2
0
forked from Wavyzz/dolibarr

Fix warnings

This commit is contained in:
Laurent Destailleur
2020-12-29 04:27:16 +01:00
parent 7b93c34c0f
commit af41c06822
7 changed files with 14 additions and 10 deletions

View File

@@ -1146,6 +1146,8 @@ class Categorie extends CommonObject
// First build full array $motherof
//$this->load_motherof(); // Disabled because already done by caller of build_path_from_id_categ
// $this->cats[$id_categ] is supposed to be already an array. We just want to complete it with property fullpath and fulllabel
// Define fullpath and fulllabel
$this->cats[$id_categ]['fullpath'] = '_'.$id_categ;
$this->cats[$id_categ]['fulllabel'] = $this->cats[$id_categ]['label'];

View File

@@ -7123,9 +7123,9 @@ function dol_sort_array(&$array, $index, $order = 'asc', $natsort = 0, $case_sen
foreach (array_keys($array) as $key)
{
if (is_object($array[$key])) {
$temp[$key] = $array[$key]->$index;
$temp[$key] = empty($array[$key]->$index) ? 0 : $array[$key]->$index;
} else {
$temp[$key] = $array[$key][$index];
$temp[$key] = empty($array[$key][$index]) ? 0 : $array[$key][$index];
}
}

View File

@@ -1252,7 +1252,7 @@ function check_value($mask, $value)
//print "masktri=".$masktri." maskcounter=".$maskcounter." maskwithonlyymcode=".$maskwithonlyymcode." maskwithnocode=".$maskwithnocode." maskraz=".$maskraz." maskoffset=".$maskoffset."<br>\n";
if (function_exists('mb_strrpos')) {
$posnumstart = mb_strrpos($maskwithnocode, $maskcounter, 'UTF-8');
$posnumstart = mb_strrpos($maskwithnocode, $maskcounter, 0, 'UTF-8');
}
else {
$posnumstart = strrpos($maskwithnocode, $maskcounter);

View File

@@ -212,8 +212,8 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
// Get Mask value
$mask = '';
if ($type == 0) $mask = $conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER;
if ($type == 1) $mask = $conf->global->COMPANY_ELEPHANT_MASK_SUPPLIER;
if ($type == 0) $mask = empty($conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER) ? '' : $conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER;
if ($type == 1) $mask = empty($conf->global->COMPANY_ELEPHANT_MASK_SUPPLIER) ? '' : $conf->global->COMPANY_ELEPHANT_MASK_SUPPLIER;
if (!$mask)
{
$this->error = 'NotConfigured';

View File

@@ -157,6 +157,8 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode
$i = 0;
$this->code = '';
$disponibility = 0;
if (is_object($societe))
{
dol_syslog("mod_codecompta_digitaria::get_code search code for type=".$type." & company=".(!empty($societe->name) ? $societe->name : ''));
@@ -216,8 +218,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode
}
}
if ($disponibility == 0)
{
if ($disponibility == 0) {
return 0; // return ok
} else {
return -1; // return ko

View File

@@ -109,7 +109,7 @@ if ($object->id > 0) {
$permissiontoread = $user->rights->societe->lire;
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->societe->delete || ($permissiontoadd && isset($object->status) && $object->status == 0);
$permissiontodelete = $user->rights->societe->supprimer || ($permissiontoadd && isset($object->status) && $object->status == 0);
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->societe->creer; // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
@@ -1355,7 +1355,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '<td'.($conf->browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning_fax').' <input type="text" name="fax" id="fax" class="maxwidth200 widthcentpercentminusx" value="'.(GETPOSTISSET('fax') ?GETPOST('fax', 'alpha') : $object->fax).'"></td></tr>';
// Email / Web
print '<tr><td>'.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', $conf->global->SOCIETE_EMAIL_MANDATORY).'</td>';
print '<tr><td>'.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', empty($conf->global->SOCIETE_EMAIL_MANDATORY) ? '' : $conf->global->SOCIETE_EMAIL_MANDATORY).'</td>';
print '<td colspan="3">'.img_picto('', 'object_email').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="email" id="email" value="'.$object->email.'"></td></tr>';
print '<tr><td>'.$form->editfieldkey('Web', 'url', '', $object, 0).'</td>';
print '<td colspan="3">'.img_picto('', 'globe').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="url" id="url" value="'.$object->url.'"></td></tr>';
@@ -1366,7 +1366,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '<tr>';
print '<td><label for="'.$value['label'].'">'.$form->editfieldkey($value['label'], $key, '', $object, 0).'</label></td>';
print '<td colspan="3">';
print '<input type="text" name="'.$key.'" id="'.$key.'" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET($key) ?GETPOST($key, 'alphanohtml') : $object->socialnetworks[$key]).'">';
print '<input type="text" name="'.$key.'" id="'.$key.'" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET($key) ? GETPOST($key, 'alphanohtml') : (empty($object->socialnetworks[$key]) ? '' : $object->socialnetworks[$key])).'">';
print '</td>';
print '</tr>';
} elseif (!empty($object->socialnetworks[$key])) {

View File

@@ -2418,6 +2418,7 @@ class User extends CommonObject
}
$result = ''; $label = '';
$companylink = '';
if (!empty($this->photo)) {
$label .= '<div class="photointooltip">';