From: vincent@cubedesigners.com Date: Fri, 14 Dec 2012 15:27:00 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=bdd17b951ad254257233d13a8d5cf28f0ba6f6c4;p=cubeextranet.git --- diff --git a/fluidbook/icones/1/nav-twitter.png b/fluidbook/icones/1/nav-twitter.png new file mode 100644 index 000000000..a4ad9ad0f Binary files /dev/null and b/fluidbook/icones/1/nav-twitter.png differ diff --git a/inc/postconfig.inc.php b/inc/postconfig.inc.php index df1a7cb6e..85ec7aef7 100644 --- a/inc/postconfig.inc.php +++ b/inc/postconfig.inc.php @@ -8,18 +8,17 @@ define('DEV', $dev); // Définition des variables dans l'environnement de production //define('DB_HOST', ':/var/run/mysqld/mysqld.sock'); -define('DB_HOST', 'avanger.fluidbook.com'); - -if (DB_HOST == 'avanger.fluidbook.com') { - define('DB_NAME', 'extranet'); - define('DB_USER', 'extranet'); - define('DB_PASSWORD', 'WvcAeYBDnrB93RXa'); +if ($_SERVER['SERVER_ADDR'] == '37.59.53.196') { + define('DB_HOST', 'localhost'); } else { - define('DB_NAME', 'extranet_workshop'); - define('DB_USER', 'ws'); - define('DB_PASSWORD', '*arica*2'); + define('DB_HOST', 'avanger.fluidbook.com'); } +define('DB_NAME', 'extranet'); +define('DB_USER', 'extranet'); +define('DB_PASSWORD', 'WvcAeYBDnrB93RXa'); + + define('EXTRANET_URL', 'http://extranet.cubedesigners.com'); define('WS_URL', 'http://workshop.fluidbook.com'); diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index e1cfc35a2..17e039e76 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -11,50 +11,6 @@ class wsServices extends cubeFlashGateway { $gateway = new $n($core->con, $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() {