diff --git a/app/Controller/HomeController.php b/app/Controller/HomeController.php index 33fb225..fd7ef09 100755 --- a/app/Controller/HomeController.php +++ b/app/Controller/HomeController.php @@ -10,7 +10,7 @@ class HomeController extends AppController { * @var array */ - public $uses = array(); + public $uses = array("DreamjobJobOpening"); /** * Displays a view @@ -25,6 +25,8 @@ class HomeController extends AppController { $this->MiconwareSession->init($this); $this->MiconwareSession->initWeb($this); $this->MiconwareSession->setFlash('In Entwicklung','flash',array('alert'=>'info')); + $openings = $this->DreamjobJobOpening->find('all',array('contitions'=>array('active'=>true),'order'=>'DreamjobJobOpening.id DESC','limit'=>3)); + $this->set('openings',$openings); $this->set('title', 'dreamjob.startpage'); $this->set('MENU_START', true); $this->render('/Home/home'); diff --git a/app/Controller/JobController.php b/app/Controller/JobController.php index 2a48477..7dd1acb 100644 --- a/app/Controller/JobController.php +++ b/app/Controller/JobController.php @@ -219,13 +219,19 @@ class JobController extends AppController { $this->DreamjobJobMsg->data['DreamjobJobMsg']['saw'] = false; $this->DreamjobJobMsg->data['DreamjobJobMsg']['application_id'] = $application['DreamjobJobApplication']['id']; $this->DreamjobJobMsg->data['DreamjobJobMsg']['fromcompany'] = is_array($COMPANY) and count($COMPANY) > 0; - if ($this->DreamjobJobMsg->save()) { + if($this->DreamjobJobMsg->save()) { $application = $this->DreamjobJobApplication->find('first',array('conditions' => array('DreamjobJobApplication.id'=> $this->request->params['id'] ))); $this->MiconwareSession->setFlash('dreamjob.application.msg.add','flash',array('alert'=>'success')); }else{ $this->MiconwareSession->setFlash('dreamjob.application.msg.error','flash',array('alert'=>'danger')); } } + //TODO Mark as read + if(is_array($WORKER) and count($WORKER) > 0) + $this->DreamjobJobMsg->updateAll(array("saw"=>true),array("DreamjobJobMsg.fromcompany"=>true,"DreamjobJobMsg.application_id"=>$this->request->params['id'])); + if(is_array($COMPANY) and count($COMPANY) > 0) + $this->DreamjobJobMsg->updateAll(array("saw"=>true),array("DreamjobJobMsg.fromcompany"=>false,"DreamjobJobMsg.application_id"=>$this->request->params['id'])); + }else{ $this->set('msg',false); if(!empty($this->request->params['page'])){ @@ -256,6 +262,17 @@ class JobController extends AppController { if(isset($this->request->params['id'])){ if(is_array($COMPANY) and count($COMPANY) > 0) $opening = $this->DreamjobJobOpening->find('first',array('conditions' => array('DreamjobJobOpening.company_id' => $COMPANY['AppUser']['id'],'DreamjobJobOpening.id'=> $this->request->params['id'] ))); + if(!empty($this->request->query['archiv']) and count($opening)>0){ + $application = $this->DreamjobJobApplication->find('first',array('conditions' =>array('DreamjobJobApplication.id'=>$this->request->query['archiv'], 'DreamjobJobApplication.opening_id'=> $this->request->params['id']))); + $this->DreamjobJobApplication->id = $this->request->query['archiv']; + if ($this->DreamjobJobApplication->saveField('closed',!$application['DreamjobJobApplication']['closed'])) { + $application = $this->DreamjobJobApplication->find('first',array('conditions' => array('DreamjobJobApplication.id'=> $this->request->params['id'] ))); + $this->MiconwareSession->setFlash('dreamjob.application.archiv','flash',array('alert'=>'success')); + }else{ + $this->MiconwareSession->setFlash('dreamjob.application.archiv.error','flash',array('alert'=>'danger')); + } + } + $filter_current = false; $filter_archiv = false; $condition = array('DreamjobJobOpening.company_id' => $COMPANY['AppUser']['id'],'DreamjobJobApplication.opening_id'=> $this->request->params['id']); diff --git a/app/View/Elements/user_worker_item.ctp b/app/View/Elements/user_worker_item.ctp index 3b7b227..1bb61a7 100644 --- a/app/View/Elements/user_worker_item.ctp +++ b/app/View/Elements/user_worker_item.ctp @@ -2,33 +2,76 @@ /* * */ + $User = 'User'; + $DreamjobUser = 'DreamjobUser'; + $AppUser = 'AppUser'; + $DreamjobListGraducation = 'DreamjobListGraducation'; + if($enableOpening){ + $User = 'WorkerUser'; + $DreamjobUser = 'DreamjobUserWorker'; + $AppUser = 'AppUserWorker'; + $DreamjobListGraducation = 'WorkerGraducation'; + } +// echo var_dump($profil); ?> -
Html->link("Miconware", '/user/24/'); ?>mail:imberg@miconware.de - PW:sebi
Html->link("Sebi", '/user/4/'); ?>mail:- - PW:-
diff --git a/app/View/Job/application.ctp b/app/View/Job/application.ctp index 9cd3488..e0b1f12 100644 --- a/app/View/Job/application.ctp +++ b/app/View/Job/application.ctp @@ -25,24 +25,23 @@