Qual: Suppression des proprits nom_url au profit de la methode getNomUrl. Ce qui permet de passer en parametre si on veut en plus le picto ou non dans le lien
This commit is contained in:
parent
893dd28a5c
commit
c617bac12f
@ -131,9 +131,7 @@ if ($_GET["id"] > 0)
|
||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">'.$act->id.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td>';
|
||||
print '<td>'.img_object($langs->trans("ShowCompany"),'company').' '.$act->societe->nom_url.'</td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>'.$act->societe->getNomUrl(1).'</td>';
|
||||
print '<td>'.$langs->trans("Contact").'</td>';
|
||||
print '<td>';
|
||||
if ($act->contact->id) print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$act->contact->id.'">'.img_object($langs->trans("ShowContact"),'contact').' '.$act->contact->fullname.'</a>';
|
||||
|
||||
@ -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 '<input type="hidden" name="socid" value="'.$_GET["socid"].'">';
|
||||
}
|
||||
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 '<input type="hidden" name="socid" value="'.$_GET["socid"].'">';
|
||||
}
|
||||
else
|
||||
@ -481,9 +481,7 @@ if ($_GET["id"])
|
||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">'.$act->id.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td>';
|
||||
print '<td>'.img_object($langs->trans("ShowCompany"),'company').' '.$act->societe->nom_url.'</td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>'.$act->societe->getNomUrl(1).'</td>';
|
||||
print '<td>'.$langs->trans("Contact").'</td>';
|
||||
print '<td>';
|
||||
|
||||
|
||||
@ -103,7 +103,7 @@ if ($_GET["action"] == 'create')
|
||||
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="2"><input name="ref" value="'.$numpr.'"></td></tr>';
|
||||
|
||||
// Societe
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.img_object($langs->trans("ShowCompany"),'company').' '.$soc->nom_url;
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.$soc->getNomUrl(1);
|
||||
print '<input type="hidden" name="socidp" value="'.$soc->id.'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -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 = '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$this->id.'">'.$obj->nom.'</a>';
|
||||
}
|
||||
elseif($this->client == 2)
|
||||
{
|
||||
$this->nom_url = '<a href="'.DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$this->id.'">'.$obj->nom.'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->nom_url = '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$this->id.'">'.$obj->nom.'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
$this->lignes = array();
|
||||
|
||||
@ -527,7 +527,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
|
||||
print '</tr>';
|
||||
|
||||
// Client
|
||||
print '<tr><td>'.$langs->trans('Customer').'</td><td>'.img_object($langs->trans("ShowCompany"),'company').' '.$soc->nom_url.'</td>';
|
||||
print '<tr><td>'.$langs->trans('Customer').'</td><td>'.$soc->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Ligne info remises tiers
|
||||
|
||||
@ -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 = '<a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$result["rowid"].'">'.$result["nom"].'</a>';
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
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;
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
|
||||
@ -204,7 +204,7 @@ else
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="20%">'.$langs->trans("Personn").'</td><td><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$user->id.'">'.$user->fullname.'</a></td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("CompanyVisited").'</td><td>'.$soc->nom_url.'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("CompanyVisited").'</td><td>'.$soc->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>';
|
||||
print dolibarr_print_date($deplacement->date);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -103,7 +103,7 @@ if ($resql)
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowTrip"),"trip").' '.$objp->rowid.'</a></td>';
|
||||
print '<td>'.dolibarr_print_date($objp->dd).'</td>';
|
||||
print '<td>' . img_object($langs->trans("ShowCompany"),"company").' '.$soc->nom_url . '</a></td>';
|
||||
print '<td>'.$soc->getNomUrl(1).'</a></td>';
|
||||
print '<td align="left"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' '.$objp->firstname.' '.$objp->name.'</a></td>';
|
||||
print '<td align="right">'.$objp->km.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -738,7 +738,7 @@ if ($_GET['action'] == 'create')
|
||||
print '<tr><td>'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
|
||||
|
||||
// Societe
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.img_object($langs->trans("ShowCompany"),'company').' '.$soc->nom_url.'</td>';
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.$soc->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Ligne info remises tiers
|
||||
|
||||
@ -112,7 +112,7 @@ if ($contact->socid > 0)
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($contact->socid);
|
||||
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->nom_url.'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -355,7 +355,7 @@ if ($user->rights->societe->contact->creer)
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($contact->socid);
|
||||
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->nom_url.'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -449,7 +449,7 @@ if ($_GET["id"] && $_GET["action"] != 'edit')
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($contact->socid);
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->nom_url.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -110,10 +110,10 @@ print '</td></tr></table>';
|
||||
|
||||
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.'<br>';
|
||||
print $langs->trans("Company").' : '.$societe->getNomUrl(0).'<br>';
|
||||
}
|
||||
|
||||
dolibarr_print_object_info($contact);
|
||||
|
||||
@ -143,7 +143,7 @@ if ($_GET["action"] == 'edit')
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($contact->socid);
|
||||
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->nom_url.'</td>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -198,7 +198,7 @@ else
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($contact->socid);
|
||||
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->nom_url.'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
@ -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 "<form name='fichinter' action=\"fiche.php\" method=\"post\">";
|
||||
|
||||
@ -168,7 +168,7 @@ if ($_GET["action"] == 'create')
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<input type="hidden" name="socidp" value='.$_GET["socidp"].'>';
|
||||
print "<tr><td>".$langs->trans("Company")."</td><td>".img_object($langs->trans("ShowCompany"),'company').' '.$objsoc->nom_url."</td></tr>";
|
||||
print "<tr><td>".$langs->trans("Company")."</td><td>".$societe->getNomUrl(1)."</td></tr>";
|
||||
|
||||
print "<tr><td>".$langs->trans("Date")."</td><td>";
|
||||
$sel->select_date(time(),"p",'','','','fichinter');
|
||||
|
||||
@ -382,7 +382,7 @@ else
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td>'.$langs->trans('Company').'</td>';
|
||||
|
||||
print '<td>'.$societe->nom_url.'</td>';
|
||||
print '<td>'.$societe->getNomUrl(1).'</td>';
|
||||
print '<td width="50%" valign="top">'.$langs->trans('Comments').'</tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans('Ref').'</td><td valign="top">';
|
||||
|
||||
@ -114,7 +114,7 @@ if ($_GET["id"])
|
||||
print '</td></tr>';
|
||||
|
||||
print "<tr>";
|
||||
print '<td width="20%">'.$langs->trans("Supplier").'</td><td width="40%">'.$product->fourn->nom_url.'</td>';
|
||||
print '<td width="20%">'.$langs->trans("Supplier").'</td><td width="40%">'.$product->fourn->getNomUrl(1).'</td>';
|
||||
print '</tr><tr>';
|
||||
print '<td width="20%">'.$langs->trans("SupplierRef").'</td><td width="40%">'.$product->fourn_ref.'</td>';
|
||||
print '</tr><tr>';
|
||||
|
||||
@ -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%%
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -114,9 +114,9 @@ else
|
||||
print "<tr>";
|
||||
print "<td>Date</td><td>".strftime("%A %d %B %Y",$concert->date)."</td>\n";
|
||||
|
||||
print '<tr><td valign="top">Artiste/Groupe</td><td valign="top">'.$groupart->nom_url."</td>";
|
||||
print '<tr><td valign="top">Artiste/Groupe</td><td valign="top">'.$groupart->getNomUrl(0)."</td>";
|
||||
|
||||
print '<tr><td valign="top">Lieu</td><td valign="top">'.$lieuconcert->nom_url."</td>";
|
||||
print '<tr><td valign="top">Lieu</td><td valign="top">'.$lieuconcert->getNomUrl(0)."</td>";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td valign="top">'.nl2br($concert->description)."</td>";
|
||||
|
||||
|
||||
@ -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 = '<a href="'.DOL_URL_ROOT.'/product/concert/fichelieu.php?id='.$result["rowid"].'">'.$result["nom"].'</a>';
|
||||
}
|
||||
$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 '<a href="'.DOL_URL_ROOT.'/product/concert/fichelieu.php?id='.$this->rowid.'">'.$this->nom.'</a>';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -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 '<a href="'.DOL_URL_ROOT.'/product/groupart/fiche.php?id='.$this->rowid.'">'.$this->nom.'</a>';
|
||||
}
|
||||
|
||||
|
||||
$this->id = $result["rowid"];
|
||||
$this->nom = $result["nom"];
|
||||
$this->desc = $result["description"];
|
||||
$this->grar = $result["groupart"];
|
||||
|
||||
$this->nom_url = '<a href="'.DOL_URL_ROOT.'/product/groupart/fiche.php?id='.$result["rowid"].'">'.$result["nom"].'</a>';
|
||||
|
||||
}
|
||||
$this->db->free();
|
||||
|
||||
return $result;
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
|
||||
@ -137,18 +137,18 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Ref").'</td><td><input size="10" type="text" name="ref"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input size="30" type="text" name="title"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||
$societe = new Societe($db);
|
||||
$societe->fetch($_GET["socidp"]);
|
||||
print $societe->nom_url;
|
||||
|
||||
print $societe->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Author").'</td><td>'.$user->fullname.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Ref").'</td><td><input size="10" type="text" name="ref"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input size="30" type="text" name="title"></td></tr>';
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
@ -214,12 +214,12 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$_GET["id"].'">';
|
||||
|
||||
print '<table class="border" width="50%">';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>'.$projet->societe->nom_url.'</td></tr>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td>'.$langs->trans("Ref").'</td><td><input name="ref" value="'.$projet->ref.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input name="title" value="'.$projet->title.'"></td></tr>';
|
||||
print '<tr><td align="center" colspan="2"><input name="update" type="submit" Value="'.$langs->trans("Modify").'"> <input type="submit" name="cancel" Value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>'.$projet->societe->$projet->societe->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td align="center" colspan="2"><input name="update" class="button" type="submit" value="'.$langs->trans("Modify").'"> <input type="submit" class="button" name="cancel" Value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
}
|
||||
@ -227,10 +227,10 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
{
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>'.$projet->societe->nom_url.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projet->title.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>'.$projet->societe->getNomUrl(1).'</td></tr>';
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
|
||||
@ -199,18 +199,18 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Ref").'</td><td><input size="10" type="text" name="ref"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input size="30" type="text" name="title"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||
$societe = new Societe($db);
|
||||
$societe->fetch($_GET["socidp"]);
|
||||
print $societe->nom_url;
|
||||
|
||||
print $societe->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Author").'</td><td>'.$user->fullname.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Ref").'</td><td><input size="10" type="text" name="ref"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input size="30" type="text" name="title"></td></tr>';
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" value="'.$langs->trans("Create").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
@ -266,7 +266,7 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
print '<input type="hidden" name="action" value="createtask">';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>'.$projet->title.'</td>';
|
||||
print '<td>'.$langs->trans("Company").'</td><td>'.$projet->societe->nom_url.'</td></tr>';
|
||||
print '<td>'.$langs->trans("Company").'</td><td>'.$projet->societe->getNomUrl(1).'</td></tr>';
|
||||
|
||||
|
||||
/* Liste des acteurs */
|
||||
|
||||
@ -88,7 +88,7 @@ if ($_GET["id"] > 0)
|
||||
print '<input type="hidden" name="action" value="createtask">';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>'.$projet->title.'</td>';
|
||||
print '<td>'.$langs->trans("Company").'</td><td>'.$projet->societe->nom_url.'</td></tr>';
|
||||
print '<td>'.$langs->trans("Company").'</td><td>'.$projet->societe->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Task").'</td><td colspan="3">'.$task->title.'</td></tr>';
|
||||
|
||||
/* Liste des tâches */
|
||||
|
||||
@ -538,19 +538,6 @@ class Societe
|
||||
$this->client = $obj->client;
|
||||
$this->fournisseur = $obj->fournisseur;
|
||||
|
||||
if ($this->client == 1)
|
||||
{
|
||||
$this->nom_url = '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$this->id.'">'.$obj->nom.'</a>';
|
||||
}
|
||||
elseif($this->client == 2)
|
||||
{
|
||||
$this->nom_url = '<a href="'.DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$this->id.'">'.$obj->nom.'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->nom_url = '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$this->id.'">'.$obj->nom.'</a>';
|
||||
}
|
||||
|
||||
$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 = '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$this->id.'">';
|
||||
$lienfin='</a>';
|
||||
}
|
||||
elseif($this->client == 2)
|
||||
{
|
||||
$lien= '<a href="'.DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$this->id.'">';
|
||||
$lienfin='</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$this->id.'">';
|
||||
$lienfin='</a>';
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user