# Conflicts:
#	metadata/dbms/records.php
This commit is contained in:
2020-08-17 11:34:08 +06:00
3 changed files with 126 additions and 41 deletions

View File

@ -153,8 +153,9 @@
}
//Функция для перевода текста без применения GetText
function trt($text)
{
/*
закоментил так как есть в tools.php
function trt($text) {
global $db,$lng,$Schema;
$language_id=1;
@ -182,29 +183,32 @@
$result=str_replace("_", " ", $text);
}
return $result;
}
}*/
//Перевод для строки в которой встречаются подстроки вида: _('')
//Перевод для строки в которой встречаются подстроки вида: trt('')
function parseGT($text)
{
$result='';
$pLen=4; //Длина преамбулы trt(
$cut=0;
$from = 0; // Позиция поиска для итерации
while (true)
{
$pos1 = strpos($text, '_(', $from);
$pos1 = strpos($text, 'trt(', $from);
if($pos1 !== false)
{
$from = $pos1+3;
$from = $pos1+$pLen+1;
$pos2 = false;
if($text[$pos1+2] == '"') $pos2 = strpos($text, '")', $from);
if($text[$pos1+2] == '\'') $pos2 = strpos($text, '\')', $from);
if($text[$pos1+$pLen] == '"') $pos2 = strpos($text, '")', $from);
if($text[$pos1+$pLen] == '\'') $pos2 = strpos($text, '\')', $from);
if($pos2 !== false)
{
$result.=substr($text, $cut, $pos1 - $cut );
$result.=trt(substr($text, $pos1+3, $pos2 - $pos1 - 3 ));
$result.=__(substr($text, $pos1+3, $pos2 - $pos1 - 3 ));
$toTranslate=substr($text, $pos1+$pLen+1, $pos2 - $pos1 - $pLen-1 );
$result.=trt($toTranslate);
$cut=$pos2+2;
$from = $pos2 + 2;
$from = $pos2 + $pLen;
}
}else break;
}
@ -1150,7 +1154,7 @@
if ($fn==8)//Получить отчёт как Excel.xls файл (почти тоже самое что и функция 4)
{
session_write_close(); //Разблокируем сессионный файл так как запросы могут быть достаточно долгими
//if (!isset($_SESSION['USER_ID']) || $_SESSION['USER_ID']=='') sendError(_('You are not logged in!'));
//if (!isset($_SESSION['USER_ID']) || $_SESSION['USER_ID']=='') sendError(trt('You are not logged in!'));
//Выбираем информацию о текущем пользователе
$name='';
@ -1197,7 +1201,7 @@
setFilter($f1,$f2);//заменить все значения первого фильтра значениями из второго
//Выбираем параметры фильтра (Для информирования что было заполнено)
$filter='<b>'._('Filter options').'</b><br>';
$filter='<b>'.trt('Filter options').'</b><br>';
$nextnode=$f1->firstChild;
while ($nextnode)
{ if ($nextnode->nodeName=='column')
@ -1235,7 +1239,7 @@
} catch (Exception $e)
{ sendError($e->getMessage());
}
if($res->rowCount()!=1) sendError(_('The number of records is not equal to one!').' '.$sql_query);
if($res->rowCount()!=1) sendError(trt('The number of records is not equal to one!').' '.$sql_query);
$columns=explode(",",$nextnode->getAttribute('FieldCaption'));
@ -1300,8 +1304,8 @@
fwrite($fh, ' </head>'."\n");
fwrite($fh, ' <body>'."\n");
fwrite($fh, '<b>'._('Time and date of generation').': </b><i>'.date('H:i:s m.d.Y').'</i><br>');
fwrite($fh, '<b>'._('Creator').': </b>'.$name);
fwrite($fh, '<b>'.trt('Time and date of generation').': </b><i>'.date('H:i:s m.d.Y').'</i><br>');
fwrite($fh, '<b>'.trt('Creator').': </b>'.$name);
fwrite($fh, $filter);
fwrite($fh, ' <table border="1" cellspacing="0">'."\n");
@ -1367,7 +1371,7 @@
//deleteTempFiles($dir);
}else
{
sendError(_('Not found the requested node:').' "'.$typename.'"!');
sendError(trt('Not found the requested node:').' "'.$typename.'"!');
}
}else