weiterleitung
This commit is contained in:
parent
41bfcca04b
commit
25dbbfc155
|
@ -54,7 +54,7 @@ class JobController extends AppController {
|
|||
$this->DreamjobJobOpening->data['DreamjobJobOpening']['company_id'] = $c['AppUser']['id'];
|
||||
if ($this->DreamjobJobOpening->save()) {
|
||||
$this->MiconwareSession->setFlash(__('dreamjob.opening.save.add'), 'flash', array('alert' => 'success'));
|
||||
return $this->redirect(array('action' => 'applicationByOpening','id'=>$this->DreamjobJobOpening->id));
|
||||
return $this->redirect(array('action' => 'openingGet','id'=>$this->DreamjobJobOpening->id));
|
||||
} else {
|
||||
$this->MiconwareSession->setFlash(__('dreamjob.opening.save.error'), 'flash', array('alert' => 'danger'));
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ class JobController extends AppController {
|
|||
$this->DreamjobJobOpening->data['DreamjobJobOpening']['company_id'] = $cid;
|
||||
if ($this->DreamjobJobOpening->save($this->DreamjobJobOpening->data)) {
|
||||
$this->MiconwareSession->setFlash(__('dreamjob.opening.save'), 'flash', array('alert' => 'success'));
|
||||
return $this->redirect(array('action' => 'applicationByOpening','id'=>$this->request->params['id']));
|
||||
return $this->redirect(array('action' => 'openingGet','id'=>$this->request->params['id']));
|
||||
} else
|
||||
$this->MiconwareSession->setFlash(__('dreamjob.opening.save.error'), 'flash', array('alert' => 'danger'));
|
||||
}
|
||||
|
|
|
@ -159,7 +159,14 @@ body.loading #container{
|
|||
color:white;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
#alert.old .alert{
|
||||
background-color: #E9E9E9;
|
||||
border-color: #BABABA;
|
||||
color: #9B9B9B;
|
||||
}
|
||||
/*
|
||||
* Main
|
||||
*/
|
||||
|
|
|
@ -144,14 +144,17 @@
|
|||
});
|
||||
//$(where+" form label.has-error").parent(".form-group").addClass("has-error")
|
||||
}
|
||||
function setContent(data,back,tab){
|
||||
function setContent(data,back,tab,backignore){
|
||||
alert = data.split('<!-- alert -->')[1].split('<!-- /alert -->')[0];
|
||||
$('#alert').removeClass('old');
|
||||
if( alert.trim().length > 0){
|
||||
$('#alert').html(alert);
|
||||
}else if(!backignore){
|
||||
$('#alert').addClass('old');
|
||||
}
|
||||
|
||||
if(back){
|
||||
load(back,{},tab);
|
||||
load(back,{'backignore':true},tab);
|
||||
}else if(tab){
|
||||
navbar = data.split('<!-- tab -->')[1].split('<!-- /tab -->')[0];
|
||||
$('#tab').html(navbar);
|
||||
|
@ -182,6 +185,7 @@
|
|||
alert = "<div class=\"alert alert-danger\">"+data.statusText+
|
||||
"<button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>"
|
||||
+ "</div>";
|
||||
$('#alert').removeClass('old');
|
||||
$('#alert').html(alert);
|
||||
event("#alert");
|
||||
$('#container').html(data.responseText);
|
||||
|
@ -191,6 +195,7 @@
|
|||
data = {};
|
||||
typemethode = "GET";
|
||||
back = false;
|
||||
backignore = false;
|
||||
history = true;
|
||||
if(conf['data'])
|
||||
data = conf['data'];
|
||||
|
@ -198,14 +203,17 @@
|
|||
typemethode = conf['type'];
|
||||
if(conf['back'] && conf['back'].indexOf("logout")== -1 && conf['back'].indexOf("login")== -1 )
|
||||
back = conf['back'];
|
||||
if(conf['backignore'])
|
||||
backignore = conf['backignore'];
|
||||
if(conf['history'])
|
||||
history = conf['history'];
|
||||
|
||||
//e.preventDefault();
|
||||
/*
|
||||
if uncomment the above line, html5 nonsupported browers won't change the url but will display the ajax content;
|
||||
if commented, html5 nonsupported browers will reload the page to the specified link.
|
||||
*/
|
||||
$.ajax({url:pageurl,data:data,type:typemethode,success:function(data){setContent(data,back,tab);} ,error:function(data){setContentError(data,back,tab);}});
|
||||
$.ajax({url:pageurl,data:data,type:typemethode,success:function(data){setContent(data,back,tab,backignore);} ,error:function(data){setContentError(data,back,tab);}});
|
||||
if(history && pageurl!=window.location){
|
||||
window.history.pushState({path:pageurl},'',pageurl);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue