Fix: Trad on label

This commit is contained in:
Laurent Destailleur 2010-07-14 20:47:35 +00:00
parent 5556ed5faf
commit 453c29901b
6 changed files with 39 additions and 16 deletions

View File

@ -165,7 +165,8 @@ if ($socid > 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="30%">'.$langs->trans("Name").'</td><td width="70%" colspan="3">'; print '<tr><td width="30%">'.$langs->trans("Name").'</td><td width="70%" colspan="3">';
print $objsoc->nom; $objsoc->next_prev_filter="te.client in (1,3)";
print $form->showrefnav($objsoc,'socid','',($user->societe_id?0:1),'rowid','nom','','');
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$objsoc->prefix_comm.'</td></tr>'; print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$objsoc->prefix_comm.'</td></tr>';

View File

@ -99,7 +99,11 @@ if ($socid > 0)
print '<tr><td valign="top" width="50%" class="notopnoleft">'; print '<tr><td valign="top" width="50%" class="notopnoleft">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="25%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">';
$societe->next_prev_filter="te.client in (2,3)";
print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom','','');
print '</td></tr>';
print '<tr><td valign="top">'.$langs->trans("Address").'</td><td colspan="3">'.nl2br($societe->address)."</td></tr>"; print '<tr><td valign="top">'.$langs->trans("Address").'</td><td colspan="3">'.nl2br($societe->address)."</td></tr>";
// Zip / Town // Zip / Town

View File

@ -135,7 +135,10 @@ if ($socid > 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="100">'.$langs->trans("Name").'</td><td colspan="3">'.$societe->nom.'</td></tr>'; print '<tr><td width="100">'.$langs->trans("Name").'</td><td colspan="3">';
$societe->next_prev_filter="te.client in (1,3)";
print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom','','');
print '</td></tr>';
// Prefix // Prefix
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';

View File

@ -2959,16 +2959,17 @@ class Form
} }
/** /**
* \brief Affiche tableau avec ref et bouton navigation pour un objet metier * \brief Return a HTML area with the reference of object and a naviagation bar for a business object
* \param object Object to show * \param object Object to show
* \param paramid Nom du parametre a utiliser pour nommer id dans liens URL * \param paramid Name of parameter to use to name the id into the URL link
* \param morehtml Code html supplementaire a afficher avant barre nav * \param morehtml More html content to output just before the nav bar
* \param shownav Show Condition (navigation is show if value is 1) * \param shownav Show Condition (navigation is shown if value is 1)
* \param fieldid Nom du champ en base a utiliser pour select next et previous * \param fieldid Nom du champ en base a utiliser pour select next et previous
* \param fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous * \param fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous
* \param morehtmlref Code html supplementaire a afficher apres ref * \param morehtmlref Code html supplementaire a afficher apres ref
* \param moreparam More param to ad in nav link url. * \param moreparam More param to add in nav link url.
* \return string Portion HTML avec ref + boutons nav * \return string Portion HTML avec ref + boutons nav
* \remarks To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria.
*/ */
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='') function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='')
{ {

View File

@ -71,7 +71,10 @@ if ( $societe->fetch($socid) )
print '<tr><td valign="top" width="50%" class="notopnoleft">'; print '<tr><td valign="top" width="50%" class="notopnoleft">';
print '<table width="100%" class="border">'; print '<table width="100%" class="border">';
print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">';
$societe->next_prev_filter="te.fournisseur = 1";
print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom','','');
print '</td></tr>';
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$societe->prefix_comm.'</td></tr>'; print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$societe->prefix_comm.'</td></tr>';

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 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
@ -30,6 +30,8 @@ require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
$langs->load("companies"); $langs->load("companies");
$langs->load("mails"); $langs->load("mails");
$langs->load("admin");
$langs->load("other");
// Security check // Security check
$socid = isset($_GET["socid"])?$_GET["socid"]:''; $socid = isset($_GET["socid"])?$_GET["socid"]:'';
@ -137,7 +139,6 @@ if ( $soc->fetch($soc->id) )
// Help // Help
$langs->load("admin");
print $langs->trans("NotificationsDesc").'<br><br>'; print $langs->trans("NotificationsDesc").'<br><br>';
@ -220,7 +221,7 @@ if ( $soc->fetch($soc->id) )
print '</tr>'; print '</tr>';
// Liste // Liste
$sql = "SELECT c.rowid as id, c.name, c.firstname, c.email, a.titre, n.rowid"; $sql = "SELECT c.rowid as id, c.name, c.firstname, c.email, a.code, a.titre, n.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify_def as n"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify_def as n";
$sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action AND n.fk_soc = ".$soc->id; $sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action AND n.fk_soc = ".$soc->id;
@ -244,7 +245,10 @@ if ( $soc->fetch($soc->id) )
print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1); print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1);
print $obj->email?' &lt;'.$obj->email.'&gt;':$langs->trans("NoMail"); print $obj->email?' &lt;'.$obj->email.'&gt;':$langs->trans("NoMail");
print '</td>'; print '</td>';
print '<td>'.$obj->titre.'</td>'; print '<td>';
$libelle=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->titre);
print $libelle;
print '</td>';
print '<td align="right"><a href="fiche.php?socid='.$socid.'&action=delete&actid='.$obj->rowid.'">'.img_delete().'</a></td>'; print '<td align="right"><a href="fiche.php?socid='.$socid.'&action=delete&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
print '</tr>'; print '</tr>';
$i++; $i++;
@ -273,7 +277,9 @@ if ( $soc->fetch($soc->id) )
print '</tr>'; print '</tr>';
// Liste // Liste
$sql = "SELECT c.rowid as id, c.name, c.firstname, c.email, a.titre, n.rowid, n.daten, n.email"; $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type, n.objet_id,";
$sql.= " c.rowid as id, c.name, c.firstname, c.email,";
$sql.= " a.code, a.titre";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify as n"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify as n";
$sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action"; $sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action";
@ -297,8 +303,13 @@ if ( $soc->fetch($soc->id) )
print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1); print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1);
print $obj->email?' &lt;'.$obj->email.'&gt;':$langs->trans("NoMail"); print $obj->email?' &lt;'.$obj->email.'&gt;':$langs->trans("NoMail");
print '</td>'; print '</td>';
print '<td>'.$obj->titre.'</td>'; print '<td>';
print'<td align="right">'.dol_print_date($db->jdate($obj->daten)).'</td>'; $libelle=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->titre);
print $libelle;
print '</td>';
// TODO Add link to object here
// print
print'<td align="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
print '</tr>'; print '</tr>';
$i++; $i++;
} }