Skip to content

Commit fc6a051

Browse files
author
Tatiana
committed
version 4.10.55.0
2 parents 69edc28 + 98d948c commit fc6a051

33 files changed

+220
-76
lines changed

Diff for: http/html.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
type="text/css"
77
href="/css/libs.css?v=ead40ab">
88
<script src="/js/libs.js?v=c27fdf7"></script>
9-
<script src="/js/functions.js?v=7175840"></script>
9+
<script src="/js/functions.js?v=c5a1796"></script>
1010

1111
<link rel="stylesheet"
1212
type="text/css"
1313
href="/css/main.css?v=f037941">
14-
<script src="/js/main.js?v=dbcc612"></script>
14+
<script src="/js/main.js?v=526709e"></script>
1515

1616
</head>
1717
<body id="pk">

Diff for: http/js/functions.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: http/js/i18n/de.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: http/js/i18n/es.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: http/js/i18n/ru.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: http/js/main.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: totum/common/Lang/DE.php

+3
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ class DE implements LangInterface
426426
'list-ubsubscribe-Blocked-from-sending' => 'Diese Email ist für den Versand gesperrt',
427427
'list-ubsubscribe-done' => 'Es ist getan',
428428
'list-ubsubscribe-wrong-link' => 'Falscher Link',
429+
'There is no access to excel-import in this table' => 'In dieser Tabelle gibt es keinen Zugang zum Excel-Import',
430+
'The [[%s]] must be equal to the [[%s]].' => 'Der [[%s]] muss gleich dem [[%s]] sein.',
431+
'Excel import to %s' => 'Excel-Import in %s',
429432
);
430433
/**
431434
* Возвращает сумму прописью

Diff for: totum/common/Lang/ES.php

+3
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ class ES implements LangInterface
426426
'list-ubsubscribe-Blocked-from-sending' => 'Este correo electrónico está bloqueado para el envío',
427427
'list-ubsubscribe-done' => 'Está hecho',
428428
'list-ubsubscribe-wrong-link' => 'Enlace incorrecto',
429+
'There is no access to excel-import in this table' => 'No hay acceso a excel-import en esta tabla',
430+
'The [[%s]] must be equal to the [[%s]].' => 'El [[%s]] debe ser igual al [[%s]].',
431+
'Excel import to %s' => 'Importación Excel a %s',
429432
);
430433
public function dateFormat(DateTime $date, $fStr): string
431434
{

Diff for: totum/common/Lang/RU.php

+3
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,9 @@ class RU implements LangInterface
428428
'list-ubsubscribe-Blocked-from-sending' => 'Отправка на данный email заблокирована',
429429
'list-ubsubscribe-done' => 'Готово',
430430
'list-ubsubscribe-wrong-link' => 'Неверная ссылка',
431+
'There is no access to excel-import in this table' => 'Нет доступа к excel-импорту в этой таблице',
432+
'The [[%s]] must be equal to the [[%s]].' => '[[%s]] должен быть равен [[%s]].',
433+
'Excel import to %s' => 'Excel импорт в %s',
431434
);
432435
/**
433436
* Возвращает сумму прописью

Diff for: totum/common/Totum.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828
class Totum
2929
{
30-
public const VERSION = '4.10.54.4';
30+
public const VERSION = '4.10.55.0';
3131

3232

3333
public const TABLE_CODE_PARAMS = ['row_format', 'table_format', 'on_duplicate', 'default_action'];

Diff for: totum/common/calculates/Calculate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Calculate
5454
* @var aTable
5555
*/
5656
protected $Table;
57-
protected $vars;
57+
protected $vars = [];
5858
protected $fixedCodeNames = [];
5959
protected $fixedCodeVars = [];
6060
protected $CodeLineParams = [];

Diff for: totum/common/calculates/CalculateAction.php

+18-11
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ function ($match) use ($params) {
113113
$eml = '<style>' . $template['styles'] . '</style>' . $template['body'];
114114

115115
$toBfl = $params['bfl'] ?? in_array(
116-
'email',
117-
$this->Table->getTotum()->getConfig()->getSettings('bfl') ?? []
118-
);
116+
'email',
117+
$this->Table->getTotum()->getConfig()->getSettings('bfl') ?? []
118+
);
119119

120120
try {
121121
foreach ($emails as $email) {
@@ -542,7 +542,7 @@ protected function funcLinkToInput($params)
542542
'input',
543543
array_intersect_key(
544544
$params,
545-
['value' => 1, 'title' => 1, 'html' => 1, 'height' => 1, 'hash' => 1, 'refresh' => 1, 'button' => 1, 'close' => 1, 'type' => 1, 'multiple' => 1]
545+
['value' => 1, 'title' => 1, 'html' => 1, 'height' => 1, 'hash' => 1, 'refresh' => 1, 'button' => 1, 'close' => 1, 'type' => 1, 'multiple' => 1, 'selectAndSave' => 1]
546546
)
547547
);
548548
}
@@ -552,6 +552,10 @@ protected function funcLinkToInputSelect($params)
552552
$params = $this->getParamsArray($params, ['var'], [], ['var']);
553553
$params['type'] = 'select';
554554
$this->__checkNotEmptyParams($params, ['codeselect']);
555+
if (($params['multiple'] ?? false) === 'force') {
556+
$params['multiple'] = false;
557+
$params['selectAndSave'] = true;
558+
}
555559
$this->funcLinkToInput($params);
556560
}
557561

@@ -672,9 +676,9 @@ protected function funcEmailSend($params)
672676
}
673677

674678
$toBfl = $params['bfl'] ?? in_array(
675-
'email',
676-
$this->Table->getTotum()->getConfig()->getSettings('bfl') ?? []
677-
);
679+
'email',
680+
$this->Table->getTotum()->getConfig()->getSettings('bfl') ?? []
681+
);
678682

679683
try {
680684
$r = $this->Table->getTotum()->getConfig()->sendMail(
@@ -734,9 +738,9 @@ protected function funcGetFromSoap($params)
734738

735739

736740
$toBfl = $params['bfl'] ?? in_array(
737-
'soap',
738-
$this->Table->getTotum()->getConfig()->getSettings('bfl') ?? []
739-
);
741+
'soap',
742+
$this->Table->getTotum()->getConfig()->getSettings('bfl') ?? []
743+
);
740744
try {
741745
$soapClient = new SoapClient(
742746
$params['wsdl'] ?? null,
@@ -1984,7 +1988,10 @@ function ($params) {
19841988
'modify' => $modify,
19851989
'remove' => $remove,
19861990
'add' => $add,
1987-
1991+
'channel' => match ($params['channel']) {
1992+
'web', 'xml' => $params['channel'],
1993+
default => 'inner'
1994+
}
19881995
]
19891996
);
19901997
}

Diff for: totum/common/calculates/FuncArraysTrait.php

+14-5
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ protected function funcListFilter(string $params): array
237237
$filtered = [];
238238
$nIsRow = false;
239239

240-
if ((array_keys($list) !== range(0, count($list) - 1))) {
240+
if ($params['savekeys'] ?? false || (array_keys($list) !== range(0, count($list) - 1))) {
241241
$nIsRow = true;
242242
}
243243
foreach ($list as $k => $v) {
@@ -444,6 +444,10 @@ protected function funcListMinus(string $params): array
444444
return [];
445445
}
446446

447+
foreach ($params['item'] ?? [] as $item) {
448+
$params['list'][] = [$item];
449+
}
450+
447451
foreach ($params['list'] as $i => $list) {
448452
if ($list) {
449453
$this->__checkListParam($list, 'list' . (++$i));
@@ -467,10 +471,6 @@ protected function funcListMinus(string $params): array
467471
}
468472
}
469473
}
470-
foreach ($params['item'] ?? [] as $item) {
471-
$MainList = array_diff($MainList, [$item]);
472-
}
473-
474474
return array_values($MainList ?? []);
475475
}
476476

@@ -958,6 +958,15 @@ protected function funcRowKeysReplace(string $params): array
958958
throw new errorException($this->translate('The number of the [[%s]] must be equal to the number of [[%s]].',
959959
['from', 'to']));
960960
}
961+
$keys1 = array_keys($params['from']);
962+
$keys2 = array_keys($params['to']);
963+
ksort($keys1);
964+
ksort($keys2);
965+
966+
if ($keys1 !== $keys2) {
967+
throw new errorException($this->translate('The [[%s]] must be equal to the [[%s]].',
968+
['from keys', 'to keys']));
969+
}
961970
}
962971

963972
if (is_array($params['to']) != is_array($params['from'])) {

Diff for: totum/common/calculates/FuncNumbersTrait.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ public static function bcRoundNumber($val, $step, $dectimal, $type, $logData = [
2222
$mod = bcmod($val, 1, 10);
2323
if ($val > 0) {
2424
if (($type === 'up' && (int)(substr($mod,
25-
$dectimal + 2) ?? 0)) ||
25+
$dectimal + 2) ?? 0)) ||
2626
($type != 'down' && ($mod[$dectimal + 2] ?? 0) >= 5)) {
2727
$val = bcadd($val, number_format(1 / (10 ** $dectimal), $dectimal, '.', ''), $dectimal);
2828
}
2929
} elseif ($val < 0) {
3030
if (($type === 'down' && (int)(substr($mod,
31-
$dectimal + 3) ?? 0)) || ($type !== 'up' && ($mod[$dectimal + 3] ?? 0) >= 5)) {
31+
$dectimal + 3) ?? 0)) || ($type !== 'up' && ($mod[$dectimal + 3] ?? 0) >= 5)) {
3232
$val = bcsub($val, number_format(1 / (10 ** $dectimal), $dectimal, '.', ''), $dectimal);
3333
}
3434
}
@@ -50,7 +50,7 @@ public static function bcRoundNumber($val, $step, $dectimal, $type, $logData = [
5050
}
5151

5252
if (bccomp($val, 0, 10) === 0) {
53-
} elseif (!empty($step)) {
53+
} elseif (!empty((float)$step)) {
5454

5555
$fig = 10 ** $dectimal;
5656
$stepMul = bcmul($step, $fig, 10);

Diff for: totum/common/calculates/FuncServicesTrait.php

+29
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,35 @@ protected function serviceRequests(\totum\config\Conf $Config, $serviceName, arr
4747
return $answer;
4848
}
4949

50+
protected function funcServiceXlsxParser($params)
51+
{
52+
$params = $this->getParamsArray($params);
53+
$Config = $this->Table->getTotum()->getConfig();
54+
55+
56+
$this->__checkNotArrayParams($params, ['comment', 'withformats', 'filestring', 'file']);
57+
$withFormats = !!$params['withformats'];
58+
$withColumns = !!$params['withcolumns'];
59+
60+
$data = [];
61+
if ($params['filestring'] ?? null) {
62+
foreach ((array)$params['filestring'] as $_file) {
63+
$data[] = ['file' => base64_encode($_file), 'f' => $withFormats, 'c' => $withColumns];
64+
}
65+
} elseif ($params['file'] ?? null) {
66+
foreach ((array)$params['file'] as $_file) {
67+
$data[] = ['file' => base64_encode(File::getContent($_file, $Config)), 'f' => $withFormats, 'c' => $withColumns];
68+
}
69+
}
70+
71+
if (empty($data)) {
72+
return [];
73+
}
74+
$answers = $this->serviceRequests($Config, 'xlsx', $data, $params['comment'] ?? null);
75+
76+
return json_decode($answers[0], true);
77+
}
78+
5079
protected function funcServiceXlsxGenerator($params)
5180
{
5281
$params = $this->getParamsArray($params);

Diff for: totum/common/calculates/FuncTablesTrait.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@ protected function funcLinkToDataTable($params)
141141
$params['width'] ?? null,
142142
$params['refresh'] ?? false,
143143
['header' => $params['header'] ?? true,
144-
'footer' => $params['footer'] ?? true]
144+
'footer' => $params['footer'] ?? true,
145+
'topbuttons' => $params['topbuttons'] ?? true,
146+
'bottombuttons' => $params['bottombuttons'] ?? true,
147+
'pointing' => $params['pointing'] ?? null,
148+
'hidedots' => $this->__checkBoolOrNull($params['hidedots'] ?? null),
149+
]
145150
);
146151
} else {
147152
$table = [

Diff for: totum/common/configs/ConfParent.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ abstract class ConfParent
8484
protected $Lang;
8585

8686

87-
/** @noinspection PhpNewClassMissingParameterListInspection */
87+
8888
public function __construct($env = self::ENV_LEVELS['production'])
8989
{
9090
$this->mktimeStart = microtime(true);
@@ -782,4 +782,10 @@ public function setHiddenHostSettings(array $Settings)
782782
}
783783
}
784784

785+
protected array $techTables = ['ttm__prepared_data_import'];
786+
787+
public function isTechTable(string $name){
788+
return in_array($name, $this->techTables);
789+
}
790+
785791
}

Diff for: totum/moduls/Json/JsonController.php

+8-7
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class JsonController extends Controller
8686
15 => 'Remote {var} does not exist or is not available to you',
8787
16 => 'The name for remote is not set',
8888
17 => 'Due to exceeding the number of password attempts, your IP is blocked',
89+
18 => 'Incorrect set in the rows-set-where section',
8990
];
9091
private static $translates = ['header' => 'param', 'footer' => 'footer', 'rows' => 'column'];
9192

@@ -113,9 +114,9 @@ public function doIt(ServerRequestInterface $request, bool $output)
113114

114115
try {
115116
$this->arrayIn = json_decode($jsonString, true) ?? json_decode(
116-
$request->getParsedBody()['data'] ?? '',
117-
true
118-
);
117+
$request->getParsedBody()['data'] ?? '',
118+
true
119+
);
119120
if (!is_array($this->arrayIn)) {
120121
$this->throwError(1);
121122
}
@@ -183,7 +184,7 @@ protected function jsonRecalculate()
183184
}
184185
$params['where'][] = $where;
185186
}
186-
$params['field']='id';
187+
$params['field'] = 'id';
187188
/*TODO ограничение по фильтру*/
188189
$ids = $this->Table->getByParams($params, 'list');
189190
$inVars['modify'] = array_map(
@@ -315,7 +316,7 @@ protected function jsonImport()
315316
foreach ($itemArray as $k => $v) {
316317
if (empty($fields[$k]) || $fields[$k]['category'] !== $category) {
317318
throw new errorException(
318-
$this->translate('The %s field in %s table does not exist',[$k, $path]),
319+
$this->translate('The %s field in %s table does not exist', [$k, $path]),
319320
10
320321
);
321322
}
@@ -326,7 +327,7 @@ protected function jsonImport()
326327
foreach ($this->arrayIn['import']['rows-set-where'] as $set) {
327328
$where = [];
328329
foreach ($set['where'] as $_where) {
329-
if (count(array_intersect_key(
330+
if (!is_array($_where) || count(array_intersect_key(
330331
$_where,
331332
array_flip(['field', 'operator', 'value'])
332333
)) !== 3) {
@@ -347,7 +348,7 @@ protected function jsonImport()
347348
$rP =& $import['setValuesToPinned'][(int)$id];
348349
unset($set['set']['id']);
349350
$handleItem(
350-
$set['set'],
351+
$set['set'] ?? [],
351352
'column',
352353
'rows',
353354
$r,

Diff for: totum/moduls/Table/Actions.php

+4
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ function reuser()
104104
return ['ok' => 1];
105105
}
106106

107+
public function isCreatorView(){
108+
return $this->User->isCreator();
109+
}
110+
107111
public function getSchemaFormats()
108112
{
109113
return ['formats' => ['date' => $this->Totum->getConfig()->getSettings('dates_format') ?? 'd.m.Y'] + $this->Totum->getConfig()->getSettings('numbers_format') ?? []];

Diff for: totum/moduls/Table/AdminTableActions.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function leftEyeGroupSet()
166166
public function getTableData()
167167
{
168168
$data = parent::getTableData();
169-
$data['isCreatorView'] = true;
169+
$data['isCreatorView'] = $this->isCreatorView();
170170
return $data;
171171
}
172172

0 commit comments

Comments
 (0)