Skip to content

Commit

Permalink
Merge branch 'develop' into fix_dev_missing_create_accounting_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Dec 13, 2024
2 parents 6d73505 + 9199565 commit 99dbb8b
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 83 deletions.
36 changes: 0 additions & 36 deletions build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8196,12 +8196,6 @@ parameters:
count: 1
path: ../../htdocs/core/actions_massactions.inc.php

-
message: '#^Variable \$action might not be defined\.$#'
identifier: variable.undefined
count: 14
path: ../../htdocs/core/actions_massactions.inc.php

-
message: '#^Variable \$from might not be defined\.$#'
identifier: variable.undefined
Expand All @@ -8220,12 +8214,6 @@ parameters:
count: 1
path: ../../htdocs/core/actions_massactions.inc.php

-
message: '#^Variable \$month might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/core/actions_massactions.inc.php

-
message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#'
identifier: empty.variable
Expand Down Expand Up @@ -8256,12 +8244,6 @@ parameters:
count: 1
path: ../../htdocs/core/actions_massactions.inc.php

-
message: '#^Variable \$year might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/core/actions_massactions.inc.php

-
message: '#^Variable \$classfile might not be defined\.$#'
identifier: variable.undefined
Expand Down Expand Up @@ -17394,18 +17376,6 @@ parameters:
count: 4
path: ../../htdocs/cron/class/cronjob.class.php

-
message: '#^Variable \$ExecTimeLimit in empty\(\) always exists and is not falsy\.$#'
identifier: empty.variable
count: 1
path: ../../htdocs/cron/class/cronjob.class.php

-
message: '#^Variable \$MemoryLimit in empty\(\) always exists and is always falsy\.$#'
identifier: empty.variable
count: 1
path: ../../htdocs/cron/class/cronjob.class.php

-
message: '#^Ternary operator condition is always true\.$#'
identifier: ternary.alwaysTrue
Expand Down Expand Up @@ -27816,12 +27786,6 @@ parameters:
count: 2
path: ../../htdocs/projet/tasks.php

-
message: '#^Variable \$param might not be defined\.$#'
identifier: variable.undefined
count: 17
path: ../../htdocs/projet/tasks.php

-
message: '#^Variable \$permissiontodelete might not be defined\.$#'
identifier: variable.undefined
Expand Down
6 changes: 4 additions & 2 deletions htdocs/blockedlog/admin/blockedlog_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,9 @@
print getTitleFieldOfList($langs->trans('Action'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '')."\n";
print getTitleFieldOfList($langs->trans('Ref'), 0, $_SERVER["PHP_SELF"], 'ref_object', '', $param, '', $sortfield, $sortorder, '')."\n";
print getTitleFieldOfList($langs->trans('Amount'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ')."\n";
print getTitleFieldOfList($langs->trans('DataOfArchivedEvent'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ', 0, $langs->trans('DataOfArchivedEventHelp').'<br>'.$langs->trans('DataOfArchivedEventHelp2'), 1)."\n";
print getTitleFieldOfList($langs->trans('DataOfArchivedEvent'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ', 0, $langs->trans('DataOfArchivedEventHelp'), 1)."\n";
print getTitleFieldOfList($langs->trans('Fingerprint'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '')."\n";
print getTitleFieldOfList($langs->trans('Status'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
print getTitleFieldOfList($form->textwithpicto($langs->trans('Status'), $langs->trans('DataOfArchivedEventHelp2')), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
//print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '')."\n";
// Action column
Expand Down Expand Up @@ -671,6 +671,8 @@
} else {
//print $form->textwithpicto('', $langs->trans('KoCheckFingerprintValidity'));
}
} else {
//print $form->textwithpicto('', $langs->trans('DataOfArchivedEventHelp2'));
}

if (getDolGlobalString('BLOCKEDLOG_USE_REMOTE_AUTHORITY') && getDolGlobalString('BLOCKEDLOG_AUTHORITY_URL')) {
Expand Down
8 changes: 7 additions & 1 deletion htdocs/blockedlog/class/blockedlog.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,13 @@ public function setObjectData(&$object, $action, $amounts, $fuser = null)
$lineid++;
foreach ($tmpline as $keyline => $valueline) {
if (!in_array($keyline, array(
'ref', 'multicurrency_code', 'multicurrency_total_ht', 'multicurrency_total_tva', 'multicurrency_total_ttc', 'qty', 'product_type', 'product_label', 'vat_src_code', 'tva_tx', 'info_bits', 'localtax1_tx', 'localtax2_tx', 'total_ht', 'total_tva', 'total_ttc', 'total_localtax1', 'total_localtax2'
'ref', 'product_type', 'product_label',
'qty',
'subprice',
'vat_src_code', 'tva_tx', 'localtax1_tx', 'localtax2_tx',
'total_ht', 'total_tva', 'total_ttc', 'total_localtax1', 'total_localtax2',
'multicurrency_code', 'multicurrency_total_ht', 'multicurrency_total_tva', 'multicurrency_total_ttc',
'info_bits', 'special_code',
))) {
continue; // Discard if not into a dedicated list
}
Expand Down
3 changes: 3 additions & 0 deletions htdocs/core/actions_massactions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@
* @var ?string $objectlabel
* @var ?string $option
* @var ?int $deliveryreceipt
* @var string $action
* @var string $massaction
* @var string $objectclass
* @var string $uploaddir
* @var string $confirm
* @var string $month
* @var string $year
* @var int $error
*/
'
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/html.formfile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ public function list_of_documents($filearray, $object, $modulepart, $param = '',
// Show title of list of existing files
$morehtmlright = '';
if (!empty($moreoptions['showhideaddbutton']) && $conf->use_javascript_ajax) {
$tmpurlforbutton = 'javascript:console.log("open add file form");jQuery(".divattachnewfile").toggle(); if (!jQuery(".divattachnewfile").is(":hidden")) { jQuery("input[type=\'file\']").click(); }';
$tmpurlforbutton = 'javascript:console.log("open add file form");jQuery(".divattachnewfile").toggle(); if (!jQuery(".divattachnewfile").is(":hidden")) { jQuery("input[type=\'file\']").click();}void(0);';
$morehtmlright .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $tmpurlforbutton, '', $permtoeditline);
}

Expand Down Expand Up @@ -2221,7 +2221,7 @@ public function listOfLinks($object, $permissiontodelete = 1, $action = null, $s

$morehtmlright = '';
if (!empty($moreoptions['showhideaddbutton']) && $conf->use_javascript_ajax) {
$morehtmlright .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', 'javascript:console.log("open addlink form"); jQuery(".divlinkfile").toggle();', '', $permissiontoedit);
$morehtmlright .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', 'javascript:console.log("open addlink form"); jQuery(".divlinkfile").toggle(); void(0);', '', $permissiontoedit);
}

// Show list of associated links
Expand Down
77 changes: 40 additions & 37 deletions htdocs/core/tpl/list_print_total.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,46 @@
*/
'@phan-var-force array{nbfield:int,type?:array<int,string>,pos?:array<int,int>,val?:array<int,float>} $totalarray';

if (!function_exists('printTotalValCell')) { // allow two list with total on same screen

/** print a total cell value according to its type
*
* @param string $type of field (duration, string..)
* @param string $val the value to display
*
* @return void (direct print)
*/
function printTotalValCell($type, $val)
{
// if $totalarray['type'] not present we consider it as number
if (empty($type)) {
$type = 'real';
}
switch ($type) {
case 'duration':
print '<td class="right">';
print(!empty($val) ? convertSecondToTime((int) $val, 'allhourmin') : 0);
print '</td>';
break;
case 'string': // This type is no more used. type is now varchar(x)
print '<td class="left">';
print(!empty($val) ? $val : '');
print '</td>';
break;
case 'stock':
print '<td class="right">';
print price2num(!empty($val) ? $val : 0, 'MS');
print '</td>';
break;
default:
print '<td class="right">';
print price(!empty($val) ? $val : 0);
print '</td>';
break;
}
}
}

// Move fields of totalizable into the common array pos and val
if (!empty($totalarray['totalizable']) && is_array($totalarray['totalizable'])) {
foreach ($totalarray['totalizable'] as $keytotalizable => $valtotalizable) {
Expand Down Expand Up @@ -107,40 +147,3 @@
}
//print '</tfoot>';
}

/** print a total cell value according to its type
*
* @param string $type of field (duration, string..)
* @param string $val the value to display
*
* @return void (direct print)
*/
function printTotalValCell($type, $val)
{
// if $totalarray['type'] not present we consider it as number
if (empty($type)) {
$type = 'real';
}
switch ($type) {
case 'duration':
print '<td class="right">';
print(!empty($val) ? convertSecondToTime((int) $val, 'allhourmin') : 0);
print '</td>';
break;
case 'string': // This type is no more used. type is now varchar(x)
print '<td class="left">';
print(!empty($val) ? $val : '');
print '</td>';
break;
case 'stock':
print '<td class="right">';
print price2num(!empty($val) ? $val : 0, 'MS');
print '</td>';
break;
default:
print '<td class="right">';
print price(!empty($val) ? $val : 0);
print '</td>';
break;
}
}
4 changes: 2 additions & 2 deletions htdocs/cron/class/cronjob.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1223,15 +1223,15 @@ public function run_jobs(string $userlogin)
dol_syslog(get_class($this)."::run_jobs jobtype=".$this->jobtype." userlogin=".$userlogin, LOG_DEBUG);

// Increase limit of time. Works only if we are not in safe mode
$ExecTimeLimit = 600;
$ExecTimeLimit = getDolGlobalInt('MAIN_CRON_EXEC_TIME_LIMIT', 600);
if (!empty($ExecTimeLimit)) {
$err = error_reporting();
error_reporting(0); // Disable all errors
//error_reporting(E_ALL);
@set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64
error_reporting($err);
}
$MemoryLimit = 0;
$MemoryLimit = getDolGlobalString('MAIN_CRON_MEMORY_LIMIT');
if (!empty($MemoryLimit)) {
@ini_set('memory_limit', $MemoryLimit);
}
Expand Down
6 changes: 3 additions & 3 deletions htdocs/langs/en_US/blockedlog.lang
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ BlockedlogInfoDialog=Log Details
ListOfTrackedEvents=List of tracked events
Fingerprint=Fingerprint
DownloadLogCSV=Export archived logs (CSV)
DataOfArchivedEvent=Full data of archived event
DataOfArchivedEventHelp=This field contains the unalterable and structured data that was archived on real time. Even if some parent business event could have been purged or modified, the data archived here is the original data, and it can't be modified.
DataOfArchivedEventHelp2=Its integrity is guaranteed if the status of the line is OK
DataOfArchivedEvent=Complementary data of archived event
DataOfArchivedEventHelp=This field contains the complementary data that was archived on real time. Even if some parent business event could have been purged or modified, the data archived here is the original data, and it can't be modified.
DataOfArchivedEventHelp2=The integrity of data on each lines is guaranteed if the status of the line is OK
ImpossibleToReloadObject=Original object (type %s, id %s) not linked (see 'Full datas' column to get unalterable saved data)
BlockedLogAreRequiredByYourCountryLegislation=Unalterable Logs module may be required by the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit.
BlockedLogActivatedBecauseRequiredByYourCountryLegislation=Unalterable Logs module was activated because of the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they cannot be validated by a tax audit.
Expand Down
1 change: 1 addition & 0 deletions htdocs/projet/tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@
llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-project page-card_tasks');

$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';

if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref);
Expand Down

0 comments on commit 99dbb8b

Please sign in to comment.