Changeset 606

Show
Ignore:
Timestamp:
10/05/07 22:10:39 (1 year ago)
Author:
laurentj
Message:

ticket #274: jForms, added a primarykey value as a parameter of initControlFromDao and saveControlToDao

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/forms/jFormsBase.class.php

    r605 r606  
    215215     * The form should contain a formId 
    216216     * 
    217      * The Dao should map to an "association table" : its primary key should be 
    218      * the primary key stored in the formId + the field which will contain one of  
     217     * The Dao should map to an "association table" : its primary key should be composed by 
     218     * the primary key stored in the formId (or the given primarykey) + the field which will contain one of  
    219219     * the values of the control. If this order is not the same as defined into the dao, 
    220220     * you should provide the list of property names which corresponds to the primary key 
     
    223223     * @param string $controlName  the name of the control 
    224224     * @param string $daoSelector the selector of a dao file 
     225     * @param mixed  $primaryKey the primary key if the form have no id. (optional) 
    225226     * @param mixed  $primaryKeyNames list of field corresponding to primary keys (optional) 
    226227     * @param string $dbProfil the jDb profil to use with the dao 
    227228     * @see jDao 
    228229     */ 
    229     public function initControlFromDao($controlName, $daoSelector, $primaryKeyNames=null, $dbProfil=''){ 
     230    public function initControlFromDao($controlName, $daoSelector, $primaryKey = null, $primaryKeyNames=null, $dbProfil=''){ 
    230231 
    231232        if(!$this->_controls[$controlName]->isContainer()){ 
     
    236237            throw new jExceptionForms('jelix~formserr.formid.undefined.for.dao', array($controlName, $this->_sel)); 
    237238 
    238         $primaryKey = $this->_container->formId; 
     239        if($primaryKey === null) 
     240            $primaryKey = $this->_container->formId; 
    239241 
    240242        if(!is_array($primaryKey)) 
     
    303305            throw new jExceptionForms('jelix~formserr.formid.undefined.for.dao', array($controlName, $this->_sel)); 
    304306 
    305         if(!$primaryKey
     307        if($primaryKey === null
    306308            $primaryKey = $this->_container->formId; 
    307309 
  • trunk/lib/jelix/forms/jFormsBase.class.php

    r605 r606  
    215215     * The form should contain a formId 
    216216     * 
    217      * The Dao should map to an "association table" : its primary key should be 
    218      * the primary key stored in the formId + the field which will contain one of  
     217     * The Dao should map to an "association table" : its primary key should be composed by 
     218     * the primary key stored in the formId (or the given primarykey) + the field which will contain one of  
    219219     * the values of the control. If this order is not the same as defined into the dao, 
    220220     * you should provide the list of property names which corresponds to the primary key 
     
    223223     * @param string $controlName  the name of the control 
    224224     * @param string $daoSelector the selector of a dao file 
     225     * @param mixed  $primaryKey the primary key if the form have no id. (optional) 
    225226     * @param mixed  $primaryKeyNames list of field corresponding to primary keys (optional) 
    226227     * @param string $dbProfil the jDb profil to use with the dao 
    227228     * @see jDao 
    228229     */ 
    229     public function initControlFromDao($controlName, $daoSelector, $primaryKeyNames=null, $dbProfil=''){ 
     230    public function initControlFromDao($controlName, $daoSelector, $primaryKey = null, $primaryKeyNames=null, $dbProfil=''){ 
    230231 
    231232        if(!$this->_controls[$controlName]->isContainer()){ 
     
    236237            throw new jExceptionForms('jelix~formserr.formid.undefined.for.dao', array($controlName, $this->_sel)); 
    237238 
    238         $primaryKey = $this->_container->formId; 
     239        if($primaryKey === null) 
     240            $primaryKey = $this->_container->formId; 
    239241 
    240242        if(!is_array($primaryKey)) 
     
    303305            throw new jExceptionForms('jelix~formserr.formid.undefined.for.dao', array($controlName, $this->_sel)); 
    304306 
    305         if(!$primaryKey
     307        if($primaryKey === null
    306308            $primaryKey = $this->_container->formId; 
    307309 
  • trunk/lib/jelix/forms/jFormsBuilderBase.class.php

    r605 r606  
    122122        } 
    123123        echo '<script type="text/javascript">  
    124 //<[CDATA[ 
     124//<![CDATA[ 
    125125', $this->getJavascriptCheck($params[0],$params[1]),' 
    126126//]]> 
  • trunk/lib/jelix/forms/jFormsBuilderBase.class.php

    r605 r606  
    122122        } 
    123123        echo '<script type="text/javascript">  
    124 //<[CDATA[ 
     124//<![CDATA[ 
    125125', $this->getJavascriptCheck($params[0],$params[1]),' 
    126126//]]> 
Download in other formats: Unified Diff Zip Archive