From c617bac12f231da39d6df9966cf22e7dbf3df476 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jun 2006 14:47:05 +0000 Subject: [PATCH] =?UTF-8?q?Qual:=20Suppression=20des=20propri=E9t=E9s=20no?= =?UTF-8?q?m=5Furl=20au=20profit=20de=20la=20methode=20getNomUrl.=20Ce=20q?= =?UTF-8?q?ui=20permet=20de=20passer=20en=20parametre=20si=20on=20veut=20e?= =?UTF-8?q?n=20plus=20le=20picto=20ou=20non=20dans=20le=20lien?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/action/document.php | 4 +- htdocs/comm/action/fiche.php | 8 +-- htdocs/comm/addpropal.php | 2 +- htdocs/comm/adresse_livraison.class.php | 13 ---- htdocs/commande/fiche.php | 2 +- htdocs/commande/osccommande.class.php | 66 +++++++++++--------- htdocs/compta/deplacement/fiche.php | 2 +- htdocs/compta/deplacement/index.php | 2 +- htdocs/compta/facture.php | 2 +- htdocs/contact/exportimport.php | 2 +- htdocs/contact/fiche.php | 4 +- htdocs/contact/info.php | 6 +- htdocs/contact/perso.php | 4 +- htdocs/fichinter/fiche.php | 8 +-- htdocs/fourn/facture/fiche.php | 2 +- htdocs/fourn/product/fourn.php | 2 +- htdocs/langs/en_US/companies.lang | 4 +- htdocs/langs/fr_FR/bills.lang | 4 +- htdocs/langs/fr_FR/companies.lang | 8 +-- htdocs/product/concert/fiche.php | 4 +- htdocs/product/concert/lieuconcert.class.php | 61 +++++++++++------- htdocs/product/groupart/groupart.class.php | 62 +++++++++++------- htdocs/projet/fiche.php | 22 +++---- htdocs/projet/tasks/fiche.php | 12 ++-- htdocs/projet/tasks/task.php | 2 +- htdocs/societe.class.php | 51 ++++++++++----- 26 files changed, 199 insertions(+), 160 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 299bdd74c5c..52600ea1b0c 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -131,9 +131,7 @@ if ($_GET["id"] > 0) print ''.$langs->trans("Ref").''.$act->id.''; print ''.$langs->trans("Type").''.$act->type.''; print ''.$langs->trans("Title").''.$act->label.''; - print ''.$langs->trans("Company").''; - print ''.img_object($langs->trans("ShowCompany"),'company').' '.$act->societe->nom_url.''; - + print ''.$langs->trans("Company").''.$act->societe->getNomUrl(1).''; print ''.$langs->trans("Contact").''; print ''; if ($act->contact->id) print ''.img_object($langs->trans("ShowContact"),'contact').' '.$act->contact->fullname.''; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index fec8b67981c..a2bc28c7b11 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -220,7 +220,7 @@ if ($_GET["action"] == 'create') { $societe = new Societe($db); $societe->fetch($_GET["socid"]); - print $societe->nom_url; + print $societe->getNomUrl(1); print ''; } else @@ -312,7 +312,7 @@ if ($_GET["action"] == 'create') { $societe = new Societe($db); $societe->fetch($_GET["socid"]); - print img_object($langs->trans("ShowCompany"),'company').' '.$societe->nom_url; + print $societe->getNomUrl(1); print ''; } else @@ -481,9 +481,7 @@ if ($_GET["id"]) print ''.$langs->trans("Ref").''.$act->id.''; print ''.$langs->trans("Type").''.$act->type.''; print ''.$langs->trans("Title").''.$act->label.''; - print ''.$langs->trans("Company").''; - print ''.img_object($langs->trans("ShowCompany"),'company').' '.$act->societe->nom_url.''; - + print ''.$langs->trans("Company").''.$act->societe->getNomUrl(1).''; print ''.$langs->trans("Contact").''; print ''; diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index 8d0708bf0f6..35a7abd9498 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -103,7 +103,7 @@ if ($_GET["action"] == 'create') print ''.$langs->trans("Ref").''; // Societe - print ''.$langs->trans('Company').''.img_object($langs->trans("ShowCompany"),'company').' '.$soc->nom_url; + print ''.$langs->trans('Company').''.$soc->getNomUrl(1); print ''; print ''; print ''; diff --git a/htdocs/comm/adresse_livraison.class.php b/htdocs/comm/adresse_livraison.class.php index f2f6e93dbbe..e3b51b0b78a 100644 --- a/htdocs/comm/adresse_livraison.class.php +++ b/htdocs/comm/adresse_livraison.class.php @@ -258,19 +258,6 @@ class Livraison $this->id = $obj->idp; $this->client = $obj->client; $this->fournisseur = $obj->fournisseur; - - if ($this->client == 1) - { - $this->nom_url = ''.$obj->nom.''; - } - elseif($this->client == 2) - { - $this->nom_url = ''.$obj->nom.''; - } - else - { - $this->nom_url = ''.$obj->nom.''; - } } $this->lignes = array(); diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 1a73b63a5db..5f0cf5f2c4e 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -527,7 +527,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print ''; // Client - print ''.$langs->trans('Customer').''.img_object($langs->trans("ShowCompany"),'company').' '.$soc->nom_url.''; + print ''.$langs->trans('Customer').''.$soc->getNomUrl(1).''; print ''; // Ligne info remises tiers diff --git a/htdocs/commande/osccommande.class.php b/htdocs/commande/osccommande.class.php index 01585ce8909..ec81873d19c 100644 --- a/htdocs/commande/osccommande.class.php +++ b/htdocs/commande/osccommande.class.php @@ -21,42 +21,46 @@ * */ -class OscCommande { - var $db ; +class OscCommande +{ + var $db ; + + var $id ; + var $client_name ; - var $id ; - var $client_name ; - - function OscCommande($DB, $id=0) { - $this->db = $DB; - $this->id = $id ; - } - /* - * - * - * - */ - function fetch ($id) - { - - $sql = "SELECT o.orders_id, o.customers_name, o.orders_status FROM ".OSC_DB_NAME.".orders as o"; - $sql .= " WHERE o.orders_id = $id"; - - $result = $this->db->query($sql) ; - - if ( $result ) + + function OscCommande($DB, $id=0) { - $result = $this->db->fetch_array(); + $this->db = $DB; + $this->id = $id ; + } + - $this->id = $result["rowid"]; - $this->client_name = $result["customers_name"]; - - $this->nom_url = ''.$result["nom"].''; + /* + * + * + * + */ + function fetch ($id) + { + $sql = "SELECT o.orders_id, o.customers_name, o.orders_status FROM ".OSC_DB_NAME.".orders as o"; + $sql .= " WHERE o.orders_id = $id"; + + $result = $this->db->query($sql) ; + + if ( $result ) + { + $result = $this->db->fetch_array(); + + $this->id = $result["rowid"]; + $this->client_name = $result["customers_name"]; + } + $this->db->free(); + + return $result; } - $this->db->free(); + - return $result; - } /* * * diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index 7b154766b78..509eb4f22ad 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -204,7 +204,7 @@ else print ''; print ''; - print ''; + print ''; print ''; diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 1a1d786c6fb..a4962e87e73 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -103,7 +103,7 @@ if ($resql) print ""; print ''; print ''; - print ''; + print ''; print ''; print ''; print "\n"; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 97ff3ca1e63..e43db825994 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -738,7 +738,7 @@ if ($_GET['action'] == 'create') print ''; // Societe - print ''; + print ''; print ''; // Ligne info remises tiers diff --git a/htdocs/contact/exportimport.php b/htdocs/contact/exportimport.php index 467201c053c..15990bafbfd 100644 --- a/htdocs/contact/exportimport.php +++ b/htdocs/contact/exportimport.php @@ -112,7 +112,7 @@ if ($contact->socid > 0) $objsoc = new Societe($db); $objsoc->fetch($contact->socid); - print ''; + print ''; } else { diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 8203163102e..9c3eaf050d4 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -355,7 +355,7 @@ if ($user->rights->societe->contact->creer) $objsoc = new Societe($db); $objsoc->fetch($contact->socid); - print ''; + print ''; } else { @@ -449,7 +449,7 @@ if ($_GET["id"] && $_GET["action"] != 'edit') $objsoc = new Societe($db); $objsoc->fetch($contact->socid); - print ''; + print ''; } else { diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php index b106864f905..38637df57ea 100644 --- a/htdocs/contact/info.php +++ b/htdocs/contact/info.php @@ -110,10 +110,10 @@ print '
'.$langs->trans("Personn").''.$user->fullname.'
'.$langs->trans("CompanyVisited").''.$soc->nom_url.'
'.$langs->trans("CompanyVisited").''.$soc->getNomUrl(1).'
'.$langs->trans("Date").''; print dolibarr_print_date($deplacement->date); print '
'.img_object($langs->trans("ShowTrip"),"trip").' '.$objp->rowid.''.dolibarr_print_date($objp->dd).'' . img_object($langs->trans("ShowCompany"),"company").' '.$soc->nom_url . ''.$soc->getNomUrl(1).''.img_object($langs->trans("ShowUser"),"user").' '.$objp->firstname.' '.$objp->name.''.$objp->km.'
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'.$langs->trans('Company').''.img_object($langs->trans("ShowCompany"),'company').' '.$soc->nom_url.'
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'.$langs->trans("Company").''.$objsoc->nom_url.'
'.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
'.$langs->trans("Company").''.$objsoc->nom_url.'
'.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
'.$langs->trans("Company").''.$objsoc->nom_url.'
'.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
'; if ($contact->socid > 0) { - $objsoc = new Societe($db); - $objsoc->fetch($contact->socid); + $societe = new Societe($db); + $societe->fetch($contact->socid); - print $langs->trans("Company").' : '.$objsoc->nom_url.'
'; + print $langs->trans("Company").' : '.$societe->getNomUrl(0).'
'; } dolibarr_print_object_info($contact); diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index bcecdb92894..f0213d26141 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -143,7 +143,7 @@ if ($_GET["action"] == 'edit') $objsoc = new Societe($db); $objsoc->fetch($contact->socid); - print ''.$langs->trans("Company").''.$objsoc->nom_url.''; + print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; } else { @@ -198,7 +198,7 @@ else $objsoc = new Societe($db); $objsoc->fetch($contact->socid); - print ''.$langs->trans("Company").''.$objsoc->nom_url.''; + print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; } else diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 951760700f3..8ca69379cb1 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -44,8 +44,8 @@ if (!$user->rights->ficheinter->lire) accessforbidden(); if ($_GET["socidp"]) { - $objsoc=new Societe($db); - $objsoc->fetch($_GET["socidp"]); + $societe=new Societe($db); + $societe->fetch($_GET["socidp"]); } // Sécurité accés client @@ -159,7 +159,7 @@ if ($_GET["action"] == 'create') // $modFicheinter = new $obj; // $numpr = $modFicheinter->getNextValue($soc); - $numpr = $fix->get_new_num($objsoc); + $numpr = $fix->get_new_num($societe); print "
"; @@ -168,7 +168,7 @@ if ($_GET["action"] == 'create') print ''; print ''; - print ""; + print ""; print "
".$langs->trans("Company")."".img_object($langs->trans("ShowCompany"),'company').' '.$objsoc->nom_url."
".$langs->trans("Company")."".$societe->getNomUrl(1)."
".$langs->trans("Date").""; $sel->select_date(time(),"p",'','','','fichinter'); diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 899c32716ff..c2014df3e2d 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -382,7 +382,7 @@ else print ''; print ''; - print ''; + print ''; print ''; print ''; print ""; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 34f09de773c..7084683fdd4 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -72,8 +72,8 @@ Prospect=Prospect CustomerCard=Customer Card Customer=Customer CustomerDiscount=Customer Discount -CustomerRelativeDiscount=Relative global discount -CustomerAbsoluteDiscount=Absolute discount +CustomerRelativeDiscount=Relative customer discount +CustomerAbsoluteDiscount=Absolute customer discount CustomerRelativeDiscountShort=Relative discount CustomerAbsoluteDiscountShort=Absolute discount CompanyHasRelativeDiscount=This customer has a discount of %s%% diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 5e6d7e9fcb9..105a3a13e33 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -135,8 +135,8 @@ NoteReason=Note/Motif ReasonDiscount=Motif AddGlobalDiscount=Ajouter remise fixe DiscountOfferedBy=Accordé par -DiscountStillRemaining=Remises absolues restant en cours -DiscountAlreadyCounted=Remises absolues déjà appliquées +DiscountStillRemaining=Remises fixes restant en cours +DiscountAlreadyCounted=Remises fixes déjà appliquées BillAddress=Adresse de facturation # PaymentConditions PaymentConditionShortRECEP=A réception diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 780a2d7a0fa..e117d557be6 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -72,16 +72,16 @@ Prospect=Prospect CustomerCard=Fiche Client Customer=Client CustomerDiscount=Remise client -CustomerRelativeDiscount=Remise globale relative -CustomerAbsoluteDiscount=Remise globale fixe +CustomerRelativeDiscount=Remise client relative +CustomerAbsoluteDiscount=Remise client fixe CustomerRelativeDiscountShort=Remise relative CustomerAbsoluteDiscountShort=Remise fixe CompanyHasRelativeDiscount=Ce client a une remise par défaut de %s%% CompanyHasNoRelativeDiscount=Ce client n'a pas de remises par défaut CompanyHasAbsoluteDiscount=Ce client a %s %s de remises fixes disponibles CompanyHasNoAbsoluteDiscount=Ce client n'a pas ou plus de remises fixes disponibles -CustomerAbsoluteDiscountAllUsers=Remises en cours (accordées par tout utilisateur) -CustomerAbsoluteDiscountMy=Remises en cours (accordées personnellement) +CustomerAbsoluteDiscountAllUsers=Remises fixes en cours (accordées par tout utilisateur) +CustomerAbsoluteDiscountMy=Remises fixes en cours (accordées personnellement) DefaultDiscount=Remise par défaut DiscountNone=Aucune Supplier=Fournisseur diff --git a/htdocs/product/concert/fiche.php b/htdocs/product/concert/fiche.php index ab98d465490..a30f297a3c3 100644 --- a/htdocs/product/concert/fiche.php +++ b/htdocs/product/concert/fiche.php @@ -114,9 +114,9 @@ else print ""; print "\n"; - print '"; + print '"; - print '"; + print '"; print '"; diff --git a/htdocs/product/concert/lieuconcert.class.php b/htdocs/product/concert/lieuconcert.class.php index 88b43133c89..872a7457b52 100644 --- a/htdocs/product/concert/lieuconcert.class.php +++ b/htdocs/product/concert/lieuconcert.class.php @@ -80,31 +80,46 @@ class LieuConcert { print $this->db->error() . ' in ' . $sql; } } - /* - * - * - * - */ - function fetch ($id) { - - $sql = "SELECT rowid, nom, ville, description FROM ".MAIN_DB_PREFIX."lieu_concert WHERE rowid = $id"; + + + /* + * + * + * + */ + function fetch ($id) + { + $sql = "SELECT rowid, nom, ville, description FROM ".MAIN_DB_PREFIX."lieu_concert WHERE rowid = $id"; + + $result = $this->db->query($sql) ; + + if ( $result ) + { + $result = $this->db->fetch_array(); + + $this->id = $result["rowid"]; + $this->nom = $result["nom"]; + $this->ville = $result["ville"]; + $this->description = $result["description"]; + } + $this->db->free(); + + return $result; + } - $result = $this->db->query($sql) ; - if ( $result ) { - $result = $this->db->fetch_array(); - - $this->id = $result["rowid"]; - $this->nom = $result["nom"]; - $this->ville = $result["ville"]; - $this->description = $result["description"]; - - $this->nom_url = ''.$result["nom"].''; - } - $this->db->free(); - - return $result; - } + /** + * \brief Renvoie le nom clicable + * \param withpicto Inclut le picto dans le lien + * \return string Chaine avec URL + */ + function getNomUrl($withpicto=0) + { + global $langs; + + $result=''; + return ''.$this->nom.''; + } /* diff --git a/htdocs/product/groupart/groupart.class.php b/htdocs/product/groupart/groupart.class.php index 8ee915c4193..a08de6b487c 100644 --- a/htdocs/product/groupart/groupart.class.php +++ b/htdocs/product/groupart/groupart.class.php @@ -79,32 +79,48 @@ class Groupart { print $this->db->error() . ' in ' . $sql; } } - /* - * - * - * - */ - function fetch ($id) { - - $sql = "SELECT rowid, nom, groupart, description FROM ".MAIN_DB_PREFIX."groupart WHERE rowid = $id"; + + + /* + * + * + * + */ + function fetch ($id) + { + $sql = "SELECT rowid, nom, groupart, description FROM ".MAIN_DB_PREFIX."groupart WHERE rowid = $id"; + + $result = $this->db->query($sql) ; + + if ( $result ) + { + $result = $this->db->fetch_array(); + + $this->id = $result["rowid"]; + $this->nom = $result["nom"]; + $this->desc = $result["description"]; + $this->grar = $result["groupart"]; + } + $this->db->free(); + + return $result; + } - $result = $this->db->query($sql) ; - if ( $result ) { - $result = $this->db->fetch_array(); + /** + * \brief Renvoie le nom clicable + * \param withpicto Inclut le picto dans le lien + * \return string Chaine avec URL + */ + function getNomUrl($withpicto=0) + { + global $langs; + + $result=''; + return ''.$this->nom.''; + } + - $this->id = $result["rowid"]; - $this->nom = $result["nom"]; - $this->desc = $result["description"]; - $this->grar = $result["groupart"]; - - $this->nom_url = ''.$result["nom"].''; - - } - $this->db->free(); - - return $result; - } /* * * diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index 5ecad811215..1eacc3ef138 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -137,18 +137,18 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) print '
'.$langs->trans('Company').''.$societe->nom_url.''.$societe->getNomUrl(1).''.$langs->trans('Comments').'
'.$langs->trans('Ref').''; diff --git a/htdocs/fourn/product/fourn.php b/htdocs/fourn/product/fourn.php index 16868d9ee4e..e92a2c1932d 100644 --- a/htdocs/fourn/product/fourn.php +++ b/htdocs/fourn/product/fourn.php @@ -114,7 +114,7 @@ if ($_GET["id"]) print '
'.$langs->trans("Supplier").''.$product->fourn->nom_url.''.$langs->trans("Supplier").''.$product->fourn->getNomUrl(1).'
'.$langs->trans("SupplierRef").''.$product->fourn_ref.'
Date".strftime("%A %d %B %Y",$concert->date)."
Artiste/Groupe'.$groupart->nom_url."
Artiste/Groupe'.$groupart->getNomUrl(0)."
Lieu'.$lieuconcert->nom_url."
Lieu'.$lieuconcert->getNomUrl(0)."
'.$langs->trans("Description").''.nl2br($concert->description)."
'; print ''; - print ''; + print ''; + + print ''; print ''; - print ''; - print ''; print ''; print '
'.$langs->trans("Company").''; + print '
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
'.$langs->trans("Company").''; $societe = new Societe($db); $societe->fetch($_GET["socidp"]); - print $societe->nom_url; - + print $societe->getNomUrl(1); print '
'.$langs->trans("Author").''.$user->fullname.'
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
'; print ''; @@ -214,12 +214,12 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) print ''; print ''; - print ''; - print ''; - + print '
'.$langs->trans("Company").''.$projet->societe->nom_url.'
'; print ''; print ''; - print ''; + + print ''; + print ''; print '
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
 
'.$langs->trans("Company").''.$projet->societe->$projet->societe->getNomUrl(1).'
 
'; print ''; } @@ -227,10 +227,10 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) { print ''; - print ''; - print ''; print ''; + + print ''; print '
'.$langs->trans("Company").''.$projet->societe->nom_url.'
'.$langs->trans("Ref").''.$projet->ref.'
'.$langs->trans("Label").''.$projet->title.'
'.$langs->trans("Company").''.$projet->societe->getNomUrl(1).'
'; } diff --git a/htdocs/projet/tasks/fiche.php b/htdocs/projet/tasks/fiche.php index fcda60f4908..48ec8bc8d7a 100644 --- a/htdocs/projet/tasks/fiche.php +++ b/htdocs/projet/tasks/fiche.php @@ -199,18 +199,18 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) print ''; print ''; - print ''; + print ''; + + print ''; print ''; - print ''; - print ''; print ''; print '
'.$langs->trans("Company").''; + print '
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
'.$langs->trans("Company").''; $societe = new Societe($db); $societe->fetch($_GET["socidp"]); - print $societe->nom_url; - + print $societe->getNomUrl(1); print '
'.$langs->trans("Author").''.$user->fullname.'
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
'; print ''; @@ -266,7 +266,7 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) print ''; print ''; print ''; - print ''; + print ''; /* Liste des acteurs */ diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 1908e1ae41b..1348c9a85ea 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -88,7 +88,7 @@ if ($_GET["id"] > 0) print ''; print '
'.$langs->trans("Project").''.$projet->title.''.$langs->trans("Company").''.$projet->societe->nom_url.'
'.$langs->trans("Company").''.$projet->societe->getNomUrl(1).'
'; print ''; - print ''; + print ''; print ''; /* Liste des tâches */ diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index 9cadfb80421..6bc5b8fc84c 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -538,19 +538,6 @@ class Societe $this->client = $obj->client; $this->fournisseur = $obj->fournisseur; - if ($this->client == 1) - { - $this->nom_url = ''.$obj->nom.''; - } - elseif($this->client == 2) - { - $this->nom_url = ''.$obj->nom.''; - } - else - { - $this->nom_url = ''.$obj->nom.''; - } - $this->rubrique = $obj->rubrique; $this->note = $obj->note; // multiprix @@ -1087,10 +1074,44 @@ class Societe } } + + /** + * \brief Renvoie nom clicable (avec eventuellement le picto) + * \param withpicto Inclut le picto dans le lien + * \return string Chaine avec URL + */ + function getNomUrl($withpicto=0) + { + global $langs; + + $result=''; + + if ($this->client == 1) + { + $lien = ''; + $lienfin=''; + } + elseif($this->client == 2) + { + $lien= ''; + $lienfin=''; + } + else + { + $lien = ''; + $lienfin=''; + } + + if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany"),'company').$lienfin.' '); + $result.=$lien.$this->nom.$lienfin; + return $result; + } + + /** * \brief Renvoie le nom d'une societe a partir d'un id - * \param id id de la société recherchée - * + * \param id id de la société recherchée + * \return string Nom de la société */ function get_nom($id) {
'.$langs->trans("Project").''.$projet->title.''.$langs->trans("Company").''.$projet->societe->nom_url.'
'.$langs->trans("Company").''.$projet->societe->getNomUrl(1).'
'.$langs->trans("Task").''.$task->title.'