Changeset 6384
- Timestamp:
- 06/01/12 15:53:54 (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/draw_api.js
r6332 r6384 1737 1737 headers_msgs.followupflagged.id = DataLayer.put('followupflagged', headers_msgs.followupflagged); 1738 1738 DataLayer.commit(false, false, function(data){ 1739 var fail = false;1739 var fail = 'success'; 1740 1740 $.each(data, function(index, value) { 1741 if(typeof value != 'object' || !(value['id'])){1742 fail = true;1741 if(typeof value === 'string'){ 1742 fail = value; 1743 1743 } 1744 1744 }); … … 1747 1747 'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited") 1748 1748 .html('<img src="../prototype/modules/mail/img/flagEditor.png">'); 1749 1750 if (!fail) { 1751 $('#td_message_followup_' + messageClickedId + ', ' + 1752 'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).attr('title', get_lang('Follow up')).find(".flag-edited").css("background", headers_msgs.followupflagged.backgroundColor); 1753 updateCacheFollowupflag(messageClickedId, msg_folder, true); 1754 } else { 1755 $('#td_message_followup_' + messageClickedId + ', ' + 1756 'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "#CCCCCC"); 1757 alert("Não foi possível sinalizar esta mensagem. \nDetalhes do erro: mensagem não contém o atributo message-id."); 1749 1750 switch( fail ) 1751 { 1752 case '#FollowupflagMessageIdError': { 1753 $('#td_message_followup_' + messageClickedId + ', ' + 1754 'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "#CCCCCC"); 1755 alert("Não foi possível sinalizar esta mensagem. \nDetalhes do erro: mensagem não contém o atributo message-id."); break; 1756 } 1757 case '#FollowupflagParamsError': { 1758 $('#td_message_followup_' + messageClickedId + ', ' + 1759 'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "#CCCCCC"); 1760 alert("Não foi possível sinalizar esta mensagem. \nDetalhes do erro: mensagem não contém todos os atributos necessários."); break; 1761 } 1762 default : { 1763 $('#td_message_followup_' + messageClickedId + ', ' + 1764 'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).attr('title', get_lang('Follow up')).find(".flag-edited").css("background", headers_msgs.followupflagged.backgroundColor); 1765 updateCacheFollowupflag(messageClickedId, msg_folder, true); 1766 } 1758 1767 } 1759 1768 }); -
trunk/expressoMail1_2/js/search.js
r6365 r6384 576 576 $.each(data, function(index, value) { 577 577 fail = false; 578 if(typeof value != 'object' || !(value['id'])){579 fail = true;578 if(typeof value === 'string'){ 579 fail = value; 580 580 } 581 581 }); … … 591 591 $('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "#CCCCCC"); 592 592 } 593 alert("Não foi possível sinalizar esta mensagem. \nDetalhes do erro: mensagem não contém o atributo message-id."); 593 594 switch( fail ) 595 { 596 case '#FollowupflagMessageIdError': alert("Não foi possível sinalizar esta mensagem. \nDetalhes do erro: mensagem não contém o atributo message-id."); break; 597 case '#FollowupflagParamsError': alert("Não foi possível sinalizar esta mensagem. \nDetalhes do erro: mensagem não contém todos os atributos necessários."); break; 598 } 599 594 600 return false; 595 601 } -
trunk/prototype/api/controller.php
r6373 r6384 489 489 490 490 if( $return === false ) 491 return( false );491 return( false ); 492 492 493 493 if( isset($return) ) … … 535 535 } 536 536 537 public static function finalizeCommit( $TX, $params, $original, $method ) 538 { 539 $TX['rollback'] = !!!$params['properties']; 540 541 if( $params['properties'] && is_array($params['properties']) && isset($params['properties']['id']) ) 542 $TX['id'] = $params['properties']['id']; 543 544 self::$tx[ $params['URI']['service'] ][] = array_merge( $TX, $original['URI'], array( 'service' => $params['URI']['service'], 'method' => $method ) ); 545 546 if( isset($commit) && $commit ) 547 { 548 if( !self::call( 'commit', $params['URI'], false, self::$tx[ $params['URI']['service'] ] ) ) 549 self::call( 'rollback', $params['URI'] , false, self::$tx[ $params['URI']['service'] ] ); 550 551 unset( self::$tx[ $params['URI']['service'] ] ); 537 public static function finalizeCommit( $method, $params, $original, $TX = array() ) 538 { 539 if( $TX !== false ) 540 { 541 $TX['rollback'] = !!!$params['properties']; 542 543 if( $params['properties'] && is_array($params['properties']) && isset($params['properties']['id']) ) 544 $TX['id'] = $params['properties']['id']; 545 546 self::$tx[ $params['URI']['service'] ][] = array_merge( $TX, $original['URI'], array( 'service' => $params['URI']['service'], 'method' => $method ) ); 552 547 } 553 548 … … 568 563 569 564 if( isset($params['URI']['concept']) && !self::fire( 'before', $method, $params, $original ) ) 570 return( !isset($TX) ? empty($params['properties']) ? false : $params['properties'] : self::finalizeCommit( $TX, $params, $original, $method ) ); 571 572 565 return( self::finalizeCommit( $method, $params, $original ) ); 573 566 574 567 if( $params && !$params['service'] ) … … 592 585 593 586 if( !self::fire( 'before', $method, $params, $original, true ) ) 594 return( !isset($TX) ? empty($params['properties']) ? false : $params['properties'] : self::finalizeCommit( $TX, $params, $original, $method) );587 return( self::finalizeCommit( $method, $params, $original, isset($TX) ? $TX : false ) ); 595 588 } 596 589 … … 632 625 if( isset($params['URI']['service']) ) 633 626 if( !self::fire( 'after', $method, $params, $original, true ) ) 634 return( !isset($TX) ? empty($params['properties']) ? false : $params['properties'] : self::finalizeCommit( $TX, $params, $original, $method) );627 return( self::finalizeCommit( $method, $params, $original, isset($TX) ? $TX : false ) ); 635 628 636 629 if( isset($URI['concept']) ) … … 641 634 642 635 if( isset( $TX ) ) 643 self::finalizeCommit( $TX, $params, $original, $method ); 636 { 637 self::finalizeCommit( $params, $original, $method, $TX ); 638 639 if( isset($commit) && $commit ) 640 { 641 if( !self::call( 'commit', $params['URI'], false, self::$tx[ $params['URI']['service'] ] ) ) 642 self::call( 'rollback', $params['URI'] , false, self::$tx[ $params['URI']['service'] ] ); 643 644 unset( self::$tx[ $params['URI']['service'] ] ); 645 } 646 } 644 647 } 645 648 catch( Exception $e ) … … 726 729 $URI['id'] = $result['id']; 727 730 728 self::$tx[ $URI['service'] ][ count(self::$tx[ $URI['service'] ]) - 1 ]['order'] = $order; 729 self::$tx[ $URI['service'] ][ count(self::$tx[ $URI['service'] ]) - 1 ]['id'] = $URI['id']; 731 $index = count(self::$tx[ $URI['service'] ]) - 1; 732 733 self::$tx[ $URI['service'] ][ $index ]['order'] = $order; 734 self::$tx[ $URI['service'] ][ $index ]['id'] = $URI['id']; 735 736 if( !isset(self::$tx[ $URI['service'] ][ $index ]['concept']) ) 737 self::$tx[ $URI['service'] ][ $index ]['concept'] = $URI['concept']; 730 738 731 739 foreach( $postpone as $linkTarget => $dt )
Note: See TracChangeset
for help on using the changeset viewer.