From 30fb057bd33dc02cc86d766401e2a431bde9df12 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 14 Mar 2011 18:31:08 +0000 Subject: [PATCH] --- inc/ws/Controlleur/_common.php | 1 + inc/ws/Controlleur/class.ws.maintenance.php | 40 +++++++++++++++++++++ inc/ws/DAO/class.ws.dao.document.php | 3 ++ inc/ws/DAO/class.ws.dao.theme.php | 3 ++ inc/ws/_common.php | 1 + 5 files changed, 48 insertions(+) create mode 100644 inc/ws/Controlleur/class.ws.maintenance.php diff --git a/inc/ws/Controlleur/_common.php b/inc/ws/Controlleur/_common.php index 551049511..43fe49fd3 100644 --- a/inc/ws/Controlleur/_common.php +++ b/inc/ws/Controlleur/_common.php @@ -10,5 +10,6 @@ $__autoload['wsStats'] = dirname(__FILE__) . '/class.ws.stats.php'; $__autoload['wsServices'] = dirname(__FILE__) . '/class.ws.services.php'; $__autoload['wsUsersTree'] = dirname(__FILE__) . '/class.ws.users.tree.php'; $__autoload['wsSecureSWF'] = dirname(__FILE__) . '/class.ws.secure.swf.php'; +$__autoload['wsMaintenance'] = dirname(__FILE__) . '/class.ws.maintenance.php'; ?> \ No newline at end of file diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php new file mode 100644 index 000000000..ccb6669a2 --- /dev/null +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -0,0 +1,40 @@ +con->select('SELECT MAX(book_id) FROM books WHERE book<10000'); + $lastImported = $r->book_id; + // On recherche maintenant les fluidbook dans la vieille base + $r = $core->con->select('SELECT bid FROM ws.book WHERE bid>' . $r->book_id); + $oldBooks = array(); + while ($r->fetch()) { + $oldBooks[] = $r->bid; + } + // On cherche maintenant à savoir si l'on doit importer de nouveaux documents associés + $oldDocuments = array(); + $r = $core->con->select('SELECT DISTINCT did FROM ws.book_pages WHERE bid IN(' . implode(',', $oldBooks) . ')'); + while ($r->fetch()) { + $oldDocument[] = $r->did; + } + } + + public function importOldBook($r) + { + } +} + +?> \ No newline at end of file diff --git a/inc/ws/DAO/class.ws.dao.document.php b/inc/ws/DAO/class.ws.dao.document.php index 2284f7e09..9b2bf4c4f 100644 --- a/inc/ws/DAO/class.ws.dao.document.php +++ b/inc/ws/DAO/class.ws.dao.document.php @@ -259,6 +259,9 @@ class wsDAODocument extends commonDAO { public function getNextId() { $r = $this->con->select('SELECT MAX(document_id) AS document_id FROM documents'); + if ($r->document_id < 100000) { + return 100000; + } return $r->document_id + 1; } diff --git a/inc/ws/DAO/class.ws.dao.theme.php b/inc/ws/DAO/class.ws.dao.theme.php index 5180e1f45..ab336a025 100644 --- a/inc/ws/DAO/class.ws.dao.theme.php +++ b/inc/ws/DAO/class.ws.dao.theme.php @@ -29,6 +29,9 @@ class wsDAOTheme extends commonDAO { public function selectById($theme_id, $table = 'themes_vue') { $r = $this->con->select('SELECT * FROM ' . $table . ' WHERE theme_id=\'' . $this->con->escape($theme_id) . '\' LIMIT 1'); + if ($r->theme_id < 1000) { + return 1000; + } return $this->singleton($r); } diff --git a/inc/ws/_common.php b/inc/ws/_common.php index da8679da7..c8c7ba435 100644 --- a/inc/ws/_common.php +++ b/inc/ws/_common.php @@ -8,6 +8,7 @@ $GLOBALS['ajaxClasses'][] = 'wsAjax'; $core->url->register('flash', 'flash', '^flash(.*)$', array('wsFlash', 'in')); $core->url->register('services', 'services', '^services(.*)$', array('wsServices', 'in')); +$core->url->register('maintenance', 'maintenance', '^maintenance(.*)$', array('wsMaintenance', 'in')); $core->url->register('editor', 'editor', '^editor/(.*)$', array('wsUrl', 'editor')); $core->url->register('viewer', 'viewer', '^viewer/(.*)$', array('wsUrl', 'viewer')); $core->url->register('vieweru', 'vieweru', '^vieweru/(.*)$', array('wsUrl', 'vieweru')); -- 2.39.5