From 830e89fbfc516f5969e01ce279766edc672aeed7 Mon Sep 17 00:00:00 2001 From: igor Date: Wed, 6 Oct 2021 16:31:01 +0600 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6?= =?UTF-8?q?=D0=B0=D1=8E=20=D0=BD=D0=BE=D0=BC=D0=B5=D1=80=20=D1=81=D1=82?= =?UTF-8?q?=D0=BE=D0=BB=D0=B1=D1=86=D0=B0=20=D0=BF=D1=80=D0=B8=20=D1=81?= =?UTF-8?q?=D0=BA=D0=B0=D1=87=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D0=B8=20Excel?= =?UTF-8?q?=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metadata/dbms/editrecord.js | 68 ++++++++++++++++++------------------- metadata/dbms/login.js | 4 +-- metadata/dbms/records.php | 3 ++ metadata/dbms/showrecord.js | 2 +- metadata/dbms/tools.js | 61 ++++++++++++++++++--------------- 5 files changed, 73 insertions(+), 65 deletions(-) diff --git a/metadata/dbms/editrecord.js b/metadata/dbms/editrecord.js index f2c6126..6052f92 100644 --- a/metadata/dbms/editrecord.js +++ b/metadata/dbms/editrecord.js @@ -127,7 +127,7 @@ class EdtRec this.record_id=record_id; this.nodeMetadata=Node.cloneNode(true); //Для чего клонирую? - var nodeType=findFirstNode(this.nodeMetadata, 'type'); + let nodeType=findFirstNode(this.nodeMetadata, 'type'); //Appending settings to nodeMetadata this.setXMLSettings(this.f_Settings); @@ -163,7 +163,7 @@ class EdtRec //For convenience, when adding a new record, we rewrite the values from the parent filter in the edit field. if(nodeFilters!=null) { - var nodeFilter=nodeFilters.firstChild; + let nodeFilter=nodeFilters.firstChild; while (nodeFilter!=null) { if(nodeFilter.nodeName=="column") @@ -196,8 +196,8 @@ class EdtRec } nodeProp=nodeProperties.firstChild; - var newRowM=null; - var rpos=0; + let newRowM=null; + let rpos=0; while (nodeProp!=null) { if (nodeProp.nodeName=="type") //Grouping fields. @@ -208,7 +208,7 @@ class EdtRec td.style.cssText="font-weight: bold;"; td.colSpan = "2"; - var div=document.createElement('div'); + let div=document.createElement('div'); div.style.cssText='border: solid 1px black; background-color: rgba(0,0,0,0.5); width:100%; height: 300px;'; div.innerHTML=''; @@ -216,12 +216,12 @@ class EdtRec tr.appendChild(td); eTable.tBodies[0].appendChild(tr); - var subSRec=new SRec(); + let subSRec=new SRec(); subSRec.create(div); //Перебираю данные из текущего запроса и пытаюсь подменить строку (до получения анных (при создании новой записи)) - var nPs=findFirstNode(this.nodeMetadata, 'properties') - var nP=nPs.firstChild + let nPs=findFirstNode(this.nodeMetadata, 'properties') + let nP=nPs.firstChild while (nP!=null) { if (nP.nodeName=="prop") @@ -241,9 +241,9 @@ class EdtRec }else if (nodeProp.nodeName=="divide") //Grouping fields. { - var tr = document.createElement('tr'); + let tr = document.createElement('tr'); tr.style.cssText="background-color: var(--back-color-title);"; - var td = document.createElement('td'); + let td = document.createElement('td'); td.style.cssText="font-weight: bold;"; td.colSpan = "2"; td.innerHTML=nodeProp.getAttribute("d"); @@ -253,13 +253,13 @@ class EdtRec }else if (nodeProp.nodeName=="prop") { - var bgColor=''; - var tr = null; - var td1 = null; - var td2 = null; + let bgColor=''; + let tr = null; + let td1 = null; + let td2 = null; let vt=nodeProp.getAttribute("vt"); - var row=nodeProp.getAttribute("row"); //Several fields in the 1st row. + let row=nodeProp.getAttribute("row"); //Several fields in the 1st row. if(row==null) { rpos++; @@ -267,12 +267,12 @@ class EdtRec if (rpos%2==0) bgColor=g_rowColor1; else bgColor=g_rowColor2; tr.setAttribute("bgColor",bgColor); if(nodeProp.getAttribute("visible")=='0') tr.style.display='none'; - var td1 = document.createElement('td'); - var td2 = document.createElement('td'); + td1 = document.createElement('td'); + td2 = document.createElement('td'); tr.appendChild(td1); tr.appendChild(td2); - var table=document.createElement('table'); + let table=document.createElement('table'); table.border=0; table.setAttribute("width","100%"); table.cellspacing=0; @@ -301,22 +301,22 @@ class EdtRec if(nodeProp.getAttribute("t")!=null) td1.title=nodeProp.getAttribute("t"); if (nodeProp.getAttribute("maybenull")=='0') td1.style.cssText="font-weight: bold;"; - var value=getCdata(nodeProp).nodeValue; + let value=getCdata(nodeProp).nodeValue; if(vt=="string" || vt=="str") { - var table=document.createElement('table'); + let table=document.createElement('table'); table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;"; table.border=0; let newRow=table.insertRow(0); //add a row to the created table - var newCell1 = newRow.insertCell(0); //in the created line we add a column + let newCell1 = newRow.insertCell(0); //in the created line we add a column newCell1.style.cssText="padding:0px; padding-right:1px; width: 100%;"; - var newCell2 = newRow.insertCell(1); //in the created line we add a column + let newCell2 = newRow.insertCell(1); //in the created line we add a column newCell2.style.cssText="padding:0px;"; //If there is a list node with CheckBox elements, then we create them - var nList=findNode(nodeProp, "options"); + let nList=findNode(nodeProp, "options"); if(nList!=null) { nodeProp.field = new TCheckboxListField(nodeProp.getAttribute("n")); @@ -344,7 +344,7 @@ class EdtRec //td2.appendChild( input ); //Button for translation - var tObj=findNode(nodeProp, "type"); + let tObj=findNode(nodeProp, "type"); if(tObj!=null) { let button = document.createElement('input'); @@ -380,10 +380,10 @@ class EdtRec select.classList.add('DBMS'); select.style.cssText="width: 100%;"; select.setAttribute("name",nodeProp.getAttribute("n")); - var opt=findFirstNode(nodeProp,"options"); + let opt=findFirstNode(nodeProp,"options"); if(opt==null) { - var option = document.createElement('option'); + let option = document.createElement('option'); option.setAttribute("value",""); option.appendChild(document.createTextNode("")); option.selected = true; @@ -418,7 +418,7 @@ class EdtRec { //If there is a node "list" with the elements "CheckBox" then create them. let opt=findNode(nodeProp, "options"); - if(opt!=null) //If combobox + if(opt!=null){ //If combobox let select = document.createElement('select'); select.classList.add('DBMS'); select.style.cssText="width: 100%;"; @@ -440,16 +440,16 @@ class EdtRec }else { - var table=document.createElement('table'); + let table=document.createElement('table'); table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;"; //table.setAttribute("bgColor","#0000FF"); table.border=0; let newRow=table.insertRow(0); //add a row to the created table - var newCell1 = newRow.insertCell(0); //in the created line we add a column + let newCell1 = newRow.insertCell(0); //in the created line we add a column newCell1.style.cssText="padding:0px; padding-right:1px; width: 100%;"; - var newCell2 = newRow.insertCell(1); //in the created line we add a column + let newCell2 = newRow.insertCell(1); //in the created line we add a column newCell2.style.cssText="padding:0px; padding-right:1px;height:100%;"; - var newCell3 = newRow.insertCell(2); //in the created line we add a column + let newCell3 = newRow.insertCell(2); //in the created line we add a column newCell3.style.cssText="padding:0px;height:100%;"; input = document.createElement('input'); @@ -788,10 +788,10 @@ class EdtRec } nodeProp=nodeProp.nextSibling; } - //Button apply - tr = document.createElement('tr'); - var td = document.createElement('td'); + let tr = document.createElement('tr'); + let td = document.createElement('td'); + td.style.cssText="padding: 5px; vertical-align: bottom;"; td.setAttribute("colspan", "2"); if (this.record_id==-1) td.innerHTML=''; diff --git a/metadata/dbms/login.js b/metadata/dbms/login.js index eee57b5..b02d9de 100644 --- a/metadata/dbms/login.js +++ b/metadata/dbms/login.js @@ -220,14 +220,14 @@ class DBMSUser } }; -//Display password recovery form + //Display password recovery form showRestoreForm() { var win=new TWin(true); win.BuildGUI(10,10); win.setCaption(trt("Password_recovery")); - str='
\n\ + let str='
\n\ \n\ \n\ \n\ diff --git a/metadata/dbms/records.php b/metadata/dbms/records.php index e0c9120..1f09c5a 100644 --- a/metadata/dbms/records.php +++ b/metadata/dbms/records.php @@ -1171,6 +1171,7 @@ fwrite($fh, ' '."\n"); fwrite($fh, ' '."\n"); fwrite($fh, ' '); + fwrite($fh, ''); $nextnode=findNode($currNode,'objects-list')->firstChild; $col=0; while ($nextnode) @@ -1182,9 +1183,11 @@ fwrite($fh, ' '."\n"); fwrite($fh, ' '."\n"); fwrite($fh, ' '."\n"); + $pos=0; while ($row = $res->fetch(PDO::FETCH_ASSOC)) { fwrite($fh, ' '); + fwrite($fh, ''); $nextnode=findNode($currNode,'objects-list')->firstChild; while ($nextnode) { if ($nextnode->nodeName=='column') diff --git a/metadata/dbms/showrecord.js b/metadata/dbms/showrecord.js index 2123d8b..09268c9 100644 --- a/metadata/dbms/showrecord.js +++ b/metadata/dbms/showrecord.js @@ -150,7 +150,7 @@ class SRec
\
'+trt('Login')+' (E-mail)
'.findNode($currNode,'objects-list')->getAttribute("d").'
'.(++$pos).'
\ \ - \ + \
\
\ \ diff --git a/metadata/dbms/tools.js b/metadata/dbms/tools.js index 2ff4814..a52b779 100644 --- a/metadata/dbms/tools.js +++ b/metadata/dbms/tools.js @@ -1103,9 +1103,14 @@ class myXMLHttpRequest //Класс окна class TWin { - constructor(dialog) + constructor(dialog,path) { this.dialog=dialog; //Показывать окно как диалог (без возможности изменения размеров) + if(typeof path !== 'undefined') + this.path=path; + else + this.path='../resources'; + this.disableClosing=false; this.closed=false; //Закрыли (те. удалили из родителя и детей и из DOM) @@ -1130,7 +1135,7 @@ class TWin this.pBarCnt=0; //Прогресс бар this.pBarDiv=null; //Прогресс бар - + this.fnResizeListener=null; } @@ -1215,14 +1220,14 @@ class TWin let hd=''; hd+='
add
'; hd+=' '; - hd+=' '; - hd+=' '; - hd+=' '; + hd+=' '; + hd+=' '; + hd+=' '; //hd+=' '; - hd+=' '; - hd+=' '; - hd+=' '; - hd+=' '; + hd+=' '; + hd+=' '; + hd+=' '; + hd+=' '; hd+=' '; hd+='
 XX
'; @@ -1230,30 +1235,30 @@ class TWin str+=''; str+=' '; str+=' '; - str+=' '; - str+=' '; - str+=' '; + str+=' '; + str+=' '; + str+=' '; str+=' '; str+=' '; - str+=' '; + str+=' '; str+=' '; - str+=' '; + str+=' '; str+=' '; str+=' '; - str+=' '; - str+=' '; - str+=' '; + str+=' '; + str+=' '; + str+=' '; str+=' '; str+='
'+hd+'
 
'; */ /* let str=''; str+=''; - str+=' '; + str+=' '; str+=' '; - str+=' '; + str+=' '; str+=' '; - str+=' '; + str+=' '; str+=' '; str+=' '; str+=' '; @@ -1261,9 +1266,9 @@ class TWin str+=' '; str+=' '; str+=' '; - str+=' '; + str+=' '; str+=' '; - str+=' '; + str+=' '; str+=' '; str+='
'; */ @@ -1277,11 +1282,11 @@ class TWin let str=''; str+=''; - str+=' '; + str+=' '; str+=' '; - str+=' '; + str+=' '; str+=' '; - str+=' '; + str+=' '; str+=' '; str+=' '; str+=' '; @@ -1289,9 +1294,9 @@ class TWin str+=' '; str+=' '; str+=' '; - str+=' '; + str+=' '; str+=' '; - str+=' '; + str+=' '; str+=' '; str+='
'+(this.disableClosing ? '' : '')+'
'+(this.disableClosing ? '' : '')+'
'; @@ -1542,7 +1547,7 @@ class TWin this.pBarDiv=document.createElement('div'); this.pBarDiv.style.cssText='position: absolute; left: 0px; top: 0px; z-index: 1; width:100%; height: 100%; margin-top:30px; padding-bottom:30px;'; - this.pBarDiv.innerHTML='
'; + this.pBarDiv.innerHTML='
'; //var eDiv=document.getElementById('eDiv'+this.uid); this.div.appendChild(this.pBarDiv);