Filtre acces client
This commit is contained in:
parent
3ae75ca41e
commit
34de66ce1c
@ -1,5 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -25,6 +25,16 @@ require("../../lib/webcal.class.php3");
|
|||||||
require("../../cactioncomm.class.php3");
|
require("../../cactioncomm.class.php3");
|
||||||
require("../../actioncomm.class.php3");
|
require("../../actioncomm.class.php3");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sécurité accés client
|
||||||
|
*/
|
||||||
|
if ($user->societe_id > 0)
|
||||||
|
{
|
||||||
|
$action = '';
|
||||||
|
$socidp = $user->societe_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$db = new Db();
|
$db = new Db();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -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,19 +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("../../contact.class.php3");
|
require("../../contact.class.php3");
|
||||||
require("../../lib/webcal.class.php3");
|
require("../../lib/webcal.class.php3");
|
||||||
require("../../cactioncomm.class.php3");
|
require("../../cactioncomm.class.php3");
|
||||||
require("../../actioncomm.class.php3");
|
require("../../actioncomm.class.php3");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sécurité accés client
|
||||||
|
*/
|
||||||
|
if ($user->societe_id > 0)
|
||||||
|
{
|
||||||
|
$action = '';
|
||||||
|
$socid = $user->societe_id;
|
||||||
|
}
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
$db = new Db();
|
|
||||||
|
|
||||||
|
$db = new Db();
|
||||||
|
|
||||||
if ($page == -1) { $page = 0 ; }
|
if ($page == -1) { $page = 0 ; }
|
||||||
$limit = $conf->liste_limit;
|
$limit = $conf->liste_limit;
|
||||||
@ -40,25 +47,27 @@ $offset = $limit * $page ;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if ($action=='delete_action') {
|
if ($action=='delete_action')
|
||||||
|
{
|
||||||
$actioncomm = new ActionComm($db);
|
$actioncomm = new ActionComm($db);
|
||||||
$actioncomm->delete($actionid);
|
$actioncomm->delete($actionid);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if ($action=='add_action') {
|
if ($action=='add_action')
|
||||||
|
{
|
||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
$contact->fetch($contactid);
|
$contact->fetch($contactid);
|
||||||
|
|
||||||
|
|
||||||
$actioncomm = new ActionComm($db);
|
$actioncomm = new ActionComm($db);
|
||||||
|
|
||||||
if ($actionid == 5) {
|
if ($actionid == 5)
|
||||||
|
{
|
||||||
$actioncomm->date = $db->idate(mktime($heurehour,$heuremin,0,$remonth,$reday,$reyear));
|
$actioncomm->date = $db->idate(mktime($heurehour,$heuremin,0,$remonth,$reday,$reyear));
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$actioncomm->date = $date;
|
$actioncomm->date = $date;
|
||||||
}
|
}
|
||||||
$actioncomm->type = $actionid;
|
$actioncomm->type = $actionid;
|
||||||
@ -69,7 +78,6 @@ if ($action=='add_action') {
|
|||||||
|
|
||||||
$actioncomm->add($user);
|
$actioncomm->add($user);
|
||||||
|
|
||||||
|
|
||||||
$societe = new Societe($db);
|
$societe = new Societe($db);
|
||||||
$societe->fetch($socid);
|
$societe->fetch($socid);
|
||||||
|
|
||||||
@ -104,7 +112,6 @@ if ($action=='add_action') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Liste
|
* Liste
|
||||||
@ -154,7 +161,9 @@ $sql .= " WHERE a.fk_soc = $socid AND c.id=a.fk_action AND a.fk_user_author = u.
|
|||||||
print $db->error() . '<br>' . $sql;
|
print $db->error() . '<br>' . $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
print_barre_liste("Liste des actions commerciales effectuées",$page, $PHP_SELF);
|
print_barre_liste("Liste des actions commerciales effectuées",$page, $PHP_SELF);
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -21,12 +21,24 @@
|
|||||||
*/
|
*/
|
||||||
require("./pre.inc.php3");
|
require("./pre.inc.php3");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sécurité accés client
|
||||||
|
*/
|
||||||
|
if ($user->societe_id > 0)
|
||||||
|
{
|
||||||
|
$action = '';
|
||||||
|
$socid = $user->societe_id;
|
||||||
|
}
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
$db = new Db();
|
$db = new Db();
|
||||||
if ($sortorder == "") {
|
|
||||||
|
if ($sortorder == "")
|
||||||
|
{
|
||||||
$sortorder="ASC";
|
$sortorder="ASC";
|
||||||
}
|
}
|
||||||
if ($sortfield == "") {
|
if ($sortfield == "")
|
||||||
|
{
|
||||||
$sortfield="p.name";
|
$sortfield="p.name";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,29 +60,32 @@ print_barre_liste("Liste des contacts",$page, $PHP_SELF);
|
|||||||
$sql = "SELECT s.idp, s.nom, st.libelle as stcomm, p.idp as cidp, p.name, p.firstname, p.email, p.phone ";
|
$sql = "SELECT s.idp, s.nom, st.libelle as stcomm, p.idp as cidp, p.name, p.firstname, p.email, p.phone ";
|
||||||
$sql .= "FROM societe as s, socpeople as p, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.idp = p.fk_soc";
|
$sql .= "FROM societe as s, socpeople as p, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.idp = p.fk_soc";
|
||||||
|
|
||||||
if (strlen($stcomm))
|
if (strlen($stcomm)) // statut commercial
|
||||||
{
|
{
|
||||||
$sql .= " AND s.fk_stcomm=$stcomm";
|
$sql .= " AND s.fk_stcomm=$stcomm";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($begin))
|
if (strlen($begin)) // filtre sur la premiere lettre du nom
|
||||||
{
|
{
|
||||||
$sql .= " AND upper(p.name) like '$begin%'";
|
$sql .= " AND upper(p.name) like '$begin%'";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contactname) {
|
if ($contactname) // acces a partir du module de recherche
|
||||||
$sql .= " AND lower(p.name) like '%".strtolower($contactname)."%'";
|
{
|
||||||
|
$sql .= " AND ( lower(p.name) like '%".strtolower($contactname)."%' OR lower(p.firstname) like '%".strtolower($contactname)."%') ";
|
||||||
$sortfield = "lower(p.name)";
|
$sortfield = "lower(p.name)";
|
||||||
$sortorder = "ASC";
|
$sortorder = "ASC";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($socid) {
|
if ($socid)
|
||||||
|
{
|
||||||
$sql .= " AND s.idp = $socid";
|
$sql .= " AND s.idp = $socid";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset);
|
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows();
|
||||||
@ -111,7 +126,14 @@ if ($result)
|
|||||||
|
|
||||||
print '<td><a href="action/fiche.php3?action=create&actionid=1&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->phone.'</a> </td>';
|
print '<td><a href="action/fiche.php3?action=create&actionid=1&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->phone.'</a> </td>';
|
||||||
|
|
||||||
|
if ($user->societe_id == 0)
|
||||||
|
{
|
||||||
print "<TD><a href=\"addpropal.php3?socidp=$obj->idp&setcontact=$obj->cidp&action=create\">[Propal]</A></td>\n";
|
print "<TD><a href=\"addpropal.php3?socidp=$obj->idp&setcontact=$obj->cidp&action=create\">[Propal]</A></td>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<td> </td>";
|
||||||
|
}
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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,6 +15,9 @@
|
|||||||
* 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("../contact.class.php3");
|
require("../contact.class.php3");
|
||||||
|
|||||||
@ -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,6 +15,9 @@
|
|||||||
* 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");
|
||||||
|
|
||||||
@ -32,6 +32,16 @@ require("../actioncomm.class.php3");
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sécurité accés client
|
||||||
|
*/
|
||||||
|
if ($user->societe_id > 0)
|
||||||
|
{
|
||||||
|
$action = '';
|
||||||
|
$socidp = $user->societe_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$db = new Db();
|
$db = new Db();
|
||||||
@ -160,6 +170,10 @@ if ($propalid) {
|
|||||||
$sql .= " FROM societe as s, llx_propal as p, c_propalst as c, socpeople as x";
|
$sql .= " FROM societe as s, llx_propal as p, c_propalst as c, socpeople as x";
|
||||||
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND x.idp = p.fk_soc_contact AND p.rowid = $propalid";
|
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND x.idp = p.fk_soc_contact AND p.rowid = $propalid";
|
||||||
|
|
||||||
|
if ($socidp) {
|
||||||
|
$sql .= " AND s.idp = $socidp";
|
||||||
|
}
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ( $result )
|
if ( $result )
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -25,10 +25,18 @@ require("../contact.class.php3");
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
$db = new Db();
|
$db = new Db();
|
||||||
if ($sortorder == "") {
|
|
||||||
|
/*
|
||||||
|
* Liste
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ($sortorder == "")
|
||||||
|
{
|
||||||
$sortorder="ASC";
|
$sortorder="ASC";
|
||||||
}
|
}
|
||||||
if ($sortfield == "") {
|
if ($sortfield == "")
|
||||||
|
{
|
||||||
$sortfield="nom";
|
$sortfield="nom";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,9 +46,15 @@ print_titre("Liste des fiches d'intervention");
|
|||||||
$sql = "SELECT s.nom,s.idp, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut, f.duree";
|
$sql = "SELECT s.nom,s.idp, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut, f.duree";
|
||||||
$sql .= " FROM societe as s, llx_fichinter as f ";
|
$sql .= " FROM societe as s, llx_fichinter as f ";
|
||||||
$sql .= " WHERE f.fk_soc = s.idp ";
|
$sql .= " WHERE f.fk_soc = s.idp ";
|
||||||
|
|
||||||
|
if ($user->societe_id > 0) {
|
||||||
|
$sql .= " AND s.idp = " . $user->societe_id;
|
||||||
|
}
|
||||||
|
|
||||||
$sql .= " ORDER BY f.datei DESC ;";
|
$sql .= " ORDER BY f.datei DESC ;";
|
||||||
|
|
||||||
if ( $db->query($sql) ) {
|
if ( $db->query($sql) )
|
||||||
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||||
@ -49,10 +63,11 @@ if ( $db->query($sql) ) {
|
|||||||
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Societe</a></td>";
|
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Societe</a></td>";
|
||||||
print "<TD>Date</TD>";
|
print "<TD>Date</TD>";
|
||||||
print '<TD align="center">Durée</TD>';
|
print '<TD align="center">Durée</TD>';
|
||||||
print "<TD>Statut</TD><td> </td>";
|
print '<TD align="center">Statut</TD><td> </td>';
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
$var=True;
|
$var=True;
|
||||||
while ($i < $num) {
|
while ($i < $num)
|
||||||
|
{
|
||||||
$objp = $db->fetch_object( $i);
|
$objp = $db->fetch_object( $i);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<TR $bc[$var]>";
|
print "<TR $bc[$var]>";
|
||||||
@ -60,8 +75,16 @@ if ( $db->query($sql) ) {
|
|||||||
print "<TD><a href=\"../comm/fiche.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
print "<TD><a href=\"../comm/fiche.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
||||||
print "<TD>".strftime("%d %B %Y",$objp->dp)."</TD>\n";
|
print "<TD>".strftime("%d %B %Y",$objp->dp)."</TD>\n";
|
||||||
print '<TD align="center">'.sprintf("%.1f",$objp->duree).'</TD>';
|
print '<TD align="center">'.sprintf("%.1f",$objp->duree).'</TD>';
|
||||||
print "<TD>$objp->fk_statut</TD>\n";
|
print '<TD align="center">'.$objp->fk_statut.'</TD>';
|
||||||
|
|
||||||
|
if ($user->societe_id == 0)
|
||||||
|
{
|
||||||
print '<TD align="center"><a href="fiche.php3?socidp='.$objp->idp.'&action=create">[Fiche Inter]</A></td>';
|
print '<TD align="center"><a href="fiche.php3?socidp='.$objp->idp.'&action=create">[Fiche Inter]</A></td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<td> </td>";
|
||||||
|
}
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
@ -69,7 +92,9 @@ if ( $db->query($sql) ) {
|
|||||||
|
|
||||||
print "</TABLE>";
|
print "</TABLE>";
|
||||||
$db->free();
|
$db->free();
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
print $db->error();
|
print $db->error();
|
||||||
print "<p>$sql";
|
print "<p>$sql";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user