- Timestamp:
- 04/10/12 17:58:11 (12 years ago)
- Location:
- trunk/prototype/modules/mail
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/mail/interceptors/Helpers.php
r5893 r5909 307 307 $Labels = Controller::find(array('concept' => 'label'), false, array('filter' => array('i=', 'name', $nameLabel) )); 308 308 if($Labels){ 309 //Throw new Exception('Marcador existe'); 310 //$params['id'] = 'Marcador existe'; 311 return false; 309 Throw new Exception('Já existe um marcador com esse nome.'); 312 310 } 313 311 } -
trunk/prototype/modules/mail/js/label.js
r5899 r5909 115 115 DataLayer.commit(false, false, function(data){ 116 116 var hasLabel = true; 117 for(var i in data){118 if(parseInt(data[i].id))119 117 $.each(data, function(index, value) { 118 if(typeof value == 'object'){ 119 hasLabel = false; 120 120 } 121 else { 122 hasLabel = value; 123 } 124 }); 125 126 if(typeof data[0] == 'object'){ 127 hasLabel = false; 128 } 121 129 if(!hasLabel){ 122 130 $(".label-list-container .label-list li").each(function(){ … … 162 170 loadMenu(); 163 171 }else{ 164 alert( 'Problema ao salvar marcador.');172 alert(hasLabel); 165 173 } 166 174 … … 244 252 245 253 DataLayer.commit(false, false, function(data){ 246 var hasLabel = true;247 for(var i in data){248 if( parseInt(data[i].id))254 var hasLabel = true; 255 $.each(data, function(index, value) { 256 if(typeof value == 'object'){ 249 257 hasLabel = false; 250 } 258 }else{ 259 hasLabel = value; 260 } 261 }); 251 262 if(!hasLabel){ 252 263 labels = DataLayer.get('label',{criteria:{order: 'id'}}, true); … … 303 314 $(".add-label-button").empty() 304 315 .addClass("ui-icon ui-icon-plus"); 305 alert( 'Problema ao salvar marcador.');316 alert(hasLabel); 306 317 } 307 318 });
Note: See TracChangeset
for help on using the changeset viewer.