- Timestamp:
- 06/15/12 16:30:56 (12 years ago)
- Location:
- sandbox/2.4.1-3
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.4.1-3/expressoMail1_2/index.php
r6512 r6526 39 39 <script src="../prototype/plugins/farbtastic/farbtastic.js" language="javascript"></script> 40 40 <script src="../prototype/api/datalayer.js" language="javascript"></script> 41 <script src="../prototype/api/rest.js" language="javascript"></script> 41 42 <script type="text/javascript" src="../prototype/plugins/scrollto/jquery.scrollTo.js"></script> 42 <script language="javascript">DataLayer.dispatchPath = "../prototype/";</script> 43 <script language="javascript"> 44 DataLayer.dispatchPath = "../prototype/"; 45 REST.dispatchPath = "../prototype/"; 46 REST.load(""); 47 </script> 43 48 <script src="../library/ckeditor/ckeditor.js" language="javascript" charset="utf-8"></script> 44 49 <script src="../library/ckeditor/adapters/jquery.js" language="javascript"></script> … … 73 78 <script type="text/javascript" src="../prototype/modules/calendar/js/calendar.date.js"></script> 74 79 <script type="text/javascript" src="../prototype/modules/calendar/js/calendar.codecs.js"></script> 75 80 76 81 77 82 <script src="js/rich_text_editor.js" type="text/javascript"></script> -
sandbox/2.4.1-3/expressoMail1_2/js/main.js
r6522 r6526 35 35 function updateDynamicContact(){ 36 36 dynamicContacts = new Array(); 37 var dynamicData = DataLayer.read("/dynamiccontacts").collection.itens;37 var dynamicData = REST.get("/dynamiccontacts").collection.itens; 38 38 if(dynamicData){ 39 39 $.each(dynamicData, function(index, value){ … … 56 56 function updateDynamicPersonalGroups(){ 57 57 dynamicPersonalGroups = new Array(); 58 var groupsData = DataLayer.read("/groups").collection.itens;58 var groupsData = REST.get("/groups").collection.itens; 59 59 if(groupsData){ 60 60 $.each(groupsData, function(index, value){ … … 73 73 function updateDynamicPersonalContacts(){ 74 74 dynamicPersonalContacts = new Array(); 75 var contactsData = DataLayer.read("/contacts").collection.itens;75 var contactsData = REST.get("/contacts").collection.itens; 76 76 if(contactsData){ 77 77 $.each(contactsData, function(index, value){ … … 99 99 100 100 }*/ 101 var load_dynamics = function(){ 102 updateDynamicContact(); 103 updateDynamicPersonalGroups(); 104 updateDynamicPersonalContacts(); 105 updateDynamicContactList(); 106 }; 107 load_dynamics(); 108 101 if(parseInt(preferences.use_dynamic_contacts)){ 102 var load_dynamics = function(){ 103 updateDynamicContact(); 104 updateDynamicPersonalGroups(); 105 updateDynamicPersonalContacts(); 106 updateDynamicContactList(); 107 }; 108 load_dynamics(); 109 } 109 110 var save_preferences = function(data){ 110 111 … … 2289 2290 var array = content.find(".to-tr").find(".box").clone(); 2290 2291 delete_border(ID,'true'); 2291 $.each(array, function(i, value){ 2292 var stop = false; 2293 $.each(dynamicPersonalContacts, function(x, valuex){ 2294 if(valuex.email == $(value).find("input").val().match(reComplexEmail)[1]){ 2295 stop = true; 2296 return false; 2297 } 2298 }); 2299 if(!stop){ 2300 var exist = 0; 2301 $.each(dynamicContacts, function(x, valuex){ 2292 if(parseInt(preferences.use_dynamic_contacts)){ 2293 $.each(array, function(i, value){ 2294 var stop = false; 2295 $.each(dynamicPersonalContacts, function(x, valuex){ 2302 2296 if(valuex.email == $(value).find("input").val().match(reComplexEmail)[1]){ 2303 exist = valuex.id;2297 stop = true; 2304 2298 return false; 2305 2299 } 2306 2300 }); 2307 if(exist){ 2308 DataLayer.update("/dynamiccontact/"+exist, {name: $(value).find("input").val().split('"')[1], mail:$(value).find("input").val().match(reComplexEmail)[1]}); 2309 }else{ 2310 DataLayer.create("/dynamiccontacts", {name: $(value).find("input").val().split('"')[1], mail:$(value).find("input").val().match(reComplexEmail)[1]}); 2301 if(!stop){ 2302 var exist = 0; 2303 $.each(dynamicContacts, function(x, valuex){ 2304 if(valuex.email == $(value).find("input").val().match(reComplexEmail)[1]){ 2305 exist = valuex.id; 2306 return false; 2307 } 2308 }); 2309 if(exist){ 2310 REST.put("/dynamiccontact/"+exist, {name: $(value).find("input").val().split('"')[1], mail:$(value).find("input").val().match(reComplexEmail)[1]}); 2311 }else{ 2312 REST.post("/dynamiccontacts", {name: $(value).find("input").val().split('"')[1], mail:$(value).find("input").val().match(reComplexEmail)[1]}); 2313 } 2311 2314 } 2312 } 2313 });2314 updateDynamicContact();2315 updateDynamicContactList();2315 }); 2316 updateDynamicContact(); 2317 updateDynamicContactList(); 2318 } 2316 2319 } 2317 2320 else{ -
sandbox/2.4.1-3/prototype/api/controller.php
r6357 r6526 45 45 require_once(ROOTPATH.'/api/config.php'); 46 46 use prototype\api\Config as Config; 47 48 47 /** 49 48 TODO list: … … 181 180 public static function rollback( $URI, $criteria = false ) 182 181 { 182 if( isset( $URI['service'] ) ) 183 unset( self::$tx[ $URI['service'] ] ); 184 185 self::$txID--; 186 183 187 return self::call( 'rollback', $URI, false, $criteria ); 184 188 } … … 485 489 486 490 if( $return === false ) 487 return( false );491 return( false ); 488 492 489 493 if( isset($return) ) … … 530 534 return( $URI ); 531 535 } 536 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 ) ); 547 } 548 549 return( empty($params['properties']) ? false : $params['properties'] ); 550 } 532 551 533 552 //TODO: Compatibilizar as configs relativas aos modulos, adicionando os mesmos nas options passadas … … 544 563 545 564 if( isset($params['URI']['concept']) && !self::fire( 'before', $method, $params, $original ) ) 546 return( empty($params['properties']) ? false : $params['properties'] ); 547 548 565 return( self::finalizeCommit( $method, $params, $original ) ); 549 566 550 567 if( $params && !$params['service'] ) … … 568 585 569 586 if( !self::fire( 'before', $method, $params, $original, true ) ) 570 return( empty($params['properties']) ? false : $params['properties']);587 return( self::finalizeCommit( $method, $params, $original, isset($TX) ? $TX : false ) ); 571 588 } 572 589 … … 608 625 if( isset($params['URI']['service']) ) 609 626 if( !self::fire( 'after', $method, $params, $original, true ) ) 610 return( empty($params['properties']) ? false : $params['properties']);627 return( self::finalizeCommit( $method, $params, $original, isset($TX) ? $TX : false ) ); 611 628 612 629 if( isset($URI['concept']) ) … … 618 635 if( isset( $TX ) ) 619 636 { 620 $TX['rollback'] = !!!$params['properties']; 621 622 if( $params['properties'] && is_array($params['properties']) && isset($params['properties']['id']) ) 623 $TX['id'] = $params['properties']['id']; 624 625 self::$tx[ $params['URI']['service'] ][] = array_merge( $TX, $original['URI'], array( 'service' => $params['URI']['service'], 'method' => $method ) ); 626 637 //self::finalizeCommit( $params, $original, $method, $TX ); 638 self::finalizeCommit( $method, $params, $original, $TX ); 627 639 if( isset($commit) && $commit ) 628 640 { … … 636 648 catch( Exception $e ) 637 649 { 638 if( !self::fallback( $e ) )650 if( !self::fallback( $e, $URI ) ) 639 651 self::closeAll(); 640 652 … … 645 657 } 646 658 647 public static function fallback( $exception )659 public static function fallback( $exception, $URI ) 648 660 { 649 661 $code = $exception->getCode(); … … 652 664 { 653 665 $fn = self::$fallbackHandlers[ $code ]; 654 return $fn( $exception );666 return $fn( $exception, $URI ); 655 667 } 656 668 … … 717 729 $URI['id'] = $result['id']; 718 730 719 self::$tx[ $URI['service'] ][ count(self::$tx[ $URI['service'] ]) - 1 ]['order'] = $order; 720 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']; 721 738 722 739 foreach( $postpone as $linkTarget => $dt ) … … 763 780 catch( Exception $e ) 764 781 { 765 if( !self::fallback( $e ) )782 if( !self::fallback( $e, $URI ) ) 766 783 self::closeAll(); 767 784 -
sandbox/2.4.1-3/prototype/request.php
r6111 r6526 1 1 <?php 2 2 3 // $properties = $_ GET['properties'];4 // $limit = $_ GET['limit'];5 // $offset = $_ GET['offset'];6 // $group = $_ GET['group'];7 // $order = $_ GET['join'];8 // $filter = $_ GET['filter'];9 // $URI = $_ GET['URI'];3 // $properties = $_REQUEST['properties']; 4 // $limit = $_REQUEST['limit']; 5 // $offset = $_REQUEST['offset']; 6 // $group = $_REQUEST['group']; 7 // $order = $_REQUEST['join']; 8 // $filter = $_REQUEST['filter']; 9 // $URI = $_REQUEST['URI']; 10 10 11 $concept = isset( $_ GET['concept'] ) ? $_GET['concept'] : false;12 $id = isset( $_ GET['id'] ) ? $_GET['id'] : false;13 $filter = isset( $_ GET['filter'] ) ? $_GET['filter'] : false;14 $criteria = isset( $_ GET['criteria'] ) ? $_GET['criteria'] : false;11 $concept = isset( $_REQUEST['concept'] ) ? $_REQUEST['concept'] : false; 12 $id = isset( $_REQUEST['id'] ) ? $_REQUEST['id'] : false; 13 $filter = isset( $_REQUEST['filter'] ) ? $_REQUEST['filter'] : false; 14 $criteria = isset( $_REQUEST['criteria'] ) ? $_REQUEST['criteria'] : false; 15 15 16 16 $criteria = $filter ? $criteria ? -
sandbox/2.4.1-3/prototype/rest/catalog/ContactResource.php
r6512 r6526 30 30 31 31 try { 32 //$this->secured();32 $this->secured(); 33 33 34 34 $contact = Controller::find( array( 'concept' => 'contact' ), false, array( 'filter' => array( 'AND', array('=', 'user', Config::me("uidNumber") ), array('=', 'id', $id) ) ) ); -
sandbox/2.4.1-3/prototype/rest/catalog/ContactsResource.php
r6512 r6526 30 30 31 31 try { 32 //$this->secured();32 $this->secured(); 33 33 34 34 $contacts = Controller::find( array( 'concept' => 'contact' ), false, array( 'filter' => array( '=', 'user', Config::me("uidNumber") ) ) ); -
sandbox/2.4.1-3/prototype/rest/catalog/GroupResource.php
r6512 r6526 30 30 31 31 try { 32 //$this->secured();32 $this->secured(); 33 33 34 34 $group = Controller::find( array( 'concept' => 'contactGroup' ), false, array( 'filter' => array( 'AND', array('=', 'user', Config::me("uidNumber") ), array('=', 'id', $id) ) ) ); -
sandbox/2.4.1-3/prototype/rest/catalog/GroupsResource.php
r6519 r6526 30 30 31 31 try { 32 //$this->secured();32 $this->secured(); 33 33 34 34 $groups = Controller::find( array( 'concept' => 'contactGroup' ), false, array( 'filter' => array('=', 'user', Config::me("uidNumber") ), 'order' => array('name') ) ); … … 51 51 foreach($groups as $value){ 52 52 53 $i = new Item($request->resources, 'GroupsResource' );53 $i = new Item($request->resources, 'GroupsResource', $value['id']); 54 54 55 55 $d = new Data(); -
sandbox/2.4.1-3/prototype/rest/user/UserResource.php
r6512 r6526 29 29 try { 30 30 31 //$this->secured();31 $this->secured(); 32 32 33 33 $user = Controller::find(array('concept' => 'user','service'=>'OpenLDAP'), false, array('filter' => array('=', 'uid', $id ))); -
sandbox/2.4.1-3/prototype/rest/user/UsersResource.php
r6512 r6526 30 30 31 31 try { 32 //$this->secured();32 $this->secured(); 33 33 34 34 //Executa uma consulta de usuários do LDAP a partir de um determinado atributo e valor
Note: See TracChangeset
for help on using the changeset viewer.