From bdd17b951ad254257233d13a8d5cf28f0ba6f6c4 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 14 Dec 2012 15:27:00 +0000 Subject: [PATCH] --- fluidbook/icones/1/nav-twitter.png | Bin 0 -> 1110 bytes inc/postconfig.inc.php | 17 +++-- inc/ws/Controlleur/class.ws.services.php | 69 +++++---------------- inc/ws/Metier/class.ws.book.parametres.php | 5 +- inc/ws/Metier/class.ws.icone.php | 2 +- 5 files changed, 28 insertions(+), 65 deletions(-) create mode 100644 fluidbook/icones/1/nav-twitter.png diff --git a/fluidbook/icones/1/nav-twitter.png b/fluidbook/icones/1/nav-twitter.png new file mode 100644 index 0000000000000000000000000000000000000000..a4ad9ad0f155b8a0d8e47997be738a8b651b9ef4 GIT binary patch literal 1110 zcmaJ=O>7KN9DnuEHnp3OHfRwq;~?nnd~A2uj;?KYXR+9-?MC2eRsAXyzaIEk78 zSO~Rjj^xt2MFs1A*~R!B-K1;)nq!VBD}9K-JnGSmDD!pf0RuHP%5(aUTw#q zg*pb?vdUne5>c7hR@m%_R6s{WhK_!~utg`z%;<`A?H;oXoPm(OC^Ks+mu`m%Y#|u* zb3TO&aWKUD`9M=R9BzaH$8#(vu)N^o!(u=XIS$T!42@=~-C{=CHW!QTqD(I#rpU5| zLcw1M__5W)@{vfy)er<9MfmIigUF80u-BCoBxEa=W)ck>&{dT4xSvEB>U1^*-JF*- z?71@0g0YTlvb>*jQz`+|>HkA@eI9L-4Ep2upTc%_z(i~Y*|^_Q=*4xfb3>V8!a_2^ zRugg{HU=X>AH}$r4w>O23W_QsSzAxQVh{w-I!cMwXDJ9YX3h3+r$uVNomZ zB~n&zj;ogULOqwsgQaFz_geqD=F$=E9d|k3v~)Ay_Q;^UZqcS5z5MeEeGo5FQft9$<*Z0?}T??|e7Q9}}d24c>{dcon, $args); } - public function sendGordini() { - - $fromEmail = $this->args['fromemail']; - $fromName = $this->args['fromname']; - - $emails = array(); - - if (preg_match_all('|[a-z0-9_\-\.]*@[a-z0-9\-\.]*\.[a-z]{2,5}|i', $this->args['email'], $matches)) { - $emails = $matches[0]; - } - - $http = new cubeHTTP('secure.cabestan.com', 443); - $http->useSSL(true); - - $query = ''; - $query .= ''; - $query .= ''; - $query .= ''; - $query .= '' . $fromEmail . ''; - $query .= '' . $fromName . ''; - foreach ($emails as $i => $email) { - $query .= '' . $email . ''; - } - $i++; - if (($i + 1) < 3) { - for (; $i <= 2; $i++) { - $query .= ''; - } - } - $query .= ''; - $query .= ''; - $query .= ''; - $query .= ''; - - $datas = array('Emm_Login' => 'Publicis', - 'Emm_Password' => '%K8\'hQi/kr', - 'XmlOutputType' => 'XML', - 'XmlOutputMethod' => 'NOREDIRECT', - 'XmlBatch' => '1', - 'XmlQuery' => $query); - - $http->post('/renault/Shared/WebServices/Ws_LaunchAlert.cfm', $datas); - } - public function sendEmail() { // Check protection hash $hash = md5(substr($this->args['fromemail'], 2, 6) . substr($this->args['email'], 3, 5) . 'SFGHF566!S' . $this->args['id']); @@ -73,6 +29,10 @@ class wsServices extends cubeFlashGateway { $mail->to = $this->args['email']; $mail->from = $this->args['fromname'] . '<' . $this->args['fromemail'] . '>'; $mail->subject = $this->args['subject']; + if (isset($this->args['bookmarks'])) { + $pdf = $this->getPDFComplex($this->args['id'], $this->args['bookmarks']); + $mail->addFile('bookmarks.pdf', $pdf['file']); + } /* if ($this->args['attachPDFInEmail'] == '1') { $doc_name = isset($this->args['attachmentName'])?$this->args['attachmentName']:'document.pdf'; $file = fwsConverter::extractPages($this->args['id'], $this->args['attachPDFInEmail'], false); @@ -221,21 +181,18 @@ class wsServices extends cubeFlashGateway { $this->exportpdf(true); } - public function exportpdf($print = false) { + protected function getPDFComplex($book_id, $range) { global $core; $daoBook = new wsDAOBook($core->con); - $book = $daoBook->selectById($this->args['id']); + $book = $daoBook->selectById($book_id); if (is_null($book)) { return; } - if (!$book->parametres->pdfComplex && !$book->parametres->pdf && $book->parametres->printMode != 'pdf') { - return; - } // Normalize range - $range = cubeArray::parseRange($this->args['range']); + $range = cubeArray::parseRange($range); if ($k = array_search(0, $range)) { $range[$k] = 1; } @@ -281,9 +238,16 @@ class wsServices extends cubeFlashGateway { $pdftk->execute(); } + return array('url' => $destURL, 'file' => $destFile); + } + + public function exportpdf($print = false) { + global $core; + $dest = $this->getPDFComplex($this->args['id'], $this->args['range']); + if (!$print) { // Return the url of the resulting pdf - http::redirect($destURL); + http::redirect($dest['url']); exit; } else { $res = ' @@ -294,10 +258,9 @@ class wsServices extends cubeFlashGateway { - + '; - fb($res); ob_end_clean(); echo $res; exit; diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index fa76955a7..c6d5783ef 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -51,6 +51,7 @@ class wsBookParametres extends wsParametres { $this->fields['email_body'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Corps de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut')); $this->fields['email_editable'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Permettre au lecteur de modifier le corps de l'email")); $this->fields['askAcknowledge'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Demander au destinataire un accusé de réception"), 'grade' => 3); + $this->fields['email_attachment_bookmarks'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Joindre à l'email les pages marquées en PDF"), 'grade' => 3); $this->fields['facebook'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Facebook')); $this->fields['facebook_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre facebook"), 'hint' => __('Titre proposé sur la fonction de partage facebook (par défaut, titre de la publication)')); $this->fields['facebook_description'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Description facebook"), 'grade' => 1, 'hint' => __('Description proposée sur la fonction de partage facebook (par défaut, vide)')); @@ -60,7 +61,7 @@ class wsBookParametres extends wsParametres { $this->fields['friendWidth'] = array('type' => 'integer', 'default' => 319, 'editable' => true, 'label' => __('Largeur du menu'), 'grade' => 5); $this->fields['friendHeight'] = array('type' => 'integer', 'default' => 500, 'editable' => true, 'label' => __('Largeur du menu'), 'grade' => 5); $this->forms['share'] = array('label' => __('Fonctions de partage'), - 'fieldsnames' => array('friend', 'email_title', 'email_body', 'email_editable', 'askAcknowledge', '|', + 'fieldsnames' => array('friend', 'email_title', 'email_body', 'email_editable', 'askAcknowledge', 'email_attachment_bookmarks', '|', 'facebook', 'facebook_title', 'facebook_description', '|', 'twitter', 'twitter_description', '|', 'customSharer', '|', 'friendWidth', 'friendHeight')); // . @@ -95,7 +96,7 @@ class wsBookParametres extends wsParametres { $this->fields['bookmark'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Activer les marques-pages')); $this->fields['bookmarkCorner'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Activer les marques-pages sur les coins des pages')); $this->forms['bookmark'] = array('label' => __('Marques-pages'), - 'fieldsnames' => array('bookmark','bookmarkCorner')); + 'fieldsnames' => array('bookmark', 'bookmarkCorner')); $this->fields['help'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Activer l'aide")); $this->fields['helpStartup'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Afficher l'aide au démarrage")); diff --git a/inc/ws/Metier/class.ws.icone.php b/inc/ws/Metier/class.ws.icone.php index eb341c3a0..8fe3fe198 100644 --- a/inc/ws/Metier/class.ws.icone.php +++ b/inc/ws/Metier/class.ws.icone.php @@ -5,7 +5,7 @@ class wsIcone extends cubeMetier { public $icone_id; public $nom; public $date; - public static $files = array('index', 'normal', 'sommaire', 'print', 'friend', 'bookmark', 'fullscreen', 'normalscreen', 'save', 'archives', 'help', '2d', '3d', 'soundon', 'soundoff', 'basket', 'previous', 'home'); + public static $files = array('index', 'normal', 'sommaire', 'print', 'friend', 'bookmark', 'fullscreen', 'normalscreen', 'save', 'archives', 'help', '2d', '3d', 'soundon', 'soundoff', 'basket', 'previous', 'home','email','facebook','twitter'); public static $display = array('index', 'sommaire', 'print', 'friend', 'bookmark', 'fullscreen', 'save', '3d', 'soundon', 'help'); public function makeImage() { -- 2.39.5