This commit is contained in:
Martin Müller 2014-04-16 15:41:56 +02:00
parent 9a359b265c
commit 25de46c9f0
4 changed files with 22 additions and 6 deletions

View File

@ -374,9 +374,7 @@ class UserController extends AppController {
$result = $this->DreamjobPageImage->delete($page,false); $result = $this->DreamjobPageImage->delete($page,false);
}else }else
$result = $this->DreamjobPageText->delete($page['DreamjobPageInh']['id'],false); $result = $this->DreamjobPageText->delete($page['DreamjobPageInh']['id'],false);
if($result){
$result = $this->DreamjobPageInh->delete($page['DreamjobPageInh']['id'],false);
}
if($result){ if($result){
$this->MiconwareSession->refreshCache(); $this->MiconwareSession->refreshCache();
$profil = $this->MiconwareSession->getWorker(); $profil = $this->MiconwareSession->getWorker();

View File

@ -124,10 +124,13 @@ public function processUpload($check=array()) {
return TRUE; return TRUE;
} }
public function delete($id = NULL, $cascade = true){ public function delete($id = NULL, $cascade = false){
$dataSource = $this->getDataSource(); $dataSource = $this->getDataSource();
$dataSource->begin(); $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){ if($result){
$filename = WWW_ROOT . $this->uploadDir . DS .$id['DreamjobPageImage']['image']; $filename = WWW_ROOT . $this->uploadDir . DS .$id['DreamjobPageImage']['image'];
chmod($filename,0755); chmod($filename,0755);

View File

@ -40,6 +40,21 @@ class DreamjobPageText extends AppModel {
* *
* @var array * @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( public $validate = array(
'page_ptr_id' => array( 'page_ptr_id' => array(
'numeric' => array( 'numeric' => array(

View File

@ -21,7 +21,7 @@ if($profil['AppUser']['take_systemwide']){
else else
$url = $MEDIA.DS.$profil['AppUser']['avatar']; $url = $MEDIA.DS.$profil['AppUser']['avatar'];
if($edit and isset($url)) if($edit and isset($url))
$url = 'img/icon_user.png'; $url = 'img/icon_company.png';
?> ?>
<img src="<?=$url;?>"/> <img src="<?=$url;?>"/>
<?php if($edit): ?> <?php if($edit): ?>