php 8.1 warnings suite

This commit is contained in:
lmarcouiller 2022-09-27 15:21:10 +02:00
parent 91d0eefd92
commit 45be6ab024
8 changed files with 40 additions and 16 deletions

View File

@ -612,7 +612,7 @@ class ChargeSociales extends CommonObject
}
$linkclose = '';
if (empty($notooltip) && $user->rights->facture->lire) {
if (empty($notooltip) && $user->hasRight("facture", "read")) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$label = $langs->trans("SocialContribution");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';

View File

@ -345,8 +345,8 @@ class Tva extends CommonObject
$this->fk_user_creat = $obj->fk_user_creat;
$this->fk_user_modif = $obj->fk_user_modif;
$this->fk_account = $obj->fk_account;
$this->fk_type = $obj->fk_type;
$this->rappro = $obj->rappro;
$this->fk_type = !empty($obj->fk_type) ? $obj->fk_type : "";
$this->rappro = !empty($obj->fk_type) ? $obj->rappro : "";
}
$this->db->free($resql);

View File

@ -55,6 +55,7 @@ $search_type = GETPOST('search_type', 'int');
$search_account = GETPOST('search_account', 'int');
$search_amount = GETPOST('search_amount', 'alpha');
$search_status = GETPOST('search_status', 'int');
$ltt = GETPOST("ltt", "int");
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
@ -278,6 +279,13 @@ if (!empty($search_amount)) {
if ($search_status != '' && $search_status != '-1') {
$param .= '&search_status='.urlencode($search_status);
}
$arrayofmassactions = array(
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
);
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$moreforfilter = '';
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') {
@ -294,7 +302,7 @@ $url = DOL_URL_ROOT.'/compta/tva/card.php?action=create';
if (!empty($socid)) {
$url .= '&socid='.$socid;
}
$newcardbutton = dolGetButtonTitle($langs->trans('NewVATPayment', ($ltt + 1)), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer);
$newcardbutton = dolGetButtonTitle($langs->trans('NewVATPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer);
print_barre_liste($langs->trans("VATDeclarations"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
$varpage = empty($contextpage) ? $_SERVER['PHP_SELF'] : $contextpage;
@ -429,6 +437,9 @@ print '</tr>';
$i = 0;
$totalarray = array();
$totalarray['nbfield'] = 0;
$total = 0;
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql);
@ -523,7 +534,11 @@ while ($i < min($num, $limit)) {
$totalarray['nbfield']++;
}
$totalarray['pos'][$totalarray['nbfield']] = 'amount';
$totalarray['val']['amount'] += $obj->amount;
if (empty($totalarray['val']['amount'])) {
$totalarray['val']['amount'] = $obj->amount;
} else {
$totalarray['val']['amount'] += $obj->amount;
}
}
if (!empty($arrayfields['t.status']['checked'])) {

View File

@ -42,6 +42,7 @@ $langs->loadLangs(array('compta', 'bills'));
$mode = GETPOST("mode", 'alpha');
$year = GETPOST("year", 'int');
$filtre = GETPOST("filtre", 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
if (!$year && $mode != 'tvaonly') {
$year = date("Y", time());
}
@ -113,6 +114,8 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
$center = '';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit);
if ($year) {

View File

@ -494,7 +494,9 @@ if ($action == 'create') {
print '<tr>';
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
print '<td>';
if (!isset($note_public)) {
$note_public = $object->getDefaultCreateValueFor('note_public');
}
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
print $doleditor->Create(1);
print '</td></tr>';
@ -504,7 +506,9 @@ if ($action == 'create') {
print '<tr>';
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
print '<td>';
if (!isset($note_private)) {
$note_private = $object->getDefaultCreateValueFor('note_private');
}
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
print $doleditor->Create(1);
print '</td></tr>';
@ -672,6 +676,7 @@ if (!empty($id) && $action == 'edit') {
/* */
/* ************************************************************ */
if (!empty($id) && $action != 'edit') {
$formconfirm = "";
// Confirmation delete
if ($action == 'delete') {
$text = $langs->trans("ConfirmDeleteADonation");
@ -802,7 +807,7 @@ if (!empty($id) && $action != 'edit') {
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$i = 0; $total = 0;
$i = 0; $total = 0; $totalpaid = 0;
print '<table class="noborder paymenttable centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("RefPayment").'</td>';
@ -832,7 +837,7 @@ if (!empty($id) && $action != 'edit') {
$remaintopay = $object->amount - $totalpaid;
print "<tr><td colspan=\"3\" class=\"right\">".$langs->trans("RemainderToPay")." :</td>";
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : '').'">'.price($remaintopay)."</td></tr>\n";
print '<td class="right'.(!empty($resteapayeraffiche) ? ' amountremaintopay' : '').'">'.price($remaintopay)."</td></tr>\n";
}
print "</table>";
$db->free($resql);

View File

@ -406,9 +406,9 @@ class Don extends CommonObject
$sql .= ", ".((int) $user->id);
$sql .= ", null";
$sql .= ", '".$this->db->idate($this->date)."'";
$sql .= ", '".$this->db->escape(trim($this->email))."'";
$sql .= ", '".$this->db->escape(trim($this->phone))."'";
$sql .= ", '".$this->db->escape(trim($this->phone_mobile))."'";
$sql .= ", '".(!empty($this->email) ? $this->db->escape(trim($this->email)) : "")."'";
$sql .= ", '".(!empty($this->phone) ? $this->db->escape(trim($this->phone)) : "")."'";
$sql .= ", '".(!empty($this->phone_mobile) ? $this->db->escape(trim($this->phone_mobile)) : "")."'";
$sql .= ")";
$resql = $this->db->query($sql);
@ -989,7 +989,7 @@ class Don extends CommonObject
$this->user_creation_id = $obj->fk_user_author;
$this->user_validation_id = $obj->fk_user_valid;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->tms);
$this->date_modification = (!empty($obj->tms) ? $this->db->jdate($obj->tms) : "");
}
$this->db->free($result);
} else {

View File

@ -78,7 +78,7 @@ if (!$sortfield) {
$object = new Don($db);
$object->fetch($id, $ref);
$upload_dir = $conf->don->dir_output.'/'.get_exdir($filename, 0, 0, 0, $object, 'donation').'/'.dol_sanitizeFileName($object->ref);
$upload_dir = $conf->don->dir_output.'/'.get_exdir($id, 0, 0, 0, $object, 'donation').'/'.dol_sanitizeFileName($object->ref);
$modulepart = 'don';
$permissiontoadd = $user->rights->don->creer; // Used by the include of actions_dellink.inc.php

View File

@ -41,6 +41,7 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$type = GETPOST('type', 'aZ');
if (empty($page) || $page == -1) {
$page = 0;
} // If $page is not defined, or '' or -1
@ -61,7 +62,7 @@ $search_company = GETPOST('search_company', 'alpha');
$search_name = GETPOST('search_name', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$moreforfilter = GETPOST('moreforfilter', 'alpha');
if (!$user->rights->don->lire) {
accessforbidden();
}
@ -198,7 +199,7 @@ if ($resql) {
}
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<table class="tagtable liste'.(!empty($moreforfilter) ? " listwithfilterbefore" : "").'">'."\n";
// Filters lines
print '<tr class="liste_titre_filter">';