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); ?> -
-
+
+

+ +

+
+ "/> +
- {{workershow}} - {% trans 'city' %}:{{workershow.city}} - {% trans 'branch' %}:{{workershow.branch}} - {% trans 'graducation' %}:{{workershow.graducation}} - {% if workershow.workexperience %} - {% trans 'workexperience' %}:{{workershow.workexperience}} {% trans 'years' %} - {% endif %} - {{application.created}} + + + + + + + Time->format('d.m.Y H:i', $profil['DreamjobJobApplication']['created']);?> +
- {% if application.closed %} - {% trans 'application open' %} - {% trans 'detail' %} - - {% else %} - {% trans 'application archiv' %} - - {% if application.messages_set.all|length > 0 %} - {% blocktrans with new=application.newmsgcompany.all|length all=application.messages_set.all|length %}detail ({{new}}/{{all}}){% endblocktrans %} - {% else %} - {% trans 'detail' %} - {% endif %} - - {% endif %} +
+ $profil['DreamjobJobApplication']['id']); + if($profil['DreamjobJobApplication']['closed']){ + $status = 'dreamjob.application.close.activet'; + $statusApp= count($profil['DreamjobJobMsg']); + $newcount=0; + foreach($profil['DreamjobJobMsg'] as $msg) + if(!$msg['saw']) + $newcount++; + if($newcount>0) + $statusApp = $newcount."/".$statusApp; + $statusApp =__('dreamjob.applicated').''.$statusApp.''; + $archiv['filter'] = 'archiv'; + }else{ + $statusApp = __('dreamjob.application'); + } + echo $this->Html->link(__($status),array('controller'=>'job', 'action'=>'applicationByOpening', 'id'=> $profil['DreamjobJobApplication']['opening_id'],'?'=>$archiv),array("class" => "btn btn-default")); + echo $this->Html->link($statusApp,array('controller'=>'job', 'action'=>'applicationGet', 'id'=> $profil['DreamjobJobApplication']['id']),array("class" => "btn btn-default")); + } + ?> +
diff --git a/app/View/Home/home.ctp b/app/View/Home/home.ctp index 899ff05..bbf9c4d 100755 --- a/app/View/Home/home.ctp +++ b/app/View/Home/home.ctp @@ -3,7 +3,31 @@ * */ ?> +
+ +
+

+
+
+ + + + +
+
+
+
+

+
+ element('job_opening_item',array('opening' => $opening)); + } + ?> +
+
+
Test Profile

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 @@
- - - - Html->link(__($str),array('controller'=>'job','action'=>'applicationGet','id'=>$application['DreamjobJobApplication']['id'],'hiv'=>'hiv')); ?> - -   - - - Html->link(__('dreamjob.applicated'),array('controller'=>'job','action'=>'applicationGet','id'=>$application['DreamjobJobApplication']['id'])); - }else{ - echo $this->Html->link(__('dreamjob.message.send'),array('controller'=>'job','action'=>'applicationGet','id'=>$application['DreamjobJobApplication']['id'],'ages'=>'ages')); + + + Html->link(__($str),array('controller'=>'job','action'=>'applicationGet','id'=>$application['DreamjobJobApplication']['id'],'hiv'=>'hiv')); ?> + +   + + + Html->link(__('dreamjob.applicated'),array('controller'=>'job','action'=>'applicationGet','id'=>$application['DreamjobJobApplication']['id'])); + }else{ + echo $this->Html->link(__('dreamjob.message.send'),array('controller'=>'job','action'=>'applicationGet','id'=>$application['DreamjobJobApplication']['id'],'ages'=>'ages')); } ?> - +
@@ -58,10 +57,10 @@
-
- - -
+
+ + +