startseite+worker_item

This commit is contained in:
Martin Müller 2014-03-05 00:01:58 +01:00
parent c167e24236
commit 5d8504944e
7 changed files with 147 additions and 64 deletions

View File

@ -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');

View File

@ -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']);

View File

@ -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);
?>
<div class="item">
<div class="icon"> <img src="{% if workershow.avatar %}{{workershow.avatar.url}}{% else %}{{ STATIC_URL }}img/icon_user.png{% endif %}"></div>
<div class="openingitem">
<h3>
<?php
if($profil[$AppUser]['take_systemwide'])
echo $profil[$User]['first_name'].' '.$profil[$User]['last_name'];
else
echo $profil[$AppUser]['first_name'].' '.$profil[$AppUser]['last_name'];
?>
</h3>
<div class="icon">
<img src="<?php
if($profil[$AppUser]['take_systemwide'])
if($profil[$User]['avatar'])
echo $MEDIA_URL.$profil[$User]['avatar'];
else
echo $STATIC_URL."img/icon_user.png";
else
if($profil[$AppUser]['avatar'])
echo $MEDIA_URL.$profil[$AppUser]['avatar'];
else
echo $STATIC_URL."img/icon_user.png";
?>"/>
</div>
<div class="left">
<span class="title">{{workershow}}</span>
<span>{% trans 'city' %}:{{workershow.city}}</span>
<span>{% trans 'branch' %}:{{workershow.branch}}</span>
<span>{% trans 'graducation' %}:{{workershow.graducation}}</span>
{% if workershow.workexperience %}
<span>{% trans 'workexperience' %}:{{workershow.workexperience}} {% trans 'years' %}</span>
{% endif %}
<span>{{application.created}}</span>
<span><?=__('dreamjob.city').': '.$profil[$DreamjobUser]['city'];?></span>
<span><?=__('dreamjob.graducation').': '.$profil[$DreamjobListGraducation]['name'];?></span>
<?php if($profil['DreamjobWorker']['workexperience']){ ?>
<span><?=__('dreamjob.workexperience').': '.$profil['DreamjobWorker']['workexperience'].' ',__('dreamjob.years');?></span>
<?php } ?>
<?php if($enableOpening){ ?>
<span><?=$this->Time->format('d.m.Y H:i', $profil['DreamjobJobApplication']['created']);?></span>
<?php } ?>
</div>
<div class="right">
{% if application.closed %}
<a href="{% url de.miconware.dreamjob.jobs.views.opening_application opening=application.opening.pk application=application.pk showarchive=showarchive %}"><span jtype="button">{% trans 'application open' %}</span></a>
<a href="{% url de.miconware.dreamjob.jobs.views.application_show application.pk %}"><span jtype="button">{% trans 'detail' %}</span></a>
{% else %}
<a href="{% url de.miconware.dreamjob.jobs.views.opening_application opening=application.opening.pk application=application.pk showarchive=showarchive %}"><span jtype="button">{% trans 'application archiv' %}</span></a>
<a href="{% url de.miconware.dreamjob.jobs.views.application_show application.pk %}"><span jtype="button">
{% 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 %}
</span></a>
{% endif %}
<div class="btn-group-vertical">
<?php
if($enableOpening){
$status = 'dreamjob.application.close';
$statusApp = null;
$archiv = array("archiv"=> $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').'<span class="badge">'.$statusApp.'</span>';
$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"));
}
?>
</div>
</div>
</div>

View File

@ -3,7 +3,31 @@
*
*/
?>
<div class="box" style="text-align:center;">
<img src="http://openhatch.org/blog/wp-content/uploads/2014/01/osctc-columbia.jpg" style="width:500;height:250px;float:left;margin-right:20px;"/>
<div style="display:inline-block;width:380px;height:250px;background-color:red; padding-top:40px;">
<h1 style="color:white;"><?=__('dreamjob.search');?></h1>
<div style="display:inline-block;width:80%;">
<div class="input-group">
<input type="text" class="form-control">
<span class="input-group-btn">
<button class="btn btn-default" type="button" style="background-color:orange;">Go!</button>
</span>
</div>
</div>
</div>
</div>
<div class="box">
<h1><?=__("dreamjob.startpage.openings");?></h1>
<div class="openinggroup">
<?php
foreach($openings as $opening){
echo $this->element('job_opening_item',array('opening' => $opening));
}
?>
</div>
</div>
<div class="box" style="margin-top:100px;">
Test Profile
<p><?php echo $this->Html->link("Miconware", '/user/24/'); ?>mail:imberg@miconware.de - PW:sebi</p>
<p><?php echo $this->Html->link("Sebi", '/user/4/'); ?>mail:- - PW:-</p>

View File

@ -31,7 +31,6 @@
if($application['DreamjobJobApplication']['closed'])
$str = 'dreamjob.application.close.activet';
?>
<!-- TODO -->
<?=$this->Html->link(__($str),array('controller'=>'job','action'=>'applicationGet','id'=>$application['DreamjobJobApplication']['id'],'hiv'=>'hiv')); ?>
<?php } ?>
&nbsp;
@ -86,11 +85,9 @@
echo $application['AppUser']['nickname']." ".$application['DreamjobCompany']['corporateform'];
}else{
echo $application['WorkerUser']['first_name']." ".$application['WorkerUser']['last_name'];
?>
<c:out value="${application.worker.firstName} ${application.worker.lastName}"/>
<?php } ?>
} ?>
</span>
<span class="created" style="float:right;<?php if($msgitem['saw']){ ?>color:red;<?php } ?>">
<span class="created" style="float:right;<?php if(!$msgitem['saw']){ ?>color:red;<?php } ?>">
<?=$this->Time->format('d.m.Y H:i', $msgitem['created']);?>
</span>
</legend>

View File

@ -22,7 +22,7 @@
<div class="openinggroup">
<?php
foreach($applications as $opening){
echo $this->element('user_worker_item',array('opening' => $opening,'enableOpening'=>true));
echo $this->element('user_worker_item',array('profil' => $opening,'enableOpening'=>true));
}
?>
</div>

BIN
app/webroot/img/logo.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB