Changeset 6013


Ignore:
Timestamp:
04/24/12 14:59:22 (12 years ago)
Author:
marcieli
Message:

Ticket #2633 - Ao atualizar marcador, não é necessário controlar limite de slot.

Location:
trunk/prototype
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/config/label.ini

    r5971 r6013  
    1313 
    1414[before.update] 
    15 validateLabel = modules/mail/interceptors/Helpers.php 
     15verifyNameLabel = modules/mail/interceptors/Helpers.php 
    1616 
    1717[before.create] 
    18 validateLabel = modules/mail/interceptors/Helpers.php 
     18verifyNameLabel = modules/mail/interceptors/Helpers.php 
     19validateNumberSlots = modules/mail/interceptors/Helpers.php 
    1920 
    2021[PostgreSQL.mapping] 
  • trunk/prototype/modules/mail/interceptors/Helpers.php

    r5990 r6013  
    337337                }        
    338338        }        
    339  
    340339        //label:before.create  
    341         public function validateLabel(&$uri , &$params , &$criteria , $original){  
    342  
     340        public function verifyNameLabel(&$uri , &$params , &$criteria , $original){  
     341         
    343342                        if( !!Controller::find( array('concept' => 'label'), false, array('filter' => array('i=', 'name', $params['name'])) ) )  
    344343                        {  
    345                                 throw new Exception('Já existe um marcador com esse nome.');  
    346                         }  
     344                                throw new Exception('#LabelNameError');  
     345                        } 
     346        } 
     347 
     348        //label:before.create  
     349        public function validateNumberSlots(&$uri , &$params , &$criteria , $original){  
    347350 
    348351                        $used = Controller::read( array( 'concept' => 'label', 'id' => '1' ), array( 'id' ), array( 'uid' => Config::me('uidNumber') ) ); 
     
    358361                        if( empty( $slot ) )  
    359362                        {  
    360                                 throw new Exception('Atingido limite de marcadores criados.');  
     363                                throw new Exception('#LabelSlotError');  
    361364                        }  
    362365 
  • trunk/prototype/modules/mail/js/label.js

    r5909 r6013  
     1function msgCallback(msg){ 
     2        switch(msg){ 
     3                case '#LabelNameError':  
     4                        alert('Já existe um marcador com esse nome.'); 
     5                        break; 
     6                case '#LabelSlotError': 
     7                        alert('Atingido limite de marcadores criados.'); 
     8                        break;   
     9                default: 
     10                        alert('Ocorreu um erro ao salvar o Marcador'); 
     11        } 
     12} 
    113function configureLabel(event, ui){ 
    214        var idmarkernow = $(this).find('[name="labelItemId"]').val(); 
     
    170182                                                loadMenu(); 
    171183                                        }else{ 
    172                                                 alert(hasLabel); 
     184                                                msgCallback(hasLabel); 
    173185                                        } 
    174186                                         
     
    314326                        $(".add-label-button").empty() 
    315327                        .addClass("ui-icon ui-icon-plus"); 
    316                         alert(hasLabel); 
     328                        msgCallback(hasLabel); 
    317329                } 
    318330        }); 
Note: See TracChangeset for help on using the changeset viewer.