From: vincent@cubedesigners.com Date: Tue, 29 Mar 2011 09:35:23 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3eb40d7f1affe0bf791b3b1a055f55867d4ffed4;p=cubeextranet.git --- diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 5197d2e94..7896195b2 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -178,9 +178,16 @@ class wsDAOBook extends commonDAO { public function count($limitedToUserRights = false) { - $where = '(' . $this->makeWhereFromFiltres() . ')'; + $filters = $this->makeWhereFromFiltres(); + if ($filters == '1=1') { + $table = 'books'; + } else { + $table = 'books_vue'; + } + + $where = '(' . $filters . ')'; $where .= $this->limitToUserRights($limitedToUserRights); - $r = $this->con->select('SELECT COUNT(*) AS nb FROM books_vue WHERE ' . $where); + $r = $this->con->select('SELECT COUNT(*) AS nb FROM ' . $table . ' WHERE ' . $where); return $r->nb; }