Filtre acces client
This commit is contained in:
parent
36c6a8adbe
commit
d5a60cbdc6
@ -1,8 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
* $Source$
|
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -18,17 +15,29 @@
|
|||||||
* 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$
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
require("./pre.inc.php3");
|
require("./pre.inc.php3");
|
||||||
require("./project.class.php3");
|
require("./project.class.php3");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sécurité accés client
|
||||||
|
*/
|
||||||
|
if ($user->societe_id > 0)
|
||||||
|
{
|
||||||
|
$action = '';
|
||||||
|
$socidp = $user->societe_id;
|
||||||
|
}
|
||||||
|
|
||||||
llxHeader("","../");
|
llxHeader("","../");
|
||||||
print_titre("Projets");
|
print_titre("Projets");
|
||||||
print '<table width="100%">';
|
print '<table width="100%">';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
|
|
||||||
if($socidp) {
|
if($socidp && $user->societe_id == 0)
|
||||||
|
{
|
||||||
print '<td>[<a href="fiche.php3?socidp='.$socidp.'&action=create">Nouveau projet</a>]</td>';
|
print '<td>[<a href="fiche.php3?socidp='.$socidp.'&action=create">Nouveau projet</a>]</td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
@ -53,10 +62,12 @@ if ($action == 'create') {
|
|||||||
* Affichage
|
* Affichage
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if ($sortfield == "") {
|
if ($sortfield == "")
|
||||||
|
{
|
||||||
$sortfield="lower(p.label)";
|
$sortfield="lower(p.label)";
|
||||||
}
|
}
|
||||||
if ($sortorder == "") {
|
if ($sortorder == "")
|
||||||
|
{
|
||||||
$sortorder="ASC";
|
$sortorder="ASC";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +90,10 @@ $sql = "SELECT s.nom, s.idp, p.rowid as projectid, p.ref, p.title,".$db->pdate("
|
|||||||
$sql .= " FROM societe as s, llx_projet as p";
|
$sql .= " FROM societe as s, llx_projet as p";
|
||||||
$sql .= " WHERE p.fk_soc = s.idp";
|
$sql .= " WHERE p.fk_soc = s.idp";
|
||||||
|
|
||||||
if ($socidp) { $sql .= " AND s.idp = $socidp"; }
|
if ($socidp)
|
||||||
|
{
|
||||||
|
$sql .= " AND s.idp = $socidp";
|
||||||
|
}
|
||||||
|
|
||||||
if ( $db->query($sql) ) {
|
if ( $db->query($sql) ) {
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user