Changeset 6013
- Timestamp:
- 04/24/12 14:59:22 (12 years ago)
- Location:
- trunk/prototype
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/config/label.ini
r5971 r6013 13 13 14 14 [before.update] 15 v alidateLabel = modules/mail/interceptors/Helpers.php15 verifyNameLabel = modules/mail/interceptors/Helpers.php 16 16 17 17 [before.create] 18 validateLabel = modules/mail/interceptors/Helpers.php 18 verifyNameLabel = modules/mail/interceptors/Helpers.php 19 validateNumberSlots = modules/mail/interceptors/Helpers.php 19 20 20 21 [PostgreSQL.mapping] -
trunk/prototype/modules/mail/interceptors/Helpers.php
r5990 r6013 337 337 } 338 338 } 339 340 339 //label:before.create 341 public function v alidateLabel(&$uri , &$params , &$criteria , $original){342 340 public function verifyNameLabel(&$uri , &$params , &$criteria , $original){ 341 343 342 if( !!Controller::find( array('concept' => 'label'), false, array('filter' => array('i=', 'name', $params['name'])) ) ) 344 343 { 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){ 347 350 348 351 $used = Controller::read( array( 'concept' => 'label', 'id' => '1' ), array( 'id' ), array( 'uid' => Config::me('uidNumber') ) ); … … 358 361 if( empty( $slot ) ) 359 362 { 360 throw new Exception(' Atingido limite de marcadores criados.');363 throw new Exception('#LabelSlotError'); 361 364 } 362 365 -
trunk/prototype/modules/mail/js/label.js
r5909 r6013 1 function 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 } 1 13 function configureLabel(event, ui){ 2 14 var idmarkernow = $(this).find('[name="labelItemId"]').val(); … … 170 182 loadMenu(); 171 183 }else{ 172 alert(hasLabel);184 msgCallback(hasLabel); 173 185 } 174 186 … … 314 326 $(".add-label-button").empty() 315 327 .addClass("ui-icon ui-icon-plus"); 316 alert(hasLabel);328 msgCallback(hasLabel); 317 329 } 318 330 });
Note: See TracChangeset
for help on using the changeset viewer.