Skip to content

Commit 3da982a

Browse files
author
Tatiana
committed
6.16.62.0
2 parents 6768f98 + 1b08b79 commit 3da982a

25 files changed

+390
-409
lines changed

Diff for: http/css/libs.css

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

Diff for: http/css/main.css

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

Diff for: http/imgs/32px.png

-4.08 KB
Loading

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/libs.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

+71-143
Original file line numberDiff line numberDiff line change
@@ -445,97 +445,25 @@ class DE implements LangInterface
445445
'You can resend a secret via <span></span> sec' => 'Code kann in <span></span> Sek erneut gesendet werden',
446446
'Secret code' => 'Geheimcode',
447447
'Recalculate cycle with id %s before export.' => 'Berechnen Sie den Zyklus mit der ID %s vor dem Export neu.',
448+
'TOTUM-HELP-LINKS' => '[["📕 Dokumentation","https://docs.totum.online/"],["📗 Grundlagen für Benutzer","https://docs.totum.online/user-guide"],["🚀 Lizenzen der PRO-Version","https://totum.online/pro"],["🤖 Totum AI","https://totum.online/ai"]]',
448449
);
449-
/**
450-
* Возвращает сумму прописью
451-
* @author runcore
452-
* @uses morph(...)
453-
*/
454-
public function num2str($num): string
455-
{
456-
$nul = 'ноль';
457-
$ten = array(
458-
array('', 'один', 'два', 'три', 'четыре', 'пять', 'шесть', 'семь', 'восемь', 'девять'),
459-
array('', 'одна', 'две', 'три', 'четыре', 'пять', 'шесть', 'семь', 'восемь', 'девять'),
460-
);
461-
$a20 = array('десять', 'одиннадцать', 'двенадцать', 'тринадцать', 'четырнадцать', 'пятнадцать', 'шестнадцать', 'семнадцать', 'восемнадцать', 'девятнадцать');
462-
$tens = array(2 => 'двадцать', 'тридцать', 'сорок', 'пятьдесят', 'шестьдесят', 'семьдесят', 'восемьдесят', 'девяносто');
463-
$hundred = array('', 'сто', 'двести', 'триста', 'четыреста', 'пятьсот', 'шестьсот', 'семьсот', 'восемьсот', 'девятьсот');
464-
$unit = array( // Units
465-
array('копейка', 'копейки', 'копеек', 1),
466-
array('рубль', 'рубля', 'рублей', 0),
467-
array('тысяча', 'тысячи', 'тысяч', 1),
468-
array('миллион', 'миллиона', 'миллионов', 0),
469-
array('миллиард', 'милиарда', 'миллиардов', 0),
470-
);
471-
//
472-
list($rub, $kop) = explode('.', sprintf("%015.2f", floatval($num)));
473-
$out = array();
474-
if (intval($rub) > 0) {
475-
foreach (str_split($rub, 3) as $uk => $v) { // by 3 symbols
476-
if (!intval($v)) {
477-
continue;
478-
}
479-
$uk = sizeof($unit) - $uk - 1; // unit key
480-
$gender = $unit[$uk][3];
481-
list($i1, $i2, $i3) = array_map('intval', str_split($v, 1));
482-
// mega-logic
483-
$out[] = $hundred[$i1]; # 1xx-9xx
484-
if ($i2 > 1) {
485-
$out[] = $tens[$i2] . ' ' . $ten[$gender][$i3];
486-
} # 20-99
487-
else {
488-
$out[] = $i2 > 0 ? $a20[$i3] : $ten[$gender][$i3];
489-
} # 10-19 | 1-9
490-
// units without rub & kop
491-
if ($uk > 1) {
492-
$out[] = static::morph($v, $unit[$uk][0], $unit[$uk][1], $unit[$uk][2]);
493-
}
494-
} //foreach
495-
} else {
496-
$out[] = $nul;
497-
}
498-
$out[] = static::morph(intval($rub), $unit[1][0], $unit[1][1], $unit[1][2]); // rub
499-
$out[] = $kop . ' ' . static::morph($kop, $unit[0][0], $unit[0][1], $unit[0][2]); // kop
500-
return trim(preg_replace('/ {2,}/', ' ', join(' ', $out)));
501-
}
450+
public function num2str($num): string
451+
{
452+
return (string) $num;
453+
}
502454

503455
public function smallTranslit($s): string
504456
{
505457
return strtr(
506458
$s,
507459
[
508-
'ß'=>'ss', 'ä'=>'a', 'ü'=>'u', 'ö'=>'o',
460+
'ß'=>'ss', 'ä'=>'a', 'ü'=>'u', 'ö'=>'o',
461+
'á' => 'a', 'é' => 'e', 'í' => 'i', 'ó' => 'o', 'ú' => 'u',
509462
'ñ'=>'ny',
510463
'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'e', 'ж' => 'j', 'з' => 'z', 'и' => 'i', 'й' => 'y', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'shch', 'ы' => 'y', 'э' => 'e', 'ю' => 'yu', 'я' => 'ya', 'ъ' => '', 'ь' => '']
511464
);
512465
}
513466

514-
public function searchPrepare($string): string
515-
{
516-
return str_replace('ё', 'е', mb_strtolower(trim((string)$string)));
517-
}
518-
519-
/**
520-
* Склоняем словоформу
521-
* @ author runcore
522-
*/
523-
protected static function morph($n, $f1, $f2, $f5)
524-
{
525-
$n = abs(intval($n)) % 100;
526-
if ($n > 10 && $n < 20) {
527-
return $f5;
528-
}
529-
$n = $n % 10;
530-
if ($n > 1 && $n < 5) {
531-
return $f2;
532-
}
533-
if ($n === 1) {
534-
return $f1;
535-
}
536-
return $f5;
537-
}
538-
539467
public function dateFormat(DateTime $date, $fStr): string
540468
{
541469
$result = '';
@@ -572,68 +500,68 @@ public function dateFormat(DateTime $date, $fStr): string
572500
}
573501

574502
protected function getConstant($name): array
575-
{
576-
return match ($name) {
577-
'monthsShort' => [
578-
1 => 'янв',
579-
'фев',
580-
'мар',
581-
'апр',
582-
'май',
583-
'июн',
584-
'июл',
585-
'авг',
586-
'сент',
587-
'окт',
588-
'ноя',
589-
'дек'
590-
],
591-
'months' => [
592-
1 => 'январь',
593-
'февраль',
594-
'март',
595-
'апрель',
596-
'май',
597-
'июнь',
598-
'июль',
599-
'август',
600-
'сентябрь',
601-
'октябрь',
602-
'ноябрь',
603-
'декабрь'
604-
],
605-
'weekDays' => [
606-
1 => 'Понедельник',
607-
'Вторник',
608-
'Среда',
609-
'Четверг',
610-
'Пятница',
611-
'Суббота',
612-
'Воскресенье'
613-
],
614-
'weekDaysShort' => [
615-
1 => 'Пн',
616-
'Вт',
617-
'Ср',
618-
'Чт',
619-
'Пт',
620-
'Сб',
621-
'Вс'
622-
],
623-
'monthRods' => [
624-
1 => 'января',
625-
'февраля',
626-
'марта',
627-
'апреля',
628-
'мая',
629-
'июня',
630-
'июля',
631-
'августа',
632-
'сентября',
633-
'октября',
634-
'ноября',
635-
'декабря'
636-
],
637-
};
638-
}
503+
{
504+
return match ($name) {
505+
'monthsShort' => [
506+
1 => 'Jan',
507+
'Feb',
508+
'Mär',
509+
'Apr',
510+
'Mai',
511+
'Jun',
512+
'Jul',
513+
'Aug',
514+
'Sep',
515+
'Okt',
516+
'Nov',
517+
'Dez'
518+
],
519+
'months' => [
520+
1 => 'Januar',
521+
'Februar',
522+
'März',
523+
'April',
524+
'Mai',
525+
'Juni',
526+
'Juli',
527+
'August',
528+
'September',
529+
'Oktober',
530+
'November',
531+
'Dezember'
532+
],
533+
'weekDays' => [
534+
1 => 'Montag',
535+
'Dienstag',
536+
'Mittwoch',
537+
'Donnerstag',
538+
'Freitag',
539+
'Samstag',
540+
'Sonntag'
541+
],
542+
'weekDaysShort' => [
543+
1 => 'Mo',
544+
'Di',
545+
'Mi',
546+
'Do',
547+
'Fr',
548+
'Sa',
549+
'So'
550+
],
551+
'monthRods' => [
552+
1 => 'Januar',
553+
'Februar',
554+
'März',
555+
'April',
556+
'Mai',
557+
'Juni',
558+
'Juli',
559+
'August',
560+
'September',
561+
'Oktober',
562+
'November',
563+
'Dezember'
564+
],
565+
};
566+
}
639567
}

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

+7-43
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ class EN implements LangInterface
358358
'Resend secret' => 'Resend secret code',
359359
'You can resend a secret via <span></span> sec' => 'You can resend the code in <span></span> sec',
360360
'Recalculate cycle with id %s before export.' => 'Recalculate the cycle with id %s before exporting.',
361+
'TOTUM-HELP-LINKS' => '[["📕 Documentation","https://docs.totum.online/"],["📗 User Guide Basics","https://docs.totum.online/user-guide"],["🚀 PRO Version Licenses","https://totum.online/pro"],["🤖 Totum AI","https://totum.online/ai"]]',
361362
);
362363
public function dateFormat(DateTime $date, $fStr): string
363364
{
@@ -380,55 +381,18 @@ public function dateFormat(DateTime $date, $fStr): string
380381
}
381382

382383
public function num2str($num): string
383-
{
384-
$num = str_replace([',', ' '], '', trim($num));
385-
if (!$num) {
386-
return '';
387-
}
388-
$num = (int)$num;
389-
$words = [];
390-
$list1 = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven',
391-
'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'
392-
];
393-
$list2 = ['', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', 'hundred'];
394-
$list3 = ['', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion',
395-
'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quattuordecillion',
396-
'quindecillion', 'sexdecillion', 'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion'
397-
];
398-
$num_length = strlen($num);
399-
$levels = (int)(($num_length + 2) / 3);
400-
$max_length = $levels * 3;
401-
$num = substr('00' . $num, -$max_length);
402-
$num_levels = str_split($num, 3);
403-
for ($i = 0; $i < count($num_levels); $i++) {
404-
$levels--;
405-
$hundreds = (int)($num_levels[$i] / 100);
406-
$hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' hundred' . ' ' : '');
407-
$tens = (int)($num_levels[$i] % 100);
408-
$singles = '';
409-
if ($tens < 20) {
410-
$tens = ($tens ? ' ' . $list1[$tens] . ' ' : '');
411-
} else {
412-
$tens = (int)($tens / 10);
413-
$tens = ' ' . $list2[$tens] . ' ';
414-
$singles = (int)($num_levels[$i] % 10);
415-
$singles = ' ' . $list1[$singles] . ' ';
416-
}
417-
$words[] = $hundreds . $tens . $singles . (($levels && ( int )($num_levels[$i])) ? ' ' . $list3[$levels] . ' ' : '');
418-
} //end for loop
419-
$commas = count($words);
420-
if ($commas > 1) {
421-
$commas = $commas - 1;
422-
}
423-
return implode(' ', $words);
424-
}
384+
{
385+
return (string) $num;
386+
}
387+
425388

426389
public function smallTranslit($s): string
427390
{
428391
return strtr(
429392
$s,
430393
[
431-
'ß'=>'ss', 'ä'=>'a', 'ü'=>'u', 'ö'=>'o',
394+
'ß'=>'ss', 'ä'=>'a', 'ü'=>'u', 'ö'=>'o',
395+
'á' => 'a', 'é' => 'e', 'í' => 'i', 'ó' => 'o', 'ú' => 'u',
432396
'ñ'=>'ny',
433397
'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'e', 'ж' => 'j', 'з' => 'z', 'и' => 'i', 'й' => 'y', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'shch', 'ы' => 'y', 'э' => 'e', 'ю' => 'yu', 'я' => 'ya', 'ъ' => '', 'ь' => '']
434398
);

0 commit comments

Comments
 (0)