diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index c917b363c70..a8cb095a889 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2013,7 +2013,8 @@ class Adherent extends CommonObject } $label .= '
'; - $label .= ''.$langs->trans("Member").''; + $label .= img_picto('', $this->picto).' '.$langs->trans("Member").''; + $label .= ' '.$this->getLibStatut(4); if (!empty($this->ref)) $label .= '
'.$langs->trans('Ref').': '.$this->ref; if (!empty($this->firstname) || !empty($this->lastname)) $label .= '
'.$langs->trans('Name').': '.$this->getFullName($langs); if (!empty($this->company)) $label .= '
'.$langs->trans('Company').': '.$this->company; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index e31d1e8fbc7..420ad95fca8 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -85,7 +85,6 @@ class AdherentType extends CommonObject /** * @var int Subsription required (0 or 1) - * @since 5.0 */ public $subscription; @@ -95,9 +94,15 @@ class AdherentType extends CommonObject /** @var integer Can vote */ public $vote; - /** @var string Email sent during validation */ + /** @var string Email sent during validation of member */ public $mail_valid; + /** @var string Email sent after recording a new subscription */ + public $mail_subscription; + + /** @var string Email sent after resiliation */ + public $mail_resiliate; + /** @var array Array of members */ public $members = array(); @@ -116,7 +121,7 @@ class AdherentType extends CommonObject } /** - * Load array this->multilangs + * Load array this->multilangs * * @return int <0 if KO, >0 if OK */ @@ -151,7 +156,7 @@ class AdherentType extends CommonObject } /** - * Update or add a translation for a product + * Update or add a translation for this member type * * @param User $user Object user making update * @return int <0 if KO, >0 if OK @@ -236,12 +241,11 @@ class AdherentType extends CommonObject } /** - * Delete a language for this product + * Delete a language for this member type * - * @param string $langtodelete Language code to delete - * @param User $user Object user making delete - * - * @return int <0 if KO, >0 if OK + * @param string $langtodelete Language code to delete + * @param User $user Object user making delete + * @return int <0 if KO, >0 if OK */ public function delMultiLangs($langtodelete, $user) { @@ -268,9 +272,9 @@ class AdherentType extends CommonObject } /** - * Fonction qui permet de creer le status de l'adherent + * Function to create the member type * - * @param User $user User making creation + * @param User $user User making creation * @param int $notrigger 1=do not execute triggers, 0 otherwise * @return int >0 if OK, < 0 if KO */ @@ -574,7 +578,7 @@ class AdherentType extends CommonObject public function getmorphylib($morphy = '') { global $langs; - if ($morphy == 'phy') { return $langs->trans("Physical"); } elseif ($morphy == 'mor') { return $langs->trans("Moral"); } else return $langs->trans("MorPhy"); + if ($morphy == 'phy') { return $langs->trans("Physical"); } elseif ($morphy == 'mor') { return $langs->trans("Moral"); } else return $langs->trans("MorAndPhy"); //return $morphy; } @@ -591,7 +595,15 @@ class AdherentType extends CommonObject global $langs; $result = ''; - $label = $langs->trans("ShowTypeCard", $this->label); + + $label = ''; + + $label = img_picto('', $this->picto).' '.$langs->trans("MemberType").''; + $label .= ' '.$this->getLibStatut(4); + $label .= '
'.$langs->trans("Label").': '.$this->label; + if (isset($this->subscription)) { + $label .= '
'.$langs->trans("SubscriptionRequired").': '.yn($this->subscription); + } $linkstart = ''; $linkend = ''; @@ -741,4 +753,35 @@ class AdherentType extends CommonObject return ''; } + + /** + * getMailOnSubscription + * + * @return string Return mail content of type or empty + */ + public function getMailOnSubscription() + { + // mail_subscription not defined so never used + if (!empty($this->mail_subscription) && trim(dol_htmlentitiesbr_decode($this->mail_subscription))) { // Property not yet defined + return $this->mail_subscription; + } + + return ''; + } + + /** + * getMailOnResiliate + * + * @return string Return mail model content of type or empty + */ + public function getMailOnResiliate() + { + // NOTE mail_resiliate not defined so never used + if (!empty($this->mail_resiliate) && trim(dol_htmlentitiesbr_decode($this->mail_resiliate))) { // Property not yet defined + return $this->mail_resiliate; + } + + return ''; + } + } diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index fc93f828f6c..35b0fcfb478 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -284,10 +284,10 @@ print '
'; */ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; -$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; +$sql = "SELECT a.rowid, a.statut as status, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; $sql .= " a.gender, a.email, a.photo, a.morphy,"; -$sql .= " a.tms as datem, datefin as date_end_subscription,"; -$sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription"; +$sql .= " a.tms as datem, a.datefin as date_end_subscription,"; +$sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription as need_subscription"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; $sql .= " WHERE a.entity IN (".getEntity('adherent').")"; $sql .= " AND a.fk_adherent_type = ta.rowid"; @@ -306,7 +306,7 @@ if ($resql) { $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; + $staticmember->id = $obj->rowid; $staticmember->ref = $obj->rowid; $staticmember->lastname = $obj->lastname; @@ -315,6 +315,9 @@ if ($resql) { $staticmember->email = $obj->email; $staticmember->photo = $obj->photo; $staticmember->morphy = $obj->morphy; + $staticmember->statut = $obj->status; + $staticmember->need_subscription = $obj->need_subscription; + $staticmember->datefin = $db->jdate($obj->date_end_subscription); if (!empty($obj->fk_soc)) { $staticmember->fk_soc = $obj->fk_soc; $staticmember->fetch_thirdparty(); @@ -322,12 +325,16 @@ if ($resql) { } else { $staticmember->name = $obj->company; } + $statictype->id = $obj->typeid; $statictype->label = $obj->label; + $statictype->subscription = $obj->need_subscription; + + print ''; print ''.$staticmember->getNomUrl(-1, 32).''; print ''.$statictype->getNomUrl(1, 32).''; print ''.dol_print_date($db->jdate($obj->datem), 'dayhour').''; - print ''.$staticmember->LibStatut($obj->statut, ($obj->subscription == 'yes' ? 1 : 0), $db->jdate($obj->date_end_subscription), 3).''; + print ''.$staticmember->getLibStatut(3).''; print ''; $i++; } @@ -344,12 +351,14 @@ if ($resql) { */ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; -$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; +$sql = "SELECT a.rowid, a.statut as status, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; $sql .= " a.gender, a.email, a.photo, a.morphy,"; $sql .= " a.datefin as date_end_subscription,"; +$sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription as need_subscription,"; $sql .= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.subscription"; -$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."subscription as c"; +$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta, ".MAIN_DB_PREFIX."subscription as c"; $sql .= " WHERE a.entity IN (".getEntity('adherent').")"; +$sql .= " AND a.fk_adherent_type = ta.rowid"; $sql .= " AND c.fk_adherent = a.rowid"; $sql .= $db->order("c.tms", "DESC"); $sql .= $db->plimit($max, 0); @@ -366,9 +375,7 @@ if ($resql) { $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; - $subscriptionstatic->id = $obj->cid; - $subscriptionstatic->ref = $obj->cid; + $staticmember->id = $obj->rowid; $staticmember->ref = $obj->rowid; $staticmember->lastname = $obj->lastname; @@ -377,6 +384,9 @@ if ($resql) { $staticmember->email = $obj->email; $staticmember->photo = $obj->photo; $staticmember->morphy = $obj->morphy; + $staticmember->statut = $obj->status; + $staticmember->need_subscription = $obj->need_subscription; + $staticmember->datefin = $db->jdate($obj->date_end_subscription); if (!empty($obj->fk_soc)) { $staticmember->fk_soc = $obj->fk_soc; $staticmember->fetch_thirdparty(); @@ -384,6 +394,11 @@ if ($resql) { } else { $staticmember->name = $obj->company; } + + $subscriptionstatic->id = $obj->cid; + $subscriptionstatic->ref = $obj->cid; + + print ''; print ''.$subscriptionstatic->getNomUrl(1).''; print ''.$staticmember->getNomUrl(-1, 32, 'subscription').''; print ''.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).''; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index d1573f316f9..df2838a59e9 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -247,7 +247,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') { print ''; print ''.$langs->trans("Ref").''; print ''.$langs->trans("Label").''; - print ''.$langs->trans("MemberNature").''; + print ''.$langs->trans("MembersNature").''; print ''.$langs->trans("SubscriptionRequired").''; print ''.$langs->trans("VoteAllowed").''; print ''.$langs->trans("Status").''; @@ -263,6 +263,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') { $membertype->ref = $objp->rowid; $membertype->label = $objp->rowid; $membertype->status = $objp->status; + $membertype->subscription = $objp->subscription; print ''; print ''; @@ -321,10 +322,10 @@ if ($action == 'create') { // Morphy $morphys = array(); - $morphys[""] = $langs->trans("MorPhy"); - $morphys["phy"] = $langs->trans("Physical"); + $morphys[""] = $langs->trans("MorAndPhy"); + $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); - print ''.$langs->trans("MemberNature").''; + print ''.$langs->trans("MembersNature").''; print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy", 'aZ09') : 'morphy'); print ""; @@ -343,12 +344,12 @@ if ($action == 'create') { print ''.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('comment', $object->note, '', 280, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%'); + $doleditor = new DolEditor('comment', $object->note, '', 200, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%'); $doleditor->Create(); print ''.$langs->trans("WelcomeEMail").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 280, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%'); + $doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 250, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%'); $doleditor->Create(); print ''; @@ -401,7 +402,7 @@ if ($rowid > 0) { print ''; // Morphy - print ''; + print ''; print ''; print ''; if ($objp->company != '') { - print ''."\n"; + print ''."\n"; } else { - print ''."\n"; + print ''."\n"; } // Login @@ -640,9 +644,9 @@ if ($rowid > 0) { // EMail print "\n"; - // Statut + // Status print '"; // Date end subscription @@ -668,11 +672,10 @@ if ($rowid > 0) { // Actions print '"; @@ -723,11 +726,11 @@ if ($rowid > 0) { print ''; // Morphy - $morphys[""] = $langs->trans("MorPhy"); + $morphys[""] = $langs->trans("MorAndPhy"); $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); - print '"; print '
'.$langs->trans("MemberNature").''.$object->getmorphylib($object->morphy).'
'.$langs->trans("MembersNature").''.$object->getmorphylib($object->morphy).'
'.$langs->trans("SubscriptionRequired").''; @@ -614,13 +615,16 @@ if ($rowid > 0) { $adh = new Adherent($db); $adh->lastname = $objp->lastname; $adh->firstname = $objp->firstname; + $adh->datefin = $datefin; + $adh->need_subscription = $objp->subscription; + $adh->statut = $objp->status; // Lastname print '
'.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->societe, 12).''.img_object($langs->trans("ShowMember"), "user", 'class="paddingright"').$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->company, 12).''.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 32).''.img_object($langs->trans("ShowMember"), "user", 'class="paddingright"').$adh->getFullName($langs, 0, -1, 32).'".dol_print_email($objp->email, 0, 0, 1)."'; - print $adh->LibStatut($objp->status, $objp->subscription, $datefin, 2); + print $adh->getLibStatut(2); print "'; if ($user->rights->adherent->creer) { - print ''.img_edit().''; + print ''.img_edit().''; } - print ' '; if ($user->rights->adherent->supprimer) { - print ''.img_picto($langs->trans("Resiliate"), 'disable.png').''; + print ''.img_picto($langs->trans("Resiliate"), 'disable.png').''; } print "
'.$langs->trans("MemberNature").''; - print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy") : $object->morphy); + print '
'.$langs->trans("MembersNature").''; + print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy", 'aZ09') : $object->morphy); print "
'.$langs->trans("SubscriptionRequired").''; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index b305858bd93..8ce38ba4ea3 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -137,10 +137,10 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { * Draft customer proposals */ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { - $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc"; - $sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta"; - $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; - $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status,"; + $sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta"; + $sql .= " FROM ".MAIN_DB_PREFIX."propal as p,"; + $sql .= " ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE p.entity IN (".getEntity($propalstatic->element).")"; $sql .= " AND p.fk_soc = s.rowid"; @@ -167,6 +167,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { $propalstatic->total_ht = $obj->total_ht; $propalstatic->total_tva = $obj->total_tva; $propalstatic->total_ttc = $obj->total_ttc; + $propalstatic->statut = $obj->status; $companystatic->id = $obj->socid; $companystatic->name = $obj->name; @@ -203,10 +204,10 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { * Draft supplier proposals */ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { - $sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc"; - $sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.entity, s.email"; - $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p"; - $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + $sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status,"; + $sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.entity, s.email"; + $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p,"; + $sql .= " ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE p.entity IN (".getEntity($supplierproposalstatic->element).")"; $sql .= " AND p.fk_statut = ".SupplierProposal::STATUS_DRAFT; @@ -232,6 +233,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa $supplierproposalstatic->total_ht = $obj->total_ht; $supplierproposalstatic->total_tva = $obj->total_tva; $supplierproposalstatic->total_ttc = $obj->total_ttc; + $supplierproposalstatic->statut = $obj->status; $companystatic->id = $obj->socid; $companystatic->name = $obj->name; @@ -267,10 +269,10 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa * Draft customer orders */ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { - $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc"; - $sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta"; - $sql .= " FROM ".MAIN_DB_PREFIX."commande as c"; - $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, c.fk_statut as status,"; + $sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta"; + $sql .= " FROM ".MAIN_DB_PREFIX."commande as c,"; + $sql .= " ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE c.entity IN (".getEntity($orderstatic->element).")"; $sql .= " AND c.fk_statut = ".Commande::STATUS_DRAFT; @@ -297,6 +299,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $orderstatic->total_ht = $obj->total_ht; $orderstatic->total_tva = $obj->total_tva; $orderstatic->total_ttc = $obj->total_ttc; + $orderstatic->statut = $obj->status; $companystatic->id = $obj->socid; $companystatic->name = $obj->name; @@ -329,13 +332,13 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { /* - * Draft suppliers orders + * Draft purchase orders */ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) { - $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc"; - $sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.entity, s.email"; - $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf"; - $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, cf.fk_statut as status,"; + $sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.entity, s.email"; + $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf,"; + $sql .= " ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE cf.entity IN (".getEntity($supplierorderstatic->element).")"; $sql .= " AND cf.fk_statut = ".CommandeFournisseur::STATUS_DRAFT; @@ -362,6 +365,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $supplierorderstatic->total_ht = $obj->total_ht; $supplierorderstatic->total_tva = $obj->total_tva; $supplierorderstatic->total_ttc = $obj->total_ttc; + $supplierorderstatic->statut = $obj->status; $companystatic->id = $obj->socid; $companystatic->name = $obj->name; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 602e3445ae2..d784ff8d834 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3564,7 +3564,10 @@ class Propal extends CommonObject if ($user->rights->propal->lire) { - $label = img_picto('', $this->picto).' '.$langs->trans("Proposal").''; + $label = img_picto('', $this->picto).' '.$langs->trans("Proposal").''; + if (isset($this->statut)) { + $label .= ' '.$this->getLibStatut(5); + } if (!empty($this->ref)) $label .= '
'.$langs->trans('Ref').': '.$this->ref; if (!empty($this->ref_client)) @@ -3575,10 +3578,6 @@ class Propal extends CommonObject $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); if (!empty($this->total_ttc)) $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); - if (isset($this->statut)) { - $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5); - } - if ($option == '') { $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id.$get_params; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 5934dc066a3..a01b6dfb924 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3634,7 +3634,10 @@ class Commande extends CommonOrder $label = ''; if ($user->rights->commande->lire) { - $label = img_picto('', $this->picto).' '.$langs->trans("Order").''; + $label = img_picto('', $this->picto).' '.$langs->trans("Order").''; + if (isset($this->statut)) { + $label .= ' '.$this->getLibStatut(5); + } $label .= '
'.$langs->trans('Ref').': '.$this->ref; $label .= '
'.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client); if (!empty($this->total_ht)) { @@ -3646,9 +3649,6 @@ class Commande extends CommonOrder if (!empty($this->total_ttc)) { $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); } - if (isset($this->statut)) { - $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5); - } } $linkclose = ''; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 78f91d0796f..4dd96ac88aa 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1417,11 +1417,14 @@ class Facture extends CommonInvoice $label = ''; if ($user->rights->facture->lire) { - $label = img_picto('', $this->picto).' '.$langs->trans("Invoice").''; - if ($this->type == self::TYPE_REPLACEMENT) $label = ''.$langs->transnoentitiesnoconv("ReplacementInvoice").''; - if ($this->type == self::TYPE_CREDIT_NOTE) $label = ''.$langs->transnoentitiesnoconv("CreditNote").''; - if ($this->type == self::TYPE_DEPOSIT) $label = ''.$langs->transnoentitiesnoconv("Deposit").''; - if ($this->type == self::TYPE_SITUATION) $label = ''.$langs->transnoentitiesnoconv("InvoiceSituation").''; + $label = img_picto('', $this->picto).' '.$langs->trans("Invoice").''; + if ($this->type == self::TYPE_REPLACEMENT) $label = ''.$langs->transnoentitiesnoconv("ReplacementInvoice").''; + if ($this->type == self::TYPE_CREDIT_NOTE) $label = ''.$langs->transnoentitiesnoconv("CreditNote").''; + if ($this->type == self::TYPE_DEPOSIT) $label = ''.$langs->transnoentitiesnoconv("Deposit").''; + if ($this->type == self::TYPE_SITUATION) $label = ''.$langs->transnoentitiesnoconv("InvoiceSituation").''; + if (isset($this->statut) && isset($this->alreadypaid)) { + $label .= ' '.$this->getLibStatut(5, $this->alreadypaid); + } if (!empty($this->ref)) $label .= '
'.$langs->trans('Ref').': '.$this->ref; if (!empty($this->ref_client)) @@ -1439,9 +1442,6 @@ class Facture extends CommonInvoice if (!empty($this->total_ttc)) $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); if ($moretitle) $label .= ' - '.$moretitle; - if (isset($this->statut) && isset($this->alreadypaid)) { - $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5, $this->alreadypaid); - } } $linkclose = ($target ? ' target="'.$target.'"' : ''); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 6c8024be4db..145ff92cdb4 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1982,7 +1982,11 @@ class Contrat extends CommonObject $label = ''; if ($user->rights->contrat->lire) { - $label = img_picto('', $this->picto).' '.$langs->trans("Contract").''; + $label = img_picto('', $this->picto).' '.$langs->trans("Contract").''; + /* Status of a contract is status of all services, so disabled + if (isset($this->statut)) { + $label .= ' '.$this->getLibStatut(5); + }*/ $label .= '
'.$langs->trans('Ref').': '.($this->ref ? $this->ref : $this->id); $label .= '
'.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client); $label .= '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier; diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 5e013b3d32f..c94919eb1dc 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -257,8 +257,7 @@ class CUnits // extends CommonObject $this->records = array(); $num = $this->db->num_rows($resql); if ($num > 0) { - while ($obj = $this->db->fetch_object($resql)) - { + while ($obj = $this->db->fetch_object($resql)) { $record = new self($this->db); $record->id = $obj->rowid; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5fc4fbd070d..923334208d0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3191,10 +3191,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'bookmark', 'bom', 'building', 'cash-register', 'category', 'check', 'clock', 'close_title', 'company', 'contact', 'contract', 'cubes', 'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'email', 'external-link-alt', 'external-link-square-alt', - 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', + 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group', 'help', 'holiday', 'intervention', 'label', 'language', 'list', 'listlight', 'lot', - 'map-marker-alt', 'money-bill-alt', 'mrp', 'note', 'next', + 'map-marker-alt', 'member', 'money-bill-alt', 'mrp', 'note', 'next', 'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom', 'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 99b9bda840b..36a6b9a9aee 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -765,11 +765,11 @@ class Fichinter extends CommonObject $result = ''; - $label = img_picto('', $this->picto).' '.$langs->trans("Intervention").''; - $label .= '
'.$langs->trans('Ref').': '.$this->ref; + $label = img_picto('', $this->picto).' '.$langs->trans("Intervention").''; if (isset($this->status)) { - $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5); + $label .= ' '.$this->getLibStatut(5); } + $label .= '
'.$langs->trans('Ref').': '.$this->ref; $url = DOL_URL_ROOT.'/fichinter/card.php?id='.$this->id; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index c1ccc837232..9b927360025 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -763,17 +763,25 @@ class CommandeFournisseur extends CommonOrder global $langs, $conf, $user; $result = ''; - $label = ''.$langs->trans("PurchaseOrder").''; - if (!empty($this->ref)) - $label .= '
'.$langs->trans('Ref').': '.$this->ref; - if (!empty($this->ref_supplier)) - $label .= '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier; - if (!empty($this->total_ht)) - $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); - if (!empty($this->total_tva)) - $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); - if (!empty($this->total_ttc)) - $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); + + $label = ''; + + if ($user->rights->fournisseur->commande->lire) { + $label = ''.$langs->trans("SupplierOrder").''; + if (isset($this->statut)) { + $label .= ' '.$this->getLibStatut(5); + } + if (!empty($this->ref)) + $label .= '
'.$langs->trans('Ref').': '.$this->ref; + if (!empty($this->ref_supplier)) + $label .= '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier; + if (!empty($this->total_ht)) + $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); + if (!empty($this->total_tva)) + $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); + if (!empty($this->total_ttc)) + $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); + } $picto = 'order'; $url = DOL_URL_ROOT.'/fourn/commande/card.php?id='.$this->id; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 8d5809dff73..1bf32782bdb 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2295,10 +2295,10 @@ class FactureFournisseur extends CommonInvoice if ($this->type == self::TYPE_CREDIT_NOTE) $picto .= 'a'; // Credit note if ($this->type == self::TYPE_DEPOSIT) $picto .= 'd'; // Deposit invoice - $label = img_picto('', $this->picto).' '.$langs->trans("SupplierInvoice").''; - if ($this->type == self::TYPE_REPLACEMENT) $label = ''.$langs->transnoentitiesnoconv("InvoiceReplace").''; - elseif ($this->type == self::TYPE_CREDIT_NOTE) $label = ''.$langs->transnoentitiesnoconv("CreditNote").''; - elseif ($this->type == self::TYPE_DEPOSIT) $label = ''.$langs->transnoentitiesnoconv("Deposit").''; + $label = img_picto('', $this->picto).' '.$langs->trans("SupplierInvoice").''; + if ($this->type == self::TYPE_REPLACEMENT) $label = ''.$langs->transnoentitiesnoconv("InvoiceReplace").''; + elseif ($this->type == self::TYPE_CREDIT_NOTE) $label = ''.$langs->transnoentitiesnoconv("CreditNote").''; + elseif ($this->type == self::TYPE_DEPOSIT) $label = ''.$langs->transnoentitiesnoconv("Deposit").''; if (!empty($this->ref)) $label .= '
'.$langs->trans('Ref').': '.$this->ref; if (!empty($this->ref_supplier)) diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 1a1419aa6da..5812248b129 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -80,7 +80,7 @@ DeleteType=Delete VoteAllowed=Vote allowed Physical=Physical Moral=Moral -MorPhy=Nature +MorAndPhy=Moral and Physical Reenable=Reenable ResiliateMember=Terminate a member ConfirmResiliateMember=Are you sure you want to terminate this member? @@ -177,6 +177,7 @@ MenuMembersStats=Statistics LastMemberDate=Latest member date LatestSubscriptionDate=Latest subscription date MemberNature=Nature of member +MembersNature=Nature of members Public=Information are public NewMemberbyWeb=New member added. Awaiting approval NewMemberForm=New member form diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c3c07504a99..59d34f728b1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4427,15 +4427,32 @@ class Product extends CommonObject global $conf, $langs, $hookmanager; include_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; - $result = ''; + $result = ''; $label = ''; + $newref = $this->ref; - if ($maxlength) { $newref = dol_trunc($newref, $maxlength, 'middle'); + if ($maxlength) { + $newref = dol_trunc($newref, $maxlength, 'middle'); } - if ($this->type == Product::TYPE_PRODUCT) { $label = img_picto('', 'product').' '.$langs->trans("Product").''; + if (!empty($this->entity)) { + $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80); + if ($this->nbphoto > 0) { + $label .= '
'; + $label .= $tmpphoto; + $label .= '
'; + } } - if ($this->type == Product::TYPE_SERVICE) { $label = img_picto('', 'service').' '.$langs->trans("Service").''; + + if ($this->type == Product::TYPE_PRODUCT) { + $label .= img_picto('', 'product').' '.$langs->trans("Product").''; + } elseif ($this->type == Product::TYPE_SERVICE) { + $label .= img_picto('', 'service').' '.$langs->trans("Service").''; } + if (isset($this->status) && isset($this->status_buy)) { + $label .= ' '.$this->getLibStatut(5, 0); + $label .= ' '.$this->getLibStatut(5, 1); + } + if (!empty($this->ref)) { $label .= '
'.$langs->trans('ProductRef').': '.$this->ref; } @@ -4491,16 +4508,6 @@ class Product extends CommonObject $label .= '
'.$langs->trans('ProductAccountancyBuyIntraCode').': '.length_accountg($this->accountancy_code_buy_intra); $label .= '
'.$langs->trans('ProductAccountancyBuyExportCode').': '.length_accountg($this->accountancy_code_buy_export); } - if (isset($this->status) && isset($this->status_buy)) { - $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5, 0); - $label .= ' '.$this->getLibStatut(5, 1); - } - - if (!empty($this->entity)) { - $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80); - if ($this->nbphoto > 0) { $label .= '
'.$tmpphoto; - } - } $linkclose = ''; if (empty($notooltip)) { diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 651aa250ee4..b1d5982ead1 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1102,7 +1102,10 @@ class Project extends CommonObject } $label = ''; - if ($option != 'nolink') $label = img_picto('', $this->picto).' '.$langs->trans("Project").''; + if ($option != 'nolink') $label = img_picto('', $this->picto).' '.$langs->trans("Project").''; + if (isset($this->status)) { + $label .= ' '.$this->getLibStatut(5); + } $label .= ($label ? '
' : '').''.$langs->trans('Ref').': '.$this->ref; // The space must be after the : to not being explode when showing the title in img_picto $label .= ($label ? '
' : '').''.$langs->trans('Label').': '.$this->title; // The space must be after the : to not being explode when showing the title in img_picto if (isset($this->public)) { @@ -1118,9 +1121,6 @@ class Project extends CommonObject $label .= ($label ? '
' : '').''.$langs->trans('DateEnd').': '.dol_print_date($this->datee, 'day'); // The space must be after the : to not being explode when showing the title in img_picto } if ($moreinpopup) $label .= '
'.$moreinpopup; - if (isset($this->status)) { - $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5); - } $url = ''; if ($option != 'nolink') diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index b96c9bbd9db..5bca91b0700 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2339,19 +2339,11 @@ class Societe extends CommonObject if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto))) { $code = ''; - if (($this->client) && (!empty($this->code_client)) - && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 2 - ) - ) - { + if (($this->client) && (!empty($this->code_client)) && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 2)) { $code = $this->code_client.' - '; } - if (($this->fournisseur) && (!empty($this->code_fournisseur)) - && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 3 - ) - ) - { + if (($this->fournisseur) && (!empty($this->code_fournisseur)) && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 3)) { $code .= $this->code_fournisseur.' - '; } @@ -2385,44 +2377,47 @@ class Societe extends CommonObject if ($option == 'customer' || $option == 'compta' || $option == 'category') { - $label .= img_picto('', $this->picto).' '.$langs->trans("Customer").''; + $label .= img_picto('', $this->picto).' '.$langs->trans("Customer").''; $linkstart = ''; + $label .= img_picto('', $this->picto).' '.$langs->trans("Prospect").''; $linkstart = ''; + $label .= img_picto('', $this->picto).' '.$langs->trans("Supplier").''; $linkstart = ''; + $label .= img_picto('', $this->picto).' '.$langs->trans("ThirdParty").''; $linkstart = ''; + $label .= img_picto('', $this->picto).' '.$langs->trans("ThirdParty").''; $linkstart = ''; + $label .= img_picto('', $this->picto).' '.$langs->trans("ThirdParty").''; $linkstart = ''; + $label .= img_picto('', $this->picto).' '.$langs->trans("ThirdParty").''; $linkstart = ''; + $label .= img_picto('', $this->picto).' '.$langs->trans("ThirdParty").''; $linkstart = ''; + $label .= img_picto('', $this->picto).' '.$langs->trans("ThirdParty").''; $linkstart = ' ".$this->getLibStatut(5); - } $label .= ''; // Add type of canvas diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index a7717fd4721..863ec318798 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2485,15 +2485,15 @@ class SupplierProposal extends CommonObject $url = ''; $result = ''; - $label = img_picto('', $this->picto).' '.$langs->trans("SupplierProposal").''; + $label = img_picto('', $this->picto).' '.$langs->trans("SupplierProposal").''; + if (isset($this->status)) { + $label .= ' '.$this->getLibStatut(5); + } if (!empty($this->ref)) $label .= '
'.$langs->trans('Ref').': '.$this->ref; if (!empty($this->ref_fourn)) $label .= '
'.$langs->trans('RefSupplier').': '.$this->ref_fourn; if (!empty($this->total_ht)) $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); if (!empty($this->total_tva)) $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); if (!empty($this->total_ttc)) $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); - if (isset($this->status)) { - $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5); - } if ($option == '') { $url = DOL_URL_ROOT.'/supplier_proposal/card.php?id='.$this->id.$get_params; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 895b81fa716..e39a4b4b962 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1289,7 +1289,8 @@ class Ticket extends CommonObject $result = ''; - $label = img_picto('', $this->picto).' '.$langs->trans("Ticket").''; + $label = img_picto('', $this->picto).' '.$langs->trans("Ticket").''; + $label .= ' '.$this->getLibStatut(4); $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref.'
'; $label .= ''.$langs->trans('TicketTrackId').': '.$this->track_id.'
'; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 2f60be4b05d..2cc43fb9214 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2255,8 +2255,9 @@ class User extends CommonObject // Info Login $label .= '
'; - $label .= img_picto('', $this->picto).' '.$langs->trans("User").'
'; - $label .= ''.$langs->trans('Name').': '.$this->getFullName($langs, ''); + $label .= img_picto('', $this->picto).' '.$langs->trans("User").''; + $label .= ' '.$this->getLibStatut(4); + $label .= '
'.$langs->trans('Name').': '.$this->getFullName($langs, ''); if (!empty($this->login)) $label .= '
'.$langs->trans('Login').': '.$this->login; if (!empty($this->job)) $label .= '
'.$langs->trans("Job").': '.$this->job; $label .= '
'.$langs->trans("Email").': '.$this->email; @@ -2272,7 +2273,6 @@ class User extends CommonObject } $type = ($this->socid ? $langs->trans("External").$company : $langs->trans("Internal")); $label .= '
'.$langs->trans("Type").': '.$type; - $label .= '
'.$langs->trans("Status").': '.$this->getLibStatut(4); $label .= '
'; if ($infologin > 0) {