diff --git a/app/Controller/JobController.php b/app/Controller/JobController.php index d07f571..0b3ab13 100644 --- a/app/Controller/JobController.php +++ b/app/Controller/JobController.php @@ -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'])){ diff --git a/app/Controller/RegistrationController.php b/app/Controller/RegistrationController.php index 15db8b6..885ed5b 100644 --- a/app/Controller/RegistrationController.php +++ b/app/Controller/RegistrationController.php @@ -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'); diff --git a/app/Controller/UserController.php b/app/Controller/UserController.php index 540b6b7..aac06df 100755 --- a/app/Controller/UserController.php +++ b/app/Controller/UserController.php @@ -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'); } } diff --git a/app/Model/DreamjobCompany.php b/app/Model/DreamjobCompany.php index d5536ff..cfdc633 100755 --- a/app/Model/DreamjobCompany.php +++ b/app/Model/DreamjobCompany.php @@ -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( diff --git a/app/Model/DreamjobJobOpening.php b/app/Model/DreamjobJobOpening.php index 2b9057e..1427775 100644 --- a/app/Model/DreamjobJobOpening.php +++ b/app/Model/DreamjobJobOpening.php @@ -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' => '' ) ); diff --git a/app/Model/DreamjobUser.php b/app/Model/DreamjobUser.php index bc7d2ea..8b05cfd 100755 --- a/app/Model/DreamjobUser.php +++ b/app/Model/DreamjobUser.php @@ -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' => '' ) ); } diff --git a/app/Model/DreamjobWorker.php b/app/Model/DreamjobWorker.php index c6a5b00..d7d9bad 100755 --- a/app/Model/DreamjobWorker.php +++ b/app/Model/DreamjobWorker.php @@ -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( diff --git a/app/View/Elements/job_company_item.ctp b/app/View/Elements/job_company_item.ctp index 94291aa..94d14f2 100644 --- a/app/View/Elements/job_company_item.ctp +++ b/app/View/Elements/job_company_item.ctp @@ -35,7 +35,7 @@ if($company['AppUser']['take_systemwide']){
: - : + :
diff --git a/app/View/Elements/job_opening_head_extra.ctp b/app/View/Elements/job_opening_head_extra.ctp index 8e22a05..780f5d7 100644 --- a/app/View/Elements/job_opening_head_extra.ctp +++ b/app/View/Elements/job_opening_head_extra.ctp @@ -20,5 +20,5 @@

:

- +

diff --git a/app/View/Elements/job_opening_item.ctp b/app/View/Elements/job_opening_item.ctp index a214ee5..1a4b7c1 100644 --- a/app/View/Elements/job_opening_item.ctp +++ b/app/View/Elements/job_opening_item.ctp @@ -64,7 +64,7 @@ if($opening['AppUser']['take_systemwide']){
: : - : + : : strtotime($opening['DreamjobJobOpening']['enddate'])){ ?> class="opening_outdate">: Time->format('d.m.Y', $opening['DreamjobJobOpening']['enddate']);?>
diff --git a/app/View/Elements/user_worker_cv.ctp b/app/View/Elements/user_worker_cv.ctp index f6510aa..da7281f 100644 --- a/app/View/Elements/user_worker_cv.ctp +++ b/app/View/Elements/user_worker_cv.ctp @@ -38,6 +38,10 @@ if($edit){ + + + + diff --git a/app/View/Elements/user_worker_cv_edit.ctp b/app/View/Elements/user_worker_cv_edit.ctp index c6c487e..50ccfd6 100644 --- a/app/View/Elements/user_worker_cv_edit.ctp +++ b/app/View/Elements/user_worker_cv_edit.ctp @@ -42,6 +42,10 @@ echo $this->Html->link($text,array('controller'=>'user','action'=>'profil'),arra + + + + diff --git a/app/View/Elements/user_worker_item.ctp b/app/View/Elements/user_worker_item.ctp index 1785e4f..c62c6d8 100644 --- a/app/View/Elements/user_worker_item.ctp +++ b/app/View/Elements/user_worker_item.ctp @@ -37,7 +37,7 @@
- + diff --git a/app/View/Job/opening_edit.ctp b/app/View/Job/opening_edit.ctp index 371c535..5fc4a80 100644 --- a/app/View/Job/opening_edit.ctp +++ b/app/View/Job/opening_edit.ctp @@ -42,7 +42,7 @@ echo $this->Form->create('DreamjobJobOpening',$default_Form); 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']))); ?> Form->textarea('DreamjobJobOpening.text',array("class"=>'form-control',"rows"=>10)); ?>
diff --git a/app/View/Registration/company.ctp b/app/View/Registration/company.ctp index 75668f0..57ba472 100644 --- a/app/View/Registration/company.ctp +++ b/app/View/Registration/company.ctp @@ -29,7 +29,7 @@ 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']))); ?>
diff --git a/app/View/Registration/worker.ctp b/app/View/Registration/worker.ctp index b992a63..f5e6dbf 100644 --- a/app/View/Registration/worker.ctp +++ b/app/View/Registration/worker.ctp @@ -29,7 +29,7 @@ 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']))); ?> diff --git a/app/View/User/company.ctp b/app/View/User/company.ctp index 780ebcc..c731e77 100644 --- a/app/View/User/company.ctp +++ b/app/View/User/company.ctp @@ -85,7 +85,7 @@ if($profil['AppUser']['take_systemwide']){


- +
diff --git a/app/View/User/settings_account.ctp b/app/View/User/settings_account.ctp index 18d24e9..5dc0c81 100644 --- a/app/View/User/settings_account.ctp +++ b/app/View/User/settings_account.ctp @@ -73,7 +73,7 @@ if($profil['AppUser']['take_systemwide']){ 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']))); diff --git a/update.sql b/update.sql index 6bd98bb..d567e0d 100644 --- a/update.sql +++ b/update.sql @@ -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 + + + + +