From 367bc59dd79ebd14d1689682a2ffa7e21f34d195 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 8 Oct 2020 18:26:38 +0000 Subject: [PATCH] done #3939 @0.75 --- inc/commons/class.common.core.php | 12 +---- inc/commons/class.common.tools.php | 3 +- inc/ws/DAO/class.ws.dao.signature.php | 47 +++++++++---------- inc/ws/Metier/class.ws.signature.php | 9 +--- .../html5/master/class.ws.html5.compiler.php | 8 +--- .../html5/master/class.ws.html5.links.php | 3 +- 6 files changed, 30 insertions(+), 52 deletions(-) diff --git a/inc/commons/class.common.core.php b/inc/commons/class.common.core.php index 4518d2373..c28bba1d4 100644 --- a/inc/commons/class.common.core.php +++ b/inc/commons/class.common.core.php @@ -278,16 +278,6 @@ class commonCore extends cubeCore $db->dashboard->index('index_dashboard_sort', 'BTREE', 'sort'); $db->dashboard->index('index_dashboard_site', 'BTREE', 'site'); // . - // Table Signatures - $db->signatures->signature_id('integer', 0, false); - $db->signatures->nom('varchar', 256, false); - $db->signatures->fbcredit('varchar', 64, false); - $db->signatures->fblink('varchar', 64, false); - $db->signatures->partnercredit('varchar', 64, false); - $db->signatures->partnerlink('varchar', 64, false); - $db->signatures->active('integer', 0, false, '1'); - // Clés - $db->signatures->primary('pk_signatures', 'signature_id'); // Table jeux d'icones $db->icones->icone_id('integer', 0, false); $db->icones->nom('varchar', 256, false); @@ -704,7 +694,7 @@ LEFT JOIN e2_u a ON ri.administrateur_id=a.utilisateur_id'); . 'WHERE p.client_id=e.utilisateur_id ' . 'GROUP BY e.type, p.annee_fin'); - + $this->views->createView('signatures', 'SELECT * FROM fluidbook_toolbox.signature'); //cubeDb::mysqlConvert($this->con, 'UTF8', 'utf8_general_ci', 'MYISAM'); touch($cache); } diff --git a/inc/commons/class.common.tools.php b/inc/commons/class.common.tools.php index 157dbc233..23c66f4c6 100644 --- a/inc/commons/class.common.tools.php +++ b/inc/commons/class.common.tools.php @@ -1186,7 +1186,8 @@ class commonTools $options = ['10doigts' => '10 doigts', 'ascocelda' => 'Asco & Celda', 'wesco' => 'Wesco', - 'mopec' => 'Mopec']; + 'mopec' => 'Mopec', + 'intex'=>'Intex']; $options = array_flip($options); ksort($options); diff --git a/inc/ws/DAO/class.ws.dao.signature.php b/inc/ws/DAO/class.ws.dao.signature.php index 868f91c2b..b9acb6389 100644 --- a/inc/ws/DAO/class.ws.dao.signature.php +++ b/inc/ws/DAO/class.ws.dao.signature.php @@ -1,29 +1,26 @@ signature_id = $r->signature_id; - $signature->nom = $r->nom; - $signature->main = $r->fbcredit; - $signature->mainLink = $r->fblink; - $signature->partner = $r->partnercredit; - $signature->partnerLink = $r->partnerlink; - $signature->active = $r->active; - return $signature; - } - public function selectById($signature_id) - { - $r = $this->con->select('SELECT * FROM signatures WHERE signature_id=\'' . $this->con->escape($signature_id) . '\''); - return $this->singleton($r); - } +class wsDAOSignature extends commonDAO +{ + protected function singleton($r) + { + $signature = new wsSignature(); + $signature->signature_id = $r->id; + $signature->nom = $r->name; + $signature->credits = $r->credits; + $signature->active = $r->active; + return $signature; + } - public function selectAll() - { - $r = $this->con->select('SELECT * FROM signatures ORDER BY signature_id'); - return $this->factory($r); - } -} + public function selectById($signature_id) + { + $r = $this->con->select('SELECT * FROM signatures WHERE id=\'' . $this->con->escape($signature_id) . '\''); + return $this->singleton($r); + } -?> \ No newline at end of file + public function selectAll() + { + $r = $this->con->select('SELECT * FROM signatures ORDER BY id'); + return $this->factory($r); + } +} \ No newline at end of file diff --git a/inc/ws/Metier/class.ws.signature.php b/inc/ws/Metier/class.ws.signature.php index e54195c55..26235f627 100644 --- a/inc/ws/Metier/class.ws.signature.php +++ b/inc/ws/Metier/class.ws.signature.php @@ -2,11 +2,6 @@ class wsSignature extends cubeMetier { protected $signature_id; protected $nom; - protected $main; - protected $mainLink; - protected $partner; - protected $partnerLink; + protected $credits; protected $active; -} - -?> \ No newline at end of file +} \ No newline at end of file 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 2f393ed95..3d632e314 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -914,11 +914,7 @@ class wsHTML5Compiler $this->_signature = $daoSignature->selectById($this->book->parametres->signature); } - $credits = ''; - if ($this->_signature->partner != '') { - $credits = '' . $this->_signature->partner . ' '; - } - $credits .= '' . $this->_signature->main . ''; + $credits = $this->_signature->credits; $hiddenContents = implode("\n", $this->hiddenContents); @@ -1121,7 +1117,7 @@ class wsHTML5Compiler $html = file_get_contents($this->assets . '/_seo.html'); $a = $seoArticle; unset($a['image']); - $a['imageurl'] = 'https://workshop.fluidbook.com/services/facebook_thumbnail?cid=' . $this->book->cid . '&j=' .TIME; + $a['imageurl'] = 'https://workshop.fluidbook.com/services/facebook_thumbnail?cid=' . $this->book->cid . '&j=' . TIME; if ($seoArticle['image']) { $a['imageurl'] .= '&image=' . $seoArticle['image']; } diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index 933f1270e..791e510e5 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -1796,7 +1796,7 @@ class wescoLink extends normalLink public function getURL() { - return self::_getURL($this->to); + return static::_getURL($this->to); } protected static function _getURLOfType($type, $ref) @@ -2018,7 +2018,6 @@ class customLink extends wescoLink public static function _getURL($to) { - global $core; $e = explode(':', $to, 2); if (!count($e) == 1) { return 'https://workshop.fluidbook.com/services/wsref?ref=' . urlencode($to); -- 2.39.5