+ MPDF 6.1

This commit is contained in:
2020-08-11 18:04:59 +06:00
parent 11d3f0fc7a
commit c2e133debe
714 changed files with 120510 additions and 93145 deletions

View File

@ -46,17 +46,17 @@ class SRec
applyReq(req,fn,node,xmldoc)
{
//alert(getXMLNodeSerialisation(node));
//alert2(_('Alert'),getXMLNodeSerialisation(node));
this.hideProgressBar();
this.xmldoc=node.ownerDocument; //xmldoc;
if (fn==-1) //Information menu
{
alert(findFirstNode(node,'#cdata-section').nodeValue);
alert2(_('Alert'),findFirstNode(node,'#cdata-section').nodeValue);
}else
if (fn==0)
{
//alert(getXMLNodeSerialisation(node));
//alert2(_('Alert'),getXMLNodeSerialisation(node));
this.setMetadata(node);
this.updateSize();
}else
@ -84,7 +84,7 @@ class SRec
this.rwin.setContent('<table border="0px" style="width: 100%; height: 100%; background-color: #f1f1f1;"><tr><td align="center"><a href="'+findFirstNode(node,'#cdata-section').nodeValue+'">'+_('Download_report')+': "'+this.win.getCaption().innerHTML+'".</a></td></tr></table>');
}
}else
alert("Unknown function! fn=\""+fn+"\"" );
alert2(_('Alert'),"Unknown function! fn=\""+fn+"\"" );
}
//Edit the GUI filter from the xml string.
@ -234,7 +234,7 @@ class SRec
//Function to fill the drop-down lists (here it is necessary to ensure that everywhere there is a "var" in front of the variables).
setDataSelect(node)
{
//alert("setDataSelect = " + getXMLNodeSerialisation(node));
//alert2(_('Alert'),"setDataSelect = " + getXMLNodeSerialisation(node));
let nodeType,prop_id,prop,option,nodeProp,id,value,cdataNode;
nodeType=findFirstNode(node, 'type');
@ -247,7 +247,7 @@ class SRec
let nodeCur=findNodeOnAttribute(nodeFilter, 'column', 'n', prop_id);
if(nodeCur!=null) selector=nodeCur.getAttribute("selector");
//alert("nodeCur = " + getXMLNodeSerialisation(nodeCur));
//alert2(_('Alert'),"nodeCur = " + getXMLNodeSerialisation(nodeCur));
/*nodeCur=nodeFilter.firstChild
while(nodeCur!=null)
@ -324,7 +324,7 @@ class SRec
}
if(count==0)
{
alert(_("No_results_were_found_for_your_search"));
alert2(_('Alert'),_("No_results_were_found_for_your_search"));
}else
if(count==1) //fill without window
{
@ -401,7 +401,7 @@ class SRec
}
}else
{
alert('Filter "'+prop_id+'" not find!');
alert2(_('Alert'),'Filter "'+prop_id+'" not find!');
}
}
@ -435,7 +435,7 @@ class SRec
columnNode = columnNode.nextSibling;
}
}
//alert(getXMLNodeSerialisation(this.nodeMetadata));
//alert2(_('Alert'),getXMLNodeSerialisation(this.nodeMetadata));
}
/** Function to send filter data to the server
@ -476,7 +476,7 @@ class SRec
xs+='</filter></objects-list></type>\n';
xs+='</metadata>';
//alert(xs);
//alert2(_('Alert'),xs);
if(this.request.callServer(ScriptName,xs))
{
@ -494,7 +494,7 @@ class SRec
let td,tr,td1,td2;
let nodeFilter=null;
let tablefilter=document.getElementById('idfilter'+this.uid);
if (tablefilter.tBodies==null) alert('tablefilter=null');
if (tablefilter.tBodies==null) alert2(_('Alert'),'tablefilter=null');
let nodeType=findFirstNode(node, "type");
this.f_pI=nodeType.getAttribute("ins");//access rights
this.f_pU=nodeType.getAttribute("upd");
@ -507,7 +507,15 @@ class SRec
if(this.f_pI!='1') deleteHTML('SRec_Add_'+this.uid);
if(this.f_pD!='1') deleteHTML('SRec_Del_'+this.uid);
this.nodeMetadataObjList=findNode(nodeType, "objects-list");
if(this.win!=null) this.win.setWidth(this.nodeMetadataObjList.getAttribute("width"));
if(this.win!=null) {
this.win.setWidth(this.nodeMetadataObjList.getAttribute("width"));
let height=this.nodeMetadataObjList.getAttribute("height");
if(height!=null){
if(height.indexOf('%')!=-1)
height=(window.innerHeight / 100) * parseInt(height.substring(0,height.length-1));
this.win.setHeight(height);
}
}
nodeFilter=findNodeOnPath(nodeType,"objects-list/filter");
@ -885,7 +893,7 @@ class SRec
}
td2.appendChild( table );
}else alert("Unknown type = "+columnNode.getAttribute("vt"));
}else alert2(_('Alert'),"Unknown type = "+columnNode.getAttribute("vt"));
tablefilter.tBodies[0].appendChild(tr);
}
columnNode = columnNode.nextSibling;
@ -1052,16 +1060,16 @@ class SRec
th.appendChild( document.createTextNode(columnNode.getAttribute("d")));
th.style.cssText='width: '+columnNode.getAttribute("width")+'px;';
if(this.nodeMetadataObjList.getAttribute('order')==columnNode.getAttribute('n')) { th.style.backgroundColor='#afafaf'; }
if(columnNode.getAttribute("order")!=null && columnNode.getAttribute("order")!='')
{
th.style.textDecoration='underline';
th.style.backgroundColor='var(--btn-color)';
th.style.cursor='pointer';
th.onclick=function(thiz,cName){ return function(){ findNodeOnPath(thiz.nodeMetadata,"type/objects-list").setAttribute('order',cName); thiz.appendFilter(); thiz.sendFilter(-1,0);}; }(this,columnNode.getAttribute("n"));
th.onmouseover=function(){ this.style.backgroundColor="var(--btn-color2)"; };
th.onmouseout=function(thiz,cName){ return function(){ if(findNodeOnPath(thiz.nodeMetadata,"type/objects-list").getAttribute('order') == cName) this.style.backgroundColor='#afafaf'; else this.style.backgroundColor='#dadada'; }; }(this,columnNode.getAttribute("n"));
th.onmouseout=function(thiz,cName){ return function(){ if(findNodeOnPath(thiz.nodeMetadata,"type/objects-list").getAttribute('order') == cName) this.style.backgroundColor='var(--btn-color2)'; else this.style.backgroundColor='var(--btn-color)'; }; }(this,columnNode.getAttribute("n"));
}
if(this.nodeMetadataObjList.getAttribute('order')==columnNode.getAttribute('n')) { th.style.backgroundColor='var(--btn-color2)'; }
tr.appendChild(th);
}
pos++;
@ -1107,12 +1115,12 @@ class SRec
let newRow=tablepages.insertRow(-1);
for(let i=0;i<pagecount;i++)
{
let bgColor='#DDDDDD';
if (i%2==0) bgColor='#EEEEEE';
let bgColor='var(--btn-color)';
if (i%2==0) bgColor='var(--btn-color3)';
if (this.pagepos==i) bgColor='DodgerBlue';
let newCell = newRow.insertCell(-1);
newCell.setAttribute("bgColor",bgColor);
newCell.style.cssText="cursor: pointer;";
newCell.style.backgroundColor = bgColor;
newCell.style.cursor="pointer";
newCell.appendChild(document.createTextNode(i+1));
//Upon clicking, a filter with old values is used only with a different page number.
newCell.onclick=function(obj,page){
@ -1122,11 +1130,11 @@ class SRec
};
}(this,i);
newCell.onmouseover=function(){
this.setAttribute("bgColor","#AAAAFF");
this.style.backgroundColor = "#AAAAFF";
};
newCell.onmouseout=function(val1,val2){
return function(){
val1.setAttribute("bgColor",val2);
val1.style.backgroundColor = val2;
};
}(newCell,bgColor);
if((i+1)%40==0) newRow=tablepages.insertRow(-1);
@ -1427,7 +1435,7 @@ class SRec
dataalert()
{
let error_msg="";
if (error_msg!="") alert("ShowRecords: \n"+error_msg);
if (error_msg!="") alert2(_('Alert'),"ShowRecords: \n"+error_msg);
}
showreport(ext)
@ -1500,7 +1508,7 @@ class SRec
if(this.f_State=="1") //select one record
{
//Send the id of the selected record to the parent of the selected record and close the window
//alert("id="+id+" f_PropName="+this.f_PropName+" f_TypeName="+this.f_TypeName);
//alert2(_('Alert'),"id="+id+" f_PropName="+this.f_PropName+" f_TypeName="+this.f_TypeName);
this.opener.setFilterObject(this.f_TypeName,this.f_PropName,id);
this.win.Close();
}else
@ -1594,7 +1602,7 @@ function nodeToTable(node)
if(cdataNode.nodeName=="#cdata-section")
{
result[pos][cols[i]]=cdataNode.nodeValue;
//alert(pos+') '+cols[i]+' = '+cdataNode.nodeValue);
//alert2(_('Alert'),pos+') '+cols[i]+' = '+cdataNode.nodeValue);
i++;
}
cdataNode = cdataNode.nextSibling;