From eca2e4f45fccdf82195e441dbf6c835bf541e0a2 Mon Sep 17 00:00:00 2001 From: Igor I Date: Thu, 25 Jan 2024 17:00:47 +0600 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8E=20getColN(n?= =?UTF-8?q?ame)=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=BF=D0=BE=20?= =?UTF-8?q?=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D1=8E=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=BD=D0=BA=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metadata/dbms/records.php | 3 +-- metadata/dbms/showrecord.js | 10 ++++++---- metadata/dbms/tools.js | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/metadata/dbms/records.php b/metadata/dbms/records.php index 7ba1e5c..d2f808c 100644 --- a/metadata/dbms/records.php +++ b/metadata/dbms/records.php @@ -1101,7 +1101,7 @@ }else if ($fn==8)//Получить отчёт как Excel.xls файл (почти тоже самое что и функция 4) { - $dir='./temp/'; + $dir='./temp/'; //$tmpfname = tempnam($dir, ""); // отправка файла в отдельном файле download.php для совместимости с java версией session_write_close(); //Разблокируем сессионный файл так как запросы могут быть достаточно долгими @@ -1307,7 +1307,6 @@ header('Content-type: text/xml'); echo ''; - //deleteTempFiles($dir); }else { sendError(1,trt('Not found the requested node:').' "'.$typename.'"!'); diff --git a/metadata/dbms/showrecord.js b/metadata/dbms/showrecord.js index e87d4d0..2b00a96 100644 --- a/metadata/dbms/showrecord.js +++ b/metadata/dbms/showrecord.js @@ -1462,10 +1462,11 @@ class SRec } } - //Get column number by name + //Get column number by name, if result=-1 then not find else find getColN(name){ - let i=-1; + let result=-1; //determine the sequence number of the column + let pos=0; let node=findNodeOnPath(this.nodeMetadata,"type/objects-list"); let nodeCol = node.firstChild; while (nodeCol != null) @@ -1473,13 +1474,14 @@ class SRec if(nodeCol.nodeName=="column") { if(nodeCol.getAttribute("n")==name){ + result=pos; break; } - i++; + pos++; } nodeCol = nodeCol.nextSibling; } - return i; + return result; } //find the value in the result set by the id of the record and the name of the column diff --git a/metadata/dbms/tools.js b/metadata/dbms/tools.js index 99b6411..4ebbfa6 100644 --- a/metadata/dbms/tools.js +++ b/metadata/dbms/tools.js @@ -622,7 +622,7 @@ function getCookie(c_name) //expires - Сколько дней хранить куки //path - Путь куда разрешено пересылать куки (по умолчанию текущий) -function setCookie (name, value, expires, path, domain, secure) +function setCookie(name, value, expires, path, domain, secure) { let exDate=new Date(); exDate.setDate(exDate.getDate() + expires); @@ -632,8 +632,8 @@ function setCookie (name, value, expires, path, domain, secure) ((expires) ? "; expires=" + expires : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + - ((secure) ? "; secure" : ""); - + ((secure) ? "; secure" : "") + + "; SameSite=Strict"; document.cookie = str; }