New: Add statistics on contract area

Minor look enhancements
This commit is contained in:
Laurent Destailleur 2009-07-08 10:10:35 +00:00
parent 69dba45590
commit 814b1acd43
14 changed files with 618 additions and 455 deletions

View File

@ -1,6 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 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
@ -15,16 +15,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/comm/remise.php * \file htdocs/comm/remise.php
\ingroup commercial * \ingroup societe
\brief Onglet remise de la societe * \brief Onglet remise de la societe
\version $Revision$ * \version $Id$
*/ */
require_once("./pre.inc.php"); require_once("./pre.inc.php");
@ -35,6 +32,13 @@ $langs->load("companies");
$langs->load("orders"); $langs->load("orders");
$langs->load("bills"); $langs->load("bills");
$_socid = $_GET["id"];
// Security check
if ($user->societe_id > 0)
{
$_socid = $user->societe_id;
}
if ($_POST["action"] == 'setremise') if ($_POST["action"] == 'setremise')
{ {
@ -54,17 +58,14 @@ if ($_POST["action"] == 'setremise')
} }
/*
* View
*/
$form=new Form($db);
llxHeader(); llxHeader();
$_socid = $_GET["id"];
// Sécurité si un client essaye d'accéder à une autre fiche que la sienne
if ($user->societe_id > 0)
{
$_socid = $user->societe_id;
}
/********************************************************************************* /*********************************************************************************
* *
@ -88,7 +89,7 @@ if ($_socid > 0)
*/ */
$head = societe_prepare_head($objsoc); $head = societe_prepare_head($objsoc);
dol_fiche_head($head, 'relativediscount', $objsoc->nom); dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"));
/* /*
@ -102,6 +103,12 @@ if ($_socid > 0)
print '<tr><td valign="top">'; print '<tr><td valign="top">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Name
print '<tr><td colspan="2" width="25%">'.$langs->trans('Name').'</td>';
print '<td colspan="2">';
print $form->showrefnav($objsoc,'id','',1,'rowid','nom');
print '</td></tr>';
// Remise // Remise
print '<tr><td colspan="2" width="25%">'; print '<tr><td colspan="2" width="25%">';
print $langs->trans("CustomerRelativeDiscount").'</td><td colspan="2">'.$objsoc->remise_client."%</td></tr>"; print $langs->trans("CustomerRelativeDiscount").'</td><td colspan="2">'.$objsoc->remise_client."%</td></tr>";

View File

@ -20,7 +20,7 @@
/** /**
* \file htdocs/comm/remx.php * \file htdocs/comm/remx.php
* \ingroup commercial, invoice * \ingroup societe
* \brief Page to edit absolute discounts for a customer * \brief Page to edit absolute discounts for a customer
* \version $Id$ * \version $Id$
*/ */

View File

@ -61,7 +61,7 @@ print '<table width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%" class="notopnoleft">'; print '<tr><td valign="top" width="30%" class="notopnoleft">';
/* /*
* Zone recherche * Search form
*/ */
$var=false; $var=false;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -69,7 +69,7 @@ print '<form method="post" action="liste.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>'; print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>';
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sf_ref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>'; print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print '<tr '.$bc[$var].'><td nowrap>'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>'; print '<tr '.$bc[$var].'><td nowrap>'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
print '</tr>'; print '</tr>';
print "</form></table><br>\n"; print "</form></table><br>\n";
@ -116,69 +116,6 @@ if ($conf->commande->enabled)
} }
} }
/*
* Orders to process
*/
if ($conf->commande->enabled)
{
$sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid";
$sql.=" FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE c.fk_soc = s.rowid";
$sql.= " AND c.entity = ".$conf->entity;
$sql.= " AND c.fk_statut = 1";
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " ORDER BY c.rowid DESC";
if ( $db->query($sql) )
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("OrdersToProcess").'</td></tr>';
$num = $db->num_rows();
if ($num)
{
$i = 0;
$var = True;
while ($i < $num)
{
$var=!$var;
$obj = $db->fetch_object();
print "<tr $bc[$var]>";
print '<td nowrap="nowrap">';
$commandestatic->id=$obj->rowid;
$commandestatic->ref=$obj->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="90" class="nobordernopadding" nowrap="nowrap">';
print $commandestatic->getNomUrl(1);
print '</td>';
print '<td width="16" class="nobordernopadding" nowrap="nowrap">';
print '&nbsp;';
print '</td>';
print '<td width="16" align="right" class="nobordernopadding">';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
print '</td></tr></table>';
print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
$i++;
}
}
print "</table><br>";
}
}
print '</td><td valign="top" width="70%" class="notopnoleftnoright">'; print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
@ -253,7 +190,76 @@ if ($resql)
/* /*
* Commandes en cours * Orders to process
*/
if ($conf->commande->enabled)
{
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid";
$sql.=" FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE c.fk_soc = s.rowid";
$sql.= " AND c.entity = ".$conf->entity;
$sql.= " AND c.fk_statut = 1";
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " ORDER BY c.rowid DESC";
if ( $db->query($sql) )
{
$num = $db->num_rows();
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?viewstatut=1">('.$num.')</a></td></tr>';
if ($num)
{
$i = 0;
$var = True;
while ($i < $num)
{
$var=!$var;
$obj = $db->fetch_object();
print "<tr $bc[$var]>";
print '<td nowrap="nowrap">';
$commandestatic->id=$obj->rowid;
$commandestatic->ref=$obj->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="90" class="nobordernopadding" nowrap="nowrap">';
print $commandestatic->getNomUrl(1);
print '</td>';
print '<td width="16" class="nobordernopadding" nowrap="nowrap">';
print '&nbsp;';
print '</td>';
print '<td width="16" align="right" class="nobordernopadding">';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
print '</td></tr></table>';
print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
print '</tr>';
$i++;
}
}
print "</table><br>";
}
}
/*
* Commandes en cours d'expedition
*/ */
if ($conf->commande->enabled) if ($conf->commande->enabled)
{ {
@ -274,7 +280,7 @@ if ($conf->commande->enabled)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commandes/liste.php?viewstatut=2">('.$num.')</a></td></tr>'; print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?viewstatut=2">('.$num.')</a></td></tr>';
if ($num) if ($num)
{ {
@ -309,7 +315,9 @@ if ($conf->commande->enabled)
print '</td>'; print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>'; print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
print '</tr>'; print '</tr>';
$i++; $i++;
} }

View File

@ -113,10 +113,6 @@ if ($_GET['year'] > 0)
{ {
$sql.= " AND date_format(c.date_commande, '%Y') = $year"; $sql.= " AND date_format(c.date_commande, '%Y') = $year";
} }
if (strlen($_POST['sf_ref']) > 0)
{
$sql.= " AND c.ref like '%".addslashes($_POST['sf_ref']) . "%'";
}
if (!empty($snom)) if (!empty($snom))
{ {
$sql.= ' AND s.nom like \'%'.addslashes($snom).'%\''; $sql.= ' AND s.nom like \'%'.addslashes($snom).'%\'';

View File

@ -210,22 +210,29 @@ class Contrat extends CommonObject
} }
} }
if ($this->statut == 0)
{
$result=$this->validate($user,$langs,$conf);
if ($result < 0) $ok=false;
}
if ($ok) if ($ok)
{ {
$this->db->commit(); $this->db->commit();
} }
else else
{ {
dol_print_error($db,'Failed to update contrat_det'); dol_print_error($db,'Error in cloture function');
$this->db->rollback(); $this->db->rollback();
} }
} }
/** /**
* \brief Valide un contrat * \brief Validate a contract
* \param user Objet User qui valide * \param user Objet User
* \param langs Environnement langue de l'utilisateur * \param langs Environnement langue de l'utilisateur
* \param conf Environnement de configuration lors de l'op<EFBFBD>ration * \param conf Environnement de configuration lors de l'operation
* \return int <0 if KO, >0 if OK
*/ */
function validate($user,$langs,$conf) function validate($user,$langs,$conf)
{ {
@ -1072,8 +1079,8 @@ class Contrat extends CommonObject
$text.=' '.$langs->trans("Services"); $text.=' '.$langs->trans("Services");
$text.=': &nbsp; &nbsp; '; $text.=': &nbsp; &nbsp; ';
$text.=$this->nbofserviceswait.' '.$line->LibStatut(0,3).' &nbsp; '; $text.=$this->nbofserviceswait.' '.$line->LibStatut(0,3).' &nbsp; ';
$text.=$this->nbofservicesopened.' '.$line->LibStatut(4,3,false).' &nbsp; '; $text.=$this->nbofservicesopened.' '.$line->LibStatut(4,3,0).' &nbsp; ';
$text.=$this->nbofservicesexpired.' '.$line->LibStatut(4,3,true).' &nbsp; '; $text.=$this->nbofservicesexpired.' '.$line->LibStatut(4,3,1).' &nbsp; ';
$text.=$this->nbofservicesclosed.' '.$line->LibStatut(5,3); $text.=$this->nbofservicesclosed.' '.$line->LibStatut(5,3);
return $text; return $text;
} }
@ -1417,60 +1424,66 @@ class ContratLigne
*/ */
function getLibStatut($mode) function getLibStatut($mode)
{ {
return $this->LibStatut($this->statut,$mode,(isset($this->date_fin_validite) && $this->date_fin_validite < gmmktime())); return $this->LibStatut($this->statut,$mode,(isset($this->date_fin_validite)?($this->date_fin_validite < dol_now('tzref')?1:0):-1));
} }
/** /**
* \brief Return label of a contract line status * \brief Return label of a contract line status
* \param statut id statut * \param statut id statut
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* \param expired true=Expired * \param expired 0=Not expired, 1=Expired, -1=Both or unknown
* \return string Libelle * \return string Libelle
*/ */
function LibStatut($statut,$mode,$expired=false) function LibStatut($statut,$mode,$expired=-1)
{ {
global $langs; global $langs;
$langs->load("contracts"); $langs->load("contracts");
if ($mode == 0) if ($mode == 0)
{ {
if ($statut == 0) { return $langs->trans("ServiceStatusInitial"); } if ($statut == 0) { return $langs->trans("ServiceStatusInitial"); }
if ($statut == 4 && ! $expired) { return $langs->trans("ServiceStatusRunning"); } if ($statut == 4 && $expired == -1) { return $langs->trans("ServiceStatusRunning"); }
if ($statut == 4 && $expired) { return $langs->trans("ServiceStatusLate"); } if ($statut == 4 && $expired == 0) { return $langs->trans("ServiceStatusNotLate"); }
if ($statut == 4 && $expired == 1) { return $langs->trans("ServiceStatusLate"); }
if ($statut == 5) { return $langs->trans("ServiceStatusClosed"); } if ($statut == 5) { return $langs->trans("ServiceStatusClosed"); }
} }
if ($mode == 1) if ($mode == 1)
{ {
if ($statut == 0) { return $langs->trans("ServiceStatusInitial"); } if ($statut == 0) { return $langs->trans("ServiceStatusInitial"); }
if ($statut == 4 && ! $expired) { return $langs->trans("ServiceStatusRunning"); } if ($statut == 4 && $expired == -1) { return $langs->trans("ServiceStatusRunning"); }
if ($statut == 4 && $expired) { return $langs->trans("ServiceStatusLateShort"); } if ($statut == 4 && $expired == 0) { return $langs->trans("ServiceStatusNotLateShort"); }
if ($statut == 4 && $expired == 1) { return $langs->trans("ServiceStatusLateShort"); }
if ($statut == 5) { return $langs->trans("ServiceStatusClosed"); } if ($statut == 5) { return $langs->trans("ServiceStatusClosed"); }
} }
if ($mode == 2) if ($mode == 2)
{ {
if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); } if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); }
if ($statut == 4 && ! $expired) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); } if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
if ($statut == 4 && $expired) { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLateShort"); } if ($statut == 4 && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4').' '.$langs->trans("ServiceStatusNotLateShort"); }
if ($statut == 4 && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLateShort"); }
if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); } if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
} }
if ($mode == 3) if ($mode == 3)
{ {
if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0'); } if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0'); }
if ($statut == 4 && ! $expired) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4'); } if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4'); }
if ($statut == 4 && $expired) { return img_picto($langs->trans('ServiceStatusLate'),'statut3'); } if ($statut == 4 && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4'); }
if ($statut == 4 && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3'); }
if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6'); } if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6'); }
} }
if ($mode == 4) if ($mode == 4)
{ {
if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); } if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); }
if ($statut == 4 && ! $expired) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); } if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
if ($statut == 4 && $expired) { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLate"); } if ($statut == 4 && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4').' '.$langs->trans("ServiceStatusNotLate"); }
if ($statut == 4 && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLate"); }
if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); } if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
} }
if ($mode == 5) if ($mode == 5)
{ {
if ($statut == 0) { return $langs->trans("ServiceStatusInitial").' '.img_picto($langs->trans('ServiceStatusInitial'),'statut0'); } if ($statut == 0) { return $langs->trans("ServiceStatusInitial").' '.img_picto($langs->trans('ServiceStatusInitial'),'statut0'); }
if ($statut == 4 && ! $expired) { return $langs->trans("ServiceStatusRunning").' '.img_picto($langs->trans('ServiceStatusRunning'),'statut4'); } if ($statut == 4 && $expired == -1) { return $langs->trans("ServiceStatusRunning").' '.img_picto($langs->trans('ServiceStatusRunning'),'statut4'); }
if ($statut == 4 && $expired) { return $langs->trans("ServiceStatusLateShort").' '.img_picto($langs->trans('ServiceStatusLate'),'statut3'); } if ($statut == 4 && $expired == 0) { return $langs->trans("ServiceStatusNotLateShort").' '.img_picto($langs->trans('ServiceStatusNotLateShort'),'statut4'); }
if ($statut == 4 && $expired == 1) { return $langs->trans("ServiceStatusLateShort").' '.img_picto($langs->trans('ServiceStatusLate'),'statut3'); }
if ($statut == 5) { return $langs->trans("ServiceStatusClosed").' '.img_picto($langs->trans('ServiceStatusClosed'),'statut6'); } if ($statut == 5) { return $langs->trans("ServiceStatusClosed").' '.img_picto($langs->trans('ServiceStatusClosed'),'statut6'); }
} }
} }

View File

@ -367,6 +367,7 @@ if ($_REQUEST["action"] == 'confirm_valid' && $_REQUEST["confirm"] == 'yes' && $
$result = $contrat->validate($user,$langs,$conf); $result = $contrat->validate($user,$langs,$conf);
} }
// Close all lines
if ($_REQUEST["action"] == 'confirm_close' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->creer) if ($_REQUEST["action"] == 'confirm_close' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->creer)
{ {
$contrat = new Contrat($db); $contrat = new Contrat($db);
@ -751,7 +752,7 @@ else
echo '<br>'; echo '<br>';
$servicepos=(isset($_REQUEST["servicepos"])?$_REQUEST["servicepos"]:1); $servicepos=(isset($_REQUEST["servicepos"])?$_REQUEST["servicepos"]:1);
$colorb='333333'; $colorb='666666';
$arrayothercontracts=$contrat->getListOfContracts('others'); $arrayothercontracts=$contrat->getListOfContracts('others');
@ -760,7 +761,7 @@ else
*/ */
// Title line for service // Title line for service
print '<table class="noborder" width="100%">'; // Array with (n*2)+1 lines print '<table class="notopnoleft" width="100%">'; // Array with (n*2)+1 lines
$cursorline=1; $cursorline=1;
while ($cursorline <= $nbofservices) while ($cursorline <= $nbofservices)
{ {
@ -771,7 +772,7 @@ else
print '<td class="tab" style="border-right: 1px solid #'.$colorb.'; border-top: 1px solid #'.$colorb.'; border-bottom: 1px solid #'.$colorb.';" rowspan="2">'; print '<td class="tab" style="border-right: 1px solid #'.$colorb.'; border-top: 1px solid #'.$colorb.'; border-bottom: 1px solid #'.$colorb.';" rowspan="2">';
// Area with common detail of line // Area with common detail of line
print '<table class="noborder" width="100%">'; print '<table class="notopnoleft" width="100%">';
$sql = "SELECT cd.rowid, cd.statut, cd.label as label_det, cd.fk_product, cd.description, cd.price_ht, cd.qty,"; $sql = "SELECT cd.rowid, cd.statut, cd.label as label_det, cd.fk_product, cd.description, cd.price_ht, cd.qty,";
$sql.= " cd.tva_tx, cd.remise_percent, cd.info_bits, cd.subprice,"; $sql.= " cd.tva_tx, cd.remise_percent, cd.info_bits, cd.subprice,";
@ -959,7 +960,7 @@ else
if ($_REQUEST["action"] == 'deleteline' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $contrat->lignes[$cursorline-1]->id == $_GET["rowid"]) if ($_REQUEST["action"] == 'deleteline' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $contrat->lignes[$cursorline-1]->id == $_GET["rowid"])
{ {
$ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&lineid=".$_GET["rowid"],$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&lineid=".$_GET["rowid"],$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1);
if ($ret == 'html') print '<table class="noborder" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>'; if ($ret == 'html') print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
} }
/* /*
@ -980,7 +981,7 @@ else
array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid)); array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid));
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&lineid=".$_GET["rowid"],$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion); $html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&lineid=".$_GET["rowid"],$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion);
print '<table class="noborder" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>'; print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
} }
/* /*
@ -993,7 +994,7 @@ else
$dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]); $dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
$comment = $_POST["comment"]; $comment = $_POST["comment"];
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1); $html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1);
print '<table class="noborder" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>'; print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
} }
/* /*
@ -1006,14 +1007,14 @@ else
$dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]); $dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
$comment = $_POST["comment"]; $comment = $_POST["comment"];
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1); $html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1);
print '<table class="noborder" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>'; print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
} }
// Area with status and activation info of line // Area with status and activation info of line
if ($contrat->statut > 0) if ($contrat->statut > 0)
{ {
print '<table class="noborder" width="100%">'; print '<table class="notopnoleft" width="100%">';
print '<tr '.$bc[false].'>'; print '<tr '.$bc[false].'>';
print '<td>'.$langs->trans("ServiceStatus").': '.$contrat->lignes[$cursorline-1]->getLibStatut(4).'</td>'; print '<td>'.$langs->trans("ServiceStatus").': '.$contrat->lignes[$cursorline-1]->getLibStatut(4).'</td>';

View File

@ -63,19 +63,6 @@ print '<table class="notopnoleftnoright" width="100%">';
print '<tr><td width="30%" valign="top" class="notopnoleft">'; print '<tr><td width="30%" valign="top" class="notopnoleft">';
// Legend
$var=false;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("ServicesLegend").'</td></tr>';
print '<tr '.$bc[$var].'><td nowrap>';
print $staticcontratligne->LibStatut(0,4).'<br />';
print $staticcontratligne->LibStatut(4,4,false).'<br />';
print $staticcontratligne->LibStatut(4,4,true).'<br />';
print $staticcontratligne->LibStatut(5,4).'<br />';
print '</td></tr>';
print '</table>';
print "<br>";
// Search contract // Search contract
if ($conf->contrat->enabled) if ($conf->contrat->enabled)
{ {
@ -93,6 +80,86 @@ if ($conf->contrat->enabled)
print "<br>"; print "<br>";
} }
/*
* Legends / Status
*/
$nb=array();
// Search by status (except expired)
$sql = "SELECT count(cd.rowid), cd.statut";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid";
$sql.= " AND (cd.statut != 4 OR (cd.statut = 4 AND (cd.date_fin_validite is null or cd.date_fin_validite >= ".$db->idate(dol_now('tzref')).')))';
$sql.= " AND s.entity = ".$conf->entity;
if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " GROUP BY cd.statut";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$row = $db->fetch_row($resql);
$nb[$row[1]]=$row[0];
$i++;
}
$db->free($resql);
}
else
{
dol_print_error($db);
}
// Search by status (only expired)
$sql = "SELECT count(cd.rowid), cd.statut";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid";
$sql.= " AND (cd.statut = 4 AND cd.date_fin_validite < ".$db->idate(dol_now('tzref')).')';
$sql.= " AND s.entity = ".$conf->entity;
if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " GROUP BY cd.statut";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$row = $db->fetch_row($resql);
$nb[$row[1].true]=$row[0];
$i++;
}
$db->free($resql);
}
else
{
dol_print_error($db);
}
print '<table class="liste" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Status").'</td>';
print '<td align="right">'.$langs->trans("Nb").'</td>';
print "</tr>\n";
$var=true;
$listofstatus=array(0,4,4,5); $bool=false;
foreach($listofstatus as $status)
{
$var=!$var;
print "<tr $bc[$var]>";
print '<td>'.$staticcontratligne->LibStatut($status,0,($bool?1:0)).'</td>';
print '<td align="right"><a href="services.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).'</a></td>';
if ($status==4 && $bool==false) $bool=true;
else $bool=false;
}
print "</tr>\n";
print "</table><br>";
/** /**
* Draft contratcs * Draft contratcs
*/ */
@ -218,8 +285,8 @@ if ($result)
print '<td align="center">'.dol_print_date($obj->tms,'dayhour').'</td>'; print '<td align="center">'.dol_print_date($obj->tms,'dayhour').'</td>';
//print '<td align="left">'.$staticcontrat->LibStatut($obj->statut,2).'</td>'; //print '<td align="left">'.$staticcontrat->LibStatut($obj->statut,2).'</td>';
print '<td align="right" width="32">'.($obj->nb_initial>0 ? $obj->nb_initial.$staticcontratligne->LibStatut(0,3):'').'</td>'; print '<td align="right" width="32">'.($obj->nb_initial>0 ? $obj->nb_initial.$staticcontratligne->LibStatut(0,3):'').'</td>';
print '<td align="right" width="32">'.($obj->nb_running>0 ? $obj->nb_running.$staticcontratligne->LibStatut(4,3,false):'').'</td>'; print '<td align="right" width="32">'.($obj->nb_running>0 ? $obj->nb_running.$staticcontratligne->LibStatut(4,3,0):'').'</td>';
print '<td align="right" width="32">'.($obj->nb_expired>0 ? $obj->nb_expired.$staticcontratligne->LibStatut(4,3,true):'').'</td>'; print '<td align="right" width="32">'.($obj->nb_expired>0 ? $obj->nb_expired.$staticcontratligne->LibStatut(4,3,1):'').'</td>';
print '<td align="right" width="32">'.($obj->nb_closed>0 ? $obj->nb_closed.$staticcontratligne->LibStatut(5,3):'').'</td>'; print '<td align="right" width="32">'.($obj->nb_closed>0 ? $obj->nb_closed.$staticcontratligne->LibStatut(5,3):'').'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
@ -351,7 +418,7 @@ if ($resql)
print '</td>'; print '</td>';
print '<td nowrap="nowrap" align="right"><a href="'.DOL_URL_ROOT.'/contrat/fiche.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">'; print '<td nowrap="nowrap" align="right"><a href="'.DOL_URL_ROOT.'/contrat/fiche.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';
$dateend=$db->jdate($obj->date_fin_validite); $dateend=$db->jdate($obj->date_fin_validite);
print $staticcontratligne->LibStatut($obj->statut, 3, ($dateend && $dateend < $now)); print $staticcontratligne->LibStatut($obj->statut, 3, ($dateend && $dateend < $now)?1:0);
print '</a></td>'; print '</a></td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -107,8 +107,8 @@ if ($resql)
print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder);
//print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "c.statut","","$param",'align="center"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "c.statut","","$param",'align="center"',$sortfield,$sortorder);
print '<td class="liste_titre" width="16">'.$staticcontratligne->LibStatut(0,3).'</td>'; print '<td class="liste_titre" width="16">'.$staticcontratligne->LibStatut(0,3).'</td>';
print '<td class="liste_titre" width="16">'.$staticcontratligne->LibStatut(4,3,false).'</td>'; print '<td class="liste_titre" width="16">'.$staticcontratligne->LibStatut(4,3,0).'</td>';
print '<td class="liste_titre" width="16">'.$staticcontratligne->LibStatut(4,3,true).'</td>'; print '<td class="liste_titre" width="16">'.$staticcontratligne->LibStatut(4,3,1).'</td>';
print '<td class="liste_titre" width="16">'.$staticcontratligne->LibStatut(5,3).'</td>'; print '<td class="liste_titre" width="16">'.$staticcontratligne->LibStatut(5,3).'</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -19,10 +19,10 @@
*/ */
/** /**
\file htdocs/contrat/services.php * \file htdocs/contrat/services.php
\ingroup contrat * \ingroup contrat
\brief Page liste des contrats en service * \brief Page liste des contrats en service
\version $Id$ * \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -64,7 +64,7 @@ $companystatic=new Societe($db);
* View * View
*/ */
$now=gmmktime(); $now=dol_now('tzref');
$form=new Form($db); $form=new Form($db);
@ -91,7 +91,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc
if ($mode == "0") $sql.= " AND cd.statut = 0"; if ($mode == "0") $sql.= " AND cd.statut = 0";
if ($mode == "4") $sql.= " AND cd.statut = 4"; if ($mode == "4") $sql.= " AND cd.statut = 4";
if ($mode == "5") $sql.= " AND cd.statut = 5"; if ($mode == "5") $sql.= " AND cd.statut = 5";
if ($filter == "expired") $sql.= " AND date_fin_validite < ".$db->idate(mktime()); if ($filter == "expired") $sql.= " AND date_fin_validite < ".$now;
if ($search_nom) $sql.= " AND s.nom like '%".addslashes($search_nom)."%'"; if ($search_nom) $sql.= " AND s.nom like '%".addslashes($search_nom)."%'";
if ($search_contract) $sql.= " AND c.rowid = '".addslashes($search_contract)."'"; if ($search_contract) $sql.= " AND c.rowid = '".addslashes($search_contract)."'";
if ($search_service) $sql.= " AND (p.ref like '%".addslashes($search_service)."%' OR p.description like '%".addslashes($search_service)."%')"; if ($search_service) $sql.= " AND (p.ref like '%".addslashes($search_service)."%' OR p.description like '%".addslashes($search_service)."%')";
@ -230,7 +230,7 @@ if ($resql)
else else
{ {
print '<a href="'.DOL_URL_ROOT.'/contrat/fiche.php?id='.$obj->cid.'&line='.$obj->rowid.'">'; print '<a href="'.DOL_URL_ROOT.'/contrat/fiche.php?id='.$obj->cid.'&line='.$obj->rowid.'">';
print $staticcontratligne->LibStatut($obj->statut,5,($obj->date_fin_validite && $obj->date_fin_validite < $now)); print $staticcontratligne->LibStatut($obj->statut,5,($obj->date_fin_validite && $obj->date_fin_validite < $now)?1:0);
print '</a>'; print '</a>';
} }
print '</td>'; print '</td>';

View File

@ -48,6 +48,26 @@ print_barre_liste($langs->trans("SuppliersOrdersArea"), $page, "index.php", "",
print '<table class="notopnoleftnoright" width="100%">'; print '<table class="notopnoleftnoright" width="100%">';
print '<tr valign="top"><td class="notopnoleft" width="30%">'; print '<tr valign="top"><td class="notopnoleft" width="30%">';
/*
* Search form
*/
$var=false;
print '<table class="noborder" width="100%">';
print '<form method="post" action="liste.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="search_ref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print '<tr '.$bc[$var].'><td nowrap>'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="search_all" size="18"></td>';
print '</tr>';
print "</form></table><br>\n";
/*
* Legends / Status
*/
$sql = "SELECT count(cf.rowid), fk_statut"; $sql = "SELECT count(cf.rowid), fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf"; $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf";
@ -83,7 +103,7 @@ if ($resql)
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }
print "</table>"; print "</table><br>";
$db->free($resql); $db->free($resql);
} }
else else
@ -91,6 +111,47 @@ else
dol_print_error($db); dol_print_error($db);
} }
/*
* Commandes brouillons
*/
if ($conf->fournisseur->enabled)
{
$sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE c.fk_soc = s.rowid";
$sql.= " AND c.entity = ".$conf->entity;
$sql.= " AND c.fk_statut = 0";
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ( $db->query($sql) )
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("DraftOrders").'</td></tr>';
$langs->load("orders");
$num = $db->num_rows();
if ($num)
{
$i = 0;
$var = True;
while ($i < $num)
{
$var=!$var;
$obj = $db->fetch_object();
print "<tr $bc[$var]>";
print '<td nowrap="nowrap">';
print "<a href=\"fiche.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>";
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
$i++;
}
}
print "</table><br>";
}
}
print '</td><td width="70%" valign="top" class="notopnoleft">'; print '</td><td width="70%" valign="top" class="notopnoleft">';

View File

@ -29,6 +29,10 @@ require("./pre.inc.php");
$langs->load("orders"); $langs->load("orders");
$sref=isset($_GET['search_ref'])?$_GET['search_ref']:$_POST['search_ref'];
$snom=isset($_GET['search_nom'])?$_GET['search_nom']:$_POST['search_nom'];
$sall=isset($_GET['search_all'])?$_GET['search_all']:$_POST['search_all'];
$page = ( is_numeric($_GET["page"]) ? $_GET["page"] : 0 ); $page = ( is_numeric($_GET["page"]) ? $_GET["page"] : 0 );
$socid = ( is_numeric($_GET["socid"]) ? $_GET["socid"] : 0 ); $socid = ( is_numeric($_GET["socid"]) ? $_GET["socid"] : 0 );
$sortorder = $_GET["sortorder"]; $sortorder = $_GET["sortorder"];
@ -74,6 +78,18 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX
$sql.= " WHERE cf.fk_soc = s.rowid "; $sql.= " WHERE cf.fk_soc = s.rowid ";
$sql.= " AND s.entity = ".$conf->entity; $sql.= " AND s.entity = ".$conf->entity;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($sref)
{
$sql.= " AND cf.ref like '%".addslashes($sref)."%'";
}
if ($snom)
{
$sql.= " AND s.nom like '%".addslashes($snom)."%'";
}
if ($sall)
{
$sql.= " AND (cf.ref like '%".addslashes($sall)."%' OR cf.note like '%".addslashes($sall)."%')";
}
if ($socid) $sql.= " AND s.rowid = ".$socid; if ($socid) $sql.= " AND s.rowid = ".$socid;
if (strlen($_GET["statut"])) if (strlen($_GET["statut"]))
@ -81,16 +97,6 @@ if (strlen($_GET["statut"]))
$sql .= " AND fk_statut =".$_GET["statut"]; $sql .= " AND fk_statut =".$_GET["statut"];
} }
if (strlen($_GET["search_ref"]))
{
$sql .= " AND cf.ref LIKE '%".$_GET["search_ref"]."%'";
}
if (strlen($_GET["search_nom"]))
{
$sql .= " AND s.nom LIKE '%".$_GET["search_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);
$resql = $db->query($sql); $resql = $db->query($sql);
@ -113,8 +119,8 @@ if ($resql)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td><input type="text" class="flat" name="search_ref" value="'.$_GET["search_ref"].'"></td>'; print '<td><input type="text" class="flat" name="search_ref" value="'.$sref.'"></td>';
print '<td><input type="text" class="flat" name="search_nom" value="'.$_GET["search_nom"].'"></td>'; print '<td><input type="text" class="flat" name="search_nom" value="'.$snom.'"></td>';
print '<td colspan="2" class="liste_titre" align="right">'; print '<td colspan="2" class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">'; print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
print '</td>'; print '</td>';
@ -132,7 +138,7 @@ if ($resql)
// Ref // Ref
print '<td><a href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>'."\n"; print '<td><a href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>'."\n";
// Société // Soci<EFBFBD>t<EFBFBD>
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '; print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' ';
print $obj->nom.'</a></td>'."\n"; print $obj->nom.'</a></td>'."\n";

View File

@ -1568,7 +1568,7 @@ class Form
if ($formquestion) if ($formquestion)
{ {
$more.='<tr class="valid"><td class="valid" colspan="3">'; $more.='<tr class="valid"><td class="valid" colspan="3">';
$more.='<table class="notopnoleftnoright" width="100%">'; $more.='<table class="nobordernopadding" width="100%">';
$more.='<tr><td colspan="3" valign="top">'.$formquestion['text'].'</td></tr>'; $more.='<tr><td colspan="3" valign="top">'.$formquestion['text'].'</td></tr>';
foreach ($formquestion as $key => $input) foreach ($formquestion as $key => $input)
{ {
@ -1691,7 +1691,7 @@ class Form
print '<form method="post" action="'.$page.'">'; print '<form method="post" action="'.$page.'">';
print '<input type="hidden" name="action" value="classin">'; print '<input type="hidden" name="action" value="classin">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder" cellpadding="0" cellspacing="0">'; print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>'; print '<tr><td>';
select_projects($socid,$selected,$htmlname); select_projects($socid,$selected,$htmlname);
print '</td>'; print '</td>';
@ -1726,7 +1726,7 @@ class Form
print '<form method="post" action="'.$page.'">'; print '<form method="post" action="'.$page.'">';
print '<input type="hidden" name="action" value="setconditions">'; print '<input type="hidden" name="action" value="setconditions">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder" cellpadding="0" cellspacing="0">'; print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>'; print '<tr><td>';
$this->select_conditions_paiements($selected,$htmlname,-1,$addempty); $this->select_conditions_paiements($selected,$htmlname,-1,$addempty);
print '</td>'; print '</td>';
@ -1761,7 +1761,7 @@ class Form
print '<form method="post" action="'.$page.'" name="form'.$htmlname.'">'; print '<form method="post" action="'.$page.'" name="form'.$htmlname.'">';
print '<input type="hidden" name="action" value="set'.$htmlname.'">'; print '<input type="hidden" name="action" value="set'.$htmlname.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder" cellpadding="0" cellspacing="0">'; print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>'; print '<tr><td>';
print $this->select_date($selected,$htmlname,0,0,1,'form'.$htmlname); print $this->select_date($selected,$htmlname,0,0,1,'form'.$htmlname);
print '</td>'; print '</td>';
@ -1795,7 +1795,7 @@ class Form
print '<form method="post" action="'.$page.'">'; print '<form method="post" action="'.$page.'">';
print '<input type="hidden" name="action" value="setmode">'; print '<input type="hidden" name="action" value="setmode">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder" cellpadding="0" cellspacing="0">'; print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>'; print '<tr><td>';
$this->select_types_paiements($selected,$htmlname); $this->select_types_paiements($selected,$htmlname);
print '</td>'; print '</td>';
@ -1881,7 +1881,7 @@ class Form
print '<form method="post" action="'.$page.'">'; print '<form method="post" action="'.$page.'">';
print '<input type="hidden" name="action" value="set_contact">'; print '<input type="hidden" name="action" value="set_contact">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder" cellpadding="0" cellspacing="0">'; print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>'; print '<tr><td>';
$num=$this->select_contacts($societe->id, $selected, $htmlname); $num=$this->select_contacts($societe->id, $selected, $htmlname);
if ($num==0) if ($num==0)
@ -1925,7 +1925,7 @@ class Form
print '<form method="post" action="'.$page.'">'; print '<form method="post" action="'.$page.'">';
print '<input type="hidden" name="action" value="setdeliveryadress">'; print '<input type="hidden" name="action" value="setdeliveryadress">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder" cellpadding="0" cellspacing="0">'; print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>'; print '<tr><td>';
$this->select_adresse_livraison($selected, $socid, $htmlname, 1); $this->select_adresse_livraison($selected, $socid, $htmlname, 1);
print '</td>'; print '</td>';

View File

@ -13,6 +13,8 @@ ContractStatusValidated=Validated
ContractStatusClosed=Closed ContractStatusClosed=Closed
ServiceStatusInitial=Not running ServiceStatusInitial=Not running
ServiceStatusRunning=Running ServiceStatusRunning=Running
ServiceStatusNotLate=Running, not expired
ServiceStatusNotLateShort=Not expired
ServiceStatusLate=Running, expired ServiceStatusLate=Running, expired
ServiceStatusLateShort=Expired ServiceStatusLateShort=Expired
ServiceStatusClosed=Closed ServiceStatusClosed=Closed

View File

@ -13,6 +13,8 @@ ContractStatusValidated=Validé
ContractStatusClosed=Clôturé ContractStatusClosed=Clôturé
ServiceStatusInitial=Inactif ServiceStatusInitial=Inactif
ServiceStatusRunning=En service ServiceStatusRunning=En service
ServiceStatusNotLate=En service, non expiré
ServiceStatusNotLateShort=Non expiré
ServiceStatusLate=En service, expiré ServiceStatusLate=En service, expiré
ServiceStatusLateShort=Expiré ServiceStatusLateShort=Expiré
ServiceStatusClosed=Fermé ServiceStatusClosed=Fermé