ISearch - noch nicht fertig!

This commit is contained in:
Martin Müller 2014-03-28 16:22:19 +01:00
parent 0ff21cece8
commit 675bc39bf0
18 changed files with 295 additions and 37 deletions

View File

@ -30,11 +30,9 @@ class MiconwareSessionComponent extends Component {
); );
$controller->set('default_hForm',array( $controller->set('default_hForm',array(
'inputDefaults' => array( 'inputDefaults' => array(
'div' => array('class' => 'form-group'), 'div' => false,
'label' => array('class' => 'col-sm-3 control-label'), 'label' => false,
'between' => '<div class="col-sm-9">', 'error' => false,
'after' => '</div>',
'error' => array('attribute'=>array('wrap'=>'span','class'=>'help-block')),
'class' => 'form-control '), 'class' => 'form-control '),
'class'=>'hide-form hide-input' 'class'=>'hide-form hide-input'
) )
@ -108,6 +106,20 @@ class MiconwareSessionComponent extends Component {
'conditions' => array('AppUser.user_id' => $user_id) 'conditions' => array('AppUser.user_id' => $user_id)
)); ));
} }
public static function getOpeningCondition(){
return array('and'=>array(
'DreamjobJobOpening.active'=>true,
'DreamjobJobOpening.startdate <='=> date("Y-m-d"),
'DreamjobJobOpening.enddate >='=> date("Y-m-d", strtotime("+1 day"))
));
}
/** /**
* PasswordHasg * PasswordHasg
*/ */

View File

@ -20,19 +20,13 @@ class HomeController extends AppController {
* @throws NotFoundException When the view file could not be found * @throws NotFoundException When the view file could not be found
* or MissingViewException in debug mode. * or MissingViewException in debug mode.
*/ */
public static function getOpeningCondition(){
return array('and'=>array(
'DreamjobJobOpening.active'=>true,
'DreamjobJobOpening.startdate <='=> date("Y-m-d"),
'DreamjobJobOpening.enddate >='=> date("Y-m-d", strtotime("+1 day"))
));
}
private $opening_limit = 3; private $opening_limit = 3;
public function home() { public function home() {
$this->MiconwareSession->init($this); $this->MiconwareSession->init($this);
$this->MiconwareSession->initWeb($this); $this->MiconwareSession->initWeb($this);
$openings = $this->DreamjobJobOpening->find('all',array('conditions'=>HomeController::getOpeningCondition(), $openings = $this->DreamjobJobOpening->find('all',array('conditions'=>$this->MiconwareSession->getOpeningCondition(),
'order'=>'DreamjobJobOpening.id DESC','limit'=> $this->opening_limit)); 'order'=>'DreamjobJobOpening.id DESC','limit'=> $this->opening_limit));
$this->set('openings',$openings); $this->set('openings',$openings);
$this->set('title', 'dreamjob.startpage'); $this->set('title', 'dreamjob.startpage');
@ -60,7 +54,7 @@ class HomeController extends AppController {
$this->MiconwareSession->initWeb($this); $this->MiconwareSession->initWeb($this);
$openings = $this->DreamjobJobOpening->find('all',array('conditions'=>HomeController::getOpeningCondition(), $openings = $this->DreamjobJobOpening->find('all',array('conditions'=>$this->MiconwareSession->getOpeningCondition(),
'order'=>'DreamjobJobOpening.id DESC','limit'=> $this->opening_limit)); 'order'=>'DreamjobJobOpening.id DESC','limit'=> $this->opening_limit));
$this->set('openings',$openings); $this->set('openings',$openings);
$this->set('title', 'dreamjob.startpage'); $this->set('title', 'dreamjob.startpage');
@ -77,7 +71,7 @@ class HomeController extends AppController {
$this->MiconwareSession->setFlash('dreamjob.loggingoutError','flash',array('alert'=>'danger')); $this->MiconwareSession->setFlash('dreamjob.loggingoutError','flash',array('alert'=>'danger'));
$this->MiconwareSession->initWeb($this); $this->MiconwareSession->initWeb($this);
$openings = $this->DreamjobJobOpening->find('all',array('conditions'=>HomeController::getOpeningCondition(), $openings = $this->DreamjobJobOpening->find('all',array('conditions'=>$this->MiconwareSession->getOpeningCondition(),
'order'=>'DreamjobJobOpening.id DESC','limit'=> $this->opening_limit)); 'order'=>'DreamjobJobOpening.id DESC','limit'=> $this->opening_limit));
$this->set('openings',$openings); $this->set('openings',$openings);
$this->set('title', 'dreamjob.startpage'); $this->set('title', 'dreamjob.startpage');

View File

@ -10,7 +10,7 @@ class JobController extends AppController {
* @var array * @var array
*/ */
public $uses = array('DreamjobJobOpening','DreamjobJobFavority','DreamjobJobApplication','DreamjobPageText','DreamjobPageImage','DreamjobJobMsg','DreamjobCvCategory'); public $uses = array('DreamjobJobOpening','DreamjobJobFavority','DreamjobJobApplication','DreamjobPageText','DreamjobPageImage','DreamjobJobMsg','DreamjobCvCategory','DreamjobListBranch');
/** /**
* Displays a view * Displays a view
@ -61,6 +61,7 @@ class JobController extends AppController {
} }
$this->set('kindofjobs', $this->DreamjobJobOpening->DreamjobListKindofjob->find('list')); $this->set('kindofjobs', $this->DreamjobJobOpening->DreamjobListKindofjob->find('list'));
$this->set('graducations', $this->DreamjobJobOpening->DreamjobListGraducation->find('list')); $this->set('graducations', $this->DreamjobJobOpening->DreamjobListGraducation->find('list'));
$this->set('branches',$this->DreamjobListBranch->find('list'));
$this->render('/Job/opening_edit'); $this->render('/Job/opening_edit');
}else{ }else{
$this->set('error', 'dreamjob.error.noCompany'); $this->set('error', 'dreamjob.error.noCompany');
@ -95,6 +96,7 @@ class JobController extends AppController {
$this->request->data=$load; $this->request->data=$load;
$this->set('kindofjobs', $this->DreamjobJobOpening->DreamjobListKindofjob->find('list')); $this->set('kindofjobs', $this->DreamjobJobOpening->DreamjobListKindofjob->find('list'));
$this->set('graducations', $this->DreamjobJobOpening->DreamjobListGraducation->find('list')); $this->set('graducations', $this->DreamjobJobOpening->DreamjobListGraducation->find('list'));
$this->set('branches',$this->DreamjobListBranch->find('list'));
} }
if(empty($this->request->data['DreamjobJobOpening'])){ if(empty($this->request->data['DreamjobJobOpening'])){
@ -133,7 +135,7 @@ class JobController extends AppController {
$this->MiconwareSession->setFlash('dreamjob.opening.fav.add','flash',array('alert'=>'success')); $this->MiconwareSession->setFlash('dreamjob.opening.fav.add','flash',array('alert'=>'success'));
} }
} }
$con = HomeController::getOpeningCondition(); $con = $this->MiconwareSession->getOpeningCondition();
$con['DreamjobJobOpening.id'] = $this->request->params['id']; $con['DreamjobJobOpening.id'] = $this->request->params['id'];
$opening = $this->DreamjobJobOpening->find('first',array('conditions' => $con)); $opening = $this->DreamjobJobOpening->find('first',array('conditions' => $con));
} }
@ -163,7 +165,7 @@ class JobController extends AppController {
$fav_id = array(); $fav_id = array();
foreach($self['Favority'] as $fav) foreach($self['Favority'] as $fav)
$fav_id[]=$fav['id']; $fav_id[]=$fav['id'];
$con = HomeController::getOpeningCondition(); $con = $this->MiconwareSession->getOpeningCondition();
$con['DreamjobJobOpening.id'] =$fav_id; $con['DreamjobJobOpening.id'] =$fav_id;
$openings = $this->DreamjobJobOpening->find('all',array('conditions' => $con)); $openings = $this->DreamjobJobOpening->find('all',array('conditions' => $con));
$this->set('openings',$openings); $this->set('openings',$openings);
@ -314,7 +316,7 @@ class JobController extends AppController {
if(!empty($w)){ if(!empty($w)){
$opening = null; $opening = null;
if(!empty($this->request->params['id'])){ if(!empty($this->request->params['id'])){
$con = HomeController::getOpeningCondition(); $con = $this->MiconwareSession->getOpeningCondition();
$con['DreamjobJobOpening.id'] = $this->request->params['id']; $con['DreamjobJobOpening.id'] = $this->request->params['id'];
$opening = $this->DreamjobJobOpening->find('first',array('conditions' => $con)); $opening = $this->DreamjobJobOpening->find('first',array('conditions' => $con));
} }

View File

@ -10,7 +10,7 @@ class UserController extends AppController {
* @var array * @var array
*/ */
public $uses = array('DreamjobListGraducation', 'DreamjobWorker', 'DreamjobCompany', 'DreamjobPageText','DreamjobPageInh', 'DreamjobPageImage', 'DreamjobJobOpening', 'DreamjobCvCategory', 'DreamjobListGraducation', 'Mannerofaddress'); public $uses = array('DreamjobListGraducation', 'DreamjobWorker', 'DreamjobCompany', 'DreamjobPageText','DreamjobPageInh', 'DreamjobPageImage', 'DreamjobJobOpening', 'DreamjobCvCategory', 'DreamjobListGraducation', 'DreamjobListJob','DreamjobListKindofjob','DreamjobListBranch','Mannerofaddress','DreamjobISearch');
public $components = array('MiconwareSession','RequestHandler'); public $components = array('MiconwareSession','RequestHandler');
/** /**
@ -100,7 +100,7 @@ class UserController extends AppController {
$this->set('page',$page); $this->set('page',$page);
if(!$hard_error) if(!$hard_error)
if($company){ if($company){
$con = HomeController::getOpeningCondition(); $con = $this->MiconwareSession->getOpeningCondition();
$con['DreamjobJobOpening.company_id'] = $profil['AppUser']['id']; $con['DreamjobJobOpening.company_id'] = $profil['AppUser']['id'];
$openings = $this->DreamjobJobOpening->find('all',array('conditions' => $con)); $openings = $this->DreamjobJobOpening->find('all',array('conditions' => $con));
$this->set("openings",$openings); $this->set("openings",$openings);
@ -237,7 +237,7 @@ class UserController extends AppController {
if($company){ if($company){
$profil['DreamjobCompany']['corporateform'] = $this->request->data['DreamjobCompany']['corporateform']; $profil['DreamjobCompany']['corporateform'] = $this->request->data['DreamjobCompany']['corporateform'];
$profil['DreamjobCompany']['owner'] = $this->request->data['DreamjobCompany']['owner']; $profil['DreamjobCompany']['owner'] = $this->request->data['DreamjobCompany']['owner'];
$profil['DreamjobCompany']['branch'] = $this->request->data['DreamjobCompany']['branch']; $profil['DreamjobCompany']['branch_id'] = $this->request->data['DreamjobCompany']['branch_id'];
$profil['DreamjobCompany']['headcount'] = $this->request->data['DreamjobCompany']['headcount']; $profil['DreamjobCompany']['headcount'] = $this->request->data['DreamjobCompany']['headcount'];
$profil['DreamjobCompany']['bank_details'] = $this->request->data['DreamjobCompany']['bank_details']; $profil['DreamjobCompany']['bank_details'] = $this->request->data['DreamjobCompany']['bank_details'];
$profil['DreamjobCompany']['website'] = $this->request->data['DreamjobCompany']['website']; $profil['DreamjobCompany']['website'] = $this->request->data['DreamjobCompany']['website'];
@ -267,6 +267,7 @@ class UserController extends AppController {
$this->request->data = $profil; $this->request->data = $profil;
$this->set('profil',$profil); $this->set('profil',$profil);
$this->set('graducations',$this->DreamjobListGraducation->find('list')); $this->set('graducations',$this->DreamjobListGraducation->find('list'));
$this->set('branches',$this->DreamjobListBranch->find('list'));
$this->set('mannerofaddresses',$this->Mannerofaddress->find('list')); $this->set('mannerofaddresses',$this->Mannerofaddress->find('list'));
$this->render('/User/settings_account'); $this->render('/User/settings_account');
} }
@ -410,7 +411,21 @@ class UserController extends AppController {
$this->set('error', 'dreamjob.error.noPermision'); $this->set('error', 'dreamjob.error.noPermision');
$this->render('/Home/error'); $this->render('/Home/error');
}else{ }else{
if($this->request->is('post')){
$tosave = array();
$tosave['DreamjobISerach'] = $this->data['DreamjobISerach'];
var_dump($tosave);
$result = $this->DreamjobISearch->saveMany($tosave);
if($result){
$this->MiconwareSession->setFlash('dreamjob.settings.save','flash',array('alert'=>'success'));
}else{
$this->MiconwareSession->setFlash('dreamjob.settings.save.error','flash',array('alert'=>'danger'));
}
}
$this->request->data = $profil; $this->request->data = $profil;
$this->set('kindofjobs',$this->DreamjobListKindofjob->find('list'));
$this->set('jobs',$this->DreamjobListJob->find('list'));
$this->set('branches',$this->DreamjobListBranch->find('list'));
$this->set('profil',$profil); $this->set('profil',$profil);
$this->render('/User/settings_isearch'); $this->render('/User/settings_isearch');
} }

View File

@ -72,7 +72,7 @@ class DreamjobCompany extends AppModel {
if($result) if($result)
$result = $this->saveField('owner',$data['DreamjobCompany']['owner']); $result = $this->saveField('owner',$data['DreamjobCompany']['owner']);
if($result) if($result)
$result = $this->saveField('branch',$data['DreamjobCompany']['branch']); $result = $this->saveField('branch_id',$data['DreamjobCompany']['branch_id']);
if($result) if($result)
$result = $this->saveField('headcount',$data['DreamjobCompany']['headcount']); $result = $this->saveField('headcount',$data['DreamjobCompany']['headcount']);
if($result) if($result)
@ -149,9 +149,9 @@ class DreamjobCompany extends AppModel {
//'on' => 'create', // Limit validation to 'create' or 'update' operations //'on' => 'create', // Limit validation to 'create' or 'update' operations
), ),
), ),
'branch' => array( 'branch_id' => array(
'notEmpty' => array( 'numeric' => array(
'rule' => array('notEmpty'), 'rule' => array('numeric'),
//'message' => 'Your custom message here', //'message' => 'Your custom message here',
//'allowEmpty' => false, //'allowEmpty' => false,
//'required' => false, //'required' => false,
@ -170,7 +170,15 @@ class DreamjobCompany extends AppModel {
), ),
), ),
); );
public $belongsTo = array(
'DreamjobListBranch' => array(
'className' => 'DreamjobListBranch',
'foreignKey' => 'branch_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
);
public $hasAndBelongsToMany = array( public $hasAndBelongsToMany = array(
'User' => 'User' =>

View File

@ -0,0 +1,117 @@
<?php
App::uses('AppModel', 'Model');
/**
* MicDjAccountIsearch Model
*
* @property Worker $Worker
* @property Kindofjob $Kindofjob
*/
class DreamjobISearch extends AppModel {
/**
* Use database config
*
* @var string
*/
public $useDbConfig = 'dreamjobMain';
/**
* Use table
*
* @var mixed False or table name
*/
public $useTable = 'mic_dj_account_isearch';
/**
* Display field
*
* @var string
*/
public $displayField = 'id';
/**
* Validation rules
*
* @var array
*/
public $validate = array(
'worker_id' => array(
'numeric' => array(
'rule' => array('numeric'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'branch_id' => array(
'numeric' => array(
'rule' => array('numeric'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'job_id' => array(
'numeric' => array(
'rule' => array('numeric'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'kindofjob_id' => array(
'numeric' => array(
'rule' => array('numeric'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
/**
* belongsTo associations
*
* @var array
*/
public $belongsTo = array(
'DreamjobWorker' => array(
'className' => 'DreamjobWorker',
'foreignKey' => 'worker_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'DreamjobListKindofjob' => array(
'className' => 'DreamjobListKindofjob',
'foreignKey' => 'kindofjob_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'DreamjobListBranch' => array(
'className' => 'DreamjobListBranch',
'foreignKey' => 'branch_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'DreamjobListJob' => array(
'className' => 'DreamjobListJob',
'foreignKey' => 'job_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);
}

View File

@ -96,9 +96,9 @@ class DreamjobJobOpening extends AppModel {
//'on' => 'create', // Limit validation to 'create' or 'update' operations //'on' => 'create', // Limit validation to 'create' or 'update' operations
), ),
), ),
'branch' => array( 'branch_id' => array(
'notEmpty' => array( 'numeric' => array(
'rule' => array('notEmpty'), 'rule' => array('numeric'),
//'message' => 'Your custom message here', //'message' => 'Your custom message here',
//'allowEmpty' => false, //'allowEmpty' => false,
//'required' => false, //'required' => false,
@ -201,6 +201,13 @@ class DreamjobJobOpening extends AppModel {
'conditions' => '', 'conditions' => '',
'fields' => '', 'fields' => '',
'order' => '' 'order' => ''
),
'DreamjobListBranch' => array(
'className' => 'DreamjobListBranch',
'foreignKey' => 'branch_id',
'conditions' => '',
'fields' => '',
'order' => ''
) )
); );

View File

@ -239,6 +239,10 @@ class DreamjobWorker extends AppModel {
'DreamjobJobApplication' => array( 'DreamjobJobApplication' => array(
'className' => 'DreamjobJobApplication', 'className' => 'DreamjobJobApplication',
'foreignKey' => 'worker_id' 'foreignKey' => 'worker_id'
),
'DreamjobISearch' => array(
'className' => 'DreamjobISearch',
'foreignKey' => 'worker_id'
) )
); );
} }

View File

@ -6,7 +6,7 @@
<p> <p>
<h4><?=__("dreamjob.opening.titleinfo");?></h4> <h4><?=__("dreamjob.opening.titleinfo");?></h4>
<?=__("dreamjob.graducation.company");?>: <?=$opening['DreamjobListGraducation']['name'];?><br/> <?=__("dreamjob.graducation.company");?>: <?=$opening['DreamjobListGraducation']['name'];?><br/>
<?=__("dreamjob.branch");?>: <?=$opening['DreamjobJobOpening']['branch'];?><br/> <?=__("dreamjob.branch");?>: <?=$opening['DreamjobListBranch']['name'];?><br/>
<?=__("dreamjob.kindofjob");?>: <?=$opening['DreamjobListKindofjob']['name'];?><br/> <?=__("dreamjob.kindofjob");?>: <?=$opening['DreamjobListKindofjob']['name'];?><br/>
<span<?php if( time() > strtotime($opening['DreamjobJobOpening']['enddate'])){ ?> class="opening_outdate"<?php } ?>><?=__("dreamjob.opening.enddate");?>: <?=$this->Time->format('d.m.Y', $opening['DreamjobJobOpening']['enddate']);?></span> <span<?php if( time() > strtotime($opening['DreamjobJobOpening']['enddate'])){ ?> class="opening_outdate"<?php } ?>><?=__("dreamjob.opening.enddate");?>: <?=$this->Time->format('d.m.Y', $opening['DreamjobJobOpening']['enddate']);?></span>
</p> </p>

View File

@ -64,7 +64,7 @@ if($opening['AppUser']['take_systemwide']){
<?php } ?> <?php } ?>
<div class="left"> <div class="left">
<span><?=__("dreamjob.graducation.company");?>: <?=$opening['DreamjobListGraducation']['name'];?></span> <span><?=__("dreamjob.graducation.company");?>: <?=$opening['DreamjobListGraducation']['name'];?></span>
<span><?=__("dreamjob.branch");?>: <?=$opening['DreamjobJobOpening']['branch'];?></span> <span><?=__("dreamjob.branch");?>: <?=$opening['DreamjobListBranch']['name'];?></span>
<span><?=__("dreamjob.city");?>: <?=$opening['DreamjobJobOpening']['city'];?></span> <span><?=__("dreamjob.city");?>: <?=$opening['DreamjobJobOpening']['city'];?></span>
<span><?=__("dreamjob.kindofjob");?>: <?=$opening['DreamjobListKindofjob']['name'];?></span> <span><?=__("dreamjob.kindofjob");?>: <?=$opening['DreamjobListKindofjob']['name'];?></span>
<span<?php if( time() > strtotime($opening['DreamjobJobOpening']['enddate'])){ ?> class="opening_outdate"<?php } ?>><?=__("dreamjob.opening.enddate");?>: <?=$this->Time->format('d.m.Y', $opening['DreamjobJobOpening']['enddate']);?></span> <span<?php if( time() > strtotime($opening['DreamjobJobOpening']['enddate'])){ ?> class="opening_outdate"<?php } ?>><?=__("dreamjob.opening.enddate");?>: <?=$this->Time->format('d.m.Y', $opening['DreamjobJobOpening']['enddate']);?></span>

View File

@ -7,7 +7,6 @@ if(!empty($isLoggedin)){
<?php } ?> <?php } ?>
<li<?php if(isset($MENU_START)){?> class="active"<?php } ?>><?=$this->Html->link(__('dreamjob.startpage'),array('controller'=>'home','action'=>'home'));?></li> <li<?php if(isset($MENU_START)){?> class="active"<?php } ?>><?=$this->Html->link(__('dreamjob.startpage'),array('controller'=>'home','action'=>'home'));?></li>
<li<?php if(isset($MENU_SEARCH)){?> class="active"<?php } ?>><?=$this->Html->link(__('dreamjob.search'),'/search/');?></li> <li<?php if(isset($MENU_SEARCH)){?> class="active"<?php } ?>><?=$this->Html->link(__('dreamjob.search'),'/search/');?></li>
<li<?php if(isset($MENU_SETTINGS)){?> class="active"<?php } ?>><?=$this->Html->link(__('dreamjob.settings'),'/settings/');?></li>
<li<?php if(isset($MENU_SERVICE)){?> class="active"<?php } ?>><?=$this->Html->link(__('dreamjob.service'),'/service/');?></li> <li<?php if(isset($MENU_SERVICE)){?> class="active"<?php } ?>><?=$this->Html->link(__('dreamjob.service'),'/service/');?></li>
<li><?=$this->Html->link(__('dreamjob.logout'),array('controller'=>'home','action'=>'logout'));?></li> <li><?=$this->Html->link(__('dreamjob.logout'),array('controller'=>'home','action'=>'logout'));?></li>
</ul> </ul>

View File

@ -32,7 +32,7 @@ echo $this->Form->create('DreamjobJobOpening',$default_Form);
echo $this->Form->input('DreamjobJobOpening.enddate',array('label'=>array('text'=>__("dreamjob.opening.enddate"),"class"=>$default_Form['inputDefaults']['label']['class']),"style"=>'width:20%;display:inline-block;')); echo $this->Form->input('DreamjobJobOpening.enddate',array('label'=>array('text'=>__("dreamjob.opening.enddate"),"class"=>$default_Form['inputDefaults']['label']['class']),"style"=>'width:20%;display:inline-block;'));
echo $this->Form->input('DreamjobJobOpening.kindofjob_id',array('label'=>array('text'=>__("dreamjob.kindofjob"),"class"=>$default_Form['inputDefaults']['label']['class']))); echo $this->Form->input('DreamjobJobOpening.kindofjob_id',array('label'=>array('text'=>__("dreamjob.kindofjob"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobJobOpening.graducation_id',array('label'=>array('text'=>__("dreamjob.graducation"),"class"=>$default_Form['inputDefaults']['label']['class']))); echo $this->Form->input('DreamjobJobOpening.graducation_id',array('label'=>array('text'=>__("dreamjob.graducation"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobJobOpening.branch',array('label'=>array('text'=>__("dreamjob.branch"),"class"=>$default_Form['inputDefaults']['label']['class']))); ?> echo $this->Form->input('DreamjobJobOpening.branch_id',array('label'=>array('text'=>__("dreamjob.branch"),"class"=>$default_Form['inputDefaults']['label']['class']))); ?>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"><?=__("dreamjob.opening.active");?></label> <label class="col-sm-3 control-label"><?=__("dreamjob.opening.active");?></label>
<div class="col-sm-9" style="text-align:left;"> <div class="col-sm-9" style="text-align:left;">

View File

@ -69,7 +69,7 @@ if($profil['AppUser']['take_systemwide']){
</p> </p>
<p> <p>
<?=__("dreamjob.branch");?>:<br/> <?=__("dreamjob.branch");?>:<br/>
<?=$profil['DreamjobCompany']['branch'];?> <?=$profil['DreamjobListBranch']['name'];?>
</p> </p>
</div> </div>
<div class="bar"> <div class="bar">

View File

@ -64,7 +64,7 @@ if($profil['AppUser']['take_systemwide']){
echo $this->Form->input('AppUser.nickname',array('label'=>array('text'=>__("dreamjob.company.nickname"),"class"=>$default_Form['inputDefaults']['label']['class']))); echo $this->Form->input('AppUser.nickname',array('label'=>array('text'=>__("dreamjob.company.nickname"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobCompany.corporateform',array('label'=>array('text'=>__("dreamjob.corporateform"),"class"=>$default_Form['inputDefaults']['label']['class']))); echo $this->Form->input('DreamjobCompany.corporateform',array('label'=>array('text'=>__("dreamjob.corporateform"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobCompany.owner',array('label'=>array('text'=>__("dreamjob.owner"),"class"=>$default_Form['inputDefaults']['label']['class']))); echo $this->Form->input('DreamjobCompany.owner',array('label'=>array('text'=>__("dreamjob.owner"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobCompany.branch',array('label'=>array('text'=>__("dreamjob.branch"),"class"=>$default_Form['inputDefaults']['label']['class']))); echo $this->Form->input('DreamjobCompany.branch_id',array('label'=>array('text'=>__("dreamjob.branch"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobCompany.headcount',array('label'=>array('text'=>__("dreamjob.headcount"),"class"=>$default_Form['inputDefaults']['label']['class']))); echo $this->Form->input('DreamjobCompany.headcount',array('label'=>array('text'=>__("dreamjob.headcount"),"class"=>$default_Form['inputDefaults']['label']['class'])));
//echo $this->Form->input('DreamjobCompany.bank_details',array('label'=>array('text'=>__("dreamjob.bank_details"),"class"=>$default_Form['inputDefaults']['label']['class']))); //echo $this->Form->input('DreamjobCompany.bank_details',array('label'=>array('text'=>__("dreamjob.bank_details"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobCompany.website',array('label'=>array('text'=>__("dreamjob.website"),"class"=>$default_Form['inputDefaults']['label']['class']))); echo $this->Form->input('DreamjobCompany.website',array('label'=>array('text'=>__("dreamjob.website"),"class"=>$default_Form['inputDefaults']['label']['class'])));

View File

@ -20,4 +20,41 @@ if($profil['AppUser']['take_systemwide']){
</ul> </ul>
</div> </div>
<h1><?=__("dreamjob.settings.isearch");?></h1> <h1><?=__("dreamjob.settings.isearch");?></h1>
<?php
$default_hForm['class']=array('tableForm');
echo $this->Form->create("DreamjobISearch",$default_hForm);
?>
<table class="table table-striped">
<thead>
<tr>
<th><?=__('dreamjob.branch');?></th>
<th><?=__('dreamjob.job');?></th>
<th><?=__('dreamjob.kindofjob');?></th>
<th><?=__('dreamjob.options');?></th>
</tr>
</thead>
<tbody>
<?php
foreach($this->data['DreamjobISearch'] as $i => $egal) {
?>
<tr data="set">
<td>
<?=$this->Form->hidden("DreamjobISearch.$i.id",array('empty' => __('dreamjob.form.chooseOne')));?>
<?=$this->Form->input("DreamjobISearch.$i.branch_id",array('empty' => __('dreamjob.form.chooseOne')));?>
</td>
<td><?=$this->Form->input("DreamjobISearch.$i.job_id",array('empty' =>__('dreamjob.form.chooseOne')));?></td>
<td><?=$this->Form->input("DreamjobISearch.$i.kindofjob_id",array('empty' => __('dreamjob.form.chooseOne')));?></td>
<td><a class="btn btn-default btn-del rmEvnt" ref="eventOff"><span class="glyphicon glyphicon-trash"></span></a></td>
</tr>
<?php
}
?>
<tr class="new">
<td><?=$this->Form->input('DreamjobISearch..branch_id',array('empty' => __('dreamjob.form.chooseOne')));?></td>
<td><?=$this->Form->input('DreamjobISearch..job_id',array('empty' =>__('dreamjob.form.chooseOne')));?></td>
<td><?=$this->Form->input('DreamjobISearch..kindofjob_id',array('empty' => __('dreamjob.form.chooseOne')));?></td>
<td><a class="btn btn-default btn-del" ref="eventOff"><span class="glyphicon glyphicon-trash"></span></a></td>
</tr>
</tbody>
</table>
</div> </div>

View File

@ -401,4 +401,10 @@ body.loading #container{
.infofield{ .infofield{
color:black; color:black;
} }
.table > thead > tr > th {
color:black;
}
.tableForm tbody tr.new .btn-del{
display:none;
}

View File

@ -15,7 +15,7 @@
$(where+'.dropdown-toggle').dropdown(); $(where+'.dropdown-toggle').dropdown();
$(where+" a").each(function(that){ $(where+" a").each(function(that){
if($(this).attr("rel")!=="external") if($(this).attr("rel")!=="external" && $(this).attr("ref")!=="eventOff")
$(this).click(function(e){ $(this).click(function(e){
load($(this).attr('href'),{},($(this).attr('rel')=="tab")); load($(this).attr('href'),{},($(this).attr('rel')=="tab"));
return false; return false;
@ -48,6 +48,52 @@
}); });
}); });
}); });
$(where+" form.tableForm tbody").each(function(evt){
that = this;
newRow = $(".new").html();
$(this).change(function(){
$("tr",that).each(function(){
see = true;
save = true;
$("select",this).each(function(){
if(see)
see = $(this).val()=='';
if(save){
save = $(this).val()!='';
console.log($(this).val()!='');
}
});
if(see && $(this).attr("data")=="set"){
$(this).attr("data","");
$(this).remove();
}
if(!see && $(this).attr("data")!="set"){
$(this).attr("data","set");
$("tr",that).removeClass("new");
$(that).append("<tr class=\"new\">"+newRow+"</tr>");
evet();
}
if(save && !$("tr",that).hasClass("new"))
saveForm();
});
});
//ZUOFT WIRD GESPEICHERT
function evet(){
$("tr:not(.new)",that).each(function(){
var that2 = this;
$(".btn-del",this).unbind("click").click(function(evt){
$(that2).remove();
saveForm();
});
});
}
evet();
function saveForm(){
load($(this).attr("action"),{data:$(this).serialize(), type:'GET'},false);
console.log("save");
}
});
$(where+" form.hide-form").each(function(evt){ $(where+" form.hide-form").each(function(evt){
that = this; that = this;
$('span.edit.label',this).click(function(evt){ $('span.edit.label',this).click(function(evt){

View File

@ -39,3 +39,14 @@ ALTER TABLE `mic_dj_account_cmpy` ADD `pro_user` INT NOT NULL ;
ALTER TABLE `mic_dj_jobs_opening_worker` ALTER TABLE `mic_dj_jobs_opening_worker`
ADD CONSTRAINT `mic_dj_jobs_opening_worker_favOpening` FOREIGN KEY (`opening_id`) REFERENCES `mic_dj_jobs_opening` (`id`), ADD CONSTRAINT `mic_dj_jobs_opening_worker_favOpening` FOREIGN KEY (`opening_id`) REFERENCES `mic_dj_jobs_opening` (`id`),
ADD CONSTRAINT `mic_dj_jobs_opening_worker_favWorker` FOREIGN KEY (`worker_id`) REFERENCES `mic_dj_account_wrk` (`djaccount_ptr_id`); ADD CONSTRAINT `mic_dj_jobs_opening_worker_favWorker` FOREIGN KEY (`worker_id`) REFERENCES `mic_dj_account_wrk` (`djaccount_ptr_id`);
-- ACHTUNG:
ALTER TABLE `mic_dj_account_cmpy` CHANGE `branch` `branch_id` INT(11) NOT NULL;
ALTER TABLE `mic_dj_jobs_opening` CHANGE `branch` `branch_id` INT(11) NOT NULL;
-- LOLA
ALTER TABLE `ic_dj_account_isearch` CHANGE `branch` `branch_id` INT(11) NOT NULL;