Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
0cda79c2d9
35 changed files with 101 additions and 93 deletions
|
|
@ -9,13 +9,13 @@
|
|||
*/
|
||||
return [
|
||||
// # Issue statistics:
|
||||
// PhanUndeclaredProperty : 410+ occurrences
|
||||
// PhanTypeMismatchArgument : 65+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 55+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 20+ occurrences
|
||||
// PhanUndeclaredProperty : 400+ occurrences
|
||||
// PhanTypeMismatchArgument : 60+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 50+ occurrences
|
||||
// PhanTypeMismatchProperty : 20+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 15+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 10+ occurrences
|
||||
// PhanTypeMismatchDimFetch : 10+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 7 occurrences
|
||||
// PhanTypeArraySuspiciousNull : 5 occurrences
|
||||
// PhanTypeExpectedObjectPropAccess : 5 occurrences
|
||||
// PhanUndeclaredMethod : 5 occurrences
|
||||
|
|
@ -39,14 +39,11 @@ return [
|
|||
'htdocs/commande/class/commande.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/commande/list.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/commande/list_det.php' => ['PhanTypeInvalidDimOffset'],
|
||||
'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/bank/class/account.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/class/paymentvarious.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/line.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/bank/various_payment/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/various_payment/document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/various_payment/info.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/clients.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/facture/card-rec.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -56,7 +53,6 @@ return [
|
|||
'htdocs/compta/paiement/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/paiement/cheque/list.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/paiement/rapport.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/prelevement/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/clientfourn.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/projects.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -73,7 +69,7 @@ return [
|
|||
'htdocs/core/class/CMailFile.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/class/canvas.class.php' => ['PhanUndeclaredMethod'],
|
||||
'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/commonobject.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/conf.class.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/core/class/ctyperesource.class.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -98,19 +94,14 @@ return [
|
|||
'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/delivery/mod_delivery_saphir.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/expedition/doc/pdf_espadon.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/expedition/doc/pdf_espadon.modules.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/holiday/mod_holiday_immaculate.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
|
|
@ -119,16 +110,16 @@ return [
|
|||
'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'],
|
||||
'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/multicompany_page.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -142,7 +133,6 @@ return [
|
|||
'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
|
||||
'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/expedition/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/expedition/class/expedition.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/expensereport/card.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -240,7 +230,6 @@ return [
|
|||
'htdocs/ticket/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/class/actions_ticket.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/class/cticketcategory.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/class/ticket.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/user/class/user.class.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/user/class/usergroup.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -249,7 +238,6 @@ return [
|
|||
'htdocs/webhook/target_card.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/webportal/admin/setup.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/webportal/class/html.formlistwebportal.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/webportal/class/webportalpropal.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/webservices/server_project.php' => ['PhanUndeclaredProperty'],
|
||||
],
|
||||
// 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed.
|
||||
|
|
|
|||
|
|
@ -414,7 +414,9 @@ if ($action == 'set' && $user->admin) {
|
|||
// We made some check against evil eternal modules that try to low security options.
|
||||
$checkOldValue = getDolGlobalInt('CHECKLASTVERSION_EXTERNALMODULE');
|
||||
$csrfCheckOldValue = getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN');
|
||||
$resarray = activateModule($value);
|
||||
|
||||
$resarray = activateModule($value, 1, 0, 'acceptredirect');
|
||||
|
||||
if ($checkOldValue != getDolGlobalInt('CHECKLASTVERSION_EXTERNALMODULE')) {
|
||||
setEventMessage($langs->trans('WarningModuleHasChangedLastVersionCheckParameter', $value), 'warnings');
|
||||
}
|
||||
|
|
@ -458,8 +460,11 @@ if ($action == 'set' && $user->admin) {
|
|||
if ($result) {
|
||||
setEventMessages($result, null, 'errors');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mode=".$mode.$param.($page_y ? '&page_y='.$page_y : ''));
|
||||
exit;
|
||||
}
|
||||
$resarray = activateModule($value, 0, 1);
|
||||
|
||||
$resarray = activateModule($value, 0, 1, 'acceptredirect');
|
||||
|
||||
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1), 'chaine', 0, '', $conf->entity);
|
||||
if (!empty($resarray['errors'])) {
|
||||
setEventMessages('', $resarray['errors'], 'errors');
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ foreach ($syslogModules as $moduleName) {
|
|||
$value = (isset($option['default']) ? $option['default'] : '');
|
||||
}
|
||||
|
||||
print '<span class="hideonsmartphone opacitymedium">'.$option['name'].': </span><input type="text" class="flat'.(empty($option['css']) ? '' : ' '.$option['css']).'" name="'.dol_escape_htmltag($option['constant']).'" value="'.$value.'"'.(isset($option['attr']) ? ' '.$option['attr'] : '').'>';
|
||||
print '<span class="hideonsmartphone opacitymedium">'.$option['name'].': </span><input type="text" placeholder="'.$option['default'].'" class="flat'.(empty($option['css']) ? '' : ' '.$option['css']).'" name="'.dol_escape_htmltag($option['constant']).'" value="'.$value.'"'.(isset($option['attr']) ? ' '.$option['attr'] : '').'>';
|
||||
if (!empty($option['example'])) {
|
||||
print '<br>'.$langs->trans("Example").': '.dol_escape_htmltag($option['example']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3316,7 +3316,7 @@ class Setup extends DolibarrApi
|
|||
$objMod = new $modName($db);
|
||||
//$name = strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
|
||||
if ($state) {
|
||||
activateModule($modulename);
|
||||
activateModule($modulename, 1, 0);
|
||||
return array('result' => 'success', 'message' => 'Module '.$this->db->escape($modulename).' activated');
|
||||
} else {
|
||||
unActivateModule($modulename);
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ print '<td></td>';
|
|||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="titlefield">';
|
||||
print '<td class="titlefieldmiddle">';
|
||||
print $langs->trans("CompanyInitialKey").'</td><td>';
|
||||
print $block_static->getOrInitFirstSignature();
|
||||
print '</td></tr>';
|
||||
|
|
@ -239,7 +239,7 @@ print '</td>';
|
|||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="titlefield">';
|
||||
print '<td class="">';
|
||||
print $langs->trans("ListOfTrackedEvents").'</td><td>';
|
||||
$arrayoftrackedevents = $block_static->trackedevents;
|
||||
foreach ($arrayoftrackedevents as $key => $val) {
|
||||
|
|
|
|||
|
|
@ -230,6 +230,8 @@ if ($withtab) {
|
|||
|
||||
print '<span class="opacitymedium">'.$langs->trans("BlockedLogDesc")."</span><br>\n";
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Show version
|
||||
print '<div class="center"><span class="opacitymedium">'.$langs->trans("CurrentVersion").'</span> <span class="badge-text badge-secondary">'.DOL_VERSION.'</span></div>';
|
||||
|
||||
|
|
|
|||
|
|
@ -185,12 +185,16 @@ function isALNEQualifiedVersion($ignoredev = 0, $ignoremodule = 0)
|
|||
*/
|
||||
function isALNERunningVersion($blockedlogtestalreadydone = 0)
|
||||
{
|
||||
// For Debug help: Constant set by developer to force all LNE restrictions even if country is not France so we can test them on any dev instance.
|
||||
// Note that you can force, with this option, the enabling of the LNE restrictions, but there is no way to force the disabling of the LNE restriction.
|
||||
if (defined('CERTIF_LNE') && (int) constant('CERTIF_LNE') === 2) {
|
||||
// For Debug help: Constant set by developer to force all LNE restrictions
|
||||
// even if country is not France so we can test them on any dev instance.
|
||||
// Note that you can force, with this option, the enabling of the LNE restrictions,
|
||||
// but there is no way to force the disabling of the LNE restriction.
|
||||
if (defined('CERTIF_LNE') && (int) constant('CERTIF_LNE') === 2
|
||||
&& isModEnabled('blockedlog') && ($blockedlogtestalreadydone || isBlockedLogUsed())) {
|
||||
return true;
|
||||
}
|
||||
if (isModEnabled('blockedlog') && ($blockedlogtestalreadydone || isBlockedLogUsed())) {
|
||||
if (defined('CERTIF_LNE') && (int) constant('CERTIF_LNE') === 1
|
||||
&& isModEnabled('blockedlog') && ($blockedlogtestalreadydone || isBlockedLogUsed())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
|
|||
if ($action == 'validate' && $user->hasRight('deplacement', 'creer')) {
|
||||
$object->fetch($id);
|
||||
if ($object->statut == Deplacement::STATUS_DRAFT) {
|
||||
$result = $object->setStatut(1);
|
||||
$result = $object->setStatut(Deplacement::STATUS_REFUNDED, null, '', 'DELIVERY_MODIFY');
|
||||
if ($result > 0) {
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
|
|
@ -86,7 +86,7 @@ if ($action == 'validate' && $user->hasRight('deplacement', 'creer')) {
|
|||
} elseif ($action == 'classifyrefunded' && $user->hasRight('deplacement', 'creer')) {
|
||||
$object->fetch($id);
|
||||
if ($object->statut == Deplacement::STATUS_VALIDATED) {
|
||||
$result = $object->setStatut(Deplacement::STATUS_REFUNDED);
|
||||
$result = $object->setStatut(Deplacement::STATUS_REFUNDED, null, '', 'DELIVERY_MODIFY');
|
||||
if ($result > 0) {
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2018-2026 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -255,11 +255,11 @@ if ($id > 0 || $ref) {
|
|||
print '<form name="setdate_trans" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setdate_trans">';
|
||||
print $form->selectDate($object->date_trans ? $object->date_trans : -1, 'date_trans', 0, 0, 0, "setdate_trans");
|
||||
print $form->selectDate($object->date_trans, 'date_trans', 0, 0, 0, "setdate_trans"); // $object->date_trans can't be empty due to test some lines ago
|
||||
print '<input type="submit" class="button button-edit smallpaddingimp valign middle" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
} else {
|
||||
print $object->date_trans ? dol_print_date($object->date_trans, 'day') : '';
|
||||
print dol_print_date($object->date_trans, 'day'); // $object->date_trans can't be empty due to test some lines ago
|
||||
print ' <span class="opacitymedium">'.$langs->trans("By").'</span> '.$muser->getNomUrl(-1).'</td>';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -1190,10 +1190,11 @@ function purgeSessions($mysessionid)
|
|||
*
|
||||
* @param string $value Name of module to activate (modModuleName)
|
||||
* @param int $withdeps Activate/Disable also all dependencies
|
||||
* @param int $noconfverification Remove verification of $conf variable for module
|
||||
* @param int $noconfverification Remove verification of $conf->global->MODULE_NAME variable for module
|
||||
* @param string $options Option for init
|
||||
* @return array{nbmodules?:int,errors:string[],nbperms?:int} array('nbmodules'=>nb modules activated with success, 'errors=>array of error messages, 'nbperms'=>Nb permission added);
|
||||
*/
|
||||
function activateModule($value, $withdeps = 1, $noconfverification = 0)
|
||||
function activateModule($value, $withdeps = 1, $noconfverification = 0, $options = '')
|
||||
{
|
||||
global $db, $langs, $conf, $mysoc;
|
||||
|
||||
|
|
@ -1256,7 +1257,7 @@ function activateModule($value, $withdeps = 1, $noconfverification = 0)
|
|||
}
|
||||
}
|
||||
|
||||
$result = $objMod->init(); // Enable module
|
||||
$result = $objMod->init($options); // Enable module
|
||||
|
||||
if ($result <= 0) {
|
||||
$ret['errors'][] = $objMod->error;
|
||||
|
|
@ -1281,7 +1282,7 @@ function activateModule($value, $withdeps = 1, $noconfverification = 0)
|
|||
$activateerr = '';
|
||||
foreach ($modulesdir as $dir) {
|
||||
if (file_exists($dir.$modulestring.".class.php")) {
|
||||
$resarray = activateModule($modulestring);
|
||||
$resarray = activateModule($modulestring, 1, 0, $options);
|
||||
if (empty($resarray['errors'])) {
|
||||
$activate = true;
|
||||
} else {
|
||||
|
|
@ -1630,7 +1631,7 @@ function activateModulesRequiredByCountry($country_code)
|
|||
if ($modulequalified) {
|
||||
// Load languages files of module
|
||||
if (isset($objMod->automatic_activation[$country_code])) {
|
||||
activateModule($modName);
|
||||
activateModule($modName, 1, 0);
|
||||
|
||||
setEventMessages($objMod->automatic_activation[$country_code], null, 'warnings');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||
$pdf->writeHTMLCell(60, $height_trackingnumber, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber") . " : " . $object->tracking_number, 0, 1, false, true, 'L');
|
||||
$tab_top_alt = $pdf->GetY();
|
||||
|
||||
$object->getUrlTrackingStatus($object->tracking_number);
|
||||
$object->getUrlTrackingStatus((string) $object->tracking_number);
|
||||
if (!empty($object->tracking_url)) {
|
||||
if ($object->shipping_method_id > 0) {
|
||||
// Get code using getLabelFromKey
|
||||
|
|
@ -532,7 +532,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||
$barcode_path = '';
|
||||
$result = 0;
|
||||
if ($module->encodingIsSupported($encoding)) {
|
||||
$result = $module->writeBarCode($object->ref, $encoding);
|
||||
$result = $module->writeBarCode((string) $object->ref, $encoding);
|
||||
|
||||
// get path of qrcode image
|
||||
$newcode = (string) $object->ref;
|
||||
|
|
|
|||
|
|
@ -630,7 +630,7 @@ class pdf_merou extends ModelePdfExpedition
|
|||
$pdf->SetTextColor(0, 0, 0);
|
||||
|
||||
if (!empty($object->tracking_number)) {
|
||||
$object->getUrlTrackingStatus($object->tracking_number);
|
||||
$object->getUrlTrackingStatus((string) $object->tracking_number);
|
||||
if (!empty($object->tracking_url)) {
|
||||
if ($object->shipping_method_id > 0) {
|
||||
// Get code using getLabelFromKey
|
||||
|
|
|
|||
|
|
@ -379,7 +379,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||
$pdf->writeHTMLCell(60, $height_trackingnumber, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L');
|
||||
$tab_top_alt = $pdf->GetY();
|
||||
|
||||
$object->getUrlTrackingStatus($object->tracking_number);
|
||||
$object->getUrlTrackingStatus((string) $object->tracking_number);
|
||||
if (!empty($object->tracking_url)) {
|
||||
if ($object->shipping_method_id > 0) {
|
||||
// Get code using getLabelFromKey
|
||||
|
|
@ -433,7 +433,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||
$barcode_path = '';
|
||||
$result = 0;
|
||||
if ($module->encodingIsSupported($encoding)) {
|
||||
$result = $module->writeBarCode($object->ref, $encoding);
|
||||
$result = $module->writeBarCode((string) $object->ref, $encoding);
|
||||
|
||||
// get path of qrcode image
|
||||
$newcode = (string) $object->ref;
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ class modBlockedLog extends DolibarrModules
|
|||
$b = new BlockedLog($this->db);
|
||||
|
||||
// forceinit can be set to bypass this redirection
|
||||
if (isALNEQualifiedVersion(1, 1) && $options != 'forceinit') {
|
||||
if (isALNEQualifiedVersion(1, 1) && $options == 'acceptredirect') {
|
||||
// We first switch on registration page
|
||||
header("Location: ".DOL_URL_ROOT.'/blockedlog/admin/registration.php?origin=initmodule&withtab=0');
|
||||
exit;
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ class pdf_squille extends ModelePdfReception
|
|||
$barcode_path = '';
|
||||
$result = 0;
|
||||
if ($module->encodingIsSupported($encoding)) {
|
||||
$result = $module->writeBarCode($object->ref, $encoding);
|
||||
$result = $module->writeBarCode((string) $object->ref, $encoding);
|
||||
|
||||
// get path of qrcode image
|
||||
$newcode = (string) $object->ref;
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ class pdf_eagle extends ModelePDFStockTransfer
|
|||
$barcode_path = '';
|
||||
$result = 0;
|
||||
if ($module->encodingIsSupported($encoding)) {
|
||||
$result = $module->writeBarCode($object->ref, $encoding);
|
||||
$result = $module->writeBarCode((string) $object->ref, $encoding);
|
||||
|
||||
// get path of qrcode image
|
||||
$newcode = (string) $object->ref;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/modules/supplir_proposal/doc/pdf_zenith.modules.php
|
||||
* \file htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php
|
||||
* \ingroup fournisseur
|
||||
* \brief File of class to generate suppliers proposals from zenith model
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
|||
$this->setErrorsFromObject($newobject);
|
||||
} else {
|
||||
if (empty($object->fk_account) && !empty($object->thirdparty->fk_account) && !getDolGlobalInt('BANK_ASK_PAYMENT_BANK_DURING_ORDER')) {
|
||||
$ret = $newobject->setBankAccount($object->thirdparty->fk_account, 1, $user);
|
||||
$ret = $newobject->setBankAccount((int) $object->thirdparty->fk_account, 1, $user);
|
||||
if ($ret < 0) {
|
||||
$this->setErrorsFromObject($newobject);
|
||||
}
|
||||
|
|
@ -147,7 +147,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
|||
}
|
||||
}
|
||||
dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of order = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht));
|
||||
if ($this->shouldClassify($conf, $totalonlinkedelements, $object->total_ht)) {
|
||||
if ($this->shouldClassify($conf, $totalonlinkedelements, (float) $object->total_ht)) {
|
||||
foreach ($object->linkedObjects['propal'] as $element) {
|
||||
/** @var Propal $element */
|
||||
$ret = $element->classifyBilled($user);
|
||||
|
|
@ -312,7 +312,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
|||
}
|
||||
}
|
||||
dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht));
|
||||
if ($this->shouldClassify($conf, $totalonlinkedelements, $object->total_ht)) {
|
||||
if ($this->shouldClassify($conf, $totalonlinkedelements, (float) $object->total_ht)) {
|
||||
foreach ($object->linkedObjects['order_supplier'] as $element) {
|
||||
/** @var CommandeFournisseur $element */
|
||||
$ret = $element->classifyBilled($user);
|
||||
|
|
@ -336,7 +336,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
|||
}
|
||||
}
|
||||
dol_syslog("Amount of linked supplier proposals = ".$totalonlinkedelements.", of supplier invoice = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht));
|
||||
if ($this->shouldClassify($conf, $totalonlinkedelements, $object->total_ht)) {
|
||||
if ($this->shouldClassify($conf, $totalonlinkedelements, (float) $object->total_ht)) {
|
||||
foreach ($object->linkedObjects['supplier_proposal'] as $element) {
|
||||
/** @var SupplierProposal $element */
|
||||
$ret = $element->classifyBilled($user);
|
||||
|
|
@ -415,7 +415,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
|||
}
|
||||
}
|
||||
dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht));
|
||||
if ($this->shouldClassify($conf, $totalonlinkedelements, $object->total_ht)) {
|
||||
if ($this->shouldClassify($conf, $totalonlinkedelements, (float) $object->total_ht)) {
|
||||
foreach ($object->linkedObjects['commande'] as $element) {
|
||||
/** @var Commande $element */
|
||||
$ret = $element->classifyBilled($user);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class of triggered functions for agenda module
|
||||
*/
|
||||
|
|
@ -91,6 +90,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
|
|||
}
|
||||
|
||||
if ($action === 'PAYMENT_CUSTOMER_CREATE' && $object->element == 'payment') {
|
||||
include_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php';
|
||||
if (isALNERunningVersion() && $mysoc->country_code == 'FR') {
|
||||
if (empty($object->paiementcode) && !empty($object->paiementid)) {
|
||||
$object->paiementcode = dol_getIdFromCode($this->db, $object->paiementid, 'c_paiement', 'id', 'code', 1);
|
||||
|
|
|
|||
|
|
@ -1551,7 +1551,7 @@ class EmailCollector extends CommonObject
|
|||
//$search.=($search?' ':'').'SINCE 8-Apr-2022';
|
||||
}
|
||||
|
||||
dol_syslog("IMAP search string = ".var_export($criteria, true));
|
||||
dol_syslog("IMAP search string = ".formatLogObject($criteria));
|
||||
$search = var_export($criteria, true);
|
||||
} else {
|
||||
// Use native IMAP functions
|
||||
|
|
|
|||
|
|
@ -652,7 +652,7 @@ if (empty($reshook)) {
|
|||
$also_update_stock = (GETPOST('alsoUpdateStock', 'alpha') ? 1 : 0);
|
||||
$result = $object->cancel($user, 0, (bool) $also_update_stock);
|
||||
if ($result > 0) {
|
||||
$result = $object->setStatut(-1);
|
||||
$result = $object->setStatut(Expedition::STATUS_CANCELED);
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
|
@ -668,7 +668,7 @@ if (empty($reshook)) {
|
|||
// TODO add alternative status
|
||||
//} elseif ($action == 'reopen' && ($user->hasRight('expedition', 'creer') || $user->hasRight('expedition', 'shipping_advance', 'validate')))
|
||||
//{
|
||||
// $result = $object->setStatut(0);
|
||||
// $result = $object->setStatut(Expedition::STATUS_DRAFT);
|
||||
// if ($result < 0)
|
||||
// {
|
||||
// setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
|
|
|||
|
|
@ -984,7 +984,7 @@ if (empty($reshook)) {
|
|||
$object = new ExpenseReport($db);
|
||||
$object->fetch($id);
|
||||
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid || in_array($object->fk_user_author, $childids)) {
|
||||
$result = $object->setStatut(0);
|
||||
$result = $object->setStatut(ExpenseReport::STATUS_DRAFT);
|
||||
|
||||
if ($result > 0) {
|
||||
// Define output language
|
||||
|
|
|
|||
|
|
@ -610,7 +610,7 @@ class ExpenseReports extends DolibarrApi
|
|||
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->expensereport->setStatut(0);
|
||||
$result = $this->expensereport->setStatut(ExpenseReport::STATUS_DRAFT);
|
||||
if ($result == 0) {
|
||||
throw new RestException(304, 'Error nothing done. May be object is already draft');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,4 +137,7 @@ ALTER TABLE llx_usergroup ADD COLUMN fk_parent integer DEFAULT NULL AFTER entity
|
|||
ALTER TABLE llx_usergroup ADD INDEX idx_usergroup_fk_parent (fk_parent);
|
||||
ALTER TABLE llx_usergroup ADD CONSTRAINT fk_usergroup_parent FOREIGN KEY (fk_parent) REFERENCES llx_usergroup (rowid);
|
||||
|
||||
-- Force change password next time
|
||||
ALTER TABLE llx_user ADD COLUMN force_pass_change TINYINT DEFAULT 0 AFTER pass_temp;
|
||||
|
||||
-- end of migration
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ create table llx_user
|
|||
pass varchar(128),
|
||||
pass_crypted varchar(128),
|
||||
pass_temp varchar(128), -- temporary password when asked for forget password or 'hashtoallowreset:YYYMMDDHHMMSS' (where date is max date of validity)
|
||||
force_pass_change tinyint DEFAULT 0, -- 1 if user must change password at next login
|
||||
api_key varchar(128), -- key to use REST API by this user
|
||||
gender varchar(10),
|
||||
civility varchar(6),
|
||||
|
|
@ -86,7 +87,7 @@ create table llx_user
|
|||
last_main_doc varchar(255), -- relative filepath+filename of last main generated document
|
||||
datelastlogin datetime,
|
||||
datepreviouslogin datetime,
|
||||
datelastpassvalidation datetime, -- last date we change password or we made a disconnect all
|
||||
datelastpassvalidation datetime, -- last date we change password or we made a disconnect all. Open session with a start date before this date will be disabled.
|
||||
datestartvalidity datetime,
|
||||
dateendvalidity datetime,
|
||||
flagdelsessionsbefore datetime DEFAULT NULL, -- set this to a date if we need to launch an external process to invalidate all sessions for the same login created before this date
|
||||
|
|
|
|||
|
|
@ -2726,7 +2726,7 @@ if ($action == 'set' && $user->admin /* && $user->hasRight("modulebuilder", "run
|
|||
$param .= '&tabobj='.urlencode($tabobj);
|
||||
|
||||
$value = GETPOST('value', 'alpha');
|
||||
$resarray = activateModule($value);
|
||||
$resarray = activateModule($value, 1, 0);
|
||||
if (!empty($resarray['errors'])) {
|
||||
setEventMessages('', $resarray['errors'], 'errors');
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -949,16 +949,17 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P
|
|||
$companypaymentmode->status = $servicestatus;
|
||||
|
||||
$db->begin();
|
||||
if (!$error) {
|
||||
$result = $companypaymentmode->update($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$result = $companypaymentmode->update($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
|
||||
http_response_code(500);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -1130,7 +1131,7 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P
|
|||
*/
|
||||
|
||||
// Add a flag "dispute_status" in invoice table to Dispute Open
|
||||
$result = $tmpinvoice->setStatut(1, null, '', 'FACTURE_MODIFY', 'dispute_status');
|
||||
$result = $tmpinvoice->setStatut(Facture::STATUS_VALIDATED, null, '', 'FACTURE_MODIFY', 'dispute_status');
|
||||
if ($result < 0) {
|
||||
$errormsg = $tmpinvoice->error.implode(', ', $tmpinvoice->errors);
|
||||
$error++;
|
||||
|
|
@ -1207,7 +1208,7 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P
|
|||
|
||||
if (!$error) {
|
||||
// Add status dispute_status to Dispute Open
|
||||
$result = $tmpinvoice->setStatut(1, null, '', 'FACTURE_MODIFY', 'dispute_status');
|
||||
$result = $tmpinvoice->setStatut(Facture::STATUS_VALIDATED, null, '', 'FACTURE_MODIFY', 'dispute_status');
|
||||
if ($result < 0) {
|
||||
$errormsg = $tmpinvoice->error.implode(', ', $tmpinvoice->errors);
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -596,7 +596,7 @@ if (empty($reshook)) {
|
|||
|
||||
// TODO add alternative status
|
||||
/*} elseif ($action == 'reopen' && ($user->hasRights('reception', 'creer') || $user->hasRights('reception', 'reception_advance', 'validate'))) {
|
||||
$result = $object->setStatut(0);
|
||||
$result = $object->setStatut(Reception::STATUS_DRAFT);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}*/
|
||||
|
|
|
|||
|
|
@ -208,6 +208,7 @@ class Reception extends CommonObject
|
|||
*/
|
||||
public $detail_batch;
|
||||
|
||||
const STATUS_CANCELED = -1;
|
||||
const STATUS_DRAFT = 0;
|
||||
const STATUS_VALIDATED = 1;
|
||||
const STATUS_CLOSED = 2;
|
||||
|
|
@ -1501,7 +1502,7 @@ class Reception extends CommonObject
|
|||
$origin_object->loadReceptions();
|
||||
//var_dump($this->$origin->receptions);exit;
|
||||
if (count($origin_object->receptions) <= 0) {
|
||||
$origin_object->setStatut(3); // ordered
|
||||
$origin_object->setStatut(3); // CommandeFournisseur ordered
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2438,7 +2439,7 @@ class Reception extends CommonObject
|
|||
}
|
||||
//var_dump($this->$origin->receptions);exit;
|
||||
if ($setStatut) {
|
||||
$this->origin_object->setStatut(3); // ordered
|
||||
$this->origin_object->setStatut(3); // CommandeFournisseur ordered
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ if (GETPOST('action', 'alpha') == 'set') {
|
|||
dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
// TakePOS connector require ReceiptPrinter module
|
||||
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector" && !isModEnabled('receiptprinter')) {
|
||||
activateModule("modReceiptPrinter");
|
||||
activateModule("modReceiptPrinter", 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -635,7 +635,7 @@ if (empty($reshook)) {
|
|||
if ($object->fetch(GETPOSTINT('id'), GETPOST('track_id', 'alpha')) >= 0) {
|
||||
$new_status = GETPOSTINT('new_status');
|
||||
//$old_status = $object->status;
|
||||
$res = $object->setStatut($new_status);
|
||||
$res = $object->setStatut($new_status, null, '', $triggermodname);
|
||||
if ($res) {
|
||||
$url = 'card.php?track_id=' . $object->track_id;
|
||||
header("Location: " . $url);
|
||||
|
|
|
|||
|
|
@ -3068,9 +3068,9 @@ class Ticket extends CommonObject
|
|||
if ((getDolGlobalInt('TICKET_SET_STATUS_ON_ANSWER', -1) < 0
|
||||
&& ($object->status < self::STATUS_IN_PROGRESS && !$user->socid && !$private))
|
||||
|| ($object->status > self::STATUS_IN_PROGRESS && $public_area)) {
|
||||
$object->setStatut($object::STATUS_IN_PROGRESS);
|
||||
$object->setStatut($object::STATUS_IN_PROGRESS, null, '', 'TICKET_MODIFY');
|
||||
} elseif (getDolGlobalInt('TICKET_SET_STATUS_ON_ANSWER', -1) >= 0 && empty($user->socid) && empty($private)) {
|
||||
$object->setStatut(getDolGlobalInt('TICKET_SET_STATUS_ON_ANSWER'));
|
||||
$object->setStatut(getDolGlobalInt('TICKET_SET_STATUS_ON_ANSWER'), null, '', 'TICKET_MODIFY');
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ if (empty($reshook)) {
|
|||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
if ($objecttmp->status == Ticket::STATUS_CLOSED || $objecttmp->status == Ticket::STATUS_CANCELED) {
|
||||
$result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED);
|
||||
$result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED, null, '', 'TICKET_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ define('DOL_VERSION', constant('DOL_MAJOR_VERSION').'.'.constant('DOL_MINOR_VERS
|
|||
// DOL_VERSION is now a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||
|
||||
// Set to 1 if the beta version is the candidate for certification or if the stable version has been certified.
|
||||
// Use 2 to force LNE features for debug purposes (https not required in this mode)
|
||||
// Use 2 to force LNE features for debug purposes, without less restrictions: Same than 1 but https not required in this mode
|
||||
// Unset for standard version.
|
||||
define('CERTIF_LNE', '2');
|
||||
//if (!defined('CERTIF_LNE')) {
|
||||
define('CERTIF_LNE', '2');
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ abstract class CommonClassTest extends TestCase
|
|||
|
||||
if ($nbLinesToShow) {
|
||||
print "\n";
|
||||
print "## We try to output the last ".$nbLinesToShow." lines of the log file ".basename($this->logfile)." (that has ".$totalLines." lines)".PHP_EOL;
|
||||
print "########## We try to output the last ".$nbLinesToShow." lines of the log file ".basename($this->logfile)." (that has ".$totalLines." lines)".PHP_EOL;
|
||||
$newLines = count($last_lines);
|
||||
if ($newLines > 0) {
|
||||
// Show partial log file contents when requested.
|
||||
|
|
@ -196,7 +196,7 @@ abstract class CommonClassTest extends TestCase
|
|||
foreach ($last_lines as $line) {
|
||||
print $line.PHP_EOL;
|
||||
}
|
||||
print "## end of dolibarr.log for $className::$failedTestMethod".PHP_EOL;
|
||||
print "########## end of dolibarr.log for $className::$failedTestMethod".PHP_EOL;
|
||||
} else {
|
||||
print "## No new lines in 'dolibarr.log' since start of this test.".PHP_EOL;
|
||||
}
|
||||
|
|
@ -207,7 +207,7 @@ abstract class CommonClassTest extends TestCase
|
|||
$logFile = '/var/log/apache2/travis_error_log';
|
||||
|
||||
// Check if the file exists and is readable
|
||||
if (file_exists($logFile) && is_readable($logFile)) {
|
||||
if (@file_exists($logFile) && is_readable($logFile)) {
|
||||
// Read the file into an array
|
||||
$lines = file($logFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
|
||||
|
|
@ -215,13 +215,13 @@ abstract class CommonClassTest extends TestCase
|
|||
$lastFiveLines = array_slice($lines, -10);
|
||||
|
||||
// Print the last 5 lines
|
||||
print "\n";
|
||||
print "Content of ".$logFile."\n";
|
||||
echo "Last 5 lines of $logFile:\n";
|
||||
foreach ($lastFiveLines as $line) {
|
||||
echo $line . "\n";
|
||||
}
|
||||
} else {
|
||||
echo "File $logFile does not exist or is not readable so we can't show more information.\n";
|
||||
//echo "File $logFile does not exist or is not readable so we can't show more information.\n";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue