// fix bug display message error or success in AdminAccessController
This commit is contained in:
+2
-2
@@ -1022,7 +1022,7 @@ if (Tools::isSubmit('submitAddAccess'))
|
||||
AND `id_profile` = '.(int)$id_profile
|
||||
);
|
||||
$res = $res?'ok':'error';
|
||||
die(Tools::jsonEncode($res));
|
||||
die($res);
|
||||
}
|
||||
|
||||
/* Update Access Modules */
|
||||
@@ -1056,6 +1056,6 @@ if (Tools::isSubmit('changeModuleAccess'))
|
||||
}
|
||||
|
||||
$res = $res?'ok':'error';
|
||||
die(Tools::jsonEncode($res));
|
||||
die($res);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,11 +65,10 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
res = $.parseJSON(res);
|
||||
if (res.result == 'ok')
|
||||
showSuccessMessage(res.msg);
|
||||
if (res == 'ok')
|
||||
showSuccessMessage("{l s='Update successful'}");
|
||||
else
|
||||
showErrorMessage(res.msg);
|
||||
showErrorMessage("{l s='Update error'}");
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
@@ -111,11 +110,10 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
res = $.parseJSON(res);
|
||||
if (res.result == "ok")
|
||||
showSuccessMessage(res.msg);
|
||||
if (res == 'ok')
|
||||
showSuccessMessage("{l s='Update successful'}");
|
||||
else
|
||||
showErrorMessage(res.msg);
|
||||
showErrorMessage("{l s='Update error'}");
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
|
||||
@@ -471,6 +471,28 @@ select optgroup option {
|
||||
border-radius:3px;
|
||||
}
|
||||
|
||||
#ajax_confirmation .error {
|
||||
background: #FFBABA url(../img/admin/icon-cancel.png) no-repeat scroll 6px 6px;
|
||||
border: 1px solid #CC0000;
|
||||
color:#D8000C;
|
||||
padding:20px;
|
||||
position:fixed;
|
||||
bottom:0;
|
||||
width:100%;
|
||||
left:0;
|
||||
}
|
||||
|
||||
#ajax_confirmation .conf {
|
||||
background: #DFF2BF url(../img/admin/icon-valid.png) no-repeat scroll 6px 6px;
|
||||
border: 1px solid #4F8A10;
|
||||
color:#4F8A10;
|
||||
padding:20px;
|
||||
position:fixed;
|
||||
bottom:0;
|
||||
width:100%;
|
||||
left:0;
|
||||
}
|
||||
|
||||
#content .warn {
|
||||
background: #FEEFB3 url(../img/admin/icon-attention.png) no-repeat scroll 6px 6px;
|
||||
border: 1px solid #9e6014;
|
||||
|
||||
+3
-2
@@ -948,7 +948,8 @@ function refreshImagePositions(imageTable)
|
||||
*/
|
||||
function showSuccessMessage(msg)
|
||||
{
|
||||
$("#ajax_confirmation").show().html("<div style=\"background-color:green;color:white;padding:20px;position:fixed;bottom:0;width:100%;left:0;text-align:center;\">"+msg+"</div>").delay(3000).fadeOut("slow");
|
||||
$("#ajax_confirmation").show()
|
||||
.html("<div class=\"conf\">"+msg+"</div>").delay(3000).fadeOut("slow");
|
||||
}
|
||||
|
||||
/** display a warning message in a #ajax_confirmation container
|
||||
@@ -957,7 +958,7 @@ function showSuccessMessage(msg)
|
||||
function showErrorMessage(msg)
|
||||
{
|
||||
$("#ajax_confirmation").show()
|
||||
.html("<div class=\"error\"><img src=\"../img/admin/error.png\" alt=\"ERROR\" />"+msg+"</div>");
|
||||
.html("<div class=\"error\">"+msg+"</div>").delay(3000).fadeOut("slow");
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
Reference in New Issue
Block a user