Changeset 5547


Ignore:
Timestamp:
02/24/12 15:09:26 (12 years ago)
Author:
douglasz
Message:

Ticket #2486 - Atualizado o arquivo setup correções no salvamento de sinalizadores

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/setup/setup.inc.php

    r5298 r5547  
    1212        $setup_info['expressoMail1_2']['name']          = 'expressoMail1_2'; 
    1313        $setup_info['expressoMail1_2']['title']         = 'Expresso Mail'; 
    14         $setup_info['expressoMail1_2']['version']       = '2.4.0'; 
     14        $setup_info['expressoMail1_2']['version']       = '2.4.1'; 
    1515        $setup_info['expressoMail1_2']['app_order']     = 2; 
    1616        $setup_info['expressoMail1_2']['tables'][]              = 'phpgw_expressomail_contacts'; 
    1717    $setup_info['expressoMail1_2']['tables'][]          = 'phpgw_certificados'; 
     18         
     19        $setup_info['expressoMail1_2']['tables'][]              = 'expressomail_label'; 
     20        $setup_info['expressoMail1_2']['tables'][]              = 'expressomail_followupflag'; 
     21        $setup_info['expressoMail1_2']['tables'][]              = 'expressomail_message_followupflag'; 
     22         
    1823        $setup_info['expressoMail1_2']['enable']        = 1; 
    1924 
  • trunk/expressoMail1_2/setup/tables_current.inc.php

    r1035 r5547  
    3333            'ix' => array(), 
    3434            'uc' => array() 
     35                ), 
     36                 
     37                'expressomail_label' => array( 
     38                        'fd' => array( 
     39                                'id' => array('type' => 'auto','nullable' => False), 
     40                                'user_id' => array('type' => 'int', 'precision' => '8','nullable' => true), 
     41                                'name' => array('type' => 'varchar','precision' => '255','nullable' => true), 
     42                                'border_color' => array('type' => 'varchar','precision' => '7','nullable' => true), 
     43                                'background_color' => array('type' => 'varchar','precision' => '7','nullable' => true), 
     44                                'font_color' => array('type' => 'varchar','precision' => '7','nullable' => true) 
     45                        ), 
     46                        'pk' => array('id'), 
     47                        'fk' => array(), 
     48                        'ix' => array(), 
     49                        'uc' => array() 
     50                ), 
     51 
     52                'expressomail_followupflag' => array( 
     53                        'fd' => array( 
     54                                'id' => array('type' => 'auto','nullable' => False), 
     55                                'user_id' => array('type' => 'int', 'precision' => '8','nullable' => true), 
     56                                'name' => array('type' => 'varchar','precision' => '255','nullable' => False) 
     57                        ), 
     58                        'pk' => array('id'), 
     59                        'fk' => array(), 
     60                        'ix' => array(), 
     61                        'uc' => array() 
     62                ), 
     63         
     64                'expressomail_message_followupflag' => array( 
     65                        'fd' => array( 
     66                                'id' => array('type' => 'auto','nullable' => False), 
     67                                'followupflag_id' => array('type' => 'int', 'precision' => '8','nullable' => False),                                     
     68                                'border_color' => array('type' => 'varchar','precision' => '7','nullable' => true), 
     69                                'background_color' => array('type' => 'varchar','precision' => '7','nullable' => true), 
     70                                'font_color' => array('type' => 'varchar','precision' => '7','nullable' => true), 
     71                                'alarm_deadline' => array('type' => 'timestamp', 'nullable' => true), 
     72                                'done_deadline' => array('type' => 'timestamp', 'nullable' => true), 
     73                                'is_done' => array('type' => 'int', 'precision' => '8','nullable' => true) 
     74                        ), 
     75                        'pk' => array('id'), 
     76                        'fk' => array(), 
     77                        'ix' => array(), 
     78                        'uc' => array() 
     79                        ) 
    3580                ) 
     81                 
    3682        ); 
    3783?> 
  • trunk/expressoMail1_2/setup/tables_update.inc.php

    r5311 r5547  
    141141            return $setup_info['expressoMail1_2']['currentver'];  
    142142        } 
     143        $test[] = '2.4.0'; 
     144        function expressoMail1_2_upgrade2_4_0() { 
     145        $oProc = $GLOBALS['phpgw_setup']->oProc;             
     146            $oProc->CreateTable('expressomail_label',array( 
     147                                'fd' => array( 
     148                                        'id' => array('type' => 'auto','nullable' => False), 
     149                                        'user_id' => array('type' => 'int', 'precision' => '8','nullable' => true), 
     150                                        'name' => array('type' => 'varchar','precision' => '255','nullable' => true), 
     151                                        'border_color' => array('type' => 'varchar','precision' => '7','nullable' => true), 
     152                                        'background_color' => array('type' => 'varchar','precision' => '7','nullable' => true), 
     153                                        'font_color' => array('type' => 'varchar','precision' => '7','nullable' => true) 
     154                                ), 
     155                                'pk' => array('id'), 
     156                                'fk' => array(), 
     157                                'ix' => array(), 
     158                                'uc' => array() 
     159                                ) 
     160                        ); 
     161                        $oProc->CreateTable('expressomail_followupflag',array( 
     162                                'fd' => array( 
     163                                        'id' => array('type' => 'auto','nullable' => False), 
     164                                        'user_id' => array('type' => 'int', 'precision' => '8','nullable' => true), 
     165                                        'name' => array('type' => 'varchar','precision' => '255','nullable' => False) 
     166                                ), 
     167                                'pk' => array('id'), 
     168                                'fk' => array(), 
     169                                'ix' => array(), 
     170                                'uc' => array() 
     171                                ) 
     172                        ); 
     173                        $oProc->CreateTable('expressomail_message_followupflag',array( 
     174                                'fd' => array( 
     175                                        'id' => array('type' => 'auto','nullable' => False), 
     176                                        'followupflag_id' => array('type' => 'int', 'precision' => '8','nullable' => False),                                     
     177                                        'border_color' => array('type' => 'varchar','precision' => '7','nullable' => true), 
     178                                        'background_color' => array('type' => 'varchar','precision' => '7','nullable' => true), 
     179                                        'font_color' => array('type' => 'varchar','precision' => '7','nullable' => true), 
     180                                        'alarm_deadline' => array('type' => 'timestamp', 'nullable' => true), 
     181                                        'done_deadline' => array('type' => 'timestamp', 'nullable' => true), 
     182                                        'is_done' => array('type' => 'int', 'precision' => '8','nullable' => true) 
     183                                ), 
     184                                'pk' => array('id'), 
     185                                'fk' => array(), 
     186                                'ix' => array(), 
     187                                'uc' => array() 
     188                                ) 
     189                        );                       
     190                        $oProc->query("ALTER TABLE expressomail_message_followupflag ADD CONSTRAINT expressomail_message_followupflag_followupflag_id_fkey FOREIGN KEY (followupflag_id) REFERENCES expressomail_followupflag (id);"); 
     191                        $oProc->query("INSERT INTO expressomail_followupflag(name) VALUES ('Follow up'), ('Read'), ('Forward'), ('Answer'), ('Don''t forward'), ('Don''t answer');"); 
     192                         
     193                        //Insert reservados para as labels padrões referentes ao thunderbir 
     194                        $oProc->query("INSERT INTO expressomail_label(name, font_color, border_color, background_color) VALUES ('Important', '#ff0000', '#ff0000', '#ffffff');");  
     195                        $oProc->query("INSERT INTO expressomail_label(name, font_color, border_color, background_color) VALUES ('Work', '#ff9900', '#ff9900', '#ffffff');");  
     196                        $oProc->query("INSERT INTO expressomail_label(name, font_color, border_color, background_color) VALUES ('personal', '#009900', '#009900', '#ffffff');");  
     197                        $oProc->query("INSERT INTO expressomail_label(name, font_color, border_color, background_color) VALUES ('todo', '#3333ff', '#3333ff', '#ffffff');");  
     198                        $oProc->query("INSERT INTO expressomail_label(name, font_color, border_color, background_color) VALUES ('later', '#993399', '#993399', '#ffffff');"); 
     199                                                 
     200                $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '2.4.1'; 
     201        return $GLOBALS['setup_info']['expressoMail1_2']['currentver']; 
     202        }        
    143203?> 
  • trunk/prototype/modules/mail/css/label.css

    r5537 r5547  
    9595} 
    9696#MyMarckersList.list-label .status-list-labels{display:inline-block; position: absolute;} 
    97 #MyMarckersList.list-label ul {height: 60%; margin: 5px 0 0 6px; padding:0; list-style:none; } 
     97#MyMarckersList.list-label ul {height: auto; margin: 5px 0 0 6px; padding:0; list-style:none; } 
    9898#MyMarckersList.list-label.acc-list ul li{ border-radius:3px;  padding:2px 2px 3px 2px;} 
    9999#MyMarckersList.list-label li{ background: #FFF; margin:2px 2px 0 12px; border:1px solid #CCC; width: 150px; height:13px; } 
  • trunk/prototype/modules/mail/js/followupflag.js

    r5533 r5547  
    279279                        var messageNumber   = selectedMessageIds[i]; 
    280280                        //var followupflag = DataLayer.get('followupflag', followupflagId.toString()), 
    281                         var followupflagged = { 
     281                        var idFollowupflagged = winElement.find('.id-followup').val(); 
     282                        var followupflagged = DataLayer.merge({ 
    282283                                uid : User.me.id, 
    283284                                followupflagId : followupflagId,  
     
    288289                                isDone: isDone, 
    289290                                backgroundColor : backgroundColor 
    290                         } 
     291                        }, !!idFollowupflagged ? {id: idFollowupflagged} : {}); 
    291292                         
    292293                        if (alarmDate = winElement.find('[name="alarmDate"]').datepicker("getDate")) { 
     
    304305                        } 
    305306                         
     307                        var flagged = $('#td_message_followup_' + messageNumber + ', ' + '#td_message_followup_search_' + messageNumber).find(".flag-edited"); 
    306308                        if(isDone){ 
    307                                 $('#td_message_followup_' + messageNumber + ', ' +  
    308                                 '#td_message_followup_search_' + messageNumber).find(".flag-edited") 
    309                                 .find("img").attr("src", "../prototype/modules/mail/img/flagChecked.png") 
    310                                 .css("margin-left","-3px"); 
     309                                flagged.find("img").attr("src", "../prototype/modules/mail/img/flagChecked.png").css("margin-left","-3px"); 
     310                        }else{ 
     311                                flagged.find("img").attr("src", "../prototype/modules/mail/img/flagEditor.png").css("margin-left","0");                  
    311312                        } 
    312313                         
     
    316317                        DataLayer.put('followupflagged', followupflagged); 
    317318                } 
    318                 DataLayer.commit(); 
     319                DataLayer.commit(false, false, function(data){ 
     320                        followupflags = DataLayer.get('followupflagged',{criteria:{order: 'id'}}, true);                 
     321                        var id = followupflags[followupflags.length - 1].id; 
     322                        winElement.find('.id-followup').val(id); 
     323                });              
    319324                 
    320325                //onceOpenedHeadersMessages[current_folder][followupflagged.messageNumber]['followupflagged']['followupflag'] = {}; 
     
    335340                        var messageNumber   = selectedMessageIds[i]; 
    336341                        var flag_id = onceOpenedHeadersMessages[current_folder][messageNumber]['followupflagged'].id; 
     342                        var flagged = $('#td_message_followup_' + messageNumber + ', ' + '#td_message_followup_search_' + messageNumber).find(".flag-edited"); 
    337343                        DataLayer.remove('followupflagged', flag_id); 
    338                         $('#td_message_followup_' + messageNumber + ', ' +  
    339                           '#td_message_followup_search_' + messageNumber).find(".flag-edited").css("background", '#CCC'); 
    340                         $('#td_message_followup_' + messageNumber + ', ' +  
    341                                 '#td_message_followup_search_' + messageNumber).find(".flag-edited") 
    342                                 .find("img").attr("src", "../prototype/modules/mail/img/flagEditor.png").css("margin-left","0");; 
     344                        flagged.css("background", '#cccccc'); 
     345                        flagged.find("img").attr("src", "../prototype/modules/mail/img/flagEditor.png").css("margin-left","0"); 
    343346                } 
    344347                DataLayer.commit(); 
  • trunk/prototype/modules/mail/js/label.js

    r5537 r5547  
     1function configureLabel(event, ui){ 
     2        var idmarkernow = $(this).find('[name="labelItemId"]').val(); 
     3        winElement.find('.edit-label').val(idmarkernow); 
     4        winElement.find('.input-nome').val($(this).find("span").text()); 
     5         
     6        var colorpicker = winElement.find('.lebals-colorpicker'); 
     7        colorpicker.find('input[name="backgroundColor"]').val(rgb2hex($(this).css("backgroundColor"))) 
     8        .css("background-color", $(this).css("backgroundColor")).focus().end() 
     9        .find('input[name="fontColor"]').val(rgb2hex($(this).css("color"))).css("background-color", $(this).css("color")).focus().end() 
     10        .find('input[name="borderColor"]').val(rgb2hex($(this).css("border-left-color"))).css("background-color", $(this).css("border-left-color")).focus().end() 
     11        .find('.preview-label-outer').css({ 
     12                'background-color':$(this).css("backgroundColor"), 
     13                'color':$(this).css("color"), 
     14                'border-color':$(this).css("border-left-color") 
     15        })               
     16        winElement.find(".preview-label-inner").text($(this).text()); 
     17} 
    118function editLabel(){    
    219        var conteudoSpan = $(this).parent().find(".text-list").text(); 
     
    4360  ("0" + parseInt(rgb[3],10).toString(16)).slice(-2); 
    4461} 
    45 function configureLabel(event, ui){ 
    46         var idmarkernow = $(this).find('[name="labelItemId"]').val(); 
    47         winElement.find('.edit-label').val(idmarkernow); 
    48         winElement.find('.input-nome').val($(this).find("span").text()); 
    49          
    50         var colorpicker = winElement.find('.lebals-colorpicker'); 
    51         colorpicker.find('input[name="backgroundColor"]').val(rgb2hex($(this).css("backgroundColor"))) 
    52         .css("background-color", $(this).css("backgroundColor")).focus().end() 
    53         .find('input[name="fontColor"]').val(rgb2hex($(this).css("color"))).css("background-color", $(this).css("color")).focus().end() 
    54         .find('input[name="borderColor"]').val(rgb2hex($(this).css("border-left-color"))).css("background-color", $(this).css("border-left-color")).focus().end() 
    55         .find('.preview-label-outer').css({ 
    56                 'background-color':$(this).css("backgroundColor"), 
    57                 'color':$(this).css("color"), 
    58                 'border-color':$(this).css("border-left-color") 
    59         })               
    60         winElement.find(".preview-label-inner").text($(this).text()); 
    61 } 
     62 
    6263function confirmDelete(id){ 
    6364        $.Zebra_Dialog('<strong>Deseja excluir esse marcador?</strong>', { 
     
    112113        }                
    113114} 
    114 function new_label(nameLabel){ 
     115function new_label(nameLabel, isNew){ 
    115116        var labelCreated = { 
    116117                uid: User.me.id, 
    117118                name : nameLabel, 
    118                 backgroundColor : winElement.find("input[name='backgroundColor']").val(), 
    119                 fontColor : winElement.find("input[name='fontColor']").val(), 
    120                 borderColor : winElement.find("input[name='borderColor']").val() 
     119                backgroundColor : !!isNew ? '#ebebeb' : winElement.find("input[name='backgroundColor']").val(), 
     120                fontColor : !!isNew ? '#000000' : winElement.find("input[name='fontColor']").val(), 
     121                borderColor :!!isNew ? '#000000' : winElement.find("input[name='borderColor']").val() 
    121122        } 
    122123        DataLayer.put('label', labelCreated); 
     
    132133                        name : labels[labels.length- 1].name, 
    133134                        uid: User.me.id, 
    134                         bgColor : winElement.find("input[name='backgroundColor']").val(), 
    135                         fontColor : winElement.find("input[name='fontColor']").val(), 
    136                         borderColor : winElement.find("input[name='borderColor']").val() 
     135                        bgColor : !!isNew ? '#ebebeb' : winElement.find("input[name='backgroundColor']").val(), 
     136                        fontColor : !!isNew ? '#000000' : winElement.find("input[name='fontColor']").val(), 
     137                        borderColor : !!isNew ? '#000000' : winElement.find("input[name='borderColor']").val() 
    137138                }; 
    138139 
     
    197198 
    198199        winElement = data.window; 
    199  
    200         /* var configureLabel = function(event, ui){ 
    201                 var idmarkernow = $(this).find('[name="labelItemId"]').val(); 
    202                 winElement.find('.edit-label').val(idmarkernow); 
    203                 winElement.find('.input-nome').val($(this).find("span").text()); 
    204                  
    205                 var colorpicker = winElement.find('.lebals-colorpicker'); 
    206                 colorpicker.find('input[name="backgroundColor"]').val(rgb2hex($(this).css("backgroundColor"))) 
    207                 .css("background-color", $(this).css("backgroundColor")).focus().end() 
    208                 .find('input[name="fontColor"]').val(rgb2hex($(this).css("color"))).css("background-color", $(this).css("color")).focus().end() 
    209                 .find('input[name="borderColor"]').val(rgb2hex($(this).css("border-left-color"))).css("background-color", $(this).css("border-left-color")).focus().end() 
    210                 .find('.preview-label-outer').css({ 
    211                         'background-color':$(this).css("backgroundColor"), 
    212                         'color':$(this).css("color"), 
    213                         'border-color':$(this).css("border-left-color") 
    214                 })               
    215                 winElement.find(".preview-label-inner").text($(this).text()); 
    216         } */ 
     200         
    217201        //TODO Mudar quando API abstrair atualizações no cache 
    218202        DataLayer.remove('label',false); 
     
    320304                var nameLabel = winElement.find(".insert-label").val(); 
    321305                if(nameLabel.length >= 2){ 
    322                         new_label(nameLabel); 
     306                        new_label(nameLabel, true); 
    323307                        $.Watermark.ShowAll(); 
    324308                        winElement.find(".insert-label").val(""); 
     
    421405                        var nameLabel = winElement.find(".input-nome").val(); 
    422406                        if(nameLabel.length >= 2){ 
    423                                 new_label(nameLabel);                            
     407                                new_label(nameLabel, false);                             
    424408                                winElement.find(".insert-label").val(""); 
    425409                                $.Watermark.ShowAll();                           
  • trunk/prototype/modules/mail/templates/followupflag_configure.ejs

    r5545 r5547  
    4747                <legend><%= get_lang("Basic")%></legend> 
    4848                <div class="followupflag-configure"> 
     49                        <input type="hidden" class="id-followup" value="" name="followupFlag"> 
    4950                        <label class="label-name"><%= get_lang("Flag as")%>:</label>  
    5051                        <select name="name"> 
Note: See TracChangeset for help on using the changeset viewer.