Merge branch 'master' of http://git.dirt.kz/igor/Metadata_PHP
This commit is contained in:
@ -79,7 +79,7 @@ import tools.EmailUtility;
|
|||||||
import tools.User;
|
import tools.User;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@SessionAttributes( { "user" }) //Сесионный объект
|
@SessionAttributes( { "user" }) //Сесионный объект!
|
||||||
public class DBMSRecords implements ServletContextAware {
|
public class DBMSRecords implements ServletContextAware {
|
||||||
|
|
||||||
//private static final Logger logger = LoggerFactory.getLogger(Translation.class);
|
//private static final Logger logger = LoggerFactory.getLogger(Translation.class);
|
||||||
|
|||||||
@ -40,7 +40,7 @@ import tools.User;
|
|||||||
import tools.XMLTools;
|
import tools.XMLTools;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@SessionAttributes( { "user" }) //Сесионный объект
|
@SessionAttributes( { "user" }) //Сесионный объект!
|
||||||
public class DBMSTree implements ServletContextAware {
|
public class DBMSTree implements ServletContextAware {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(kz.goodssales.GoodsSales.dbms.DBMSTree.class);
|
private static final Logger logger = LoggerFactory.getLogger(kz.goodssales.GoodsSales.dbms.DBMSTree.class);
|
||||||
|
|||||||
@ -146,9 +146,31 @@ function TCGallery(parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Галерея изображений на странице товара (Двигается в право в лево)
|
//Галерея изображений на странице товара (Двигается в право в лево)
|
||||||
function TCGallery2(parent)
|
class TCGallery2
|
||||||
{
|
{
|
||||||
this.addImage = function(small)
|
constructor(parent) {
|
||||||
|
this.parent=parent; //Элемент который будем двигать в право в лево
|
||||||
|
|
||||||
|
this.mas = new Array(); //Массим элементов с рисуночками
|
||||||
|
this.pos=0;
|
||||||
|
this.ower=true;
|
||||||
|
|
||||||
|
this.iWidth=200; //Размер картинки по умолчанию
|
||||||
|
|
||||||
|
// повторить с интервалом 2 секунды
|
||||||
|
setInterval(() => this.resize(), 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Подстраиваюсь под размер родительского компонента
|
||||||
|
resize()
|
||||||
|
{
|
||||||
|
let pDiv = this.parent.parentElement;
|
||||||
|
|
||||||
|
this.parent.style.width = pDiv.offsetWidth+'px';
|
||||||
|
}
|
||||||
|
|
||||||
|
//Добавляю кнопочки для переключения картинок
|
||||||
|
addImage(small)
|
||||||
{
|
{
|
||||||
this.mas.push({div: small, sell: false});
|
this.mas.push({div: small, sell: false});
|
||||||
|
|
||||||
@ -157,8 +179,8 @@ function TCGallery2(parent)
|
|||||||
{
|
{
|
||||||
if(!thiz.ower) return;
|
if(!thiz.ower) return;
|
||||||
|
|
||||||
pos=-1;
|
let pos=-1;
|
||||||
for(i=0;i<thiz.mas.length;i++) if(small===thiz.mas[i].div) { pos=i;} //Позиция элемента в массиве
|
for(let i=0;i<thiz.mas.length;i++) if(small===thiz.mas[i].div) { pos=i;} //Позиция элемента в массиве
|
||||||
if(pos===-1) return;
|
if(pos===-1) return;
|
||||||
|
|
||||||
if(thiz.ower && pos!== thiz.pos )
|
if(thiz.ower && pos!== thiz.pos )
|
||||||
@ -171,8 +193,9 @@ function TCGallery2(parent)
|
|||||||
small.onclick = function(thiz,small)
|
small.onclick = function(thiz,small)
|
||||||
{ return function()
|
{ return function()
|
||||||
{
|
{
|
||||||
pos=-1;
|
|
||||||
for(i=0;i<thiz.mas.length;i++) if(small===thiz.mas[i].div) { pos=i; } else { thiz.mas[i].div.style.borderColor="#dfdfdf"; thiz.mas[i].sell=false; } //Позиция элемента в массиве
|
let pos=-1;
|
||||||
|
for(let i=0;i<thiz.mas.length;i++) if(small===thiz.mas[i].div) { pos=i; } else { thiz.mas[i].div.style.borderColor="#dfdfdf"; thiz.mas[i].sell=false; } //Позиция элемента в массиве
|
||||||
if(pos===-1) return;
|
if(pos===-1) return;
|
||||||
|
|
||||||
if(!thiz.mas[pos].sell) //Если щёлкнули на выделеное 1й раз
|
if(!thiz.mas[pos].sell) //Если щёлкнули на выделеное 1й раз
|
||||||
@ -195,7 +218,7 @@ function TCGallery2(parent)
|
|||||||
};
|
};
|
||||||
|
|
||||||
//Плавная прокрутка по горизонтали
|
//Плавная прокрутка по горизонтали
|
||||||
this.moveTo = function()
|
moveTo()
|
||||||
{
|
{
|
||||||
if(this.parent==null) return;
|
if(this.parent==null) return;
|
||||||
var dx=(this.pos - this.parent.scrollLeft)/20.0; //Шагов для достижения нужного положения
|
var dx=(this.pos - this.parent.scrollLeft)/20.0; //Шагов для достижения нужного положения
|
||||||
@ -205,8 +228,4 @@ function TCGallery2(parent)
|
|||||||
setTimeout(function(thiz){ return function(){ thiz.moveTo(); } }(this),10);
|
setTimeout(function(thiz){ return function(){ thiz.moveTo(); } }(this),10);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mas = new Array(); //Массим элементов с рисуночками
|
|
||||||
this.parent=parent;
|
|
||||||
this.pos=0;
|
|
||||||
this.ower=true;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,10 @@
|
|||||||
|
/*Переменные для настройки цветов*/
|
||||||
|
:root{
|
||||||
|
--header-color: #505050;
|
||||||
|
--back-color: 3a3a3a;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
*{
|
*{
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
-moz-box-sizing: border-box;
|
-moz-box-sizing: border-box;
|
||||||
@ -12,6 +19,7 @@ html,body
|
|||||||
padding: 0px;
|
padding: 0px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: Arial;
|
font-family: Arial;
|
||||||
|
background-color: #3a3a3a;
|
||||||
}
|
}
|
||||||
|
|
||||||
input,textarea
|
input,textarea
|
||||||
@ -58,8 +66,11 @@ select
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Табличка исполняющая роль окна*/
|
||||||
.shadow {
|
.shadow {
|
||||||
box-shadow: 0 0 10px rgba(0,0,0,0.7);
|
box-shadow: 0 0 10px rgba(255,255,255,0.7);
|
||||||
|
background-color: #3a3a3a;
|
||||||
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -80,7 +91,7 @@ table.SEdit {
|
|||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border: 1px double #999999;
|
border: 1px double #999999;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #ffffff;
|
background-color: var(--back-color);
|
||||||
border-spacing: 1px 1px;
|
border-spacing: 1px 1px;
|
||||||
}
|
}
|
||||||
table.SEdit td,table.SEdit th {
|
table.SEdit td,table.SEdit th {
|
||||||
@ -90,7 +101,7 @@ table.SEdit td,table.SEdit th {
|
|||||||
|
|
||||||
table.SEdit th {
|
table.SEdit th {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background-color: rgb(218, 218, 218);
|
background-color: var(--header-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -99,7 +110,7 @@ table.SFilter {
|
|||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color:#f1f1f1;
|
background-color: var(--back-color);
|
||||||
border-spacing: 1px 1px;
|
border-spacing: 1px 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,8 +119,6 @@ table.SFilter td {
|
|||||||
border: 0px solid #999999;
|
border: 0px solid #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* For table show data */
|
/* For table show data */
|
||||||
table.SShow {
|
table.SShow {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
@ -125,5 +134,5 @@ table.SShow td,table.SShow th {
|
|||||||
|
|
||||||
table.SShow th {
|
table.SShow th {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background-color: rgb(218, 218, 218);
|
background-color: var(--header-color);
|
||||||
}
|
}
|
||||||
@ -15,7 +15,7 @@ class EdtRec
|
|||||||
this.uid=getUID();
|
this.uid=getUID();
|
||||||
|
|
||||||
this.win=new TWin();
|
this.win=new TWin();
|
||||||
this.win.TWin(pageX-10,pageY-10);
|
this.win.BuildGUI(pageX-10,pageY-10);
|
||||||
this.win.setSize("500px","150px");
|
this.win.setSize("500px","150px");
|
||||||
this.win.setContent('<div id="eDiv'+this.uid+'" style="width: 100%; /*height: 100%;*/ position: relative;"></div>');
|
this.win.setContent('<div id="eDiv'+this.uid+'" style="width: 100%; /*height: 100%;*/ position: relative;"></div>');
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ class EdtRec
|
|||||||
this.setPropCdata(nodeType.getAttribute("ObjectID"),record_id);
|
this.setPropCdata(nodeType.getAttribute("ObjectID"),record_id);
|
||||||
|
|
||||||
let str='';
|
let str='';
|
||||||
str+=' <table id="eTable'+this.uid+'" border="0px" cellspacing="1" cellpadding="1" style="width: 100%; height: 100%; background-color: #afafaf;">';
|
str+=' <table class="SEdit" id="eTable'+this.uid+'" border="0px" cellspacing="1" cellpadding="1" style="width: 100%; height: 100%;">';
|
||||||
str+=' <caption><b id="caption'+this.uid+'"></b></caption>';
|
str+=' <caption><b id="caption'+this.uid+'"></b></caption>';
|
||||||
str+=' <thead>';
|
str+=' <thead>';
|
||||||
str+=' <tr bgcolor="#dadada">';
|
str+=' <tr bgcolor="#dadada">';
|
||||||
@ -262,7 +262,7 @@ class EdtRec
|
|||||||
{
|
{
|
||||||
rpos++;
|
rpos++;
|
||||||
tr = document.createElement('tr');
|
tr = document.createElement('tr');
|
||||||
if (rpos%2==0) bgColor='#EEEEEE'; else bgColor='#FFFFFF';
|
if (rpos%2==0) bgColor=g_rowColor1; else bgColor=g_rowColor2;
|
||||||
tr.setAttribute("bgColor",bgColor);
|
tr.setAttribute("bgColor",bgColor);
|
||||||
if(nodeProp.getAttribute("visible")=='0') tr.style.display='none';
|
if(nodeProp.getAttribute("visible")=='0') tr.style.display='none';
|
||||||
var td1 = document.createElement('td');
|
var td1 = document.createElement('td');
|
||||||
@ -338,7 +338,8 @@ class EdtRec
|
|||||||
var tObj=findNode(nodeProp, "type");
|
var tObj=findNode(nodeProp, "type");
|
||||||
if(tObj!=null)
|
if(tObj!=null)
|
||||||
{
|
{
|
||||||
var button = document.createElement('input');
|
let button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","...");
|
button.setAttribute("value","...");
|
||||||
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
|
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
|
||||||
@ -352,6 +353,16 @@ class EdtRec
|
|||||||
}
|
}
|
||||||
td2.appendChild( table );
|
td2.appendChild( table );
|
||||||
|
|
||||||
|
}else
|
||||||
|
if(vt=="password")
|
||||||
|
{
|
||||||
|
input = document.createElement('input');
|
||||||
|
input.style.cssText="width: 100%;";
|
||||||
|
input.setAttribute("type","password");
|
||||||
|
input.setAttribute("name",nodeProp.getAttribute("n"));
|
||||||
|
input.setAttribute("value",value);
|
||||||
|
input.setAttribute("id","prop_"+this.uid+"_"+nodeProp.getAttribute("n"));
|
||||||
|
td2.appendChild( input );
|
||||||
}else
|
}else
|
||||||
if(vt=="b")
|
if(vt=="b")
|
||||||
{
|
{
|
||||||
@ -442,6 +453,7 @@ class EdtRec
|
|||||||
newCell1.appendChild( input );
|
newCell1.appendChild( input );
|
||||||
|
|
||||||
button = document.createElement('input');
|
button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","+");
|
button.setAttribute("value","+");
|
||||||
button.setAttribute("title",_("Increase_by_1"));
|
button.setAttribute("title",_("Increase_by_1"));
|
||||||
@ -451,6 +463,7 @@ class EdtRec
|
|||||||
newCell2.appendChild( button );
|
newCell2.appendChild( button );
|
||||||
|
|
||||||
button = document.createElement('input');
|
button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","-");
|
button.setAttribute("value","-");
|
||||||
button.setAttribute("title",_("Decrease_by_1"));
|
button.setAttribute("title",_("Decrease_by_1"));
|
||||||
@ -503,6 +516,7 @@ class EdtRec
|
|||||||
//cmbInp.addEventListener(IndexChangeEvent.CHANGE,onComboObjectChangeHandler);
|
//cmbInp.addEventListener(IndexChangeEvent.CHANGE,onComboObjectChangeHandler);
|
||||||
|
|
||||||
var button = document.createElement('input');
|
var button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","...");
|
button.setAttribute("value","...");
|
||||||
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;height:100%;";
|
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;height:100%;";
|
||||||
@ -571,6 +585,7 @@ class EdtRec
|
|||||||
hidden.value=value;
|
hidden.value=value;
|
||||||
newCell1.appendChild(hidden);
|
newCell1.appendChild(hidden);
|
||||||
var button = document.createElement('input');
|
var button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","...");
|
button.setAttribute("value","...");
|
||||||
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
|
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
|
||||||
@ -638,7 +653,8 @@ class EdtRec
|
|||||||
newCell1.appendChild(input);
|
newCell1.appendChild(input);
|
||||||
|
|
||||||
//Button to send the file to the server
|
//Button to send the file to the server
|
||||||
var btnSel = document.createElement('input');
|
let btnSel = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
btnSel.setAttribute("type","button");
|
btnSel.setAttribute("type","button");
|
||||||
btnSel.setAttribute("value","...");
|
btnSel.setAttribute("value","...");
|
||||||
btnSel.setAttribute("title",_('Upload'));
|
btnSel.setAttribute("title",_('Upload'));
|
||||||
@ -646,7 +662,8 @@ class EdtRec
|
|||||||
btnSel.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
|
btnSel.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
|
||||||
newCell2.appendChild(btnSel);
|
newCell2.appendChild(btnSel);
|
||||||
|
|
||||||
var button2 = document.createElement('input');
|
let button2 = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button2.setAttribute("type","button");
|
button2.setAttribute("type","button");
|
||||||
button2.setAttribute("value","X");
|
button2.setAttribute("value","X");
|
||||||
button2.setAttribute("title",_('Delete'));
|
button2.setAttribute("title",_('Delete'));
|
||||||
@ -749,13 +766,14 @@ class EdtRec
|
|||||||
//Button apply
|
//Button apply
|
||||||
tr = document.createElement('tr');
|
tr = document.createElement('tr');
|
||||||
var td = document.createElement('td');
|
var td = document.createElement('td');
|
||||||
td.style.cssText="padding: 5px; vertical-align: bottom; background-color: #f5f5f5;";
|
td.style.cssText="padding: 5px; vertical-align: bottom;";
|
||||||
td.setAttribute("colspan", "2");
|
td.setAttribute("colspan", "2");
|
||||||
if (this.record_id==-1) td.innerHTML='<label style="float: left; white-space: nowrap;"><input id="readd_'+this.uid+'" type="checkbox"> '+_('Repeat_the_addition_of_the_entry')+'</label>';
|
if (this.record_id==-1) td.innerHTML='<label style="float: left; white-space: nowrap;"><input id="readd_'+this.uid+'" type="checkbox"> '+_('Repeat_the_addition_of_the_entry')+'</label>';
|
||||||
tr.appendChild(td);
|
tr.appendChild(td);
|
||||||
//var td = document.createElement('td');
|
//var td = document.createElement('td');
|
||||||
td.setAttribute("align","right");
|
td.setAttribute("align","right");
|
||||||
button = document.createElement('input');
|
button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.style.cssText="margin:0px;margin-right:1px;";
|
button.style.cssText="margin:0px;margin-right:1px;";
|
||||||
button.setAttribute("value",_('Apply'));
|
button.setAttribute("value",_('Apply'));
|
||||||
@ -768,6 +786,7 @@ class EdtRec
|
|||||||
|
|
||||||
button = document.createElement('input'); //Button cancel
|
button = document.createElement('input'); //Button cancel
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
|
button.className='button-secondary';
|
||||||
button.style.cssText="margin:0px;";
|
button.style.cssText="margin:0px;";
|
||||||
button.setAttribute("value",_('Cancel'));
|
button.setAttribute("value",_('Cancel'));
|
||||||
//button.onclick=function f_exit(this) { alert(this.win.div); }
|
//button.onclick=function f_exit(this) { alert(this.win.div); }
|
||||||
@ -867,7 +886,7 @@ class EdtRec
|
|||||||
selObj(typeName,propname)
|
selObj(typeName,propname)
|
||||||
{
|
{
|
||||||
var win=new TWin();
|
var win=new TWin();
|
||||||
win.TWin(pageX-10,pageY-10);
|
win.BuildGUI(pageX-10,pageY-10);
|
||||||
|
|
||||||
var str='';
|
var str='';
|
||||||
str+='<table id="thetable'+win+'" bgcolor="SlateGrey" style="border: 1px solid rgb(99, 99, 99);" width="100%">';
|
str+='<table id="thetable'+win+'" bgcolor="SlateGrey" style="border: 1px solid rgb(99, 99, 99);" width="100%">';
|
||||||
@ -988,7 +1007,7 @@ class EdtRec
|
|||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
//We request the field title by the field id (if it is filled).
|
//We request the field title by the field id (if it is filled).
|
||||||
if ((value!="")&&(value!=-1))
|
/*if ((value!="")&&(value!=-1))
|
||||||
{
|
{
|
||||||
var xml='<?xml version="1.0" encoding="utf-8"?><metadata fn="6"><type n="'+nodeProp.getAttribute("ot")+'" c="'+nodeProp.getAttribute("FieldCaption")+'" pn="'+nodeProp.getAttribute("n")+'" fn="'+nodeProp.getAttribute("fn")+'" id="'+value+'">';
|
var xml='<?xml version="1.0" encoding="utf-8"?><metadata fn="6"><type n="'+nodeProp.getAttribute("ot")+'" c="'+nodeProp.getAttribute("FieldCaption")+'" pn="'+nodeProp.getAttribute("n")+'" fn="'+nodeProp.getAttribute("fn")+'" id="'+value+'">';
|
||||||
xml+='<objects-list><filter><column n="'+findFirstNode(this.nodeMetadata, 'type').getAttribute('ObjectID')+'"><![CDATA['+value+']]></column></filter></objects-list>';
|
xml+='<objects-list><filter><column n="'+findFirstNode(this.nodeMetadata, 'type').getAttribute('ObjectID')+'"><![CDATA['+value+']]></column></filter></objects-list>';
|
||||||
@ -997,7 +1016,7 @@ class EdtRec
|
|||||||
{
|
{
|
||||||
this.showProgressBar();
|
this.showProgressBar();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1132,7 +1151,7 @@ class EdtRec
|
|||||||
htmlString+='</table>';
|
htmlString+='</table>';
|
||||||
|
|
||||||
var win=new TWin();
|
var win=new TWin();
|
||||||
win.TWin(pageX-280,pageY-7);
|
win.BuildGUI(pageX-280,pageY-7);
|
||||||
win.setContent(htmlString);
|
win.setContent(htmlString);
|
||||||
win.setCaption(document.createTextNode(_("Selection")));
|
win.setCaption(document.createTextNode(_("Selection")));
|
||||||
win.setParent(this.win);
|
win.setParent(this.win);
|
||||||
|
|||||||
BIN
metadata/dbms/form/b_g.png
Normal file
BIN
metadata/dbms/form/b_g.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 625 B |
BIN
metadata/dbms/form/b_x.png
Normal file
BIN
metadata/dbms/form/b_x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 598 B |
@ -1,22 +1,15 @@
|
|||||||
|
|
||||||
function TUser()
|
function TUser()
|
||||||
{
|
{
|
||||||
//Функция запрашивает информацию о текущем пользователе с сервера
|
|
||||||
this.LoadData = function()
|
|
||||||
{
|
|
||||||
var r = new TRequest(this);
|
|
||||||
var xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[0]]></cmd></metadata>';
|
|
||||||
if(r.callServer(ScriptName,xs))
|
|
||||||
{
|
|
||||||
this.showShadow(true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.applyReq=function(req,fn,node)
|
this.applyReq=function(req,fn,node)
|
||||||
{
|
{
|
||||||
//alert(getXMLNodeSerialisation(node));
|
//alert(getXMLNodeSerialisation(node));
|
||||||
this.showShadow(false);
|
this.showShadow(false);
|
||||||
|
if (fn==-1)
|
||||||
|
{
|
||||||
|
alert(findFirstNode(node,'#cdata-section').nodeValue);
|
||||||
|
}else
|
||||||
if(fn==7)
|
if(fn==7)
|
||||||
{
|
{
|
||||||
var nCmd=findFirstNode(node, "cmd");
|
var nCmd=findFirstNode(node, "cmd");
|
||||||
@ -43,16 +36,29 @@ function TUser()
|
|||||||
//configGUIbyAccessLevel();
|
//configGUIbyAccessLevel();
|
||||||
//var shadow=document.getElementById("shadow");
|
//var shadow=document.getElementById("shadow");
|
||||||
//if(shadow.parentNode!=null) shadow.parentNode.removeChild(shadow);
|
//if(shadow.parentNode!=null) shadow.parentNode.removeChild(shadow);
|
||||||
|
|
||||||
|
//Информируем слушатеелй о логине
|
||||||
|
for(i=0;i<this.m_ls.length;i++){
|
||||||
|
if(this.m_ls[i]!==null){
|
||||||
|
this.m_ls[i].OnLogin(true); //0 - authorized, 1 - an incorrect username or password, 2 - left.
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else if(findFirstNode(nCmd,'#cdata-section').nodeValue=="3") //Login
|
}else if(findFirstNode(nCmd,'#cdata-section').nodeValue=="3") //Login
|
||||||
{
|
{
|
||||||
//if(findNode(node,'#cdata-section').nodeValue=="0") //if not logged
|
if(findNode(node,'#cdata-section').nodeValue=="0") //if not logged
|
||||||
//{
|
{
|
||||||
// alert(_('Invalid_username_and_or_password'));
|
alert(_('Invalid_username_and_or_password'));
|
||||||
//}else
|
}else
|
||||||
//{
|
{
|
||||||
//location.reload();
|
//location.reload();
|
||||||
//}
|
//Информируем слушатеелй о логине
|
||||||
|
for(i=0;i<this.m_ls.length;i++){
|
||||||
|
if(this.m_ls[i]!==null){
|
||||||
|
this.m_ls[i].OnLogin(true); //0 - authorized, 1 - an incorrect username or password, 2 - left.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}else if(findFirstNode(nCmd,'#cdata-section').nodeValue=="4") //Register
|
}else if(findFirstNode(nCmd,'#cdata-section').nodeValue=="4") //Register
|
||||||
{
|
{
|
||||||
//if(findNode(node,'#cdata-section').nodeValue=="1") //if register
|
//if(findNode(node,'#cdata-section').nodeValue=="1") //if register
|
||||||
@ -71,7 +77,7 @@ function TUser()
|
|||||||
if(this.win==null || this.win.closed)
|
if(this.win==null || this.win.closed)
|
||||||
{
|
{
|
||||||
this.win=new TWin(true);
|
this.win=new TWin(true);
|
||||||
this.win.TWin(10,10);
|
this.win.BuildGUI(10,10);
|
||||||
this.win.setCaption(_('Authorization'));
|
this.win.setCaption(_('Authorization'));
|
||||||
|
|
||||||
this.win.setSize("350px","200px");
|
this.win.setSize("350px","200px");
|
||||||
@ -164,6 +170,17 @@ function TUser()
|
|||||||
deleteHTML(this.divsh);
|
deleteHTML(this.divsh);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//Функция запрашивает информацию о текущем пользователе с сервера
|
||||||
|
this.LoadData = function()
|
||||||
|
{
|
||||||
|
var r = new TRequest(this);
|
||||||
|
var xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[2]]></cmd></metadata>';
|
||||||
|
if(r.callServer(ScriptName,xs))
|
||||||
|
{
|
||||||
|
this.showShadow(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
//Check whether the already authorized (+ attempt to log in through "hash").
|
//Check whether the already authorized (+ attempt to log in through "hash").
|
||||||
this.isLogined=function()
|
this.isLogined=function()
|
||||||
{
|
{
|
||||||
@ -179,6 +196,18 @@ function TUser()
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.addListener=function(l)
|
||||||
|
{ if(l.OnLogin==null) alert('Object does not have the function "OnLogin()"!');
|
||||||
|
this.m_ls[this.m_ls.length]=l;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.remListener=function(l)
|
||||||
|
{ for(i=0;i<this.m_ls.length;i++)
|
||||||
|
{ if(this.m_ls[i]==l)
|
||||||
|
this.m_ls[i]=null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
this.divsh=null;
|
this.divsh=null;
|
||||||
this.id=null;
|
this.id=null;
|
||||||
this.name='';
|
this.name='';
|
||||||
@ -186,6 +215,7 @@ function TUser()
|
|||||||
this.patronymic='';
|
this.patronymic='';
|
||||||
this.temp=false;
|
this.temp=false;
|
||||||
this.role='';
|
this.role='';
|
||||||
|
this.m_ls=new Array(); //Listeners called OnLogin function.
|
||||||
|
|
||||||
//Запрашиваю данные о текущем пользователе с сервера
|
//Запрашиваю данные о текущем пользователе с сервера
|
||||||
//this.LoadData();
|
//this.LoadData();
|
||||||
@ -196,11 +226,11 @@ function TUser()
|
|||||||
* Login form (not cross-source).
|
* Login form (not cross-source).
|
||||||
* [^\x00-\x7F]+
|
* [^\x00-\x7F]+
|
||||||
*/
|
*/
|
||||||
function TLogin()
|
/*function TLogin()
|
||||||
{
|
{
|
||||||
this.showLoginForm = function()
|
this.showLoginForm = function()
|
||||||
{
|
{
|
||||||
this.win.TWin(10,10);
|
this.win.BuildGUI(10,10);
|
||||||
this.win.shadow=true;
|
this.win.shadow=true;
|
||||||
this.win.setCaption(document.createTextNode("Enter"));
|
this.win.setCaption(document.createTextNode("Enter"));
|
||||||
|
|
||||||
@ -311,11 +341,11 @@ function TLogin()
|
|||||||
this.m_ls[i].OnLogin(true); //0 - authorized, 1 - an incorrect username or password, 2 - left.
|
this.m_ls[i].OnLogin(true); //0 - authorized, 1 - an incorrect username or password, 2 - left.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
this.m_lo=getCdataValue(findFirstNode(node,"login")) == '0' ? true : false;
|
//this.m_lo=getCdataValue(findFirstNode(node,"login")) == '0' ? true : false;
|
||||||
if(this.m_lo && this.win.div!==null) this.win.hide(true);
|
//if(this.m_lo && this.win.div!==null) this.win.hide(true);
|
||||||
this.m_UserName=getCdataValue(findFirstNode(node,"name"));
|
//this.m_UserName=getCdataValue(findFirstNode(node,"name"));
|
||||||
*/
|
|
||||||
}else
|
}else
|
||||||
alert("Not known function! fn=\""+fn+"\"" );
|
alert("Not known function! fn=\""+fn+"\"" );
|
||||||
|
|
||||||
@ -347,16 +377,6 @@ function TLogin()
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//Check whether the already authorized (+ attempt to log in through "hash").
|
|
||||||
this.Logined=function()
|
|
||||||
{
|
|
||||||
var xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[0]]></cmd></metadata>';
|
|
||||||
|
|
||||||
//alert('xs='+xs);
|
|
||||||
|
|
||||||
this.request.callServer(ScriptName,xs);
|
|
||||||
};
|
|
||||||
|
|
||||||
//logout current user
|
//logout current user
|
||||||
this.Exit=function()
|
this.Exit=function()
|
||||||
{
|
{
|
||||||
@ -379,6 +399,16 @@ function TLogin()
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//Check whether the already authorized (+ attempt to log in through "hash").
|
||||||
|
this.LoadData=function()
|
||||||
|
{
|
||||||
|
var xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[2]]></cmd></metadata>';
|
||||||
|
|
||||||
|
//alert('xs='+xs);
|
||||||
|
|
||||||
|
this.request.callServer(ScriptName,xs);
|
||||||
|
};
|
||||||
|
|
||||||
TLogin.LoginIsOk=0; //login in
|
TLogin.LoginIsOk=0; //login in
|
||||||
TLogin.LoginIsError=1; //Invalid password and / or login.
|
TLogin.LoginIsError=1; //Invalid password and / or login.
|
||||||
TLogin.LoginIsExit=2; //Exit
|
TLogin.LoginIsExit=2; //Exit
|
||||||
@ -396,13 +426,13 @@ function TLogin()
|
|||||||
this.m_html=false;
|
this.m_html=false;
|
||||||
|
|
||||||
this.request = new TRequest(this);
|
this.request = new TRequest(this);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
//Display password recovery form
|
//Display password recovery form
|
||||||
function showRestoreForm()
|
function showRestoreForm()
|
||||||
{
|
{
|
||||||
var win=new TWin(true);
|
var win=new TWin(true);
|
||||||
win.TWin(10,10);
|
win.BuildGUI(10,10);
|
||||||
win.setCaption(_("Password_recovery"));
|
win.setCaption(_("Password_recovery"));
|
||||||
|
|
||||||
str='<div id="TWin_DT_'+win.tWinId+'" style="width: 100%; height: 100%; padding: 4px; text-align: left;">\n\
|
str='<div id="TWin_DT_'+win.tWinId+'" style="width: 100%; height: 100%; padding: 4px; text-align: left;">\n\
|
||||||
|
|||||||
@ -46,36 +46,38 @@
|
|||||||
|
|
||||||
function getSQLValue($t,$v)
|
function getSQLValue($t,$v)
|
||||||
{
|
{
|
||||||
global $db_connstr;
|
global $db_connection;
|
||||||
|
|
||||||
if($t=='object')
|
if($t=='object' && gettype($v)=='string'){
|
||||||
{ if (($v=='-1')||($v=='')) $v='NULL';
|
$t='string'; //Если id шники uuid
|
||||||
|
}
|
||||||
|
|
||||||
|
if($t=='object'){
|
||||||
|
if (($v=='-1')||($v=='')) $v='NULL';
|
||||||
}else
|
}else
|
||||||
if($t=='i1' || $t=='i2' || $t=='i4' || $t=='integer')
|
if($t=='i1' || $t=='i2' || $t=='i4' || $t=='integer'){
|
||||||
{ if($v=='') $v='NULL';
|
if($v=='') $v='NULL';
|
||||||
}else
|
}else
|
||||||
if($t=='f8' || $t=='f4' || $t=='real' || $t=='double')
|
if($t=='f8' || $t=='f4' || $t=='real' || $t=='double'){
|
||||||
{ if($v=='')$v='NULL';
|
if($v=='')$v='NULL';
|
||||||
$v=str_replace(',','.',$v); //Разделитель целой и дробной части точка
|
$v=str_replace(',','.',$v); //Разделитель целой и дробной части точка
|
||||||
}else
|
}else
|
||||||
if($t=='b')
|
if($t=='b'){
|
||||||
{ if($v=='') $v='NULL'; else
|
if($v=='') $v='NULL'; else
|
||||||
if($v=='1') $v='true'; else
|
if($v=='1') $v='true'; else
|
||||||
if($v=='0') $v='false';
|
if($v=='0') $v='false';
|
||||||
}else
|
}else
|
||||||
if($t=='string' || $t=='text' || $t=='dateTime' || $t=='time' || $t=='date' || $t=='file')
|
if($t=='string' || $t=='text' || $t=='dateTime' || $t=='time' || $t=='date' || $t=='file'){
|
||||||
{ if($v=='')
|
if($v==''){
|
||||||
{ $v='NULL';
|
$v='NULL';
|
||||||
}else
|
}else{
|
||||||
{
|
if(strpos($db_connection, 'pgsql')!==false)
|
||||||
if(strpos($db_connstr, 'pgsql')!==false)
|
|
||||||
$v=str_replace("'","''",$v); //так как в SQL строку вставляется
|
$v=str_replace("'","''",$v); //так как в SQL строку вставляется
|
||||||
else
|
else
|
||||||
$v=str_replace('\'','\\\'',$v); //так как в SQL строку вставляется
|
$v=str_replace('\'','\\\'',$v); //так как в SQL строку вставляется
|
||||||
$v='\''.$v.'\'';
|
$v='\''.$v.'\'';
|
||||||
}
|
}
|
||||||
}else
|
}else{
|
||||||
{
|
|
||||||
$v='\''.$v.'\'';
|
$v='\''.$v.'\'';
|
||||||
}
|
}
|
||||||
return $v;
|
return $v;
|
||||||
@ -83,24 +85,27 @@
|
|||||||
|
|
||||||
function getValue($t,$v)
|
function getValue($t,$v)
|
||||||
{
|
{
|
||||||
if($t=='object' && gettype($v)=='string') $t='string'; //Если id шники uuid
|
if($t=='object' && gettype($v)=='string'){
|
||||||
if($t=='object')
|
$t='string'; //Если id шники uuid
|
||||||
{ if (($v=='-1')||($v=='')) $v=null;
|
}
|
||||||
|
|
||||||
|
if($t=='object'){
|
||||||
|
if (($v=='-1')||($v=='')) $v=null;
|
||||||
}else
|
}else
|
||||||
if($t=='i4' || $t=='integer')
|
if($t=='i4' || $t=='integer'){
|
||||||
{ if($v=='') $v=null;
|
if($v=='') $v=null;
|
||||||
}else
|
}else
|
||||||
if($t=='f8')
|
if($t=='f8'){
|
||||||
{ if($v=='')$v=null;
|
if($v=='')$v=null;
|
||||||
$v=str_replace(',','.',$v); //Разделитель целой и дробной части точка
|
$v=str_replace(',','.',$v); //Разделитель целой и дробной части точка
|
||||||
}else
|
}else
|
||||||
if($t=='b')
|
if($t=='b'){
|
||||||
{ if($v=='') $v=null; else
|
if($v=='') $v=null; else
|
||||||
if($v=='1') $v=true; else
|
if($v=='1') $v=true; else
|
||||||
if($v=='0') $v=false;
|
if($v=='0') $v=false;
|
||||||
}else
|
}else
|
||||||
if($t=='string' || $t=='dateTime' || $t=='date')
|
if($t=='string' || $t=='dateTime' || $t=='date'){
|
||||||
{ if($v=='') $v=null;
|
if($v=='') $v=null;
|
||||||
}
|
}
|
||||||
return $v;
|
return $v;
|
||||||
}
|
}
|
||||||
@ -150,14 +155,14 @@
|
|||||||
//Функция для перевода текста без применения GetText
|
//Функция для перевода текста без применения GetText
|
||||||
function __($text)
|
function __($text)
|
||||||
{
|
{
|
||||||
global $db,$lng;
|
global $db,$lng,$Schema;
|
||||||
|
|
||||||
$language_id=1;
|
$language_id=1;
|
||||||
if($lng=='kz') $language_id=2;
|
if($lng=='kz') $language_id=2;
|
||||||
if($lng=='en') $language_id=3;
|
if($lng=='en') $language_id=3;
|
||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
$sql='select translation from main._translations where del=false and language_id='.$language_id.' and identifier=\''.$text.'\';';
|
$sql='select translation from '.$Schema.'_translations where del=false and language_id='.$language_id.' and identifier=\''.$text.'\';';
|
||||||
$res = NULL;
|
$res = NULL;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -213,14 +218,24 @@
|
|||||||
}
|
}
|
||||||
set_exception_handler('special_handler'); //чтоб не пойманные исключения посылались в виде XML
|
set_exception_handler('special_handler'); //чтоб не пойманные исключения посылались в виде XML
|
||||||
|
|
||||||
|
//Схема базы по умолчанияю
|
||||||
|
if(!isset($Schema)) {
|
||||||
|
$Schema="";
|
||||||
|
}
|
||||||
|
//Тип идентификаторов
|
||||||
|
$idType="object";
|
||||||
|
if(!isset($idType)) {
|
||||||
|
$idType="object";
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(strpos($db_connstr, 'sqlite')!==false)
|
if(strpos($db_connection, 'sqlite')!==false)
|
||||||
{
|
{
|
||||||
$db = new PDO($db_connstr);
|
$db = new PDO($db_connection);
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
$db = new PDO($db_connstr, $db_login, $db_password);
|
$db = new PDO($db_connection, $db_login, $db_password);
|
||||||
}
|
}
|
||||||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
} catch (Exception $e)
|
} catch (Exception $e)
|
||||||
@ -228,16 +243,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Пытаемся автоматически залогинется по GUID из COOKIE
|
//Пытаемся автоматически залогинется по GUID из COOKIE
|
||||||
if($_SESSION['USER_ID']==null && $_COOKIE['GUID']!=null)
|
/*if($_SESSION['USER_ID']==null && $_COOKIE['GUID']!=null)
|
||||||
{
|
{
|
||||||
$res = $db->query("select * from main.p__Login(null,null,null,'".$_COOKIE['GUID']."');");
|
$res = $db->query("select * from ".$Schema."p__Login(null,null,null,'".$_COOKIE['GUID']."');");
|
||||||
//$res = $db->query("select * from \"p__Login_1\"(null,null,null,'".$_COOKIE['GUID']."');");
|
//$res = $db->query("select * from \"p__Login_1\"(null,null,null,'".$_COOKIE['GUID']."');");
|
||||||
if($res->rowCount()>0)
|
if($res->rowCount()>0)
|
||||||
{
|
{
|
||||||
$result = $res->fetch(PDO::FETCH_ASSOC);
|
$result = $res->fetch(PDO::FETCH_ASSOC);
|
||||||
$_SESSION['USER_ID']=$result['id'];
|
$_SESSION['USER_ID']=$result['id'];
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
$fn=filter_input(INPUT_GET, 'fn', FILTER_VALIDATE_INT, array('options'=>array('default'=>-1)));
|
$fn=filter_input(INPUT_GET, 'fn', FILTER_VALIDATE_INT, array('options'=>array('default'=>-1)));
|
||||||
$reqid=0; //id запроса "уникальный".
|
$reqid=0; //id запроса "уникальный".
|
||||||
@ -283,7 +298,7 @@
|
|||||||
$name=findFirstNode($reqNode, "type")->getAttribute("n");
|
$name=findFirstNode($reqNode, "type")->getAttribute("n");
|
||||||
|
|
||||||
$xmls='';
|
$xmls='';
|
||||||
$sql='select xml from main._metadata where del=false and name=\''.$name.'\';';
|
$sql='select xml from '.$Schema.'_metadata where del=false and name=\''.$name.'\';';
|
||||||
$resX = $db->query($sql);
|
$resX = $db->query($sql);
|
||||||
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
{
|
{
|
||||||
@ -309,7 +324,7 @@
|
|||||||
//$allow=true;
|
//$allow=true;
|
||||||
$allow=false;
|
$allow=false;
|
||||||
//$sql_query='select a.*,at.name from "_Access" a, "_Actions" at where a.del=false and at.id=a.action_id and at.name=\'Insert_'.$name.'\' and a.group_id in (select group_id from "_UsersGroups" where user_id='.$_SESSION['USER_ID'].');'
|
//$sql_query='select a.*,at.name from "_Access" a, "_Actions" at where a.del=false and at.id=a.action_id and at.name=\'Insert_'.$name.'\' and a.group_id in (select group_id from "_UsersGroups" where user_id='.$_SESSION['USER_ID'].');'
|
||||||
$sql_query='select main.p_getaccess('.getSQLValue(gettype($_SESSION['USER_ID']),$_SESSION['USER_ID']).',\'Insert_'.$name.'\') as allow;';
|
$sql_query='select '.$Schema.'p_getaccess('.getSQLValue(gettype($_SESSION['USER_ID']),$_SESSION['USER_ID']).',\'Insert_'.$name.'\') as allow;';
|
||||||
|
|
||||||
$res = $db->query($sql_query);
|
$res = $db->query($sql_query);
|
||||||
while ($row = $res->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($row = $res->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
@ -322,7 +337,7 @@
|
|||||||
|
|
||||||
$allow=false;
|
$allow=false;
|
||||||
//$sql_query='select a.*,at.name from "_Access" a, "_Actions" at where a.del=false and at.id=a.action_id and at.name=\'Update_'.$name.'\' and a.group_id in (select group_id from "_UsersGroups" where user_id='.$_SESSION['USER_ID'].');';
|
//$sql_query='select a.*,at.name from "_Access" a, "_Actions" at where a.del=false and at.id=a.action_id and at.name=\'Update_'.$name.'\' and a.group_id in (select group_id from "_UsersGroups" where user_id='.$_SESSION['USER_ID'].');';
|
||||||
$sql_query='select main.p_getaccess('.getSQLValue(gettype($_SESSION['USER_ID']),$_SESSION['USER_ID']).',\'Update_'.$name.'\') as allow;';
|
$sql_query='select '.$Schema.'p_getaccess('.getSQLValue(gettype($_SESSION['USER_ID']),$_SESSION['USER_ID']).',\'Update_'.$name.'\') as allow;';
|
||||||
$res = $db->query($sql_query);
|
$res = $db->query($sql_query);
|
||||||
while ($row = $res->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($row = $res->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
{
|
{
|
||||||
@ -334,7 +349,7 @@
|
|||||||
|
|
||||||
$allow=false;
|
$allow=false;
|
||||||
//$sql_query='select a.*,at.name from "_Access" a, "_Actions" at where a.del=false and at.id=a.action_id and at.name=\'Delete_'.$name.'\' and a.group_id in (select group_id from "_UsersGroups" where user_id='.$_SESSION['USER_ID'].');';
|
//$sql_query='select a.*,at.name from "_Access" a, "_Actions" at where a.del=false and at.id=a.action_id and at.name=\'Delete_'.$name.'\' and a.group_id in (select group_id from "_UsersGroups" where user_id='.$_SESSION['USER_ID'].');';
|
||||||
$sql_query='select main.p_getaccess('.getSQLValue(gettype($_SESSION['USER_ID']),$_SESSION['USER_ID']).',\'Delete_'.$name.'\') as allow;';
|
$sql_query='select '.$Schema.'p_getaccess('.getSQLValue(gettype($_SESSION['USER_ID']),$_SESSION['USER_ID']).',\'Delete_'.$name.'\') as allow;';
|
||||||
$res = $db->query($sql_query);
|
$res = $db->query($sql_query);
|
||||||
while ($row = $res->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($row = $res->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
{
|
{
|
||||||
@ -372,7 +387,7 @@
|
|||||||
$typename=findFirstNode($reqNode,"type")->getAttribute("n");
|
$typename=findFirstNode($reqNode,"type")->getAttribute("n");
|
||||||
|
|
||||||
$xmls='';
|
$xmls='';
|
||||||
$resX = $db->query('select xml from main._metadata where del=false and name=\''.$typename.'\';');
|
$resX = $db->query('select xml from '.$Schema.'_metadata where del=false and name=\''.$typename.'\';');
|
||||||
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
{
|
{
|
||||||
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
||||||
@ -493,7 +508,7 @@
|
|||||||
$node_properties=findFirstNode($nodeType,"properties");
|
$node_properties=findFirstNode($nodeType,"properties");
|
||||||
|
|
||||||
$xmls='';
|
$xmls='';
|
||||||
$resX = $db->query('select xml from main._metadata where del=false and name=\''.$typename.'\';');
|
$resX = $db->query('select xml from '.$Schema.'_metadata where del=false and name=\''.$typename.'\';');
|
||||||
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
{
|
{
|
||||||
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
||||||
@ -617,7 +632,7 @@
|
|||||||
$obj_id=$nodeType->getAttribute("id");
|
$obj_id=$nodeType->getAttribute("id");
|
||||||
|
|
||||||
$xmls='';
|
$xmls='';
|
||||||
$resX = $db->query('select xml from main._metadata where del=false and name=\''.$typename.'\';');
|
$resX = $db->query('select xml from '.$Schema.'_metadata where del=false and name=\''.$typename.'\';');
|
||||||
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
{
|
{
|
||||||
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
||||||
@ -672,7 +687,7 @@
|
|||||||
$pagepos=$nTypeR->getAttribute("pp"); //текущяя страница page pos
|
$pagepos=$nTypeR->getAttribute("pp"); //текущяя страница page pos
|
||||||
|
|
||||||
$xmls='';
|
$xmls='';
|
||||||
$resX = $db->query('select xml from main._metadata where del=false and name=\''.$typename.'\';');
|
$resX = $db->query('select xml from '.$Schema.'_metadata where del=false and name=\''.$typename.'\';');
|
||||||
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
{
|
{
|
||||||
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
||||||
@ -839,7 +854,7 @@
|
|||||||
$idval=$node->getAttribute("id"); //Значение идентификатора
|
$idval=$node->getAttribute("id"); //Значение идентификатора
|
||||||
|
|
||||||
$xmls='';
|
$xmls='';
|
||||||
$resX = $db->query('select xml from main._metadata where del=false and name=\''.$typename.'\';');
|
$resX = $db->query('select xml from '.$Schema.'_metadata where del=false and name=\''.$typename.'\';');
|
||||||
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
{
|
{
|
||||||
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
||||||
@ -877,13 +892,13 @@
|
|||||||
} catch (Exception $e)
|
} catch (Exception $e)
|
||||||
{ sendError($e->getMessage());
|
{ sendError($e->getMessage());
|
||||||
}
|
}
|
||||||
if(strpos($db_connstr, 'sqlite')===false) //Для SQLite не работает rowCount()
|
if(strpos($db_connection, 'sqlite')===false) //Для SQLite не работает rowCount()
|
||||||
{
|
{
|
||||||
if($res->rowCount()!=1) sendError("Количество записей не равно одному!");
|
if($res->rowCount()!=1) sendError("Количество записей не равно одному!");
|
||||||
}
|
}
|
||||||
|
|
||||||
$xmls='';
|
$xmls='';
|
||||||
$resX = $db->query('select xml from main._metadata where del=false and name=\''.$typename.'\';');
|
$resX = $db->query('select xml from '.$Schema.'_metadata where del=false and name=\''.$typename.'\';');
|
||||||
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
{
|
{
|
||||||
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
||||||
@ -955,7 +970,7 @@
|
|||||||
//if($propid==-1 || $propid=='') $propid='NULL';
|
//if($propid==-1 || $propid=='') $propid='NULL';
|
||||||
|
|
||||||
$xmls='';
|
$xmls='';
|
||||||
$resX = $db->query('select xml from main._metadata where del=false and name=\''.$typename.'\';');
|
$resX = $db->query('select xml from '.$Schema.'_metadata where del=false and name=\''.$typename.'\';');
|
||||||
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
{
|
{
|
||||||
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
||||||
@ -1051,7 +1066,7 @@
|
|||||||
}elseif($cmd==1) //Logout
|
}elseif($cmd==1) //Logout
|
||||||
{
|
{
|
||||||
//filter_input(INPUT_COOKIE, 'S_HASH', FILTER_VALIDATE_INT, array('options'=>array('default'=>-1)));
|
//filter_input(INPUT_COOKIE, 'S_HASH', FILTER_VALIDATE_INT, array('options'=>array('default'=>-1)));
|
||||||
$sql='delete from main._Logins where sessionid='.getSQLValue('string',$_COOKIE['GUID']).' and user_id='.getSQLValue('i4',$_SESSION['USER_ID']).';';
|
$sql='delete from '.$Schema.'_Logins where sessionid='.getSQLValue('string',$_COOKIE['GUID']).' and user_id='.getSQLValue('object',$_SESSION['USER_ID']).';';
|
||||||
try
|
try
|
||||||
{ $db->exec($sql);
|
{ $db->exec($sql);
|
||||||
} catch (Exception $e)
|
} catch (Exception $e)
|
||||||
@ -1082,7 +1097,7 @@
|
|||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
$xs.=' <![CDATA[1]]><cmd><![CDATA['.$cmd.']]></cmd>'."\n";
|
$xs.=' <![CDATA[1]]><cmd><![CDATA['.$cmd.']]></cmd>'."\n";
|
||||||
$res = $db->query('select * from main.p__Login('.getSQLValue('i4',$_SESSION['USER_ID']).',null,null,null,null,null);');
|
$res = $db->query('select * from '.$Schema.'p__Login('.getSQLValue($idType,$_SESSION['USER_ID']).',null,null,null,null,null);');
|
||||||
if($row = $res->fetch(PDO::FETCH_ASSOC))
|
if($row = $res->fetch(PDO::FETCH_ASSOC))
|
||||||
{
|
{
|
||||||
$xs.=' <name><![CDATA['.$row['name'].']]></name>'."\n";
|
$xs.=' <name><![CDATA['.$row['name'].']]></name>'."\n";
|
||||||
@ -1103,7 +1118,7 @@
|
|||||||
$name='';
|
$name='';
|
||||||
$surname='';
|
$surname='';
|
||||||
$patronymic='';
|
$patronymic='';
|
||||||
$sql="select * from main.p__Login(".getSQLValue('i4',$_SESSION['USER_ID']).",'$login','$password',null,null,null);";
|
$sql="select * from ".$Schema."p__Login(".getSQLValue($idType,$_SESSION['USER_ID']).",'$login','$password',null,null,null);";
|
||||||
$res = $db->query($sql);
|
$res = $db->query($sql);
|
||||||
if($res->rowCount()>0)
|
if($res->rowCount()>0)
|
||||||
{ $result = $res->fetch(PDO::FETCH_ASSOC);
|
{ $result = $res->fetch(PDO::FETCH_ASSOC);
|
||||||
@ -1139,7 +1154,7 @@
|
|||||||
|
|
||||||
//Выбираем информацию о текущем пользователе
|
//Выбираем информацию о текущем пользователе
|
||||||
$name='';
|
$name='';
|
||||||
$sql="select Coalesce(surname,'') || ' ' || Coalesce(name,'') || ' ' || Coalesce(patronymic,'') as name from main._users where id=".$_SESSION['USER_ID'].";";
|
$sql="select Coalesce(surname,'') || ' ' || Coalesce(name,'') || ' ' || Coalesce(patronymic,'') as name from ".$Schema."_users where id=".$_SESSION['USER_ID'].";";
|
||||||
$res = $db->query($sql);
|
$res = $db->query($sql);
|
||||||
if($res->rowCount()>0)
|
if($res->rowCount()>0)
|
||||||
{ $result = $res->fetch(PDO::FETCH_ASSOC);
|
{ $result = $res->fetch(PDO::FETCH_ASSOC);
|
||||||
@ -1152,7 +1167,7 @@
|
|||||||
$ext=$nTypeR->getAttribute("ext");
|
$ext=$nTypeR->getAttribute("ext");
|
||||||
|
|
||||||
$xmls='';
|
$xmls='';
|
||||||
$resX = $db->query('select xml from main._metadata where del=false and name=\''.$typename.'\';');
|
$resX = $db->query('select xml from '.$Schema.'_metadata where del=false and name=\''.$typename.'\';');
|
||||||
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
{
|
{
|
||||||
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
||||||
@ -1409,7 +1424,7 @@
|
|||||||
$idval = $_REQUEST['i']; //Идентификатор поля в базе
|
$idval = $_REQUEST['i']; //Идентификатор поля в базе
|
||||||
|
|
||||||
$xmls='';
|
$xmls='';
|
||||||
$resX = $db->query('select xml from main._metadata where del=false and name=\''.$typename.'\';');
|
$resX = $db->query('select xml from '.$Schema.'_metadata where del=false and name=\''.$typename.'\';');
|
||||||
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
while ($rowX = $resX->fetch(PDO::FETCH_ASSOC))// $row - ассоциативный массив значений, ключи - названия столбцов
|
||||||
{
|
{
|
||||||
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
$xmls='<?xml version="1.0" encoding="UTF-8"?><metadata>'.parseGT($rowX['xml']).'</metadata>';
|
||||||
@ -1437,7 +1452,7 @@
|
|||||||
|
|
||||||
if($fnode->getAttribute("vt")=="blob") //Отправить файл клиенту из базы данных
|
if($fnode->getAttribute("vt")=="blob") //Отправить файл клиенту из базы данных
|
||||||
{
|
{
|
||||||
$stmt = $db->prepare("SELECT \"$field\",length(\"$field\"),substring(\"$name\", position('_' IN \"$name\")+1) as name FROM main.\"$typename\" WHERE id='$idval'");
|
$stmt = $db->prepare("SELECT \"$field\",length(\"$field\"),substring(\"$name\", position('_' IN \"$name\")+1) as name FROM $Schema\"$typename\" WHERE id='$idval'");
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$stmt->bindColumn(1, $blob, PDO::PARAM_LOB);
|
$stmt->bindColumn(1, $blob, PDO::PARAM_LOB);
|
||||||
$stmt->bindColumn(2, $size, PDO::PARAM_INT);
|
$stmt->bindColumn(2, $size, PDO::PARAM_INT);
|
||||||
|
|||||||
@ -146,7 +146,7 @@ class SRec
|
|||||||
let str='\
|
let str='\
|
||||||
<div id="eDiv'+this.uid+'" style="width: 100%; height: 100%; position: relative;">\
|
<div id="eDiv'+this.uid+'" style="width: 100%; height: 100%; position: relative;">\
|
||||||
<table class="SFilter" border="0" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%;"><tr><td>\
|
<table class="SFilter" border="0" cellspacing="0" cellpadding="0" 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="whitesmoke">\
|
<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><thead></thead><tbody></tbody>\
|
||||||
</table>\
|
</table>\
|
||||||
</td></tr><tr><td>\
|
</td></tr><tr><td>\
|
||||||
@ -173,7 +173,7 @@ class SRec
|
|||||||
if(htmlElement==null || typeof(htmlElement) == "undefined")
|
if(htmlElement==null || typeof(htmlElement) == "undefined")
|
||||||
{
|
{
|
||||||
this.win=new TWin();
|
this.win=new TWin();
|
||||||
this.win.TWin(pageX-10,pageY-10);
|
this.win.BuildGUI(pageX-10,pageY-10);
|
||||||
this.win.setHeight(400);
|
this.win.setHeight(400);
|
||||||
//this.win.setLeftTop()
|
//this.win.setLeftTop()
|
||||||
|
|
||||||
@ -332,20 +332,21 @@ class SRec
|
|||||||
id=nodeProp.getAttribute("id");
|
id=nodeProp.getAttribute("id");
|
||||||
value=findFirstNode(nodeProp, '#cdata-section').nodeValue;
|
value=findFirstNode(nodeProp, '#cdata-section').nodeValue;
|
||||||
prop.value=id;
|
prop.value=id;
|
||||||
propvis=document.getElementById('filter_'+this.uid+'_'+prop_id+'_visible');
|
let propvis=document.getElementById('filter_'+this.uid+'_'+prop_id+'_visible');
|
||||||
propvis.value=value;
|
propvis.value=value;
|
||||||
propvis.select();
|
propvis.select();
|
||||||
}else
|
}else
|
||||||
if(count>1) //The item selection window is displayed.
|
if(count>1) //The item selection window is displayed.
|
||||||
{
|
{
|
||||||
let htmlString='<table width="100%" bgcolor="whitesmoke">';
|
let htmlString='<table width="100%" bgcolor="'+g_rowColor2+'">';
|
||||||
nodeProp=nodeType.firstChild
|
nodeProp=nodeType.firstChild
|
||||||
i=0;
|
i=0;
|
||||||
while (nodeProp!=null)
|
while (nodeProp!=null)
|
||||||
{
|
{
|
||||||
if (nodeProp.nodeName=="record")
|
if (nodeProp.nodeName=="record")
|
||||||
{
|
{
|
||||||
if (i%2==0) bgColor='white'; else bgColor='#e0e0e0';
|
let bgColor='#e0e0e0';
|
||||||
|
if (i%2==0) bgColor='white';
|
||||||
id=nodeProp.getAttribute("id");
|
id=nodeProp.getAttribute("id");
|
||||||
value=getCdataValue(nodeProp);
|
value=getCdataValue(nodeProp);
|
||||||
value=value.replace(/"/g, """); value=value.replace(/'/g, "\\'");
|
value=value.replace(/"/g, """); value=value.replace(/'/g, "\\'");
|
||||||
@ -357,7 +358,7 @@ class SRec
|
|||||||
htmlString+='</table>';
|
htmlString+='</table>';
|
||||||
|
|
||||||
let win=new TWin();
|
let win=new TWin();
|
||||||
win.TWin(pageX-10,pageY-10);
|
win.BuildGUI(pageX-10,pageY-10);
|
||||||
win.setHeight(400);
|
win.setHeight(400);
|
||||||
win.setContent(htmlString);
|
win.setContent(htmlString);
|
||||||
win.setCaption(document.createTextNode(_('Selection')));
|
win.setCaption(document.createTextNode(_('Selection')));
|
||||||
@ -370,8 +371,8 @@ class SRec
|
|||||||
//Set the value for the object filter with a text field search
|
//Set the value for the object filter with a text field search
|
||||||
setFilterVal(id,caption,prop_id)
|
setFilterVal(id,caption,prop_id)
|
||||||
{
|
{
|
||||||
prop=document.getElementById('filter_'+this.uid+'_'+prop_id);
|
let prop=document.getElementById('filter_'+this.uid+'_'+prop_id);
|
||||||
propvis=document.getElementById('filter_'+this.uid+'_'+prop_id+'_visible');
|
let propvis=document.getElementById('filter_'+this.uid+'_'+prop_id+'_visible');
|
||||||
if ((prop!=null)&&(propvis!=null))
|
if ((prop!=null)&&(propvis!=null))
|
||||||
{
|
{
|
||||||
prop.value=id;
|
prop.value=id;
|
||||||
@ -735,6 +736,7 @@ class SRec
|
|||||||
newCell1.appendChild( input );
|
newCell1.appendChild( input );
|
||||||
|
|
||||||
let button = document.createElement('input');
|
let button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","+");
|
button.setAttribute("value","+");
|
||||||
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
|
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
|
||||||
@ -742,6 +744,7 @@ class SRec
|
|||||||
button.onclick=function(inp){return function(){ inp.value=getIntVal(inp.value)+1; }}(input);
|
button.onclick=function(inp){return function(){ inp.value=getIntVal(inp.value)+1; }}(input);
|
||||||
|
|
||||||
button = document.createElement('input');
|
button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","-");
|
button.setAttribute("value","-");
|
||||||
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
|
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
|
||||||
@ -792,6 +795,7 @@ class SRec
|
|||||||
newCell1.appendChild(select);
|
newCell1.appendChild(select);
|
||||||
|
|
||||||
let button = document.createElement('input');
|
let button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","...");
|
button.setAttribute("value","...");
|
||||||
button.style.cssText="display:block; box-sizing: border-box; margin: 0px; padding: 0px;width:100%; height:100%; font-size: 9pt;";
|
button.style.cssText="display:block; box-sizing: border-box; margin: 0px; padding: 0px;width:100%; height:100%; font-size: 9pt;";
|
||||||
@ -860,6 +864,7 @@ class SRec
|
|||||||
newCell1.appendChild(hidden);
|
newCell1.appendChild(hidden);
|
||||||
|
|
||||||
let button = document.createElement('input');
|
let button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","...");
|
button.setAttribute("value","...");
|
||||||
button.style.cssText="width:30px; height:100%;margin: 0px; padding: 0px;";
|
button.style.cssText="width:30px; height:100%;margin: 0px; padding: 0px;";
|
||||||
@ -894,6 +899,7 @@ class SRec
|
|||||||
td.setAttribute("align","right");
|
td.setAttribute("align","right");
|
||||||
|
|
||||||
let button = document.createElement('input');
|
let button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value",_("Filtering"));
|
button.setAttribute("value",_("Filtering"));
|
||||||
button.setAttribute("id","btnfilter_"+this.uid);
|
button.setAttribute("id","btnfilter_"+this.uid);
|
||||||
@ -944,7 +950,7 @@ class SRec
|
|||||||
let nodeFilter=findNodeOnPath(nodeType,"objects-list/filter");
|
let nodeFilter=findNodeOnPath(nodeType,"objects-list/filter");
|
||||||
if(nodeFilter!=null) //Create HTML elements by XML filter.
|
if(nodeFilter!=null) //Create HTML elements by XML filter.
|
||||||
{
|
{
|
||||||
columnNode=nodeFilter.firstChild;
|
let columnNode=nodeFilter.firstChild;
|
||||||
while (columnNode != null)
|
while (columnNode != null)
|
||||||
{
|
{
|
||||||
if (columnNode.nodeName==="column")
|
if (columnNode.nodeName==="column")
|
||||||
@ -1018,7 +1024,7 @@ class SRec
|
|||||||
let thetable = document.getElementById('thetable'+this.uid);
|
let thetable = document.getElementById('thetable'+this.uid);
|
||||||
delChild(thetable.tHead);
|
delChild(thetable.tHead);
|
||||||
let tr=document.createElement('tr');
|
let tr=document.createElement('tr');
|
||||||
tr.style.cssText='background-color: #dadada;';
|
tr.style.cssText='background-color: var(--header-color);';
|
||||||
let th=document.createElement('th');
|
let th=document.createElement('th');
|
||||||
th.appendChild( document.createTextNode('№'));
|
th.appendChild( document.createTextNode('№'));
|
||||||
th.style.cssText='width: 1%;';
|
th.style.cssText='width: 1%;';
|
||||||
@ -1027,8 +1033,8 @@ class SRec
|
|||||||
th.appendChild( document.createTextNode('Del'));
|
th.appendChild( document.createTextNode('Del'));
|
||||||
th.title = _('Invert_selection');
|
th.title = _('Invert_selection');
|
||||||
th.style.cssText='width: 1%; cursor: pointer; text-decoration: underline;';
|
th.style.cssText='width: 1%; cursor: pointer; text-decoration: underline;';
|
||||||
th.onmouseover=function(){ this.style.backgroundColor='#C2D7FC'; };
|
th.onmouseover=function(){ this.style.backgroundColor=g_rowColor2; };
|
||||||
th.onmouseout=function(){ this.style.backgroundColor='#dadada'; };
|
th.onmouseout=function(){ this.style.backgroundColor='var(--header-color)'; };
|
||||||
th.onclick=function(thiz){return function(){ for(let i=0;i<thiz.masChBox.length;i++){ if(!thiz.masChBox[i].disabled) thiz.masChBox[i].checked = ! thiz.masChBox[i].checked; }};}(this);
|
th.onclick=function(thiz){return function(){ for(let i=0;i<thiz.masChBox.length;i++){ if(!thiz.masChBox[i].disabled) thiz.masChBox[i].checked = ! thiz.masChBox[i].checked; }};}(this);
|
||||||
tr.appendChild(th);
|
tr.appendChild(th);
|
||||||
|
|
||||||
@ -1152,7 +1158,7 @@ class SRec
|
|||||||
{
|
{
|
||||||
let bgColor='';
|
let bgColor='';
|
||||||
let i=theTable.rows.length; //number of rows in the table
|
let i=theTable.rows.length; //number of rows in the table
|
||||||
if (i%2==0) bgColor='white'; else bgColor='whitesmoke';
|
if (i%2==0) bgColor=g_rowColor1; else bgColor=g_rowColor2;
|
||||||
|
|
||||||
if(nColor>=0) //Color from Result
|
if(nColor>=0) //Color from Result
|
||||||
{ bgColorT=findNodeOnNum(nodeRecord,"#cdata-section",nColor).nodeValue;
|
{ bgColorT=findNodeOnNum(nodeRecord,"#cdata-section",nColor).nodeValue;
|
||||||
@ -1430,7 +1436,7 @@ class SRec
|
|||||||
if(this.rwin!=null) this.rwin.Close();
|
if(this.rwin!=null) this.rwin.Close();
|
||||||
|
|
||||||
this.rwin=new TWin();
|
this.rwin=new TWin();
|
||||||
this.rwin.TWin(pageX-10,pageY-10);
|
this.rwin.BuildGUI(pageX-10,pageY-10);
|
||||||
this.rwin.setParent(this.win);
|
this.rwin.setParent(this.win);
|
||||||
this.rwin.setSize(280,130);
|
this.rwin.setSize(280,130);
|
||||||
this.rwin.setCaption(_('Report'));
|
this.rwin.setCaption(_('Report'));
|
||||||
@ -1526,8 +1532,8 @@ class SRec
|
|||||||
//Update HTML data after update record
|
//Update HTML data after update record
|
||||||
ApplyDelRec(node)
|
ApplyDelRec(node)
|
||||||
{
|
{
|
||||||
nodeType=findFirstNode(node, "type");
|
let nodeType=findFirstNode(node, "type");
|
||||||
typeName=nodeType.getAttribute("n");
|
let typeName=nodeType.getAttribute("n");
|
||||||
id=nodeType.getAttribute("id");
|
id=nodeType.getAttribute("id");
|
||||||
deleteHTML(id+'_'+this.uid);
|
deleteHTML(id+'_'+this.uid);
|
||||||
//Rebuild sequential numbering of rows (first column)
|
//Rebuild sequential numbering of rows (first column)
|
||||||
|
|||||||
@ -1,7 +1,13 @@
|
|||||||
|
|
||||||
class tcTab
|
class tcTab
|
||||||
{
|
{
|
||||||
constructor(caption){
|
constructor(config){
|
||||||
|
|
||||||
|
this.bColor="";
|
||||||
|
|
||||||
|
|
||||||
|
if(typeof config.float == 'undefined'){ config.float='left'; }
|
||||||
|
|
||||||
this.id=0;
|
this.id=0;
|
||||||
this.par=null;
|
this.par=null;
|
||||||
this.sel=false;
|
this.sel=false;
|
||||||
@ -10,12 +16,12 @@ class tcTab
|
|||||||
|
|
||||||
//Сам таб на который нажимаем (ушко)
|
//Сам таб на который нажимаем (ушко)
|
||||||
this.div=document.createElement('div')
|
this.div=document.createElement('div')
|
||||||
this.div.style.cssText='position: relative; top: 1px; cursor: pointer; float: left; border: 1px solid #b3b3b3; border-radius: 5px 5px 0px 0px; padding: 1px; padding-right: 4px; padding-left: 4px; margin-left: 2px; margin-right: 2px;'
|
this.div.style.cssText='position: relative; top: 1px; cursor: pointer; float: '+config.float+'; border: 1px solid #b3b3b3; border-radius: 5px 5px 0px 0px; padding: 1px; padding-right: 4px; padding-left: 4px; margin-left: 2px; margin-right: 2px;'
|
||||||
this.div.style.background = '#dfdfdf';
|
this.div.style.background = g_backColor1;
|
||||||
this.div.innerHTML=caption;
|
this.div.innerHTML=config.caption;
|
||||||
|
|
||||||
this.div.onmouseover=function(obj){return function(){ if(!obj.sel) obj.div.style.background = '#f0f0f0';}}(this);
|
this.div.onmouseover=function(obj){return function(){ if(!obj.sel) obj.div.style.background = g_rowColor1; }}(this);
|
||||||
this.div.onmouseout=function(obj){return function(){ if(!obj.sel) obj.div.style.background = '#dfdfdf' }}(this);
|
this.div.onmouseout=function(obj){return function(){ if(!obj.sel) obj.div.style.background = g_backColor1; }}(this);
|
||||||
this.div.onclick=function(obj){return function(){ obj.setSel(); if(obj.href!='') goToURL(obj.href); }}(this)
|
this.div.onclick=function(obj){return function(){ obj.setSel(); if(obj.href!='') goToURL(obj.href); }}(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,12 +50,12 @@ class tcTab
|
|||||||
setSel()
|
setSel()
|
||||||
{
|
{
|
||||||
for(let i=0;i<this.par.tbs.length;i++)
|
for(let i=0;i<this.par.tbs.length;i++)
|
||||||
{ this.par.tbs[i].div.style.background = '#dfdfdf'
|
{ this.par.tbs[i].div.style.background = g_backColor1;
|
||||||
this.par.tbs[i].div.style.borderBottom = "1px solid #b3b3b3"
|
this.par.tbs[i].div.style.borderBottom = "1px solid #b3b3b3"
|
||||||
this.par.tbs[i].sel=false
|
this.par.tbs[i].sel=false
|
||||||
this.par.tbs[i].con.style.display='none'
|
this.par.tbs[i].con.style.display='none'
|
||||||
}
|
}
|
||||||
this.div.style.background = '#ffffff';
|
this.div.style.background = g_rowColor2;
|
||||||
this.div.style.borderBottom = '1px solid #ffffff'
|
this.div.style.borderBottom = '1px solid #ffffff'
|
||||||
//this.con.style.display='inline'
|
//this.con.style.display='inline'
|
||||||
this.con.style.display='block';
|
this.con.style.display='block';
|
||||||
@ -74,7 +80,7 @@ class tcTabs
|
|||||||
tr.style.cssText='display: table-row; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;'
|
tr.style.cssText='display: table-row; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;'
|
||||||
|
|
||||||
this.btt=document.createElement('div');
|
this.btt=document.createElement('div');
|
||||||
this.btt.style.cssText='display: table-cell; width :100%; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;'
|
this.btt.style.cssText='display: table-cell; width :100%; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;background-color: '+g_backColor2+';color:'+g_textColor1+';';
|
||||||
tr.appendChild(this.btt);
|
tr.appendChild(this.btt);
|
||||||
this.wra.appendChild(tr);
|
this.wra.appendChild(tr);
|
||||||
|
|
||||||
@ -91,9 +97,9 @@ class tcTabs
|
|||||||
this.bd.appendChild(this.wra);
|
this.bd.appendChild(this.wra);
|
||||||
}
|
}
|
||||||
|
|
||||||
addTab(caption)
|
addTab(config)
|
||||||
{
|
{
|
||||||
var tab=new tcTab(caption)
|
var tab=new tcTab(config)
|
||||||
tab.par=this
|
tab.par=this
|
||||||
this.btt.appendChild(tab.div);
|
this.btt.appendChild(tab.div);
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,41 @@
|
|||||||
//Copyright (C) Ivanov I.M. irigm@mail.ru
|
//Copyright (C) Ivanov I.M. irigm@mail.ru
|
||||||
|
|
||||||
|
//Расширить плитку чтобы она занимала всю штртну области
|
||||||
|
function resizeDivTile(parent,minWidth)
|
||||||
|
{
|
||||||
|
if(typeof parent == 'string') parent=document.getElementById(parent);
|
||||||
|
if(parent==null) return;
|
||||||
|
var margin=2; //С права и слева по одному пикселю то получается два
|
||||||
|
var dx=Math.floor(parent.offsetWidth/(minWidth+margin));
|
||||||
|
|
||||||
|
//console.log("parent.offsetWidth="+parent.offsetWidth+" minWidth="+minWidth+" margin="+margin+" dx="+dx);
|
||||||
|
|
||||||
|
var addW=0;
|
||||||
|
for(var i=0;i<minWidth+margin+2;i++)
|
||||||
|
{
|
||||||
|
if(dx>=parent.offsetWidth/(minWidth+margin+i))
|
||||||
|
{
|
||||||
|
addW=i-1;
|
||||||
|
console.log("addW="+addW+" parent.offsetWidth/(minWidth+margin+i)="+(parent.offsetWidth/(minWidth+margin+i)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var i = 0; i < parent.children.length; i++) {
|
||||||
|
//console.log(parent.children[i].tagName);
|
||||||
|
if(parent.children[i].tagName.toUpperCase()=='DIV')
|
||||||
|
{
|
||||||
|
parent.children[i].style.width = (minWidth+addW)+"px";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//console.log("minWidth+addW="+(minWidth+addW));
|
||||||
|
|
||||||
|
//Центрирую, путем добавления пространства с права
|
||||||
|
parent.style.paddingLeft = Math.floor((parent.offsetWidth-(dx*(minWidth+margin+addW)))/2) + "px";
|
||||||
|
|
||||||
|
//console.log("parent.style.paddingLeft="+parent.style.paddingLeft+" calc="+(Math.floor((parent.offsetWidth-(dx*(minWidth+margin+addW)))/2)));
|
||||||
|
}
|
||||||
|
|
||||||
//Получить уникальный идентификатор из глобальной переменной
|
//Получить уникальный идентификатор из глобальной переменной
|
||||||
var UID=0;
|
var UID=0;
|
||||||
function getUID()
|
function getUID()
|
||||||
@ -999,6 +1035,7 @@ class TWin
|
|||||||
constructor(dialog)
|
constructor(dialog)
|
||||||
{
|
{
|
||||||
this.dialog=dialog; //Показывать окно как диалог (без возможности изменения размеров)
|
this.dialog=dialog; //Показывать окно как диалог (без возможности изменения размеров)
|
||||||
|
this.disableClosing=false;
|
||||||
|
|
||||||
this.closed=false; //Закрыли (те. удалили из родителя и детей и из DOM)
|
this.closed=false; //Закрыли (те. удалили из родителя и детей и из DOM)
|
||||||
this.onClose=null; //слушатель закрытия окна
|
this.onClose=null; //слушатель закрытия окна
|
||||||
@ -1079,6 +1116,9 @@ class TWin
|
|||||||
|
|
||||||
Close() //Закрыть и удалить окно из родителя и менеджера
|
Close() //Закрыть и удалить окно из родителя и менеджера
|
||||||
{
|
{
|
||||||
|
if(this.disableClosing)
|
||||||
|
return;
|
||||||
|
|
||||||
this.hide(true);
|
this.hide(true);
|
||||||
this.setParent(null);
|
this.setParent(null);
|
||||||
for(var i=0;i<this.childs.length;i++) if(this.childs[i]!=null) this.childs[i].parent=null
|
for(var i=0;i<this.childs.length;i++) if(this.childs[i]!=null) this.childs[i].parent=null
|
||||||
@ -1096,7 +1136,7 @@ class TWin
|
|||||||
};
|
};
|
||||||
|
|
||||||
//Типа конструктор создать окно с заданой позицией
|
//Типа конструктор создать окно с заданой позицией
|
||||||
TWin(x,y)
|
BuildGUI(x,y)
|
||||||
{
|
{
|
||||||
this.tWinId=Wins.add(this);
|
this.tWinId=Wins.add(this);
|
||||||
/*
|
/*
|
||||||
@ -1158,7 +1198,7 @@ class TWin
|
|||||||
|
|
||||||
var str='';
|
var str='';
|
||||||
str+='<table id="TWin_TBL_'+this.tWinId+'" class="shadow" bgcolor="#f1f1f1" border="0px" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%; border: 1px solid #000000;">';
|
str+='<table id="TWin_TBL_'+this.tWinId+'" class="shadow" bgcolor="#f1f1f1" border="0px" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%; border: 1px solid #000000;">';
|
||||||
str+=' <tr id="TWin_H0_'+this.tWinId+'" style="background: url(../resources/metadata/dbms/form/g.gif) repeat-x;"><td></td><td><table cellspacing="0" cellpadding="0" 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="background: url(../resources/metadata/dbms/form/b_g.png) repeat-x;"><td></td><td><table cellspacing="0" cellpadding="0" 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/b_x.png" id="TWin_CL_'+this.tWinId+'" style="cursor:pointer;padding-right: 5px;"></td></tr></table></td><td></td></tr>';
|
||||||
str+=' <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="../resources/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="vertical-align:top;height: 5px;'+(!this.dialog ? ' cursor:n-resize;' : '')+'" id="TWin_T_'+this.tWinId+'"></td>';
|
||||||
@ -1249,10 +1289,10 @@ class TWin
|
|||||||
for(var i=0;i<Wins.mas.length;i++) if(Wins.mas[i]!=null)
|
for(var i=0;i<Wins.mas.length;i++) if(Wins.mas[i]!=null)
|
||||||
{
|
{
|
||||||
Wins.mas[i].sel=false;
|
Wins.mas[i].sel=false;
|
||||||
Wins.mas[i].ca.style.color="#555555";
|
Wins.mas[i].ca.style.color="#afafaf"; //555555
|
||||||
}
|
}
|
||||||
this.sel=true;
|
this.sel=true;
|
||||||
this.ca.style.color="black";
|
this.ca.style.color="#ffffff"; //black
|
||||||
this.setWinZ(true);
|
this.setWinZ(true);
|
||||||
}
|
}
|
||||||
//Получить значение Z индекса TODO сделать через геттер
|
//Получить значение Z индекса TODO сделать через геттер
|
||||||
|
|||||||
57
metadata/include/captcha.php
Normal file
57
metadata/include/captcha.php
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
@session_start();
|
||||||
|
//if(isset($_SESSION['REMOTE_ADDR']) && $_SESSION['REMOTE_ADDR'] != $_SERVER['REMOTE_ADDR']) unset($_SESSION["USER_ID"]); //Делаемся не авторизованным если зашли с другого ip адреса
|
||||||
|
if (isset($_REQUEST['id'])) $id = $_REQUEST['id']; else $id = '';
|
||||||
|
|
||||||
|
$width = 115; //Ширина изображения
|
||||||
|
$height = 40; //Высота изображения
|
||||||
|
$font_size = 14; //Размер шрифта
|
||||||
|
$let_amount = 5; //Количество символов, которые нужно набрать
|
||||||
|
$fon_let_amount = 40; //Количество символов, которые находятся на фоне
|
||||||
|
$path_fonts = getcwd().'/fonts/'; //Путь к шрифтам
|
||||||
|
|
||||||
|
//$letters = array('a','b','c','d','e','f','g','h','j','k','m','n','p','q','r','s','t','u','v','w','x','y','z','2','3','4','5','6','7','9');
|
||||||
|
$letters = array('0','1','2','3','4','5','6','7','8','9');
|
||||||
|
$colors = array('100','200','150','170','190','210','190','160','170','190','210');
|
||||||
|
|
||||||
|
$src = imagecreatetruecolor($width,$height);
|
||||||
|
$fon = imagecolorallocate($src,58,58,58);
|
||||||
|
imagefill($src,0,0,$fon);
|
||||||
|
|
||||||
|
$fonts = array();
|
||||||
|
$dir=opendir($path_fonts);
|
||||||
|
while($fontName = readdir($dir))
|
||||||
|
{
|
||||||
|
if($fontName != "." && $fontName != ".." && pathinfo($fontName, PATHINFO_EXTENSION)=='ttf')
|
||||||
|
{
|
||||||
|
$fonts[] = $fontName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($dir);
|
||||||
|
|
||||||
|
for($i=0;$i<$fon_let_amount;$i++)
|
||||||
|
{
|
||||||
|
$color = imagecolorallocatealpha($src,rand(0,255),rand(0,255),rand(0,255),100);
|
||||||
|
$font = $path_fonts.$fonts[rand(0,sizeof($fonts)-1)];
|
||||||
|
$letter = $letters[rand(0,sizeof($letters)-1)];
|
||||||
|
$size = rand($font_size-2,$font_size+2);
|
||||||
|
imagettftext($src,$size,rand(0,45),rand($width*0.1,$width-$width*0.1),rand($height*0.2,$height),$color,$font,$letter);
|
||||||
|
}
|
||||||
|
|
||||||
|
for($i=0;$i<$let_amount;$i++)
|
||||||
|
{
|
||||||
|
$color = imagecolorallocatealpha($src,$colors[rand(0,sizeof($colors)-1)],$colors[rand(0,sizeof($colors)-1)],$colors[rand(0,sizeof($colors)-1)],rand(20,40));
|
||||||
|
$font = $path_fonts.$fonts[rand(0,sizeof($fonts)-1)];
|
||||||
|
$letter = $letters[rand(0,sizeof($letters)-1)];
|
||||||
|
$size = rand($font_size*2.1-2,$font_size*2.1+2);
|
||||||
|
$x = ($i+0.9)*$font_size + rand(4,7);
|
||||||
|
$y = (($height*2.3)/3) + rand(0,5);
|
||||||
|
$cod[] = $letter;
|
||||||
|
imagettftext($src,$size,rand(0,15),$x,$y,$color,$font,$letter);
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION['secpic'.$id] = implode('',$cod);
|
||||||
|
|
||||||
|
header ("Content-type: image/gif");
|
||||||
|
imagegif($src);
|
||||||
|
?>
|
||||||
BIN
metadata/include/fonts/cour.ttf
Normal file
BIN
metadata/include/fonts/cour.ttf
Normal file
Binary file not shown.
Reference in New Issue
Block a user