update error display function
This commit is contained in:
parent
26a0e8775e
commit
5ed06ccc78
|
@ -3492,12 +3492,12 @@ group by m.uuid,m.title,m.description) md ON md.uuid=v.uuid
|
|||
}catch(Exception $e) {
|
||||
$sql="delete from mdstatus where uuid in (select uuid from geonetworkmetadata where id=?)";
|
||||
$this->db->query($sql,array($id));
|
||||
$msg = "提交失败,请确认权限后重试";
|
||||
if($this->debug>0)
|
||||
{$msg .= $e->getMessage();}
|
||||
$data = array("error"=>$msg);
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
$msg = "提交失败,请确认权限后重试";
|
||||
if($this->debug>0)
|
||||
{$msg .= $e->getMessage();}
|
||||
$data = array("error"=>$msg, "detail"=>$e->getMessage());
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,16 @@
|
|||
<script>
|
||||
$('#wapper').width($('body').width()-300);
|
||||
|
||||
function errorContentHtml(err){
|
||||
var html = "";
|
||||
if(err && err.error)
|
||||
html += "<h4>" + err.error + "</h4>";
|
||||
if(err && err.detail)
|
||||
html += "<p>" + err.detail + "</p>";
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function action(ac,id){
|
||||
$.ajax({
|
||||
'type':"POST",
|
||||
|
@ -68,7 +78,7 @@ function action(ac,id){
|
|||
if (typeof(data)=='object')
|
||||
{
|
||||
if(typeof(data.error)!='undefined')
|
||||
{$.colorbox({'innerWidth':'50%','html':data.error});}
|
||||
{$.colorbox({'innerWidth':'50%','html': errorContentHtml(data)});}
|
||||
if(typeof(data.deleted)!='undefined')
|
||||
{$('#list_'+data.deleted).fadeOut("slow",function(){$(this).remove();});}
|
||||
if(typeof(data.commited)!='undefined')
|
||||
|
|
Loading…
Reference in New Issue