From 675bc39bf095e45ee569faf485856df7755b03bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Fri, 28 Mar 2014 16:22:19 +0100 Subject: [PATCH] ISearch - noch nicht fertig! --- .../Component/MiconwareSessionComponent.php | 22 +++- app/Controller/HomeController.php | 14 +-- app/Controller/JobController.php | 10 +- app/Controller/UserController.php | 21 +++- app/Model/DreamjobCompany.php | 18 ++- app/Model/DreamjobISearch.php | 117 ++++++++++++++++++ app/Model/DreamjobJobOpening.php | 13 +- app/Model/DreamjobWorker.php | 4 + app/View/Elements/job_opening_head_extra.ctp | 2 +- app/View/Elements/job_opening_item.ctp | 2 +- app/View/Elements/navbar.ctp | 1 - app/View/Job/opening_edit.ctp | 2 +- app/View/User/company.ctp | 2 +- app/View/User/settings_account.ctp | 2 +- app/View/User/settings_isearch.ctp | 37 ++++++ app/webroot/css/dreamjob.css | 6 + app/webroot/js/dreamjob.js | 48 ++++++- update.sql | 11 ++ 18 files changed, 295 insertions(+), 37 deletions(-) create mode 100644 app/Model/DreamjobISearch.php diff --git a/app/Controller/Component/MiconwareSessionComponent.php b/app/Controller/Component/MiconwareSessionComponent.php index cbbdb76..0ef7408 100755 --- a/app/Controller/Component/MiconwareSessionComponent.php +++ b/app/Controller/Component/MiconwareSessionComponent.php @@ -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' => '
', - 'after' => '
', - '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 */ diff --git a/app/Controller/HomeController.php b/app/Controller/HomeController.php index 7f6c9c4..fa8566e 100755 --- a/app/Controller/HomeController.php +++ b/app/Controller/HomeController.php @@ -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'); diff --git a/app/Controller/JobController.php b/app/Controller/JobController.php index 7a1fb3c..57a5177 100644 --- a/app/Controller/JobController.php +++ b/app/Controller/JobController.php @@ -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)); } diff --git a/app/Controller/UserController.php b/app/Controller/UserController.php index 1475574..b6dea94 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', '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'); } diff --git a/app/Model/DreamjobCompany.php b/app/Model/DreamjobCompany.php index d84a7c1..cd46a90 100755 --- a/app/Model/DreamjobCompany.php +++ b/app/Model/DreamjobCompany.php @@ -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' => diff --git a/app/Model/DreamjobISearch.php b/app/Model/DreamjobISearch.php new file mode 100644 index 0000000..50cd983 --- /dev/null +++ b/app/Model/DreamjobISearch.php @@ -0,0 +1,117 @@ + 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' => '' + ) + ); +} diff --git a/app/Model/DreamjobJobOpening.php b/app/Model/DreamjobJobOpening.php index f62fd4c..2b9057e 100644 --- a/app/Model/DreamjobJobOpening.php +++ b/app/Model/DreamjobJobOpening.php @@ -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' => '' ) ); diff --git a/app/Model/DreamjobWorker.php b/app/Model/DreamjobWorker.php index e26d6b3..412ef49 100755 --- a/app/Model/DreamjobWorker.php +++ b/app/Model/DreamjobWorker.php @@ -239,6 +239,10 @@ class DreamjobWorker extends AppModel { 'DreamjobJobApplication' => array( 'className' => 'DreamjobJobApplication', 'foreignKey' => 'worker_id' + ), + 'DreamjobISearch' => array( + 'className' => 'DreamjobISearch', + 'foreignKey' => 'worker_id' ) ); } diff --git a/app/View/Elements/job_opening_head_extra.ctp b/app/View/Elements/job_opening_head_extra.ctp index 430a1a0..8e22a05 100644 --- a/app/View/Elements/job_opening_head_extra.ctp +++ b/app/View/Elements/job_opening_head_extra.ctp @@ -6,7 +6,7 @@

:
- :
+ :
:
strtotime($opening['DreamjobJobOpening']['enddate'])){ ?> class="opening_outdate">: Time->format('d.m.Y', $opening['DreamjobJobOpening']['enddate']);?>

diff --git a/app/View/Elements/job_opening_item.ctp b/app/View/Elements/job_opening_item.ctp index 7b1b523..ca44f17 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/navbar.ctp b/app/View/Elements/navbar.ctp index d351899..cc47231 100755 --- a/app/View/Elements/navbar.ctp +++ b/app/View/Elements/navbar.ctp @@ -7,7 +7,6 @@ if(!empty($isLoggedin)){ class="active">Html->link(__('dreamjob.startpage'),array('controller'=>'home','action'=>'home'));?> class="active">Html->link(__('dreamjob.search'),'/search/');?> - class="active">Html->link(__('dreamjob.settings'),'/settings/');?> class="active">Html->link(__('dreamjob.service'),'/service/');?>
  • Html->link(__('dreamjob.logout'),array('controller'=>'home','action'=>'logout'));?>
  • diff --git a/app/View/Job/opening_edit.ctp b/app/View/Job/opening_edit.ctp index b1e160b..371c535 100644 --- a/app/View/Job/opening_edit.ctp +++ b/app/View/Job/opening_edit.ctp @@ -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']))); ?>
    diff --git a/app/View/User/company.ctp b/app/View/User/company.ctp index 2107aed..a281eef 100644 --- a/app/View/User/company.ctp +++ b/app/View/User/company.ctp @@ -69,7 +69,7 @@ if($profil['AppUser']['take_systemwide']){

    :
    - +

    diff --git a/app/View/User/settings_account.ctp b/app/View/User/settings_account.ctp index 56df967..477e2a7 100644 --- a/app/View/User/settings_account.ctp +++ b/app/View/User/settings_account.ctp @@ -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']))); diff --git a/app/View/User/settings_isearch.ctp b/app/View/User/settings_isearch.ctp index 6c0b775..dea559c 100644 --- a/app/View/User/settings_isearch.ctp +++ b/app/View/User/settings_isearch.ctp @@ -20,4 +20,41 @@ if($profil['AppUser']['take_systemwide']){

    + Form->create("DreamjobISearch",$default_hForm); + ?> + + + + + + + + + + + data['DreamjobISearch'] as $i => $egal) { + ?> + + + + + + + + + + + + + + +
    + Form->hidden("DreamjobISearch.$i.id",array('empty' => __('dreamjob.form.chooseOne')));?> + Form->input("DreamjobISearch.$i.branch_id",array('empty' => __('dreamjob.form.chooseOne')));?> + Form->input("DreamjobISearch.$i.job_id",array('empty' =>__('dreamjob.form.chooseOne')));?>Form->input("DreamjobISearch.$i.kindofjob_id",array('empty' => __('dreamjob.form.chooseOne')));?>
    Form->input('DreamjobISearch..branch_id',array('empty' => __('dreamjob.form.chooseOne')));?>Form->input('DreamjobISearch..job_id',array('empty' =>__('dreamjob.form.chooseOne')));?>Form->input('DreamjobISearch..kindofjob_id',array('empty' => __('dreamjob.form.chooseOne')));?>
    diff --git a/app/webroot/css/dreamjob.css b/app/webroot/css/dreamjob.css index 2fbc12c..8a33bed 100755 --- a/app/webroot/css/dreamjob.css +++ b/app/webroot/css/dreamjob.css @@ -401,4 +401,10 @@ body.loading #container{ .infofield{ color:black; } +.table > thead > tr > th { + color:black; +} +.tableForm tbody tr.new .btn-del{ + display:none; +} diff --git a/app/webroot/js/dreamjob.js b/app/webroot/js/dreamjob.js index 7335d6a..378623b 100755 --- a/app/webroot/js/dreamjob.js +++ b/app/webroot/js/dreamjob.js @@ -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(""+newRow+""); + 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){ diff --git a/update.sql b/update.sql index de3d497..2189a63 100644 --- a/update.sql +++ b/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; + +