diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7fefd5100b5..6e779b97463 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,11 +44,11 @@ Use clear commit messages with the following structure:
 FIX|Fix #456 Short description (where #456 is number of bug fix, if it exists. In upper case to appear into ChangeLog)
 or
-CLOSE|Close #456 Short description (where #456 is number feature request, if it exists. In upper case to appear into ChangeLog)
+CLOSE|Close #456 Short description (where #456 is number of feature request, if it exists. In upper case to appear into ChangeLog)
 or
-NEW|New Short description (In upper case to appear into ChangeLog)
+NEW|New Short description (In upper case to appear into ChangeLog, use this if you add a feature not tracked, otherwise use CLOSE #456)
 or
-Short description (when the commit is not introducing feature or closing a bug)
+Short description (when the commit is not introducing feature nor closing a bug)
 
 Long description (Can span accross multiple lines).
 
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index c8c4f9b9ad4..7a4510119dc 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2014 Alexandre Spangaro + * Copyright (C) 2014-2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -77,7 +77,7 @@ class Adherent extends CommonObject var $morphy; var $public; - var $note; // Private note + var $note_private; // Private note var $statut; // -1:brouillon, 0:resilie, >=1:valide,paye var $photo; @@ -310,7 +310,7 @@ class Adherent extends CommonObject $sql.= " VALUES ("; $sql.= " '".$this->db->idate($this->datec)."'"; $sql.= ", ".($this->login?"'".$this->db->escape($this->login)."'":"null"); - $sql.= ", ".($user->id>0?$user->id:"null"); // Can be null because member can be createb by a guest or a script + $sql.= ", ".($user->id>0?$user->id:"null"); // Can be null because member can be created by a guest or a script $sql.= ", null, null, '".$this->morphy."'"; $sql.= ", '".$this->typeid."'"; $sql.= ", ".$conf->entity; @@ -445,9 +445,9 @@ class Adherent extends CommonObject $sql.= ", email='".$this->email."'"; $sql.= ", skype='".$this->skype."'"; $sql.= ", phone=" .($this->phone?"'".$this->db->escape($this->phone)."'":"null"); - $sql.= ", phone_perso=" .($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null"); + $sql.= ", phone_perso=" .($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null"); $sql.= ", phone_mobile=" .($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null"); - $sql.= ", note=" .($this->note?"'".$this->db->escape($this->note)."'":"null"); + $sql.= ", note_private=" .($this->note_private?"'".$this->db->escape($this->note_private)."'":"null"); $sql.= ", photo=" .($this->photo?"'".$this->photo."'":"null"); $sql.= ", public='".$this->public."'"; $sql.= ", statut=" .$this->statut; @@ -1053,7 +1053,7 @@ class Adherent extends CommonObject { global $langs; - $sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_id, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,"; + $sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_id, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note_private,"; $sql.= " d.email, d.skype, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,"; $sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,"; $sql.= " d.datec as datec,"; @@ -1134,7 +1134,7 @@ class Adherent extends CommonObject $this->datevalid = $this->db->jdate($obj->datev); $this->birth = $this->db->jdate($obj->birthday); - $this->note = $obj->note; + $this->note_private = $obj->note_private; $this->morphy = $obj->morphy; $this->typeid = $obj->fk_adherent_type; @@ -1801,7 +1801,7 @@ class Adherent extends CommonObject $this->phone = '0999999999'; $this->phone_perso = '0999999998'; $this->phone_mobile = '0999999997'; - $this->note='No comment'; + $this->note_private='No comment'; $this->birth=time(); $this->photo=''; $this->public=1; @@ -1874,7 +1874,7 @@ class Adherent extends CommonObject if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso; if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile; if ($this->fax && ! empty($conf->global->LDAP_MEMBER_FIELD_FAX)) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax; - if ($this->note && ! empty($conf->global->LDAP_MEMBER_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note; + if ($this->note_private && ! empty($conf->global->LDAP_MEMBER_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note_private; if ($this->birth && ! empty($conf->global->LDAP_MEMBER_FIELD_BIRTHDATE)) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->birth,'dayhourldap'); if (isset($this->statut) && ! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut; if ($this->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap'); diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 727b3a9bcdc..3a938e74034 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -19,7 +19,7 @@ /** * \file htdocs/adherents/note.php * \ingroup member - * \brief Tabe for note of a member + * \brief Tab for note of a member */ require '../main.inc.php'; @@ -54,7 +54,7 @@ if ($action == 'update' && $user->rights->adherent->creer && ! $_POST["cancel"]) { $db->begin(); - $res=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES)); + $res=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES), '_private'); if ($res < 0) { setEventMessage($object->error, 'errors'); @@ -82,7 +82,7 @@ if ($id) dol_fiche_head($head, 'note', $langs->trans("Member"), 0, 'user'); - print "
"; + print ""; print ''; print ''; @@ -129,7 +129,7 @@ if ($id) // Status print ''; - // Note + // Private note print ''; print '"; @@ -150,7 +150,7 @@ if ($id) { print ''; } diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index e7bddb8bd7e..54f97fa2117 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -220,8 +220,8 @@ class ICal } if (($key == "DTSTAMP") or ($key == "LAST-MODIFIED") or ($key == "CREATED")) $value = $this->ical_date_to_unix($value); - if ($key == "RRULE" ) $value = $this->ical_rrule($value); - + //if ($key == "RRULE" ) $value = $this->ical_rrule($value); + if (stristr($key,"DTSTART") or stristr($key,"DTEND") or stristr($key,"DTSTART;VALUE=DATE") or stristr($key,"DTEND;VALUE=DATE")) { if (stristr($key,"DTSTART;VALUE=DATE") or stristr($key,"DTEND;VALUE=DATE")) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index be60d721d6a..1abd3bc4818 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -302,7 +302,7 @@ if (empty($reshook)) $object->modelpdf = GETPOST('model'); $object->author = $user->id; // deprecated $object->note = GETPOST('note'); - $object->statut = 0; + $object->statut = Propal::STATUS_DRAFT; $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); @@ -549,7 +549,7 @@ if (empty($reshook)) // Reopen proposal else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) { // prevent browser refresh from reopening proposal several times - if ($object->statut == 2 || $object->statut == 3 || $object->statut == 4) { + if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) { $object->reopen($user, 1); } } @@ -561,7 +561,7 @@ if (empty($reshook)) $action = 'statut'; } else { // prevent browser refresh from closing proposal several times - if ($object->statut == 1) { + if ($object->statut == Propal::STATUS_VALIDATED) { $object->cloture($user, GETPOST('statut'), GETPOST('note')); } } @@ -575,7 +575,7 @@ if (empty($reshook)) // Reopen proposal else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) { // prevent browser refresh from reopening proposal several times - if ($object->statut == 2 || $object->statut == 3 || $object->statut == 4) { + if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) { $object->reopen($user, 1); } } @@ -587,7 +587,7 @@ if (empty($reshook)) $action = 'statut'; } else { // prevent browser refresh from closing proposal several times - if ($object->statut == 1) { + if ($object->statut == Propal::STATUS_VALIDATED) { $object->cloture($user, GETPOST('statut'), GETPOST('note')); } } @@ -1735,7 +1735,7 @@ if ($action == 'create') $absolute_discount = price2num($absolute_discount, 'MT'); $absolute_creditnote = price2num($absolute_creditnote, 'MT'); if ($absolute_discount) { - if ($object->statut > 0) { + if ($object->statut > Propal::STATUS_DRAFT) { print $langs->trans("CompanyHasAbsoluteDiscount", price($absolute_discount, 0, $langs, 0, 0, -1, $conf->currency)); } else { // Remise dispo de type non avoir @@ -1797,7 +1797,7 @@ if ($action == 'create') } else { if (! empty($object->fin_validite)) { print dol_print_date($object->fin_validite, 'daytext'); - if ($object->statut == 1 && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay)) + if ($object->statut == Propal::STATUS_VALIDATED && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); } else { print ' '; @@ -2081,7 +2081,7 @@ if ($action == 'create') '; - if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { + if (! empty($conf->use_javascript_ajax) && $object->statut == Propal::STATUS_DRAFT) { include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } @@ -2091,7 +2091,7 @@ if ($action == 'create') $ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1); // Form to add new line - if ($object->statut == 0 && $user->rights->propal->creer) + if ($object->statut == Propal::STATUS_DRAFT && $user->rights->propal->creer) { if ($action != 'editline') { @@ -2154,7 +2154,7 @@ if ($action == 'create') if ($action != 'statut' && $action != 'editline') { // Validate - if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && + if ($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0 && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->creer)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->propal_advance->validate))) ) { @@ -2168,18 +2168,18 @@ if ($action == 'create') print '' . $langs->trans("AddAction") . ''; } // Edit - if ($object->statut == 1 && $user->rights->propal->creer) { + if ($object->statut == Propal::STATUS_VALIDATED && $user->rights->propal->creer) { print ''; } // ReOpen - if (($object->statut == 2 || $object->statut == 3 || $object->statut == 4) && $user->rights->propal->cloturer) { + if (($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) && $user->rights->propal->cloturer) { print ''; } // Send - if ($object->statut == 1 || $object->statut == 2) { + if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED) { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send) { print ''; } else @@ -2187,14 +2187,14 @@ if ($action == 'create') } // Create an order - if (! empty($conf->commande->enabled) && $object->statut == 2) { + if (! empty($conf->commande->enabled) && $object->statut == Propal::STATUS_SIGNED) { if ($user->rights->commande->creer) { print ''; } } // Create contract - if ($conf->contrat->enabled && $object->statut == 2) { + if ($conf->contrat->enabled && $object->statut == Propal::STATUS_SIGNED) { $langs->load("contracts"); if ($user->rights->contrat->creer) { @@ -2203,7 +2203,7 @@ if ($action == 'create') } // Create an invoice and classify billed - if ($object->statut == 2) { + if ($object->statut == Propal::STATUS_SIGNED) { if (! empty($conf->facture->enabled) && $user->rights->facture->creer) { print ''; @@ -2217,7 +2217,7 @@ if ($action == 'create') } // Close - if ($object->statut == 1 && $user->rights->propal->cloturer) { + if ($object->statut == Propal::STATUS_VALIDATED && $user->rights->propal->cloturer) { print ''; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index ce773b4e953..c1442aa403e 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -54,19 +54,56 @@ class Propal extends CommonObject var $id; - var $socid; // Id client - var $client; // Objet societe client (a charger par fetch_client) + /** + * ID of the client + * @var int + */ + var $socid; + /** + * Client (loaded by fetch_client) + * @var Societe + */ + var $client; var $contactid; var $fk_project; var $author; var $ref; var $ref_client; - var $statut; // 0 (draft), 1 (validated), 2 (signed), 3 (not signed), 4 (billed) - var $datec; // Date of creation - var $datev; // Date of validation - var $date; // Date of proposal - var $datep; // Same than date + + /** + * Status of the quote + * Check the following constants: + * - STATUS_DRAFT + * - STATUS_VALIDATED + * - STATUS_SIGNED + * - STATUS_NOTSIGNED + * - STATUS_BILLED + * @var int + */ + var $statut; + + /** + * Date of creation + * @var + */ + var $datec; + /** + * Date of validation + * @var + */ + var $datev; + /** + * Date of the quote + * @var + */ + var $date; + + /** + * Same than date ¿? + * @var + */ + var $datep; var $date_livraison; var $fin_validite; @@ -79,9 +116,19 @@ class Propal extends CommonObject var $total_localtax1; // Total Local Taxes 1 var $total_localtax2; // Total Local Taxes 2 var $total_ttc; // Total with tax - var $price; // deprecated (for compatibility) - var $tva; // deprecated (for compatibility) - var $total; // deprecated (for compatibility) + + /** + * @deprecated + */ + var $price; + /** + * @deprecated + */ + var $tva; + /** + * @deprecated + */ + var $total; var $cond_reglement_id; var $cond_reglement_code; @@ -91,10 +138,16 @@ class Propal extends CommonObject var $remise; var $remise_percent; var $remise_absolue; - var $note; // deprecated (for compatibility) + /** + * @deprecated + */ + var $note; var $note_private; var $note_public; - var $fk_delivery_address; // deprecated (for compatibility) + /** + * @deprecated + */ + var $fk_delivery_address; var $fk_address; var $address_type; var $address; @@ -126,6 +179,26 @@ class Propal extends CommonObject var $location_incoterms; var $libelle_incoterms; //Used into tooltip + /** + * Draft status + */ + const STATUS_DRAFT = 0; + /** + * Validated status + */ + const STATUS_VALIDATED = 1; + /** + * Signed quote + */ + const STATUS_SIGNED = 2; + /** + * Not signed quote + */ + const STATUS_NOTSIGNED = 3; + /** + * Billed quote + */ + const STATUS_BILLED = 4; /** * Constructor @@ -361,7 +434,7 @@ class Propal extends CommonObject // Check parameters if ($type < 0) return -1; - if ($this->statut == 0) + if ($this->statut == self::STATUS_DRAFT) { $this->db->begin(); @@ -525,7 +598,7 @@ class Propal extends CommonObject if (empty($qty) && empty($special_code)) $special_code=3; // Set option tag if (! empty($qty) && $special_code == 3) $special_code=0; // Remove option tag - if ($this->statut == 0) + if ($this->statut == self::STATUS_DRAFT) { $this->db->begin(); @@ -650,7 +723,7 @@ class Propal extends CommonObject */ function deleteline($lineid) { - if ($this->statut == 0) + if ($this->statut == self::STATUS_DRAFT) { $line=new PropaleLigne($this->db); @@ -1007,7 +1080,7 @@ class Propal extends CommonObject } $this->id=0; - $this->statut=0; + $this->statut=self::STATUS_DRAFT; if (empty($conf->global->PROPALE_ADDON) || ! is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php")) { @@ -1192,7 +1265,7 @@ class Propal extends CommonObject $this->location_incoterms = $obj->location_incoterms; $this->libelle_incoterms = $obj->libelle_incoterms; - if ($obj->fk_statut == 0) + if ($obj->fk_statut == self::STATUS_DRAFT) { $this->brouillon = 1; } @@ -1385,8 +1458,8 @@ class Propal extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; $sql.= " SET ref = '".$num."',"; - $sql.= " fk_statut = 1, date_valid='".$this->db->idate($now)."', fk_user_valid=".$user->id; - $sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0"; + $sql.= " fk_statut = ".self::STATUS_VALIDATED.", date_valid='".$this->db->idate($now)."', fk_user_valid=".$user->id; + $sql.= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; dol_syslog(get_class($this)."::valid", LOG_DEBUG); $resql=$this->db->query($sql); @@ -1441,7 +1514,7 @@ class Propal extends CommonObject $this->ref=$num; $this->brouillon=0; - $this->statut = 1; + $this->statut = self::STATUS_VALIDATED; $this->user_valid_id=$user->id; $this->datev=$now; @@ -1476,7 +1549,7 @@ class Propal extends CommonObject if (! empty($user->rights->propal->creer)) { $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET datep = '".$this->db->idate($date)."'"; - $sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0"; + $sql.= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; dol_syslog(get_class($this)."::set_date", LOG_DEBUG); if ($this->db->query($sql) ) @@ -1505,7 +1578,7 @@ class Propal extends CommonObject if (! empty($user->rights->propal->creer)) { $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".($date_fin_validite!=''?"'".$this->db->idate($date_fin_validite)."'":'null'); - $sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0"; + $sql.= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; if ($this->db->query($sql) ) { $this->fin_validite = $date_fin_validite; @@ -1655,7 +1728,7 @@ class Propal extends CommonObject $remise = price2num($remise); $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET remise_percent = ".$remise; - $sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0"; + $sql.= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; if ($this->db->query($sql) ) { @@ -1689,7 +1762,7 @@ class Propal extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."propal "; $sql.= " SET remise_absolue = ".$remise; - $sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0"; + $sql.= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; if ($this->db->query($sql) ) { @@ -1797,7 +1870,7 @@ class Propal extends CommonObject $modelpdf=$conf->global->PROPALE_ADDON_PDF_ODT_CLOSED?$conf->global->PROPALE_ADDON_PDF_ODT_CLOSED:$this->modelpdf; $trigger_name='PROPAL_CLOSE_REFUSED'; - if ($statut == 2) + if ($statut == self::STATUS_SIGNED) { $trigger_name='PROPAL_CLOSE_SIGNED'; $modelpdf=$conf->global->PROPALE_ADDON_PDF_ODT_TOBILL?$conf->global->PROPALE_ADDON_PDF_ODT_TOBILL:$this->modelpdf; @@ -1814,7 +1887,7 @@ class Propal extends CommonObject return -2; } } - if ($statut == 4) + if ($statut == self::STATUS_BILLED) { $trigger_name='PROPAL_CLASSIFY_BILLED'; } @@ -1864,11 +1937,11 @@ class Propal extends CommonObject */ function classifyBilled() { - $sql = 'UPDATE '.MAIN_DB_PREFIX.'propal SET fk_statut = 4'; - $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0 ;'; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'propal SET fk_statut = '.self::STATUS_BILLED; + $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT.' ;'; if ($this->db->query($sql) ) { - $this->statut=4; + $this->statut=self::STATUS_BILLED; return 1; } else @@ -1896,12 +1969,12 @@ class Propal extends CommonObject */ function set_draft($user) { - $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fk_statut = 0"; + $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fk_statut = ".self::STATUS_DRAFT; $sql.= " WHERE rowid = ".$this->id; if ($this->db->query($sql)) { - $this->statut = 0; + $this->statut = self::STATUS_DRAFT; $this->brouillon = 1; return 1; } @@ -1945,7 +2018,7 @@ class Propal extends CommonObject $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; } if ($socid) $sql.= " AND s.rowid = ".$socid; - if ($draft) $sql.= " AND p.fk_statut = 0"; + if ($draft) $sql.= " AND p.fk_statut = ".self::STATUS_DRAFT; if ($notcurrentuser > 0) $sql.= " AND p.fk_user_author <> ".$user->id; $sql.= $this->db->order($sortfield,$sortorder); $sql.= $this->db->plimit($limit,$offset); @@ -2215,7 +2288,7 @@ class Propal extends CommonObject function availability($availability_id) { dol_syslog('Propale::availability('.$availability_id.')'); - if ($this->statut >= 0) + if ($this->statut >= self::STATUS_DRAFT) { $sql = 'UPDATE '.MAIN_DB_PREFIX.'propal'; $sql .= ' SET fk_availability = '.$availability_id; @@ -2249,7 +2322,7 @@ class Propal extends CommonObject function demand_reason($demand_reason_id) { dol_syslog('Propale::demand_reason('.$demand_reason_id.')'); - if ($this->statut >= 0) + if ($this->statut >= self::STATUS_DRAFT) { $sql = 'UPDATE '.MAIN_DB_PREFIX.'propal'; $sql .= ' SET fk_input_reason = '.$demand_reason_id; @@ -2356,11 +2429,11 @@ class Propal extends CommonObject global $langs; $langs->load("propal"); - if ($statut==0) $statuttrans='statut0'; - if ($statut==1) $statuttrans='statut1'; - if ($statut==2) $statuttrans='statut3'; - if ($statut==3) $statuttrans='statut5'; - if ($statut==4) $statuttrans='statut6'; + if ($statut==self::STATUS_DRAFT) $statuttrans='statut0'; + if ($statut==self::STATUS_VALIDATED) $statuttrans='statut1'; + if ($statut==self::STATUS_SIGNED) $statuttrans='statut3'; + if ($statut==self::STATUS_NOTSIGNED) $statuttrans='statut5'; + if ($statut==self::STATUS_BILLED) $statuttrans='statut6'; if ($mode == 0) return $this->labelstatut[$statut]; if ($mode == 1) return $this->labelstatut_short[$statut]; @@ -2393,8 +2466,8 @@ class Propal extends CommonObject $clause = " AND"; } $sql.= $clause." p.entity = ".$conf->entity; - if ($mode == 'opened') $sql.= " AND p.fk_statut = 1"; - if ($mode == 'signed') $sql.= " AND p.fk_statut = 2"; + if ($mode == 'opened') $sql.= " AND p.fk_statut = ".self::STATUS_VALIDATED; + if ($mode == 'signed') $sql.= " AND p.fk_statut = ".self::STATUS_SIGNED; if ($user->societe_id) $sql.= " AND p.fk_soc = ".$user->societe_id; $resql=$this->db->query($sql); @@ -2405,12 +2478,12 @@ class Propal extends CommonObject if ($mode == 'opened') { $delay_warning=$conf->propal->cloture->warning_delay; - $statut = 1; + $statut = self::STATUS_VALIDATED; $label = $langs->trans("PropalsToClose"); } if ($mode == 'signed') { $delay_warning=$conf->propal->facturation->warning_delay; - $statut = 2; + $statut = self::STATUS_SIGNED; $label = $langs->trans("PropalsToBill"); } @@ -2815,7 +2888,14 @@ class PropaleLigne extends CommonObject var $fk_parent_line; var $desc; // Description ligne var $fk_product; // Id produit predefini - var $product_type = 0; // Type 0 = product, 1 = Service + /** + * Product type. + * Use the following constants: + * - Product::TYPE_PRODUCT + * - Product::TYPE_SERVICE + * @var int + */ + var $product_type = Product::TYPE_PRODUCT; var $qty; var $tva_tx; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 9292684d06f..05cd2db3f04 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -126,7 +126,7 @@ if ($id > 0 || ! empty($ref)) if ($object->fin_validite) { print dol_print_date($object->fin_validite,'daytext'); - if ($object->statut == 1 && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + if ($object->statut == Propal::STATUS_VALIDATED && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); } else { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index edf380b2e36..f95482f5e06 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -51,8 +51,17 @@ class Commande extends CommonOrder var $id; - var $socid; // Id client - var $client; // Objet societe client (a charger par fetch_client) + /** + * Client ID + * @var int + */ + var $socid; + + /** + * Client (loaded by fetch_client) + * @var Societe + */ + var $client; var $ref; var $ref_client; @@ -69,31 +78,13 @@ class Commande extends CommonOrder * - STATUS_CLOSED * @var int */ - var $statut; // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Delivered=Sent/Received, billed or not) + var $statut; + /** + * @deprecated + */ var $facturee; // deprecated var $billed; // billed or not - /** - * Canceled status - */ - const STATUS_CANCELED = -1; - /** - * Draft status - */ - const STATUS_DRAFT = 0; - /** - * Validated status - */ - const STATUS_VALIDATED = 1; - /** - * Accepted/On process not managed for customer orders - */ - const STATUS_ACCEPTED = 2; - /** - * Closed (Sent/Received, billed or not) - */ - const STATUS_CLOSED = 3; - var $brouillon; var $cond_reglement_id; var $cond_reglement_code; @@ -153,6 +144,27 @@ class Commande extends CommonOrder */ const STOCK_NOT_ENOUGH_FOR_ORDER = -3; + /** + * Canceled status + */ + const STATUS_CANCELED = -1; + /** + * Draft status + */ + const STATUS_DRAFT = 0; + /** + * Validated status + */ + const STATUS_VALIDATED = 1; + /** + * Accepted/On process not managed for customer orders + */ + const STATUS_ACCEPTED = 2; + /** + * Closed (Sent/Received, billed or not) + */ + const STATUS_CLOSED = 3; + /** * Constructor diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index 2b71c5c8004..16960b53c46 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -61,7 +61,7 @@ class LignePrelevement * Recupere l'objet prelevement * * @param int $rowid id de la facture a recuperer - * @return void|int + * @return integer */ function fetch($rowid) { diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 61ea308df39..82d675019d1 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -516,6 +516,10 @@ class CMailFile // Encode subject according to RFC 2822 - http://en.wikipedia.org/wiki/MIME#Encoded-Word + + /** + * @param string $stringtoencode + */ function encodetorfc2822($stringtoencode) { global $conf; @@ -639,7 +643,7 @@ class CMailFile /** * Create SMTP headers (mode = 'mail') * - * @return smtp headers + * @return string headers */ function write_smtpheaders() { @@ -690,7 +694,7 @@ class CMailFile * * @param array $filename_list Array of filenames * @param array $mimefilename_list Array of mime types - * @return array mime headers + * @return string mime headers */ function write_mimeheaders($filename_list, $mimefilename_list) { diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 1a7ebfc34c8..42265846d04 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -60,6 +60,34 @@ abstract class CommonInvoice extends CommonObject */ const TYPE_SITUATION = 5; + /** + * Draft + */ + const STATUS_DRAFT = 0; + + /** + * Validated (need to be paid) + */ + const STATUS_VALIDATED = 1; + + /** + * Classified paid. + * If paid partially, $this->close_code can be: + * - CLOSECODE_DISCOUNTVAT + * - CLOSECODE_BADDEBT + * If paid completelly, this->close_code will be null + */ + const STATUS_CLOSED = 2; + + /** + * Classified abandoned and no payment done. + * $this->close_code can be: + * - CLOSECODE_BADDEBT + * - CLOSECODE_ABANDONED + * - CLOSECODE_REPLACED + */ + const STATUS_ABANDONED = 3; + /** * Return amount of payments already done * @@ -188,7 +216,7 @@ abstract class CommonInvoice extends CommonObject * Return label of object status * * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto - * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ function getLibStatut($mode=0,$alreadypaid=-1) @@ -202,7 +230,7 @@ abstract class CommonInvoice extends CommonObject * @param int $paye Status field paye * @param int $status Id status * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto - * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @param int $type Type facture * @return string Libelle du statut */ @@ -326,7 +354,7 @@ abstract class CommonInvoice extends CommonObject * Renvoi une date limite de reglement de facture en fonction des * conditions de reglements de la facture et date de facturation * - * @param string $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition. + * @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition. * @return date Date limite de reglement si ok, <0 si ko */ function calculate_date_lim_reglement($cond_reglement=0) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d240c13110b..ac87f1e693d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1611,7 +1611,7 @@ abstract class CommonObject } if (! in_array($suffix,array('','_public','_private'))) { - dol_syslog(get_class($this)."::upate_note Parameter suffix must be empty, '_private' or '_public'", LOG_ERR); + dol_syslog(get_class($this)."::update_note Parameter suffix must be empty, '_private' or '_public'", LOG_ERR); return -2; } diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 15a0535598d..b65c5c8ede4 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -115,7 +115,7 @@ class DolGraph * Set Y precision * * @param float $which_prec Precision - * @return string + * @return boolean */ function SetPrecisionY($which_prec) { @@ -187,7 +187,7 @@ class DolGraph * Set y label * * @param string $label Y label - * @return boolean True + * @return boolean|null True */ function SetYLabel($label) { @@ -198,7 +198,7 @@ class DolGraph * Set width * * @param int $w Width - * @return boolean True + * @return boolean|null True */ function SetWidth($w) { @@ -554,7 +554,7 @@ class DolGraph /** * Return min value of all data * - * @return int Max value of all data + * @return double Max value of all data */ function GetFloorMinValue() { @@ -578,7 +578,7 @@ class DolGraph * * @param string $file Image file name to use to save onto disk (also used as javascript unique id) * @param string $fileurl Url path to show image if saved onto disk - * @return void + * @return integer|null */ function draw($file,$fileurl='') { diff --git a/htdocs/core/class/dolprintipp.class.php b/htdocs/core/class/dolprintipp.class.php index 252b742cc9d..4b934b331f3 100644 --- a/htdocs/core/class/dolprintipp.class.php +++ b/htdocs/core/class/dolprintipp.class.php @@ -18,7 +18,7 @@ /** * \file htdocs/core/class/dolprintipp.class.php - * \brief A set of functions for using printIPP + * \brief List jobs printed with driver printipp */ /** @@ -57,78 +57,6 @@ class dolprintIPP } - /** - * Return list of available printers - * - * @return array list of printers - */ - function getlist_available_printers() - { - global $conf,$db; - include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php'; - $ipp = new CupsPrintIPP(); - $ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose - $ipp->setHost($this->host); - $ipp->setPort($this->port); - $ipp->setUserName($this->userid); - if (! empty($this->user)) $ipp->setAuthentication($this->user,$this->password); - $ipp->getPrinters(); - return $ipp->available_printers; - } - - /** - * Print selected file - * - * @param string $file file - * @param string $module module - * - * @return string '' if OK, Error message if KO - */ - function print_file($file, $module) - { - global $conf,$db; - - include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php'; - - $ipp = new CupsPrintIPP(); - $ipp->setLog(DOL_DATA_ROOT.'/dolibarr_printipp.log','file',3); // logging very verbose - $ipp->setHost($this->host); - $ipp->setPort($this->port); - $ipp->setJobName($file,true); - $ipp->setUserName($this->userid); - if (! empty($this->user)) $ipp->setAuthentication($this->user,$this->password); - - // select printer uri for module order, propal,... - $sql = 'SELECT rowid,printer_uri,copy FROM '.MAIN_DB_PREFIX.'printer_ipp WHERE module="'.$module.'"'; - $result = $this->db->query($sql); - if ($result) - { - $obj = $this->db->fetch_object($result); - if ($obj) - { - $ipp->setPrinterURI($obj->printer_uri); - } - else - { - if (! empty($conf->global->PRINTIPP_URI_DEFAULT)) - { - $ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT); - } - else - { - return 'NoDefaultPrinterDefined'; - } - } - } - - // Set number of copy - $ipp->setCopies($obj->copy); - $ipp->setData(DOL_DATA_ROOT.'/'.$module.'/'.$file); - $ipp->printJob(); - - return ''; - } - /** * List jobs print * @@ -191,25 +119,4 @@ class dolprintIPP print "
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("Note").''; if ($action == 'edit' && $user->rights->adherent->creer) @@ -137,12 +137,12 @@ if ($id) print ""; print "id."\">"; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('note',$object->note,'',280,'dolibarr_notes','',true,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,80); + $doleditor=new DolEditor('note_private',$object->note_private,'',280,'dolibarr_notes','',true,false,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,80); $doleditor->Create(); } else { - print nl2br($object->note); + print dol_htmlentitiesbr($object->note_private); } print "
'; print ''; - print '   '; + print '     '; print ''; print '
"; } - /** - * Get printer detail - * - * @param string $uri URI - * @return array List of attributes - */ - function get_printer_detail($uri) - { - global $conf,$db; - - include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php'; - $ipp = new CupsPrintIPP(); - $ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose - $ipp->setHost($this->host); - $ipp->setPort($this->port); - $ipp->setUserName($this->userid); - if (! empty($this->user)) $ipp->setAuthentication($this->user,$this->password); - $ipp->setPrinterURI($uri); - $ipp->getPrinterAttributes(); - return $ipp->printer_attributes; - } } diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 14d1bec0841..755e304abfd 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -30,7 +30,7 @@ class InfoBox /** * Name of positions 0=Home, 1=... * - * @return array Array with list of zones + * @return string[] Array with list of zones */ static function getListOfPagesForBoxes() { diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 2783c55ee03..98250ab0db1 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -349,7 +349,7 @@ class Ldap /** * Change ldap protocol version to use. * - * @return string version + * @return boolean version */ function setVersion() { // LDAP_OPT_PROTOCOL_VERSION est une constante qui vaut 17 @@ -360,7 +360,7 @@ class Ldap /** * changement du referrals. * - * @return string referrals + * @return boolean referrals */ function setReferrals() { // LDAP_OPT_REFERRALS est une constante qui vaut ? @@ -1314,7 +1314,7 @@ class Ldap * Convertit le temps ActiveDirectory en Unix timestamp * * @param string $value AD time to convert - * @return string Unix timestamp + * @return integer Unix timestamp */ function convert_time($value) { diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index 0fbf22b0745..f27c4e75189 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -26,95 +26,95 @@ interface Database { /** - * Format a SQL IF + * Format a SQL IF * - * @param string $test Test string (example: 'cd.statut=0', 'field IS NULL') - * @param string $resok resultat si test egal - * @param string $resko resultat si test non egal - * @return string SQL string + * @param string $test Test string (example: 'cd.statut=0', 'field IS NULL') + * @param string $resok resultat si test egal + * @param string $resko resultat si test non egal + * @return string SQL string */ function ifsql($test, $resok, $resko); /** - * Return datas as an array + * Return datas as an array * - * @param resource $resultset Resultset of request - * @return array Array + * @param resource $resultset Resultset of request + * @return array Array */ function fetch_row($resultset); /** - * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. - * Function to use to build INSERT, UPDATE or WHERE predica + * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. + * Function to use to build INSERT, UPDATE or WHERE predica * - * @param string $param Date TMS to convert - * @return string Date in a string YYYYMMDDHHMMSS + * @param int $param Date TMS to convert + * @return string Date in a string YYYYMMDDHHMMSS */ function idate($param); /** - * Return last error code + * Return last error code * - * @return string lasterrno + * @return string lasterrno */ function lasterrno(); /** * Start transaction * - * @return int 1 if transaction successfuly opened or already opened, 0 if error + * @return int 1 if transaction successfuly opened or already opened, 0 if error */ function begin(); /** - * Create a new database - * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated - * We force to create database with charset this->forcecharset and collate this->forcecollate + * Create a new database + * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated + * We force to create database with charset this->forcecharset and collate this->forcecollate * - * @param string $database Database name to create - * @param string $charset Charset used to store data - * @param string $collation Charset used to sort data - * @param string $owner Username of database owner - * @return resource resource defined if OK, null if KO + * @param string $database Database name to create + * @param string $charset Charset used to store data + * @param string $collation Charset used to sort data + * @param string $owner Username of database owner + * @return resource resource defined if OK, null if KO */ function DDLCreateDb($database, $charset = '', $collation = '', $owner = ''); /** - * Return version of database server into an array + * Return version of database server into an array * - * @return array Version array + * @return array Version array */ function getVersionArray(); /** * Convert a SQL request in Mysql syntax to native syntax * - * @param string $line SQL request line to convert - * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) - * @return string SQL request line converted + * @param string $line SQL request line to convert + * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) + * @return string SQL request line converted */ static function convertSQLFromMysql($line, $type = 'ddl'); /** - * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE + * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * - * @param resource $resultset Curseur de la requete voulue - * @return int Nombre de lignes - * @see num_rows + * @param resource $resultset Curseur de la requete voulue + * @return int Nombre de lignes + * @see num_rows */ function affected_rows($resultset); /** - * Return description of last error + * Return description of last error * - * @return string Error text + * @return string Error text */ function error(); /** * Return label of manager * - * @return string Label + * @return string Label */ function getLabel(); @@ -128,58 +128,58 @@ interface Database function DDLListTables($database, $table = ''); /** - * Return last request executed with query() + * Return last request executed with query() * - * @return string Last query + * @return string Last query */ function lastquery(); /** * Define sort criteria of request * - * @param string $sortfield List of sort fields - * @param string $sortorder Sort order - * @return string String to provide syntax of a sort sql string + * @param string $sortfield List of sort fields + * @param string $sortorder Sort order + * @return string String to provide syntax of a sort sql string */ function order($sortfield = 0, $sortorder = 0); /** - * Decrypt sensitive data in database + * Decrypt sensitive data in database * * @param string $value Value to decrypt - * @return string Decrypted value if used + * @return string Decrypted value if used */ function decrypt($value); /** * Return datas as an array * - * @param resource $resultset Resultset of request - * @return array Array + * @param resource $resultset Resultset of request + * @return array Array */ function fetch_array($resultset); /** - * Return last error label + * Return last error label * - * @return string lasterror + * @return string lasterror */ function lasterror(); /** - * Escape a string to insert data + * Escape a string to insert data * - * @param string $stringtoencode String to escape - * @return string String escaped + * @param string $stringtoencode String to escape + * @return string String escaped */ function escape($stringtoencode); /** * Get last ID after an insert INSERT * - * @param string $tab Table name concerned by insert. Ne sert pas sous MySql mais requis pour compatibilite avec Postgresql - * @param string $fieldid Field name - * @return int Id of row + * @param string $tab Table name concerned by insert. Ne sert pas sous MySql mais requis pour compatibilite avec Postgresql + * @param string $fieldid Field name + * @return int Id of row */ function last_insert_id($tab, $fieldid = 'rowid'); @@ -193,186 +193,186 @@ interface Database /** * Annulation d'une transaction et retour aux anciennes valeurs * - * @param string $log Add more log to default log line - * @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur + * @param string $log Add more log to default log line + * @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur */ function rollback($log = ''); /** * Execute a SQL request and return the resultset * - * @param string $query SQL query string - * @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollbock to savepoint if error (this allow to have some request with errors inside global transactions). + * @param string $query SQL query string + * @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollbock to savepoint if error (this allow to have some request with errors inside global transactions). * Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints. * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) - * @return resource Resultset of answer + * @return resource Resultset of answer */ function query($query, $usesavepoint = 0, $type = 'auto'); /** * Connexion to server * - * @param string $host database server host - * @param string $login login - * @param string $passwd password - * @param string $name name of database (not used for mysql, used for pgsql) - * @param string $port Port of database server - * @return resource Database access handler - * @see close + * @param string $host database server host + * @param string $login login + * @param string $passwd password + * @param string $name name of database (not used for mysql, used for pgsql) + * @param string $port Port of database server + * @return resource Database access handler + * @see close */ function connect($host, $login, $passwd, $name, $port = 0); /** * Define limits and offset of request * - * @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit) - * @param int $offset Numero of line from where starting fetch - * @return string String with SQL syntax to add a limit and offset + * @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit) + * @param int $offset Numero of line from where starting fetch + * @return string String with SQL syntax to add a limit and offset */ function plimit($limit = 0, $offset = 0); /** * Return value of server parameters * - * @param string $filter Filter list on a particular value - * @return array Array of key-values (key=>value) + * @param string $filter Filter list on a particular value + * @return array Array of key-values (key=>value) */ function getServerParametersValues($filter = ''); /** - * Return value of server status + * Return value of server status * - * @param string $filter Filter list on a particular value - * @return array Array of key-values (key=>value) + * @param string $filter Filter list on a particular value + * @return array Array of key-values (key=>value) */ function getServerStatusValues($filter = ''); /** - * Return collation used in database + * Return collation used in database * - * @return string Collation value + * @return string Collation value */ function getDefaultCollationDatabase(); /** - * Return number of lines for result of a SELECT + * Return number of lines for result of a SELECT * - * @param resource $resultset Resulset of requests - * @return int Nb of lines - * @see affected_rows + * @param resource $resultset Resulset of requests + * @return int Nb of lines + * @see affected_rows */ function num_rows($resultset); /** - * Return full path of dump program + * Return full path of dump program * * @return string Full path of dump program */ function getPathOfDump(); /** - * Return version of database client driver + * Return version of database client driver * * @return string Version string */ function getDriverInfo(); /** - * Return generic error code of last operation. + * Return generic error code of last operation. * * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ function errno(); /** - * Create a table into database + * Create a table into database * - * @param string $table Nom de la table - * @param array $fields Tableau associatif [nom champ][tableau des descriptions] - * @param string $primary_key Nom du champ qui sera la clef primaire - * @param string $type Type de la table - * @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur - * @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext - * @param string $keys Tableau des champs cles noms => valeur - * @return int <0 if KO, >=0 if OK + * @param string $table Nom de la table + * @param array $fields Tableau associatif [nom champ][tableau des descriptions] + * @param string $primary_key Nom du champ qui sera la clef primaire + * @param string $type Type de la table + * @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur + * @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext + * @param string $keys Tableau des champs cles noms => valeur + * @return int <0 if KO, >=0 if OK */ function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = "", $fulltext_keys = "", $keys = ""); /** - * Return list of available charset that can be used to store data in database + * Return list of available charset that can be used to store data in database * * @return array List of Charset */ function getListOfCharacterSet(); /** - * Create a new field into table + * Create a new field into table * - * @param string $table Name of table - * @param string $field_name Name of field to add - * @param string $field_desc Tableau associatif de description du champ a inserer[nom du parametre][valeur du parametre] - * @param string $field_position Optionnel ex.: "after champtruc" - * @return int <0 if KO, >0 if OK + * @param string $table Name of table + * @param string $field_name Name of field to add + * @param string $field_desc Tableau associatif de description du champ a inserer[nom du parametre][valeur du parametre] + * @param string $field_position Optionnel ex.: "after champtruc" + * @return int <0 if KO, >0 if OK */ function DDLAddField($table, $field_name, $field_desc, $field_position = ""); /** - * Drop a field from table + * Drop a field from table * - * @param string $table Name of table - * @param string $field_name Name of field to drop - * @return int <0 if KO, >0 if OK + * @param string $table Name of table + * @param string $field_name Name of field to drop + * @return int <0 if KO, >0 if OK */ function DDLDropField($table, $field_name); /** - * Update format of a field into a table + * Update format of a field into a table * - * @param string $table Name of table - * @param string $field_name Name of field to modify - * @param string $field_desc Array with description of field format - * @return int <0 if KO, >0 if OK + * @param string $table Name of table + * @param string $field_name Name of field to modify + * @param string $field_desc Array with description of field format + * @return int <0 if KO, >0 if OK */ function DDLUpdateField($table, $field_name, $field_desc); /** - * Return list of available collation that can be used for database + * Return list of available collation that can be used for database * - * @return array List of Collation + * @return array List of Collation */ function getListOfCollation(); /** - * Return a pointer of line with description of a table or field + * Return a pointer of line with description of a table or field * - * @param string $table Name of table - * @param string $field Optionnel : Name of field if we want description of field - * @return resource Resource + * @param string $table Name of table + * @param string $field Optionnel : Name of field if we want description of field + * @return resource Resource */ function DDLDescTable($table, $field = ""); /** - * Return version of database server + * Return version of database server * - * @return string Version string + * @return string Version string */ function getVersion(); /** - * Return charset used to store data in database + * Return charset used to store data in database * - * @return string Charset + * @return string Charset */ function getDefaultCharacterSetDatabase(); /** - * Create a user and privileges to connect to database (even if database does not exists yet) + * Create a user and privileges to connect to database (even if database does not exists yet) * - * @param string $dolibarr_main_db_host Ip serveur - * @param string $dolibarr_main_db_user Nom user a creer - * @param string $dolibarr_main_db_pass Mot de passe user a creer - * @param string $dolibarr_main_db_name Database name where user must be granted - * @return int <0 if KO, >=0 if OK + * @param string $dolibarr_main_db_host Ip serveur + * @param string $dolibarr_main_db_user Nom user a creer + * @param string $dolibarr_main_db_pass Mot de passe user a creer + * @param string $dolibarr_main_db_name Database name where user must be granted + * @return int <0 if KO, >=0 if OK */ function DDLCreateUser( $dolibarr_main_db_host, @@ -382,85 +382,85 @@ interface Database ); /** - * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) - * 19700101020000 -> 3600 with TZ+1 and gmt=0 - * 19700101020000 -> 7200 whaterver is TZ if gmt=1 + * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) + * 19700101020000 -> 3600 with TZ+1 and gmt=0 + * 19700101020000 -> 7200 whaterver is TZ if gmt=1 * - * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ - * @return timestamp|string Date TMS + * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) + * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ + * @return int|string Date TMS or '' */ function jdate($string, $gm=false); /** - * Encrypt sensitive data in database - * Warning: This function includes the escape, so it must use direct value + * Encrypt sensitive data in database + * Warning: This function includes the escape, so it must use direct value * - * @param string $fieldorvalue Field name or value to encrypt - * @param int $withQuotes Return string with quotes - * @return string XXX(field) or XXX('value') or field or 'value' + * @param string $fieldorvalue Field name or value to encrypt + * @param int $withQuotes Return string with quotes + * @return string XXX(field) or XXX('value') or field or 'value' */ function encrypt($fieldorvalue, $withQuotes = 0); /** * Validate a database transaction * - * @param string $log Add more log to default log line - * @return int 1 if validation is OK or transaction level no started, 0 if ERROR + * @param string $log Add more log to default log line + * @return int 1 if validation is OK or transaction level no started, 0 if ERROR */ function commit($log = ''); /** - * List information of columns into a table. + * List information of columns into a table. * - * @param string $table Name of table - * @return array Tableau des informations des champs de la table + * @param string $table Name of table + * @return array Array with inforation on table */ function DDLInfoTable($table); /** - * Free last resultset used. + * Free last resultset used. * - * @param resource $resultset Curseur de la requete voulue - * @return void + * @param resource $resultset Fre cursor + * @return void */ function free($resultset = 0); /** - * Close database connexion + * Close database connexion * - * @return boolean True if disconnect successfull, false otherwise - * @see connect + * @return boolean True if disconnect successfull, false otherwise + * @see connect */ function close(); /** - * Return last query in error + * Return last query in error * - * @return string lastqueryerror + * @return string lastqueryerror */ function lastqueryerror(); /** * Return connexion ID * - * @return string Id connexion + * @return string Id connexion */ function DDLGetConnectId(); /** - * Renvoie la ligne courante (comme un objet) pour le curseur resultset + * Renvoie la ligne courante (comme un objet) pour le curseur resultset * - * @param resource $resultset Curseur de la requete voulue - * @return Object Object result line or false if KO or end of cursor + * @param resource $resultset Curseur de la requete voulue + * @return Object Object result line or false if KO or end of cursor */ function fetch_object($resultset); /** - * Select a database + * Select a database * - * @param string $database Name of database - * @return boolean true if OK, false if KO + * @param string $database Name of database + * @return boolean true if OK, false if KO */ function select_db($database); diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index c7177475a34..0aae168be79 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -82,7 +82,7 @@ abstract class DoliDB implements Database * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. * Function to use to build INSERT, UPDATE or WHERE predica * - * @param string $param Date TMS to convert + * @param int $param Date TMS to convert * @return string Date in a string YYYYMMDDHHMMSS */ function idate($param) @@ -271,7 +271,7 @@ abstract class DoliDB implements Database * * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ - * @return int|string Date TMS + * @return int|string Date TMS or '' */ function jdate($string, $gm=false) { diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php index 88efde86394..d09ce11ca43 100644 --- a/htdocs/core/db/sqlite.class.php +++ b/htdocs/core/db/sqlite.class.php @@ -296,7 +296,7 @@ class DoliDBSqlite extends DoliDB * @param string $login login * @param string $passwd password * @param string $name name of database (not used for mysql, used for pgsql) - * @param string $port Port of database server + * @param integer $port Port of database server * @return resource Database access handler * @see close */ @@ -459,7 +459,7 @@ class DoliDBSqlite extends DoliDB /** * Return datas as an array * - * @param Resultset $resultset Resultset of request + * @param resource $resultset Resultset of request * @return array Array */ function fetch_row($resultset) @@ -511,7 +511,7 @@ class DoliDBSqlite extends DoliDB /** * Free last resultset used. * - * @param resultset $resultset Curseur de la requete voulue + * @param integer $resultset Curseur de la requete voulue * @return void */ function free($resultset=0) @@ -629,7 +629,7 @@ class DoliDBSqlite extends DoliDB * * @param string $fieldorvalue Field name or value to encrypt * @param int $withQuotes Return string with quotes - * @return return XXX(field) or XXX('value') or field or 'value' + * @return string XXX(field) or XXX('value') or field or 'value' */ function encrypt($fieldorvalue, $withQuotes=0) { diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index 243b862ff88..778723c5f3b 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -61,7 +61,7 @@ else $genbarcode_loc = $conf->global->GENBARCODE_LOCATION; * * @param string $code Code * @param string $encoding Encoding - * @param string $scale Scale + * @param integer $scale Scale * @param string $mode 'png' or 'jpg' ... * * @@ -159,7 +159,7 @@ function barcode_encode($code,$encoding) * Calculate EAN sum * * @param string $ean EAN to encode - * @return string Sum + * @return integer Sum */ function barcode_gen_ean_sum($ean) { @@ -299,7 +299,7 @@ function barcode_encode_genbarcode($code,$encoding) * @param string $mode png,gif,jpg (default='png') * @param int $total_y the total height of the image ( default: scale * 60 ) * @param array $space default: $space[top] = 2 * $scale; $space[bottom]= 2 * $scale; $space[left] = 2 * $scale; $space[right] = 2 * $scale; - * @return void + * @return string|null */ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, $space = '') { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index d9bae4b5ecb..0af5e917cc5 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -452,7 +452,7 @@ function dol_count_nb_of_line($file) * Return size of a file * * @param string $pathoffile Path of file - * @return string File size + * @return integer File size */ function dol_filesize($pathoffile) { @@ -598,7 +598,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists) * * @param string $srcfile Source file (can't be a directory. use native php @rename() to move a directory) * @param string $destfile Destination file (can't be a directory. use native php @rename() to move a directory) - * @param string $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK) + * @param integer $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK) * @param int $overwriteifexists Overwrite file if exists (1 by default) * @return boolean True if OK, false if KO */ @@ -657,7 +657,7 @@ function dol_unescapefile($filename) * @param string $dest_file Target full path filename ($_FILES['field']['name']) * @param int $allowoverwrite 1=Overwrite target file if it already exists * @param int $disablevirusscan 1=Disable virus scan - * @param string $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error']) + * @param integer $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error']) * @param int $nohook Disable all hooks * @param string $varfiles _FILES var name * @return int >0 if OK, <0 or string if KO @@ -989,7 +989,7 @@ function dol_delete_preview($object) * This should allow "grep" search. * This feature is enabled only if option MAIN_DOC_CREATE_METAFILE is set. * - * @param Object $object Object + * @param CommonObject $object Object * @return int 0 if we did nothing, >0 success, <0 error */ function dol_meta_create($object) diff --git a/htdocs/core/modules/livraison/modules_livraison.php b/htdocs/core/modules/livraison/modules_livraison.php index 22c25bcfd5f..0a439ed8fe7 100644 --- a/htdocs/core/modules/livraison/modules_livraison.php +++ b/htdocs/core/modules/livraison/modules_livraison.php @@ -42,7 +42,7 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator * Return list of active generation modules * * @param DoliDB $db Database handler - * @param string $maxfilenamelength Max length of value to show + * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ static function liste_modeles($db,$maxfilenamelength=0) @@ -151,7 +151,7 @@ abstract class ModeleNumRefDeliveryOrder * Create object on disk * * @param DoliDB $db objet base de donnee - * @param Object $object object delivery + * @param Livraison $object object delivery * @param string $modele force le modele a utiliser ('' to not force) * @param Translate $outputlangs objet lang a utiliser pour traduction * @return int 0 if KO, 1 if OK diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 3f8df87cd7a..5d218376983 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -85,7 +85,7 @@ class mailing_contacts1 extends MailingTargets * For example if this selector is used to extract 500 different * emails from a text file, this function must return 500. * - * @param string $sql Requete sql de comptage + * @param string $sql Requete sql de comptage * @return int */ function getNbOfRecipients($sql='') diff --git a/htdocs/core/modules/mailings/contacts2.modules.php b/htdocs/core/modules/mailings/contacts2.modules.php index fe49ce56b35..b1e22110f5e 100644 --- a/htdocs/core/modules/mailings/contacts2.modules.php +++ b/htdocs/core/modules/mailings/contacts2.modules.php @@ -152,7 +152,7 @@ class mailing_contacts2 extends MailingTargets /** * Return here number of distinct emails returned by your selector. * - * @param string $sql Requete sql de comptage + * @param string $sql Requete sql de comptage * @return int */ function getNbOfRecipients($sql='') diff --git a/htdocs/core/modules/mailings/contacts3.modules.php b/htdocs/core/modules/mailings/contacts3.modules.php index 92640291088..feeb0a2cb55 100644 --- a/htdocs/core/modules/mailings/contacts3.modules.php +++ b/htdocs/core/modules/mailings/contacts3.modules.php @@ -157,7 +157,7 @@ class mailing_contacts3 extends MailingTargets /** * Return here number of distinct emails returned by your selector. * - * @param string $sql Requete sql de comptage + * @param string $sql Requete sql de comptage * @return int Number of recipients */ function getNbOfRecipients($sql='') diff --git a/htdocs/core/modules/mailings/contacts4.modules.php b/htdocs/core/modules/mailings/contacts4.modules.php index 59355b372fe..c0a1c59c01c 100644 --- a/htdocs/core/modules/mailings/contacts4.modules.php +++ b/htdocs/core/modules/mailings/contacts4.modules.php @@ -158,7 +158,7 @@ class mailing_contacts4 extends MailingTargets /** * Return here number of distinct emails returned by your selector. * - * @param string $sql Requete sql de comptage + * @param string $sql Requete sql de comptage * @return int Number of recipients */ function getNbOfRecipients($sql='') diff --git a/htdocs/core/modules/mailings/example.modules.php b/htdocs/core/modules/mailings/example.modules.php index a7eb1b0b839..428285fb20b 100644 --- a/htdocs/core/modules/mailings/example.modules.php +++ b/htdocs/core/modules/mailings/example.modules.php @@ -100,8 +100,8 @@ class mailing_example extends MailingTargets * For example if this selector is used to extract 500 different * emails from a text file, this function must return 500. * - * @param string $sql Requete sql de comptage - * @return int + * @param string $sql Requete sql de comptage + * @return int|string Number of recipient or '?' */ function getNbOfRecipients($sql='') { diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index dd6e18dfa91..69b018080b8 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -86,8 +86,8 @@ class mailing_fraise extends MailingTargets * For example if this selector is used to extract 500 different * emails from a text file, this function must return 500. * - * @param string $sql Requete sql de comptage - * @return int Nb of recipients + * @param string $sql Requete sql de comptage + * @return int Nb of recipients */ function getNbOfRecipients($sql='') { diff --git a/htdocs/core/modules/mailings/framboise.modules.php b/htdocs/core/modules/mailings/framboise.modules.php index c647466e796..e25ffad5f1b 100644 --- a/htdocs/core/modules/mailings/framboise.modules.php +++ b/htdocs/core/modules/mailings/framboise.modules.php @@ -150,8 +150,8 @@ class mailing_framboise extends MailingTargets * For example if this selector is used to extract 500 different * emails from a text file, this function must return 500. * - * @param string $sql Requete sql de comptage - * @return int Nb of recipients + * @param string $sql Requete sql de comptage + * @return int Nb of recipients */ function getNbOfRecipients($sql='') { diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 5561526a7ff..2508440c147 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -72,8 +72,8 @@ class MailingTargets // This can't be abstract as it is used for some method /** * Retourne nombre de destinataires * - * @param string $sql Requete sql de comptage - * @return int Nb de destinataires si ok, < 0 si erreur + * @param string $sql Sql request to count + * @return int Nb of recipient, or <0 if error */ function getNbOfRecipients($sql) { @@ -85,7 +85,7 @@ class MailingTargets // This can't be abstract as it is used for some method } else { - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); return -1; } } diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index df8ec79f988..222711cdf65 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -157,7 +157,7 @@ class mailing_thirdparties extends MailingTargets * emails from a text file, this function must return 500. * * @param string $sql Requete sql de comptage - * @return int Nb of recipients + * @return int Nb of recipients */ function getNbOfRecipients($sql='') { diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 777621fa432..7b6f8361d24 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -73,8 +73,8 @@ class mailing_xinputfile extends MailingTargets * For example if this selector is used to extract 500 different * emails from a text file, this function must return 500. * - * @param string $sql Requete sql de comptage - * @return int '' means NA + * @param string $sql Sql request to count + * @return string '' means NA */ function getNbOfRecipients($sql='') { diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 0d01aa53912..7832d1f6a93 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -73,8 +73,8 @@ class mailing_xinputuser extends MailingTargets * For example if this selector is used to extract 500 different * emails from a text file, this function must return 500. * - * @param string $sql Requete sql de comptage - * @return int '' means NA + * @param string $sql Sql request to count + * @return string '' means NA */ function getNbOfRecipients($sql='') { diff --git a/htdocs/core/modules/printing/modules_printing.php b/htdocs/core/modules/printing/modules_printing.php index 3b53711f58c..7bb9ac98f58 100644 --- a/htdocs/core/modules/printing/modules_printing.php +++ b/htdocs/core/modules/printing/modules_printing.php @@ -49,7 +49,7 @@ class PrintingDriver * Return list of printing driver * * @param DoliDB $db Database handler - * @param string $maxfilenamelength Max length of value to show + * @param integer $maxfilenamelength Max length of value to show * @return array List of drivers */ static function listDrivers($db,$maxfilenamelength=0) diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 302adaeb965..a0e0d37d074 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -254,7 +254,7 @@ class printing_printgcp extends PrintingDriver /** * Login into Google Account * - * @return string true or false + * @return boolean true or false */ function GoogleLogin() { @@ -324,8 +324,8 @@ class printing_printgcp extends PrintingDriver * * @param string $url url to hit * @param array $postfields array of post fields - * @param array $headers array of http headers - * @return array response from curl + * @param string[] $headers array of http headers + * @return string response from curl */ private function makeCurl($url,$postfields=array(),$headers=array()) { diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 78d7f42fab2..0880cbc58ac 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -819,7 +819,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices * Show payments table * * @param PDF $pdf Object PDF - * @param Object $object Object invoice + * @param FactureFournisseur $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output * @return int <0 if KO, >0 if OK @@ -903,7 +903,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices * Show top header of page. * * @param PDF $pdf Object PDF - * @param Object $object Object to show + * @param FactureFournisseur $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @return void @@ -1090,7 +1090,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices * Show footer of page. Need this->emetteur object * * @param PDF $pdf PDF - * @param Object $object Object to show + * @param FactureFournisseur $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text * @return int Return height of bottom margin including footer text diff --git a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php index bc544363b39..a968955ea73 100644 --- a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php +++ b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php @@ -44,7 +44,7 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator * Return list of active generation models * * @param DoliDB $db Database handler - * @param string $maxfilenamelength Max length of value to show + * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ static function liste_modeles($db,$maxfilenamelength=0) @@ -143,7 +143,7 @@ abstract class ModeleNumRefSuppliersOrders * Create a document onto disk according to template model. * * @param DoliDB $db Database handler - * @param Object $object Object supplier order + * @param CommandeFournisseur $object Object supplier order * @param string $modele Force template to use ('' to not force) * @param Translate $outputlangs Object lang to use for traduction * @param int $hidedetails Hide details of lines diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index f0abed84cbb..22ac415b511 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -52,7 +52,11 @@ class CommandeFournisseur extends CommonOrder var $id; - var $ref; // TODO deprecated + /** + * TODO: Remove + * @deprecated + */ + var $ref; var $product_ref; var $ref_supplier; var $brouillon; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 19cb26cf17b..99e9cca639c 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -55,10 +55,15 @@ class FactureFournisseur extends CommonInvoice var $socid; //Check constants for types var $type = self::TYPE_STANDARD; - //! 0=draft, - //! 1=validated - //! 2=classified paid partially (close_code='discount_vat','badcustomer') or completely (close_code=null), - //! Also 2, should be 3=classified abandoned and no payment done (close_code='badcustomer','abandon' ou 'replaced') + + /** + * Check constants for more info: + * - STATUS_DRAFT + * - STATUS_VALIDATED + * - STATUS_PAID + * - STATUS_ABANDONED + * @var int + */ var $statut; //! 1 si facture payee COMPLETEMENT, 0 sinon (ce champ ne devrait plus servir car insuffisant) var $paye; @@ -438,7 +443,7 @@ class FactureFournisseur extends CommonInvoice $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); $this->fetch_optionals($this->id,$extralabels); - if ($this->statut == 0) $this->brouillon = 1; + if ($this->statut == self::STATUS_DRAFT) $this->brouillon = 1; $result=$this->fetch_lines(); if ($result < 0) @@ -886,7 +891,7 @@ class FactureFournisseur extends CommonInvoice $error=0; // Protection - if ($this->statut > 0) // This is to avoid to validate twice (avoid errors on logs and stock management) + if ($this->statut > self::STATUS_DRAFT) // This is to avoid to validate twice (avoid errors on logs and stock management) { dol_syslog(get_class($this)."::validate no draft status", LOG_WARNING); return 0; @@ -995,7 +1000,7 @@ class FactureFournisseur extends CommonInvoice if (! $error) { $this->ref = $num; - $this->statut=1; + $this->statut=self::STATUS_VALIDATED; //$this->date_validation=$now; this is stored into log table } @@ -1032,7 +1037,7 @@ class FactureFournisseur extends CommonInvoice $error=0; - if ($this->statut == 0) + if ($this->statut == self::STATUS_DRAFT) { dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING); return 0; @@ -1746,7 +1751,7 @@ class FactureFournisseur extends CommonInvoice // Load source object $object->fetch($fromid); $object->id=0; - $object->statut=0; + $object->statut=self::STATUS_DRAFT; // Clear fields $object->ref_supplier=$langs->trans("CopyOf").' '.$object->ref_supplier; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index e93d06ad530..28fbe44fc9f 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -288,7 +288,7 @@ if (empty($reshook)) elseif ($action == 'deletepaiement' && $user->rights->fournisseur->facture->creer) { $object->fetch($id); - if ($object->statut == 1 && $object->paye == 0) + if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0) { $paiementfourn = new PaiementFourn($db); $result=$paiementfourn->fetch(GETPOST('paiement_id')); @@ -867,8 +867,8 @@ if (empty($reshook)) elseif ($action == 'reopen' && $user->rights->fournisseur->facture->creer) { $result = $object->fetch($id); - if ($object->statut == 2 - || ($object->statut == 3 && $object->close_code != 'replaced')) + if ($object->statut == FactureFournisseur::STATUS_CLOSED + || ($object->statut == FactureFournisseur::STATUS_ABANDONED && $object->close_code != 'replaced')) { $result = $object->set_unpaid($user); if ($result > 0) @@ -1739,8 +1739,8 @@ else print "\n"; // Ref supplier - print ''.$form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)).''; - print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)); + print ''.$form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statutrights->fournisseur->facture->creer)).''; + print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statutrights->fournisseur->facture->creer)); print ''; // Third party @@ -1788,8 +1788,8 @@ else print ''; // Label - print ''.$form->editfieldkey("Label",'label',$object->label,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)).''; - print ''.$form->editfieldval("Label",'label',$object->label,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)).''; + print ''.$form->editfieldkey("Label",'label',$object->label,$object,($object->statutrights->fournisseur->facture->creer)).''; + print ''.$form->editfieldval("Label",'label',$object->label,$object,($object->statutrights->fournisseur->facture->creer)).''; /* * List of payments @@ -1853,7 +1853,7 @@ else } print ''.price($objp->amount).''; print ''; - if ($object->statut == 1 && $object->paye == 0 && $user->societe_id == 0) + if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { print 'rowid.'">'; print img_delete(); @@ -1891,15 +1891,17 @@ else print ''; + $form_permission = $object->statutrights->fournisseur->facture->creer && $object->getSommePaiement() <= 0; + // Date - print ''.$form->editfieldkey("Date",'datef',$object->datep,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'datepicker').''; - print $form->editfieldval("Date",'datef',$object->datep,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'datepicker'); + print ''.$form->editfieldkey("Date",'datef',$object->datep,$object,$form_permission,'datepicker').''; + print $form->editfieldval("Date",'datef',$object->datep,$object,$form_permission,'datepicker'); print ''; // Due date - print ''.$form->editfieldkey("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'datepicker').''; - print $form->editfieldval("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'datepicker'); - if ($action != 'editdate_lim_reglement' && $object->statut < 2 && $object->date_echeance && $object->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_warning($langs->trans('Late')); + print ''.$form->editfieldkey("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,$form_permission,'datepicker').''; + print $form->editfieldval("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,$form_permission,'datepicker'); + if ($action != 'editdate_lim_reglement' && $object->statut < FactureFournisseur::STATUS_CLOSED && $object->date_echeance && $object->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_warning($langs->trans('Late')); print ''; // Conditions de reglement par defaut @@ -2081,7 +2083,7 @@ else '; - if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { + if (! empty($conf->use_javascript_ajax) && $object->statut == FactureFournisseur::STATUS_DRAFT) { include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } @@ -2279,7 +2281,7 @@ else } */ // Form to add new line - if ($object->statut == 0 && $user->rights->fournisseur->facture->creer) + if ($object->statut == FactureFournisseur::STATUS_DRAFT && $user->rights->fournisseur->facture->creer) { if ($action != 'editline') { @@ -2310,7 +2312,7 @@ else print '
'; // Modify a validated invoice with no payments - if ($object->statut == 1 && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer) + if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer) { print ''.$langs->trans('Modify').''; } @@ -2329,7 +2331,7 @@ else } // Send by mail - if (($object->statut == 1 || $object->statut == 2)) + if (($object->statut == FactureFournisseur::STATUS_VALIDATED || $object->statut == FactureFournisseur::STATUS_CLOSED)) { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send) { @@ -2340,13 +2342,13 @@ else // Make payments - if ($action != 'edit' && $object->statut == 1 && $object->paye == 0 && $user->societe_id == 0) + if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { print ''.$langs->trans('DoPayment').''; // must use facid because id is for payment id not invoice } // Classify paid - if ($action != 'edit' && $object->statut == 1 && $object->paye == 0 && $user->societe_id == 0) + if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { print ''.$langs->trans('ClassifyPaid').''; @@ -2355,7 +2357,7 @@ else } // Validate - if ($action != 'edit' && $object->statut == 0) + if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_DRAFT) { if (count($object->lines)) { diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index 5f8fed7fd14..85757f85f15 100644 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -513,3 +513,6 @@ create table llx_c_price_global_variable_updater next_update integer DEFAULT 0, last_status text DEFAULT NULL )ENGINE=innodb; + +ALTER TABLE llx_adherent CHANGE COLUMN note note_private text DEFAULT NULL; + diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql index e7f9c246834..e6ffee2dc5b 100644 --- a/htdocs/install/mysql/tables/llx_adherent.sql +++ b/htdocs/install/mysql/tables/llx_adherent.sql @@ -54,7 +54,7 @@ create table llx_adherent statut smallint NOT NULL DEFAULT 0, public smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils public ou pas ? datefin datetime, -- date de fin de validite de la cotisation - note text, + note_private text DEFAULT NULL, datevalid datetime, -- date de validation datec datetime, -- date de creation tms timestamp, -- date de modification diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index c2c0bba6381..85d0694b725 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -321,7 +321,7 @@ class Loan extends CommonObject * Return label of loan status (unpaid, paid) * * @param int $mode 0=label, 1=short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label - * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ function getLibStatut($mode=0,$alreadypaid=-1) @@ -334,7 +334,7 @@ class Loan extends CommonObject * * @param int $statut Id statut * @param int $mode 0=Label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label, 5=Short label + Picto - * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ function LibStatut($statut,$mode=0,$alreadypaid=-1) @@ -447,7 +447,7 @@ class Loan extends CommonObject * Information on record * * @param int $id Id of record - * @return void + * @return integer|null */ function info($id) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e4fe0c06e8e..d0b80db1190 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -111,17 +111,17 @@ function test_sql_and_script_inject($val, $type) /** * Security: Return true if OK, false otherwise. * - * @param string $var Variable name - * @param string $type 1=GET, 0=POST, 2=PHP_SELF - * @return boolean true if there is an injection + * @param string $var Variable name + * @param string $type 1=GET, 0=POST, 2=PHP_SELF + * @return boolean||null true if there is an injection. Stop code if injection found. */ -function analyse_sql_and_script(&$var, $type) +function analyseVarsForSqlAndScriptsInjection(&$var, $type) { if (is_array($var)) { foreach ($var as $key => $value) { - if (analyse_sql_and_script($value,$type)) + if (analyseVarsForSqlAndScriptsInjection($value,$type)) { $var[$key] = $value; } @@ -147,16 +147,16 @@ if ((defined('NOREQUIREDB') || defined('NOREQUIRETRAN')) && ! defined('NOREQUIRE if (! empty($_SERVER["PHP_SELF"])) { $morevaltochecklikepost=array($_SERVER["PHP_SELF"]); - analyse_sql_and_script($morevaltochecklikepost,2); + analyseVarsForSqlAndScriptsInjection($morevaltochecklikepost,2); } // Sanity check on GET parameters if (! empty($_SERVER["QUERY_STRING"])) { $morevaltochecklikeget=array($_SERVER["QUERY_STRING"]); - analyse_sql_and_script($morevaltochecklikeget,1); + analyseVarsForSqlAndScriptsInjection($morevaltochecklikeget,1); } // Sanity check on POST -analyse_sql_and_script($_POST,0); +analyseVarsForSqlAndScriptsInjection($_POST,0); // This is to make Dolibarr working with Plesk if (! empty($_SERVER['DOCUMENT_ROOT'])) set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs'); diff --git a/htdocs/printing/index.php b/htdocs/printing/index.php index e8669f44585..48795fbab4c 100644 --- a/htdocs/printing/index.php +++ b/htdocs/printing/index.php @@ -30,8 +30,8 @@ llxHeader("",$langs->trans("Printing")); print_fiche_titre($langs->trans("Printing")); // List Jobs from printing modules -//$printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD); -//$printer->list_jobs('commande'); +$printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD); +$printer->list_jobs('commande'); llxFooter(); diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index b36e7b317c6..5926beab083 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -67,7 +67,7 @@ class ActionsCardService * Assign custom values for canvas (for example into this->tpl to be used by templates) * * @param string $action Type of action - * @param string $id Id of object + * @param integer $id Id of object * @param string $ref Ref of object * @return void */ diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index d6d848b8ef1..ee49302407d 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -462,7 +462,7 @@ class Productbatch extends CommonObject /** * Return all batch detail records for given product and warehouse * - * @param obj $db database object + * @param DoliDB $db database object * @param int $fk_product_stock id product_stock for objet * @param int $with_qty doesn't return line with 0 quantity * @return int <0 if KO, >0 if OK diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index a6ac9ee1906..8fb06cd783e 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -25,9 +25,9 @@ * \brief Example of form to add a new member * * Note that you can add following constant to change behaviour of page - * MEMBER_NEWFORM_AMOUNT Default amount for autosubscribe form + * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form * MEMBER_NEWFORM_EDITAMOUNT Amount can be edited - * MEMBER_NEWFORM_PAYONLINE Suggest paypemt with paypal of paybox + * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal of paybox * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted * MEMBER_NEWFORM_FORCETYPE Force type of member @@ -40,7 +40,7 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site. // For MultiCompany module. // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php -// TODO This should be useless. Because entity must be retreive from object ref and not from url. +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. $entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); if (is_numeric($entity)) define("DOLENTITY", $entity); @@ -138,7 +138,7 @@ function llxFooterVierge() * Actions */ -// Action called when page is submited +// Action called when page is submitted if ($action == 'add') { // test if login already exists @@ -335,7 +335,7 @@ if ($action == 'add') } } -// Action called after a submited was send and member created succesfully +// Action called after a submitted was send and member created successfully // If MEMBER_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url. // backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. if ($action == 'added') diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index b94262bbb52..c5389c73452 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -355,7 +355,7 @@ abstract class ActionsCardCommon * Assign custom values for canvas (for example into this->tpl to be used by templates) * * @param string $action Type of action - * @param string $id Id of object + * @param integer $id Id of object * @param string $ref Ref of object * @return void */ diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index d54af2b8bba..b2c0f82f1e0 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -92,7 +92,7 @@ class ActionsCardCompany extends ActionsCardCommon * Assign custom values for canvas (for example into this->tpl to be used by templates) * * @param string $action Type of action - * @param string $id Id of object + * @param integer $id Id of object * @param string $ref Ref of object * @return void */ diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php index 2f00cd4bc27..19921b69d81 100644 --- a/htdocs/societe/canvas/individual/actions_card_individual.class.php +++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php @@ -92,7 +92,7 @@ class ActionsCardIndividual extends ActionsCardCommon * Assign custom values for canvas (for example into this->tpl to be used by templates) * * @param string $action Type of action - * @param string $id Id of object + * @param integer $id Id of object * @param string $ref Ref of object * @return void */ diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 2df9ba0776f..7e2bdeef3a6 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1578,7 +1578,7 @@ class Societe extends CommonObject * * @param User $user Filtre sur un user auteur des remises * @param string $filter Filtre autre - * @param string $maxvalue Filter on max value for discount + * @param integer $maxvalue Filter on max value for discount * @return int <0 if KO, Credit note amount otherwise */ function getAvailableDiscounts($user='',$filter='',$maxvalue=0) @@ -1728,7 +1728,7 @@ class Societe extends CommonObject * @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only) * @param string $option Target of link ('', 'customer', 'prospect', 'supplier') * @param int $maxlen Max length of text - * @param string $notooltip 1=Disable tooltip + * @param integer $notooltip 1=Disable tooltip * @return string String with URL */ function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0) diff --git a/test/bootstrap.php b/test/bootstrap.php index 6e80411dca6..27a5be97508 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -1,3 +1,26 @@ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file test/bootstrap.php + * \ingroup test + * \brief PHPUnit test + * \remarks To make test with phpunit + */ + set_time_limit(0); -?>