Changeset 7391 for branches


Ignore:
Timestamp:
10/09/12 17:56:00 (7 years ago)
Author:
eduardow
Message:

Ticket #3152 - Inconsistências na delegação em tarefas

Location:
branches/2.4/prototype/modules/calendar
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4/prototype/modules/calendar/alarms.php

    r6754 r7391  
    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', 
  • branches/2.4/prototype/modules/calendar/js/calendar.codecs.js

    r7362 r7391  
    133133            return returns; 
    134134        }; 
    135     console.log(evtObj); 
     135 
    136136        var res = $.map(evtObj, function( objEvent ){                    
    137137            return { 
     
    676676                alarms: !!participantInfo.user ? participantInfo.user.alarms : [], 
    677677                status: !!participantInfo.user ? participantInfo.user.status : 1, 
    678                 acl: constantAcl(me.acl || 'roiw'), 
     678                acl: constantAcl((me.acl && me.acl != '') ? me.acl : ((!objEvent.id || objEvent.id == '') ? 'row' : 'r')), 
    679679                isShared: isShared, 
    680680                isAttendee: (isAttendee ? true : (objEvent.id && isShared ? false : true)), 
     
    764764                    id: attendee, 
    765765                    isOrganizer: (form.attendee_organizer == attendee ? 1 : 0 ), 
    766                     isExternal: !!parseInt(form.attendeeType[i]) ? 1 : 0 
     766                    isExternal: !!parseInt(form.attendeeType[i]) ? 1 : 0,  
     767                    delegatedFrom: (form.delegatedFrom[i] != '0' && form.delegatedFrom[i] != '') ? form.delegatedFrom[i] : '0' 
    767768                    }; 
    768769            }; 
     
    868869                isExternal: attend.isExternal, 
    869870                acl: attend.acl, 
    870                 delegatedFrom: attend.delegatedFrom 
     871                delegatedFrom: attend.delegatedFrom,  
     872                isOrganizer: attend.isOrganizer 
    871873            }; 
    872874 
    873875            if(!!parseInt(attend.delegatedFrom)){ 
    874876                delegatedFrom[attend.delegatedFrom] = DataLayer.copy(person); 
    875                 return(null); 
     877                if( !!parseInt(attend.isOrganizer)){  
     878                    participantInfo.organizer = DataLayer.copy(person);  
     879                }  
     880  
     881                return null; 
    876882            } 
    877883 
    878884            if( !!parseInt(attend.isOrganizer)){ 
    879885                participantInfo.organizer = DataLayer.copy(person); 
    880                 return(null); 
     886                return null; 
    881887            };                   
    882888 
  • branches/2.4/prototype/modules/calendar/js/task.helpers.js

    r7362 r7391  
    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    }); 
  • branches/2.4/prototype/modules/calendar/templates/attendee_add.ejs

    r7382 r7391  
    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> 
  • branches/2.4/prototype/modules/calendar/templates/attendees_task.ejs

    r7362 r7391  
    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> 
  • branches/2.4/prototype/modules/calendar/templates/notify_create_delegated_body_task.tpl

    r7360 r7391  
    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.