]> _ Git - cubeextranet.git/commitdiff
wip #5701 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 30 Jan 2023 17:58:22 +0000 (17:58 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 30 Jan 2023 17:58:22 +0000 (17:58 +0000)
.docker/docker-compose.yml
inc/commons/class.common.core.php
inc/ws/Controlleur/class.ws.ajax.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Metier/class.ws.book.php

index 24ccfd3d7f4324d43840cd80e1ab768d909a3bfc..d1839f0776792eafff836a83a0c55f2ddf7f6e03 100644 (file)
@@ -11,6 +11,7 @@ services:
       - '/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
@@ -51,6 +52,7 @@ services:
       - '/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
@@ -127,6 +129,7 @@ services:
       - '/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
index c93ec2e9bddbeb887d78e2d355a702807619aa80..7c6a354f50793eaf458c4331461c71326b848b72 100644 (file)
@@ -351,6 +351,7 @@ class commonCore extends cubeCore
         $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
index 91f0e0541c8e198243d68ecd93a6c28da2511b0f..44efcc8975f91c9b547f84096cb9275304afc3b4 100644 (file)
@@ -206,10 +206,10 @@ class wsAjax extends cubeAjax
         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();
index 46e041fed1c32e3ae99067012d4019a686b06ba5..3617cb34eabce3bbf8ed71758ea349a68d16eee1 100644 (file)
@@ -1279,6 +1279,7 @@ html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-co
         $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;
index 77af6d8b0f24cd92950d048072f08bea4e3e4f9a..0d8a9d35481eb73f5e77829ebc906ac0ee5bbd64 100644 (file)
@@ -71,6 +71,7 @@ class wsDAOBook extends commonDAO
         $book->composition_update = $r->composition_update;
         $book->demo_counter = $r->demo_counter;
         $book->exportdatas = $r->exportdatas;
+        $book->region = $r->region;
 
 
         return $book;
@@ -82,6 +83,7 @@ class wsDAOBook extends commonDAO
         $book->book_id = 'new';
         $book->nom = '';
         $book->cid = null;
+        $book->region = 'UE';
         $book->lang = 'fr';
         $book->theme = 1;
         $book->proprietaire = '';
@@ -241,8 +243,17 @@ class wsDAOBook extends commonDAO
         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;
@@ -278,7 +289,8 @@ class wsDAOBook extends commonDAO
         $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;
@@ -295,8 +307,13 @@ class wsDAOBook extends commonDAO
         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);
@@ -318,7 +335,8 @@ class wsDAOBook extends commonDAO
         $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);
     }
index 47bb27bde28ae58134d1b9ea02041c22bc1dcd81..15cbbc395eec755cd9743f31272a202c56e1cd96 100644 (file)
@@ -6,6 +6,7 @@ class wsBook extends cubeMetier
     protected $book_id;\r
     protected $cid;\r
     protected $nom;\r
+    protected $region;\r
     protected $lang;\r
     protected $theme;\r
     protected $proprietaire;\r