city abhängigkeit herstellen

This commit is contained in:
Martin Müller 2014-04-22 16:01:00 +02:00
parent f2c5ff813f
commit 1ce809293f
19 changed files with 74 additions and 36 deletions

View File

@ -65,6 +65,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->set('cities',$this->DreamjobListCity->find('list'));
$this->render('/Job/opening_edit');
}else{
$this->set('error', 'dreamjob.error.noCompany');
@ -100,6 +101,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->set('cities',$this->DreamjobListCity->find('list'));
}
if(empty($this->request->data['DreamjobJobOpening'])){

View File

@ -36,7 +36,7 @@ class RegistrationController extends AppController {
$data = array();
$data['User']['password'] = $this->MiconwareSession->create_hash($this->request->data['User']['password1']);
$data['User']['mail'] = $this->request->data['User']['mail'];
$data['DreamjobUser']['city'] = $this->request->data['DreamjobUser']['city'];
$data['DreamjobUser']['city_id'] = $this->request->data['DreamjobUser']['city_id'];
$data['DreamjobUser']['street'] = $this->request->data['DreamjobUser']['street'];
$data['DreamjobUser']['postcode'] = $this->request->data['DreamjobUser']['postcode'];
$data['AppUser']['nickname'] = $this->request->data['AppUser']['nickname'];
@ -67,6 +67,7 @@ class RegistrationController extends AppController {
}
}
$this->set('result',$regResult);
$this->set('cities',$this->DreamjobListCity->find('list'));
$this->set('branches',$this->DreamjobListBranch->find('list'));
$this->render('/Registration/company');
}else{
@ -87,7 +88,7 @@ class RegistrationController extends AppController {
$data = array();
$data['User']['password'] = $this->MiconwareSession->create_hash($this->request->data['User']['password1']);
$data['User']['mail'] = $this->request->data['User']['mail'];
$data['DreamjobUser']['city'] = $this->request->data['DreamjobUser']['city'];
$data['DreamjobUser']['city_id'] = $this->request->data['DreamjobUser']['city_id'];
$data['DreamjobUser']['street'] = $this->request->data['DreamjobUser']['street'];
$data['DreamjobUser']['postcode'] = $this->request->data['DreamjobUser']['postcode'];
$data['AppUser']['bday'] = $this->request->data['AppUser']['bday'];
@ -127,6 +128,7 @@ class RegistrationController extends AppController {
}
}
$this->set('result',$regResult);
$this->set('cities',$this->DreamjobListCity->find('list'));
$this->set('mannerofaddresses',$this->Mannerofaddress->find('list'));
$this->set('graducations',$this->DreamjobListGraducation->find('list'));
$this->render('/Registration/worker');

View File

@ -10,7 +10,7 @@ class UserController extends AppController {
* @var array
*/
public $uses = array('DreamjobListGraducation', 'DreamjobWorker', 'DreamjobCompany', 'DreamjobPageText','DreamjobPageInh', 'DreamjobPageImage', 'DreamjobJobOpening', 'DreamjobCvEntry', 'DreamjobListCvCategory', 'DreamjobListGraducation', 'DreamjobListJob','DreamjobListKindofjob','DreamjobListBranch','Mannerofaddress','DreamjobISearch','User','AppUser');
public $uses = array('DreamjobListGraducation', 'DreamjobWorker', 'DreamjobCompany', 'DreamjobPageText','DreamjobPageInh', 'DreamjobPageImage', 'DreamjobJobOpening', 'DreamjobCvEntry', 'DreamjobListCvCategory', 'DreamjobListGraducation', 'DreamjobListJob','DreamjobListKindofjob','DreamjobListBranch','Mannerofaddress','DreamjobISearch','User','AppUser','DreamjobListCity');
public $components = array('MiconwareSession','RequestHandler');
/**
@ -256,7 +256,7 @@ class UserController extends AppController {
if($this->request->data['User']['password1']!='')
$profil['User']['password'] = $this->MiconwareSession->create_hash($this->request->data['User']['password1']);
$profil['DreamjobUser']['city'] = $this->request->data['DreamjobUser']['city'];
$profil['DreamjobUser']['city_id'] = $this->request->data['DreamjobUser']['city_id'];
$profil['DreamjobUser']['street'] = $this->request->data['DreamjobUser']['street'];
$profil['DreamjobUser']['postcode'] = $this->request->data['DreamjobUser']['postcode'];
$profil['AppUser']['bday'] = $this->request->data['AppUser']['bday'];
@ -299,6 +299,7 @@ class UserController extends AppController {
$this->set('graducations',$this->DreamjobListGraducation->find('list'));
$this->set('branches',$this->DreamjobListBranch->find('list'));
$this->set('mannerofaddresses',$this->Mannerofaddress->find('list'));
$this->set('cities',$this->DreamjobListCity->find('list'));
$this->render('/User/settings_account');
}
}

View File

@ -120,7 +120,7 @@ class DreamjobCompany extends AppModel {
if($result)
$result = $this->DreamjobUser->saveField('street',$data['DreamjobUser']['street']);
if($result)
$result = $this->DreamjobUser->saveField('city',$data['DreamjobUser']['city']);
$result = $this->DreamjobUser->saveField('city_id',$data['DreamjobUser']['city_id']);
if($result)
$result = $this->DreamjobUser->saveField('postcode',$data['DreamjobUser']['postcode']);
@ -260,6 +260,12 @@ class DreamjobCompany extends AppModel {
'foreignKey' => false,
'conditions' => array('DreamjobCompany.djaccount_ptr_id=AppUser.id and User.id = AppUser.user_id'),
'limit' => 1
),
'DreamjobListCity' => array(
'className' => 'DreamjobListCity',
'foreignKey' => false,
'conditions' => array('DreamjobListCity.id=DreamjobUser.city_id'),
'limit' => 1
)
);
public $hasMany = array(

View File

@ -56,16 +56,6 @@ class DreamjobJobOpening extends AppModel {
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'city' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'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
),
),
'postcode' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
@ -208,6 +198,13 @@ class DreamjobJobOpening extends AppModel {
'conditions' => '',
'fields' => '',
'order' => ''
),
'DreamjobListCity' => array(
'className' => 'DreamjobListCity',
'foreignKey' => 'city_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);

View File

@ -71,16 +71,6 @@ class DreamjobUser extends AppModel {
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'city' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'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
),
),
'postcode' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
@ -98,6 +88,19 @@ class DreamjobUser extends AppModel {
'AppUser' => array(
'className' => 'AppUser',
'foreignKey' => 'id'
),
'User' => array(
'className' => 'User',
'foreignKey' => false,
'conditions' => array('DreamjobWorker.djaccount_ptr_id=AppUser.id and User.id = AppUser.user_id'),
'limit' => 1
),
'DreamjobListCity' => array(
'className' => 'DreamjobListCity',
'foreignKey' => 'city_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);
}

View File

@ -137,7 +137,7 @@ class DreamjobWorker extends AppModel {
if($result)
$result = $this->DreamjobUser->saveField('street',$data['DreamjobUser']['street']);
if($result)
$result = $this->DreamjobUser->saveField('city',$data['DreamjobUser']['city']);
$result = $this->DreamjobUser->saveField('city_id',$data['DreamjobUser']['city_id']);
if($result)
$result = $this->DreamjobUser->saveField('postcode',$data['DreamjobUser']['postcode']);
@ -301,7 +301,13 @@ class DreamjobWorker extends AppModel {
'foreignKey' => false,
'conditions' => array('DreamjobWorker.djaccount_ptr_id=AppUser.id and User.id = AppUser.user_id'),
'limit' => 1
)
),
'DreamjobListCity' => array(
'className' => 'DreamjobListCity',
'foreignKey' => false,
'conditions' => array('DreamjobListCity.id=DreamjobUser.city_id'),
'limit' => 1
)
);
public $hasMany = array(
'DreamjobPageInh' => array(

View File

@ -35,7 +35,7 @@ if($company['AppUser']['take_systemwide']){
<?php } ?>
<div class="left">
<span><?=__("dreamjob.branch");?>: <?=$company['DreamjobListBranch']['name'];?></span>
<span><?=__("dreamjob.city");?>: <?=$company['DreamjobUser']['city'];?></span>
<span><?=__("dreamjob.city");?>: <?=$company['DreamjobListCity']['name'];?></span>
</div>
<div class="right">
<div class="btn-group-vertical">

View File

@ -20,5 +20,5 @@
<p>
<?=__("dreamjob.address");?>: <br/>
<?=$opening['DreamjobUser']['street'];?><br/>
<?=$opening['DreamjobUser']['postcode']." ".$opening['DreamjobUser']['city'];?>
<?=$opening['DreamjobUser']['postcode']." ".$opening['DreamjobListCity']['name'];?>
</p>

View File

@ -64,7 +64,7 @@ if($opening['AppUser']['take_systemwide']){
<div class="left">
<span><?=__("dreamjob.graducation.company");?>: <?=$opening['DreamjobListGraducation']['name'];?></span>
<span><?=__("dreamjob.branch");?>: <?=$opening['DreamjobListBranch']['name'];?></span>
<span><?=__("dreamjob.city");?>: <?=$opening['DreamjobJobOpening']['city'];?></span>
<span><?=__("dreamjob.city");?>: <?=$opening['DreamjobListCity']['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>
</div>

View File

@ -38,6 +38,10 @@ if($edit){
<td><?=__("dreamjob.graducation.worker");?></td>
<td><?=$profil['DreamjobListGraducation']['name'];?></td>
</tr>
<tr>
<td><?=__("dreamjob.city");?></td>
<td><?=$profil['DreamjobListCity']['name'];?></td>
</tr>
<tr>
<td><?=__("dreamjob.country.worker");?></td>
<td><?=$profil['DreamjobWorker']['country'];?></td>

View File

@ -42,6 +42,10 @@ echo $this->Html->link($text,array('controller'=>'user','action'=>'profil'),arra
<td><?=__("dreamjob.graducation.worker");?></td>
<td><?=$profil['DreamjobListGraducation']['name'];?></td>
</tr>
<tr>
<td><?=__("dreamjob.city");?></td>
<td><?=$profil['DreamjobListCity']['name'];?></td>
</tr>
<tr>
<td><?=__("dreamjob.country.worker");?></td>
<td><?=$profil['DreamjobWorker']['country'];?></td>

View File

@ -37,7 +37,7 @@
<img src="<?=$url;?>"/>
</div>
<div class="left">
<span><?=__('dreamjob.city').': '.$profil[$DreamjobUser]['city'];?></span>
<span><?=__('dreamjob.city').': '.$profil['DreamjobListCity']['name'];?></span>
<span><?=__('dreamjob.graducation').': '.$profil[$DreamjobListGraducation]['name'];?></span>
<?php if($profil['DreamjobWorker']['workexperience']){ ?>
<span><?=__('dreamjob.workexperience').': '.$profil['DreamjobWorker']['workexperience'].' ',__('dreamjob.years');?></span>

View File

@ -42,7 +42,7 @@ echo $this->Form->create('DreamjobJobOpening',$default_Form);
<legend><?=__("dreamjob.address");?></legend>
<?php echo $this->Form->input('DreamjobJobOpening.street',array('label'=>array('text'=>__("dreamjob.street"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobJobOpening.postcode',array('label'=>array('text'=>__("dreamjob.postcode"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobJobOpening.city',array("label" => array('text'=>__("dreamjob.city"),"class"=>$default_Form['inputDefaults']['label']['class']))); ?>
echo $this->Form->input('DreamjobJobOpening.city_id',array("label" => array('text'=>__("dreamjob.city"),"class"=>$default_Form['inputDefaults']['label']['class']))); ?>
<legend><?=__("dreamjob.text");?></legend>
<?php echo $this->Form->textarea('DreamjobJobOpening.text',array("class"=>'form-control',"rows"=>10)); ?>
<div class="buttonrow">

View File

@ -29,7 +29,7 @@
<legend><?=__("dreamjob.addresse");?></legend>
<?php
echo $this->Form->input('DreamjobUser.street',array('label'=>array('text'=>__("dreamjob.street"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobUser.city',array('label'=>array('text'=>__("dreamjob.city"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobUser.city_id',array('label'=>array('text'=>__("dreamjob.city"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobUser.postcode',array('label'=>array('text'=>__("dreamjob.postcode"),"class"=>$default_Form['inputDefaults']['label']['class'])));
?>
<div class="buttonrow">

View File

@ -29,7 +29,7 @@
<legend><?=__("dreamjob.addresse");?></legend>
<?php
echo $this->Form->input('DreamjobUser.street',array('label'=>array('text'=>__("dreamjob.street"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobUser.city',array('label'=>array('text'=>__("dreamjob.city"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobUser.city_id',array('label'=>array('text'=>__("dreamjob.city"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobUser.postcode',array('label'=>array('text'=>__("dreamjob.postcode"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobWorker.country',array('label'=>array('text'=>__("dreamjob.country"),"class"=>$default_Form['inputDefaults']['label']['class'])));
?>

View File

@ -85,7 +85,7 @@ if($profil['AppUser']['take_systemwide']){
<div class="bar">
<h3><?=__("dreamjob.address");?></h3>
<?=$profil['DreamjobUser']['street'];?><br/>
<?=$profil['DreamjobUser']['postcode']." ".$profil['DreamjobUser']['city'];?>
<?=$profil['DreamjobUser']['postcode']." ".$profil['DreamjobListCity']['name'];?>
</div>
</div>
</div>

View File

@ -73,7 +73,7 @@ if($profil['AppUser']['take_systemwide']){
<legend><?=__("dreamjob.addresse");?></legend>
<?php
echo $this->Form->input('DreamjobUser.street',array('label'=>array('text'=>__("dreamjob.street"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobUser.city',array('label'=>array('text'=>__("dreamjob.city"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobUser.city_id',array('label'=>array('text'=>__("dreamjob.city"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('DreamjobUser.postcode',array('label'=>array('text'=>__("dreamjob.postcode"),"class"=>$default_Form['inputDefaults']['label']['class'])));
if($WORKER)
echo $this->Form->input('DreamjobWorker.country',array('label'=>array('text'=>__("dreamjob.country"),"class"=>$default_Form['inputDefaults']['label']['class'])));

View File

@ -87,3 +87,16 @@ Update `mic_sys_micacc` `a` join `mic_sys_micacc` `d` on `d`.`id` = `a`.`id` set
--UPDATE `mic_dj_list_cv-category` SET `position` = '80' WHERE `mic_dj_list_cv-category`.`id` = 2;
--UPDATE `mic_dj_list_cv-category` SET `position` = '90' WHERE `mic_dj_list_cv-category`.`id` = 10;
-- CITY in abhängigkeit
update `mic_dj_account_acc` left join `mic_dj_list_city` on `name`=`city` set `city`=`mic_dj_list_city`.`id`;
update `mic_dj_jobs_opening` left join `mic_dj_list_city` on `name`=`city` set `city`=`mic_dj_list_city`.`id`;
ALTER TABLE `mic_dj_account_acc` CHANGE `city` `city_id` INT(11) NOT NULL;
ALTER TABLE `mic_dj_jobs_opening` CHANGE `city` `city_id` INT(11) NOT NULL;
-- opening:1/5
-- acc:22/71