Changeset 6954


Ignore:
Timestamp:
08/07/12 12:06:34 (7 years ago)
Author:
douglasz
Message:

Ticket #2966 - Adicionado as validacoes na tela de atividades.

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

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/css/style.css

    r6946 r6954  
    144144  font-size: 150%; 
    145145  font-weight: bold; 
    146   width: 64%; 
     146  width: 100%; 
    147147  height: 150%; 
    148148} 
     
    591591/*Atividades*/ 
    592592 
    593 .div-addactivity #calendar_addactivity_details5 .button-files-upload { margin: 0 0 0 5px; } 
    594 .div-addactivity #calendar_addactivity_details1 .h1{ width: 100%;} 
    595 .div-addactivity #calendar_addactivity_details2 textarea { width: 635px; } 
    596593.div-addactivity{ width: 734px;} 
    597 .div-addactivity #calendar_addactivity_details1 .time-previsao { width: 40px; } 
    598 .div-addactivity #calendar_addactivity_details1 .date-previsao{ width: 80px; } 
    599  
    600 .div-addactivity #calendar_addactivity_details1 .start-time{ width: 40px; } 
    601 .div-addactivity #calendar_addaActivity_details1 .start-date{ width: 80px; } 
    602 .div-addactivity #calendar_addactivity_details1 .end-time{ width: 40px; } 
    603 .div-addactivity #calendar_addactivity_details1 .end-date{ width: 80px; } 
    604 .div-addactivity #calendar_addactivity_details1 .previsao-termino { margin: 0 0 0 50px; } 
    605 .div-addactivity #calendar_addactivity_details1 .subitem { margin: 5px; display: block;} 
    606 .div-addactivity #calendar_addactivity_details1 .subitem .span_done{ margin: 0 30px;} 
    607 .div-addactivity #calendar_addactivity_details1 .calendar_addevent_details_lnk_timezone { margin: 0 0 0 20px;} 
    608 .div-addactivity #calendar_addactivity_details1 .subitem .done { width: 45px;} 
     594.div-addactivity #group_addactivity_details1 .h1{ width: 100%;} 
     595.div-addactivity #group_addactivity_details2 textarea { width: 635px; } 
     596.div-addactivity #group_addactivity_details1 .time-previsao { width: 40px; } 
     597.div-addactivity #group_addactivity_details1 .date-previsao{ width: 80px; } 
     598 
     599.div-addactivity #group_addactivity_details1 .start-time{ width: 40px; } 
     600.div-addactivity #group_addactivity_details1 .start-date{ width: 80px; } 
     601.div-addactivity #group_addactivity_details1 .end-time{ width: 40px; } 
     602.div-addactivity #group_addactivity_details1 .end-date{ width: 80px; } 
     603.div-addactivity #group_addactivity_details1 .previsao-termino { margin: 0 0 0 50px; } 
     604.div-addactivity #group_addactivity_details1 .subitem { margin: 5px; display: block;} 
     605.div-addactivity #group_addactivity_details1 .subitem .span_done{ margin: 0 30px;} 
     606.div-addactivity #group_addactivity_details1 .calendar_addevent_details_lnk_timezone { margin: 0 0 0 20px;} 
     607.div-addactivity #group_addactivity_details1 .subitem .done { width: 45px;}  
     608 
     609.div-addactivity #group_addactivity_details1 .subitem .span_done.noAction{background-image: url("../img/gray.png"); background-repeat: no-repeat; } 
     610.div-addactivity #group_addactivity_details1 .subitem .span_done.inProcess{background-image: url("../img/yellow.png"); background-repeat: no-repeat;} 
     611.div-addactivity #group_addactivity_details1 .subitem .span_done.finished{background-image: url("../img/green.png"); background-repeat: no-repeat;} 
     612.div-addactivity #group_addactivity_details1 .subitem .span_done.canceled{background-image: url("../img/red.png"); background-repeat: no-repeat;} 
     613.div-addactivity #group_addactivity_details1 .subitem .span_done label{position: relative; left: 28px;} 
     614 
     615.div-addactivity #group_addactivity_details5.tab-level2{margin-top: 2px;} 
     616.div-addactivity #group_addactivity_details5 .button-files-upload { margin: 0 0 0 5px; } 
    609617 
    610618.div-addactivity  #group_addactivity_details6 .parent {width: 680px; min-height: 268px; float: left;} 
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/js/activity.helpers.js

    r6951 r6954  
    1919        var dueDate = new Date; 
    2020        var percentage = 0; 
    21  
    22         var allDay = true; 
     21                 
     22                var allDay = true; 
    2323 
    2424        var formatString =  User.preferences.dateFormat + " " +  User.preferences.hourFormat; 
     
    5252            if(i == 'length') 
    5353                continue; 
    54  
     54                                 
     55                        var statusActivity = tasks[i].status ; 
    5556            stTime = Date.parseExact( tasks[i].startDate + " "+$.trim( tasks[i].startHour) , formatString); 
    5657            enTime = Date.parseExact( tasks[i].endDate + " "+$.trim( tasks[i].endHour), formatString ); 
     
    6768                percentage += parseInt((100 / tasks.length)) * ( parseInt(tasks[i].percentage) / 100); 
    6869        } 
    69  
     70                 
     71                todoStatus('addActivity', (statusActivity != undefined) ? statusActivity : 1); 
     72                 
     73                UI.dialogs.addActivity.find('select[name="activityStatus"] option[value="'+statusActivity+'"]').attr('selected','selected'); 
     74                 
    7075        dueDate = dueDate.compareTo(endDate) == -1 ? endDate : dueDate; 
    7176 
     
    355360/*Seleciona a agenda padrão para visualização/edição de um evento*/ 
    356361if(objActivity.id) 
    357     UI.dialogs.addActivity.find('option[value="'+objActivity.group+'"]').attr('selected','selected').trigger('change'); 
     362    UI.dialogs.addActivity.find('select[name="group"] option[value="'+objActivity.group+'"]').attr('selected','selected').trigger('change'); 
    358363 
    359364UI.dialogs.addActivity.find('.button').button(); 
     
    363368        } 
    364369}); 
     370 
     371todoStatus('addActivity', (objActivity.activityStatus != undefined) ? objActivity.activityStatus : 1); 
    365372 
    366373// ==== validation events ==== 
     
    487494                    dueTime: old_item.find('[name="taskDueTime"]').val(), 
    488495                    allDay: old_item.find('[name="taskAllDay"]').val(), 
    489                     percentage: old_item.find('[name="taskPercentage"]').val() 
     496                    percentage: old_item.find('[name="taskPercentage"]').val(), 
     497                    status: old_item.find('[name="taskStatus"]').val() 
    490498                }; 
    491499 
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/js/calendar.codecs.js

    r6951 r6954  
    831831            dueTime: (!objEvent.due || objEvent.due == '' || objEvent.due == '0') ? '' : dateCalendar.formatDate(Timezone.getDateEvent(new Date( parseInt(objEvent.due)), objEvent.timezone, objEvent.calendar, objEvent.DayLigth, 'startTime'), User.preferences.hourFormat), 
    832832            allDay: !!parseInt( objEvent.allDay ), 
    833             percentage: (objEvent.percentage) ? objEvent.percentage : '0' 
     833            percentage: (objEvent.percentage) ? objEvent.percentage : '0', 
     834                        status: objEvent.status 
    834835        } 
    835836    }); 
     
    885886        due: (form.dueDate == '' )? 0 : Date.parseExact(form.dueDate + " "+$.trim(form.dueHour) , formatString ).toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00'), 
    886887        allDay: ( !!form.allDay ? 1 : 0 ),       
    887         status: form.taskStatus,       
     888        status: form.activityStatus,       
    888889        id: form.idActivity, 
    889890        type: !!form.type ?  form.type : 2, 
     
    946947                    startHour: dateCalendar.formatDate(Timezone.getDateEvent(new Date( parseInt(task.startTime)), task.timezone, task.calendar, obj.DayLigth, 'startTime'), User.preferences.hourFormat), 
    947948                    endDate: new Date( parseInt(task.endTime) - (!!parseInt(task.allDay) ? 86400000 : 0)  ).setTimezoneOffset( Timezone.timezone( task.timezone ) ).toString( User.preferences.dateFormat ), 
    948                     endHour: dateCalendar.formatDate(Timezone.getDateEvent(new Date(parseInt(task.endTime)),  task.timezone, obj.calendar, obj.DayLigth, 'endTime'), User.preferences.hourFormat) 
     949                    endHour: dateCalendar.formatDate(Timezone.getDateEvent(new Date(parseInt(task.endTime)),  task.timezone, obj.calendar, obj.DayLigth, 'endTime'), User.preferences.hourFormat), 
     950                                        status: task.status, 
     951                                        percentage: task.percentage 
    949952                } 
    950953 
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/js/task.helpers.js

    r6951 r6954  
    8686    return false; 
    8787} 
    88 function taskStatus(status){ 
     88 
     89function todoStatus(view, status){ 
    8990        if (status == "1"){ 
    90                 UI.dialogs.addTask.find('.subitem .span_done').removeClass('finished noAction inProcess canceled').addClass('noAction'); 
     91                UI.dialogs[view].find('.subitem .span_done').removeClass('finished noAction inProcess canceled').addClass('noAction'); 
    9192        }else if (status == "2"){ 
    92                 UI.dialogs.addTask.find('.subitem .span_done').removeClass('finished noAction inProcess canceled').addClass('inProcess'); 
     93                UI.dialogs[view].find('.subitem .span_done').removeClass('finished noAction inProcess canceled').addClass('inProcess'); 
    9394        }else if (status == "3"){ 
    94                 UI.dialogs.addTask.find('.subitem .span_done').removeClass('finished noAction inProcess canceled').addClass('finished'); 
     95                UI.dialogs[view].find('.subitem .span_done').removeClass('finished noAction inProcess canceled').addClass('finished'); 
    9596        }else if (status == "4"){ 
    96                 UI.dialogs.addTask.find('.subitem .span_done').removeClass('finished noAction inProcess canceled').addClass('canceled'); 
     97                UI.dialogs[view].find('.subitem .span_done').removeClass('finished noAction inProcess canceled').addClass('canceled'); 
    9798        } 
    9899} 
     
    374375    }); 
    375376         
    376         if (objTask.taskStatus == "1" || objTask.taskStatus == undefined){ 
    377                 taskStatus(1); 
    378         }else if (objTask.taskStatus == "2"){ 
    379                 taskStatus(2); 
    380         }else if (objTask.taskStatus == "3"){ 
    381                 taskStatus(3); 
    382         }else if (objTask.taskStatus == "4"){ 
    383                 taskStatus(4); 
    384         } 
     377        todoStatus('addTask', (objTask.taskStatus  != undefined) ? objTask.taskStatus  : 1); 
    385378         
    386         //Concluão das Tarefas 
     379        //Conclusão das Tarefas 
    387380        var conclusionTask = function(e){ 
    388381                var percentageTask = UI.dialogs.addTask.find('input[name="percentage"]'); 
     
    396389                if(percentageValue <= 0){ 
    397390                        statusTask.find('option.taskStatus-noAction').attr('selected', 'selected'); 
    398                         taskStatus(1);           
     391                        todoStatus('addTask', 1);                
    399392                }else if(percentageValue == 100){ 
    400393                        statusTask.find('option.taskStatus-finished').attr('selected', 'selected'); 
    401                         taskStatus(3); 
     394                        todoStatus('addTask', 3); 
    402395                }else{ 
    403396                        statusTask.find('option.taskStatus-inProcess').attr('selected', 'selected'); 
    404                         taskStatus(2); 
     397                        todoStatus('addTask', 2); 
    405398                }                
    406399                setTimeout(function(){ 
     
    415408                var statusSelected = $('select[name=taskStatus] option:selected').val(); 
    416409                var percentageTask = UI.dialogs.addTask.find('input[name="percentage"]'); 
     410                 
    417411                if (statusSelected == "1"){ 
    418412                        percentageTask.val(0); 
    419                         taskStatus(1); 
    420413                }else if(statusSelected == "2"){ 
    421414                        percentageTask.val(percentageTask.val() != 0 ? (percentageTask.val() == 100 ? 99: percentageTask.val()) : 1); 
    422                         taskStatus(2); 
    423415                }else if(statusSelected == "3"){ 
    424416                        percentageTask.val(100); 
    425                         taskStatus(3); 
    426417                }else if(statusSelected == "4"){ 
    427418                        percentageTask.val(percentageTask.val() != 100 ? percentageTask.val() : 99); 
    428                         taskStatus(4); 
    429419                } 
     420                todoStatus('addTask', statusSelected); 
    430421        }); 
    431422         
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/activity_add.ejs

    r6945 r6954  
    6464                    <option <%= (data.activity.priority == '3') ? 'selected="selected"' : '' %> value="3">Baixa</option> 
    6565                </select> 
    66                 <span class="span_done"><img src="../prototype/modules/calendar/img/empty-status.png"/> Completo<span> 
     66                <span class="span_done"><label>Completo</label></span> 
    6767        </div> 
    6868        </fieldset> 
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_search_itemlist.ejs

    r6945 r6954  
    1010    <input type="hidden" name="taskDueTime" value="<%=data[i]['dueTime']%>" /> 
    1111    <input type="hidden" name="taskAllDay" value="<%=data[i]['allDay']%>" /> 
     12    <input type="hidden" name="taskStatus" value="<%=data[i]['status']%>" /> 
    1213    <input type="hidden" name="taskPercentage" value="<%=data[i]['percentage']%>" /> 
    1314    <label class="description"><%=data[i]['startDate']%> - <%=data[i]['description']%></label> 
Note: See TracChangeset for help on using the changeset viewer.