cv+preReady
This commit is contained in:
parent
f898d6571d
commit
720d060621
|
@ -33,6 +33,7 @@
|
|||
|
||||
Router::connect('/profil', array('controller' => 'user', 'action' => 'profil'));
|
||||
Router::connect('/profil/page/:page', array('controller' => 'user', 'action' => 'profil'),array("page" => "[0-9]+"));
|
||||
Router::connect('/profil/edit', array('controller' => 'user', 'action' => 'profil_edit'));
|
||||
Router::connect('/settings', array('controller' => 'user', 'action' => 'settings_account'));
|
||||
Router::connect('/settings/pages', array('controller' => 'user', 'action' => 'settings_pageInh'));
|
||||
Router::connect('/settings/pages/:page', array('controller' => 'user', 'action' => 'settings_pageInh'),array("page" => "[0-9]+"));
|
||||
|
|
|
@ -30,11 +30,11 @@ class MiconwareSessionComponent extends Component {
|
|||
);
|
||||
$controller->set('default_hForm',array(
|
||||
'inputDefaults' => array(
|
||||
'div' => false,
|
||||
'div' => true,
|
||||
'label' => false,
|
||||
'error' => false,
|
||||
'class' => 'form-control '),
|
||||
'class'=>'hide-form hide-input'
|
||||
'class'=>'tableForm'
|
||||
)
|
||||
);
|
||||
$controller->set('default_Form',array(
|
||||
|
|
|
@ -10,7 +10,7 @@ class UserController extends AppController {
|
|||
* @var array
|
||||
*/
|
||||
|
||||
public $uses = array('DreamjobListGraducation', 'DreamjobWorker', 'DreamjobCompany', 'DreamjobPageText','DreamjobPageInh', 'DreamjobPageImage', 'DreamjobJobOpening', 'DreamjobCvCategory', 'DreamjobListGraducation', 'DreamjobListJob','DreamjobListKindofjob','DreamjobListBranch','Mannerofaddress','DreamjobISearch');
|
||||
public $uses = array('DreamjobListGraducation', 'DreamjobWorker', 'DreamjobCompany', 'DreamjobPageText','DreamjobPageInh', 'DreamjobPageImage', 'DreamjobJobOpening', 'DreamjobCvEntry', 'DreamjobListCvCategory', 'DreamjobListGraducation', 'DreamjobListJob','DreamjobListKindofjob','DreamjobListBranch','Mannerofaddress','DreamjobISearch');
|
||||
public $components = array('MiconwareSession','RequestHandler');
|
||||
|
||||
/**
|
||||
|
@ -23,8 +23,9 @@ class UserController extends AppController {
|
|||
*/
|
||||
function beforeFilter(){
|
||||
$this->Security->unlockedActions[]="settings_isearch";
|
||||
/*if($this->request->action=="settings_isearch")
|
||||
$this->Security->=false;*/
|
||||
$this->Security->unlockedActions[]="profil_edit";
|
||||
if($this->request->action=="settings_isearch")
|
||||
unset($this->request->data['_Token']['key']);
|
||||
parent::beforeFilter();
|
||||
}
|
||||
|
||||
|
@ -55,7 +56,7 @@ class UserController extends AppController {
|
|||
$page = null;
|
||||
$profil = null;
|
||||
|
||||
if(empty($this->request->params['id'])) {
|
||||
if(empty($this->request->params['id'])){
|
||||
$profil = $self;
|
||||
$company = $self_company;
|
||||
}else{
|
||||
|
@ -79,7 +80,7 @@ class UserController extends AppController {
|
|||
);
|
||||
}else{
|
||||
if(isset($profil['DreamjobWorker'])){
|
||||
$cv = $this->DreamjobCvCategory->find('all',array('conditions' => array('worker_id'=> $profil['AppUser']['id'])));
|
||||
$cv = $this->DreamjobCvEntry->find('all',array('conditions' => array('worker_id'=> $profil['AppUser']['id'])));
|
||||
if(!$self_company and $profil['AppUser']['id']==$self['AppUser']['id'])
|
||||
$this->request->data = $cv;
|
||||
$this->set("cv",$cv);
|
||||
|
@ -115,25 +116,44 @@ class UserController extends AppController {
|
|||
}else
|
||||
$this->render('/User/worker');
|
||||
}
|
||||
public function saveCvJson(){
|
||||
public function profil_edit(){
|
||||
$this->MiconwareSession->init($this);
|
||||
|
||||
$this->MiconwareSession->initWeb($this);
|
||||
$this->RequestHandler->setContent('json', 'application/json' );
|
||||
|
||||
$this->set("cv",null);
|
||||
$this->set('error', null);
|
||||
$this->RequestHandler->setContent('html', 'application/html' );
|
||||
$this->layout = 'default';
|
||||
|
||||
$self = $this->MiconwareSession->getWorker();
|
||||
if(!empty($self) and count($self)> 0){
|
||||
$cv = $this->DreamjobCvCategory->find('all',array('conditions' => array('worker_id'=> $self['AppUser']['id'])));
|
||||
$this->request->data = $cv;
|
||||
$this->set("cv",$cv);
|
||||
$this->set('error', false);
|
||||
if($this->request->is('post')){
|
||||
$tosave = array();
|
||||
if(isset($this->request->data['DreamjobCvEntry'])){
|
||||
$tosave = $this->request->data['DreamjobCvEntry'];
|
||||
foreach($tosave as $i => $a)
|
||||
$tosave[$i]['worker_id']=$self['AppUser']['id'];
|
||||
}
|
||||
$result = $this->DreamjobCvEntry->saveAndDelete($tosave,$self['DreamjobCvEntry']);
|
||||
if($result){
|
||||
$this->MiconwareSession->setFlash('dreamjob.settings.save','flash',array('alert'=>'success'));
|
||||
}else{
|
||||
$this->MiconwareSession->setFlash('dreamjob.settings.save.error','flash',array('alert'=>'danger'));
|
||||
}
|
||||
}
|
||||
$cvc = $this->DreamjobListCvCategory->find('all',array('order'=>'id'));
|
||||
$cve = $this->DreamjobCvEntry->find('all',array('conditions' => array('worker_id'=> $self['AppUser']['id'])));
|
||||
$cve2 = array('DreamjobCvEntry'=>null);
|
||||
foreach($cve as $i => $data)
|
||||
$cve2['DreamjobCvEntry'][$i] = $data['DreamjobCvEntry'];
|
||||
$this->request->data = $cve2;
|
||||
$this->set('cvc',$cvc);
|
||||
$this->set('cve',$cve);
|
||||
$this->set('profil',$self);
|
||||
$this->set('edit_show',true);
|
||||
$this->render('/User/worker');
|
||||
}else{
|
||||
$this->set('error', true);
|
||||
$this->set('error', 'dreamjob.error.noPermision');
|
||||
$this->render('/Home/error');
|
||||
}
|
||||
$this->set('_serialize', array('cv','error'));
|
||||
}
|
||||
|
||||
public function savePageDeleteJson(){
|
||||
|
@ -419,9 +439,12 @@ class UserController extends AppController {
|
|||
$this->render('/Home/error');
|
||||
}else{
|
||||
if($this->request->is('post')){
|
||||
$tosave = array();
|
||||
if(isset($this->request->data['DreamjobISearch'])){
|
||||
$tosave = $this->request->data['DreamjobISearch'];
|
||||
foreach($tosave as $i => $a)
|
||||
$tosave[$i]['worker_id']=$profil['AppUser']['id'];
|
||||
}
|
||||
$result = $this->DreamjobISearch->saveAndDelete($tosave,$profil['DreamjobISearch']);
|
||||
if($result){
|
||||
$this->MiconwareSession->refreshCache();
|
||||
|
|
|
@ -1,101 +0,0 @@
|
|||
<?php
|
||||
App::uses('AppModel', 'Model');
|
||||
/**
|
||||
* MicDjCvCategory Model
|
||||
*
|
||||
* @property Worker $Worker
|
||||
* @property Category $Category
|
||||
*/
|
||||
class DreamjobCvCategory extends AppModel {
|
||||
|
||||
/**
|
||||
* Use database config
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $useDbConfig = 'dreamjobMain';
|
||||
|
||||
/**
|
||||
* Use table
|
||||
*
|
||||
* @var mixed False or table name
|
||||
*/
|
||||
public $useTable = 'mic_dj_cv_category';
|
||||
|
||||
/**
|
||||
* Display field
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $displayField = 'id';
|
||||
|
||||
public $order = 'DreamjobCvCategory.id';
|
||||
/**
|
||||
* Validation rules
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $validate = array(
|
||||
'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
|
||||
),
|
||||
),
|
||||
'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
|
||||
),
|
||||
),
|
||||
'category_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 $hasMany = array(
|
||||
'DreamjobCvEntry' => array(
|
||||
'className' => 'DreamjobCvEntry',
|
||||
'foreignKey' => 'category_id'
|
||||
),
|
||||
);
|
||||
|
||||
public $belongsTo = array(
|
||||
'DreamjobWorker' => array(
|
||||
'className' => 'DreamjobWorker',
|
||||
'foreignKey' => 'worker_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
),
|
||||
'DreamjobListCvCategory' => array(
|
||||
'className' => 'DreamjobListCvCategory',
|
||||
'foreignKey' => 'category_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
)
|
||||
);
|
||||
}
|
|
@ -27,6 +27,38 @@ class DreamjobCvEntry extends AppModel {
|
|||
* @var string
|
||||
*/
|
||||
public $displayField = 'title';
|
||||
public $order = array('DreamjobCvEntry.category_id','DreamjobCvEntry.enddate desc','DreamjobCvEntry.id');
|
||||
|
||||
public function saveAndDelete($data,$old){
|
||||
$dataSource = $this->getDataSource();
|
||||
$dataSource->begin();
|
||||
|
||||
if(count($data)>0)
|
||||
$result = $this->saveMany($data);
|
||||
else $result = true;
|
||||
|
||||
if($result){
|
||||
$array1 = array();
|
||||
$array2 = array();
|
||||
foreach($data as $a)
|
||||
if(isset($a['id']))
|
||||
$array1[]=$a['id'];
|
||||
foreach($old as $a)
|
||||
if(isset($a['id']))
|
||||
$array2[]=$a['id'];
|
||||
$diff=array_diff($array2, $array1);
|
||||
if(count($diff)>0)
|
||||
$result = $this->delete($diff);
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
$dataSource->commit();
|
||||
return true;
|
||||
} else {
|
||||
$dataSource->rollback();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validation rules
|
||||
|
@ -94,8 +126,8 @@ class DreamjobCvEntry extends AppModel {
|
|||
* @var array
|
||||
*/
|
||||
public $belongsTo = array(
|
||||
'DreamjobCvCategory' => array(
|
||||
'className' => 'DreamjobCvCategory',
|
||||
'DreamjobListCvCategory' => array(
|
||||
'className' => 'DreamjobListCvCategory',
|
||||
'foreignKey' => 'category_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
|
|
|
@ -38,7 +38,10 @@ class DreamjobISearch extends AppModel {
|
|||
$dataSource = $this->getDataSource();
|
||||
$dataSource->begin();
|
||||
|
||||
$result = $this->saveMany($data);
|
||||
if(count($data)>0)
|
||||
$result = $this->saveMany($data);
|
||||
else $result = true;
|
||||
|
||||
if($result){
|
||||
$array1 = array();
|
||||
$array2 = array();
|
||||
|
|
|
@ -243,6 +243,11 @@ class DreamjobWorker extends AppModel {
|
|||
'DreamjobISearch' => array(
|
||||
'className' => 'DreamjobISearch',
|
||||
'foreignKey' => 'worker_id'
|
||||
),
|
||||
'DreamjobCvEntry' => array(
|
||||
'className' => 'DreamjobCvEntry',
|
||||
'foreignKey' => 'worker_id',
|
||||
'order'=>'category_id'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -36,9 +36,13 @@ if($isLoggedin){
|
|||
<style type="text/css">
|
||||
<!--
|
||||
.bar #barleft {
|
||||
width:128px;
|
||||
width:140px;
|
||||
position:relative;
|
||||
right:-130px;
|
||||
right:-120px;
|
||||
}
|
||||
.bar #barleft .btn{
|
||||
width:140px;
|
||||
overflow:hidden;
|
||||
}
|
||||
.column-center{
|
||||
padding-left:130px;
|
||||
|
|
|
@ -4,74 +4,84 @@
|
|||
*/
|
||||
?>
|
||||
|
||||
<h3><?=__("dreamjob.cv");?></h3>
|
||||
<h3>
|
||||
<?php
|
||||
echo __("dreamjob.cv");
|
||||
if($edit){
|
||||
$text ='<span class="label label-default edit" style="font-size:12px;"><span class="glyphicon glyphicon-edit"></span>'.__('dreamjob.edit').'</span>';
|
||||
echo $this->Html->link($text,array('controller'=>'user','action'=>'profil_edit'),array('escape' => false));
|
||||
}
|
||||
?>
|
||||
</h3>
|
||||
|
||||
<?php
|
||||
$inCat= -1;
|
||||
foreach($cv as $cvc){
|
||||
?>
|
||||
<h4><?=$cvc['DreamjobListCvCategory']['name'];?></h4>
|
||||
<table class="cv">
|
||||
<?php
|
||||
foreach($cvc['DreamjobCvEntry'] as $cve){
|
||||
if ( $inCat != $cvc['DreamjobListCvCategory']['id'] ){
|
||||
if($inCat == -1){
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
if($cvc['DreamjobListCvCategory']['startdate'] and $cvc['DreamjobListCvCategory']['enddate'] and $cvc['DreamjobListCvCategory']['place']){
|
||||
?>
|
||||
<td><?=$cve['startdate'];?> - <?=$cve['enddate'];?></td>
|
||||
<td><?=$cve['title'];?><br/><span><?=$cve['place'];?></span></td>
|
||||
</table>
|
||||
<?php } ?>
|
||||
<h4><?=$cvc['DreamjobListCvCategory']['name'];?></h4>
|
||||
<table class="cv">
|
||||
<?php
|
||||
$inCat = $cvc['DreamjobListCvCategory']['id'];
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
if($cvc['DreamjobListCvCategory']['startdate'] and $cvc['DreamjobListCvCategory']['enddate'] and $cvc['DreamjobListCvCategory']['place']){
|
||||
?>
|
||||
<td><?=$cvc['DreamjobCvEntry']['startdate'];?> - <?=$cvc['DreamjobCvEntry']['enddate'];?></td>
|
||||
<td><?=$cvc['DreamjobCvEntry']['title'];?><br/><span><?=$cvc['DreamjobCvEntry']['place'];?></span></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['place']){
|
||||
if($cvc['DreamjobListCvCategory']['startdate']){
|
||||
?>
|
||||
<td><?=$cvc['DreamjobCvEntry']['startdate'];?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['place']){
|
||||
if($cvc['DreamjobListCvCategory']['startdate']){
|
||||
}else if($cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['startdate'];?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['enddate'];?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<td><?=$cve['title'];?></td>
|
||||
<td><?=$cve['place'];?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($cvc['DreamjobListCvCategory']['startdate'] or $cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['title'];?><br/><span><?=$cve['place'];?></span></td>
|
||||
<td><?=$cvc['DreamjobCvEntry']['enddate'];?></td>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
if($cvc['DreamjobListCvCategory']['startdate'] and $cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['startdate'];?> - <?=$cve['enddate'];?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['startdate']){
|
||||
?>
|
||||
<td><?=$cve['startdate'];?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['enddate'];?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
ERROR
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td><?=$cve['title'];?></td>
|
||||
?>
|
||||
<td><?=$cvc['DreamjobCvEntry']['title'];?></td>
|
||||
<td><?=$cvc['DreamjobCvEntry']['place'];?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
if($cvc['DreamjobListCvCategory']['startdate'] or $cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cvc['DreamjobCvEntry']['title'];?><br/><span><?=$cvc['DreamjobCvEntry']['place'];?></span></td>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
if($cvc['DreamjobListCvCategory']['startdate'] and $cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cvc['DreamjobCvEntry']['startdate'];?> - <?=$cvc['DreamjobCvEntry']['enddate'];?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['startdate']){
|
||||
?>
|
||||
<td><?=$cvc['DreamjobCvEntry']['startdate'];?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cvc['DreamjobCvEntry']['enddate'];?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
ERROR
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td><?=$cvc['DreamjobCvEntry']['title'];?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
|
|
@ -2,79 +2,137 @@
|
|||
/*
|
||||
*
|
||||
*/
|
||||
$default_hForm['url']=array('controller'=>'user','action'=>'saveCvJson');
|
||||
echo $this->Form->create('DreamjobCvCategory',$default_hForm);
|
||||
$default_hForm['url']=array('controller'=>'user','action'=>'profil_edit');
|
||||
echo $this->Form->create('DreamjobCvEntry',$default_hForm);
|
||||
?>
|
||||
|
||||
<h3><?=__("dreamjob.cv");?><span class="label label-default edit"><span class="glyphicon glyphicon-edit"></span><?=__('dreamjob.edit');?></span><span class="label label-default save"><span class="glyphicon glyphicon-floppy-disk"></span><?=__('dreamjob.save');?></span></h3>
|
||||
<h3><?=__("dreamjob.cv");?><span class="label label-default save" style="font-size:12px;"><span class="glyphicon glyphicon-floppy-disk"></span> <?=__('dreamjob.save');?></span></h3>
|
||||
|
||||
<?php
|
||||
echo $this->Form->text('test',array('class'=>'form-control'));
|
||||
foreach($cv as $cvc){
|
||||
$i = 0;
|
||||
foreach($cvc as $cvc_item){
|
||||
?>
|
||||
<h4><?=$cvc['DreamjobListCvCategory']['name'];?></h4>
|
||||
<table class="cv">
|
||||
<?php
|
||||
foreach($cvc['DreamjobCvEntry'] as $cve){
|
||||
<h4><?=$cvc_item['DreamjobListCvCategory']['name'];?></h4>
|
||||
<table class="cv table table-striped">
|
||||
<tbody>
|
||||
<?php
|
||||
while(count($cve) > $i and $cvc_item['DreamjobListCvCategory']['id']==$cve[$i]['DreamjobCvEntry']['category_id']){
|
||||
?>
|
||||
<tr data="set">
|
||||
<?php
|
||||
if($cvc_item['DreamjobListCvCategory']['startdate'] and $cvc_item['DreamjobListCvCategory']['enddate'] and $cvc_item['DreamjobListCvCategory']['place']){
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
if($cvc['DreamjobListCvCategory']['startdate'] and $cvc['DreamjobListCvCategory']['enddate'] and $cvc['DreamjobListCvCategory']['place']){
|
||||
?>
|
||||
<td><?=$cve['startdate'];?> - <?=$cve['enddate'];?></td>
|
||||
<td><?=$cve['title'];?><br/><span><?=$cve['place'];?></span></td>
|
||||
<td><?=__('dreamjob.between');?>: <?=$this->Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date')));?> <br/> <?=__('dreamjob.between.till');?>: <?=$this->Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date')));?></td>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?><br/><span><?=$this->Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?></span></td>
|
||||
<?php
|
||||
}else if($cvc_item['DreamjobListCvCategory']['place']){
|
||||
if($cvc_item['DreamjobListCvCategory']['startdate']){
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date')));?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['place']){
|
||||
if($cvc['DreamjobListCvCategory']['startdate']){
|
||||
}else if($cvc_item['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['startdate'];?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['enddate'];?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<td><?=$cve['title'];?></td>
|
||||
<td><?=$cve['place'];?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($cvc['DreamjobListCvCategory']['startdate'] or $cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['title'];?><br/><span><?=$cve['place'];?></span></td>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date')));?></td>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
if($cvc['DreamjobListCvCategory']['startdate'] and $cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['startdate'];?> - <?=$cve['enddate'];?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['startdate']){
|
||||
?>
|
||||
<td><?=$cve['startdate'];?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['enddate'];?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
ERROR
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td><?=$cve['title'];?></td>
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?></td>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
if($cvc_item['DreamjobListCvCategory']['startdate'] or $cvc_item['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?><br/><span><?=$this->Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?></span></td>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
if($cvc_item['DreamjobListCvCategory']['startdate'] and $cvc_item['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=__('dreamjob.between');?>: <?=$this->Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date')));?> <br/> <?=__('dreamjob.between.till');?>: <?=$this->Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date')));?></td>
|
||||
<?php
|
||||
}else if($cvc_item['DreamjobListCvCategory']['startdate']){
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date')));?></td>
|
||||
<?php
|
||||
}else if($cvc_item['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date')));?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
ERROR
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?=$this->Form->input('DreamjobCvEntry.'.$i.'.category_id',array('type'=>'hidden'));?>
|
||||
<?=$this->Form->input('DreamjobCvEntry.'.$i.'.id',array('type'=>'hidden'));?>
|
||||
</tr>
|
||||
<?php
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
<tr class="new">
|
||||
<?php
|
||||
if($cvc_item['DreamjobListCvCategory']['startdate'] and $cvc_item['DreamjobListCvCategory']['enddate'] and $cvc_item['DreamjobListCvCategory']['place']){
|
||||
?>
|
||||
<td><?=__('dreamjob.between');?>: <?=$this->Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date')));?> <br/> <?=__('dreamjob.between.till');?>: <?=$this->Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date')));?></td>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?><br/><span><?=$this->Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?></span></td>
|
||||
<?php
|
||||
}else if($cvc_item['DreamjobListCvCategory']['place']){
|
||||
if($cvc_item['DreamjobListCvCategory']['startdate']){
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date')));?></td>
|
||||
<?php
|
||||
}else if($cvc_item['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date')));?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?></td>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($cvc_item['DreamjobListCvCategory']['startdate'] or $cvc_item['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?><br/><span><?=$this->Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?></span></td>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
if($cvc_item['DreamjobListCvCategory']['startdate'] and $cvc_item['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=__('dreamjob.between');?>: <?=$this->Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date')));?> <br/> <?=__('dreamjob.between.till');?>: <?=$this->Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date')));?></td>
|
||||
<?php
|
||||
}else if($cvc_item['DreamjobListCvCategory']['startdate']){
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date')));?></td>
|
||||
<?php
|
||||
}else if($cvc_item['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date')));?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
ERROR
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td><?=$this->Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?=$this->Form->input('DreamjobCvEntry..category_id',array('type'=>'hidden','value'=>$cvc_item['DreamjobListCvCategory']['id']));?>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
echo $this->Form->end();
|
||||
|
|
|
@ -44,9 +44,11 @@
|
|||
<div>
|
||||
<?=$opening['DreamjobJobOpening']['text'];?>
|
||||
</div>
|
||||
<?php if($WORKER){ ?>
|
||||
<div class="buttonrow">
|
||||
<?php
|
||||
echo $this->Html->link(__('dreamjob.applicate'),array('controller'=>'job', 'action'=>'applicationSend', 'id'=> $opening['DreamjobJobOpening']['id']),array("class" => "btn btn-default"));
|
||||
echo $this->Html->link(__('dreamjob.applicate'),array('controller'=>'job', 'action'=>'applicationSend', 'id'=> $opening['DreamjobJobOpening']['id']),array("class" => "btn btn-primary"));
|
||||
?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
|
|
@ -21,7 +21,6 @@ if($profil['AppUser']['take_systemwide']){
|
|||
</div>
|
||||
<h1><?=__("dreamjob.settings.isearch");?></h1>
|
||||
<?php
|
||||
$default_hForm['class']=array('tableForm');
|
||||
echo $this->Form->create("DreamjobISearch",$default_hForm);
|
||||
?>
|
||||
<table class="table table-striped">
|
||||
|
@ -39,7 +38,7 @@ if($profil['AppUser']['take_systemwide']){
|
|||
?>
|
||||
<tr data="set">
|
||||
<td>
|
||||
<?=$this->Form->hidden("DreamjobISearch.$i.id",array('empty' => __('dreamjob.form.chooseOne')));?>
|
||||
<?=$this->Form->hidden("DreamjobISearch.$i.id");?>
|
||||
<?=$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>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
?>
|
||||
</div>
|
||||
<?php
|
||||
if(( !empty($COMPANY) and is_array($COMPANY) and count($COMPANY) > 0 and ($COMPANY['DreamjobCompany']['pro_user']>0) )
|
||||
if(( !empty($COMPANY) and is_array($COMPANY) and count($COMPANY) > 0 and ($COMPANY['DreamjobCompany']['pro_user']>1) )
|
||||
or ( !empty($WORKER) and is_array($WORKER) and count($WORKER) > 0 )
|
||||
){
|
||||
?>
|
||||
|
@ -40,7 +40,7 @@ if(( !empty($COMPANY) and is_array($COMPANY) and count($COMPANY) > 0 and ($COMPA
|
|||
if(!empty($page)){
|
||||
echo $this->element('user_page');
|
||||
}else{
|
||||
if(!empty($WORKER) and is_array($WORKER) and count($WORKER) > 0 and $WORKER['AppUser']['id']== $profil['AppUser']['id'] and $edit){
|
||||
if(!empty($WORKER) and is_array($WORKER) and count($WORKER) > 0 and $WORKER['AppUser']['id']== $profil['AppUser']['id'] and !empty($edit_show)){
|
||||
echo $this->element('user_worker_cv_edit');
|
||||
}else{
|
||||
echo $this->element('user_worker_cv');
|
||||
|
|
|
@ -391,6 +391,15 @@ body.loading #container{
|
|||
font-size:12px;
|
||||
}
|
||||
|
||||
.cv .date {
|
||||
display:inline-block;
|
||||
width:90%;
|
||||
}
|
||||
.cv .date > select {
|
||||
width:30%;
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
.hide-input input.form-control{
|
||||
background-color:rgba(255,255,255,0);
|
||||
border-color:rgba(255,255,255,0);
|
||||
|
|
|
@ -49,15 +49,16 @@
|
|||
});
|
||||
});
|
||||
$(where+" form.tableForm tbody").each(function(evt){
|
||||
that = this;
|
||||
var that = this;
|
||||
newRow = $(".new").html();
|
||||
$(this).change(function(){
|
||||
$(that).change(function(){
|
||||
tosave = true;
|
||||
$("tr",that).each(function(){
|
||||
$("tr",that).each(function(evt){
|
||||
see = true;
|
||||
$("select",this).each(function(){
|
||||
if(see)
|
||||
$(":input:not([ type = 'hidden' ] )",this).each(function(){
|
||||
if(see){
|
||||
see = $(this).val()=='';
|
||||
}
|
||||
});
|
||||
if(see && $(this).attr("data")=="set"){
|
||||
$(this).attr("data","");
|
||||
|
@ -72,7 +73,7 @@
|
|||
|
||||
save = true;
|
||||
that2=this;
|
||||
$("select",this).each(function(){
|
||||
$(":input:not([ type = 'hidden' ] )",this).each(function(){
|
||||
if(save && !$(that2).hasClass("new")){
|
||||
save = $(this).val()!='';
|
||||
}
|
||||
|
@ -82,6 +83,7 @@
|
|||
}
|
||||
});
|
||||
if(tosave)
|
||||
//console.log("sendTosave");
|
||||
saveForm();
|
||||
});
|
||||
//ZUOFT WIRD GESPEICHERT
|
||||
|
@ -98,52 +100,18 @@
|
|||
evet();
|
||||
function saveForm(){
|
||||
i = 0;
|
||||
$("tr.new",that).remove();
|
||||
$("tr",that).each(function(){
|
||||
$("select,input",this).each(function(){
|
||||
str = $(this).attr("name").replace(/data\[(.*)\]\[.*\]\[(.*)\]/g,'data[$1]['+i+'][$2]');
|
||||
$("tbody tr.new",$(that).parents('form')).remove();
|
||||
$("tbody tr",$(that).parents('form')).each(function(){
|
||||
$(":input",this).each(function(){
|
||||
str = $(this).attr("name").replace(/data\[(.*?)\]\[.*?\]\[(.+)\]/g,'data[$1]['+i+'][$2]');
|
||||
$(this).attr("name",str);
|
||||
});
|
||||
i++;
|
||||
});
|
||||
load($(that).attr("action"),{data:$(that).parents("form").serialize(), type:'POST'},false);
|
||||
load($(that).parents("form").attr("action"),{data:$(that).parents("form").serialize(), type:'POST'},false);
|
||||
}
|
||||
});
|
||||
$(where+" form.hide-form").each(function(evt){
|
||||
that = this;
|
||||
$('span.edit.label',this).click(function(evt){
|
||||
$(that).removeClass('hide-input');
|
||||
$(this).addClass('hide');
|
||||
$('span.save.label',that).removeClass('hide');
|
||||
$('input',that).removeAttr('disabled');
|
||||
});
|
||||
function handleSend(evt){
|
||||
that2=this;
|
||||
$.getJSON($(that).attr("action"),$(that).serialize(),function(evt){
|
||||
if(!evt.error){
|
||||
$(that).addClass('hide-input');
|
||||
$('input',that).attr('disabled','disabled');
|
||||
$('span.save.label',that).addClass('hide');
|
||||
$('span.edit.label',that).removeClass('hide');
|
||||
}else{
|
||||
//TODO Handle error
|
||||
console.log("TODO Handle Error");
|
||||
}
|
||||
});
|
||||
}
|
||||
$('span.save.label',this).addClass('hide');
|
||||
$('input',this).attr('disabled','disabled');
|
||||
$('span.save.label',this).click(handleSend);
|
||||
$(that).submit(function(evt){
|
||||
evt.stopPropagation();
|
||||
handleSend(evt);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
//$(where+" form label.has-error").parent(".form-group").addClass("has-error")
|
||||
//$(where+" form label.has-error").parent(".form-group").addClass("has-error")
|
||||
}
|
||||
function setContent(data,back,tab){
|
||||
alert = data.split('<!-- alert -->')[1].split('<!-- /alert -->')[0];
|
||||
|
|
|
@ -64,5 +64,8 @@ ALTER TABLE `mic_dj_account_isearch` CHANGE `job` `job_id` INT(11) NOT NULL;
|
|||
ALTER TABLE `mic_dj_account_isearch`
|
||||
ADD CONSTRAINT `mic_dj_account_isearch_branch` FOREIGN KEY (`branch_id`) REFERENCES `mic_dj_list_branch` (`id`),
|
||||
ADD CONSTRAINT `mic_dj_account_isearch_job` FOREIGN KEY (`job_id`) REFERENCES `mic_dj_list_job` (`id`);
|
||||
|
||||
-- Lebenslauf;
|
||||
ALTER TABLE `mic_dj_cv_entry` ADD `worker_id` INT(11) NOT NULL AFTER `category_id`;
|
||||
Update `mic_dj_cv_entry` left join `mic_dj_cv_category` on `mic_dj_cv_category`.`id` = `mic_dj_cv_entry`.`category_id` set `mic_dj_cv_entry`.`worker_id`=`mic_dj_cv_category`.`worker_id`;
|
||||
Update `mic_dj_cv_entry` left join `mic_dj_cv_category` on `mic_dj_cv_category`.`id` = `mic_dj_cv_entry`.`category_id` set `mic_dj_cv_entry`.`category_id`=`mic_dj_cv_category`.`category_id`;
|
||||
|
||||
|
|
Loading…
Reference in New Issue