2004-10-20 23:06:45 +02:00
|
|
|
|
<?php
|
2006-08-05 18:44:43 +02:00
|
|
|
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
|
|
|
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
2003-06-30 18:05:17 +02:00
|
|
|
|
*
|
|
|
|
|
|
* 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
|
2013-01-16 15:36:08 +01:00
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2003-06-30 18:05:17 +02:00
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
*
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2011-08-01 01:19:04 +02:00
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2003-06-30 18:05:17 +02:00
|
|
|
|
*/
|
2006-08-05 18:44:43 +02:00
|
|
|
|
|
|
|
|
|
|
/**
|
2011-08-27 18:15:06 +02:00
|
|
|
|
* \file htdocs/societe/notify/index.php
|
|
|
|
|
|
* \ingroup notification
|
|
|
|
|
|
* \brief List of done notifications
|
|
|
|
|
|
*/
|
2009-10-19 21:54:27 +02:00
|
|
|
|
|
2012-08-22 23:24:21 +02:00
|
|
|
|
require '../../main.inc.php';
|
2005-12-26 14:36:37 +01:00
|
|
|
|
$langs->load("companies");
|
|
|
|
|
|
$langs->load("banks");
|
2003-06-30 18:05:17 +02:00
|
|
|
|
|
2009-10-19 21:54:27 +02:00
|
|
|
|
// S<>curit<69> acc<63>s client
|
|
|
|
|
|
if ($user->societe_id > 0)
|
2003-06-30 18:05:17 +02:00
|
|
|
|
{
|
2006-08-05 18:44:43 +02:00
|
|
|
|
$action = '';
|
|
|
|
|
|
$socid = $user->societe_id;
|
2003-06-30 18:05:17 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($sortorder == "")
|
|
|
|
|
|
{
|
|
|
|
|
|
$sortorder="ASC";
|
|
|
|
|
|
}
|
|
|
|
|
|
if ($sortfield == "")
|
|
|
|
|
|
{
|
|
|
|
|
|
$sortfield="s.nom";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($page == -1) { $page = 0 ; }
|
|
|
|
|
|
|
|
|
|
|
|
$offset = $conf->liste_limit * $page ;
|
|
|
|
|
|
$pageprev = $page - 1;
|
|
|
|
|
|
$pagenext = $page + 1;
|
|
|
|
|
|
|
2006-08-05 18:44:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
2003-06-30 18:05:17 +02:00
|
|
|
|
/*
|
|
|
|
|
|
* Mode Liste
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
2006-08-05 18:44:43 +02:00
|
|
|
|
|
|
|
|
|
|
llxHeader();
|
2003-06-30 18:05:17 +02:00
|
|
|
|
|
2013-03-09 20:34:38 +01:00
|
|
|
|
$sql = "SELECT s.nom, s.rowid as socid, c.lastname, c.firstname, a.label, n.rowid";
|
2011-06-04 20:49:45 +02:00
|
|
|
|
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
|
|
|
|
|
|
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
|
|
|
|
|
$sql.= " ".MAIN_DB_PREFIX."notify_def as n,";
|
|
|
|
|
|
$sql.= " ".MAIN_DB_PREFIX."societe as s";
|
|
|
|
|
|
$sql.= " WHERE n.fk_contact = c.rowid";
|
|
|
|
|
|
$sql.= " AND a.rowid = n.fk_action";
|
|
|
|
|
|
$sql.= " AND n.fk_soc = s.rowid";
|
2012-02-01 11:32:55 +01:00
|
|
|
|
$sql.= " AND s.entity IN (".getEntity('societe', 1).")";
|
2011-06-04 20:49:45 +02:00
|
|
|
|
if ($socid > 0) $sql.= " AND s.rowid = " . $user->societe_id;
|
|
|
|
|
|
|
|
|
|
|
|
$sql.= $db->order($sortfield,$sortorder);
|
|
|
|
|
|
$sql.= $db->plimit($conf->liste_limit, $offset);
|
2003-06-30 18:05:17 +02:00
|
|
|
|
|
|
|
|
|
|
$result = $db->query($sql);
|
|
|
|
|
|
if ($result)
|
|
|
|
|
|
{
|
2006-08-05 18:44:43 +02:00
|
|
|
|
$num = $db->num_rows($result);
|
|
|
|
|
|
$i = 0;
|
2009-10-19 21:54:27 +02:00
|
|
|
|
|
2006-08-05 18:44:43 +02:00
|
|
|
|
$paramlist='';
|
|
|
|
|
|
print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, "index.php", $paramlist, $sortfield,$sortorder,'',$num);
|
2009-10-19 21:54:27 +02:00
|
|
|
|
|
2006-08-05 18:44:43 +02:00
|
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
|
|
|
print '<tr class="liste_titre">';
|
2007-11-11 16:55:45 +01:00
|
|
|
|
print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","",'valign="center"',$sortfield,$sortorder);
|
2013-03-09 20:34:38 +01:00
|
|
|
|
print_liste_field_titre($langs->trans("Contact"),"index.php","c.lastname","","",'valign="center"',$sortfield,$sortorder);
|
2007-11-11 16:55:45 +01:00
|
|
|
|
print_liste_field_titre($langs->trans("Action"),"index.php","a.titre","","",'valign="center"',$sortfield,$sortorder);
|
2006-08-05 18:44:43 +02:00
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
$var=True;
|
|
|
|
|
|
while ($i < $num)
|
|
|
|
|
|
{
|
|
|
|
|
|
$obj = $db->fetch_object($result);
|
2009-10-19 21:54:27 +02:00
|
|
|
|
|
2006-08-05 18:44:43 +02:00
|
|
|
|
$var=!$var;
|
2009-10-19 21:54:27 +02:00
|
|
|
|
|
2013-03-11 15:54:01 +01:00
|
|
|
|
print "<tr ".$bc[$var].">";
|
|
|
|
|
|
print "<td><a href=\"fiche.php?socid=".$obj->socid."\">".$obj->nom."</a></td>\n";
|
|
|
|
|
|
print "<td>".dolGetFirstLastname($obj->firstname, $obj->lastname)."</td>\n";
|
2006-08-05 18:44:43 +02:00
|
|
|
|
print "<td>".$obj->titre."</td>\n";
|
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
}
|
|
|
|
|
|
print "</table>";
|
|
|
|
|
|
$db->free();
|
2003-06-30 18:05:17 +02:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2009-02-20 23:53:15 +01:00
|
|
|
|
dol_print_error($db);
|
2003-06-30 18:05:17 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-27 16:24:16 +02:00
|
|
|
|
llxFooter();
|
2013-03-11 15:54:01 +01:00
|
|
|
|
$db->close();
|
2003-06-30 18:05:17 +02:00
|
|
|
|
?>
|