- '/home/extranet/www/:/application/'\r
- '/home/extranet/share:/application/share'\r
- '/mnt/sshfs/godzilla/data/fluidbook/docs/:/application/fluidbook/docs/'\r
+ - '/mnt/sshfs/kingkong/:/application/usstorage/'\r
- '/home/toolbox/www/resources/fluidbookpublication/player:/application/fluidbook/compile/player'\r
- '/data/extranet/www/fluidbook/books/audiodescription:/application/fluidbook/books/audiodescription'\r
- '/data/extranet/www/fluidbook/books/index:/application/fluidbook/books/index'\r
- '/home/extranet/www/:/application/'\r
- '/home/extranet/share:/application/share'\r
- '/mnt/sshfs/godzilla/data/fluidbook/docs/:/application/fluidbook/docs/'\r
+ - '/mnt/sshfs/kingkong/:/application/usstorage/'\r
- '/home/toolbox/www/resources/fluidbookpublication/player:/application/fluidbook/compile/player'\r
- '/data/extranet/www/fluidbook/books/audiodescription:/application/fluidbook/books/audiodescription'\r
- '/data/extranet/www/fluidbook/books/index:/application/fluidbook/books/index'\r
- '/home/extranet/www/:/application/'\r
- '/home/extranet/share:/application/share'\r
- '/mnt/sshfs/godzilla/data/fluidbook/docs/:/application/fluidbook/docs/'\r
+ - '/mnt/sshfs/kingkong/:/application/usstorage/'\r
- '/home/toolbox/www/resources/fluidbookpublication/player:/application/fluidbook/compile/player'\r
- '/data/extranet/www/fluidbook/books/audiodescription:/application/fluidbook/books/audiodescription'\r
- '/data/extranet/www/fluidbook/books/index:/application/fluidbook/books/index'\r
$db->books->book_id('integer', 0, false);\r
$db->books->cid('varchar', 8, false);\r
$db->books->nom('varchar', 256, false);\r
+ $db->books->region('varchar', 2, false, '"UE"');\r
$db->books->lang('varchar', 20, false);\r
$db->books->theme('integer', 0, false);\r
$db->books->proprietaire('integer', 0, false);\r
global $core;
$dao = new wsDAOBook($core->con);
if ($_POST['book'] != '') {
- $book = $dao->duplicate($_POST['book'], $core->user->utilisateur_id, $_POST['title'], isset($_POST['pages']));
+ $book = $dao->duplicate($_POST['book'], $core->user->utilisateur_id, $_POST['title'], isset($_POST['pages']), false, $_POST['region']);
wsMaintenance::copyLinks([$_POST['book'], $book->book_id]);
} else {
- $book = $dao->creeEmpty($core->user->utilisateur_id, $core->user->lang, $_POST['title']);
+ $book = $dao->creeEmpty($core->user->utilisateur_id, $core->user->lang, $_POST['title'], $_POST['region']);
}
$x->addClosePopup();
$res = '<tr><td colspan="2"><p style="width:600px;text-align:justify;"><em>a' . __("Si votre nouvelle publication a des paramètres en commun avec une publication existante, veuillez rechercher cette publication afin d'attribuer par défaut à votre nouvelle publication les paramètres de l'existante") . '</em></p></td></tr>';
$res .= '<tr><td>' . __('Rechercher une publication') . ' : </td><td>' . form::field('book_nom', 64, 1024) . form::hidden('book', '') . '</td></tr>';
$res .= '<tr><td>' . __('Indiquez le titre de votre nouvelle publication') . '</td><td>' . form::field('title', 64, 1024) . '</td></tr>';
+ $res .= '<tr><td>' . __('Région d\'hébergement des données') . '</td><td>' . form::combo('region', [__('Union européenne') => 'UE', __('USA') => 'US'], "UE") . '</td></tr>';
$res .= '<tr><td colspan="2"><label>' . form::checkbox('settings', '1', true, '', '', true, '') . __('Importer les paramètres de la publication') . '</td></tr>';
$res .= '<tr><td colspan="2"><label>' . form::checkbox('pages', '1', false) . __('Importer les pages et les liens') . '</td></tr>';
return $res;
$book->composition_update = $r->composition_update;
$book->demo_counter = $r->demo_counter;
$book->exportdatas = $r->exportdatas;
+ $book->region = $r->region;
return $book;
$book->book_id = 'new';
$book->nom = '';
$book->cid = null;
+ $book->region = 'UE';
$book->lang = 'fr';
$book->theme = 1;
$book->proprietaire = '';
return $this->selectById($book_id);
}
- public function duplicate($book_id, $createur, $nom = null, $pages = false, $complete = false)
+ public function initUSStorage($book_id){
+
+ }
+
+ public function duplicate($book_id, $createur, $nom = null, $pages = false, $complete = false, $region = 'UE')
{
+ $nextId = $this->getNextId();
+ if ($region === 'US') {
+ $this->initUSStorage($nextId);
+ }
+
$r = $this->con->select('SELECT * FROM books_vue WHERE book_id=\'' . $this->con->escape($book_id) . '\'');
$old_id = $book_id;
$c->specialLinks = $r->specialLinks;
$c->specialRulers = $r->specialRulers;
$c->composition_update = TIME;
- $book_id = $c->book_id = $this->getNextId();
+ $c->region = $region;
+ $book_id = $c->book_id = $nextId;
if ($pages) {
$c->numerotation = $r->numerotation;
$c->chapters = $r->chapters;
return $this->selectById($book_id);
}
- public function creeEmpty($createur, $lang, $nom)
+ public function creeEmpty($createur, $lang, $nom, $region)
{
+ $nextId = $this->getNextId();
+ if ($region === 'US') {
+ $this->initUSStorage($nextId);
+ }
+
$c = $this->con->openCursor('books');
$parametres = new wsBookParametres($this);
$c->compiledate = 0;
$c->version = 2;
$c->composition_update = TIME;
- $book_id = $c->book_id = $this->getNextId();
+ $c->region = $region;
+ $book_id = $c->book_id = $nextId;
$c->insert();
return $this->selectById($book_id);
}
protected $book_id;\r
protected $cid;\r
protected $nom;\r
+ protected $region;\r
protected $lang;\r
protected $theme;\r
protected $proprietaire;\r