Changeset 6351 for sandbox


Ignore:
Timestamp:
05/30/12 11:34:56 (12 years ago)
Author:
gustavo
Message:

Ticket #2768 - Melhorias na inserção de destinatários na criacao de mensagem

Location:
sandbox/2.4.1-3/prototype
Files:
152 added
6 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.1-3/prototype/api/datalayer.js

    r6008 r6351  
    1 internalUrl = /^([A-z0-9-_]+)(:[A-z0-9-_]+)?$/; 
     1   internalUrl = /^([A-z0-9-_]+)(:[A-z0-9-_]+)?$/; 
    22internalUri = /^([a-zA-Z0-9-_]+)\(([a-zA-Z0-9-_]+)\):\/\/(.*)|([a-zA-Z0-9-_]+):\/\/(.*)$/; 
    33isGeneratedId = /^\d+\(javascript\)$/; 
     
    213213 
    214214                }, 
     215              'error': function( dt, textStatus, jqXHR ){ 
     216 
     217                    if( callback ) 
     218                    { 
     219                        fired = true; 
     220                        result = callback( $.parseJSON(dt.responseText), textStatus, jqXHR ); 
     221                    } 
     222                    else 
     223                        result = $.parseJSON(dt.responseText); 
     224 
     225                }, 
    215226              'complete': function( jqXHR, textStatus ){ 
    216227 
     
    234245       
    235246          return( result ); 
     247    }, 
     248     
     249    /** 
     250    * This method is used to read resources from the server. 
     251    *  
     252    * @param uri Uri of the resource that gonna be readed. 
     253    * @param callback A function that is called when the resource is loaded successfully. When the parameter is ignored the request is made synchrounsly. 
     254    * @param accept The attribute accept that is used to ask the target format to the server 
     255    * @return The target resource when the callback is ommitted ( made it synchronous ) 
     256    */ 
     257 
     258    read: function( uri, data, callback, accept ){ 
     259        //return this.send( this.dispatchPath + 'rest' + uri, [ 'get', accept || 'json' ], false, callback ); 
     260        //http://expressodev.prognus.com.br/cristiano/expresso-api/rest/maillast 
     261        return this.send( ('rest' + uri), [ 'get', accept || 'json' ], data, callback, !!!callback,  
     262        {'beforeSend' : function (xhr){  
     263            xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)}  
     264        }); 
     265       
     266    }, 
     267 
     268    /** 
     269    * This method is used to create resources from the server. 
     270    *  
     271    * @param uri Uri of the resource that gonna be readed. 
     272    * @param callback A function that is called when the resource is created on the server successfully. When the parameter is ignored the request is made synchrounsly. 
     273    * @param accept The attribute accept that is used to ask the target format to the server. 
     274    * @return The result response of the create from the server when the callback is ommitted ( made it synchronous ) 
     275    */ 
     276     
     277    create: function( uri, data, callback, accept ){ 
     278       
     279        return this.send( 'rest' + uri, [ 'post', accept || 'json' ], data, callback, !!!callback,  
     280        {'beforeSend' : function (xhr){  
     281            xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)}  
     282        }); 
     283       
     284    }, 
     285 
     286    /** 
     287    * This method is used to update resources from the server. 
     288    *  
     289    * @param uri Uri of the resource that gonna be readed. 
     290    * @param callback A function that is called when the resource is update on the server successfully. When the parameter is ignored the request is made synchrounsly. 
     291    * @param accept The attribute accept that is used to ask the target format to the server 
     292    * @return The result response of the update from the server when the callback is ommitted ( made it synchronous ) 
     293    */ 
     294 
     295    update: function( uri, data, callback, accept ){ 
     296       
     297        return this.send( 'rest' + uri, [ 'put', accept || 'json' ], data, callback, !!!callback,  
     298        {'beforeSend' : function (xhr){  
     299            xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)}  
     300        }); 
     301       
     302    }, 
     303 
     304    /** 
     305    * This method is used to delete resources from the server. 
     306    *  
     307    * @param uri Uri of the resource that gonna be readed. 
     308    * @param callback A function that is called when the resource is deleted successfully in the server. When the parameter is ignored the request is made synchrounsly. 
     309    * @param accept The attribute accept that is used to ask the target format to the server 
     310    * @return The result response of the delete from the server when the callback is ommitted ( made it synchronous ) 
     311    */ 
     312 
     313    "delete": function( uri, callback, accept ){ 
     314       
     315        return this.send( 'rest' + uri, [ 'delete', accept || 'json' ], false, callback, !!!callback,  
     316        {'beforeSend' : function (xhr){  
     317            xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)}  
     318        }); 
     319       
    236320    }, 
    237321     
     
    20392123 
    20402124        if( !this.dispatchPath ) 
    2041             this.dispatchPath = "../../"; 
     2125            this.dispatchPath = "prototype/"; 
    20422126 
    20432127        if( !this.templatePath ) 
     
    20542138 
    20552139        this.start(); 
     2140        this.me = this.dispatch( "me" ); 
    20562141    } 
    20572142} 
  • sandbox/2.4.1-3/prototype/config/OpenLDAP.srv

    r6173 r6351  
    44idAtribute = "uidNumber" 
    55host = 127.0.0.1 
    6 context = "LDAP_DN" 
    7 ; Caso o LDAP requisite autenticacao, configure os parametros a seguir 
    8 ;user =  
    9 ;password =  
     6 
     7context = "dc=prognus" 
     8user = "cn=admin,dc=prognus" 
     9password = "prognus" 
     10 
  • sandbox/2.4.1-3/prototype/config/PostgreSQL.srv

    r6081 r6351  
    77;host = 127.0.0.1 
    88port = 5432 
    9 dbname = expresso 
    10 user = postgres 
     9dbname = expressoDFDTezza 
     10user = expressodev 
    1111; Caso o usuario tenha senha... 
    1212;password= 
  • sandbox/2.4.1-3/prototype/me.php

    r5399 r6351  
    44 
    55$me = Controller::read(array('concept' => 'user', 'service' => 'OpenLDAP'  , 'id' => Config::me('uidNumber'))); 
     6$me['token'] = $_SESSION['oauth']['access_token']; 
    67 
    78echo json_encode( $me ); 
  • sandbox/2.4.1-3/prototype/services/OpenLDAP.php

    r5804 r6351  
    1313        if( !isset($criteria["limit"]) ) 
    1414                $criteria["limit"] = $this->limit; 
    15          
     15       
    1616        $sr =  ldap_search( $this->con , $this->config['context'] , self::parseCriteria($criteria , $map) , self::parseJustthese($justthese, $map) , 0 , $criteria["limit"]);  
    1717        if(!$sr) return false;  
     
    156156        $as = array_shift( $filter ); 
    157157        $op = self::parseOperator( $as ); 
    158                  
     158 
    159159        if( is_array($filter[0]) ) 
    160160        { 
  • sandbox/2.4.1-3/prototype/services/PostgreSQL.php

    r6145 r6351  
    197197                    $val[] = '\''.addslashes($v).'\''; 
    198198            } 
    199              
    200             return '('.implode(',', $ind).') VALUES ('.implode(',', $val).') RETURNING '.$map['id'].' as id'; 
     199 
     200//          return '('.implode(',', $ind).') VALUES ('.implode(',', $val).') RETURNING '.$map['id'].' as id';        
     201            return '('.implode(',', $ind).') VALUES ('.implode(',', $val).') RETURNING id';          
    201202    } 
    202203         
     
    306307            case 'or': return( $op ); 
    307308            case 'in': return array( $op ); 
     309            case '!in': return array( 'NOT IN' ); 
    308310            case '^': return array( 'like', '%',  '' ); 
    309311            case '$': return array( 'like',  '', '%' ); 
Note: See TracChangeset for help on using the changeset viewer.