From 424b6eafab515dfe2f9f1ece21ee88a0407135c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Tue, 3 Jun 2014 16:51:20 +0200 Subject: [PATCH] isearch/cv - disable autosave --- app/View/Elements/user_worker_cv_edit.ctp | 51 +++++++++++--------- app/View/User/settings_imageUpload.ctp | 2 +- app/View/User/settings_isearch.ctp | 18 ++++--- app/View/User/settings_pages.ctp | 2 +- app/webroot/js/dreamjob.js | 58 ++++++----------------- 5 files changed, 56 insertions(+), 75 deletions(-) diff --git a/app/View/Elements/user_worker_cv_edit.ctp b/app/View/Elements/user_worker_cv_edit.ctp index 751d864..f9af1ef 100644 --- a/app/View/Elements/user_worker_cv_edit.ctp +++ b/app/View/Elements/user_worker_cv_edit.ctp @@ -63,43 +63,43 @@ echo $this->Html->link($text,array('controller'=>'user','action'=>'profil'),arra - :Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?>:Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100,'maxYear' => date('Y')));?> - Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?>Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?> + :Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?>:Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100,'maxYear' => date('Y'),'required'=>false));?> + Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?>Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str'],'required'=>false));?> - Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> + Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> - Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> + Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> - Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?> - Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?> + Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?> + Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str'],'required'=>false));?> - Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?>Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?> + Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?>Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str'],'required'=>false));?> - : Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?>
: Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> + : Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?>
: Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> - Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> + Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> - Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> + Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> @@ -107,7 +107,7 @@ echo $this->Html->link($text,array('controller'=>'user','action'=>'profil'),arra - Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?> + Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?> @@ -123,43 +123,43 @@ echo $this->Html->link($text,array('controller'=>'user','action'=>'profil'),arra - :Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?>:Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> - Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?>Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?> + :Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?>:Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> + Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?>Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str'],'required'=>false));?> - Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> + Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> - Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> + Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> - Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?> - Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?> + Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?> + Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str'],'required'=>false));?> - Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?>Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?> + Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?>Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str'],'required'=>false));?> - :Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> :Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> + :Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> :Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> - Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> + Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> - Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> + Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> @@ -167,16 +167,21 @@ echo $this->Html->link($text,array('controller'=>'user','action'=>'profil'),arra - Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?> + Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?> - Form->input('DreamjobCvEntry..category_id',array('type'=>'hidden','value'=>$cvc_item['DreamjobListCvCategory']['id']));?> + Form->input('DreamjobCvEntry..category_id',array('type'=>'hidden','value'=>$cvc_item['DreamjobListCvCategory']['id'],'required'=>false));?> +
+ Form->button(' '.__('dreamjob.settings.save'),array('div' => false,'class'=>"btn btn-primary ",'type' => 'submit'));?> +
+Form->end(); ?> diff --git a/app/View/User/settings_imageUpload.ctp b/app/View/User/settings_imageUpload.ctp index bb66912..68ed80b 100644 --- a/app/View/User/settings_imageUpload.ctp +++ b/app/View/User/settings_imageUpload.ctp @@ -11,7 +11,7 @@ echo $this->Form->input('AppUser.avatar',array('type'=>'file','label'=>array('text'=>__("dreamjob.avatar"),"class"=>$default_Form['inputDefaults']['label']['class']))); ?>
- Form->button(' '.__('dreamjob.settings.save'),array('div' => false,'class'=>"btn btn-primary ",'type' => 'submit'));?> + Form->button(' '.__('dreamjob.save'),array('div' => false,'class'=>"btn btn-primary ",'type' => 'submit'));?>
Form->end(); diff --git a/app/View/User/settings_isearch.ctp b/app/View/User/settings_isearch.ctp index 3bf3d05..fed899f 100644 --- a/app/View/User/settings_isearch.ctp +++ b/app/View/User/settings_isearch.ctp @@ -39,21 +39,27 @@ if($profil['AppUser']['take_systemwide']){ Form->hidden("DreamjobISearch.$i.id");?> - Form->input("DreamjobISearch.$i.branch_id",array('empty' => __('dreamjob.form.chooseOne')));?> + Form->input("DreamjobISearch.$i.branch_id",array('empty' => __('dreamjob.form.chooseOne'),'required'=>false));?> - 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.$i.job_id",array('empty' =>__('dreamjob.form.chooseOne'),'required'=>false));?> + Form->input("DreamjobISearch.$i.kindofjob_id",array('empty' => __('dreamjob.form.chooseOne'),'required'=>false));?> - 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')));?> + Form->input('DreamjobISearch..branch_id',array('empty' => __('dreamjob.form.chooseOne'),'required'=>false));?> + Form->input('DreamjobISearch..job_id',array('empty' =>__('dreamjob.form.chooseOne'),'required'=>false));?> + Form->input('DreamjobISearch..kindofjob_id',array('empty' => __('dreamjob.form.chooseOne'),'required'=>false));?> +
+ Form->button(' '.__('dreamjob.save'),array('div' => false,'class'=>"btn btn-primary ",'type' => 'submit'));?> +
+Form->end(); +?> diff --git a/app/View/User/settings_pages.ctp b/app/View/User/settings_pages.ctp index fd555c0..60bf24b 100644 --- a/app/View/User/settings_pages.ctp +++ b/app/View/User/settings_pages.ctp @@ -110,7 +110,7 @@ if($profil['AppUser']['take_systemwide']){ echo $this->Html->link(' '.__('dreamjob.page.del'),array('controller'=>'user','action'=>'settings_pageInh','?'=>array('del'=> $pag['id'])),array('escape'=>false,'class'=>'btn btn-default')); } ?> - Form->button(' '.__('dreamjob.settings.save'),array('div' => false,'class'=>"btn btn-primary ",'type' => 'submit'));?> + Form->button(' '.__('dreamjob.save'),array('div' => false,'class'=>"btn btn-primary ",'type' => 'submit'));?> Form->end(); diff --git a/app/webroot/js/dreamjob.js b/app/webroot/js/dreamjob.js index cae93d2..7f53e1f 100755 --- a/app/webroot/js/dreamjob.js +++ b/app/webroot/js/dreamjob.js @@ -15,8 +15,6 @@ var global_load = null; } }); $(window).bind('popstate', function(evt) { - console.log(evt.target.pageurl); - console.log(evt); if (evt.originalEvent.state !== null) { load(location.href, {'history': false}, false); } @@ -57,7 +55,7 @@ var global_load = null; $(where + " a").tooltip(); ; $(where + " a").not('[href*="mailto:"]').each(function(that) { - if ($(this).attr("rel") !== "external" && $(this).attr("ref") !== "eventOff" && !$(this).parents('ul').hasClass("wysihtml5-toolbar") && !$(this).hasClass(".select2-choice") && !$(this).parents('form').hasClass('tableForm')) + if ($(this).attr("rel") !== "external" && $(this).attr("ref") !== "eventOff" && !$(this).parents('ul').hasClass("wysihtml5-toolbar") && !$(this).hasClass(".select2-choice")) $(this).click(function(e) { stopLoad(e); load($(this).attr('href'), {}, ($(this).attr('rel') == "tab")); @@ -66,8 +64,19 @@ var global_load = null; }); $(where + " form").submit(function(e) { - if (!$(this).hasClass("hide-form") && $(this).attr('enctype') != 'multipart/form-data') { + if ($(this).attr('enctype') != 'multipart/form-data') { stopLoad(e); + if ($(this).hasClass('tableForm')) { + $("tbody tr.new", $(this)).remove(); + i=0; + $("tbody tr", $(this)).each(function() { + $(":input[name]", this).each(function() { + str = $(this).attr("name").replace(/data\[(.*?)\]\[.*?\]\[(.+)\]/g, 'data[$1][' + i + '][$2]'); + $(this).attr("name", str); + }); + i++; + }); + } $(":input[ name *= '_wysihtml5_mod' ]", this).remove(); //stopLoad(e); if ($(this).attr("back")) @@ -80,12 +89,12 @@ var global_load = null; }); $(where + " form[ enctype *= 'multipart/form-data' ]").each(function(evt) { - stopLoad(evt); if (!$('#fileUpload').length) $('body').append('