Ignore:
Timestamp:
08/09/12 12:25:44 (12 years ago)
Author:
acoutinho
Message:

Ticket #2966 - Correcoes de bugs e melhorias / suporte a historico em atividades

File:
1 edited

Legend:

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

    r6968 r6974  
    626626        priority: form.priority, 
    627627        category: form.category, 
    628         summary: form.summary, 
     628        summary: form.summary == '' ? 'Tarefa sem título' : form.summary, 
    629629        description: form.description, 
    630630        timezone: tzId, 
     
    827827            case 'due': 
    828828                return { 
    829                     user : historic.user, 
     829                    user :$.type(historic.user) == 'object' ? historic.user : DataLayer.get('user', historic.user), 
    830830                    attribute : attributeDecoded[historic.attribute], 
    831831                    beforeValue : decodeDate(historic.beforeValue), 
     
    836836            case 'participant': 
    837837                return{ 
    838                     user : historic.user, 
     838                    user :$.type(historic.user) == 'object' ? historic.user : DataLayer.get('user', historic.user), 
    839839                    attribute : historic.beforeValue == '' ? ('Novo participante') : ('Rem. participante'), 
    840840                    beforeValue : historic.beforeValue == '' ? '' : historic.beforeValue.mail, 
     
    845845            case 'attachment': 
    846846                return{ 
    847                     user : historic.user, 
     847                    user : $.type(historic.user) == 'object' ? historic.user : DataLayer.get('user', historic.user), 
    848848                    attribute : historic.beforeValue == '' ? ('Novo anexo') : ('Rem. anexo'), 
    849849                    beforeValue : historic.beforeValue, 
     
    853853            case 'percentage': 
    854854                    return{ 
    855                     user : historic.user, 
     855                    user :$.type(historic.user) == 'object' ? historic.user : DataLayer.get('user', historic.user), 
    856856                    attribute :attributeDecoded[historic.attribute], 
    857857                    beforeValue : historic.beforeValue+' %', 
     
    862862            default: 
    863863                return { 
    864                     user : historic.user, 
     864                    user : $.type(historic.user) == 'object' ? historic.user : DataLayer.get('user', historic.user), 
    865865                    attribute : attributeDecoded[historic.attribute], 
    866866                    beforeValue : historic.beforeValue, 
     
    929929     
    930930        var tzId =  form.timezone || Calendar.signatureOf[form.group].calendar.timezone || User.preferences.timezone, 
    931  
    932931        formatString = pref.dateFormat + " " + pref.hourFormat; 
    933932 
     
    969968        priority: form.priority, 
    970969        category: form.category, 
    971         summary: form.summary, 
     970        summary: form.summary == '' ? 'Atividade sem título' : form.summary, 
    972971        description: form.description, 
    973972        timezone: tzId, 
     
    10031002        if(!(typeof(objEvent) == 'object')) 
    10041003            return (null); 
     1004         
     1005        var historic = []; 
    10051006 
    10061007        var decodeTasks = function(obj){ 
     
    10251026                    endDate: new Date( parseInt(task.endTime) - (!!parseInt(task.allDay) ? 86400000 : 0)  ).setTimezoneOffset( Timezone.timezone( task.timezone ) ).toString( User.preferences.dateFormat ), 
    10261027                    endHour: dateCalendar.formatDate(Timezone.getDateEvent(new Date(parseInt(task.endTime)),  task.timezone, obj.calendar, obj.DayLigth, 'endTime'), User.preferences.hourFormat), 
    1027                                         status: task.status, 
    1028                                         percentage: task.percentage 
     1028                    status: task.status, 
     1029                    percentage: task.percentage 
    10291030                } 
    10301031 
    10311032                tasks[task.id].description = tasks[task.id].startDate + ' - ' + (!!task.summary ? task.summary : task.description); 
    10321033 
     1034                historic.push({'task': (!!task.summary ? task.summary : task.description) , 'historic': decodeHistotic(task)}); 
    10331035            } 
    10341036 
     
    10601062        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), 
    10611063        allDay: !!parseInt( objEvent.allDay ), 
    1062         historic: [], 
     1064        historic: historic, 
    10631065        tasks: objEvent.taskToActivity ? decodeTasks(objEvent) : {}, 
    10641066        attachments: $.map(objEvent.attachments || [], function( attachment, i ){ 
     
    12261228                type: 1, 
    12271229                category: form.category, 
    1228                 summary: form.summary, 
     1230                summary: form.summary == '' ? 'Evento sem título' : form.summary, 
    12291231                description: form.description, 
    12301232                timezone: tzId, 
     
    14351437                if(!dates[index] || !$.isArray(dates[index].events)) 
    14361438                    dates[index] = {events:  []};                     
     1439 
     1440                res2['isOneDay'] = duration <= 86400000 ? true : false; 
    14371441 
    14381442                dates[index].events.push(res2); 
Note: See TracChangeset for help on using the changeset viewer.