diff --git a/app/Controller/UserController.php b/app/Controller/UserController.php index 2ce9160..1e8f156 100755 --- a/app/Controller/UserController.php +++ b/app/Controller/UserController.php @@ -378,8 +378,10 @@ class UserController extends AppController { if($result){ $this->MiconwareSession->refreshCache(); - $profil = $this->MiconwareSession->getWorker(); - if(empty($profil) or count($profil) <= 0) + + if(isset($profil['DreamjobWorker'])) + $profil = $this->MiconwareSession->getWorker(); + else $profil = $this->MiconwareSession->getCompany(); $this->MiconwareSession->setFlash(__('dreamjob.pages.delete'),'flash',array('alert'=>'success')); }else{ diff --git a/app/Model/DreamjobPageImage.php b/app/Model/DreamjobPageImage.php index d5d4a5f..d4cc0f5 100644 --- a/app/Model/DreamjobPageImage.php +++ b/app/Model/DreamjobPageImage.php @@ -127,7 +127,7 @@ public function processUpload($check=array()) { public function delete($id = NULL, $cascade = false){ $dataSource = $this->getDataSource(); $dataSource->begin(); - $result = $this->delete($id['DreamjobPageInh']['id'],$cascade); + $result = parent::delete($id['DreamjobPageInh']['id'],$cascade); if($result){ $result = $this->DreamjobPageInh->delete($id['DreamjobPageInh']['id'],$cascade); } diff --git a/app/Model/DreamjobPageText.php b/app/Model/DreamjobPageText.php index 92c706e..46f005c 100644 --- a/app/Model/DreamjobPageText.php +++ b/app/Model/DreamjobPageText.php @@ -43,7 +43,7 @@ class DreamjobPageText extends AppModel { public function delete($id = NULL, $cascade = false){ $dataSource = $this->getDataSource(); $dataSource->begin(); - $result = $this->delete($id,$cascade); + $result = parent::delete($id,$cascade); if($result){ $result = $this->DreamjobPageInh->delete($id,$cascade); }