]> _ Git - cubeextranet.git/commitdiff
wip #2438 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 18 Dec 2018 18:10:16 +0000 (18:10 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 18 Dec 2018 18:10:16 +0000 (18:10 +0000)
inc/ws/Controlleur/class.ws.services.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 7cdab649e8f958afa9c29cd17e50e44149a42481..d148674b245f3125702808ade4bf05097b37b130 100644 (file)
@@ -797,6 +797,19 @@ class wsServices extends cubeFlashGateway
                header('Location: http://www.wesco-eshop.fr');
        }
 
+       public function wsref()
+       {
+               global $core;
+               $e = explode('|', $_GET['ref'], 2);
+               $type = trim($e[0]);
+               $ref = trim($e[1]);
+
+               $r = $core->con->select("SELECT * FROM wsref WHERE ref='" . $core->con->escape($ref) . "' AND type='" . $core->con->escape($type) . "'");
+               if ($r->count()) {
+                       header('Location: ' . $r->url);
+               }
+       }
+
        public function pierronRef()
        {
                global $core;
@@ -1365,7 +1378,6 @@ class wsServices extends cubeFlashGateway
                $version = 40;
 
 
-
                $gpu = trim($gpu);
 
                $c = $core->con->openCursor('gpu_log');
index ebcbd6f68301575b45fc05db601db7365de3836a..1946d631e166330ed6883129328aab580bbd58dd 100644 (file)
@@ -86,6 +86,8 @@ class wsHTML5Link
                                                return new wescoSalesLink($id, $init, $compiler);
                                        case 'AtlanticDownloadLink':
                                                return new atlanticDownloadLink($id, $init, $compiler);
+                                       default :
+                                               return new customLink($id, $init, $compiler);
                                }
                                break;
                        case 8:
@@ -1563,6 +1565,31 @@ class haguenauManifLink extends internalLink
 
 }
 
+class customLink extends wescoLink
+{
+       public function getURL()
+       {
+               global $core;
+               $e = explode(':', $this->to, 2);
+               if (!count($e) == 1) {
+                       return 'https://workshop.fluidbook.com/services/wsref?ref=' . urlencode($this->to);
+               }
+               $type = trim($e[0]);
+               $ref = trim($e[1]);
+
+               $r = $core->con->select("SELECT * FROM wsref WHERE ref='" . $core->con->escape($ref) . "' AND type='" . $core->con->escape($type) . "'");
+               if ($r->count()) {
+                       return $r->url;
+               }
+               return 'https://workshop.fluidbook.com/services/wsref?ref=' . urlencode($type . '|' . $ref);
+       }
+
+       public function getDefaultTooltip()
+       {
+               return 'click to open the link';
+       }
+}
+
 class zoomLink extends normalLink
 {
        protected $maxzoom_default = 2;