Changeset 6880 for sandbox


Ignore:
Timestamp:
07/26/12 09:44:14 (12 years ago)
Author:
acoutinho
Message:

Ticket #2966 - Correcoes e melhorias na listagem de eventos e tarefas

Location:
sandbox/2.4.2-expresso1/prototype/modules/calendar
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/js/calendar.codecs.js

    r6876 r6880  
    511511                calendar: objEvent.calendar, 
    512512                summary: objEvent.summary, 
     513        type: !!objEvent.type ? objEvent.type : 1, 
    513514                description: objEvent.description, 
    514515                timezone: objEvent.timezone, 
     
    621622        id: form.idTask, 
    622623        location: form.location, 
    623         type: 2, 
     624        type: !!form.type ?  form.type : 2, 
    624625        percentage: form.percentage, 
    625626        priority: form.priority, 
     
    669670                    id: attendee, 
    670671                    isOrganizer: (form.attendee_organizer == attendee ? 1 : 0 ), 
    671                     isExternal: !!parseInt(form.attendeeType[i]) ? 1 : 0, 
     672                    isExternal: !!parseInt(form.attendeeType[i]) ? 1 : 0 
    672673                    }; 
    673674            }; 
     
    713714        group: objEvent.group, 
    714715        summary: objEvent.summary, 
     716        type: !!objEvent.type ? objEvent.type : 2, 
    715717        description: objEvent.description, 
    716718        timezone: objEvent.timezone, 
     
    10071009 
    10081010        var pref = User.preferences; 
    1009  
    1010         var res =  DataLayer.encode('schedulable:preview', evtObj); 
     1011    var res = []; 
     1012 
     1013    for(var i = 0; i < evtObj.length; i++){ 
     1014           res.push(DataLayer.encode('schedulable:' + (evtObj[i].type == '1' ?  'preview' : 'task'), evtObj[i])); 
     1015    } 
    10111016 
    10121017        if( !notArray ){ 
     
    10431048                        'endDate': new Date( occurrences[ii] + duration ).toString( User.preferences.dateFormat ) 
    10441049                        } ); 
    1045                                    
    1046                                    
    1047                                    
    1048                                    
    1049                     res2.repeat = typeRepeat[res[i].repeat.frequency]; 
     1050 
     1051                    if(res[i].repeat) 
     1052                res2.repeat = typeRepeat[res[i].repeat.frequency]; 
    10501053                                   
    10511054                    while (counter.compareTo( currentDate ) == 0) { 
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js

    r6876 r6880  
    23532353        } 
    23542354         
    2355     pageselectCallback(keyword, 0, false, false, type); // load page 1 and insert data on event_list.ejs 
     2355    pageselectCallback(keyword, 0, false, type); // load page 1 and insert data on event_list.ejs 
    23562356         
    23572357    $('.preferences-win.active .button.save, .preferences-win.active .button.cancel, .preferences-win.active .button.import, .preferences-win.active .button.export').button(); 
     
    23732373        if(paginator.indexOf('next') > 0){ 
    23742374            if(parseInt($(currentView+' [name = results]').val()) > 25) 
    2375                 pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($(currentView+' [name = page_index]').val())) +1)); 
     2375                pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($(currentView+' [name = page_index]').val())) +1), false,  2); 
    23762376        }else{ 
    23772377            if(parseInt($(currentView+' [name = page_index]').val()) > 0) 
    2378                 pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($(currentView+' [name = page_index]').val())) -1)); 
     2378                pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($(currentView+' [name = page_index]').val())) -1), false, 2); 
    23792379        } 
    23802380    }); 
     
    24142414} 
    24152415 
    2416 function paginatorList(currentView, view){ 
     2416function paginatorList(currentView, view, type){ 
    24172417    $(currentView+' .events-list.events-list-win.active .list-events-paginator .fc-header-title').html('<h2>'+mountTitleList( parseInt($('[name = page_index]').val()),view)+'</h2>'); 
    24182418    $(currentView+' .events-list.events-list-win.active .header-paginator .fc-header-right .fc-button').removeClass('fc-state-active') 
     
    24352435        var goView = $(this).attr('class'); 
    24362436        if(goView.indexOf('agendaDay') > 0) 
    2437             pageselectCallback($(currentView+' [name = keyword]').val(), 0, '', 'agendaDay'); 
     2437            pageselectCallback($(currentView+' [name = keyword]').val(), 0, 'agendaDay', type); 
    24382438        else if(goView.indexOf('month') > 0) 
    2439             pageselectCallback($(currentView+' [name = keyword]').val(), 0, '', 'month'); 
     2439            pageselectCallback($(currentView+' [name = keyword]').val(), 0, 'month', type); 
    24402440        else if(goView.indexOf('year') > 0) 
    2441             pageselectCallback($(currentView+' [name = keyword]').val(), 0, '', 'year'); 
     2441            pageselectCallback($(currentView+' [name = keyword]').val(), 0, 'year', type); 
    24422442        else if(goView.indexOf('agendaWeek') > 0) 
    2443             pageselectCallback($(currentView+' [name = keyword]').val(), 0, '', 'agendaWeek'); 
     2443            pageselectCallback($(currentView+' [name = keyword]').val(), 0, 'agendaWeek', type); 
    24442444 
    24452445    }); 
     
    24572457        var paginator = $(this).attr('class'); 
    24582458        if(paginator.indexOf('next') > 0) 
    2459             pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($('[name = page_index]').val())) +1), '', view); 
     2459            pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($('[name = page_index]').val())) +1), view, type); 
    24602460        else 
    2461             pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($('[name = page_index]').val())) -1), '', view); 
     2461            pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($('[name = page_index]').val())) -1), view, type); 
    24622462    });  
    24632463} 
    24642464 
    2465 function paginatorListEvent(currentView, typeView, view){ 
     2465function paginatorListEvent(currentView, typeView, view, type){ 
    24662466    if(!!$(currentView).find('.fc-calendar').length) 
    24672467        return; 
     
    24872487        paginatorSearch(currentView); 
    24882488    }else 
    2489         paginatorList(currentView, view); 
     2489        paginatorList(currentView, view, type); 
    24902490} 
    24912491 
     
    25642564} 
    25652565 
    2566 function pageselectCallback(keyword, page_index, jq, view, type){ 
     2566function pageselectCallback(keyword, page_index, view, type){ 
    25672567    $('.qtip.qtip-blue').remove(); 
    25682568         
     
    26362636 
    26372637                        }); 
    2638                         paginatorListEvent(currentView, (keyword == '' || keyword == null) ? 'list' : 'search',  !!view ? view : User.preferences.defaultCalView); 
     2638                        paginatorListEvent(currentView, (keyword == '' || keyword == null) ? 'list' : 'search',  !!view ? view : User.preferences.defaultCalView, type); 
    26392639                }); 
    26402640    }else{ 
     
    26462646                        '</div>' 
    26472647                        ); 
    2648                 paginatorListEvent(currentView, 'list', !!view ? view : User.preferences.defaultCalView); 
     2648                paginatorListEvent(currentView, 'list', !!view ? view : User.preferences.defaultCalView, type); 
    26492649    } 
    26502650} 
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/event_list.ejs

    r6857 r6880  
     1<% 
     2 
     3    var decoder = {status: {1: 'Sem ações', 2: 'Em processo', 3: 'Completo', 4: 'Cancelado'}, priority: {1: 'Alta', 2: 'Normal', 3: 'Baixa'}} 
     4 
     5%> 
     6 
    17<div title="<%=data.tab_title%>" class="events-list events-list-win active"> 
    28         
     
    4652                                                        var img_type = ""; 
    4753                                                        var title_type = ""; 
    48                                                         if(_event.type == 1){ 
     54                                                        if(_event.type == '1'){ 
    4955                                                                img_type = "../prototype/modules/calendar/img/event.png"; 
    5056                                                                title_type = "Evento"; 
    51                                                         }if(_event.type == 2){ 
     57                                                        }if(_event.type == '2'){ 
    5258                                                                img_type = "../prototype/modules/calendar/img/task.png";  
    5359                                                                title_type = "Tarefa"; 
    54                                                         }if(_event.type == 3){ 
     60                                                        }if(_event.type == '3'){ 
    5561                                                                img_type = "../prototype/modules/calendar/img/activity_icon.jpg";  
    5662                                                                title_type = "Atividade"; 
     
    105111                                                                <%if(_event.allDay){%> 
    106112                                                                        <p class="input-group date-info"> 
    107                                                                                 <label>Duração</label> 
     113                                                                                <label>Duração:</label> 
    108114                                                                                <span class="">Dia inteiro</span> 
    109115                                                                        </p> 
     
    123129                                                                        </p> 
    124130                                                                <%}%> 
    125                                                                 <%if(_event.type == 1){ 
     131                                                                <%if(_event.type == '1'){ 
    126132                                                                        if(_event.repeat ){%> 
    127133                                                                    <p class="input-group"> 
     
    131137                                                                <%}}%> 
    132138                                                                <p class="input-group"> 
    133                                                                         <label>Lembretes</label> 
     139                                                                        <label>Lembretes:</label> 
    134140                                                                        <% if(_event.alarms) {  
    135141                                                                                        var string_alarm = ""; 
    136                                                                                         if(_event.type == 1) 
     142                                                                                        if(_event.type == '1') 
    137143                                                                                                string_alarm = 'do evento';  
    138                                                                                         if(_event.type == 2) 
     144                                                                                        if(_event.type == '2') 
    139145                                                                                                string_alarm = 'da tarefa'; 
    140                                                                                         if(_event.type == 2) 
     146                                                                                        if(_event.type == '3') 
    141147                                                                                                string_alarm = 'da atividade'; 
    142148                                                                                        %> 
     
    148154                                                                        <% } %> 
    149155                                                                </p> 
    150                                                                 <%if(_event.type == 1){%> 
    151                                                                 <p class="input-group"> 
    152                                                                         <label>Local</label> 
     156                                                                <%if(_event.type == '1'){%> 
     157                                                                <p class="input-group"> 
     158                                                                        <label>Local:</label> 
    153159                                                                        <span><%= _event.location %></span> 
    154160                                                                </p> 
    155161                                                                <%}%> 
    156162                                                                <p class="input-group"> 
    157                                                                         <label>Descrição </label> 
     163                                                                        <label>Descrição:</label> 
    158164                                                                        <span class="large" ><%= _event.description %></span> 
    159165                                                                </p> 
    160                                                                 <%if(_event.type != 1){%> 
    161                                                                 <p class="input-group"> 
    162                                                                         <label>Prioridade </label> 
    163                                                                         <span><%= _event.priority %></span> 
    164                                                                 </p> 
    165                                                                 <p class="input-group"> 
    166                                                                         <label>Porcentagem de Conlusão </label> 
    167                                                                         <span><%= _event.percent %></span> 
    168                                                                 </p> 
    169                                                                 <p class="input-group"> 
    170                                                                         <label>Status </label> 
    171                                                                         <span><%= _event.status %></span> 
     166                                                                <%if(_event.type != '1'){%> 
     167                                                                <p class="input-group"> 
     168                                                                        <label>Prioridade:</label> 
     169                                                                        <span><%= decoder['priority'][_event.priority] %></span> 
     170                                                                </p> 
     171                                                                <p class="input-group"> 
     172                                                                        <label>% Conlusão:</label> 
     173                                                                        <span><%= _event.percentage %>%</span> 
     174                                                                </p> 
     175                                                                <p class="input-group"> 
     176                                                                        <label>Status:</label> 
     177                                                                        <span><%= decoder['status'][_event.status] %></span> 
    172178                                                                </p> 
    173179                                                                <% } %> 
     
    176182                                                                        <span><%= _event.privacy %></span> 
    177183                                                                </p> --> 
    178                                                                 <%if(_event.type == 1){%> 
    179                                                                 <p class="input-group"> 
    180                                                                         <label>Organizador</label> 
     184                                                                 
     185                                                                <p class="input-group"> 
     186                                                                        <label>Organizador:</label> 
    181187                                                                        <span class="large"><%= _event.organizer.user ? _event.organizer.user.name : _event.organizer.name %>  (<%= _event.organizer.user ? _event.organizer.user.mail : _event.organizer.mail %>)</span> 
    182188                                                                </p> 
    183                                                                 <%} 
    184                                                                 if(_event.type != 3){%> 
    185                                                                 <p class="input-group"> 
    186                                                                         <label>Participantes</label> 
     189 
     190                                                                <%if(_event.type != '3'){%> 
     191                                                                <p class="input-group"> 
     192                                                                        <label>Participantes:</label> 
    187193                                                                        <% if(_event.attendee) { %> 
    188194                                                                                <span class="large" > 
     
    194200                                                                </p> 
    195201                                                                <%} 
    196                                                                 if(_event.type == 3){%> 
     202                                                                if(_event.type == '3'){%> 
    197203                                                                <p class="input-group"> 
    198204                                                                        <label>Tarefas</label> 
     
    205211                                                                        <% } %> 
    206212                                                                </p> 
    207                                                                 <%} 
    208                                                                 if(_event.type == 1){%> 
    209                                                                 <p class="input-group"> 
    210                                                                         <label>Presença</label> 
     213                                                                <%}%> 
     214                                                                 
     215                                                                <p class="input-group"> 
     216                                                                        <label>Presença:</label> 
    211217                                                                        <span> 
    212                                                                             <% var status_name; 
    213                                                                                 if (_event.status == 1) 
    214                                                                                     status_name = "Eu vou"; 
    215                                                                                 else if (_event.status == 2) 
    216                                                                                     status_name = "Talvez"; 
    217                                                                                 else if (_event.status == 3) 
    218                                                                                     status_name = "Eu não vou"; 
    219                                                                             %> 
    220                                                                             <%= status_name %> 
    221                                                                         </span> <!-- Ta hardcodificado isso aqui? --> 
    222                                                                 </p> 
    223                                                                 <%}%> 
     218                                        <% var status_name; 
     219                                            if (_event.status == 1) 
     220                                                status_name = "Eu vou"; 
     221                                            else if (_event.status == 2) 
     222                                                status_name = "Talvez"; 
     223                                            else if (_event.status == 3) 
     224                                                status_name = "Eu não vou"; 
     225                                        %> 
     226                                        <%= status_name %> 
     227                                    </span> <!-- Ta hardcodificado isso aqui? --> 
     228                                                                </p> 
     229 
    224230                                                        </fieldset> 
    225231                                                        <div class="menu-container footer-container"> 
Note: See TracChangeset for help on using the changeset viewer.