From 25de46c9f011e9f20b017bf1948eb83d48a4a5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Wed, 16 Apr 2014 15:41:56 +0200 Subject: [PATCH] suche --- app/Controller/UserController.php | 4 +--- app/Model/DreamjobPageImage.php | 7 +++++-- app/Model/DreamjobPageText.php | 15 +++++++++++++++ app/View/User/company.ctp | 2 +- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/Controller/UserController.php b/app/Controller/UserController.php index 0116a1c..b370c3f 100755 --- a/app/Controller/UserController.php +++ b/app/Controller/UserController.php @@ -374,9 +374,7 @@ class UserController extends AppController { $result = $this->DreamjobPageImage->delete($page,false); }else $result = $this->DreamjobPageText->delete($page['DreamjobPageInh']['id'],false); - if($result){ - $result = $this->DreamjobPageInh->delete($page['DreamjobPageInh']['id'],false); - } + if($result){ $this->MiconwareSession->refreshCache(); $profil = $this->MiconwareSession->getWorker(); diff --git a/app/Model/DreamjobPageImage.php b/app/Model/DreamjobPageImage.php index fc2dd30..d5d4a5f 100644 --- a/app/Model/DreamjobPageImage.php +++ b/app/Model/DreamjobPageImage.php @@ -124,10 +124,13 @@ public function processUpload($check=array()) { return TRUE; } -public function delete($id = NULL, $cascade = true){ +public function delete($id = NULL, $cascade = false){ $dataSource = $this->getDataSource(); $dataSource->begin(); - $result = $this->delete($id['DreamjobPageInh']['id'],false); + $result = $this->delete($id['DreamjobPageInh']['id'],$cascade); + if($result){ + $result = $this->DreamjobPageInh->delete($id['DreamjobPageInh']['id'],$cascade); + } if($result){ $filename = WWW_ROOT . $this->uploadDir . DS .$id['DreamjobPageImage']['image']; chmod($filename,0755); diff --git a/app/Model/DreamjobPageText.php b/app/Model/DreamjobPageText.php index f06ab83..92c706e 100644 --- a/app/Model/DreamjobPageText.php +++ b/app/Model/DreamjobPageText.php @@ -40,6 +40,21 @@ class DreamjobPageText extends AppModel { * * @var array */ + public function delete($id = NULL, $cascade = false){ + $dataSource = $this->getDataSource(); + $dataSource->begin(); + $result = $this->delete($id,$cascade); + if($result){ + $result = $this->DreamjobPageInh->delete($id,$cascade); + } + if ($result) { + $dataSource->commit(); + return true; + } else { + $dataSource->rollback(); + } + return false; + } public $validate = array( 'page_ptr_id' => array( 'numeric' => array( diff --git a/app/View/User/company.ctp b/app/View/User/company.ctp index 06363ca..780ebcc 100644 --- a/app/View/User/company.ctp +++ b/app/View/User/company.ctp @@ -21,7 +21,7 @@ if($profil['AppUser']['take_systemwide']){ else $url = $MEDIA.DS.$profil['AppUser']['avatar']; if($edit and isset($url)) - $url = 'img/icon_user.png'; + $url = 'img/icon_company.png'; ?>