From 83e8b2ebfc283be99b3b597db67d7b4ff0049e0c Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 16 Apr 2018 15:49:37 +0000 Subject: [PATCH] #1927 --- inc/ws/Controlleur/class.ws.maintenance.php | 6 +- inc/ws/Controlleur/class.ws.services.php | 148 ++++++++++++------ .../html5/master/class.ws.html5.compiler.php | 1 + 3 files changed, 105 insertions(+), 50 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index 857e25ebe..090dbf422 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -496,7 +496,7 @@ class wsMaintenance { $c->lang = $r->lang; $c->telephone = $r->telephone; $c->date_creation = $r->date; - $c->notes = 'Inséré à l\'import vers le nouveau Fluidbook Workshop'; + $c->notes = 'Inséré à  l\'import vers le nouveau Fluidbook Workshop'; $c->ws_password = $r->password; $c->ws_id = $r->uid; $c->insert(); @@ -1538,8 +1538,8 @@ class wsMaintenance { public static function installWescoVentes() { $exporter = new wsExporter(); - $exporter->export(15296, $x, 'install_ftp', 'online', "wescogrolj-catalogca:b9uA7U72eW@ftp.cluster023.hosting.ovh.net", ''); - header('Location: http://www.wesco-group.com/download/Catalogues/2017/Wesco-Rapport-ventes-0-12-ans/'); + $exporter->export(16328, $x, 'install_ftp', 'online', "wescogrolj-catalogca:b9uA7U72eW@ftp.cluster023.hosting.ovh.net", ''); + header('Location: https://wesco-group.com/download/Catalogues/2018/Wesco_Rapport_ventes_0-12-ans'); exit; } diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index b5d8d1a93..b614f47de 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -1,17 +1,20 @@ con, $args); } - public function sendEmail() { + public function sendEmail() + { global $core; if (!$this->_checkHash()) { return; @@ -39,7 +42,8 @@ class wsServices extends cubeFlashGateway { $this->xml->addChild('ok', $mail->send() ? '1' : '0'); } - protected function _checkHash() { + protected function _checkHash() + { // Check protection hash $hash = md5(substr($this->args['fromemail'], 2, 6) . substr($this->args['email'], 3, 5) . 'SFGHF566!S' . $this->args['id']); if ($hash != $this->args['hash']) { @@ -51,7 +55,8 @@ class wsServices extends cubeFlashGateway { return true; } - public function sendBookmarks() { + public function sendBookmarks() + { if (!$this->_checkHash()) { return; } @@ -134,7 +139,8 @@ class wsServices extends cubeFlashGateway { } } - protected function shortenURL($url, $id) { + protected function shortenURL($url, $id) + { $bitLyUser = 'fluidbook'; $bitLyKey = 'R_3858dd1c9884d5c6a5fe386d7e95cf1d'; // Recherche dans le cache @@ -163,7 +169,8 @@ class wsServices extends cubeFlashGateway { * * @return */ - public function facebook_thumbnail() { + public function facebook_thumbnail() + { $this->outputXML = false; $dao = new wsDAOBook($this->con); @@ -222,25 +229,30 @@ class wsServices extends cubeFlashGateway { exit; } - public function facebookShare() { + public function facebookShare() + { http::redirect('http://www.facebook.com/sharer/sharer.php?u=' . urlencode($this->args['url'])); exit; } - public function googleplusShare() { + public function googleplusShare() + { http::redirect('https://plus.google.com/share?url=' . urlencode($this->args['url']) . "&sgp=1"); exit; } - public function linkedinShare() { + public function linkedinShare() + { http::redirect('https://www.linkedin.com/cws/share?url=' . urlencode($this->args['url']) . '&isFramed=true&_ts=' . microtime(true)); } - public function viadeoShare() { + public function viadeoShare() + { http::redirect('http://www.viadeo.com/shareit/share/?url=' . urlencode($this->args['url'])); } - public function twitterShare() { + public function twitterShare() + { $url = $this->shortenURL($this->args['url'], $this->args['id']); $post = str_replace('%short%', $url, $this->args['post']); @@ -250,7 +262,8 @@ class wsServices extends cubeFlashGateway { exit; } - public function searchHints() { + public function searchHints() + { $index = Zend_Search_Lucene::open(WS_BOOKS . '/search/' . $this->args['id']); $charsLimit = 2; @@ -278,7 +291,8 @@ class wsServices extends cubeFlashGateway { $this->xml->addChild('hints', json_encode($res)); } - public function searchResults() { + public function searchResults() + { $index = Zend_Search_Lucene::open(WS_BOOKS . '/search/' . $this->args['id']); $terms = $this->getTerms($this->args['term']); @@ -305,7 +319,8 @@ class wsServices extends cubeFlashGateway { $this->xml->addChild('terms', implode(',', $terms)); } - protected function getTerms($term) { + protected function getTerms($term) + { $term = trim($term, '*? '); $term = mb_strtolower($term); $term = cubeText::removeAccents($term); @@ -313,12 +328,14 @@ class wsServices extends cubeFlashGateway { return $terms; } - public function printpdf() { + public function printpdf() + { $this->outputXML = false; $this->exportpdf(true); } - public function getPDFComplex($book = null, $range = null) { + public function getPDFComplex($book = null, $range = null) + { global $core; if (is_null($book)) { @@ -401,7 +418,8 @@ class wsServices extends cubeFlashGateway { return array('url' => $destURL, 'file' => $destFile); } - public function getPDFComplexBaseDocument($book) { + public function getPDFComplexBaseDocument($book) + { global $core; @@ -426,19 +444,22 @@ class wsServices extends cubeFlashGateway { return $res; } - public function e() { + public function e() + { $this->args['cid'] = $this->callArgs[0]; $this->args['range'] = $this->callArgs[1]; return $this->exportpdf(); } - public function p() { + public function p() + { $this->args['cid'] = $this->callArgs[0]; $this->args['range'] = $this->callArgs[1]; return $this->exportpdf(true); } - public function exportpdf($print = false) { + public function exportpdf($print = false) + { global $core; set_time_limit(0); @@ -474,7 +495,8 @@ class wsServices extends cubeFlashGateway { } } - public function bulle() { + public function bulle() + { global $core; $e = explode('-', $this->args['catalogue'], 2); if (count($e) == 2) { @@ -492,7 +514,8 @@ class wsServices extends cubeFlashGateway { $c->insert(); } - public function getBulleList() { + public function getBulleList() + { $user = 'bulle'; $pass = '23bu1l300'; $this->outputXML = false; @@ -518,7 +541,8 @@ class wsServices extends cubeFlashGateway { } } - public function grdfValidForm() { + public function grdfValidForm() + { $notempty = array('civilite', 'prenom', 'nom', 'adresse', 'codepostal', 'ville', 'telephone', 'optin', 'connu', 'energie'); if ($this->args['id'] >= 12779) { $notempty = array_merge($notempty, array('logement', 'echeance', 'optin_partenaires')); @@ -541,7 +565,8 @@ class wsServices extends cubeFlashGateway { $this->xml->addChild('errors', implode(',', $errors)); } - public function grdfSendForm() { + public function grdfSendForm() + { global $core; if ($this->args['id'] == 11222) { @@ -551,10 +576,10 @@ class wsServices extends cubeFlashGateway { } $fields = array('Civilité' => 'civilite', 'Prénom' => 'prenom', 'Nom' => 'nom', - 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville', - 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Energie' => 'energie', - 'Type de logement' => 'logement', 'Echéance travaux' => 'echeance', - 'Optin' => 'optin', 'Optin partenaires' => 'optin_partenaires', 'Coupons sélectionnés' => 'reflist'); + 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville', + 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Energie' => 'energie', + 'Type de logement' => 'logement', 'Echéance travaux' => 'echeance', + 'Optin' => 'optin', 'Optin partenaires' => 'optin_partenaires', 'Coupons sélectionnés' => 'reflist'); $mail = new cubeMail(); $mail->charset = 'UTF-8'; @@ -581,7 +606,8 @@ class wsServices extends cubeFlashGateway { $mail->send(); } - public function grdfCoupon2015() { + public function grdfCoupon2015() + { $id = $this->args['id']; $this->outputXML = false; @@ -614,7 +640,8 @@ class wsServices extends cubeFlashGateway { exit; } - public function grdfCoupon() { + public function grdfCoupon() + { $id = $this->args['id']; @@ -656,7 +683,8 @@ class wsServices extends cubeFlashGateway { $pdf->Output('coupon.pdf', 'I'); } - public function grdfExcel12568() { + public function grdfExcel12568() + { global $core; $this->outputXML = false; @@ -677,10 +705,10 @@ class wsServices extends cubeFlashGateway { $xml = simplexml_load_file($couponsRoot . 'references.xml'); $cols = array('Date' => 'date', 'Civilité' => 'civilite', 'Prénom' => 'prenom', 'Nom' => 'nom', - 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville', - 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Energie' => 'energie', 'Type de logement' => 'logement', - 'Echéance travaux' => 'echeance', - 'Optin' => 'optin', 'Optin partenaires' => 'optin_partenaires'); + 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville', + 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Energie' => 'energie', 'Type de logement' => 'logement', + 'Echéance travaux' => 'echeance', + 'Optin' => 'optin', 'Optin partenaires' => 'optin_partenaires'); $refs = array(); foreach ($xml->xpath('//item') as $i) { $refs[(string)$i['reference']] = $i['name']; @@ -726,13 +754,15 @@ class wsServices extends cubeFlashGateway { exit; } - public function proxy() { + public function proxy() + { ob_end_clean(); fb(netHttp::quickGet($_GET['u'], 'php://output')); $this->outputXML = false; } - public function wescoRef() { + public function wescoRef() + { global $core; $this->args['ref'] = str_replace(' ', '', $this->args['ref']); @@ -762,7 +792,8 @@ class wsServices extends cubeFlashGateway { header('Location: http://www.wesco-eshop.fr'); } - public function pierronRef() { + public function pierronRef() + { global $core; $ref = $this->args['ref']; @@ -774,7 +805,8 @@ class wsServices extends cubeFlashGateway { header('Location: http://www.pierron.fr/'); } - public function flfRef() { + public function flfRef() + { global $core; $r = $core->con->select('SELECT url FROM flfref WHERE ref="' . $core->con->escape($this->args['ref']) . '"'); @@ -787,7 +819,8 @@ class wsServices extends cubeFlashGateway { exit; } - public function collection() { + public function collection() + { global $core; $id = $this->callArgs[0]; $os = $this->callArgs[1]; @@ -929,7 +962,8 @@ class wsServices extends cubeFlashGateway { exit; } - protected function _getManifest($publications, $dir, $books, $resolution) { + protected function _getManifest($publications, $dir, $books, $resolution) + { global $core; $res = array(); $res['manifest'] = array('assetRoot' => 'https://workshop.fluidbook.com' . $dir . '/', 'autoDownload' => false); @@ -995,7 +1029,8 @@ class wsServices extends cubeFlashGateway { return $res; } - protected function _getRegExpManifest($r, $book, $theme, $resolution) { + protected function _getRegExpManifest($r, $book, $theme, $resolution) + { $reg = array(); $reg['loading'] = array('^' . $r . 'style/(.*).css$', '^' . $r . 'index.html$', '^' . $r . 'data/style/(.*)$', '^' . $r . 'data/(.*).js$', '^' . $r . 'data/images/' . $theme->parametres->logoLoader . '$', '^' . $r . 'style/fonts/(.*).ttf$', '^' . $r . 'data/images/interface-down.svg$', '^' . $r . 'plugins/(.*)$'); $reg['extras'] = array('^' . $r . 'data/links/(.*).mp4$', '^' . $r . 'data/links/(.*).ogv$', '^' . $r . 'data/links/(.*).webm$', '^' . $r . 'data/(.*).pdf$', '^' . $r . 'cover.jpg$'); @@ -1018,7 +1053,8 @@ class wsServices extends cubeFlashGateway { return array('reg' => $reg, 'exclude' => $exclude); } - protected function _inFirstManifest($p, $orders, $reg) { + protected function _inFirstManifest($p, $orders, $reg) + { foreach ($orders as $list) { foreach ($reg[$list] as $v) { if (preg_match('|' . $v . '|', $p)) { @@ -1029,7 +1065,8 @@ class wsServices extends cubeFlashGateway { return $list; } - protected function _getBundles($book) { + protected function _getBundles($book) + { $res = array(0 => 'loading', 20001 => 'extras', 20000 => 'thumbnails', 1 => 'urgents'); for ($i = 1; $i <= $book->parametres->pages; $i++) { $k = 2 + $i; @@ -1038,7 +1075,8 @@ class wsServices extends cubeFlashGateway { return $res; } - public function collectionPushRegister() { + public function collectionPushRegister() + { global $core; $c = $core->con->openCursor('book_collection_push'); @@ -1055,7 +1093,8 @@ class wsServices extends cubeFlashGateway { } } - public function getFluidbookPage($id, $page) { + public function getFluidbookPage($id, $page) + { global $core; $id = $this->callArgs[0]; @@ -1072,4 +1111,19 @@ class wsServices extends cubeFlashGateway { echo file_get_contents($file); die; } + + public function orderRemarkable() + { + try { + $mail = new cubeMail(); + $mail->type = "html"; + $mail->from = 'test@cubedesigners.com'; + $mail->bcc = 'test@cubedesigners.com'; + $mail->subject = '[Remarkable] Votre commande'; + $mail->body = print_r($_POST, true); + $mail->send(); + } catch (Exception $e) { + + } + } } diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 96f4a76fd..96b1fc1fc 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -1172,6 +1172,7 @@ class wsHTML5Compiler $this->addJs('js/libs/fluidbook/fluidbook.cart.js'); switch ($this->config->basketManager) { case 'Remarkable': + $this->addJs('js/libs/parsley.min.js'); $this->addJs('js/libs/fluidbook/cart/fluidbook.cart.remarkable.js'); break; default: -- 2.39.5