isearch/cv - disable autosave

This commit is contained in:
Martin Müller 2014-06-03 16:51:20 +02:00
parent 18c9fb9b29
commit 424b6eafab
5 changed files with 56 additions and 75 deletions

View File

@ -63,43 +63,43 @@ echo $this->Html->link($text,array('controller'=>'user','action'=>'profil'),arra
<?php <?php
if($cvc_item['DreamjobListCvCategory']['startdate'] and $cvc_item['DreamjobListCvCategory']['enddate'] and $cvc_item['DreamjobListCvCategory']['place']){ if($cvc_item['DreamjobListCvCategory']['startdate'] and $cvc_item['DreamjobListCvCategory']['enddate'] and $cvc_item['DreamjobListCvCategory']['place']){
?> ?>
<td><span class="label"><?=__('dreamjob.between');?>:</span><?=$this->Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?><span class="label"><?=__('dreamjob.between.till');?>:</span><?=$this->Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100,'maxYear' => date('Y')));?></td> <td><span class="label"><?=__('dreamjob.between');?>:</span><?=$this->Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?><span class="label"><?=__('dreamjob.between.till');?>:</span><?=$this->Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100,'maxYear' => date('Y'),'required'=>false));?></td>
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?><span><?=$this->Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?></span></td> <td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?><span><?=$this->Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str'],'required'=>false));?></span></td>
<?php <?php
}else if($cvc_item['DreamjobListCvCategory']['place']){ }else if($cvc_item['DreamjobListCvCategory']['place']){
if($cvc_item['DreamjobListCvCategory']['startdate']){ if($cvc_item['DreamjobListCvCategory']['startdate']){
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?></td> <td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?></td>
<?php <?php
}else if($cvc_item['DreamjobListCvCategory']['enddate']){ }else if($cvc_item['DreamjobListCvCategory']['enddate']){
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?></td> <td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?></td>
<?php <?php
}else{ }else{
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?></td> <td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?></td>
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?></td> <td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str'],'required'=>false));?></td>
<?php <?php
} }
?> ?>
<?php <?php
if($cvc_item['DreamjobListCvCategory']['startdate'] or $cvc_item['DreamjobListCvCategory']['enddate']){ if($cvc_item['DreamjobListCvCategory']['startdate'] or $cvc_item['DreamjobListCvCategory']['enddate']){
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?><span><?=$this->Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?></span></td> <td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?><span><?=$this->Form->input('DreamjobCvEntry.'.$i.'.place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str'],'required'=>false));?></span></td>
<?php <?php
} }
}else{ }else{
if($cvc_item['DreamjobListCvCategory']['startdate'] and $cvc_item['DreamjobListCvCategory']['enddate']){ if($cvc_item['DreamjobListCvCategory']['startdate'] and $cvc_item['DreamjobListCvCategory']['enddate']){
?> ?>
<td><?=__('dreamjob.between');?>: <?=$this->Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?> <br/> <?=__('dreamjob.between.till');?>: <?=$this->Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?></td> <td><?=__('dreamjob.between');?>: <?=$this->Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?> <br/> <?=__('dreamjob.between.till');?>: <?=$this->Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?></td>
<?php <?php
}else if($cvc_item['DreamjobListCvCategory']['startdate']){ }else if($cvc_item['DreamjobListCvCategory']['startdate']){
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?></td> <td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?></td>
<?php <?php
}else if($cvc_item['DreamjobListCvCategory']['enddate']){ }else if($cvc_item['DreamjobListCvCategory']['enddate']){
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?></td> <td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?></td>
<?php <?php
}else{ }else{
?> ?>
@ -107,7 +107,7 @@ echo $this->Html->link($text,array('controller'=>'user','action'=>'profil'),arra
<?php <?php
} }
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?></td> <td><?=$this->Form->input('DreamjobCvEntry.'.$i.'.title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?></td>
<?php <?php
} }
?> ?>
@ -123,43 +123,43 @@ echo $this->Html->link($text,array('controller'=>'user','action'=>'profil'),arra
<?php <?php
if($cvc_item['DreamjobListCvCategory']['startdate'] and $cvc_item['DreamjobListCvCategory']['enddate'] and $cvc_item['DreamjobListCvCategory']['place']){ if($cvc_item['DreamjobListCvCategory']['startdate'] and $cvc_item['DreamjobListCvCategory']['enddate'] and $cvc_item['DreamjobListCvCategory']['place']){
?> ?>
<td><span class="label"><?=__('dreamjob.between');?>:</span><?=$this->Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?><span class="label"><?=__('dreamjob.between.till');?>:</span><?=$this->Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?></td> <td><span class="label"><?=__('dreamjob.between');?>:</span><?=$this->Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?><span class="label"><?=__('dreamjob.between.till');?>:</span><?=$this->Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?></td>
<td><?=$this->Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?><span><?=$this->Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?></span></td> <td><?=$this->Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?><span><?=$this->Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str'],'required'=>false));?></span></td>
<?php <?php
}else if($cvc_item['DreamjobListCvCategory']['place']){ }else if($cvc_item['DreamjobListCvCategory']['place']){
if($cvc_item['DreamjobListCvCategory']['startdate']){ if($cvc_item['DreamjobListCvCategory']['startdate']){
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?></td> <td><?=$this->Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?></td>
<?php <?php
}else if($cvc_item['DreamjobListCvCategory']['enddate']){ }else if($cvc_item['DreamjobListCvCategory']['enddate']){
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?></td> <td><?=$this->Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?></td>
<?php <?php
}else{ }else{
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?></td> <td><?=$this->Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?></td>
<td><?=$this->Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?></td> <td><?=$this->Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str'],'required'=>false));?></td>
<?php <?php
} }
?> ?>
<?php <?php
if($cvc_item['DreamjobListCvCategory']['startdate'] or $cvc_item['DreamjobListCvCategory']['enddate']){ if($cvc_item['DreamjobListCvCategory']['startdate'] or $cvc_item['DreamjobListCvCategory']['enddate']){
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?><span><?=$this->Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str']));?></span></td> <td><?=$this->Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?><span><?=$this->Form->input('DreamjobCvEntry..place',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['place_str'],'required'=>false));?></span></td>
<?php <?php
} }
}else{ }else{
if($cvc_item['DreamjobListCvCategory']['startdate'] and $cvc_item['DreamjobListCvCategory']['enddate']){ if($cvc_item['DreamjobListCvCategory']['startdate'] and $cvc_item['DreamjobListCvCategory']['enddate']){
?> ?>
<td><span class="label"><?=__('dreamjob.between');?>:</span><?=$this->Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?><span class="label"> <?=__('dreamjob.between.till');?>:</span><?=$this->Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?></td> <td><span class="label"><?=__('dreamjob.between');?>:</span><?=$this->Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?><span class="label"> <?=__('dreamjob.between.till');?>:</span><?=$this->Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?></td>
<?php <?php
}else if($cvc_item['DreamjobListCvCategory']['startdate']){ }else if($cvc_item['DreamjobListCvCategory']['startdate']){
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?></td> <td><?=$this->Form->input('DreamjobCvEntry..startdate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?></td>
<?php <?php
}else if($cvc_item['DreamjobListCvCategory']['enddate']){ }else if($cvc_item['DreamjobListCvCategory']['enddate']){
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y')));?></td> <td><?=$this->Form->input('DreamjobCvEntry..enddate',array('empty'=>__('dreamjob.chooseOne.date'),'dateFormat' => 'DMY','minYear' => date('Y') - 100, 'maxYear' => date('Y'),'required'=>false));?></td>
<?php <?php
}else{ }else{
?> ?>
@ -167,16 +167,21 @@ echo $this->Html->link($text,array('controller'=>'user','action'=>'profil'),arra
<?php <?php
} }
?> ?>
<td><?=$this->Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str']));?></td> <td><?=$this->Form->input('DreamjobCvEntry..title',array('placeholder'=>$cvc_item['DreamjobListCvCategory']['title_str'],'required'=>false));?></td>
<?php <?php
} }
?> ?>
<td><a class="btn btn-default btn-del rmEvnt" ref="eventOff"><span class="glyphicon glyphicon-trash"></span></a></td> <td><a class="btn btn-default btn-del rmEvnt" ref="eventOff"><span class="glyphicon glyphicon-trash"></span></a></td>
<?=$this->Form->input('DreamjobCvEntry..category_id',array('type'=>'hidden','value'=>$cvc_item['DreamjobListCvCategory']['id']));?> <?=$this->Form->input('DreamjobCvEntry..category_id',array('type'=>'hidden','value'=>$cvc_item['DreamjobListCvCategory']['id'],'required'=>false));?>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<?php <?php
} }
?>
<div class="buttonrow">
<?=$this->Form->button('<span class="glyphicon glyphicon-floppy-disk"></span> '.__('dreamjob.settings.save'),array('div' => false,'class'=>"btn btn-primary ",'type' => 'submit'));?>
</div>
<?php
echo $this->Form->end(); echo $this->Form->end();
?> ?>

View File

@ -11,7 +11,7 @@
echo $this->Form->input('AppUser.avatar',array('type'=>'file','label'=>array('text'=>__("dreamjob.avatar"),"class"=>$default_Form['inputDefaults']['label']['class']))); echo $this->Form->input('AppUser.avatar',array('type'=>'file','label'=>array('text'=>__("dreamjob.avatar"),"class"=>$default_Form['inputDefaults']['label']['class'])));
?> ?>
<div class="buttonrow"> <div class="buttonrow">
<?=$this->Form->button('<span class="glyphicon glyphicon-floppy-disk"></span> '.__('dreamjob.settings.save'),array('div' => false,'class'=>"btn btn-primary ",'type' => 'submit'));?> <?=$this->Form->button('<span class="glyphicon glyphicon-floppy-disk"></span> '.__('dreamjob.save'),array('div' => false,'class'=>"btn btn-primary ",'type' => 'submit'));?>
</div> </div>
<?php <?php
echo $this->Form->end(); echo $this->Form->end();

View File

@ -39,21 +39,27 @@ if($profil['AppUser']['take_systemwide']){
<tr data="set"> <tr data="set">
<td> <td>
<?=$this->Form->hidden("DreamjobISearch.$i.id");?> <?=$this->Form->hidden("DreamjobISearch.$i.id");?>
<?=$this->Form->input("DreamjobISearch.$i.branch_id",array('empty' => __('dreamjob.form.chooseOne')));?> <?=$this->Form->input("DreamjobISearch.$i.branch_id",array('empty' => __('dreamjob.form.chooseOne'),'required'=>false));?>
</td> </td>
<td><?=$this->Form->input("DreamjobISearch.$i.job_id",array('empty' =>__('dreamjob.form.chooseOne')));?></td> <td><?=$this->Form->input("DreamjobISearch.$i.job_id",array('empty' =>__('dreamjob.form.chooseOne'),'required'=>false));?></td>
<td><?=$this->Form->input("DreamjobISearch.$i.kindofjob_id",array('empty' => __('dreamjob.form.chooseOne')));?></td> <td><?=$this->Form->input("DreamjobISearch.$i.kindofjob_id",array('empty' => __('dreamjob.form.chooseOne'),'required'=>false));?></td>
<td><a class="btn btn-default btn-del rmEvnt" ref="eventOff"><span class="glyphicon glyphicon-trash"></span></a></td> <td><a class="btn btn-default btn-del rmEvnt" ref="eventOff"><span class="glyphicon glyphicon-trash"></span></a></td>
</tr> </tr>
<?php <?php
} }
?> ?>
<tr class="new"> <tr class="new">
<td><?=$this->Form->input('DreamjobISearch..branch_id',array('empty' => __('dreamjob.form.chooseOne')));?></td> <td><?=$this->Form->input('DreamjobISearch..branch_id',array('empty' => __('dreamjob.form.chooseOne'),'required'=>false));?></td>
<td><?=$this->Form->input('DreamjobISearch..job_id',array('empty' =>__('dreamjob.form.chooseOne')));?></td> <td><?=$this->Form->input('DreamjobISearch..job_id',array('empty' =>__('dreamjob.form.chooseOne'),'required'=>false));?></td>
<td><?=$this->Form->input('DreamjobISearch..kindofjob_id',array('empty' => __('dreamjob.form.chooseOne')));?></td> <td><?=$this->Form->input('DreamjobISearch..kindofjob_id',array('empty' => __('dreamjob.form.chooseOne'),'required'=>false));?></td>
<td><a class="btn btn-default btn-del" ref="eventOff"><span class="glyphicon glyphicon-trash"></span></a></td> <td><a class="btn btn-default btn-del" ref="eventOff"><span class="glyphicon glyphicon-trash"></span></a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="buttonrow">
<?=$this->Form->button('<span class="glyphicon glyphicon-floppy-disk"></span> '.__('dreamjob.save'),array('div' => false,'class'=>"btn btn-primary ",'type' => 'submit'));?>
</div>
<?php
echo $this->Form->end();
?>
</div> </div>

View File

@ -110,7 +110,7 @@ if($profil['AppUser']['take_systemwide']){
echo $this->Html->link('<span class="glyphicon glyphicon-trash"></span> '.__('dreamjob.page.del'),array('controller'=>'user','action'=>'settings_pageInh','?'=>array('del'=> $pag['id'])),array('escape'=>false,'class'=>'btn btn-default')); echo $this->Html->link('<span class="glyphicon glyphicon-trash"></span> '.__('dreamjob.page.del'),array('controller'=>'user','action'=>'settings_pageInh','?'=>array('del'=> $pag['id'])),array('escape'=>false,'class'=>'btn btn-default'));
} }
?> ?>
<?=$this->Form->button('<span class="glyphicon glyphicon-floppy-disk"></span> '.__('dreamjob.settings.save'),array('div' => false,'class'=>"btn btn-primary ",'type' => 'submit'));?> <?=$this->Form->button('<span class="glyphicon glyphicon-floppy-disk"></span> '.__('dreamjob.save'),array('div' => false,'class'=>"btn btn-primary ",'type' => 'submit'));?>
</div> </div>
<?php <?php
echo $this->Form->end(); echo $this->Form->end();

View File

@ -15,8 +15,6 @@ var global_load = null;
} }
}); });
$(window).bind('popstate', function(evt) { $(window).bind('popstate', function(evt) {
console.log(evt.target.pageurl);
console.log(evt);
if (evt.originalEvent.state !== null) { if (evt.originalEvent.state !== null) {
load(location.href, {'history': false}, false); load(location.href, {'history': false}, false);
} }
@ -57,7 +55,7 @@ var global_load = null;
$(where + " a").tooltip(); $(where + " a").tooltip();
; ;
$(where + " a").not('[href*="mailto:"]').each(function(that) { $(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) { $(this).click(function(e) {
stopLoad(e); stopLoad(e);
load($(this).attr('href'), {}, ($(this).attr('rel') == "tab")); load($(this).attr('href'), {}, ($(this).attr('rel') == "tab"));
@ -66,8 +64,19 @@ var global_load = null;
}); });
$(where + " form").submit(function(e) { $(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); 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(); $(":input[ name *= '_wysihtml5_mod' ]", this).remove();
//stopLoad(e); //stopLoad(e);
if ($(this).attr("back")) if ($(this).attr("back"))
@ -80,12 +89,12 @@ var global_load = null;
}); });
$(where + " form[ enctype *= 'multipart/form-data' ]").each(function(evt) { $(where + " form[ enctype *= 'multipart/form-data' ]").each(function(evt) {
stopLoad(evt);
if (!$('#fileUpload').length) if (!$('#fileUpload').length)
$('body').append('<iframe id="fileUpload" name="fileUpload" style="display:none" />'); $('body').append('<iframe id="fileUpload" name="fileUpload" style="display:none" />');
$(this).attr('target', 'fileUpload'); $(this).attr('target', 'fileUpload');
$(":input[ name *= '_wysihtml5_mod' ]", this).remove(); $(":input[ name *= '_wysihtml5_mod' ]", this).remove();
$(this).submit(function() { $(this).submit(function() {
stopLoad(evt);
frame = $('#fileUpload').load(function() { frame = $('#fileUpload').load(function() {
setContent(frame.contents().find('body').html()); setContent(frame.contents().find('body').html());
frame.unbind('load'); frame.unbind('load');
@ -101,7 +110,6 @@ var global_load = null;
var newRow = $(".new", this).html(); var newRow = $(".new", this).html();
$(that).on('change',function(e) { $(that).on('change',function(e) {
stopLoad(e); stopLoad(e);
tosave = true;
$("tr", that).each(function(evt) { $("tr", that).each(function(evt) {
see = true; see = true;
$(":input:not([ type = 'hidden' ] ):not(.select2-focusser):not(.select2-input)", this).each(function() { $(":input:not([ type = 'hidden' ] ):not(.select2-focusser):not(.select2-input)", this).each(function() {
@ -119,57 +127,19 @@ var global_load = null;
$(that).append("<tr class=\"new\">" + newRow + "</tr>"); $(that).append("<tr class=\"new\">" + newRow + "</tr>");
evet(); evet();
} }
save = true;
that2 = this;
$(":input:not([ type = 'hidden' ] ):not(.select2-focusser):not(.select2-input)", this).each(function() {
if (save && !$(that2).hasClass("new")) {
save = $(this).val() != '';
}
});
if (tosave && !$(that2).hasClass("new")) {
tosave = save;
}
}); });
if (tosave)
//console.log("sendTosave");
saveForm(that);
}); });
//ZUOFT WIRD GESPEICHERT
function evet() { function evet() {
$("tr:not(.new)", that).each(function() { $("tr:not(.new)", that).each(function() {
var that2 = this; var that2 = this;
$(".btn-del", this).unbind("click").click(function(evt) { $(".btn-del", this).unbind("click").click(function(evt) {
$(that2).remove(); $(that2).remove();
saveForm(that);
}); });
}); });
} }
evet(); evet();
}); });
function saveForm(here, back) {
i = 0;
$(":input[ name *= '_wysihtml5_mod' ]", $(here).parents('form')).remove();
//$(":input[ class *= 'select2-focusser' ]",$(here).parents('form')).remove();
$("tbody tr.new", $(here).parents('form')).remove();
$("tbody tr", $(here).parents('form')).each(function() {
$(":input[name]", this).each(function() {
str = $(this).attr("name").replace(/data\[(.*?)\]\[.*?\]\[(.+)\]/g, 'data[$1][' + i + '][$2]');
$(this).attr("name", str);
});
i++;
});
load($(here).parents("form").attr("action"), {back: back, data: $(here).parents("form").serialize(), type: 'POST'}, false);
}
$($(where + " form.tableForm .label.edit").parents('form.tableForm a')).click(function() {
saveForm('form.tableForm tbody', $(this).attr('href'));
return false;
});
//$(where+" form label.has-error").parent(".form-group").addClass("has-error")
} }
function setContent(data, back, tab, backignore) { function setContent(data, back, tab, backignore) {
title = data.split('<title>')[1].split('</title>')[0]; title = data.split('<title>')[1].split('</title>')[0];