Skip to content

Commit

Permalink
Merge branch 'develop' into New-add-ip-field-to-socpeople-class
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Sep 26, 2024
2 parents 9eec088 + 7127f44 commit d7ae6e1
Show file tree
Hide file tree
Showing 81 changed files with 1,177 additions and 1,113 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ repos:
- -x
- dev/tools/codespell/codespell-lines-ignore.txt
exclude_types: [image]
exclude: (?x)^(.phan/stubs/.*)$
exclude: (?x)^(.phan/stubs/.*|phpstan\.neon.*)$
additional_dependencies: [tomli]
- alias: codespell-lang-en_US
# Only for translations with specialised exceptions
Expand Down
62 changes: 25 additions & 37 deletions dev/tools/phan/baseline.txt

Large diffs are not rendered by default.

28 changes: 21 additions & 7 deletions htdocs/accountancy/closure/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,28 @@
$separate_auxiliary_account = GETPOST('separate_auxiliary_account', 'aZ09');
$generate_bookkeeping_records = GETPOST('generate_bookkeeping_records', 'aZ09');

$result = $object->closeFiscalPeriod($current_fiscal_period['id'], $new_fiscal_period_id, $separate_auxiliary_account, $generate_bookkeeping_records);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessages($langs->trans("AccountancyClosureCloseSuccessfully"), null, 'mesgs');
$error = 0;
if ($generate_bookkeeping_records) {
if (!getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT')) {
$error++;
setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors');
}
if (!getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT')) {
$error++;
setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors');
}
}

header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : ''));
exit;
if (!$error) {
$result = $object->closeFiscalPeriod($current_fiscal_period['id'], $new_fiscal_period_id, $separate_auxiliary_account, $generate_bookkeeping_records);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessages($langs->trans("AccountancyClosureCloseSuccessfully"), null, 'mesgs');

header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : ''));
exit;
}
}
} elseif ($action == 'confirm_step_3' && $confirm == "yes") {
$inventory_journal_id = GETPOSTINT('inventory_journal_id');
Expand Down
4 changes: 0 additions & 4 deletions htdocs/adherents/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,7 @@
$tableprefix = 'd';
$arrayfields = array();
foreach ($object->fields as $key => $val) {
if (!array_key_exists($tableprefix.'.'.$key, $arrayfields)) { // Discard record not into $arrayfields
continue;
}
// If $val['visible']==0, then we never show the field

if (!empty($val['visible'])) {
$visible = (int) dol_eval((string) $val['visible'], 1);
$arrayfields[$tableprefix.'.'.$key] = array(
Expand Down
6 changes: 3 additions & 3 deletions htdocs/admin/dict.php
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,7 @@
}

if (empty($reshook)) {
fieldList($fieldlist, $obj, $tabname[$id], 'add');
dictFieldList($fieldlist, $obj, $tabname[$id], 'add');
}

if ($id == DICT_COUNTRY) {
Expand Down Expand Up @@ -2280,7 +2280,7 @@

// Show fields
if (empty($reshook)) {
$withentity = fieldList($fieldlist, $obj, $tabname[$id], 'edit');
$withentity = dictFieldList($fieldlist, $obj, $tabname[$id], 'edit');
}

print '<td colspan="3" class="center">';
Expand Down Expand Up @@ -2680,7 +2680,7 @@
* @param ''|'add'|'edit'|'hide' $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we don't want it to be rendered
* @return string '' or value of entity into table
*/
function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
function dictFieldList($fieldlist, $obj = null, $tabname = '', $context = '')
{
global $langs, $db, $mysoc;
global $form;
Expand Down
16 changes: 14 additions & 2 deletions htdocs/admin/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@

if ($action == 'install' && $allowonlineinstall) {
$error = 0;

$modulenameval = '';
// $original_file should match format module_modulename-x.y[.z].zip
$original_file = basename($_FILES["fileinstall"]["name"]);
$original_file = preg_replace('/\s*\(\d+\)\.zip$/i', '.zip', $original_file);
Expand Down Expand Up @@ -282,8 +282,20 @@
}

if (!$error) {
$message = $langs->trans("SetupIsReadyForUse", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules"));
$searchParams = array(
'search_keyword' => $modulenameval,
'search_status' => '-1',
'search_nature' => '-1',
'search_version' => '-1'
);
$queryString = http_build_query($searchParams);
$redirectUrl = DOL_URL_ROOT . '/admin/modules.php?' . $queryString;

$message = $langs->trans("SetupIsReadyForUse", $redirectUrl, $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules"));

setEventMessages($message, null, 'warnings');
header('Location: ' . $redirectUrl);
exit;
}
} elseif ($action == 'install' && !$allowonlineinstall) {
httponly_accessforbidden("You try to bypass the protection to disallow deployment of an external module. Hack attempt ?");
Expand Down
4 changes: 3 additions & 1 deletion htdocs/admin/pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,10 @@
print '</td></tr>';

print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_A").'</td><td>';

//$pdfa = false; // PDF default version
$pdfa = getDolGlobalString('PDF_USE_A', '3'); // PDF/A-1 ou PDF/A-3
$pdfa = getDolGlobalInt('PDF_USE_A', 0); // PDF/A-1 ou PDF/A-3

print $form->selectarray('PDF_USE_A', $arraylistofpdfformat, $pdfa);
print '</td></tr>';

Expand Down
2 changes: 1 addition & 1 deletion htdocs/api/class/api_documents.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ public function post($filename, $modulepart, $ref = '', $subdir = '', $fileconte
// Move the temporary file at its final emplacement
$result = dol_move($destfiletmp, $dest_file, '0', $overwriteifexists, 1, 1, $moreinfo);
if (!$result) {
throw new RestException(500, "Failed to move file into '".$destfile."'");
throw new RestException(500, "Failed to move file into '".$dest_file."'");
}

return dol_basename($destfile);
Expand Down
4 changes: 2 additions & 2 deletions htdocs/bookmarks/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

$permissiontoread = $user->hasRight('bookmark', 'lire');
$permissiontoadd = $user->hasRight('bookmark', 'creer');
$permissiontodelete = $user->hasRight('bookmark', 'supprimer');
$permissiontodelete = ($user->hasRight('bookmark', 'supprimer') || ($permissiontoadd && $object->fk_user == $user->id)); // Can always delete its own bookmark



Expand Down Expand Up @@ -326,7 +326,7 @@

// Buttons

print "<div class=\"tabsAction\">\n";
print '<div class="tabsAction">'."\n";

// Edit
if ($permissiontoadd && $action != 'edit') {
Expand Down
5 changes: 3 additions & 2 deletions htdocs/comm/action/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -2336,12 +2336,13 @@ function setdatefields()
// Type
if (getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td>';
$labeltoshow = $langs->trans("Action".$object->type_code);
$labeltype = ($langs->transnoentities("Action".$object->type_code) != "Action".$object->type_code) ? $langs->transnoentities("Action".$object->type_code) : $object->type_label;
$labeltoshow = $labeltype;
if ($object->code) {
$labeltoshow .= ' ('.$object->code.')';
}
print $object->getTypePicto('pictofixedwidth paddingright', $labeltoshow);
print $langs->trans("Action".$object->type_code);
print $labeltype;
print '</td></tr>';
}

Expand Down
1 change: 1 addition & 0 deletions htdocs/comm/action/class/actioncomm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '', $loadres
$this->type_color = $obj->type_color;
$this->type_picto = $obj->type_picto;
$this->type = $obj->type_type;
$this->type_label = $obj->type_label;

$this->code = $obj->code;
$this->label = $obj->label;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@


// Multiprice level
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans("PriceLevel");
Expand Down
Loading

0 comments on commit d7ae6e1

Please sign in to comment.