Fix: Debuggage de petit bugs mineures par ci par la
This commit is contained in:
parent
ea7a7e8bf9
commit
1f5cdce88b
@ -317,7 +317,7 @@ print "<tr class=\"liste_titre\">\n";
|
|||||||
print " <td>".$langs->trans("Name")."</td>\n";
|
print " <td>".$langs->trans("Name")."</td>\n";
|
||||||
print " <td>".$langs->trans("Value")."</td>\n";
|
print " <td>".$langs->trans("Value")."</td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("Directory")."</td>\n <td>".$conf->avoir->dir_output."</td>\n</tr>\n";
|
print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("Directory")."</td>\n <td>".$conf->societe->dir_avoir."</td>\n</tr>\n";
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -524,7 +524,7 @@ if ($_GET["id"])
|
|||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($_GET["action"] != 'edit')
|
if ($_GET["action"] != 'edit' && $_GET["action"] != 'delete')
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="fiche.php?action=edit&id='.$act->id.'">'.$langs->trans("Edit").'</a>';
|
print '<a class="butAction" href="fiche.php?action=edit&id='.$act->id.'">'.$langs->trans("Edit").'</a>';
|
||||||
|
|
||||||
|
|||||||
@ -52,11 +52,13 @@ $search_ville=isset($_GET["search_ville"])?$_GET["search_ville"]:$_POST["search_
|
|||||||
$search_code=isset($_GET["search_code"])?$_GET["search_contract"]:$_POST["search_code"];
|
$search_code=isset($_GET["search_code"])?$_GET["search_contract"]:$_POST["search_code"];
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm, s.code_client";
|
|
||||||
if (!$user->rights->commercial->client->voir) $sql .= ", sc.fk_soc, sc.fk_user";
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st";
|
$sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm, s.code_client";
|
||||||
if (!$user->rights->commercial->client->voir) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->commercial->client->voir) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
$sql .= " WHERE s.fk_stcomm = st.id AND s.client=1";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st";
|
||||||
|
if (!$user->rights->commercial->client->voir) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql .= " WHERE s.fk_stcomm = st.id AND s.client=1";
|
||||||
|
|
||||||
if ($socidp) $sql .= " AND s.idp = $socidp";
|
if ($socidp) $sql .= " AND s.idp = $socidp";
|
||||||
if ($user->societe_id) $sql .= " AND s.idp = " .$user->societe_id;
|
if ($user->societe_id) $sql .= " AND s.idp = " .$user->societe_id;
|
||||||
@ -79,76 +81,82 @@ if (! $sortfield) $sortfield="s.nom";
|
|||||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset);
|
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Affichage liste
|
||||||
|
*/
|
||||||
|
|
||||||
|
llxHeader();
|
||||||
|
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
llxHeader();
|
print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num);
|
||||||
|
|
||||||
print_barre_liste($langs->trans("ListOfCustomers"), $page, "clients.php","",$sortfield,$sortorder,"",$num);
|
$i = 0;
|
||||||
|
|
||||||
$i = 0;
|
$addu = "&search_nom=".$search_nom."&search_code=".$search_code."&search_ville=".$search_ville;
|
||||||
|
print '<table class="liste">';
|
||||||
$addu = "&search_nom=".$search_nom."&search_code=".$search_code."&search_ville=".$search_ville;
|
print '<tr class="liste_titre">';
|
||||||
print '<table class="liste">';
|
print_liste_field_titre($langs->trans("Company"),"clients.php","s.nom",$addu,"","",$sortfield);
|
||||||
print '<tr class="liste_titre">';
|
print_liste_field_titre($langs->trans("Town"),"clients.php","s.ville",$addu,"","",$sortfield);
|
||||||
print_liste_field_titre($langs->trans("Company"),"clients.php","s.nom",$addu,"","",$sortfield);
|
print_liste_field_titre($langs->trans("CustomerCode"),"clients.php","s.code_client",$addu,"","",$sortfield);
|
||||||
print_liste_field_titre($langs->trans("Town"),"clients.php","s.ville",$addu,"","",$sortfield);
|
print_liste_field_titre($langs->trans("DateCreation"),"clients.php","datec",$addu,"",'align="center"',$sortfield);
|
||||||
print_liste_field_titre($langs->trans("CustomerCode"),"clients.php","s.code_client",$addu,"","",$sortfield);
|
print '<td class="liste_titre"> </td>';
|
||||||
print_liste_field_titre($langs->trans("DateCreation"),"clients.php","datec",$addu,"",'align="center"',$sortfield);
|
print "</tr>\n";
|
||||||
print '<td class="liste_titre"> </td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
print '<form method="get" action="clients.php">';
|
print '<form method="get" action="clients.php">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre" valign="right">';
|
print '<td class="liste_titre" valign="right">';
|
||||||
print '<input type="text" class="flat" name="search_nom" value="'.stripslashes($search_nom).'">';
|
print '<input type="text" class="flat" name="search_nom" value="'.stripslashes($search_nom).'">';
|
||||||
print '</td><td class="liste_titre" valign="right">';
|
print '</td><td class="liste_titre" valign="right">';
|
||||||
print '<input type="text" class="flat" name="search_ville" value="'.$search_ville.'" size="10">';
|
print '<input type="text" class="flat" name="search_ville" value="'.$search_ville.'" size="10">';
|
||||||
print '</td><td class="liste_titre" valign="right">';
|
print '</td><td class="liste_titre" valign="right">';
|
||||||
print '<input type="text" class="flat" name="search_code" value="'.$search_code.'" size="10">';
|
print '<input type="text" class="flat" name="search_code" value="'.$search_code.'" size="10">';
|
||||||
print '</td><td class="liste_titre"> </td>';
|
print '</td><td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre" align="center"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
|
print '<td class="liste_titre" align="center"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
$var=True;
|
|
||||||
|
|
||||||
while ($i < min($num,$conf->liste_limit))
|
$var=True;
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($result);
|
|
||||||
|
|
||||||
$var=!$var;
|
|
||||||
|
|
||||||
print "<tr $bc[$var]>";
|
while ($i < min($num,$conf->liste_limit))
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->idp.'">';
|
|
||||||
print img_object($langs->trans("ShowCustomer"),"company");
|
|
||||||
print '</a> <a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->idp.'">'.stripslashes($obj->nom).'</a></td>';
|
|
||||||
print '<td>'.$obj->ville.'</td>';
|
|
||||||
print '<td>'.$obj->code_client.'</td>';
|
|
||||||
print '<td align="center">'.dolibarr_print_date($obj->datec).'</td>';
|
|
||||||
print '<td align="center">';
|
|
||||||
if (defined("MAIN_MODULE_DOSSIER") && MAIN_MODULE_DOSSIER == 1)
|
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/dossier/client/fiche.php?id='.$obj->idp.'">';
|
$obj = $db->fetch_object($result);
|
||||||
print img_folder();
|
|
||||||
print '</a>';
|
$var=!$var;
|
||||||
|
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
|
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->idp.'">';
|
||||||
|
print img_object($langs->trans("ShowCustomer"),"company");
|
||||||
|
print '</a> <a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->idp.'">'.stripslashes($obj->nom).'</a></td>';
|
||||||
|
print '<td>'.$obj->ville.'</td>';
|
||||||
|
print '<td>'.$obj->code_client.'</td>';
|
||||||
|
print '<td align="center">'.dolibarr_print_date($obj->datec).'</td>';
|
||||||
|
print '<td align="center">';
|
||||||
|
if (defined("MAIN_MODULE_DOSSIER") && MAIN_MODULE_DOSSIER == 1)
|
||||||
|
{
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/dossier/client/fiche.php?id='.$obj->idp.'">';
|
||||||
|
print img_folder();
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print " ";
|
||||||
|
}
|
||||||
|
print "</td></tr>\n";
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
else
|
print "</table>";
|
||||||
{
|
$db->free($result);
|
||||||
print " ";
|
|
||||||
}
|
|
||||||
print "</td></tr>\n";
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
$db->free($result);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -461,10 +461,10 @@ if ($socidp > 0)
|
|||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$objp->cid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."</a>\n";
|
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$objp->cid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."</a>\n";
|
||||||
print '</td><td align="right" width="80">'.dolibarr_print_date($objp->dc)."</td>\n";
|
print '</td><td align="right" width="80">'.dolibarr_print_date($objp->dc)."</td>\n";
|
||||||
print '<td align="right" width="120">'.price($objp->total_ht).'</td>';
|
print '<td align="right" width="120">'.price($objp->total_ht).'</td>';
|
||||||
print '<td align="center" width="100">'.$commande_static->status_label_short[$objp->fk_statut].'</td></tr>';
|
print '<td align="right" width="100">'.$commande_static->LibStatut($objp->fk_statut,5).'</td></tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|||||||
@ -175,7 +175,9 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
|||||||
*/
|
*/
|
||||||
print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
|
print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
|
||||||
|
|
||||||
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.code, c.libelle, a.fk_user_author, s.nom as sname, s.idp";
|
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, a.fk_user_author, a.percent,";
|
||||||
|
$sql.= " c.code, c.libelle,";
|
||||||
|
$sql.= " s.nom as sname, s.idp";
|
||||||
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user ";
|
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -184,37 +186,39 @@ if (!$user->rights->commercial->client->voir && !$socidp) $sql .= " AND s.idp =
|
|||||||
$sql .= " ORDER BY a.datea DESC";
|
$sql .= " ORDER BY a.datea DESC";
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
|
||||||
$var=true;
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td colspan="4">'.$langs->trans("ActionsToDo").'</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
while ($i < $num )
|
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$var=true;
|
||||||
$var=!$var;
|
|
||||||
|
|
||||||
print "<tr $bc[$var]><td>".dolibarr_print_date($obj->da)."</td>";
|
|
||||||
|
|
||||||
$transcode=$langs->trans("Action".$obj->code);
|
print '<table class="noborder" width="100%">';
|
||||||
$libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle);
|
print '<tr class="liste_titre">';
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id."\">".img_object($langs->trans("ShowAction"),"task").' '.$libelle.'</a></td>';
|
print '<td colspan="4">'.$langs->trans("ActionsToDo").'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$obj->idp.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->sname.'</a></td>';
|
$i = 0;
|
||||||
$i++;
|
while ($i < $num )
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$var=!$var;
|
||||||
|
|
||||||
|
print "<tr $bc[$var]><td>".dolibarr_print_date($obj->da)."</td>";
|
||||||
|
|
||||||
|
// Action
|
||||||
|
$transcode=$langs->trans("Action".$obj->code);
|
||||||
|
$libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle);
|
||||||
|
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id."\">".img_object($langs->trans("ShowAction"),"task").' '.$libelle.'</a></td>';
|
||||||
|
|
||||||
|
// Tiers
|
||||||
|
print '<td><a href="'.DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$obj->idp.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->sname.'</a></td>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
print "</table><br>";
|
||||||
}
|
}
|
||||||
print "</table><br>";
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
|
|||||||
@ -135,7 +135,7 @@ if ($resql)
|
|||||||
$urladd="page=$page";
|
$urladd="page=$page";
|
||||||
if (isset($stcomm)) $urladd.="&stcomm=".$stcomm;
|
if (isset($stcomm)) $urladd.="&stcomm=".$stcomm;
|
||||||
|
|
||||||
print_barre_liste($langs->trans("ListOfProspects"), $page, "prospects.php",'&stcomm='.$_GET["stcomm"],"","",'',$num);
|
print_barre_liste($langs->trans("ListOfProspects"), $page, $_SERVER["PHP_SELF"],'&stcomm='.$_GET["stcomm"],$sortfield,$sortorder,'',$num);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,8 @@ class Commande
|
|||||||
var $id ;
|
var $id ;
|
||||||
var $socidp;
|
var $socidp;
|
||||||
var $contactid;
|
var $contactid;
|
||||||
|
var $statut;
|
||||||
|
var $facturee;
|
||||||
var $brouillon;
|
var $brouillon;
|
||||||
var $cond_reglement_id;
|
var $cond_reglement_id;
|
||||||
var $cond_reglement_code;
|
var $cond_reglement_code;
|
||||||
@ -68,18 +70,6 @@ class Commande
|
|||||||
$langs->load('orders');
|
$langs->load('orders');
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
|
|
||||||
$this->statuts[-1] = $langs->trans('StatusOrderCanceled');
|
|
||||||
$this->statuts[0] = $langs->trans('StatusOrderDraft');
|
|
||||||
$this->statuts[1] = $langs->trans('StatusOrderValidated');
|
|
||||||
$this->statuts[2] = $langs->trans('StatusOrderOnProcess');
|
|
||||||
$this->statuts[3] = $langs->trans('StatusOrderProcessed');
|
|
||||||
|
|
||||||
$this->status_label_short[-1] = $langs->trans('StatusOrderCanceled');
|
|
||||||
$this->status_label_short[0] = $langs->trans('StatusOrderDraft');
|
|
||||||
$this->status_label_short[1] = $langs->trans('StatusOrderValidated');
|
|
||||||
$this->status_label_short[2] = $langs->trans('StatusOrderOnProcessShort');
|
|
||||||
$this->status_label_short[3] = $langs->trans('StatusOrderProcessed');
|
|
||||||
|
|
||||||
$this->sources[0] = $langs->trans('OrderSource0');
|
$this->sources[0] = $langs->trans('OrderSource0');
|
||||||
$this->sources[1] = $langs->trans('OrderSource1');
|
$this->sources[1] = $langs->trans('OrderSource1');
|
||||||
$this->sources[2] = $langs->trans('OrderSource2');
|
$this->sources[2] = $langs->trans('OrderSource2');
|
||||||
@ -1711,34 +1701,45 @@ class Commande
|
|||||||
*/
|
*/
|
||||||
function getLibStatut($mode)
|
function getLibStatut($mode)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->statut,$mode);
|
return $this->LibStatut($this->statut,$this->facture,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Renvoi le libellé d'un statut donné
|
* \brief Renvoi le libellé d'un statut donné
|
||||||
* \param statut Id statut
|
* \param statut Id statut
|
||||||
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto
|
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto
|
||||||
* \return string Libellé
|
* \return string Libellé
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut,$mode)
|
function LibStatut($statut,$facture,$mode)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
return $this->statuts[$statut];
|
if ($statut==-1) return $langs->trans('StatusOrderCanceled');
|
||||||
|
if ($statut==0) return $langs->trans('StatusOrderDraft');
|
||||||
|
if ($statut==1) return $langs->trans('StatusOrderValidated');
|
||||||
|
if ($statut==2) return $langs->trans('StatusOrderOnProcess');
|
||||||
|
if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBill');
|
||||||
|
if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessed');
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
if ($mode == 1)
|
||||||
{
|
{
|
||||||
return $this->status_label_short[$statut];
|
if ($statut==-1) return $langs->trans('StatusOrderCanceledShort');
|
||||||
|
if ($statut==0) return $langs->trans('StatusOrderDraftShort');
|
||||||
|
if ($statut==1) return $langs->trans('StatusOrderValidatedShort');
|
||||||
|
if ($statut==2) return $langs->trans('StatusOrderOnProcessShort');
|
||||||
|
if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBillShort');
|
||||||
|
if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessed');
|
||||||
}
|
}
|
||||||
if ($mode == 2)
|
if ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5').' '.$this->status_label_short[$statut];
|
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceledShort'),'statut5').' '.$langs->trans('StatusOrderCanceled');
|
||||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$this->status_label_short[$statut];
|
if ($statut==0) return img_picto($langs->trans('StatusOrderDraftShort'),'statut0').' '.$langs->trans('StatusOrderDraft');
|
||||||
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1').' '.$this->status_label_short[$statut];
|
if ($statut==1) return img_picto($langs->trans('StatusOrderValidatedShort'),'statut1').' '.$langs->trans('StatusOrderValidated');
|
||||||
if ($statut==2) return img_picto($langs->trans('StatusOrderOnProcess'),'statut3').' '.$this->status_label_short[$statut];
|
if ($statut==2) return img_picto($langs->trans('StatusOrderOnProcessShort'),'statut3').' '.$langs->trans('StatusOrderOnProcess');
|
||||||
if ($statut==3) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$this->status_label_short[$statut];
|
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBillShort'),'statut4').' '.$langs->trans('StatusOrderToBill');
|
||||||
|
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessedShort'),'statut6').' '.$langs->trans('StatusOrderProcessed');
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
if ($mode == 3)
|
||||||
{
|
{
|
||||||
@ -1746,23 +1747,26 @@ class Commande
|
|||||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0');
|
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0');
|
||||||
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1');
|
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1');
|
||||||
if ($statut==2) return img_picto($langs->trans('StatusOrderOnProcess'),'statut3');
|
if ($statut==2) return img_picto($langs->trans('StatusOrderOnProcess'),'statut3');
|
||||||
if ($statut==3) return img_picto($langs->trans('StatusOrderProcessed'),'statut6');
|
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut4');
|
||||||
|
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
if ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5').' '.$this->statuts[$statut];
|
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5').' '.$langs->trans('StatusOrderCanceled');
|
||||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$this->statuts[$statut];
|
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$langs->trans('StatusOrderDraft');
|
||||||
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1').' '.$this->statuts[$statut];
|
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1').' '.$langs->trans('StatusOrderValidated');
|
||||||
if ($statut==2) return img_picto($langs->trans('StatusOrderOnProcess'),'statut3').' '.$this->statuts[$statut];
|
if ($statut==2) return img_picto($langs->trans('StatusOrderOnProcess'),'statut3').' '.$langs->trans('StatusOrderOnProcess');
|
||||||
if ($statut==3) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$this->statuts[$statut];
|
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut4').' '.$langs->trans('StatusOrderToBill');
|
||||||
|
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessed');
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
if ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut==-1) return $this->status_label_short[$statut].' '.img_picto($langs->trans('StatusOrderCanceled'),'statut5');
|
if ($statut==-1) return $langs->trans('StatusOrderCanceledShort').' '.img_picto($langs->trans('StatusOrderCanceledShort'),'statut5');
|
||||||
if ($statut==0) return $this->status_label_short[$statut].' '.img_picto($langs->trans('StatusOrderDraft'),'statut0');
|
if ($statut==0) return $langs->trans('StatusOrderDraftShort').' '.img_picto($langs->trans('StatusOrderDraftShort'),'statut0');
|
||||||
if ($statut==1) return $this->status_label_short[$statut].' '.img_picto($langs->trans('StatusOrderValidated'),'statut1');
|
if ($statut==1) return $langs->trans('StatusOrderValidatedShort').' '.img_picto($langs->trans('StatusOrderValidatedShort'),'statut1');
|
||||||
if ($statut==2) return $this->status_label_short[$statut].' '.img_picto($langs->trans('StatusOrderOnProcess'),'statut3');
|
if ($statut==2) return $langs->trans('StatusOrderOnProcessShort').' '.img_picto($langs->trans('StatusOrderOnProcessShort'),'statut3');
|
||||||
if ($statut==3) return $this->status_label_short[$statut].' '.img_picto($langs->trans('StatusOrderProcessed'),'statut6');
|
if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBillShort').' '.img_picto($langs->trans('StatusOrderToBillShort'),'statut4');
|
||||||
|
if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessedShort').' '.img_picto($langs->trans('StatusOrderProcessedShort'),'statut6');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,9 @@ if ($user->societe_id > 0)
|
|||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.idp, c.rowid, c.ref, c.total_ht,".$db->pdate("c.date_commande")." as date_commande, c.fk_statut";
|
$sql = "SELECT s.nom, s.idp,";
|
||||||
|
$sql.= " c.rowid, c.ref, c.total_ht,".$db->pdate("c.date_commande")." as date_commande,";
|
||||||
|
$sql.= " c.fk_statut, c.facture";
|
||||||
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user";
|
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
||||||
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -143,7 +145,7 @@ if ($resql)
|
|||||||
print " <a href=\"liste.php?year=$y\">";
|
print " <a href=\"liste.php?year=$y\">";
|
||||||
print strftime("%Y",$objp->date_commande)."</a></td>\n";
|
print strftime("%Y",$objp->date_commande)."</a></td>\n";
|
||||||
|
|
||||||
print '<td align="right">'.$generic_commande->LibStatut($objp->fk_statut,5).'</td>';
|
print '<td align="right">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facture,5).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$total = $total + $objp->price;
|
$total = $total + $objp->price;
|
||||||
|
|||||||
@ -332,7 +332,7 @@ class MenuLeft {
|
|||||||
if ($conf->commande->enabled )
|
if ($conf->commande->enabled )
|
||||||
{
|
{
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$newmenu->add(DOL_URL_ROOT."/compta/commande/liste.php?leftmenu=orders&status=3", $langs->trans("MenuOrdersToBill"), 0, $user->rights->commande->lire);
|
if ($conf->facture->enabled) $newmenu->add(DOL_URL_ROOT."/compta/commande/liste.php?leftmenu=orders&status=3", $langs->trans("MenuOrdersToBill"), 0, $user->rights->commande->lire);
|
||||||
// if ($leftmenu=="orders") $newmenu->add_submenu(DOL_URL_ROOT."/commande/", $langs->trans("StatusOrderToBill"), 1 ,$user->rights->commande->lire);
|
// if ($leftmenu=="orders") $newmenu->add_submenu(DOL_URL_ROOT."/commande/", $langs->trans("StatusOrderToBill"), 1 ,$user->rights->commande->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -350,8 +350,8 @@ class MenuLeft {
|
|||||||
if ($conf->commande->enabled )
|
if ($conf->commande->enabled )
|
||||||
{
|
{
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$newmenu->add(DOL_URL_ROOT."/compta/commande/liste.php?leftmenu=orders&status=3", $langs->trans("MenuOrdersToBill"), 0, $user->rights->commande->lire);
|
if ($conf->facture->enabled) $newmenu->add(DOL_URL_ROOT."/compta/commande/liste.php?leftmenu=orders&status=3", $langs->trans("MenuOrdersToBill"), 0, $user->rights->commande->lire);
|
||||||
if ($leftmenu=="orders") $newmenu->add_submenu(DOL_URL_ROOT."/commande/", $langs->trans("StatusOrderToBill"), 1 ,$user->rights->commande->lire);
|
// if ($leftmenu=="orders") $newmenu->add_submenu(DOL_URL_ROOT."/commande/", $langs->trans("StatusOrderToBill"), 1 ,$user->rights->commande->lire);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -49,7 +49,11 @@ class MenuTop {
|
|||||||
*/
|
*/
|
||||||
function MenuTop($db)
|
function MenuTop($db)
|
||||||
{
|
{
|
||||||
|
global $langs;
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
|
|
||||||
|
$langs->setTransFromTab("Company",$langs->trans("ThirdParty"));
|
||||||
|
$langs->setTransFromTab("NewCompany",$langs->trans("NewThirdParty"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -121,7 +121,6 @@ ChangeIntoRepeatableInvoice=Change into repeatable
|
|||||||
CreateRepeatableInvoice=Create repeatable invoice
|
CreateRepeatableInvoice=Create repeatable invoice
|
||||||
ExportDataset_invoice_1=Customer invoices list and invoices' lines
|
ExportDataset_invoice_1=Customer invoices list and invoices' lines
|
||||||
ProformaBill=Proforma Bill:
|
ProformaBill=Proforma Bill:
|
||||||
VATIsUsed=Using VAT
|
|
||||||
CreditNote=Credit note
|
CreditNote=Credit note
|
||||||
CreditNotes=Credit notes
|
CreditNotes=Credit notes
|
||||||
NewGlobalDiscount=New discount
|
NewGlobalDiscount=New discount
|
||||||
|
|||||||
@ -10,6 +10,7 @@ MenuNewProspect=New prospect
|
|||||||
MenuNewSupplier=New supplier
|
MenuNewSupplier=New supplier
|
||||||
MenuSocGroup=Groups
|
MenuSocGroup=Groups
|
||||||
NewCompany=New company (prospect, customer, supplier)
|
NewCompany=New company (prospect, customer, supplier)
|
||||||
|
NewThirdParty=New third party (prospect, customer, supplier)
|
||||||
NewSocGroup=Nouveau companies group
|
NewSocGroup=Nouveau companies group
|
||||||
ProspectionArea=Prospection area
|
ProspectionArea=Prospection area
|
||||||
SocGroup=Group of companies
|
SocGroup=Group of companies
|
||||||
@ -17,6 +18,7 @@ IdCompany=Company Id
|
|||||||
Company=Company
|
Company=Company
|
||||||
CompanyName=Company name
|
CompanyName=Company name
|
||||||
Companies=Companies
|
Companies=Companies
|
||||||
|
ThirdParty=Third party
|
||||||
ParentCompany=Parent company
|
ParentCompany=Parent company
|
||||||
CivilityCode=Civility code
|
CivilityCode=Civility code
|
||||||
RegisteredOffice=Registered office
|
RegisteredOffice=Registered office
|
||||||
@ -36,6 +38,7 @@ Zip=Zip Code
|
|||||||
Town=Town
|
Town=Town
|
||||||
Web=Web
|
Web=Web
|
||||||
Birthday=Birthday
|
Birthday=Birthday
|
||||||
|
VATIsUsed=Using VAT
|
||||||
##### Professionnal ID #####
|
##### Professionnal ID #####
|
||||||
ProfId1=Professional ID 1
|
ProfId1=Professional ID 1
|
||||||
ProfId2=Professional ID 2
|
ProfId2=Professional ID 2
|
||||||
|
|||||||
@ -14,11 +14,16 @@ OrdersToValid=Orders to valid
|
|||||||
OrdersToBill=Orders to bill
|
OrdersToBill=Orders to bill
|
||||||
OrdersInProcess=Orders in process
|
OrdersInProcess=Orders in process
|
||||||
OrdersToProcess=Orders to process
|
OrdersToProcess=Orders to process
|
||||||
|
StatusOrderCanceledShort=Canceld
|
||||||
|
StatusOrderDraftShort=Draft
|
||||||
|
StatusOrderValidatedShort=Validated
|
||||||
|
StatusOrderOnProcessShort=On process
|
||||||
|
StatusOrderProcessedShort=Processed
|
||||||
|
StatusOrderToBillShort=To bill
|
||||||
StatusOrderCanceled=Canceld
|
StatusOrderCanceled=Canceld
|
||||||
StatusOrderDraft=Draft
|
StatusOrderDraft=Draft
|
||||||
StatusOrderValidated=Validated
|
StatusOrderValidated=Validated
|
||||||
StatusOrderOnProcess=On process
|
StatusOrderOnProcess=On process
|
||||||
StatusOrderOnProcessShort=On process
|
|
||||||
StatusOrderProcessed=Processed
|
StatusOrderProcessed=Processed
|
||||||
StatusOrderToBill=To bill
|
StatusOrderToBill=To bill
|
||||||
MenuOrdersToBill=Orders to bill
|
MenuOrdersToBill=Orders to bill
|
||||||
|
|||||||
@ -121,7 +121,6 @@ ChangeIntoRepeatableInvoice=Modifier en r
|
|||||||
CreateRepeatableInvoice=Créer facture récurrente
|
CreateRepeatableInvoice=Créer facture récurrente
|
||||||
ExportDataset_invoice_1=Factures clients et lignes de facture
|
ExportDataset_invoice_1=Factures clients et lignes de facture
|
||||||
ProformaBill=Facture Proforma :
|
ProformaBill=Facture Proforma :
|
||||||
VATIsUsed=Assujéti à TVA
|
|
||||||
CreditNote=Avoir
|
CreditNote=Avoir
|
||||||
CreditNotes=Avoirs
|
CreditNotes=Avoirs
|
||||||
NewGlobalDiscount=Nouvel avoir
|
NewGlobalDiscount=Nouvel avoir
|
||||||
|
|||||||
@ -10,6 +10,7 @@ MenuNewProspect=Nouveau prospect
|
|||||||
MenuNewSupplier=Nouveau fournisseur
|
MenuNewSupplier=Nouveau fournisseur
|
||||||
MenuSocGroup=Groupes
|
MenuSocGroup=Groupes
|
||||||
NewCompany=Nouvelle société (prospect, client, fournisseur)
|
NewCompany=Nouvelle société (prospect, client, fournisseur)
|
||||||
|
NewThirdParty=Nouveau tiers (prospect, client, fournisseur)
|
||||||
NewSocGroup=Nouveau groupement de sociétés
|
NewSocGroup=Nouveau groupement de sociétés
|
||||||
ProspectionArea=Espace prospection
|
ProspectionArea=Espace prospection
|
||||||
SocGroup=Groupement de sociétés
|
SocGroup=Groupement de sociétés
|
||||||
@ -17,6 +18,7 @@ IdCompany=Id soci
|
|||||||
Company=Société
|
Company=Société
|
||||||
CompanyName=Raison sociale
|
CompanyName=Raison sociale
|
||||||
Companies=Sociétés
|
Companies=Sociétés
|
||||||
|
ThirdParty=Tiers
|
||||||
ParentCompany=Maison mère
|
ParentCompany=Maison mère
|
||||||
CivilityCode=Code civilité
|
CivilityCode=Code civilité
|
||||||
RegisteredOffice=Siège sociale
|
RegisteredOffice=Siège sociale
|
||||||
@ -36,6 +38,7 @@ Zip=Code postal
|
|||||||
Town=Ville
|
Town=Ville
|
||||||
Web=Web
|
Web=Web
|
||||||
Birthday=Date de naissance
|
Birthday=Date de naissance
|
||||||
|
VATIsUsed=Assujéti à TVA
|
||||||
##### Professionnal ID #####
|
##### Professionnal ID #####
|
||||||
ProfId1=ID professionnel 1
|
ProfId1=ID professionnel 1
|
||||||
ProfId2=ID professionnel 2
|
ProfId2=ID professionnel 2
|
||||||
|
|||||||
@ -14,11 +14,16 @@ OrdersToValid=Commandes
|
|||||||
OrdersToBill=Commandes à facturer
|
OrdersToBill=Commandes à facturer
|
||||||
OrdersInProcess=Commandes en traitement
|
OrdersInProcess=Commandes en traitement
|
||||||
OrdersToProcess=Commandes à traiter
|
OrdersToProcess=Commandes à traiter
|
||||||
|
StatusOrderCanceledShort=Annulée
|
||||||
|
StatusOrderDraftShort=Brouillon
|
||||||
|
StatusOrderValidatedShort=Validée
|
||||||
|
StatusOrderOnProcessShort=En cours
|
||||||
|
StatusOrderProcessedShort=Traitée
|
||||||
|
StatusOrderToBillShort=À facturer
|
||||||
StatusOrderCanceled=Annulée
|
StatusOrderCanceled=Annulée
|
||||||
StatusOrderDraft=Brouillon
|
StatusOrderDraft=Brouillon
|
||||||
StatusOrderValidated=Validée
|
StatusOrderValidated=Validée
|
||||||
StatusOrderOnProcess=Traitement en cours
|
StatusOrderOnProcess=Traitement en cours
|
||||||
StatusOrderOnProcessShort=En cours
|
|
||||||
StatusOrderProcessed=Traitée
|
StatusOrderProcessed=Traitée
|
||||||
StatusOrderToBill=À facturer
|
StatusOrderToBill=À facturer
|
||||||
SearchOrder=Rechercher une commande
|
SearchOrder=Rechercher une commande
|
||||||
|
|||||||
@ -238,6 +238,7 @@ $conf->societe->enabled=defined("MAIN_MODULE_SOCIETE")?MAIN_MODULE_SOCIETE:0;
|
|||||||
$conf->societe->dir_output=DOL_DATA_ROOT."/societe";
|
$conf->societe->dir_output=DOL_DATA_ROOT."/societe";
|
||||||
$conf->societe->dir_images=DOL_DATA_ROOT."/societe/images";
|
$conf->societe->dir_images=DOL_DATA_ROOT."/societe/images";
|
||||||
$conf->societe->dir_logos=DOL_DATA_ROOT."/societe/logos";
|
$conf->societe->dir_logos=DOL_DATA_ROOT."/societe/logos";
|
||||||
|
$conf->societe->dir_avoir=DOL_DATA_ROOT."/societe/avoirs";
|
||||||
if (defined('SOCIETE_OUTPUTDIR') && SOCIETE_OUTPUTDIR) { $conf->societe->dir_output=SOCIETE_OUTPUTDIR; } # Pour passer outre le rep par defaut
|
if (defined('SOCIETE_OUTPUTDIR') && SOCIETE_OUTPUTDIR) { $conf->societe->dir_output=SOCIETE_OUTPUTDIR; } # Pour passer outre le rep par defaut
|
||||||
// Module commercial
|
// Module commercial
|
||||||
$conf->commercial->enabled=defined("MAIN_MODULE_COMMERCIAL")?MAIN_MODULE_COMMERCIAL:0;
|
$conf->commercial->enabled=defined("MAIN_MODULE_COMMERCIAL")?MAIN_MODULE_COMMERCIAL:0;
|
||||||
@ -343,10 +344,6 @@ $conf->actionscomm->dir_output=DOL_DATA_ROOT."/action";
|
|||||||
// Module export
|
// Module export
|
||||||
$conf->export->enabled=defined("MAIN_MODULE_EXPORT")?MAIN_MODULE_EXPORT:0;
|
$conf->export->enabled=defined("MAIN_MODULE_EXPORT")?MAIN_MODULE_EXPORT:0;
|
||||||
$conf->export->dir_ouput=DOL_DATA_ROOT."/export";
|
$conf->export->dir_ouput=DOL_DATA_ROOT."/export";
|
||||||
// Module avoir client
|
|
||||||
$conf->avoir->enabled=defined("MAIN_MODULE_AVOIR")?MAIN_MODULE_AVOIR:0;
|
|
||||||
$conf->avoir->dir_output=DOL_DATA_ROOT."/avoir";
|
|
||||||
$conf->avoir->dir_images=DOL_DATA_ROOT."/avoir/images";
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -36,8 +36,8 @@ class Translate {
|
|||||||
var $dir;
|
var $dir;
|
||||||
var $defaultlang;
|
var $defaultlang;
|
||||||
|
|
||||||
var $tab_loaded=array();
|
var $tab_loaded=array(); // Tableau pour signaler les fichiers deja chargés
|
||||||
var $tab_translate=array();
|
var $tab_translate=array(); // Tableau des traductions
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,6 +50,35 @@ class Translate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Renvoie la chaine traduite pour une clé donnée.
|
||||||
|
* Le tableau des traductions doit avoir été chargé.
|
||||||
|
* \param key Clé de traduction
|
||||||
|
* \return string Chaine de traduction
|
||||||
|
*/
|
||||||
|
function getTransFromTab($key)
|
||||||
|
{
|
||||||
|
if (isset($this->tab_translate[$key]) && $this->tab_translate[$key])
|
||||||
|
{
|
||||||
|
return $this->tab_translate[$key];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Positionne la chaine traduite pour une clé donnée.
|
||||||
|
* \param key Clé de traduction
|
||||||
|
* \param value Chaine de traduction
|
||||||
|
*/
|
||||||
|
function setTransFromTab($key,$value)
|
||||||
|
{
|
||||||
|
$this->tab_translate[$key]=$value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Accesseur de this->defaultlang
|
* \brief Accesseur de this->defaultlang
|
||||||
* \param defaultlang Langue par defaut à utiliser
|
* \param defaultlang Langue par defaut à utiliser
|
||||||
@ -141,7 +170,7 @@ class Translate {
|
|||||||
{
|
{
|
||||||
$tab=split('=',$ligne,2);
|
$tab=split('=',$ligne,2);
|
||||||
//print "Domain=$domain, found a string for $tab[0] with value $tab[1]<br>";
|
//print "Domain=$domain, found a string for $tab[0] with value $tab[1]<br>";
|
||||||
if (! isset($this->tab_translate[$tab[0]])) $this->tab_translate[$tab[0]]=trim(isset($tab[1])?$tab[1]:'');
|
if (! $this->getTransFromTab($tab[0])) $this->setTransFromTab($tab[0],trim(isset($tab[1])?$tab[1]:''));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
@ -173,6 +202,7 @@ class Translate {
|
|||||||
* \brief Retourne la version traduite du texte passé en paramètre
|
* \brief Retourne la version traduite du texte passé en paramètre
|
||||||
* Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif
|
* Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif
|
||||||
* et si toujours pas trouvé, il est retourné tel quel
|
* et si toujours pas trouvé, il est retourné tel quel
|
||||||
|
* Les paramètres de cette méthode peuvent contenir de balises HTML.
|
||||||
* \param str chaine a traduire
|
* \param str chaine a traduire
|
||||||
* \param param1 chaine de param1
|
* \param param1 chaine de param1
|
||||||
* \param param2 chaine de param1
|
* \param param2 chaine de param1
|
||||||
@ -188,21 +218,22 @@ class Translate {
|
|||||||
/**
|
/**
|
||||||
* \brief Retourne la version traduite du texte passé en paramètre
|
* \brief Retourne la version traduite du texte passé en paramètre
|
||||||
* Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif
|
* Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif
|
||||||
* et si toujours pas trouvé, il est retourné tel quel
|
* et si toujours pas trouvé, il est retourné tel quel.
|
||||||
* \param str chaine a traduire
|
* Les paramètres de cette méthode ne doivent pas contenir de balises HTML.
|
||||||
|
* \param key clé de chaine a traduire
|
||||||
* \param param1 chaine de param1
|
* \param param1 chaine de param1
|
||||||
* \param param2 chaine de param1
|
* \param param2 chaine de param1
|
||||||
* \param param3 chaine de param1
|
* \param param3 chaine de param1
|
||||||
* \return string chaine traduite
|
* \return string chaine traduite
|
||||||
*/
|
*/
|
||||||
function transnoentities($str, $param1='', $param2='', $param3='')
|
function transnoentities($key, $param1='', $param2='', $param3='')
|
||||||
{
|
{
|
||||||
if (isset($this->tab_translate[$str]) && $this->tab_translate[$str])
|
if ($this->getTransFromTab($key))
|
||||||
{
|
{
|
||||||
// Si la traduction est disponible
|
// Si la traduction est disponible
|
||||||
return sprintf($this->tab_translate[$str],$param1,$param2,$param3);
|
return sprintf($this->tab_translate[$key],$param1,$param2,$param3);
|
||||||
}
|
}
|
||||||
return $str;
|
return $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user