Fix : php 8.1 warnings

This commit is contained in:
lmarcouiller 2022-09-23 16:05:11 +02:00
parent 4ef5a3b6b6
commit b0d2aa6d9b
11 changed files with 27 additions and 21 deletions

View File

@ -268,7 +268,7 @@ if ($rowid && $action != 'edit') {
// Confirmation to delete subscription
if ($action == 'delete') {
//$formquestion=array();
$formquestion=array();
//$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>';
$text = $langs->trans("ConfirmDeleteSubscription");
if (isModEnabled("banque") && !empty($conf->global->ADHERENT_BANK_USE)) {
@ -351,7 +351,7 @@ if ($rowid && $action != 'edit') {
print '<div class="tabsAction">';
if ($user->rights->adherent->cotisation->creer) {
if (!$bankline->rappro) {
if (!empty($bankline->rappro)) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify")."</a></div>";
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.$langs->trans("BankLineConciliated")."\" href=\"#\">".$langs->trans("Modify")."</a></div>";

View File

@ -357,7 +357,7 @@ print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? img_warning().' ' : img_picto('', 'tick').' ';
print yn(empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 0 : 1);
if (empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
print ' - <span class="opacitymedium">'.$langs->trans("Recommended").': '.$langs->trans("DefinedAPathForAntivirusCommandIntoSetup", $langs->transnoentitiesnoconv("Home")." - ".$langs->transcountrynoentities("Setup")." - ".$langs->transnoentitiesnoconv("Security")).'</span>';
print ' - <span class="opacitymedium">'.$langs->trans("Recommended").': '.$langs->trans("DefinedAPathForAntivirusCommandIntoSetup", $langs->transnoentitiesnoconv("Home")." - ".$langs->transnoentitiesnoconv("Setup")." - ".$langs->transnoentitiesnoconv("Security")).'</span>';
} else {
print ' &nbsp; - '.$conf->global->MAIN_ANTIVIRUS_COMMAND;
if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {

View File

@ -1780,7 +1780,7 @@ class Facture extends CommonInvoice
$url = DOL_URL_ROOT.'/compta/facture/card.php?facid='.$this->id;
}
if (!$user->rights->facture->lire) {
if (!$user->hasRight("facture", "read")) {
$option = 'nolink';
}
@ -1811,7 +1811,7 @@ class Facture extends CommonInvoice
}
$label = '';
if ($user->rights->facture->lire) {
if ($user->hasRight("facture", "read")) {
$label = img_picto('', $picto).' <u class="paddingrightonly">'.$langs->trans("Invoice").'</u>';
if (isset($this->statut) && isset($this->alreadypaid)) {
$label .= ' '.$this->getLibStatut(5, $this->alreadypaid);
@ -1847,7 +1847,7 @@ class Facture extends CommonInvoice
}
$linkclose = ($target ? ' target="'.$target.'"' : '');
if (empty($notooltip) && $user->rights->facture->lire) {
if (empty($notooltip) && $user->hasRight("facture", "read")) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$label = $langs->trans("Invoice");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';

View File

@ -1075,10 +1075,10 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print '<td colspan="'.($colspan - 1).'">';
//print ajax_constantonoff("MAIN_OPTIMIZEFORTEXTBROWSER", array(), null, 0, 0, 1, 0);
if ($edit) {
print $form->selectyesno('MAIN_OPTIMIZEFORTEXTBROWSER', $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER, 1);
print $form->selectyesno('MAIN_OPTIMIZEFORTEXTBROWSER', (isset($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER) ? $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER : 0), 1);
} else {
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
print yn($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER);
print yn(isset($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER) ? $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER : 0);
} else {
print yn(1);
if (empty($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) {
@ -1128,7 +1128,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
);
if ($edit) {
print $form->selectArray('MAIN_OPTIMIZEFORCOLORBLIND', $colorBlindOptions, $fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND, 0);
print $form->selectArray('MAIN_OPTIMIZEFORCOLORBLIND', $colorBlindOptions, (isset($fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND) ? $fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND : 0), 0);
} else {
if (!empty($fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND) && isset($colorBlindOptions[$fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND])) {
print $colorBlindOptions[$fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND];

View File

@ -713,7 +713,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
$member = $this->context['member'];
$member = (isset($this->context['member']) ? $this->context['member'] : null);
if (!is_object($member)) { // This should not happen
dol_syslog("Execute a trigger MEMBER_SUBSCRIPTION_CREATE with context key 'member' not an object");
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
@ -731,7 +731,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->actionmsg .= "\n".$langs->transnoentities("Period").': '.dol_print_date($object->dateh, 'day').' - '.dol_print_date($object->datef, 'day');
$object->sendtoid = 0;
if ($object->fk_soc > 0) {
if ( isset($object->fk_soc) && $object->fk_soc > 0) {
$object->socid = $object->fk_soc;
}
} elseif ($action == 'MEMBER_SUBSCRIPTION_MODIFY') {
@ -767,12 +767,12 @@ class InterfaceActionsAuto extends DolibarrTriggers
}
$object->actionmsg = $langs->transnoentities("MemberSubscriptionDeletedInDolibarr", $object->ref, $object->getFullName($langs));
$object->actionmsg .= "\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
$object->actionmsg .= "\n".$langs->transnoentities("Type").': '.$object->type;
$object->actionmsg .= "\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount;
$object->actionmsg .= "\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start, 'day').' - '.dol_print_date($object->last_subscription_date_end, 'day');
$object->actionmsg .= "\n".$langs->transnoentities("Type").': '.$object->fk_type;
$object->actionmsg .= "\n".$langs->transnoentities("Amount").': '.$object->amount;
$object->actionmsg .= "\n".$langs->transnoentities("Period").': '.dol_print_date($object->dateh, 'day').' - '.dol_print_date($object->datef, 'day');
$object->sendtoid = 0;
if ($object->fk_soc > 0) {
if (isset($object->fk_soc) && $object->fk_soc > 0) {
$object->socid = $object->fk_soc;
}
} elseif ($action == 'MEMBER_RESILIATE') {

View File

@ -37,6 +37,7 @@ $langs->loadLangs(array("partnership", "other"));
// Get parameters
$id = GETPOST('id', 'int');
$socid = GETPOST('socid', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');

View File

@ -42,7 +42,7 @@ $cancel = GETPOST('cancel', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'partnershipcard'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
//$lineid = GETPOST('lineid', 'int');
$lineid = GETPOST('lineid', 'int');
// Initialize technical objects
$object = new Partnership($db);
@ -434,6 +434,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}*/
$morehtmlref .= '</div>';
if (!isset($npfilter)) {
$npfilter = "";
}
if ($managedfor == 'member') $npfilter .= " AND te.fk_member > 0 "; else $npfilter .= " AND te.fk_soc > 0 ";
$object->next_prev_filter = $npfilter;

View File

@ -1469,6 +1469,7 @@ if ($source == 'contractline') {
if ($source == 'member' || $source == 'membersubscription') {
$newsource = 'member';
$tag="";
$found = true;
$langs->load("members");

View File

@ -814,19 +814,19 @@ foreach ($object->fields as $key => $val) {
print '</td>';
} elseif ($key == 'type_code') {
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
$formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150'));
$formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150'));
print '</td>';
} elseif ($key == 'category_code') {
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
$formTicket->selectGroupTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150'));
$formTicket->selectGroupTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150'));
print '</td>';
} elseif ($key == 'severity_code') {
print '<td class="liste_titre center'.($cssforfield ? ' '.$cssforfield : '').'">';
$formTicket->selectSeveritiesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150'));
$formTicket->selectSeveritiesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150'));
print '</td>';
} elseif ($key == 'fk_user_assign' || $key == 'fk_user_create') {
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
print $form->select_dolusers((empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, 1, null, 0, '', '', '0', 0, 0, '', 0, '', ($val['css'] ? $val['css'] : 'maxwidth100'));
print $form->select_dolusers((empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, 1, null, 0, '', '', '0', 0, 0, '', 0, '', (!empty($val['css']) ? $val['css'] : 'maxwidth100'));
print '</td>';
} elseif ($key == 'fk_statut') {
$arrayofstatus = array();

View File

@ -2583,6 +2583,7 @@ if ($action == 'create' || $action == 'adduserldap') {
$cate_arbo = $form->select_all_categories(Categorie::TYPE_USER, null, null, null, null, 1);
$c = new Categorie($db);
$cats = $c->containing($object->id, Categorie::TYPE_USER);
$arrayselected = array();
foreach ($cats as $cat) {
$arrayselected[] = $cat->id;
}

View File

@ -320,7 +320,7 @@ if ($action == 'edit') {
print '> <label for="check_AGENDA_DEFAULT_VIEW">'.$langs->trans("UsePersonalValue").'</label></td>';
print '<td>'."\n";
$tmplist = array(''=>'&nbsp;', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '');
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, (isset($object->conf->AGENDA_DEFAULT_VIEW) ? $object->conf->AGENDA_DEFAULT_VIEW : ''), 0, 0, 0, '');
print '</td></tr>'."\n";
// Max size of lists