# Conflicts:
#	metadata/dbms/editrecord.js
This commit is contained in:
2021-10-14 19:48:33 +06:00
5 changed files with 51 additions and 40 deletions

View File

@ -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")
@ -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");
@ -298,7 +298,7 @@ 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")
@ -772,6 +772,9 @@ class EdtRec
}
nodeProp=nodeProp.nextSibling;
}
//Button apply
let tr = document.createElement('tr');
let td = document.createElement('td');
//Button apply
tr = document.createElement('tr');

View File

@ -227,7 +227,7 @@ class DBMSUser
win.BuildGUI(10,10);
win.setCaption(trt("Password_recovery"));
str='<div style="width: 100%; height: 100%; padding: 4px; text-align: left;">\n\
let str='<div style="width: 100%; height: 100%; padding: 4px; text-align: left;">\n\
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%; padding: 0px;">\n\
<tr>\n\
<td style="padding: 2px; white-space: nowrap"><b>'+trt('Login')+' (E-mail)</b></td>\n\

View File

@ -1171,6 +1171,7 @@
fwrite($fh, ' <caption><b>'.findNode($currNode,'objects-list')->getAttribute("d").'</b></caption>'."\n");
fwrite($fh, ' <thead>'."\n");
fwrite($fh, ' <tr>');
fwrite($fh, '<td bgcolor="#d1d1d1">№</td>');
$nextnode=findNode($currNode,'objects-list')->firstChild;
$col=0;
while ($nextnode)
@ -1182,9 +1183,11 @@
fwrite($fh, ' </tr>'."\n");
fwrite($fh, ' </thead>'."\n");
fwrite($fh, ' <tbody>'."\n");
$pos=0;
while ($row = $res->fetch(PDO::FETCH_ASSOC))
{
fwrite($fh, ' <tr>');
fwrite($fh, '<td>'.(++$pos).'</td>');
$nextnode=findNode($currNode,'objects-list')->firstChild;
while ($nextnode)
{ if ($nextnode->nodeName=='column')

View File

@ -150,7 +150,7 @@ class SRec
<div id="eDiv'+this.uid+'" style="width: 100%; height: 100%; position: relative;">\
<table class="SFilter" style="width: 100%; height: 100%;"><tr><td>\
<table id="idfilter'+this.uid+'" cellspacing="2" cellpadding="0" style="border: 1px solid rgb(99, 99, 99); table-layout: auto;" width="100%" bgcolor="'+g_rowColor2+'">\
<caption></caption><thead></thead><tbody></tbody>\
<caption></caption><tbody></tbody>\
</table>\
</td></tr><tr><td>\
<table style="width:100%;"><tr><td><img src="../resources/metadata/dbms/images/rplus.png" alt="add" id="SRec_Add_'+this.uid+'" title="'+trt('Add_record')+'" style="cursor: pointer;"/></td>\

View File

@ -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)
@ -1215,14 +1220,14 @@ class TWin
let hd='';
hd+='<table style="width: 100%;">';
hd+=' <tr>';
hd+=' <td style="vertical-align:bottom;cursor:move;" id="TWin_H1_'+this.tWinId+'"><img src="../metadata/dbms/form/t1.gif" style="width: 20px; height: 20px; display: block;" alt="" border="0px" draggable="false"/></td>';
hd+=' <td align="center" width="100%" bgcolor="#3366CC" style="font-weight: bold; cursor:move; background: #92b5df url(../metadata/dbms/form/1.gif) repeat-x top;" id="TWin_H2_'+this.tWinId+'"><nobr id="TWin_Ca_'+this.tWinId+'"></nobr></td>';
hd+=' <td style="vertical-align:bottom;cursor:move;" id="TWin_H3_'+this.tWinId+'"><img src="../metadata/dbms/form/t2.gif" alt="" style="width: 20px; height: 20px; display: block;" border="0px" draggable="false"/></td>';
hd+=' <td style="vertical-align:bottom;cursor:move;" id="TWin_H1_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/t1.gif" style="width: 20px; height: 20px; display: block;" alt="" border="0px" draggable="false"/></td>';
hd+=' <td align="center" width="100%" bgcolor="#3366CC" style="font-weight: bold; cursor:move; background: #92b5df url('+this.path+'/metadata/dbms/form/1.gif) repeat-x top;" id="TWin_H2_'+this.tWinId+'"><nobr id="TWin_Ca_'+this.tWinId+'"></nobr></td>';
hd+=' <td style="vertical-align:bottom;cursor:move;" id="TWin_H3_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/t2.gif" alt="" style="width: 20px; height: 20px; display: block;" border="0px" draggable="false"/></td>';
//hd+=' <td width="100%">&nbsp;</td>';
hd+=' <td style="vertical-align:bottom;cursor:pointer;"><img src="../metadata/dbms/form/none.gif" alt="" style="width: 21px; height: 21px; display: block;" border="0px" draggable="false"/></td>';
hd+=' <td style="vertical-align:bottom;cursor:pointer;"><img src="../metadata/dbms/form/none.gif" alt="" style="width: 21px; height: 21px; display: block;" border="0px" draggable="false"/></td>';
hd+=' <td style="vertical-align:bottom;cursor:pointer;"><img src="../metadata/dbms/form/close.gif" alt="X" style="width: 21px; height: 21px; display: block;" border="0px" draggable="false" id="TWin_CL_'+this.tWinId+'"/></td>';
hd+=' <td style="vertical-align:bottom;"><img src="../metadata/dbms/form/none.gif" alt="" style="width: 21px; height: 21px; display: block;" border="0px" draggable="false"/></td>';
hd+=' <td style="vertical-align:bottom;cursor:pointer;"><img src="'+this.path+'/metadata/dbms/form/none.gif" alt="" style="width: 21px; height: 21px; display: block;" border="0px" draggable="false"/></td>';
hd+=' <td style="vertical-align:bottom;cursor:pointer;"><img src="'+this.path+'/metadata/dbms/form/none.gif" alt="" style="width: 21px; height: 21px; display: block;" border="0px" draggable="false"/></td>';
hd+=' <td style="vertical-align:bottom;cursor:pointer;"><img src="'+this.path+'/metadata/dbms/form/close.gif" alt="X" style="width: 21px; height: 21px; display: block;" border="0px" draggable="false" id="TWin_CL_'+this.tWinId+'"/></td>';
hd+=' <td style="vertical-align:bottom;"><img src="'+this.path+'/metadata/dbms/form/none.gif" alt="" style="width: 21px; height: 21px; display: block;" border="0px" draggable="false"/></td>';
hd+=' </tr>';
hd+='</table>';
@ -1230,30 +1235,30 @@ class TWin
str+='<table id="TWin_TBL_'+this.tWinId+'" border="0px" style="width: 100%; height: 100%;">';
str+=' <tr id="TWin_H0_'+this.tWinId+'"><td colspan=3>'+hd+'</td></tr>';
str+=' <tr>';
str+=' <td style="width: 10px; height: 10px; cursor:nw-resize;"><img src="../metadata/dbms/form/_t-l.gif" alt="" style="width: 10px; height: 10px; display: block;" border="0px" draggable="false" id="TWin_TL_'+this.tWinId+'"></td>';
str+=' <td style="vertical-align:top; height: 10px; cursor:n-resize;" background="../metadata/dbms/form/t.gif" id="TWin_T_'+this.tWinId+'"></td>';
str+=' <td style="width: 10px; height: 10px; cursor:ne-resize;" id="TWin_TR_'+this.tWinId+'"><img src="../metadata/dbms/form/t-r.gif" alt="" style="width: 10px; height: 10px; display: block;" border="0px" draggable="false"></td>';
str+=' <td style="width: 10px; height: 10px; cursor:nw-resize;"><img src="'+this.path+'/metadata/dbms/form/_t-l.gif" alt="" style="width: 10px; height: 10px; display: block;" border="0px" draggable="false" id="TWin_TL_'+this.tWinId+'"></td>';
str+=' <td style="vertical-align:top; height: 10px; cursor:n-resize;" background="'+this.path+'/metadata/dbms/form/t.gif" id="TWin_T_'+this.tWinId+'"></td>';
str+=' <td style="width: 10px; height: 10px; cursor:ne-resize;" id="TWin_TR_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/t-r.gif" alt="" style="width: 10px; height: 10px; display: block;" border="0px" draggable="false"></td>';
str+=' </tr>';
str+=' <tr style="height: 100%">';
str+=' <td style="vertical-align:top;height: 10px; cursor:w-resize;" background="../metadata/dbms/form/l.gif" id="TWin_L_'+this.tWinId+'"></td>';
str+=' <td style="vertical-align:top;height: 10px; cursor:w-resize;" background="'+this.path+'/metadata/dbms/form/l.gif" id="TWin_L_'+this.tWinId+'"></td>';
str+=' <td style="vertical-align:top;cursor:default;"><table style="width: 100%; height: 100%;"><tr><td id="TWin_Co_'+this.tWinId+'" style="vertical-align:top;">&nbsp;</td></tr></table></td>';
str+=' <td style="vertical-align: top; height: 10px; cursor:e-resize;" background="../metadata/dbms/form/r.gif" id="TWin_R_'+this.tWinId+'"></td>';
str+=' <td style="vertical-align: top; height: 10px; cursor:e-resize;" background="'+this.path+'/metadata/dbms/form/r.gif" id="TWin_R_'+this.tWinId+'"></td>';
str+=' </tr>';
str+=' <tr>';
str+=' <td style="width: 10px; height: 10px; cursor:sw-resize;" id="TWin_BL_'+this.tWinId+'"><img src="../metadata/dbms/form/b-l.gif" alt="" style="width: 10px; height: 10px; display: block;" border="0px" draggable="false"></td>';
str+=' <td style="vertical-align: top; height: 10px; cursor:s-resize;" background="../metadata/dbms/form/b.gif" id="TWin_B_'+this.tWinId+'"></td>';
str+=' <td style="width: 10px; height: 10px; cursor:se-resize;" id="TWin_BR_'+this.tWinId+'"><img src="../metadata/dbms/form/b-r.gif" alt="" style="width: 10px; height: 10px; display: block;" border="0px" draggable="false"></td>';
str+=' <td style="width: 10px; height: 10px; cursor:sw-resize;" id="TWin_BL_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/b-l.gif" alt="" style="width: 10px; height: 10px; display: block;" border="0px" draggable="false"></td>';
str+=' <td style="vertical-align: top; height: 10px; cursor:s-resize;" background="'+this.path+'/metadata/dbms/form/b.gif" id="TWin_B_'+this.tWinId+'"></td>';
str+=' <td style="width: 10px; height: 10px; cursor:se-resize;" id="TWin_BR_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/b-r.gif" alt="" style="width: 10px; height: 10px; display: block;" border="0px" draggable="false"></td>';
str+=' </tr>';
str+='</table>';
*/
/*
let str='';
str+='<table id="TWin_TBL_'+this.tWinId+'" class="TWin">';
str+=' <tr id="TWin_H0_'+this.tWinId+'" style="border-bottom: 1px solid #b3b3b3;"><td></td><td><table style="width: 100%; height: 29px;"><tr><td id="TWin_Ca_'+this.tWinId+'" style="vertical-align: middle; cursor: move; font-weight: bold; white-space: nowrap;"></td><td style="width: 10px; vertical-align: middle;"><img src="../resources/metadata/dbms/form/x.gif" id="TWin_CL_'+this.tWinId+'" style="cursor:pointer;"></td></tr></table></td><td></td></tr>';
str+=' <tr id="TWin_H0_'+this.tWinId+'" style="border-bottom: 1px solid #b3b3b3;"><td></td><td><table style="width: 100%; height: 29px;"><tr><td id="TWin_Ca_'+this.tWinId+'" style="vertical-align: middle; cursor: move; font-weight: bold; white-space: nowrap;"></td><td style="width: 10px; vertical-align: middle;"><img src="'+this.path+'/metadata/dbms/form/x.gif" id="TWin_CL_'+this.tWinId+'" style="cursor:pointer;"></td></tr></table></td><td></td></tr>';
str+=' <tr>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:nw-resize;' : '')+'" id="TWin_TL_'+this.tWinId+'"><img src="../resources/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:nw-resize;' : '')+'" id="TWin_TL_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' <td style="vertical-align: top; height: 5px;'+(!this.dialog ? ' cursor: n-resize;' : '')+'" id="TWin_T_'+this.tWinId+'"></td>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:ne-resize;' : '')+'" id="TWin_TR_'+this.tWinId+'"><img src="../resources/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:ne-resize;' : '')+'" id="TWin_TR_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' </tr>';
str+=' <tr style="height: 100%">';
str+=' <td style="height: 5px;'+(!this.dialog ? ' cursor:w-resize;' : '')+'" id="TWin_L_'+this.tWinId+'"></td>';
@ -1261,9 +1266,9 @@ class TWin
str+=' <td style="height: 5px;'+(!this.dialog ? ' cursor:e-resize;' : '')+'" id="TWin_R_'+this.tWinId+'"></td>';
str+=' </tr>';
str+=' <tr>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:sw-resize;' : '')+'" id="TWin_BL_'+this.tWinId+'"><img src="../resources/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:sw-resize;' : '')+'" id="TWin_BL_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' <td style="vertical-align:top;height: 5px;'+(!this.dialog ? ' cursor: s-resize;' : '')+'" id="TWin_B_'+this.tWinId+'"></td>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:se-resize;' : '')+'" id="TWin_BR_'+this.tWinId+'"><img src="../resources/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:se-resize;' : '')+'" id="TWin_BR_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' </tr>';
str+='</table>';
*/
@ -1277,11 +1282,11 @@ class TWin
let str='';
str+='<table id="TWin_TBL_'+this.tWinId+'" class="DBMSShadow" style="width: 100%; height: 100%; border: 1px solid #000000;">';
str+=' <tr id="TWin_H0_'+this.tWinId+'" style="background: url(../resources/metadata/dbms/form/'+imgB+') repeat-x;"><td></td><td><table style="width: 100%; height: 29px;"><tr><td id="TWin_Ca_'+this.tWinId+'" style="vertical-align: middle; cursor: move; font-weight: bold; white-space: nowrap;"></td><td style="width: 10px; vertical-align: middle;">'+(this.disableClosing ? '' : '<img src="../resources/metadata/dbms/form/'+imgX+'" id="TWin_CL_'+this.tWinId+'" style="cursor:pointer;padding-right: 5px;">')+'</td></tr></table></td><td></td></tr>';
str+=' <tr id="TWin_H0_'+this.tWinId+'" style="background: url('+this.path+'/metadata/dbms/form/'+imgB+') repeat-x;"><td></td><td><table style="width: 100%; height: 29px;"><tr><td id="TWin_Ca_'+this.tWinId+'" style="vertical-align: middle; cursor: move; font-weight: bold; white-space: nowrap;"></td><td style="width: 10px; vertical-align: middle;">'+(this.disableClosing ? '' : '<img src="'+this.path+'/metadata/dbms/form/'+imgX+'" id="TWin_CL_'+this.tWinId+'" style="cursor:pointer;padding-right: 5px;">')+'</td></tr></table></td><td></td></tr>';
str+=' <tr>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:nw-resize;' : '')+'" id="TWin_TL_'+this.tWinId+'"><img src="../resources/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:nw-resize;' : '')+'" id="TWin_TL_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' <td style="vertical-align:top;height: 5px;'+(!this.dialog ? ' cursor:n-resize;' : '')+'" id="TWin_T_'+this.tWinId+'"></td>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:ne-resize;' : '')+'" id="TWin_TR_'+this.tWinId+'"><img src="../resources/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:ne-resize;' : '')+'" id="TWin_TR_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' </tr>';
str+=' <tr style="height: 100%">';
str+=' <td style="height: 5px;'+(!this.dialog ? ' cursor:w-resize;' : '')+'" id="TWin_L_'+this.tWinId+'"></td>';
@ -1289,9 +1294,9 @@ class TWin
str+=' <td style="height: 5px;'+(!this.dialog ? ' cursor:e-resize;' : '')+'" id="TWin_R_'+this.tWinId+'"></td>';
str+=' </tr>';
str+=' <tr>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:sw-resize;' : '')+'" id="TWin_BL_'+this.tWinId+'"><img src="../resources/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:sw-resize;' : '')+'" id="TWin_BL_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' <td style="vertical-align:top; height: 5px;'+(!this.dialog ? ' cursor:s-resize;' : '')+'" id="TWin_B_'+this.tWinId+'"></td>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:se-resize;' : '')+'" id="TWin_BR_'+this.tWinId+'"><img src="../resources/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:se-resize;' : '')+'" id="TWin_BR_'+this.tWinId+'"><img src="'+this.path+'/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
str+=' </tr>';
str+='</table>';
@ -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='<table style="background-color: rgba(0,0,0,0.5);" width="100%" height="100%" cellpadding="0" cellspacing="0"><tr><td align="center" style="vertical-align: middle;"><img src="../resources/metadata/dbms/images/'+img+'" alt=""></td></tr></table>';
this.pBarDiv.innerHTML='<table style="background-color: rgba(0,0,0,0.5);" width="100%" height="100%" cellpadding="0" cellspacing="0"><tr><td align="center" style="vertical-align: middle;"><img src="'+this.path+'/metadata/dbms/images/'+img+'" alt=""></td></tr></table>';
//var eDiv=document.getElementById('eDiv'+this.uid);
this.div.appendChild(this.pBarDiv);