diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 513a99d843f..037d27ea852 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1562,7 +1562,7 @@ class Adherent extends CommonObject * * @param int $withpictoimg 0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small) * @param int $maxlen length max label - * @param string $option Page for link + * @param string $option Page for link ('card', 'category', 'subscription', ...) * @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login, 'ref'=Show ref * @param string $morecss Add more css on link * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking @@ -1592,10 +1592,7 @@ class Adherent extends CommonObject $label.= '
' . $langs->trans('Name') . ': ' . $this->getFullName($langs); $label.=''; - if (empty($option) || $option == 'card' || $option == 'category') - { - $url = DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id; - } + $url = DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id; if ($option == 'subscription') { $url = DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$this->id; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 30c85618bfa..5537730e678 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -59,7 +59,7 @@ class AdherentType extends CommonObject public $note; /** @var bool Can vote*/ public $vote; - /** @var bool Email sent during validation */ + /** @var string Email sent during validation */ public $mail_valid; /** @var array Array of members */ public $members=array(); @@ -481,7 +481,7 @@ class AdherentType extends CommonObject // Initialise parametres $this->id = 0; - $this->ref = 0; + $this->ref = 'MTSPEC'; $this->specimen=1; $this->label='MEMBERS TYPE SPECIMEN'; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 673ce2f2d24..068513b245c 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1749,7 +1749,7 @@ $db->close(); * @param Object $obj If we show a particular record, obj is filled with record fields * @param string $tabname Name of SQL table * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered - * @return void + * @return string '' or value of entity into table */ function fieldList($fieldlist, $obj='', $tabname='', $context='') { @@ -1763,7 +1763,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') $formcompany = new FormCompany($db); if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); - $withentity=null; + $withentity=''; foreach ($fieldlist as $field => $value) { diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 670d47ba3ee..123b5f50bd8 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -104,7 +104,7 @@ class Documents extends DolibarrApi { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $this->invoice = new Facture($this->db); - $result = $this->invoice->fetch(0, $ref); + $result = $this->invoice->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file))); if( ! $result ) { throw new RestException(404, 'Invoice not found'); } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index b4381349aec..73634f0d5e8 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -930,7 +930,7 @@ class ExtraFields if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. $value=price($value); } - $out.=' '.$langs->getCurrencySymbol($conf->currency); + $out=' '.$langs->getCurrencySymbol($conf->currency); } elseif ($type == 'double') { diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index b11389905a4..11f8b70f26b 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -328,14 +328,14 @@ class DolibarrModules // Can not be abstract, because we need to insta public $langfiles; /** - * @var string[] Array of warnings to show when we activate the module + * @var array Array of warnings to show when we activate the module * * array('always'='text') or array('FR'='text') */ public $warnings_activation; /** - * @var string[] Array of warnings to show when we activate an external module + * @var array Array of warnings to show when we activate an external module * * array('always'='text') or array('FR'='text') */ diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 0035b18d3c7..7af07c8675b 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -82,10 +82,9 @@ class EcmFiles //extends CommonObject /** * Create object into database * - * @param User $user User that creates - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int <0 if KO, Id of created object if OK + * @param User $user User that creates + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, Id of created object if OK */ public function create(User $user, $notrigger = false) { @@ -144,8 +143,8 @@ class EcmFiles //extends CommonObject if (empty($this->date_c)) $this->date_c = dol_now(); // If ref not defined - if (empty($ref)) $ref = dol_hash($this->filepath.'/'.$this->filename, 3); - + $ref = dol_hash($this->filepath.'/'.$this->filename, 3); + if (! empty($this->ref)) $ref=$this->ref; $maxposition=0; if (empty($this->position)) // Get max used diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 014c9de3a19..f26efeadc4a 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1487,14 +1487,14 @@ class Expedition extends CommonObject * Return clicable link of object (with eventually picto) * * @param int $withpicto Add picto into link - * @param int $option Where point the link + * @param string $option Where the link point to * @param int $max Max length to show * @param int $short Use short labels * @param int $notooltip 1=No tooltip * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @return string String with URL */ - function getNomUrl($withpicto=0, $option=0, $max=0, $short=0, $notooltip=0, $save_lastsearch_value=-1) + function getNomUrl($withpicto=0, $option='', $max=0, $short=0, $notooltip=0, $save_lastsearch_value=-1) { global $langs; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index bdbb03492f7..b67e5073144 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -663,7 +663,7 @@ class Fichinter extends CommonObject */ function getNomUrl($withpicto=0, $option='', $notooltip=0, $save_lastsearch_value=-1) { - global $langs; + global $conf, $langs; $result=''; @@ -674,13 +674,13 @@ class Fichinter extends CommonObject $picto='intervention'; $url = DOL_URL_ROOT.'/fichinter/card.php?id='.$this->id; - //if ($option !== 'nolink') - //{ - // Add param to save lastsearch_values or not + if ($option !== 'nolink') + { + // Add param to save lastsearch_values or not $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; - //} + } $linkclose=''; if (empty($notooltip)) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 70d00bd2f01..382530225fd 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -781,12 +781,13 @@ class Holiday extends CommonObject $num_rows = $this->db->num_rows($resql); // Note, we can have 2 records if on is morning and the other one is afternoon if ($num_rows > 0) { + $arrayofrecord=array(); $i=0; while ($i < $num_rows) { $obj = $this->db->fetch_object($resql); - // Note: $obj->halday is 0:Full days, 2:Sart afternoon end morning, -1:Start afternoon, 1:End morning + // Note: $obj->halfday is 0:Full days, 2:Sart afternoon end morning, -1:Start afternoon, 1:End morning $arrayofrecord[$obj->rowid]=array('date_start'=>$this->db->jdate($obj->date_start), 'date_end'=>$this->db->jdate($obj->date_end), 'halfday'=>$obj->halfday); $i++; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a7c2d0f1a6b..980faafc028 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2109,8 +2109,8 @@ class User extends CommonObject if (! empty($_SESSION["disablemodules"])) $label.= '
'.$langs->trans("DisabledModules").':
'.join(', ',explode(',',$_SESSION["disablemodules"])); } - if ($option == 'leave') $url.= DOL_URL_ROOT.'/holiday/list.php?id='.$this->id; - else $link.= $url.= DOL_URL_ROOT.'/user/card.php?id='.$this->id; + $url = DOL_URL_ROOT.'/user/card.php?id='.$this->id; + if ($option == 'leave') $url = DOL_URL_ROOT.'/holiday/list.php?id='.$this->id; if ($option != 'nolink') { diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index a6de8c15c65..f2b94ff5705 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -1861,7 +1861,6 @@ function dolSaveHtmlHeader($filehtmlheader, $htmlheadercontent) if (! $result) { - $error++; setEventMessages('Failed to write file '.$filehtmlheader, null, 'errors'); return false; } @@ -1887,14 +1886,13 @@ function dolSaveCssFile($filecss, $csscontent) if (! empty($conf->global->MAIN_UMASK)) @chmod($filecss, octdec($conf->global->MAIN_UMASK)); - if (! $result) - { - $error++; - setEventMessages('Failed to write file '.$filecss, null, 'errors'); - return false; - } + if (! $result) + { + setEventMessages('Failed to write file '.$filecss, null, 'errors'); + return false; + } - return true; + return true; } /** @@ -1917,7 +1915,6 @@ function dolSaveRobotFile($filerobot, $robotcontent) if (! $result) { - $error++; setEventMessages('Failed to write file '.$filerobot, null, 'errors'); return false; } @@ -1945,7 +1942,6 @@ function dolSaveHtaccessFile($filehtaccess, $htaccess) if (! $result) { - $error++; setEventMessages('Failed to write file '.$filehtaccess, null, 'errors'); return false; }