+ Подробные коменты в не [[]]
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
//Copyright (C) Ivanov I.M. irigm@mail.ru +77051809750 file created in 2008
|
//Copyright (C) Ivanov I.M. file created in 2008
|
||||||
//For find non english chars: [^\x00-\x7F]+
|
//For find non english chars: [^\x00-\x7F]+
|
||||||
|
|
||||||
//Заглушки
|
//Заглушки
|
||||||
@ -1182,51 +1182,53 @@ class EdtRec
|
|||||||
};
|
};
|
||||||
|
|
||||||
applyReq(req,fn,node,xmldoc,win)
|
applyReq(req,fn,node,xmldoc,win)
|
||||||
{ //alert2(trt('Alert'),"erec XML=\n"+getXMLNodeSerialisation(node));
|
{
|
||||||
if (fn==-1)
|
this.hideProgressBar();
|
||||||
{
|
if (fn==-1) {
|
||||||
alert2(trt('Alert'),findFirstNode(node,'#cdata-section').nodeValue);
|
let fullText = findFirstNode(node,'#cdata-section').nodeValue;
|
||||||
//this.pBarCnt=0;
|
let smallText = '';
|
||||||
this.hideProgressBar();
|
let pos1=fullText.indexOf('[[');
|
||||||
}else
|
let pos2=fullText.indexOf(']]');
|
||||||
if (fn==0)
|
if(pos1>0 && pos2>0 && pos1<pos2) smallText=fullText.substring(pos1+2, pos2);
|
||||||
{
|
|
||||||
this.hideProgressBar();
|
if(fullText.indexOf("id456[[")>=0){ //Если есть идентификатор того что это перезапись
|
||||||
|
let okFunc=()=>{
|
||||||
|
this.setValue('seq',0);
|
||||||
|
this.sendData(); //Применить ещё раз
|
||||||
|
};
|
||||||
|
if (smallText != '')
|
||||||
|
confirm2(trt('Warning'),smallText, fullText, okFunc, null);
|
||||||
|
else
|
||||||
|
confirm2(trt('Warning'),smallText, '', okFunc, null);
|
||||||
|
}else {
|
||||||
|
if (smallText != '')
|
||||||
|
alert2(trt('Alert'), smallText, fullText);
|
||||||
|
else
|
||||||
|
alert2(trt('Alert'), fullText);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
if (fn==0) {
|
||||||
this.eRecNo(node,this.record_id);
|
this.eRecNo(node,this.record_id);
|
||||||
}else
|
} else
|
||||||
if (fn==1) //returned id
|
if (fn==1) { //returned id
|
||||||
{
|
|
||||||
this.hideProgressBar();
|
|
||||||
this.insertRows(node);
|
this.insertRows(node);
|
||||||
}else
|
} else
|
||||||
if (fn==2) //Returned id and type of updated record
|
if (fn==2) { //Returned id and type of updated record
|
||||||
{
|
|
||||||
this.hideProgressBar();
|
|
||||||
this.updateRows(node);
|
this.updateRows(node);
|
||||||
}else
|
} else
|
||||||
if (fn==3) //Returned id of deleted record
|
if (fn==3) { //Returned id of deleted record
|
||||||
{
|
|
||||||
this.hideProgressBar();
|
|
||||||
this.deleteRows(node);
|
this.deleteRows(node);
|
||||||
}else
|
} else
|
||||||
if (fn==5)
|
if (fn==5) {
|
||||||
{
|
|
||||||
this.hideProgressBar();
|
|
||||||
this.setData(node);
|
this.setData(node);
|
||||||
}else
|
} else
|
||||||
if (fn==6) //Fill in the drop-down lists.
|
if (fn==6) { //Fill in the drop-down lists.
|
||||||
{
|
|
||||||
this.hideProgressBar();
|
|
||||||
this.setDataSelect(node);
|
this.setDataSelect(node);
|
||||||
}else
|
} else
|
||||||
if (fn==7) //
|
if (fn==7) {
|
||||||
{
|
|
||||||
this.hideProgressBar();
|
|
||||||
this.setData(node);
|
this.setData(node);
|
||||||
}else
|
} else {
|
||||||
{
|
|
||||||
alert2(trt('Alert'),"Unknown function! fn=\""+fn+"\"" );
|
alert2(trt('Alert'),"Unknown function! fn=\""+fn+"\"" );
|
||||||
this.hideProgressBar();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
@ -1359,8 +1361,6 @@ class EdtRec
|
|||||||
{
|
{
|
||||||
if(nodeProp.getAttribute("selector")=="combo")
|
if(nodeProp.getAttribute("selector")=="combo")
|
||||||
{
|
{
|
||||||
//console.log("++++++++++field.options.length = "+field.options.length);
|
|
||||||
|
|
||||||
//We sort out the elements of the list (options) and set it to the desired value (the snake is not automatically exposed by the automaton).
|
//We sort out the elements of the list (options) and set it to the desired value (the snake is not automatically exposed by the automaton).
|
||||||
for(let i=0;i<field.options.length;i++)
|
for(let i=0;i<field.options.length;i++)
|
||||||
{
|
{
|
||||||
@ -1518,7 +1518,7 @@ class EdtRec
|
|||||||
|
|
||||||
let readd=document.getElementById("readd_"+this.uid);
|
let readd=document.getElementById("readd_"+this.uid);
|
||||||
if(readd!==null && readd.checked){
|
if(readd!==null && readd.checked){
|
||||||
confirm2(trt('Warning'),trt("Successfully_added_data")+"<br>"+trt("Add_more")+"?",null,()=>this.win.Close());
|
confirm2(trt('Warning'),trt("Successfully_added_data")+"<br>"+trt("Add_more")+"?",'',null,()=>this.win.Close());
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
this.win.Close();
|
this.win.Close();
|
||||||
|
|||||||
BIN
metadata/dbms/images/loading1.gif
Normal file
BIN
metadata/dbms/images/loading1.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@ -11,6 +11,7 @@ class DBMSUser
|
|||||||
this.role='';
|
this.role='';
|
||||||
this.m_ls=new Array(); //Listeners called OnLogin function.
|
this.m_ls=new Array(); //Listeners called OnLogin function.
|
||||||
|
|
||||||
|
this.divsh = null;
|
||||||
//Запрашиваю данные о текущем пользователе с сервера
|
//Запрашиваю данные о текущем пользователе с сервера
|
||||||
//this.LoadData();
|
//this.LoadData();
|
||||||
}
|
}
|
||||||
@ -162,11 +163,47 @@ class DBMSUser
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
showLock(visible) {
|
||||||
|
if(this.divsh==null) {
|
||||||
|
this.divsh = document.createElement('div'); //Shadow
|
||||||
|
this.divsh.style.cssText = "display: none; position: fixed; z-index: 1000; top:0; left:0; height: 100%; width: 100%; background: rgba(0,0,0,0.3);";
|
||||||
|
document.body.append(this.divsh);
|
||||||
|
}
|
||||||
|
if(!visible)
|
||||||
|
this.divsh.style.display='none';
|
||||||
|
else
|
||||||
|
this.divsh.style.display='block';
|
||||||
|
}
|
||||||
|
|
||||||
//Checking the session without its extension, if it is completed, we display the authorization window.
|
//Checking the session without its extension, if it is completed, we display the authorization window.
|
||||||
checkSession()
|
checkSession()
|
||||||
{
|
{
|
||||||
$.getJSON('../session',{},(data)=>{if(data.result=='ERROR'){this.showLoginForm();}});
|
$.ajax({
|
||||||
setTimeout(()=>this.checkSession(), 10000);
|
url: '../session',
|
||||||
|
data: "{}",
|
||||||
|
type: "POST",
|
||||||
|
dataType: "json",
|
||||||
|
success: (data,status) => {
|
||||||
|
if(status=='success')
|
||||||
|
{
|
||||||
|
if(data.result=='ERROR'){
|
||||||
|
this.showLoginForm();
|
||||||
|
}else
|
||||||
|
if(data.result=='OK'){
|
||||||
|
this.id=data.user_id;
|
||||||
|
}
|
||||||
|
this.showLock(false);
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
this.showLock(true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: (jqXHR, exception)=>
|
||||||
|
{
|
||||||
|
this.showLock(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setTimeout(()=>this.checkSession(), 10000);
|
||||||
};
|
};
|
||||||
|
|
||||||
showShadow(visible)
|
showShadow(visible)
|
||||||
@ -280,27 +317,22 @@ class DBMSUser
|
|||||||
xmlHttpRequest.responseXML=CreateXMLDOC(xmlHttpRequest.responseText);
|
xmlHttpRequest.responseXML=CreateXMLDOC(xmlHttpRequest.responseText);
|
||||||
|
|
||||||
//загрузился xml документ начинаем его разбирать (по id функции в документе)
|
//загрузился xml документ начинаем его разбирать (по id функции в документе)
|
||||||
var xmldoc = xmlHttpRequest.responseXML
|
let xmldoc = xmlHttpRequest.responseXML
|
||||||
if(xmldoc==null) {
|
if(xmldoc==null) {
|
||||||
alert2(trt('Alert'), trt('Wrong_XML_document') + "!\n" + xmlHttpRequest.responseText);
|
alert2(trt('Alert'), trt('Wrong_XML_document') + "!\n" + xmlHttpRequest.responseText);
|
||||||
return;
|
}else {
|
||||||
}
|
var node = xmldoc.documentElement;
|
||||||
|
if ((node == null) || (node.getAttribute("fn") == null)) alert(trt('Error') + "\n " + trt("No_data") + "!\n" + xmlHttpRequest.responseText);
|
||||||
var node = xmldoc.documentElement;
|
else {
|
||||||
if((node==null)||(node.getAttribute("fn")==null)) alert(trt('Error')+"\n "+trt("No_data")+"!\n"+xmlHttpRequest.responseText);
|
//alert("Принятый браузером XML=\n"+getXMLNodeSerialisation(node));
|
||||||
else
|
var fn = node.getAttribute("fn");
|
||||||
{
|
if (fn == -1) {
|
||||||
//alert("Принятый браузером XML=\n"+getXMLNodeSerialisation(node));
|
alert(findFirstNode(node, '#cdata-section').nodeValue);
|
||||||
var fn = node.getAttribute("fn");
|
this.win.hideProgressBar();
|
||||||
if (fn==-1)
|
} else if (fn == 7) {
|
||||||
{
|
alert(findFirstNode(node, '#cdata-section').nodeValue);
|
||||||
alert(findFirstNode(node,'#cdata-section').nodeValue);
|
this.win.Close();
|
||||||
this.win.hideProgressBar();
|
}
|
||||||
}else
|
|
||||||
if(fn==7)
|
|
||||||
{
|
|
||||||
alert(findFirstNode(node,'#cdata-section').nodeValue);
|
|
||||||
this.win.Close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
|
|||||||
@ -436,7 +436,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$xmlstring='<?xml version="1.0" encoding="utf-8"?><metadata fn="1"><type n="'.$typename.'" id="'.$result[0].'"></type></metadata>';
|
$xmlstring='<?xml version="1.0" encoding="utf-8"?><metadata fn="1"><type n="'.$typename.'" id="'.$result[0].'"></type></metadata>';
|
||||||
header('Content-type: text/xml');
|
header('Content-type: text/xml');
|
||||||
|
header("Cache-Control: no-cache, must-revalidate");
|
||||||
echo $xmlstring;
|
echo $xmlstring;
|
||||||
Exit();
|
Exit();
|
||||||
}else
|
}else
|
||||||
@ -545,7 +546,8 @@
|
|||||||
$result = $stmt->fetch(PDO::FETCH_NUM); //$obj_id
|
$result = $stmt->fetch(PDO::FETCH_NUM); //$obj_id
|
||||||
if($result[0]==''){ $result[0]=$obj_id; }
|
if($result[0]==''){ $result[0]=$obj_id; }
|
||||||
$xmlstring='<?xml version="1.0" encoding="utf-8"?><metadata fn="2"><type n="'.$typename.'" id="'.$result[0].'"></type></metadata>';
|
$xmlstring='<?xml version="1.0" encoding="utf-8"?><metadata fn="2"><type n="'.$typename.'" id="'.$result[0].'"></type></metadata>';
|
||||||
header('Content-type: text/xml');
|
header('Content-type: text/xml');
|
||||||
|
header("Cache-Control: no-cache, must-revalidate");
|
||||||
echo $xmlstring;
|
echo $xmlstring;
|
||||||
Exit();
|
Exit();
|
||||||
}else
|
}else
|
||||||
@ -583,7 +585,8 @@
|
|||||||
$xmlstring.='<metadata fn="3">';
|
$xmlstring.='<metadata fn="3">';
|
||||||
$xmlstring.=" <type n=\"".$typename."\" id=\"".$obj_id."\"></type>\n";
|
$xmlstring.=" <type n=\"".$typename."\" id=\"".$obj_id."\"></type>\n";
|
||||||
$xmlstring.="</metadata>\n";
|
$xmlstring.="</metadata>\n";
|
||||||
header('Content-type: text/xml');
|
header('Content-type: text/xml');
|
||||||
|
header("Cache-Control: no-cache, must-revalidate");
|
||||||
echo $xmlstring;
|
echo $xmlstring;
|
||||||
Exit();
|
Exit();
|
||||||
}else
|
}else
|
||||||
@ -920,11 +923,62 @@
|
|||||||
|
|
||||||
if($cmd==0) //Restore password by email
|
if($cmd==0) //Restore password by email
|
||||||
{
|
{
|
||||||
$res = $db->query("select 1 from '.$Schema.'_Users where del=false and email = '$login';");
|
$recovery=false;
|
||||||
|
$res = $db->query("select email from ".$Schema."_Users where del=false and (email = '$login' or login = '$login');");
|
||||||
if($res->rowCount()>0)
|
if($res->rowCount()>0)
|
||||||
{
|
{
|
||||||
mail($login,'rigor.kz','Not implement',"Content-type: text/html; charset=utf-8\r\nFrom: rigor Site <info@rigor.kz>");
|
while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
/*$pos++;
|
||||||
|
if (($pagepos!=-1)&&(($pos<($pagepos*$rowspagecount))||($pos>=$pagepos*$rowspagecount+$rowspagecount))) { continue; }
|
||||||
|
|
||||||
|
//разрешать или запрещять редактировать запись надо проверять в хранимке а также запрещять либо разрешать редактировать колонку
|
||||||
|
//для каждой записи формируеться строка настроек со значениями что нужно запретить в таком виде "iuds"
|
||||||
|
//$access=$row["access"];
|
||||||
|
$access=''; //u = enable update field, d = enable delete field
|
||||||
|
if(!array_key_exists("_u",$row)) { $access.="u"; } else { $access.=$row["email"]; }*/
|
||||||
|
|
||||||
|
$password = getPassword(6);
|
||||||
|
$sql = 'update ' . $Schema . '_users set password=md5(:password) where email=:email';
|
||||||
|
$stmt = $db->prepare($sql);
|
||||||
|
$stmt->bindValue(':password', $password, PDO::PARAM_STR);
|
||||||
|
$stmt->bindValue(':email', $row["email"], PDO::PARAM_STR);
|
||||||
|
try {
|
||||||
|
$stmt->execute();
|
||||||
|
if ($stmt->rowCount() > 0) {
|
||||||
|
//$result = $stmt->fetch(PDO::FETCH_NUM);
|
||||||
|
$recovery = true;
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$db->rollBack();
|
||||||
|
sendError(1, $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$html = '<html><head><title>Message</title></head><body>';
|
||||||
|
$html .= '<h1>New password:</h1>';
|
||||||
|
$html .= '<b>' . $password . '</b>';
|
||||||
|
$html .= '</body></html>';
|
||||||
|
//mail($login,'rigor.kz','Not implement',"Content-type: text/html; charset=utf-8\r\nFrom: rigor Site <info@rigor.kz>");
|
||||||
|
if (!mail($login, 'Password for transit.istt.kz', $html, "Content-type: text/html; charset=utf-8\r\nFrom: Transit Site <no-reply@istt.kz>")) {
|
||||||
|
sendError("Failed to send mail to: " . $row["email"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if($recovery) {
|
||||||
|
$xs = '<?xml version="1.0" encoding="utf-8"?>' . "\n";
|
||||||
|
$xs .= '<metadata fn="7"><![CDATA[OK]]></metadata>';
|
||||||
|
header('Content-type: text/xml');
|
||||||
|
header("Cache-Control: no-cache, must-revalidate");
|
||||||
|
echo $xs;
|
||||||
|
exit();
|
||||||
|
}else{
|
||||||
|
$xs = '<?xml version="1.0" encoding="utf-8"?>' . "\n";
|
||||||
|
$xs .= '<metadata fn="7"><![CDATA[ERROR]]></metadata>';
|
||||||
|
header('Content-type: text/xml');
|
||||||
|
header("Cache-Control: no-cache, must-revalidate");
|
||||||
|
echo $xs;
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
}elseif($cmd==1) //Logout
|
}elseif($cmd==1) //Logout
|
||||||
{
|
{
|
||||||
$sql='delete from '.$Schema.'_Logins where sessionid='.getSQLValue('string',$_COOKIE['GUID']).' and user_id='.getSQLValue('object',$_SESSION['USER_ID']).';';
|
$sql='delete from '.$Schema.'_Logins where sessionid='.getSQLValue('string',$_COOKIE['GUID']).' and user_id='.getSQLValue('object',$_SESSION['USER_ID']).';';
|
||||||
@ -935,21 +989,17 @@
|
|||||||
}
|
}
|
||||||
unset($_SESSION['USER_ID']);
|
unset($_SESSION['USER_ID']);
|
||||||
|
|
||||||
header('Content-type: text/xml');
|
|
||||||
header("Cache-Control: no-cache, must-revalidate");
|
|
||||||
|
|
||||||
$xs='<?xml version="1.0" encoding="utf-8"?>'."\n";
|
$xs='<?xml version="1.0" encoding="utf-8"?>'."\n";
|
||||||
$xs.='<metadata fn="7">'."\n";
|
$xs.='<metadata fn="7">'."\n";
|
||||||
$xs.=' <cmd><![CDATA['.$cmd.']]></cmd><login><![CDATA[0]]></login><sesid><![CDATA['.session_id().']]></sesid><sesname><![CDATA['.session_name().']]></sesname>'."\n";
|
$xs.=' <cmd><![CDATA['.$cmd.']]></cmd><login><![CDATA[0]]></login><sesid><![CDATA['.session_id().']]></sesid><sesname><![CDATA['.session_name().']]></sesname>'."\n";
|
||||||
$xs.='</metadata>';
|
$xs.='</metadata>';
|
||||||
|
header('Content-type: text/xml');
|
||||||
|
header("Cache-Control: no-cache, must-revalidate");
|
||||||
echo $xs;
|
echo $xs;
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
}elseif($cmd==2) //Проверить залогинен ли пользователь
|
}elseif($cmd==2) //Проверить залогинен ли пользователь
|
||||||
{
|
{
|
||||||
header('Content-type: text/xml');
|
|
||||||
header("Cache-Control: no-cache, must-revalidate");
|
|
||||||
|
|
||||||
$xs='<?xml version="1.0" encoding="utf-8"?>'."\n";
|
$xs='<?xml version="1.0" encoding="utf-8"?>'."\n";
|
||||||
$xs.='<metadata fn="7">'."\n";
|
$xs.='<metadata fn="7">'."\n";
|
||||||
if(!isset($_SESSION['USER_ID']) || $_SESSION['USER_ID']=='')
|
if(!isset($_SESSION['USER_ID']) || $_SESSION['USER_ID']=='')
|
||||||
@ -969,6 +1019,8 @@
|
|||||||
}
|
}
|
||||||
$xs.='</metadata>';
|
$xs.='</metadata>';
|
||||||
|
|
||||||
|
header('Content-type: text/xml');
|
||||||
|
header("Cache-Control: no-cache, must-revalidate");
|
||||||
echo $xs;
|
echo $xs;
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
@ -990,8 +1042,6 @@
|
|||||||
$patronymic=$result['patronymic'];
|
$patronymic=$result['patronymic'];
|
||||||
|
|
||||||
}
|
}
|
||||||
header('Content-type: text/xml');
|
|
||||||
header("Cache-Control: no-cache, must-revalidate");
|
|
||||||
$xs='<?xml version="1.0" encoding="utf-8"?>'."\n";
|
$xs='<?xml version="1.0" encoding="utf-8"?>'."\n";
|
||||||
$xs.='<metadata fn="7">'."\n";
|
$xs.='<metadata fn="7">'."\n";
|
||||||
$xs.='<![CDATA['.$ans.']]>';
|
$xs.='<![CDATA['.$ans.']]>';
|
||||||
@ -1001,6 +1051,8 @@
|
|||||||
$xs.=' <sesid><![CDATA['.session_id().']]></sesid>'."\n";
|
$xs.=' <sesid><![CDATA['.session_id().']]></sesid>'."\n";
|
||||||
$xs.=' <sesname><![CDATA['.session_name().']]></sesname>'."\n";
|
$xs.=' <sesname><![CDATA['.session_name().']]></sesname>'."\n";
|
||||||
$xs.='</metadata>';
|
$xs.='</metadata>';
|
||||||
|
header('Content-type: text/xml');
|
||||||
|
header("Cache-Control: no-cache, must-revalidate");
|
||||||
echo $xs;
|
echo $xs;
|
||||||
exit();
|
exit();
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
//var ScriptName='../records'; //POST
|
//var ScriptName='../records'; //POST
|
||||||
//var ScriptDName='../download';
|
//var ScriptDName='../download';
|
||||||
//var ScriptUName='../upload';
|
//var ScriptUName='../upload';
|
||||||
//var ScriptRName='../reports'; //GET For download reports (?file=name)
|
//var ScriptRName='../reports'; //GET For download reports (?file=name)
|
||||||
|
//var ScriptSName='../session';
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
//Copyright (C) 2008 Ivanov I.M. irigm@mail.ru +77051809750
|
//Copyright (C) 2008 Ivanov I.M. ivanov.i@istt.kz
|
||||||
//For find non english chars: [^\x00-\x7F]+
|
//For find non english chars: [^\x00-\x7F]+
|
||||||
|
|
||||||
function callWindow(uid,id,i)
|
function callWindow(uid,id,i)
|
||||||
@ -50,9 +50,29 @@ class SRec
|
|||||||
this.hideProgressBar();
|
this.hideProgressBar();
|
||||||
|
|
||||||
this.xmldoc=node.ownerDocument; //xmldoc;
|
this.xmldoc=node.ownerDocument; //xmldoc;
|
||||||
if (fn==-1) //Information menu
|
if (fn==-1) //Information alert
|
||||||
{
|
{
|
||||||
alert2(trt('Alert'),findFirstNode(node,'#cdata-section').nodeValue);
|
let fullText = findFirstNode(node,'#cdata-section').nodeValue;
|
||||||
|
let smallText = '';
|
||||||
|
let pos1=fullText.indexOf('[[');
|
||||||
|
let pos2=fullText.indexOf(']]');
|
||||||
|
if(pos1>0 && pos2>0 && pos1<pos2) smallText=fullText.substring(pos1+2, pos2);
|
||||||
|
|
||||||
|
if(fullText.indexOf("id456[[")>=0){ //Если есть идентификатор того что это перезапись
|
||||||
|
let okFunc=()=>{
|
||||||
|
this.setValue('seq',0);
|
||||||
|
this.sendData(); //Применить ещё раз
|
||||||
|
};
|
||||||
|
if (smallText != '')
|
||||||
|
confirm2(trt('Warning'),smallText, fullText, okFunc, null);
|
||||||
|
else
|
||||||
|
confirm2(trt('Warning'),smallText, '', okFunc, null);
|
||||||
|
}else {
|
||||||
|
if (smallText != '')
|
||||||
|
alert2(trt('Alert'), smallText, fullText);
|
||||||
|
else
|
||||||
|
alert2(trt('Alert'), fullText);
|
||||||
|
}
|
||||||
}else
|
}else
|
||||||
if (fn==0)
|
if (fn==0)
|
||||||
{
|
{
|
||||||
@ -1606,7 +1626,7 @@ class SRec
|
|||||||
//We run through the marked records and request their removal
|
//We run through the marked records and request their removal
|
||||||
deleteRecord(recordid)
|
deleteRecord(recordid)
|
||||||
{
|
{
|
||||||
confirm2(trt('Warning'),trt("Are_you_sure_you_want_to_delete_the_entries")+"<br>"
|
confirm2(trt('Warning'),trt("Are_you_sure_you_want_to_delete_the_entries")+"<br>",''
|
||||||
,()=>{
|
,()=>{
|
||||||
for(let i=0;i<this.masChBox.length;i++)
|
for(let i=0;i<this.masChBox.length;i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -86,6 +86,7 @@ class tcTab
|
|||||||
this.par=null;
|
this.par=null;
|
||||||
this.sel=false;
|
this.sel=false;
|
||||||
this.con=null; //Элемент с содержимым
|
this.con=null; //Элемент с содержимым
|
||||||
|
this.display = 'block'; //Для сохранения старого значения
|
||||||
this.href='';
|
this.href='';
|
||||||
|
|
||||||
//Сам таб на который нажимаем (ушко)
|
//Сам таб на который нажимаем (ушко)
|
||||||
@ -116,6 +117,9 @@ class tcTab
|
|||||||
val=document.getElementById(val);
|
val=document.getElementById(val);
|
||||||
if(val===null || typeof(val)=='undefined') return;
|
if(val===null || typeof(val)=='undefined') return;
|
||||||
this.con=val;
|
this.con=val;
|
||||||
|
|
||||||
|
this.display = this.con.style.display;
|
||||||
|
|
||||||
if(!this.sel) this.con.style.display='none';
|
if(!this.sel) this.con.style.display='none';
|
||||||
this.par.ctt.appendChild(this.con);
|
this.par.ctt.appendChild(this.con);
|
||||||
return val;
|
return val;
|
||||||
@ -131,8 +135,7 @@ class tcTab
|
|||||||
}
|
}
|
||||||
this.div.style.background = 'var(--row-color-2)';
|
this.div.style.background = 'var(--row-color-2)';
|
||||||
this.div.style.borderBottom = '1px solid var(--back-color)'
|
this.div.style.borderBottom = '1px solid var(--back-color)'
|
||||||
//this.con.style.display='inline'
|
this.con.style.display = this.display; //this.con.style.display='block'; //this.con.style.display='inline'
|
||||||
this.con.style.display='block';
|
|
||||||
this.sel=true
|
this.sel=true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -191,24 +191,45 @@ function loadContent(url,obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Вывести текст поверх окон с кнопочкой OK
|
//Вывести текст поверх окон с кнопочкой OK
|
||||||
function alert2(title,text,okFunc=null)
|
function alert2(title,smallText,fullText,okFunc=null)
|
||||||
{
|
{
|
||||||
|
if(smallText === undefined || smallText==''){
|
||||||
|
smallText=fullText;
|
||||||
|
fullText='';
|
||||||
|
}
|
||||||
let win=new TWin(true);
|
let win=new TWin(true);
|
||||||
win.BuildGUI(10,10);
|
win.BuildGUI(10,10);
|
||||||
win.setCaption(document.createTextNode(title));
|
win.setCaption(document.createTextNode(title));
|
||||||
let html='\n\
|
let html='\n\
|
||||||
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
|
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
|
||||||
<tr>\n\
|
<tr id="smallText_'+win.uid+'">\n\
|
||||||
<td colspan="2" style="text-align: center; vertical-align: middle;">'+text+'</td>\n\
|
<td colspan="2" style="text-align: center; vertical-align: middle;">'+smallText+'</td>\n\
|
||||||
|
</tr>\n\
|
||||||
|
<tr id="fullText_'+win.uid+'" style="display: none;">\n\
|
||||||
|
<td colspan="2" style="text-align: center; vertical-align: middle;">'+fullText+'</td>\n\
|
||||||
</tr>\n\
|
</tr>\n\
|
||||||
<tr style="width: 100%;height: 10px;">\n\
|
<tr style="width: 100%;height: 10px;">\n\
|
||||||
<td> </td>\n\
|
<td>'+(fullText === undefined || fullText == '' ? '' : '<label><input type="checkbox" id="show_'+win.uid+'" name="scales"> '+trt('Full_text')+'</label>')+' </td>\n\
|
||||||
<td style="width: 80px;"><button class="button-secondary" id="'+win.uid+'_close" style="width: 100%;">'+trt('OK')+'</button></td>\n\
|
<td style="width: 80px;"><button class="button-secondary" id="close_'+win.uid+'" style="width: 100%;">'+trt('OK')+'</button></td>\n\
|
||||||
</tr>\n\
|
</tr>\n\
|
||||||
</table>';
|
</table>';
|
||||||
|
|
||||||
win.setContent(html);
|
win.setContent(html);
|
||||||
let obj=document.getElementById(win.uid+'_close');
|
|
||||||
|
let obj=document.getElementById('show_'+win.uid);
|
||||||
|
if(obj!=null) obj.onclick=function(win){
|
||||||
|
return function(){
|
||||||
|
if(document.getElementById('show_'+win.uid).checked) {
|
||||||
|
document.getElementById('smallText_' + win.uid).style.display = "none";
|
||||||
|
document.getElementById('fullText_' + win.uid).style.display = "table-row";
|
||||||
|
}else{
|
||||||
|
document.getElementById('smallText_' + win.uid).style.display = "table-row";
|
||||||
|
document.getElementById('fullText_' + win.uid).style.display = "none";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}(win);
|
||||||
|
|
||||||
|
obj=document.getElementById('close_'+win.uid);
|
||||||
obj.focus();
|
obj.focus();
|
||||||
if(obj!=null) obj.onclick=function(win,okFunc){return function(){ win.Close(); if(okFunc!=null) okFunc(); };}(win,okFunc);
|
if(obj!=null) obj.onclick=function(win,okFunc){return function(){ win.Close(); if(okFunc!=null) okFunc(); };}(win,okFunc);
|
||||||
win.setSize("300px","150px");
|
win.setSize("300px","150px");
|
||||||
@ -219,24 +240,41 @@ function alert2(title,text,okFunc=null)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Вывести текст поверх окон с кнопочкой OK
|
//Вывести текст поверх окон с кнопочкой OK
|
||||||
function confirm2(title,text,okFunc,cancelFunc)
|
function confirm2(title,smallText,fullText,okFunc,cancelFunc)
|
||||||
{
|
{
|
||||||
let win=new TWin();
|
let win=new TWin();
|
||||||
win.BuildGUI(10,10);
|
win.BuildGUI(10,10);
|
||||||
win.setCaption(document.createTextNode(title));
|
win.setCaption(document.createTextNode(title));
|
||||||
let html='\n\
|
let html='\n\
|
||||||
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
|
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
|
||||||
<tr style="width: 100%;">\n\
|
<tr id="smallText_'+win.uid+'" style="width: 100%;">\n\
|
||||||
<td colspan="3" style="text-align: center; vertical-align: middle; width: 100%;">'+text+'</td>\n\
|
<td colspan="3" style="text-align: center; vertical-align: middle; width: 100%;">'+smallText+'</td>\n\
|
||||||
|
</tr>\n\
|
||||||
|
<tr id="fullText_'+win.uid+'" style="width: 100%; display: none;">\n\
|
||||||
|
<td colspan="3" style="text-align: center; vertical-align: middle; width: 100%;">'+fullText+'</td>\n\
|
||||||
</tr>\n\
|
</tr>\n\
|
||||||
<tr style="height: 10px;">\n\
|
<tr style="height: 10px;">\n\
|
||||||
<td style="width: 100%;"> </td>\n\
|
<td style="width: 100%;">'+(fullText === undefined || fullText == '' ? '' : '<label><input type="checkbox" id="show_'+win.uid+'" name="scales"> '+trt('Full_text')+'</label>')+' </td>\n\
|
||||||
<td><button class="button-secondary" id="'+win.uid+'_ok" style="width: 80px;margin:1px;">'+trt('Ok')+'</button></td>\n\
|
<td><button class="button-secondary" id="'+win.uid+'_ok" style="width: 80px;margin:1px;">'+trt('Ok')+'</button></td>\n\
|
||||||
\<td><button class="button-secondary" id="'+win.uid+'_cancel" style="width: 80px;margin:1px;">'+trt('Cancel')+'</button></td>\n\
|
\<td><button class="button-secondary" id="'+win.uid+'_cancel" style="width: 80px;margin:1px;">'+trt('Cancel')+'</button></td>\n\
|
||||||
</tr>\n\
|
</tr>\n\
|
||||||
</table>';
|
</table>';
|
||||||
|
|
||||||
win.setContent(html);
|
win.setContent(html);
|
||||||
|
|
||||||
|
let obj=document.getElementById('show_'+win.uid);
|
||||||
|
if(obj!=null) obj.onclick=function(win){
|
||||||
|
return function(){
|
||||||
|
if(document.getElementById('show_'+win.uid).checked) {
|
||||||
|
document.getElementById('smallText_' + win.uid).style.display = "none";
|
||||||
|
document.getElementById('fullText_' + win.uid).style.display = "table-row";
|
||||||
|
}else{
|
||||||
|
document.getElementById('smallText_' + win.uid).style.display = "table-row";
|
||||||
|
document.getElementById('fullText_' + win.uid).style.display = "none";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}(win);
|
||||||
|
|
||||||
let btnO=document.getElementById(win.uid+'_ok');
|
let btnO=document.getElementById(win.uid+'_ok');
|
||||||
btnO.focus();
|
btnO.focus();
|
||||||
if(btnO!=null){
|
if(btnO!=null){
|
||||||
@ -1293,7 +1331,7 @@ class TWin
|
|||||||
|
|
||||||
let str='';
|
let str='';
|
||||||
str+='<table id="TWin_TBL_'+this.tWinId+'" class="DBMSShadow" style="width: 100%; height: 100%; border: 1px solid #000000;">';
|
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: var(--path-grad) 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 ? '' : '<div id="TWin_CL_'+this.tWinId+'" style="display: inline-block; width: 10px; height: 10px; background-image: var(--path-X); cursor:pointer;padding-right: 5px;"></div>')+'</td></tr></table></td><td></td></tr>';
|
str+=' <tr id="TWin_H0_'+this.tWinId+'" style="background: var(--path-grad) 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 ? '' : '<div id="TWin_CL_'+this.tWinId+'" style="display: inline-block; width: 10px; height: 10px; background-image: var(--path-X); background-repeat: no-repeat; cursor:pointer;padding-right: 5px;"></div>')+'</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="'+this.path+'/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="vertical-align:top;height: 5px;'+(!this.dialog ? ' cursor:n-resize;' : '')+'" id="TWin_T_'+this.tWinId+'"></td>';
|
||||||
@ -1527,9 +1565,9 @@ class TWin
|
|||||||
{
|
{
|
||||||
if(this.parent!=null)
|
if(this.parent!=null)
|
||||||
{
|
{
|
||||||
for(var i=0;i<this.parent.childs.length;i++) if(this.parent.childs[i]==this) this.parent.childs[i]=null;
|
for(let i=0;i<this.parent.childs.length;i++) if(this.parent.childs[i]==this) this.parent.childs[i]=null;
|
||||||
}
|
}
|
||||||
if(w!=null)
|
if(typeof w !== 'undefined' && w!=null)
|
||||||
{
|
{
|
||||||
this.parent=w;
|
this.parent=w;
|
||||||
w.childs[w.childs.length]=this;
|
w.childs[w.childs.length]=this;
|
||||||
|
|||||||
@ -18,7 +18,7 @@ class BolmerCMS{
|
|||||||
if ( ! self::$authenticated) {
|
if ( ! self::$authenticated) {
|
||||||
define('BOLMER_API_MODE', true);
|
define('BOLMER_API_MODE', true);
|
||||||
define('IN_MANAGER_MODE', true);
|
define('IN_MANAGER_MODE', true);
|
||||||
$init = realpath(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))))."/index.php");
|
$init = realpath(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))))."/login.php");
|
||||||
include_once($init);
|
include_once($init);
|
||||||
$type = getService('user', true)->getLoginUserType();
|
$type = getService('user', true)->getLoginUserType();
|
||||||
if($type=='manager'){
|
if($type=='manager'){
|
||||||
|
|||||||
@ -314,6 +314,43 @@ function deleteTempFiles($dir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getFilesTree($dir,$cut="",$result = null){
|
||||||
|
if($result==null)
|
||||||
|
$result = new stdClass();
|
||||||
|
|
||||||
|
if (is_dir($dir))
|
||||||
|
{
|
||||||
|
$result->list = array();
|
||||||
|
|
||||||
|
$dh = opendir($dir);
|
||||||
|
if ($dh)
|
||||||
|
{
|
||||||
|
while (($file = readdir($dh)) !== false)
|
||||||
|
{
|
||||||
|
if($file == '..' || $file == '.') continue;
|
||||||
|
|
||||||
|
if(is_dir($dir.DIRECTORY_SEPARATOR.$file)){
|
||||||
|
$sub = new stdClass();
|
||||||
|
$sub->name=$file;
|
||||||
|
$sub->path=$dir.DIRECTORY_SEPARATOR.$file;
|
||||||
|
if($cut) $sub->path = str_replace($cut, "",$sub->path);
|
||||||
|
array_push($result->list, $sub);
|
||||||
|
getFilesTree($dir.DIRECTORY_SEPARATOR.$file, $cut, $sub);
|
||||||
|
}else{
|
||||||
|
$sub = new stdClass();
|
||||||
|
$sub->name=$file;
|
||||||
|
$sub->path=$dir.DIRECTORY_SEPARATOR.$file;
|
||||||
|
if($cut) $sub->path = str_replace($cut, "",$sub->path);
|
||||||
|
array_push($result->list, $sub);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
closedir($dh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
//Генерация пароля
|
//Генерация пароля
|
||||||
function getPassword($max)
|
function getPassword($max)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user