Changeset 7388


Ignore:
Timestamp:
10/09/12 17:19:23 (7 years ago)
Author:
acoutinho
Message:

Ticket #3152 - Inconsistencias na delegacao em tarefas, e erros de tela

Location:
trunk/prototype/modules/calendar
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/calendar/alarms.php

    r6528 r7388  
    1212$target = (gmdate('U') - 300 ).'000'; 
    1313 
    14 $parts = Controller::service('PostgreSQL')->execSql('SELECT DISTINCT calendar_participant.user_info_id as "user", co.id as "schedulable", co.allDay as "allDay" ,co.dtend as "endTime", co.dtstart as "startTime", co.summary as "summary", co.tzid as "timezone", co.location as "location", al.id as "id" '. 
     14$parts = Controller::service('PostgreSQL')->execSql('SELECT DISTINCT calendar_participant.user_info_id as "user", co.id as "schedulable", co.type_id as "type", co.allDay as "allDay" ,co.dtend as "endTime", co.dtstart as "startTime", co.summary as "summary", co.tzid as "timezone", co.location as "location", al.id as "id" '. 
    1515                            'FROM calendar_participant, calendar_alarm as "al", calendar_object as "co", calendar_repeat as "rep" WHERE ('. 
    1616                            "al.participant_id = calendar_participant.id AND ". 
     
    6060                      'participants' =>  '<UL> <LI> '.implode( '<LI></LI> ', $attList ).'</LI> </UL>'); 
    6161 
    62         Controller::create( array( 'service' => 'SMTP' ), array( 'body' => parseTPL::load_tpl( $data, ROOTPATH.'/modules/calendar/templates/notify_alarm_body.tpl' ), 
     62        Controller::create( array( 'service' => 'SMTP' ), array( 'body' => parseTPL::load_tpl( $data, ROOTPATH.'/modules/calendar/templates/'. ($parts['type'] == '1' ? 'notify_alarm_body.tpl' : 'notify_alarm_body_task.tpl')), 
    6363                                                                  'isHtml' => true, 
    6464                                                                  'subject' => 'Alarme de Calendario', 
  • trunk/prototype/modules/calendar/js/calendar.codecs.js

    r7356 r7388  
    128128        var constantAcl = function(acl){ 
    129129            var returns = {}; 
     130 
    130131            for (var i in constantsCalendarShared){ 
    131132                returns[constantsCalendarShared[i]] = acl.indexOf(i) >= 0 ? true : false 
     
    133134            return returns; 
    134135        }; 
    135     console.log(evtObj); 
     136 
    136137        var res = $.map(evtObj, function( objEvent ){                    
    137138            return { 
     
    676677                alarms: !!participantInfo.user ? participantInfo.user.alarms : [], 
    677678                status: !!participantInfo.user ? participantInfo.user.status : 1, 
    678                 acl: constantAcl(me.acl || 'roiw'), 
     679                acl: constantAcl((me.acl && me.acl != '') ? me.acl : ((!objEvent.id || objEvent.id == '') ? 'row' : 'r')), 
    679680                isShared: isShared, 
    680681                isAttendee: (isAttendee ? true : (objEvent.id && isShared ? false : true)), 
     
    764765                    id: attendee, 
    765766                    isOrganizer: (form.attendee_organizer == attendee ? 1 : 0 ), 
    766                     isExternal: !!parseInt(form.attendeeType[i]) ? 1 : 0 
     767                    isExternal: !!parseInt(form.attendeeType[i]) ? 1 : 0, 
     768                    delegatedFrom: (form.delegatedFrom[i] != '0' && form.delegatedFrom[i] != '') ? form.delegatedFrom[i] : '0' 
    767769                    }; 
    768770            }; 
     
    868870                isExternal: attend.isExternal, 
    869871                acl: attend.acl, 
    870                 delegatedFrom: attend.delegatedFrom 
     872                delegatedFrom: attend.delegatedFrom, 
     873                isOrganizer: attend.isOrganizer 
    871874            }; 
    872875 
    873876            if(!!parseInt(attend.delegatedFrom)){ 
    874877                delegatedFrom[attend.delegatedFrom] = DataLayer.copy(person); 
    875                 return(null); 
     878 
     879                if( !!parseInt(attend.isOrganizer)){ 
     880                    participantInfo.organizer = DataLayer.copy(person); 
     881                } 
     882 
     883                return null; 
    876884            } 
    877885 
    878886            if( !!parseInt(attend.isOrganizer)){ 
    879887                participantInfo.organizer = DataLayer.copy(person); 
    880                 return(null); 
     888                return null; 
    881889            };                   
    882890 
  • trunk/prototype/modules/calendar/js/task.helpers.js

    r7356 r7388  
    845845    }); 
    846846 
    847     blkAddAtendee.find('.add-attendee-search .ui-icon-search').click(function (task) { 
     847    blkAddAtendee.find('.add-attendee-search .ui-icon-search').click(function (evt) { 
    848848        blkAddAtendee.find('.add-attendee-search input').keydown(); 
    849849    }); 
    850850 
    851     blkAddAtendee.find('.add-attendee-search input').keydown(function (task) { 
    852  
    853         if (task.keyCode == '13' || typeof (task.keyCode) == 'undefined') { 
     851    blkAddAtendee.find('.add-attendee-search input').keydown(function (evt) { 
     852 
     853        if (evt.keyCode == '13' || typeof (evt.keyCode) == 'undefined') { 
    854854            var result = DataLayer.get('user', ["*", "name", $(this).val()], true); 
    855855 
     
    867867            blkAddAtendee.find('ul.search-result-list').append(DataLayer.render(path + 'templates/participants_search_itemlist.ejs', result)); 
    868868 
    869             blkAddAtendee.find('ul.search-result-list li').click(function (task, ui) { 
    870                 if ($(task.target).is('input')) { 
    871                     old_item = $(task.target).parents('li'); 
     869            blkAddAtendee.find('ul.search-result-list li').click(function (event, ui) { 
     870                if ($(event.target).is('input')) { 
     871                    old_item = $(event.target).parents('li'); 
    872872                    newAttendeeId = DataLayer.put('participant', { 
    873873                        user: old_item.find('.id').html(), 
     
    925925            }); 
    926926 
    927             event.preventDefault(); 
     927            evt.preventDefault(); 
    928928        } 
    929929    }); 
  • trunk/prototype/modules/calendar/templates/attendee_add.ejs

    r7377 r7388  
    4343                            <%}%> 
    4444                             
    45                                 <li class="organizer <%= (data.event.acl.organization) ? "hidden" : "" %>">  
     45                                <li class="organizer <%= (data.event.acl.organization || (data.event.delegatedFrom[data.event.me.id] && data.event.delegatedFrom[data.event.me.id].isOrganizer == '1')) ? "hidden" : "" %>"> 
    4646                                        <div style="overflow:hidden; width:100%; display:table;"> 
    4747                                                <span class="space-status ui-icon <%=iconStatus[data.event.organizer.status]%>" title="<%=legendStatus[data.event.organizer.status]%>"></span> 
  • trunk/prototype/modules/calendar/templates/attendees_task.ejs

    r7356 r7388  
    1515                <%}%> 
    1616            </select> 
    17             <% if (data.task.id && !data.task.delegatedFrom[data.task.me.id]) { %> 
     17            <% if (data.task.id && !data.task.delegatedFrom[data.task.me.id] && !data.task.isOrganizer) { %> 
    1818                    <fieldset class="add-attendee-options-read"> 
    1919                            <a href="#" class="button participant-delegate add-attendee-options-button">Delegar participação a um novo participante</a> 
     
    3535                <label for="attendee" title="<%=  data.task.me.user ? data.task.me.user.mail : data.task.me.mail %>" class="mail hidden"></label> 
    3636                 
    37                 <li class="organizer <%= data.task.isOrganizer ? "hidden" : "" %>">  
     37                <li class="organizer <%= (data.task.isOrganizer || (data.task.delegatedFrom[data.task.me.id] && data.task.delegatedFrom[data.task.me.id].isOrganizer == '1')) ? "hidden" : "" %>"> 
    3838                    <div style="overflow:hidden; width:100%; display:table;"> 
    3939                        <span class="space-status ui-icon <%=iconStatus[data.task.organizer.status]%>" title="<%=legendStatus[data.task.organizer.status]%>"></span> 
  • trunk/prototype/modules/calendar/templates/notify_create_delegated_body_task.tpl

    r7350 r7388  
    1 <br />Você foi convidado por [delegatedFrom] para participar em seu lugar ns tarefa agendada para [startDate].<br /><br /> 
     1<br />Você foi convidado por [delegatedFrom] para participar em seu lugar na tarefa agendada para [startDate].<br /><br /> 
    22<strong>[eventTitle]</strong><br /> 
    33<strong>Início:</strong> [startDate] [startTime]<br /> 
Note: See TracChangeset for help on using the changeset viewer.