FIX Loan - Undefined variable #31973 & #31974 (#31977)

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Alexandre SPANGARO 2024-11-18 21:25:46 +01:00 committed by GitHub
parent 2f6e814d6f
commit d558075cb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 15 additions and 13 deletions

View File

@ -84,7 +84,7 @@ $upload_dir = $conf->loan->dir_output.'/'.dol_sanitizeFileName($object->ref);
$modulepart = 'loan';
$permissiontoadd = $user->hasRight('loan', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
$morehtmlright = '';
/*
* Actions
@ -128,7 +128,7 @@ if ($object->id) {
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 16, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref .= '</form>';
} else {

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2014-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -113,7 +113,7 @@ print '<div class="underbanner clearboth"></div>';
print '<br>';
print '<table width="100%"><tr><td>';
print '<table class="centpercent"><tr><td>';
dol_print_object_info($object);
print '</td></tr></table>';

View File

@ -39,10 +39,11 @@ require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
// Load translation files required by the page
$langs->loadLangs(array("banks", "bills", "compta", "loan"));
// Get parameters
$search_all = trim(GETPOST('search_all', 'alphanohtml'));
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions?
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list

View File

@ -64,7 +64,7 @@ $morehtmlright = '';
/*
* Actions
* Actions
*/
@ -78,10 +78,11 @@ if (empty($reshook)) {
/*
* View
* View
*/
$form = new Form($db);
$formproject = new FormProjets($db);
$title = $langs->trans("Loan").' - '.$langs->trans("Notes");
$help_url = 'EN:Module_Loan|FR:Module_Emprunt';
@ -90,7 +91,7 @@ llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-loan page-card_note'
if ($id > 0) {
/*
* Affichage onglets
* Show tabs
*/
$totalpaid = $object->getSumPayment();
@ -114,7 +115,7 @@ if ($id > 0) {
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 16, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref .= '</form>';
} else {

View File

@ -3,7 +3,7 @@
* Copyright (C) 2018-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -159,7 +159,7 @@ if ($action == 'updateecheancier' && empty($pay_without_schedule) && $permission
$form = new Form($db);
$formproject = new FormProjets($db);
$title = $langs->trans("Loan").' - '.$langs->trans("Card");
$title = $langs->trans("Loan").' - '.$langs->trans("FinancialCommitment");
$help_url = 'EN:Module_Loan|FR:Module_Emprunt';
llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-loan page-card_schedule');
@ -185,7 +185,7 @@ if (isModEnabled('project')) {
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref .= $formproject->select_projects(-1, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= $formproject->select_projects(-1, $object->fk_project, 'projectid', 16, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref .= '</form>';
} else {