Changeset 593
- Timestamp:
- 09/28/07 12:18:25 (1 year ago)
- Files:
-
- branches/1.0beta3.x/lib/jelix-scripts/commands/createdaocrud.cmd.php (modified) (2 diffs)
- branches/1.0beta3.x/lib/jelix-scripts/commands/createdaocrud.cmd.php (modified) (2 diffs)
- branches/1.0beta3.x/lib/jelix-scripts/templates/controller.daocrud.tpl (modified) (1 diff)
- branches/1.0beta3.x/lib/jelix-scripts/templates/controller.daocrud.tpl (modified) (1 diff)
- branches/1.0beta3.x/lib/jelix/controllers/jControllerDaoCrud.class.php (modified) (7 diffs)
- branches/1.0beta3.x/lib/jelix/controllers/jControllerDaoCrud.class.php (modified) (7 diffs)
- branches/1.0beta3.x/lib/jelix/forms/jFormsBase.class.php (modified) (5 diffs)
- branches/1.0beta3.x/lib/jelix/forms/jFormsBase.class.php (modified) (5 diffs)
- trunk/lib/jelix-scripts/commands/createdaocrud.cmd.php (modified) (2 diffs)
- trunk/lib/jelix-scripts/commands/createdaocrud.cmd.php (modified) (2 diffs)
- trunk/lib/jelix-scripts/templates/controller.daocrud.tpl (modified) (1 diff)
- trunk/lib/jelix-scripts/templates/controller.daocrud.tpl (modified) (1 diff)
- trunk/lib/jelix/controllers/jControllerDaoCrud.class.php (modified) (7 diffs)
- trunk/lib/jelix/controllers/jControllerDaoCrud.class.php (modified) (7 diffs)
- trunk/lib/jelix/forms/jFormsBase.class.php (modified) (5 diffs)
- trunk/lib/jelix/forms/jFormsBase.class.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0beta3.x/lib/jelix-scripts/commands/createdaocrud.cmd.php
r590 r593 53 53 $agcommand = jxs_load_command('createdao'); 54 54 $options = array(); 55 $profil = ''; 55 56 if ($this->getOption('-profil')) { 56 $options = array('-profil'=>$this->getOption('-profil')); 57 $profil = $this->getOption('-profil'); 58 $options = array('-profil'=>$profil); 57 59 } 58 60 $agcommand->init($options,array('module'=>$this->_parameters['module'], 'name'=>$ctrlname,'table'=>$table)); … … 65 67 $this->createDir($path.'controllers/'); 66 68 $this->createFile($path.'controllers/'.$ctrlname.'.classic.php','controller.daocrud.tpl',array('name'=>$ctrlname, 67 'module'=>$this->_parameters['module'], 'table'=>$table ));69 'module'=>$this->_parameters['module'], 'table'=>$table, 'profil'=>$profil)); 68 70 } 69 71 } branches/1.0beta3.x/lib/jelix-scripts/commands/createdaocrud.cmd.php
r590 r593 53 53 $agcommand = jxs_load_command('createdao'); 54 54 $options = array(); 55 $profil = ''; 55 56 if ($this->getOption('-profil')) { 56 $options = array('-profil'=>$this->getOption('-profil')); 57 $profil = $this->getOption('-profil'); 58 $options = array('-profil'=>$profil); 57 59 } 58 60 $agcommand->init($options,array('module'=>$this->_parameters['module'], 'name'=>$ctrlname,'table'=>$table)); … … 65 67 $this->createDir($path.'controllers/'); 66 68 $this->createFile($path.'controllers/'.$ctrlname.'.classic.php','controller.daocrud.tpl',array('name'=>$ctrlname, 67 'module'=>$this->_parameters['module'], 'table'=>$table ));69 'module'=>$this->_parameters['module'], 'table'=>$table, 'profil'=>$profil)); 68 70 } 69 71 } branches/1.0beta3.x/lib/jelix-scripts/templates/controller.daocrud.tpl
r575 r593 15 15 protected $form = '{$module}~{$name}'; 16 16 17 protected $dbProfil = '{$profil}'; 18 17 19 } 18 20 ?> branches/1.0beta3.x/lib/jelix-scripts/templates/controller.daocrud.tpl
r575 r593 15 15 protected $form = '{$module}~{$name}'; 16 16 17 protected $dbProfil = '{$profil}'; 18 17 19 } 18 20 ?> branches/1.0beta3.x/lib/jelix/controllers/jControllerDaoCrud.class.php
r571 r593 89 89 90 90 /** 91 * the jDb profil to use with the dao 92 */ 93 protected $dbProfil = ''; 94 95 /** 91 96 * Returned a simple html response to display CRUD contents. You can override this 92 97 * method to return a personnalized response … … 124 129 $rep = $this->_getResponse(); 125 130 126 $dao = jDao::get($this->dao );131 $dao = jDao::get($this->dao, $this->dbProfil); 127 132 $results = $dao->findBy(jDao::createConditions(),$offset,$this->listPageSize); 128 133 $pk = $dao->getPrimaryKeyNames(); … … 184 189 185 190 if($form->check() && $this->_checkDatas($form)){ 186 $id = $form->saveToDao($this->dao );191 $id = $form->saveToDao($this->dao, $this->dbProfil); 187 192 $form->saveAllFiles($this->uploadsDirectory); 188 193 $rep->action = $this->_getAction('view'); … … 211 216 212 217 try { 213 $form->initFromDao($this->dao );218 $form->initFromDao($this->dao, null, $this->dbProfil); 214 219 }catch(Exception $e){ 215 220 $rep->action = $this->_getAction('index'); … … 260 265 261 266 if($form->check() && $this->_checkDatas($form)){ 262 $id = $form->saveToDao($this->dao );267 $id = $form->saveToDao($this->dao, $this->dbProfil); 263 268 $form->saveAllFiles($this->uploadsDirectory); 264 269 $rep->action = $this->_getAction('view'); … … 286 291 // labels with each values. 287 292 $form = jForms::create($this->form, $this->pseudoFormId); 288 $form->initFromDao($this->dao, $id );293 $form->initFromDao($this->dao, $id, $this->dbProfil); 289 294 290 295 $tpl = new jTpl(); … … 304 309 $id = $this->param('id'); 305 310 if( $id !== null ){ 306 $dao = jDao::get($this->dao );311 $dao = jDao::get($this->dao, $this->dbProfil); 307 312 $dao->delete($id); 308 313 } branches/1.0beta3.x/lib/jelix/controllers/jControllerDaoCrud.class.php
r571 r593 89 89 90 90 /** 91 * the jDb profil to use with the dao 92 */ 93 protected $dbProfil = ''; 94 95 /** 91 96 * Returned a simple html response to display CRUD contents. You can override this 92 97 * method to return a personnalized response … … 124 129 $rep = $this->_getResponse(); 125 130 126 $dao = jDao::get($this->dao );131 $dao = jDao::get($this->dao, $this->dbProfil); 127 132 $results = $dao->findBy(jDao::createConditions(),$offset,$this->listPageSize); 128 133 $pk = $dao->getPrimaryKeyNames(); … … 184 189 185 190 if($form->check() && $this->_checkDatas($form)){ 186 $id = $form->saveToDao($this->dao );191 $id = $form->saveToDao($this->dao, $this->dbProfil); 187 192 $form->saveAllFiles($this->uploadsDirectory); 188 193 $rep->action = $this->_getAction('view'); … … 211 216 212 217 try { 213 $form->initFromDao($this->dao );218 $form->initFromDao($this->dao, null, $this->dbProfil); 214 219 }catch(Exception $e){ 215 220 $rep->action = $this->_getAction('index'); … … 260 265 261 266 if($form->check() && $this->_checkDatas($form)){ 262 $id = $form->saveToDao($this->dao );267 $id = $form->saveToDao($this->dao, $this->dbProfil); 263 268 $form->saveAllFiles($this->uploadsDirectory); 264 269 $rep->action = $this->_getAction('view'); … … 286 291 // labels with each values. 287 292 $form = jForms::create($this->form, $this->pseudoFormId); 288 $form->initFromDao($this->dao, $id );293 $form->initFromDao($this->dao, $id, $this->dbProfil); 289 294 290 295 $tpl = new jTpl(); … … 304 309 $id = $this->param('id'); 305 310 if( $id !== null ){ 306 $dao = jDao::get($this->dao );311 $dao = jDao::get($this->dao, $this->dbProfil); 307 312 $dao->delete($id); 308 313 } branches/1.0beta3.x/lib/jelix/forms/jFormsBase.class.php
r579 r593 132 132 * @param string $daoSelector the selector of a dao file 133 133 * @param string $key the primary key for the dao. if null, takes the form ID as primary key 134 * @param string $dbProfil the jDb profil to use with the dao 134 135 * @see jDao 135 136 */ 136 public function initFromDao($daoSelector, $key = null ){137 public function initFromDao($daoSelector, $key = null, $dbProfil=''){ 137 138 if($key === null) 138 139 $key = $this->_container->formId; 139 $dao = jDao::create($daoSelector );140 $dao = jDao::create($daoSelector, $dbProfil); 140 141 $daorec = $dao->get($key); 141 142 if(!$daorec) … … 164 165 * it call insert or update depending the value of the formId stored in the container 165 166 * @param string $daoSelector the selector of a dao file 167 * @param string $dbProfil the jDb profil to use with the dao 166 168 * @return mixed the primary key of the new record in a case of inserting 167 169 * @see jDao 168 170 */ 169 public function saveToDao($daoSelector ){170 $dao = jDao::create($daoSelector );171 $daorec = jDao::createRecord($daoSelector );171 public function saveToDao($daoSelector, $dbProfil=''){ 172 $dao = jDao::create($daoSelector, $dbProfil); 173 $daorec = jDao::createRecord($daoSelector, $dbProfil); 172 174 $prop = $dao->getProperties(); 173 175 foreach($this->_controls as $name=>$ctrl){ … … 217 219 * @param string $daoSelector the selector of a dao file 218 220 * @param mixed $primaryKeyNames list of field corresponding to primary keys (optional) 221 * @param string $dbProfil the jDb profil to use with the dao 219 222 * @see jDao 220 223 */ 221 public function initControlFromDao($controlName, $daoSelector, $primaryKeyNames=null ){224 public function initControlFromDao($controlName, $daoSelector, $primaryKeyNames=null, $dbProfil=''){ 222 225 223 226 if(!$this->_controls[$controlName]->isContainer()){ … … 233 236 $primaryKey =array($primaryKey); 234 237 235 $dao = jDao::create($daoSelector );236 $daorec = jDao::createRecord($daoSelector );238 $dao = jDao::create($daoSelector, $dbProfil); 239 $daorec = jDao::createRecord($daoSelector, $dbProfil); 237 240 238 241 $conditions = jDao::createConditions(); … … 279 282 * @param mixed $primaryKey the primary key if the form have no id. (optional) 280 283 * @param mixed $primaryKeyNames list of field corresponding to primary keys (optional) 284 * @param string $dbProfil the jDb profil to use with the dao 281 285 * @see jDao 282 286 */ 283 public function saveControlToDao($controlName, $daoSelector, $primaryKey = null, $primaryKeyNames=null ){287 public function saveControlToDao($controlName, $daoSelector, $primaryKey = null, $primaryKeyNames=null, $dbProfil=''){ 284 288 285 289 if(!$this->_controls[$controlName]->isContainer()){ branches/1.0beta3.x/lib/jelix/forms/jFormsBase.class.php
r579 r593 132 132 * @param string $daoSelector the selector of a dao file 133 133 * @param string $key the primary key for the dao. if null, takes the form ID as primary key 134 * @param string $dbProfil the jDb profil to use with the dao 134 135 * @see jDao 135 136 */ 136 public function initFromDao($daoSelector, $key = null ){137 public function initFromDao($daoSelector, $key = null, $dbProfil=''){ 137 138 if($key === null) 138 139 $key = $this->_container->formId; 139 $dao = jDao::create($daoSelector );140 $dao = jDao::create($daoSelector, $dbProfil); 140 141 $daorec = $dao->get($key); 141 142 if(!$daorec) … … 164 165 * it call insert or update depending the value of the formId stored in the container 165 166 * @param string $daoSelector the selector of a dao file 167 * @param string $dbProfil the jDb profil to use with the dao 166 168 * @return mixed the primary key of the new record in a case of inserting 167 169 * @see jDao 168 170 */ 169 public function saveToDao($daoSelector ){170 $dao = jDao::create($daoSelector );171 $daorec = jDao::createRecord($daoSelector );171 public function saveToDao($daoSelector, $dbProfil=''){ 172 $dao = jDao::create($daoSelector, $dbProfil); 173 $daorec = jDao::createRecord($daoSelector, $dbProfil); 172 174 $prop = $dao->getProperties(); 173 175 foreach($this->_controls as $name=>$ctrl){ … … 217 219 * @param string $daoSelector the selector of a dao file 218 220 * @param mixed $primaryKeyNames list of field corresponding to primary keys (optional) 221 * @param string $dbProfil the jDb profil to use with the dao 219 222 * @see jDao 220 223 */ 221 public function initControlFromDao($controlName, $daoSelector, $primaryKeyNames=null ){224 public function initControlFromDao($controlName, $daoSelector, $primaryKeyNames=null, $dbProfil=''){ 222 225 223 226 if(!$this->_controls[$controlName]->isContainer()){ … … 233 236 $primaryKey =array($primaryKey); 234 237 235 $dao = jDao::create($daoSelector );236 $daorec = jDao::createRecord($daoSelector );238 $dao = jDao::create($daoSelector, $dbProfil); 239 $daorec = jDao::createRecord($daoSelector, $dbProfil); 237 240 238 241 $conditions = jDao::createConditions(); … … 279 282 * @param mixed $primaryKey the primary key if the form have no id. (optional) 280 283 * @param mixed $primaryKeyNames list of field corresponding to primary keys (optional) 284 * @param string $dbProfil the jDb profil to use with the dao 281 285 * @see jDao 282 286 */ 283 public function saveControlToDao($controlName, $daoSelector, $primaryKey = null, $primaryKeyNames=null ){287 public function saveControlToDao($controlName, $daoSelector, $primaryKey = null, $primaryKeyNames=null, $dbProfil=''){ 284 288 285 289 if(!$this->_controls[$controlName]->isContainer()){ trunk/lib/jelix-scripts/commands/createdaocrud.cmd.php
r590 r593 53 53 $agcommand = jxs_load_command('createdao'); 54 54 $options = array(); 55 $profil = ''; 55 56 if ($this->getOption('-profil')) { 56 $options = array('-profil'=>$this->getOption('-profil')); 57 $profil = $this->getOption('-profil'); 58 $options = array('-profil'=>$profil); 57 59 } 58 60 $agcommand->init($options,array('module'=>$this->_parameters['module'], 'name'=>$ctrlname,'table'=>$table)); … … 65 67 $this->createDir($path.'controllers/'); 66 68 $this->createFile($path.'controllers/'.$ctrlname.'.classic.php','controller.daocrud.tpl',array('name'=>$ctrlname, 67 'module'=>$this->_parameters['module'], 'table'=>$table ));69 'module'=>$this->_parameters['module'], 'table'=>$table, 'profil'=>$profil)); 68 70 } 69 71 } trunk/lib/jelix-scripts/commands/createdaocrud.cmd.php
r590 r593 53 53 $agcommand = jxs_load_command('createdao'); 54 54 $options = array(); 55 $profil = ''; 55 56 if ($this->getOption('-profil')) { 56 $options = array('-profil'=>$this->getOption('-profil')); 57 $profil = $this->getOption('-profil'); 58 $options = array('-profil'=>$profil); 57 59 } 58 60 $agcommand->init($options,array('module'=>$this->_parameters['module'], 'name'=>$ctrlname,'table'=>$table)); … … 65 67 $this->createDir($path.'controllers/'); 66 68 $this->createFile($path.'controllers/'.$ctrlname.'.classic.php','controller.daocrud.tpl',array('name'=>$ctrlname, 67 'module'=>$this->_parameters['module'], 'table'=>$table ));69 'module'=>$this->_parameters['module'], 'table'=>$table, 'profil'=>$profil)); 68 70 } 69 71 } trunk/lib/jelix-scripts/templates/controller.daocrud.tpl
r575 r593 15 15 protected $form = '{$module}~{$name}'; 16 16 17 protected $dbProfil = '{$profil}'; 18 17 19 } 18 20 ?> trunk/lib/jelix-scripts/templates/controller.daocrud.tpl
r575 r593 15 15 protected $form = '{$module}~{$name}'; 16 16 17 protected $dbProfil = '{$profil}'; 18 17 19 } 18 20 ?> trunk/lib/jelix/controllers/jControllerDaoCrud.class.php
r571 r593 89 89 90 90 /** 91 * the jDb profil to use with the dao 92 */ 93 protected $dbProfil = ''; 94 95 /** 91 96 * Returned a simple html response to display CRUD contents. You can override this 92 97 * method to return a personnalized response … … 124 129 $rep = $this->_getResponse(); 125 130 126 $dao = jDao::get($this->dao );131 $dao = jDao::get($this->dao, $this->dbProfil); 127 132 $results = $dao->findBy(jDao::createConditions(),$offset,$this->listPageSize); 128 133 $pk = $dao->getPrimaryKeyNames(); … … 184 189 185 190 if($form->check() && $this->_checkDatas($form)){ 186 $id = $form->saveToDao($this->dao );191 $id = $form->saveToDao($this->dao, $this->dbProfil); 187 192 $form->saveAllFiles($this->uploadsDirectory); 188 193 $rep->action = $this->_getAction('view'); … … 211 216 212 217 try { 213 $form->initFromDao($this->dao );218 $form->initFromDao($this->dao, null, $this->dbProfil); 214 219 }catch(Exception $e){ 215 220 $rep->action = $this->_getAction('index'); … … 260 265 261 266 if($form->check() && $this->_checkDatas($form)){ 262 $id = $form->saveToDao($this->dao );267 $id = $form->saveToDao($this->dao, $this->dbProfil); 263 268 $form->saveAllFiles($this->uploadsDirectory); 264 269 $rep->action = $this->_getAction('view'); … … 286 291 // labels with each values. 287 292 $form = jForms::create($this->form, $this->pseudoFormId); 288 $form->initFromDao($this->dao, $id );293 $form->initFromDao($this->dao, $id, $this->dbProfil); 289 294 290 295 $tpl = new jTpl(); … … 304 309 $id = $this->param('id'); 305 310 if( $id !== null ){ 306 $dao = jDao::get($this->dao );311 $dao = jDao::get($this->dao, $this->dbProfil); 307 312 $dao->delete($id); 308 313 } trunk/lib/jelix/controllers/jControllerDaoCrud.class.php
r571 r593 89 89 90 90 /** 91 * the jDb profil to use with the dao 92 */ 93 protected $dbProfil = ''; 94 95 /** 91 96 * Returned a simple html response to display CRUD contents. You can override this 92 97 * method to return a personnalized response … … 124 129 $rep = $this->_getResponse(); 125 130 126 $dao = jDao::get($this->dao );131 $dao = jDao::get($this->dao, $this->dbProfil); 127 132 $results = $dao->findBy(jDao::createConditions(),$offset,$this->listPageSize); 128 133 $pk = $dao->getPrimaryKeyNames(); … … 184 189 185 190 if($form->check() && $this->_checkDatas($form)){ 186 $id = $form->saveToDao($this->dao );191 $id = $form->saveToDao($this->dao, $this->dbProfil); 187 192 $form->saveAllFiles($this->uploadsDirectory); 188 193 $rep->action = $this->_getAction('view'); … … 211 216 212 217 try { 213 $form->initFromDao($this->dao );218 $form->initFromDao($this->dao, null, $this->dbProfil); 214 219 }catch(Exception $e){ 215 220 $rep->action = $this->_getAction('index'); … … 260 265 261 266 if($form->check() && $this->_checkDatas($form)){ 262 $id = $form->saveToDao($this->dao );267 $id = $form->saveToDao($this->dao, $this->dbProfil); 263 268 $form->saveAllFiles($this->uploadsDirectory); 264 269 $rep->action = $this->_getAction('view'); … … 286 291 // labels with each values. 287 292 $form = jForms::create($this->form, $this->pseudoFormId); 288 $form->initFromDao($this->dao, $id );293 $form->initFromDao($this->dao, $id, $this->dbProfil); 289 294 290 295 $tpl = new jTpl(); … … 304 309 $id = $this->param('id'); 305 310 if( $id !== null ){ 306 $dao = jDao::get($this->dao );311 $dao = jDao::get($this->dao, $this->dbProfil); 307 312 $dao->delete($id); 308 313 } trunk/lib/jelix/forms/jFormsBase.class.php
r579 r593 132 132 * @param string $daoSelector the selector of a dao file 133 133 * @param string $key the primary key for the dao. if null, takes the form ID as primary key 134 * @param string $dbProfil the jDb profil to use with the dao 134 135 * @see jDao 135 136 */ 136 public function initFromDao($daoSelector, $key = null ){137 public function initFromDao($daoSelector, $key = null, $dbProfil=''){ 137 138 if($key === null) 138 139 $key = $this->_container->formId; 139 $dao = jDao::create($daoSelector );140 $dao = jDao::create($daoSelector, $dbProfil); 140 141 $daorec = $dao->get($key); 141 142 if(!$daorec) … … 164 165 * it call insert or update depending the value of the formId stored in the container 165 166 * @param string $daoSelector the selector of a dao file 167 * @param string $dbProfil the jDb profil to use with the dao 166 168 * @return mixed the primary key of the new record in a case of inserting 167 169 * @see jDao 168 170 */ 169 public function saveToDao($daoSelector ){170 $dao = jDao::create($daoSelector );171 $daorec = jDao::createRecord($daoSelector );171 public function saveToDao($daoSelector, $dbProfil=''){ 172 $dao = jDao::create($daoSelector, $dbProfil); 173 $daorec = jDao::createRecord($daoSelector, $dbProfil); 172 174 $prop = $dao->getProperties(); 173 175 foreach($this->_controls as $name=>$ctrl){ … … 217 219 * @param string $daoSelector the selector of a dao file 218 220 * @param mixed $primaryKeyNames list of field corresponding to primary keys (optional) 221 * @param string $dbProfil the jDb profil to use with the dao 219 222 * @see jDao 220 223 */ 221 public function initControlFromDao($controlName, $daoSelector, $primaryKeyNames=null ){224 public function initControlFromDao($controlName, $daoSelector, $primaryKeyNames=null, $dbProfil=''){ 222 225 223 226 if(!$this->_controls[$controlName]->isContainer()){ … … 233 236 $primaryKey =array($primaryKey); 234 237 235 $dao = jDao::create($daoSelector );236 $daorec = jDao::createRecord($daoSelector );238 $dao = jDao::create($daoSelector, $dbProfil); 239 $daorec = jDao::createRecord($daoSelector, $dbProfil); 237 240 238 241 $conditions = jDao::createConditions(); … … 279 282 * @param mixed $primaryKey the primary key if the form have no id. (optional) 280 283 * @param mixed $primaryKeyNames list of field corresponding to primary keys (optional) 284 * @param string $dbProfil the jDb profil to use with the dao 281 285 * @see jDao 282 286 */ 283 public function saveControlToDao($controlName, $daoSelector, $primaryKey = null, $primaryKeyNames=null ){287 public function saveControlToDao($controlName, $daoSelector, $primaryKey = null, $primaryKeyNames=null, $dbProfil=''){ 284 288 285 289 if(!$this->_controls[$controlName]->isContainer()){ trunk/lib/jelix/forms/jFormsBase.class.php
r579 r593 132 132 * @param string $daoSelector the selector of a dao file 133 133 * @param string $key the primary key for the dao. if null, takes the form ID as primary key 134 * @param string $dbProfil the jDb profil to use with the dao 134 135 * @see jDao 135 136 */ 136 public function initFromDao($daoSelector, $key = null ){137 public function initFromDao($daoSelector, $key = null, $dbProfil=''){ 137 138 if($key === null) 138 139 $key = $this->_container->formId; 139 $dao = jDao::create($daoSelector );140 $dao = jDao::create($daoSelector, $dbProfil); 140 141 $daorec = $dao->get($key); 141 142 if(!$daorec) … … 164 165 * it call insert or update depending the value of the formId stored in the container 165 166 * @param string $daoSelector the selector of a dao file 167 * @param string $dbProfil the jDb profil to use with the dao 166 168 * @return mixed the primary key of the new record in a case of inserting 167 169 * @see jDao 168 170 */ 169 public function saveToDao($daoSelector ){170 $dao = jDao::create($daoSelector );171 $daorec = jDao::createRecord($daoSelector );171 public function saveToDao($daoSelector, $dbProfil=''){ 172 $dao = jDao::create($daoSelector, $dbProfil); 173 $daorec = jDao::createRecord($daoSelector, $dbProfil); 172 174 $prop = $dao->getProperties(); 173 175 foreach($this->_controls as $name=>$ctrl){ … … 217 219 * @param string $daoSelector the selector of a dao file 218 220 * @param mixed $primaryKeyNames list of field corresponding to primary keys (optional) 221 * @param string $dbProfil the jDb profil to use with the dao 219 222 * @see jDao 220 223 */ 221 public function initControlFromDao($controlName, $daoSelector, $primaryKeyNames=null ){224 public function initControlFromDao($controlName, $daoSelector, $primaryKeyNames=null, $dbProfil=''){ 222 225 223 226 if(!$this->_controls[$controlName]->isContainer()){ … … 233 236 $primaryKey =array($primaryKey); 234 237 235 $dao = jDao::create($daoSelector );236 $daorec = jDao::createRecord($daoSelector );238 $dao = jDao::create($daoSelector, $dbProfil); 239 $daorec = jDao::createRecord($daoSelector, $dbProfil); 237 240 238 241 $conditions = jDao::createConditions(); … … 279 282 * @param mixed $primaryKey the primary key if the form have no id. (optional) 280 283 * @param mixed $primaryKeyNames list of field corresponding to primary keys (optional) 284 * @param string $dbProfil the jDb profil to use with the dao 281 285 * @see jDao 282 286 */ 283 public function saveControlToDao($controlName, $daoSelector, $primaryKey = null, $primaryKeyNames=null ){287 public function saveControlToDao($controlName, $daoSelector, $primaryKey = null, $primaryKeyNames=null, $dbProfil=''){ 284 288 285 289 if(!$this->_controls[$controlName]->isContainer()){
