fix warnings

This commit is contained in:
Frédéric FRANCE 2022-10-13 20:28:16 +02:00
parent c001fd9ba4
commit 220da95fa4
3 changed files with 15 additions and 3 deletions

View File

@ -652,7 +652,7 @@ foreach ($accounts as $key => $type) {
print '<span class="opacitymedium">'.$langs->trans("ConciliationDisabled").'</span>';
} else {
$result = $objecttmp->load_board($user, $objecttmp->id);
if ($result < 0) {
if (is_numeric($result) && $result < 0) {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
} else {
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&id='.$objecttmp->id.'&search_account='.$objecttmp->id.'&search_conciliated=0&contextpage=banktransactionlist">';

View File

@ -438,7 +438,11 @@ function societe_prepare_head2($object)
*/
function societe_admin_prepare_head()
{
global $langs, $conf, $user;
global $langs, $conf, $user, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('societe');
$extrafields->fetch_name_optionals_label('socpeople');
$h = 0;
$head = array();
@ -456,11 +460,19 @@ function societe_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsThirdParties");
$nbExtrafields = $extrafields->attributes['societe']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/societe/admin/contact_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsContacts");
$nbExtrafields = $extrafields->attributes['socpeople']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes_contacts';
$h++;

View File

@ -23,7 +23,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
$tmpkey = 'options_'.$key;
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey)) {
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && isset($obj->$tmpkey) && !is_numeric($obj->$tmpkey)) {
$datenotinstring = $obj->$tmpkey;
if (!is_numeric($obj->$tmpkey)) { // For backward compatibility
$datenotinstring = $db->jdate($datenotinstring);