mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Distinct status "running not expired" from "running expired" in lines contract status
This commit is contained in:
parent
fc02cb053c
commit
6c20010326
|
|
@ -28,6 +28,8 @@ For users:
|
|||
- New: Can set a limit for stock alert to 0.
|
||||
- New: Support SMTPS.
|
||||
- New: Added a page /support to provide a help center service on Dolibarr.
|
||||
- New: Distinct status "running not expired" from "running expired" in lines
|
||||
contract status.
|
||||
- Fix: Handle correctly the comment in status changing of supplier orders.
|
||||
- Fix: Author, title and topic are correctly encoded in PDF.
|
||||
- Fix: Now HTML output is always UTF8, this solve bad PDF encoding on old users.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -319,8 +319,11 @@ class Contrat extends CommonObject
|
|||
{
|
||||
$this->nbofserviceswait=0;
|
||||
$this->nbofservicesopened=0;
|
||||
$this->nbofservicesexpired=0;
|
||||
$this->nbofservicesclosed=0;
|
||||
|
||||
$now=gmmktime();
|
||||
|
||||
// Selectionne les lignes contrats liees a un produit
|
||||
$sql = "SELECT p.label, p.description as product_desc, p.ref,";
|
||||
$sql.= " d.rowid, d.fk_contrat, d.statut, d.description, d.price_ht, d.tva_tx, d.qty, d.remise_percent, d.subprice,";
|
||||
|
|
@ -390,7 +393,8 @@ class Contrat extends CommonObject
|
|||
//dolibarr_syslog("2 ".$ligne->product_desc);
|
||||
|
||||
if ($ligne->statut == 0) $this->nbofserviceswait++;
|
||||
if ($ligne->statut == 4) $this->nbofservicesopened++;
|
||||
if ($ligne->statut == 4 && (empty($ligne->date_fin_prevue) || $ligne->date_fin_prevue >= $now)) $this->nbofservicesopened++;
|
||||
if ($ligne->statut == 4 && $ligne->date_fin_prevue < $now) $this->nbofservicesexpired++;
|
||||
if ($ligne->statut == 5) $this->nbofservicesclosed++;
|
||||
|
||||
$i++;
|
||||
|
|
@ -464,7 +468,8 @@ class Contrat extends CommonObject
|
|||
$ligne->date_fin_reel = $this->db->jdate($objp->date_cloture);
|
||||
|
||||
if ($ligne->statut == 0) $this->nbofserviceswait++;
|
||||
if ($ligne->statut == 4) $this->nbofservicesopened++;
|
||||
if ($ligne->statut == 4 && (empty($ligne->date_fin_prevue) || $ligne->date_fin_prevue >= $now)) $this->nbofservicesopened++;
|
||||
if ($ligne->statut == 4 && $ligne->date_fin_prevue < $now) $this->nbofservicesexpired++;
|
||||
if ($ligne->statut == 5) $this->nbofservicesclosed++;
|
||||
|
||||
$this->lignes[] = $ligne;
|
||||
|
|
@ -1050,17 +1055,14 @@ class Contrat extends CommonObject
|
|||
if ($mode == 4)
|
||||
{
|
||||
$line=new ContratLigne($this->db);
|
||||
$text=($this->nbofserviceswait+$this->nbofservicesopened+$this->nbofservicesclosed);
|
||||
$text=($this->nbofserviceswait+$this->nbofservicesopened+$this->nbofservicesexpired+$this->nbofservicesclosed);
|
||||
$text.=' '.$langs->trans("Services");
|
||||
$text.=': ';
|
||||
$text.=$this->nbofserviceswait.' '.$line->LibStatut(0,3).' ';
|
||||
$text.=$this->nbofservicesopened.' '.$line->LibStatut(4,3).' ';
|
||||
$text.=$this->nbofservicesopened.' '.$line->LibStatut(4,3,false).' ';
|
||||
$text.=$this->nbofservicesexpired.' '.$line->LibStatut(4,3,true).' ';
|
||||
$text.=$this->nbofservicesclosed.' '.$line->LibStatut(5,3);
|
||||
return $text;
|
||||
|
||||
if ($statut == 0) { return img_picto($langs->trans('ContractStatusDraft'),'statut0').' '.$langs->trans("ContractStatusDraft"); }
|
||||
if ($statut == 1) { return img_picto($langs->trans('ContractStatusValidated'),'statut4').' '.$langs->trans("ContractStatusValidated"); }
|
||||
if ($statut == 2) { return img_picto($langs->trans('ContractStatusClosed'),'statut6').' '.$langs->trans("ContractStatusClosed"); }
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
|
|
@ -1387,59 +1389,66 @@ class ContratLigne
|
|||
|
||||
|
||||
/**
|
||||
* \brief Retourne le libelle du statut de la ligne de contrat
|
||||
* \brief Return label of this contract line status
|
||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* \return string Libelle
|
||||
*/
|
||||
function getLibStatut($mode)
|
||||
{
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
return $this->LibStatut($this->statut,$mode,(isset($this->date_fin_validite) && $this->date_fin_validite < gmmktime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi le libelle d'un statut donne
|
||||
* \brief Return label of a contract line status
|
||||
* \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 expired true=Expired
|
||||
* \return string Libelle
|
||||
*/
|
||||
function LibStatut($statut,$mode)
|
||||
function LibStatut($statut,$mode,$expired=false)
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("contracts");
|
||||
if ($mode == 0)
|
||||
{
|
||||
if ($statut == 0) { return $langs->trans("ServiceStatusInitial"); }
|
||||
if ($statut == 4) { return $langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == 4 && ! $expired) { return $langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == 4 && $expired) { return $langs->trans("ServiceStatusLate"); }
|
||||
if ($statut == 5) { return $langs->trans("ServiceStatusClosed"); }
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
if ($statut == 0) { return $langs->trans("ServiceStatusInitial"); }
|
||||
if ($statut == 4) { return $langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == 4 && ! $expired) { return $langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == 4 && $expired) { return $langs->trans("ServiceStatusLateShort"); }
|
||||
if ($statut == 5) { return $langs->trans("ServiceStatusClosed"); }
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); }
|
||||
if ($statut == 4) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == 4 && ! $expired) { 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 == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0'); }
|
||||
if ($statut == 4) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4'); }
|
||||
if ($statut == 4 && ! $expired) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4'); }
|
||||
if ($statut == 4 && $expired) { return img_picto($langs->trans('ServiceStatusLate'),'statut3'); }
|
||||
if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6'); }
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); }
|
||||
if ($statut == 4) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == 4 && ! $expired) { 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 == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
if ($statut == 0) { return $langs->trans("ServiceStatusInitial").' '.img_picto($langs->trans('ServiceStatusInitial'),'statut0'); }
|
||||
if ($statut == 4) { return $langs->trans("ServiceStatusRunning").' '.img_picto($langs->trans('ServiceStatusRunning'),'statut4'); }
|
||||
if ($statut == 4 && ! $expired) { 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 == 5) { return $langs->trans("ServiceStatusClosed").' '.img_picto($langs->trans('ServiceStatusClosed'),'statut6'); }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -869,14 +869,14 @@ else
|
|||
if ($objp->date_debut) {
|
||||
print dolibarr_print_date($objp->date_debut);
|
||||
// Warning si date prevu passee et pas en service
|
||||
if ($objp->statut == 0 && $objp->date_debut < ($now - $conf->contrat->warning_delay)) { print " ".img_warning($langs->trans("Late")); }
|
||||
if ($objp->statut == 0 && $objp->date_debut < ($now - $conf->contrat->services->inactifs->warning_delay)) { print " ".img_warning($langs->trans("Late")); }
|
||||
}
|
||||
else print $langs->trans("Unknown");
|
||||
print ' - ';
|
||||
print $langs->trans("DateEndPlanned").': ';
|
||||
if ($objp->date_fin) {
|
||||
print dolibarr_print_date($objp->date_fin);
|
||||
if ($objp->statut == 4 && $objp->date_fin < ($now - $conf->contrat->services->inactifs->warning_delay)) { print " ".img_warning($langs->trans("Late")); }
|
||||
if ($objp->statut == 4 && $objp->date_fin < ($now - $conf->contrat->services->expires->warning_delay)) { print " ".img_warning($langs->trans("Late")); }
|
||||
}
|
||||
else print $langs->trans("Unknown");
|
||||
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/contrat/index.php
|
||||
\ingroup contrat
|
||||
\brief Page liste des contrats
|
||||
\version $Revision$
|
||||
*/
|
||||
* \file htdocs/contrat/index.php
|
||||
* \ingroup contrat
|
||||
* \brief Page liste des contrats
|
||||
* \version $Revision$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once (DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
|
||||
|
|
@ -51,6 +51,8 @@ $staticcontratligne=new ContratLigne($db);
|
|||
* View
|
||||
*/
|
||||
|
||||
$now = gmmktime();
|
||||
|
||||
llxHeader();
|
||||
|
||||
print_fiche_titre($langs->trans("ContractsArea"));
|
||||
|
|
@ -84,7 +86,8 @@ 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).'<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>';
|
||||
|
|
@ -164,8 +167,9 @@ print '</td><td width="70%" valign="top" class="notopnoleftnoright">';
|
|||
$max=5;
|
||||
$sql = 'SELECT ';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=4 AND cd.date_fin_validite > ".$db->idate(gmmktime()),1,0).') as nb_running,';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite <= ".$db->idate(gmmktime()).")",1,0).') as nb_late,';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= ".$db->idate($now).")",1,0).') as nb_running,';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < ".$db->idate($now).")",1,0).') as nb_expired,';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < ".$db->idate($now - $conf->contrat->services->expires->warning_delay).")",1,0).') as nb_late,';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,';
|
||||
$sql.= " c.rowid as cid, c.ref, c.datec, c.tms, c.statut, s.nom, s.rowid as socid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
|
|
@ -192,7 +196,7 @@ if ($result)
|
|||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("LastContracts",5).'</td>';
|
||||
print '<td align="center">'.$langs->trans("DateModification").'</td>';
|
||||
//print '<td align="left">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="right" width="80" colspan="3">'.$langs->trans("Services").'</td>';
|
||||
print '<td align="right" width="80" colspan="4">'.$langs->trans("Services").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
|
|
@ -216,8 +220,9 @@ if ($result)
|
|||
print '<td align="center">'.dolibarr_print_date($obj->tms,'dayhour').'</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_running+$obj->nb_late>0 ? ($obj->nb_running+$obj->nb_late).$staticcontratligne->LibStatut(4,3):'').'</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_running>0 ? $obj->nb_running.$staticcontratligne->LibStatut(4,3,false):'').'</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_closed>0 ? $obj->nb_closed.$staticcontratligne->LibStatut(5,3):'').'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
|
@ -235,7 +240,7 @@ print '<br>';
|
|||
|
||||
|
||||
// Not activated services
|
||||
$sql = "SELECT cd.rowid as cid, c.ref, cd.statut, cd.label, cd.description as note, cd.fk_contrat, c.fk_soc, s.nom";
|
||||
$sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.description as note, cd.fk_contrat, s.nom";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
|
|
@ -298,7 +303,7 @@ print '<br>';
|
|||
$max=5;
|
||||
|
||||
$sql = "SELECT c.ref, c.fk_soc, ";
|
||||
$sql.= " cd.rowid as cid, cd.statut, cd.label, cd.description as note, cd.fk_contrat,";
|
||||
$sql.= " cd.rowid as cid, cd.statut, cd.label, cd.description as note, cd.fk_contrat, cd.date_fin_validite,";
|
||||
$sql.= " s.nom";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s";
|
||||
|
|
@ -340,7 +345,8 @@ if ($resql)
|
|||
print $staticcompany->getNomUrl(1,'',20);
|
||||
print '</td>';
|
||||
print '<td nowrap="nowrap" align="right"><a href="'.DOL_URL_ROOT.'/contrat/fiche.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';
|
||||
print $staticcontratligne->LibStatut($obj->statut,5);
|
||||
$dateend=$db->jdate($obj->date_fin_validite);
|
||||
print $staticcontratligne->LibStatut($obj->statut,5, ($dateend && $dateend < $now));
|
||||
print '</a></td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -60,12 +60,15 @@ $staticcontratligne=new ContratLigne($db);
|
|||
* View
|
||||
*/
|
||||
|
||||
$now=gmmktime();
|
||||
|
||||
llxHeader();
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=4 AND cd.date_fin_validite > ".$db->idate(mktime()),1,0).') as nb_running,';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite <= ".$db->idate(mktime()).")",1,0).') as nb_late,';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= ".$db->idate($now).")",1,0).') as nb_running,';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < ".$db->idate($now).")",1,0).') as nb_expired,';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < ".$db->idate($now - $conf->contrat->services->expires->warning_delay).")",1,0).') as nb_late,';
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,';
|
||||
$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut,";
|
||||
$sql.= " s.nom, s.rowid as socid";
|
||||
|
|
@ -103,7 +106,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("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(4,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,true).'</td>';
|
||||
print '<td class="liste_titre" width="16">'.$staticcontratligne->LibStatut(5,3).'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
|
@ -117,12 +121,11 @@ if ($resql)
|
|||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
//print '<td class="liste_titre"> </td>';
|
||||
print '<td colspan="3" class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
|
||||
print '<td colspan="4" class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
|
||||
$now=mktime();
|
||||
$var=True;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
|
|
@ -138,8 +141,9 @@ if ($resql)
|
|||
print '<td align="center">'.dolibarr_print_date($obj->date_contrat).'</td>';
|
||||
//print '<td align="center">'.$staticcontrat->LibStatut($obj->statut,3).'</td>';
|
||||
print '<td align="center">'.($obj->nb_initial>0?$obj->nb_initial:'').'</td>';
|
||||
print '<td align="center">'.($obj->nb_running+$obj->nb_late>0?$obj->nb_running+$obj->nb_late:'').'</td>';
|
||||
print '<td align="center">'.($obj->nb_closed>0?$obj->nb_closed:'').'</td>';
|
||||
print '<td align="center">'.($obj->nb_running>0?$obj->nb_running:'').'</td>';
|
||||
print '<td align="center">'.($obj->nb_expired>0?$obj->nb_expired:'').'</td>';
|
||||
print '<td align="center">'.($obj->nb_closed>0 ?$obj->nb_closed:'').'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -63,7 +63,7 @@ $companystatic=new Societe($db);
|
|||
* View
|
||||
*/
|
||||
|
||||
$now=mktime();
|
||||
$now=gmmktime();
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ if ($resql)
|
|||
if (! empty($_REQUEST['filter_op2']) && $_REQUEST['filter_op2'] != -1) $param.='&filter_op2='.urlencode($_REQUEST['filter_op2']);
|
||||
if ($filter_date1 != '') $param.='&op1day='.$_REQUEST['op1day'].'&op1month='.$_REQUEST['op1month'].'&op1year='.$_REQUEST['op1year'];
|
||||
if ($filter_date2 != '') $param.='&op2day='.$_REQUEST['op2day'].'&op2month='.$_REQUEST['op2month'].'&op2year='.$_REQUEST['op2year'];
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("ListOfServices"), $page, "services.php", $param, $sortfield, $sortorder,'',$num);
|
||||
|
||||
print '<table class="liste" width="100%">';
|
||||
|
|
@ -179,9 +179,9 @@ if ($resql)
|
|||
$contractstatic=new Contrat($db);
|
||||
$contractstatic->id=$obj->cid;
|
||||
$contractstatic->ref=$obj->ref?$obj->ref:$obj->cid;
|
||||
print $contractstatic->getNomUrl(1);
|
||||
print $contractstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Service
|
||||
print '<td>';
|
||||
if ($obj->pid)
|
||||
|
|
@ -193,7 +193,7 @@ if ($resql)
|
|||
print dolibarr_trunc($obj->description,20);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Third party
|
||||
print '<td>';
|
||||
$companystatic->id=$obj->socid;
|
||||
|
|
@ -201,7 +201,7 @@ if ($resql)
|
|||
$companystatic->client=1;
|
||||
print $companystatic->getNomUrl(1,'customer',32);
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Start date
|
||||
if ($mode == "0") {
|
||||
print '<td align="center">';
|
||||
|
|
@ -222,12 +222,12 @@ if ($resql)
|
|||
print '<td align="right" nowrap="nowrap">';
|
||||
if ($obj->cstatut == 0)
|
||||
{
|
||||
print $contractstatic->LibStatut(0,5);
|
||||
print $contractstatic->LibStatut(0,5,($obj->date_fin_validite && $obj->date_fin_validite < $now));
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/contrat/fiche.php?id='.$obj->cid.'&line='.$obj->rowid.'">';
|
||||
print $staticcontratligne->LibStatut($obj->statut,5);
|
||||
print $staticcontratligne->LibStatut($obj->statut,5,($obj->date_fin_validite && $obj->date_fin_validite < $now));
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
|||
print "\n";
|
||||
}
|
||||
|
||||
// Nbre services actifs (à renouveler)
|
||||
// Nbre services actifs (expired)
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
{
|
||||
$langs->load("contracts");
|
||||
|
|
@ -415,9 +415,9 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
|||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Contract"),"contract").'</td><td>'.$langs->trans("BoardRunningServices").'</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&leftmenu=contracts&mode=4">'.$board->nbtodo.'</a></td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&leftmenu=contracts&mode=4&filter=expired">'.$board->nbtodo.'</a></td>';
|
||||
print '<td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&leftmenu=contracts&mode=4">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&leftmenu=contracts&mode=4&filter=expired">';
|
||||
print $board->nbtodolate;
|
||||
print '</a></td><td nowrap align="right">';
|
||||
print ' (>'.ceil($conf->contrat->services->expires->warning_delay/60/60/24).' '.$langs->trans("days").')';
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ ContractStatusClosed=Closed
|
|||
ServiceStatusInitial=Not running
|
||||
ServiceStatusRunning=Running
|
||||
ServiceStatusLate=Running, expired
|
||||
ServiceStatusLateShort=Expired
|
||||
ServiceStatusClosed=Closed
|
||||
ServicesLegend=Services legend
|
||||
Contracts=Contracts
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ ContractStatusClosed=Clôturé
|
|||
ServiceStatusInitial=Inactif
|
||||
ServiceStatusRunning=En service
|
||||
ServiceStatusLate=En service, expiré
|
||||
ServiceStatusLateShort=Expiré
|
||||
ServiceStatusClosed=Fermé
|
||||
ServicesLegend=Légende pour les services
|
||||
Contracts=Contrats
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user