ISearch - noch nicht fertig!
This commit is contained in:
parent
0ff21cece8
commit
675bc39bf0
|
@ -30,11 +30,9 @@ class MiconwareSessionComponent extends Component {
|
|||
);
|
||||
$controller->set('default_hForm',array(
|
||||
'inputDefaults' => array(
|
||||
'div' => array('class' => 'form-group'),
|
||||
'label' => array('class' => 'col-sm-3 control-label'),
|
||||
'between' => '<div class="col-sm-9">',
|
||||
'after' => '</div>',
|
||||
'error' => array('attribute'=>array('wrap'=>'span','class'=>'help-block')),
|
||||
'div' => false,
|
||||
'label' => false,
|
||||
'error' => false,
|
||||
'class' => 'form-control '),
|
||||
'class'=>'hide-form hide-input'
|
||||
)
|
||||
|
@ -108,6 +106,20 @@ class MiconwareSessionComponent extends Component {
|
|||
'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
|
||||
*/
|
||||
|
|
|
@ -20,19 +20,13 @@ class HomeController extends AppController {
|
|||
* @throws NotFoundException When the view file could not be found
|
||||
* 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;
|
||||
|
||||
public function home() {
|
||||
$this->MiconwareSession->init($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));
|
||||
$this->set('openings',$openings);
|
||||
$this->set('title', 'dreamjob.startpage');
|
||||
|
@ -60,7 +54,7 @@ class HomeController extends AppController {
|
|||
|
||||
|
||||
$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));
|
||||
$this->set('openings',$openings);
|
||||
$this->set('title', 'dreamjob.startpage');
|
||||
|
@ -77,7 +71,7 @@ class HomeController extends AppController {
|
|||
$this->MiconwareSession->setFlash('dreamjob.loggingoutError','flash',array('alert'=>'danger'));
|
||||
|
||||
$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));
|
||||
$this->set('openings',$openings);
|
||||
$this->set('title', 'dreamjob.startpage');
|
||||
|
|
|
@ -10,7 +10,7 @@ class JobController extends AppController {
|
|||
* @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
|
||||
|
@ -61,6 +61,7 @@ class JobController extends AppController {
|
|||
}
|
||||
$this->set('kindofjobs', $this->DreamjobJobOpening->DreamjobListKindofjob->find('list'));
|
||||
$this->set('graducations', $this->DreamjobJobOpening->DreamjobListGraducation->find('list'));
|
||||
$this->set('branches',$this->DreamjobListBranch->find('list'));
|
||||
$this->render('/Job/opening_edit');
|
||||
}else{
|
||||
$this->set('error', 'dreamjob.error.noCompany');
|
||||
|
@ -95,6 +96,7 @@ class JobController extends AppController {
|
|||
$this->request->data=$load;
|
||||
$this->set('kindofjobs', $this->DreamjobJobOpening->DreamjobListKindofjob->find('list'));
|
||||
$this->set('graducations', $this->DreamjobJobOpening->DreamjobListGraducation->find('list'));
|
||||
$this->set('branches',$this->DreamjobListBranch->find('list'));
|
||||
}
|
||||
|
||||
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'));
|
||||
}
|
||||
}
|
||||
$con = HomeController::getOpeningCondition();
|
||||
$con = $this->MiconwareSession->getOpeningCondition();
|
||||
$con['DreamjobJobOpening.id'] = $this->request->params['id'];
|
||||
$opening = $this->DreamjobJobOpening->find('first',array('conditions' => $con));
|
||||
}
|
||||
|
@ -163,7 +165,7 @@ class JobController extends AppController {
|
|||
$fav_id = array();
|
||||
foreach($self['Favority'] as $fav)
|
||||
$fav_id[]=$fav['id'];
|
||||
$con = HomeController::getOpeningCondition();
|
||||
$con = $this->MiconwareSession->getOpeningCondition();
|
||||
$con['DreamjobJobOpening.id'] =$fav_id;
|
||||
$openings = $this->DreamjobJobOpening->find('all',array('conditions' => $con));
|
||||
$this->set('openings',$openings);
|
||||
|
@ -314,7 +316,7 @@ class JobController extends AppController {
|
|||
if(!empty($w)){
|
||||
$opening = null;
|
||||
if(!empty($this->request->params['id'])){
|
||||
$con = HomeController::getOpeningCondition();
|
||||
$con = $this->MiconwareSession->getOpeningCondition();
|
||||
$con['DreamjobJobOpening.id'] = $this->request->params['id'];
|
||||
$opening = $this->DreamjobJobOpening->find('first',array('conditions' => $con));
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ class UserController extends AppController {
|
|||
* @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');
|
||||
|
||||
/**
|
||||
|
@ -100,7 +100,7 @@ class UserController extends AppController {
|
|||
$this->set('page',$page);
|
||||
if(!$hard_error)
|
||||
if($company){
|
||||
$con = HomeController::getOpeningCondition();
|
||||
$con = $this->MiconwareSession->getOpeningCondition();
|
||||
$con['DreamjobJobOpening.company_id'] = $profil['AppUser']['id'];
|
||||
$openings = $this->DreamjobJobOpening->find('all',array('conditions' => $con));
|
||||
$this->set("openings",$openings);
|
||||
|
@ -237,7 +237,7 @@ class UserController extends AppController {
|
|||
if($company){
|
||||
$profil['DreamjobCompany']['corporateform'] = $this->request->data['DreamjobCompany']['corporateform'];
|
||||
$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']['bank_details'] = $this->request->data['DreamjobCompany']['bank_details'];
|
||||
$profil['DreamjobCompany']['website'] = $this->request->data['DreamjobCompany']['website'];
|
||||
|
@ -267,6 +267,7 @@ class UserController extends AppController {
|
|||
$this->request->data = $profil;
|
||||
$this->set('profil',$profil);
|
||||
$this->set('graducations',$this->DreamjobListGraducation->find('list'));
|
||||
$this->set('branches',$this->DreamjobListBranch->find('list'));
|
||||
$this->set('mannerofaddresses',$this->Mannerofaddress->find('list'));
|
||||
$this->render('/User/settings_account');
|
||||
}
|
||||
|
@ -410,7 +411,21 @@ class UserController extends AppController {
|
|||
$this->set('error', 'dreamjob.error.noPermision');
|
||||
$this->render('/Home/error');
|
||||
}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->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->render('/User/settings_isearch');
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ class DreamjobCompany extends AppModel {
|
|||
if($result)
|
||||
$result = $this->saveField('owner',$data['DreamjobCompany']['owner']);
|
||||
if($result)
|
||||
$result = $this->saveField('branch',$data['DreamjobCompany']['branch']);
|
||||
$result = $this->saveField('branch_id',$data['DreamjobCompany']['branch_id']);
|
||||
if($result)
|
||||
$result = $this->saveField('headcount',$data['DreamjobCompany']['headcount']);
|
||||
if($result)
|
||||
|
@ -149,9 +149,9 @@ class DreamjobCompany extends AppModel {
|
|||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
'branch' => array(
|
||||
'notEmpty' => array(
|
||||
'rule' => array('notEmpty'),
|
||||
'branch_id' => array(
|
||||
'numeric' => array(
|
||||
'rule' => array('numeric'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => 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(
|
||||
'User' =>
|
||||
|
|
|
@ -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' => ''
|
||||
)
|
||||
);
|
||||
}
|
|
@ -96,9 +96,9 @@ class DreamjobJobOpening extends AppModel {
|
|||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
'branch' => array(
|
||||
'notEmpty' => array(
|
||||
'rule' => array('notEmpty'),
|
||||
'branch_id' => array(
|
||||
'numeric' => array(
|
||||
'rule' => array('numeric'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
|
@ -201,6 +201,13 @@ class DreamjobJobOpening extends AppModel {
|
|||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
),
|
||||
'DreamjobListBranch' => array(
|
||||
'className' => 'DreamjobListBranch',
|
||||
'foreignKey' => 'branch_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -239,6 +239,10 @@ class DreamjobWorker extends AppModel {
|
|||
'DreamjobJobApplication' => array(
|
||||
'className' => 'DreamjobJobApplication',
|
||||
'foreignKey' => 'worker_id'
|
||||
),
|
||||
'DreamjobISearch' => array(
|
||||
'className' => 'DreamjobISearch',
|
||||
'foreignKey' => 'worker_id'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<p>
|
||||
<h4><?=__("dreamjob.opening.titleinfo");?></h4>
|
||||
<?=__("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/>
|
||||
<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>
|
||||
|
|
|
@ -64,7 +64,7 @@ if($opening['AppUser']['take_systemwide']){
|
|||
<?php } ?>
|
||||
<div class="left">
|
||||
<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.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>
|
||||
|
|
|
@ -7,7 +7,6 @@ if(!empty($isLoggedin)){
|
|||
<?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_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><?=$this->Html->link(__('dreamjob.logout'),array('controller'=>'home','action'=>'logout'));?></li>
|
||||
</ul>
|
||||
|
|
|
@ -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.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.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">
|
||||
<label class="col-sm-3 control-label"><?=__("dreamjob.opening.active");?></label>
|
||||
<div class="col-sm-9" style="text-align:left;">
|
||||
|
|
|
@ -69,7 +69,7 @@ if($profil['AppUser']['take_systemwide']){
|
|||
</p>
|
||||
<p>
|
||||
<?=__("dreamjob.branch");?>:<br/>
|
||||
<?=$profil['DreamjobCompany']['branch'];?>
|
||||
<?=$profil['DreamjobListBranch']['name'];?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="bar">
|
||||
|
|
|
@ -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('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.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.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'])));
|
||||
|
|
|
@ -20,4 +20,41 @@ if($profil['AppUser']['take_systemwide']){
|
|||
</ul>
|
||||
</div>
|
||||
<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>
|
||||
|
|
|
@ -401,4 +401,10 @@ body.loading #container{
|
|||
.infofield{
|
||||
color:black;
|
||||
}
|
||||
.table > thead > tr > th {
|
||||
color:black;
|
||||
}
|
||||
.tableForm tbody tr.new .btn-del{
|
||||
display:none;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
$(where+'.dropdown-toggle').dropdown();
|
||||
|
||||
$(where+" a").each(function(that){
|
||||
if($(this).attr("rel")!=="external")
|
||||
if($(this).attr("rel")!=="external" && $(this).attr("ref")!=="eventOff")
|
||||
$(this).click(function(e){
|
||||
load($(this).attr('href'),{},($(this).attr('rel')=="tab"));
|
||||
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){
|
||||
that = this;
|
||||
$('span.edit.label',this).click(function(evt){
|
||||
|
|
11
update.sql
11
update.sql
|
@ -39,3 +39,14 @@ ALTER TABLE `mic_dj_account_cmpy` ADD `pro_user` INT NOT NULL ;
|
|||
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_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;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue