Fix: les bookmarks étaient encore visible lorsque le module était désactivé

This commit is contained in:
Regis Houssin 2007-04-05 07:11:17 +00:00
parent ac79749abd
commit 2396455da7
2 changed files with 30 additions and 24 deletions

View File

@ -231,20 +231,22 @@ if ($conf->commande->enabled)
* Bookmark * Bookmark
* *
*/ */
$sql = "SELECT s.idp, s.nom,b.rowid as bid"; if ($conf->bookmark->enabled)
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."bookmark as b"; {
$sql .= " WHERE b.fk_soc = s.idp AND b.fk_user = ".$user->id; $sql = "SELECT s.idp, s.nom,b.rowid as bid";
if ($socid) $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."bookmark as b";
{ $sql .= " WHERE b.fk_soc = s.idp AND b.fk_user = ".$user->id;
$sql .= " AND s.idp = $socid"; if ($socid)
} {
$sql .= " ORDER BY lower(s.nom) ASC"; $sql .= " AND s.idp = $socid";
}
$sql .= " ORDER BY lower(s.nom) ASC";
if ( $db->query($sql) ) if ( $db->query($sql) )
{ {
$num = $db->num_rows(); $num = $db->num_rows();
if ($num) if ($num)
{ {
$i = 0; $i = 0;
@ -256,19 +258,20 @@ if ( $db->query($sql) )
$var=true; $var=true;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object(); $obj = $db->fetch_object();
$var = !$var; $var = !$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td>'; print '<td><a href="fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td>';
print '<td align="right"><a href="index.php?action=del_bookmark&bid='.$obj->bid.'">'; print '<td align="right"><a href="index.php?action=del_bookmark&bid='.$obj->bid.'">';
print img_delete(); print img_delete();
print '</a></td>'; print '</a></td>';
print '</tr>'; print '</tr>';
$i++; $i++;
} }
print '</table>'; print '</table>';
} }
}
} }
print '</td><td valign="top" width="70%" class="notopnoleftnoright">'; print '</td><td valign="top" width="70%" class="notopnoleftnoright">';

View File

@ -2,7 +2,8 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com> * Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2005-2007 Regis Houssin <regis.houssin@cap-networks.com>
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
* *
* 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
@ -151,6 +152,8 @@ class Conf
// Module bookmark4u // Module bookmark4u
$this->bookmark4u->enabled=defined('MAIN_MODULE_BOOKMARK4U')?MAIN_MODULE_BOOKMARK4U:0; $this->bookmark4u->enabled=defined('MAIN_MODULE_BOOKMARK4U')?MAIN_MODULE_BOOKMARK4U:0;
// Module bookmark
$this->bookmark->enabled=defined('MAIN_MODULE_BOOKMARK')?MAIN_MODULE_BOOKMARK:0; $this->bookmark->enabled=defined('MAIN_MODULE_BOOKMARK')?MAIN_MODULE_BOOKMARK:0;
// Module deplacement // Module deplacement