]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 29 Jun 2010 17:11:17 +0000 (17:11 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 29 Jun 2010 17:11:17 +0000 (17:11 +0000)
15 files changed:
inc/extranet/Controlleur/_common.php
inc/extranet/Controlleur/class.extranet.core.php
inc/extranet/Controlleur/class.extranet.url.php
inc/ws/Controlleur/class.ws.ajax.php
inc/ws/Controlleur/class.ws.flash.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/DAO/class.ws.dao.document.php
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Metier/class.ws.book.php
inc/ws/Metier/class.ws.theme.parametres.php
js/extranet.js
swf/_src/wsComposer.fla
swf/_src/wsComposerComponents.fla
swf/_src/wsComposerComponents.swc

index 59eb149de790df95cf432f851b3e788846d0cfe2..04d56d838b5fcf4253a7dfc1037f92be9540bdf2 100644 (file)
@@ -7,10 +7,5 @@ $__autoload['extranetUrl'] = dirname(__FILE__) . '/class.extranet.url.php';
 $__autoload['extranetDroits'] = dirname(__FILE__) . '/class.extranet.droits.php';\r
 $__autoload['extranetFiltre'] = dirname(__FILE__) . '/class.extranet.filtre.php';\r
 $__autoload['extranetPageChiffres'] = dirname(__FILE__) . '/class.extranet.page.chiffres.php';\r
-// Workshop\r
-$__autoload['wsFlash'] = dirname(__FILE__) . '/class.ws.flash.php';\r
-$__autoload['wsUrl'] = dirname(__FILE__) . '/class.ws.url.php';\r
-$__autoload['wsDroits'] = dirname(__FILE__) . '/class.ws.droits.php';\r
-$__autoload['wsConversionSession'] = dirname(__FILE__) . '/class.ws.conversion.session.php';\r
 \r
 ?>
\ No newline at end of file
index 4ed8c29dc3b95012726961d347e2ddee9b3ff78d..b5bbf761856546857e9c468bd03af63a2092fca4 100644 (file)
@@ -345,6 +345,7 @@ class extranetCore extends cubeCore {
                $db->books->extras('text', 0, false);\r
                $db->books->traductions('text', 0, false);\r
                $db->books->date('integer', 0, false);\r
+               $db->books->numerotation('text',0,false);\r
                // Clés\r
                $db->books->primary('pk_books', 'book_id');\r
                $db->books->index('index_books_nom', 'BTREE', 'nom');\r
index 20b78c5262be71c75004eec70de22d8228e8f95e..797c71eca2b55b0b7f19b6e3728474ddbd39eb90 100644 (file)
@@ -1132,7 +1132,7 @@ class extranetUrl {
                $res .= '<table>';\r
                $res .= '<tr><td>' . __('De') . '</td><td>' . $core->user->prenom . ' ' . $core->user->nom . ' &lt;' . $core->user->email . '&gt;</td></tr>';\r
                $res .= '<tr><td>' . __('Sujet') . '</td><td>' . form::field(array('email[sujet]'), 80, 128, htmlspecialchars($devis->email['sujet'], ENT_QUOTES)) . '</td></tr>';\r
-               $res .= '<tr><td>' . __('Corps') . '</td><td>' . form::textarea(array('email[corps]'),80, 20, $devis->email['corps']) . '</td></tr>';\r
+               $res .= '<tr><td>' . __('Corps') . '</td><td>' . form::textarea(array('email[corps]'), 80, 20, $devis->email['corps']) . '</td></tr>';\r
                $res .= '</table>';\r
                $res .= '</div>';\r
                $res .= '<div class="right"><a href="#" class="submit">' . $core->typo->BoutonOK('Enregistrer et prévisualiser') . '</a></div>';\r
@@ -1766,6 +1766,13 @@ class extranetUrl {
                        foreach($projets as $projet) {\r
                                $suggestions[] = $projet->projet_id . ' - ' . $projet->nom . ' (' . $projet->client . ')';\r
                        }\r
+               } elseif ($args[1] == 'book') {\r
+                       $dao = new wsDAOBook($core->con);\r
+                       $dao->setSearch($q, true);\r
+                       $books = $dao->getListe('date','DESC',15);\r
+                       foreach($books as $book) {\r
+                               $suggestions[] = $book->book_id . ' - ' . $book->nom;\r
+                       }\r
                }\r
                cubeSearch::searchSuggestion($args[2], $suggestions);\r
                exit;\r
index 7d012cde432bcb4096aa1e688622219965d56628..019746d48e547a9b530b9140294353a9d15994af 100644 (file)
@@ -32,6 +32,11 @@ class wsAjax extends cubeAjax {
                $x->addContent('listeBooks', wsUrl::listeBooks());\r
        }\r
 \r
+       public static function newBookForm($args, &$x)\r
+       {\r
+               extranetAjax::form('newBook', __("Créer une nouvelle publication à partir d'une existante"), wsUrl::chooseExistingBook(), __('Créer une nouvelle publication'), 3);\r
+       }\r
+\r
        public static function filtreBooks($args, &$x)\r
        {\r
                if (isset($args[1]) && $args[1] == 'efface') {\r
@@ -43,6 +48,20 @@ class wsAjax extends cubeAjax {
                        $x->addContent('listeBooks', wsUrl::listeBooks());\r
                }\r
        }\r
+\r
+       public static function newBook($args, &$x)\r
+       {\r
+               global $core;\r
+               $dao = new wsDAOBook($core->con);\r
+               if ($_POST['book'] != '') {\r
+                       $book = $dao->duplicate($_POST['book'], $core->user->utilisateur_id);\r
+               } else {\r
+                       $book = $dao->creeEmpty($core->user->utilisateur_id, $core->user->lang);\r
+               }\r
+               $x->addClosePopup();\r
+               $x->addContent('listeBooks', wsUrl::listeBooks());\r
+               $x->addTruePopup(SITE_PATH . 'editbook/' . $book->book_id);\r
+       }\r
 }\r
 \r
 ?>
\ No newline at end of file
index 5ad56eb5815274aa73f5dc9b0c0e53289c90d55f..058116499ae412d1376ddcfb9d330dcad78191c6 100644 (file)
@@ -25,7 +25,7 @@ class wsFlash extends cubeFlashGateway {
                        $data['proprietaire'] = $core->user->utilisateur_id;\r
                        $data['pages'] = 0;\r
                        $data['file'] = cubeFiles::tidyName($infos['name']);\r
-                       $li = new wsDocumentLocalInfos();\r
+                       $li = new wsDocumentLocalInfos($this);\r
                        $li->fileName = $this->args['fileName'];\r
                        $li->fileSize = $this->args['fileSize'];\r
                        $li->creationDate = $this->args['creationDate'];\r
@@ -84,6 +84,7 @@ class wsFlash extends cubeFlashGateway {
        {\r
                global $core;\r
                $dao = new wsDAOBook($core->con);\r
+               $book=$dao->selectById($this->args['book_id']);\r
                $pages = $dao->getPagesOfBook($this->args['book_id']);\r
                $p = $this->xml->addChild('pages');\r
                $docs = array();\r
@@ -100,6 +101,7 @@ class wsFlash extends cubeFlashGateway {
                }\r
                $docs = array_unique($docs);\r
                $p->addAttribute('documents', implode(',', $docs));\r
+               $this->xml->addChild('numerotation',json_encode($book->numerotation));\r
        }\r
 \r
        public function processConversionSession()\r
index 98ef30a4625c8634201951a71f8d8172e67fb97e..38476e8e95846451a11e9877edc8eb962943ddab 100644 (file)
@@ -7,7 +7,7 @@ class wsUrl {
                $settings = $core->user->getSettings('books');\r
 \r
                $shortcuts = array();\r
-               $shortcuts[] = '<a class="popupFS" href="' . SITE_PATH . 'editbook/new">' . $core->typo->Ajouter(__('Créer une nouvelle publication')) . '</a>';\r
+               $shortcuts[] = '<a class="popup" rel="newBookForm">' . $core->typo->Ajouter(__('Créer une nouvelle publication')) . '</a>';\r
 \r
                $filtres = array();\r
                $filtres[] = new extranetFiltre(__('Status'), 'status_book', $settings['filtres']);\r
@@ -27,6 +27,8 @@ class wsUrl {
        {\r
                global $core;\r
                cubePage::truePopup();\r
+               cubePage::autocomplete();\r
+\r
                extranetDroits::min(1);\r
                $settings = is_null($settings)?$core->user->getSettings('books'):$settings;\r
                $change = is_null($dashboard)?'Books':'Dashboard/' . $dashboard;\r
@@ -79,76 +81,42 @@ class wsUrl {
        public static function editbook($args)\r
        {\r
                global $core;\r
+\r
                $args = cubePage::getArgs($args);\r
                $book_id = $args[0];\r
 \r
                if ($book_id == 'new') {\r
                        $dao = new wsDAOBook($core->con);\r
-                       $book = $dao->creeEmpty($core->user->utilisateur_id,$core->user->lang);\r
+                       $book = $dao->creeEmpty($core->user->utilisateur_id, $core->user->lang);\r
                        http::redirect(SITE_PATH . 'editbook/' . $book->book_id);\r
                }\r
 \r
-               /*$step = isset($args[2])?$args[2]:1;\r
-\r
-               $shortcuts = array();\r
-\r
-               $steps = array();\r
-               $steps['composition'] = __('Composition');\r
-               $steps['themeSelector'] = __('Personnalisation');\r
-               $steps['settings'] = __('Paramètres');\r
-               $steps['links'] = __('Edition des liens');\r
-               $steps['preview'] = __('Aperçu');\r
-\r
-               $i = 1;\r
-               foreach($steps as $s => $n) {\r
-                       $template = 'Step';\r
-                       if ($s == $step) {\r
-                               $class = 'step active';\r
-                               $ae = $as = '';\r
-                       } else {\r
-                               $class = 'step';\r
-                               $as = '<a href="' . SITE_PATH . 'editbook/' . $book_id . '/#/' . $s . '">';\r
-                               $ae = '</a>';\r
-                       }\r
-\r
-                       if ($i == count($steps)) {\r
-                               $template = 'Last' . $template;\r
-                       }\r
-                       $shortcuts[] = $as . $core->typo->$template($i . '. ' . $n, $class, -1) . $ae;\r
-                       $i++;\r
-               }*/\r
-\r
-               /*$res = extranetPage::barre(null , null, null, null);\r
-               $res .= extranetPage::tMain(null, true);\r
-               $res .= extranetPage::bh();*/\r
                $res = '<html><head><style type="text/css">';\r
                $res .= '#composerSwf{width:100%;height:100%;margin:0 auto;}\r
 body{margin:0;padding:0;height:100%;overflow:hidden;background:#d2d3c7;}\r
 html{height:100%}' . "\n";\r
                $res .= '</style>';\r
-               $res .= '<title>' . __('Edition de la publication') . ' #' . $args[0].'</title>';\r
+               $res .= '<title>' . __('Edition de la publication') . ' #' . $args[0] . '</title>';\r
                $res .= '</head>';\r
                $res .= '<body>';\r
                $res .= self::editComposition($args);\r
                $res .= '</body>';\r
                $res .= '</html>';\r
-               /*\r
-               $res .= extranetPage::bf();\r
-               $res .= extranetPage::bMain();*/\r
                echo $res;\r
        }\r
 \r
        public static function editComposition($args)\r
        {\r
                $fv = array(session_name() => session_id(),\r
-                       'book_id' => $args[0],\r
-                       'finishedText' => __('Transfert terminé'),\r
-                       'loadingFileText' => __('Chargement du fichier'),\r
-                       'totalText' => __('Total'),\r
-                       'browseText' => __('Parcourir') . ' ...',\r
-                       'titreUpload' => __('Sélectionnez un ou plusieurs document PDF sur votre ordinateur'),\r
-                       'titreComposition' => __('Organisez le(s) document(s) pour composer votre fluidbook'));\r
-               $res = cubeMedia::flash(WEBROOT . '/swf/composer.swf?junk=' . TIME, '100%', '100%', $fv, 'composerSwf', 'swfPanel', 9, '#d2d3c7', '', 'false', 'noscale', 'normal', array(), false, true, true);\r
+                       'book_id' => $args[0]);\r
+               $res = cubeMedia::flash(WEBROOT . '/swf/composer.swf?junk=' . TIME, '100%', '100%', $fv, 'composerSwf', 'swfPanel', 10, '#d2d3c7', '', 'false', 'noscale', 'normal', array(), false, true, true);\r
+               return $res;\r
+       }\r
+\r
+       public static function chooseExistingBook()\r
+       {\r
+               $res = '<tr><td colspan="2"><p style="width:600px;text-align:justify;"><em>' . __("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>';\r
+               $res .= '<tr><td>' . __('Rechercher une publication') . ' : </td><td>' . form::field('book_nom', 64, 1024) . form::hidden('book', '') . '</td></tr>';\r
                return $res;\r
        }\r
 }\r
index 3225d6a55430fbaa6e8906cd89f188c390899610..4e891f317a3fdd7eea250abbc41b8c7a35c8a28f 100644 (file)
@@ -17,39 +17,13 @@ class wsDAOBook extends extranetDAO {
                $book->date_status = $r->date_status;\r
                $book->date = $r->date;\r
                $book->pages = array();\r
-               if ($r->chapters == '') {\r
-                       $book->chapters = array();\r
-               } else {\r
-                       $book->chapters = json_decode($r->chapters, false);\r
-               }\r
-\r
+               $book->chapters = $r->chapters;\r
+               $book->links = $r->links;\r
+               $book->rulers = $r->rulers;\r
+               $book->traductions = $r->traductions;\r
+               $book->parametres = $r->parametres;\r
                $book->extras = $r->extras;\r
-\r
-               if ($r->links == '') {\r
-                       $book->links = $this->getLinksFromCSV($r->book_id);\r
-               } else {\r
-                       $book->links = json_decode($r->links, false);\r
-               }\r
-\r
-               if ($r->rulers == '') {\r
-                       $book->rulers = array();\r
-               } else {\r
-                       $book->rulers = json_decode($r->rulers, false);\r
-               }\r
-\r
-               if ($r->traductions == '') {\r
-                       $book->traductions = array();\r
-               } else {\r
-                       $book->traductions = json_decode($r->traductions);\r
-               }\r
-\r
-               $p = unserialize($r->parametres);\r
-               if (!$p || $p->isEmpty()) {\r
-                       $p = new wsBookParametres($book);\r
-               } else {\r
-                       $p->setParent($book);\r
-               }\r
-               $book->parametres = $p;\r
+               $book->numerotation = $r->numerotation;\r
                return $book;\r
        }\r
 \r
@@ -130,6 +104,25 @@ class wsDAOBook extends extranetDAO {
                return $this->selectById($book_id);\r
        }\r
 \r
+       public function duplicate($book_id, $createur)\r
+       {\r
+               $r = $this->con->select('SELECT * FROM books_vue WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
+               $c = $this->con->openCursor('books');\r
+               $c->proprietaire = $createur;\r
+               $c->date = TIME;\r
+               $c->hash = md5(rand(0, 1234567893));\r
+               $c->compteur_visites = 20;\r
+               $c->status = -1;\r
+               $c->date_status = TIME;\r
+               $c->lang = $r->lang;\r
+               $c->parametres = $r->parametres;\r
+               $c->nom = $r->nom;\r
+               $c->theme = $r->theme;\r
+               $book_id = $c->book_id = $this->getNextId();\r
+               $c->insert();\r
+               return $this->selectById($book_id);\r
+       }\r
+\r
        public function creeEmpty($createur, $lang)\r
        {\r
                $c = $this->con->openCursor('books');\r
@@ -199,8 +192,11 @@ class wsDAOBook extends extranetDAO {
 \r
        public function insertDocument($book_id, $after_page, $document_id)\r
        {\r
+               // Obtiens le book\r
+               $book = $this->selectById($book_id);\r
+               $num = $book->numerotation;\r
                // Obtiens le nombre de pages\r
-               $r = $this->con->select('SELECT pages FROM documents WHERE document_id=\'' . $this->con->escape($document_id) . '\'');\r
+               $r = $this->con->select('SELECT pages,numberSections FROM documents WHERE document_id=\'' . $this->con->escape($document_id) . '\'');\r
                // Décale les pages vers le bas\r
                if ($after_page > 0) {\r
                        $this->decalePages($book_id, $after_page, $r->pages);\r
@@ -214,6 +210,15 @@ class wsDAOBook extends extranetDAO {
                        $c->book_page = $after_page + $i;\r
                        $c->insert();\r
                }\r
+               // Mets à jour la liste des numéros des pages\r
+               $before = array_slice($num, 0, $after_page);\r
+               $after = array_slice($num, $after_page, count($num) - $after_page);\r
+               $between = explode(',', $r->numberSections);\r
+               $num = array_merge($before, $between, $after);\r
+               // Mets à jour la numerotation de la publication\r
+               $c = $this->con->openCursor('books');\r
+               $c->numerotation = json_encode($num);\r
+               $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
        }\r
 \r
        protected function decalePages($book_id, $after_page, $decalage)\r
@@ -297,14 +302,13 @@ class wsDAOBook extends extranetDAO {
                $book = $this->selectById($book_id);\r
                $parametres = $book->parametres;\r
                $new = json_decode($settings, false);\r
-               fb($new);\r
                foreach($new as $k => $v) {\r
                        $parametres->$k = $v;\r
                }\r
                $c = $this->con->openCursor('books');\r
+               $c->nom = $parametres->title;\r
                $c->parametres = serialize($parametres);\r
                $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
-               fb($parametres);\r
        }\r
 \r
        public function getLinksFromCSV($book_id)\r
@@ -347,6 +351,11 @@ class wsDAOBook extends extranetDAO {
                }\r
                return $res;\r
        }\r
+\r
+       public function getNumerotationFromDocs()\r
+       {\r
+               $pages = $this->getPagesOfBook($book_id);\r
+       }\r
 }\r
 \r
 ?>
\ No newline at end of file
index 6f84c069347dbbea7776d4fea77187c8dc063560..4c3145b1fe5138bfd5a278b82ba6f210410191b8 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 class wsDAODocument extends extranetDAO {\r
-       public static $normal = array('document_id', 'file', 'proprietaire', 'pages', 'date');\r
-       public static $complex = array('localInfos', 'bookmarks', 'generalInfos', 'numberSections', 'trim');\r
+       public static $normal = array('document_id', 'file', 'proprietaire', 'pages', 'date', 'numberSections');\r
+       public static $complex = array('localInfos', 'bookmarks', 'generalInfos', 'trim');\r
 \r
        public function singleton($r)\r
        {\r
@@ -63,10 +63,14 @@ class wsDAODocument extends extranetDAO {
                $c = $this->con->openCursor('documents');\r
 \r
                foreach(self::$normal as $k) {\r
-                       $c->$k = $data[$k];\r
+                       if (isset($data[$k])) {\r
+                               $c->$k = $data[$k];\r
+                       }\r
                }\r
                foreach(self::$complex as $k) {\r
-                       $c->$k = serialize($data[$k]);\r
+                       if (isset($data[$k])) {\r
+                               $c->$k = serialize($data[$k]);\r
+                       }\r
                }\r
 \r
                if ($data['document_id'] == 'new') {\r
@@ -90,21 +94,6 @@ class wsDAODocument extends extranetDAO {
 \r
        public function updateFromObject($document)\r
        {\r
-               /*      protected $document_id;\r
-       protected $file;\r
-       protected $proprietaire;\r
-       protected $pages;\r
-       protected $trim;\r
-       protected $date;\r
-       protected $localInfos;\r
-       protected $generalInfos;\r
-       protected $bookmarks;\r
-       protected $numberSections;\r
-       protected $links;\r
-\r
-\r
-*/\r
-\r
                $data = array();\r
                foreach(self::$normal as $k) {\r
                        $data[$k] = $document->$k;\r
index cfb22b9df335fa4967b8dc1388595738d5694f7d..663a4360d83045b0c3febba582f5d1c60d430054 100644 (file)
@@ -13,7 +13,21 @@ class wsBookParametres extends wsParametres {
                }\r
                $this->fields['title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre de la publication"), 'extra' => false, 'grade' => 1);\r
                $this->forms['important'] = array('label' => __('Description de la publication'),\r
-                       'fieldsnames' => array('title', 'email_title', 'email_body', 'url_link'));\r
+                       'fieldsnames' => array('title', 'url_link'));\r
+               // .\r
+               // .\r
+               $this->fields['fonctions_friend'] = __('Fonction Envoyer à un ami et partage');\r
+               $this->fields['friend'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Envoyer à un ami'), 'extra' => false, 'grade' => 1);\r
+               $this->fields['email_title'] = array('type' => 'text', 'default' => __('%name% vous invite à découvrir %title%'), 'editable' => true, 'label' => __("Titre de l'email \"Envoyer à un ami\""), 'extra' => false, 'grade' => 1);\r
+               $this->fields['email_body'] = array('type' => 'textarea', 'default' => __('Veuillez cliquer sur le lien suivant : %link%'), 'editable' => true, 'label' => __("Corps de l'email \"Envoyer à un ami\""), 'extra' => false, 'grade' => 1);\r
+               $this->fields['email_editable'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Permettre au lecteur de modifier le corps de l'email"), 'extra' => false, 'grade' => 1);\r
+               $this->fields['askAcknowledge'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Demander au destinataire un accusé de réception"), 'extra' => true, 'grade' => 4);\r
+               $this->fields['attachPDFInEmail'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Joindre le fichier PDF de la page en cours à l'email"), 'extra' => true, 'grade' => 4);\r
+               $this->fields['attachmentName'] = array('type' => 'text', 'default' => '', 'editable' => false, 'label' => __('Nom de la pièce jointe'), 'extra' => true, 'grade' => 4);\r
+               $this->fields['addThis'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Identifiant addThis"), 'extra' => false, 'grade' => 4);\r
+               $this->fields['addThisOptions'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Paramètres addThis"), 'extra' => false, 'grade' => 4);\r
+               $this->forms['share'] = array('label' => __('Fonctions de partage'),\r
+                       'fieldsnames' => array('friend','email_title', 'email_body',  'email_editable', 'askAcknowledge', 'attachPDFInEmail', 'attachmentName', 'addThis', 'addThisOptions'));\r
                // .\r
                $this->fields['pages'] = array('type' => 'integer', 'default' => '', 'editable' => false, 'label' => __('Nombre de pages'), 'extra' => false, 'grade' => 0);\r
                $this->fields['width'] = array('type' => 'float', 'default' => '', 'editable' => false, 'label' => __('Largeur'), 'extra' => false, 'grade' => 0);\r
@@ -35,7 +49,7 @@ class wsBookParametres extends wsParametres {
                        'fieldsnames' => array('preload', 'reading_dir'));\r
                // .\r
                $this->fields['pdf'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Export PDF'), 'extra' => false, 'grade' => 1);\r
-               $this->fields['optimizepdf'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Optimiser le PDF'), 'extra' => false, 'grade' => 4);\r
+               $this->fields['optimizepdf'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Optimiser le PDF'), 'extra' => false, 'grade' => 4, 'hint' => "Permet de réduire la taille du document PDF");\r
                $this->fields['pdfComplex'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Export PDF avancé'), 'extra' => false, 'grade' => 3);\r
                $this->forms['pdf'] = array('label' => __('Fonction Export PDF'),\r
                        'fieldsnames' => array('pdf', 'optimizepdf', 'pdfComplex'));\r
@@ -46,19 +60,6 @@ class wsBookParametres extends wsParametres {
                $this->forms['zoom'] = array('label' => __('Zoom'),\r
                        'fieldsnames' => array('zoom', 'zoomw', 'fixedZoom'));\r
                // .\r
-               $this->fields['fonctions_friend'] = __('Fonction Envoyer à un ami et partage');\r
-               $this->fields['friend'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Envoyer à un ami'), 'extra' => false, 'grade' => 1);\r
-               $this->fields['email_title'] = array('type' => 'text', 'default' => __('%name% vous invite à découvrir %title%'), 'editable' => true, 'label' => __("Titre de l'email \"Envoyer à un ami\""), 'extra' => false, 'grade' => 1);\r
-               $this->fields['email_body'] = array('type' => 'textarea', 'default' => __('Veuillez cliquer sur le lien suivant : %link%'), 'editable' => true, 'label' => __("Corps de l'email \"Envoyer à un ami\""), 'extra' => false, 'grade' => 1);\r
-               $this->fields['email_editable'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Permettre au lecteur de modifier le corps de l'email"), 'extra' => false, 'grade' => 1);\r
-               $this->fields['askAcknowledge'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Demander au destinataire un accusé de réception"), 'extra' => true, 'grade' => 4);\r
-               $this->fields['attachPDFInEmail'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Joindre le fichier PDF de la page en cours à l'email"), 'extra' => true, 'grade' => 4);\r
-               $this->fields['attachmentName'] = array('type' => 'text', 'default' => '', 'editable' => false, 'label' => __('Nom de la pièce jointe'), 'extra' => true, 'grade' => 4);\r
-               $this->fields['addThis'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Identifiant addThis"), 'extra' => false, 'grade' => 4);\r
-               $this->fields['addThisOptions'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Paramètres addThis"), 'extra' => false, 'grade' => 4);\r
-               $this->forms['share'] = array('label' => __('Fonctions de partage'),\r
-                       'fieldsnames' => array('friend', 'email_editable', 'askAcknowledge', 'attachPDFInEmail', 'attachmentName', 'addThis', 'addThisOptions'));\r
-               // .\r
                $this->fields['fonctions_stats'] = __('Fonction Statistiques');\r
                $this->fields['stats'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Activer les statistiques'), 'extra' => false, 'grade' => 1);\r
                $this->fields['statsWeborama'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Statistiques Weborama'), 'size' => 10, 'extra' => true, 'grade' => 1);\r
index 45620231ad199418e1c351b4a4f711d503ebe6d3..e028b805d6a438eb4165c313b7eecfdf06583101 100644 (file)
@@ -30,6 +30,46 @@ class wsBook extends cubeMetier {
        protected $rulers;\r
        protected $extras;\r
        protected $traductions;\r
+       protected $numerotation;\r
+\r
+       public function __get($varname)\r
+       {\r
+               if (!property_exists($this, $varname)) {\r
+                       $msg = 'You are getting an attribute (' . get_class($this) . '::' . $varname . ') which not exists';\r
+                       trigger_error($msg, E_USER_ERROR);\r
+                       throw new Exception($msg);\r
+               }\r
+\r
+               $classic = array('chapters', 'links', 'rulers', 'traductions', 'numerotation');\r
+\r
+               if (in_array($varname, $classic)) {\r
+                       if (is_array($this->$varname)) {\r
+                               return $this->$varname;\r
+                       }\r
+                       if ($this->$varname == '') {\r
+                               $this->$varname = array();\r
+                       } else {\r
+                               $this->$varname = json_decode($this->$varname, false);\r
+                       }\r
+                       return $this->$varname;\r
+               }\r
+               if ($varname == 'parametres') {\r
+                       if ($this->parametres instanceof wsBookParametres) {\r
+                               return $this->parametres;\r
+                       }\r
+\r
+                       $p = unserialize($this->parametres);\r
+                       if (!$p || $p->isEmpty()) {\r
+                               $p = new wsBookParametres($this);\r
+                       } else {\r
+                               $p->setParent($this);\r
+                       }\r
+                       $this->parametres = $p;\r
+                       return $this->parametres;\r
+               }\r
+\r
+               return $this->$varname;\r
+       }\r
 }\r
 \r
 ?>
\ No newline at end of file
index 9460692737cab4ba44f702d8a85776ebac8906da..b6d51ac8553b6091250dc346e90660eddc2158ed 100644 (file)
@@ -70,7 +70,7 @@ class wsThemeParametres extends wsParametres {
                                __('Haut') => wsTheme::TOP,\r
                                __("Bas") => wsTheme::BOTTOM),\r
                        'default' => wsTheme::MIDDLE, 'editable' => true, 'label' => __('Alignement Vertical'), 'grade' => 3);\r
-               $this->fields['menuColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
+               $this->fields['menuColor'] = array('type' => 'couleurAlpha', 'default' => 'ffffffff', 'editable' => true,\r
                        'label' => __("Couleur du fond"), 'extra' => false, 'grade' => 3);\r
                $this->fields['shadeOnMenu'] = array('type' => 'boolean', 'default' => true, 'editable' => true,\r
                        'label' => __('Ombre portée sous la barre du menu'), 'extra' => true, 'grade' => 4);\r
index 23070c8592b669f18864dd51cc0c470ffba5e68e..0623ad71946e3aa039adad28f067c6800932dd59 100644 (file)
@@ -22,6 +22,15 @@ function load_extranet(){
                });\r
        }\r
 \r
+       if($("#book_nom").length){\r
+               $("#book_nom").autocomplete(SITE_PATH+'autocomplete/book',{\r
+                       cacheLength             :       0,\r
+                       maxItemsToShow  :       15,\r
+                       onFindValue             :       findBook,\r
+                       onItemSelect    :       findBook\r
+               });\r
+       }\r
+\r
        if($(".dashboard").length>=1 && $("#dash").length>=1){\r
                $("#dash").sortable('destroy');\r
                if(FIRST_LOAD){\r
@@ -206,6 +215,15 @@ function findProjet(li){
        });\r
 }\r
 \r
+function findBook(li){\r
+       var book=li.selectValue.split(' - ');\r
+       if(book.length<=1){\r
+               return;\r
+       }\r
+       var book_id=parseInt(book[0]);\r
+       $("#book").val(book_id);\r
+}\r
+\r
 function refreshFiles(){\r
        $.ajax({\r
                url             :       SITE_PATH+'ajax/refreshFichiers',\r
index c9174632c59f9429cc97bb0e5dfa15ecc02f5405..4066fae43e4f60e04f36b3884c8be4987de425f6 100644 (file)
Binary files a/swf/_src/wsComposer.fla and b/swf/_src/wsComposer.fla differ
index 665c7045c262c194a73c822000fb5fe3ae853523..e3e54cd749e2b0b14577a0e7ea7fbbc576f5b3a3 100644 (file)
Binary files a/swf/_src/wsComposerComponents.fla and b/swf/_src/wsComposerComponents.fla differ
index 0c6198d7a1ff86fc13f94bb9c9264f96fb1b6c43..8b4e58a1e9df82bc7cdbcd72a2295241170783ec 100644 (file)
Binary files a/swf/_src/wsComposerComponents.swc and b/swf/_src/wsComposerComponents.swc differ