]> _ Git - cubeextranet.git/commitdiff
done #947 @1.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 16 Nov 2016 17:25:27 +0000 (17:25 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 16 Nov 2016 17:25:27 +0000 (17:25 +0000)
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/class.ws.links.php

index a5edbd5955a3faf840fffb9d161c17ecb970e65a..d275cbd046cbb0a1e74f3a72640f64697e193125 100644 (file)
@@ -298,7 +298,7 @@ class wsDAOBook extends commonDAO {
        }
 
        public function getPagesOfBookAt($book_id, $time) {
-               $r = $this->con->select('SELECT * FROM book_pages_versions WHERE book_id=\'' . $this->con->escape($book_id) . '\' ORDER BY `update`');
+               $r = $this->con->select('SELECT * FROM book_pages_versions WHERE book_id=\'' . $this->con->escape($book_id) . '\' ORDER BY `update` ASC');
                if (!$r->count()) {
                        return $this->getPagesOfBook($book_id);
                }
@@ -309,9 +309,11 @@ class wsDAOBook extends commonDAO {
                        }
                        return $pages;
                }
+
                $pages = null;
                while ($r->fetch()) {
                        if ($r->update > $time) {
+
                                if (is_null($pages)) {
                                        return $this->getPagesOfBook($book_id);
                                }
@@ -319,9 +321,14 @@ class wsDAOBook extends commonDAO {
                                if (null === $res || !count($res)) {
                                        return $this->getPagesOfBook($book_id);
                                }
+                               return $res;
+                       }
+                       if (!count(unserialize($r->composition))) {
+                               continue;
                        }
                        $pages = $r->composition;
                }
+
                $res = unserialize($pages);
                if (null === $res || !count($res)) {
                        return $this->getPagesOfBook($book_id);
index 4b493392c7a66d48fc922e2626a4fdd433743dec..950f1fe361243e741d43e5d7b4dba2add56ff459 100644 (file)
@@ -209,7 +209,6 @@ class wsLinks {
                $daoBook = new wsDAOBook($core->con);
                $pages = $daoBook->getPagesOfBookAt($book_id, $time);
 
-
                foreach ($pages as $p => $infos) {
                        $documents[] = $infos['document_id'];
                }
@@ -222,7 +221,7 @@ class wsLinks {
                $rulers = array();
 
                foreach ($documents as $d) {
-                       echo $d."\n";
+                       echo $d . "\n";
                        if (is_null($time)) {
                                $lr = self::getDocumentLastLinks($d);
                        } else {