Fix: List of services
This commit is contained in:
parent
b12d53e13f
commit
3c4926c8cf
@ -1177,7 +1177,8 @@ else
|
||||
|
||||
if ($contrat->statut == 0 && $nbofservices)
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
||||
if ($user->rights->facture->creer ) print '<a class="butAction" href="fiche.php?id='.$id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
||||
else print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
|
||||
if ($contrat->statut > 0 && $user->rights->facture->creer)
|
||||
|
||||
@ -49,7 +49,7 @@ if (! $sortorder) $sortorder="DESC";
|
||||
|
||||
// Security check
|
||||
$contratid = isset($_GET["id"])?$_GET["id"]:'';
|
||||
$result = restrictedArea($user, 'contrat',$contratid,'',1);
|
||||
$result = restrictedArea($user, 'contrat', $contratid,'',1);
|
||||
|
||||
$staticcontrat=new Contrat($db);
|
||||
$staticcontratligne=new ContratLigne($db);
|
||||
@ -68,8 +68,9 @@ $sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.d
|
||||
$sql.= ' sum('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,';
|
||||
$sql.= " c.rowid as cid, c.ref, c.datec, c.statut, s.nom, s.rowid as socid";
|
||||
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
|
||||
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,";
|
||||
if (!$user->rights->commercial->client->voir && !$socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat";
|
||||
$sql.= " WHERE c.fk_soc = s.rowid ";
|
||||
if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
@ -106,10 +107,10 @@ if ($resql)
|
||||
print '<form method="POST" action="liste.php">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" size="3" name="search_contract" value="'.stripslashes($search_contract).'">';
|
||||
print '<input type="text" class="flat" size="3" name="search_contract" value="'.$search_contract.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" valign="right">';
|
||||
print '<input type="text" class="flat" size="24" name="search_nom" value="'.stripslashes($search_nom).'">';
|
||||
print '<input type="text" class="flat" size="24" name="search_nom" value="'.$search_nom.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2008 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
|
||||
@ -15,16 +15,13 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/contrat/services.php
|
||||
\ingroup contrat
|
||||
\brief Page liste des contrats en service
|
||||
\version $Revision$
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
@ -65,7 +62,6 @@ $staticcontratligne=new ContratLigne($db);
|
||||
*/
|
||||
llxHeader();
|
||||
|
||||
|
||||
$sql = "SELECT s.rowid as socid, s.nom, c.rowid as cid,";
|
||||
$sql.= " cd.rowid, cd.description, cd.statut, p.rowid as pid, p.label as label,";
|
||||
if (!$user->rights->commercial->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
|
||||
@ -75,11 +71,11 @@ $sql.= " ".$db->pdate("cd.date_fin_validite")." as date_fin_validite,";
|
||||
$sql.= " ".$db->pdate("cd.date_cloture")." as date_cloture";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat as c,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."societe as s,";
|
||||
if (!$user->rights->commercial->client->voir && !$socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."contratdet as cd";
|
||||
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
||||
$sql.= " WHERE c.statut > 0";
|
||||
$sql.= " AND c.rowid = cd.fk_contrat";
|
||||
$sql.= " WHERE";
|
||||
$sql.= " c.rowid = cd.fk_contrat";
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($mode == "0") $sql.= " AND cd.statut = 0";
|
||||
@ -93,6 +89,8 @@ if ($socid > 0) $sql.= " AND s.rowid = ".$socid;
|
||||
$sql .= " ORDER BY $sortfield $sortorder";
|
||||
$sql .= $db->plimit($limit + 1 ,$offset);
|
||||
|
||||
//print $sql;
|
||||
dolibarr_syslog("contrat/services.php sql=".$sql);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2008 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
|
||||
@ -15,13 +15,12 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
\defgroup contrat Module contrat
|
||||
\brief Module pour g<EFBFBD>rer la tenue de contrat de services
|
||||
\brief Module pour gerer la tenue de contrat de services
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -85,7 +84,7 @@ class modContrat extends DolibarrModules
|
||||
$this->rights[1][4] = 'lire';
|
||||
|
||||
$this->rights[2][0] = 162;
|
||||
$this->rights[2][1] = 'Cr<EFBFBD>er / modifier les contrats';
|
||||
$this->rights[2][1] = 'Creer / modifier les contrats';
|
||||
$this->rights[2][2] = 'w';
|
||||
$this->rights[2][3] = 0;
|
||||
$this->rights[2][4] = 'creer';
|
||||
@ -97,7 +96,7 @@ class modContrat extends DolibarrModules
|
||||
$this->rights[3][4] = 'activer';
|
||||
|
||||
$this->rights[4][0] = 164;
|
||||
$this->rights[4][1] = 'D<EFBFBD>sactiver un service d\'un contrat';
|
||||
$this->rights[4][1] = 'Desactiver un service d\'un contrat';
|
||||
$this->rights[4][2] = 'w';
|
||||
$this->rights[4][3] = 0;
|
||||
$this->rights[4][4] = 'desactiver';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user