]> _ Git - cubeextranet.git/commitdiff
wait #4495 @0.75
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 27 May 2021 18:12:40 +0000 (18:12 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 27 May 2021 18:12:40 +0000 (18:12 +0000)
inc/ws/Controlleur/class.ws.flash.php
inc/ws/DAO/class.ws.dao.theme.php

index e0fdf2516753f4f8df08e2bd8ed62ca4dab097ca..cfe33c005ddd048056fc2063f864e4382af4c8ad 100644 (file)
@@ -441,7 +441,7 @@ class wsFlash extends cubeFlashGateway
         $readOnly = array(1);
 
         $dao = new wsDAOTheme($core->con);
-        $themes = $dao->getAllThemes($core->user, 'ORDER BY FIELD (theme_id,' . $this->args['book_id'] . ',' . implode(',', $demos) . ') DESC, theme_id DESC', $demos);
+        $themes = $dao->getAllThemes($core->user, 'ORDER BY FIELD (theme_id,' . $this->args['book_id'] . ',' . implode(',', $demos) . ') DESC, theme_id DESC', $demos,$this->xml);
         foreach ($themes as $theme) {
             $t = $this->xml->addChild('theme');
             $t->addAttribute('id', $theme->theme_id);
index c54492abf36e237c4fa84095052d2aea6c275ab8..aeef4b92fc80ff4883a817d389f8de9231901373 100644 (file)
@@ -52,12 +52,17 @@ class wsDAOTheme extends commonDAO
             $sql = 'SELECT * FROM themes_vue';\r
         } else {\r
             $or = '';\r
-            if (wsDroits::revendeur() && !is_null($demos)) {\r
-                $or = ' OR theme_id IN(' . implode(',', $demos) . ')';\r
+            if (wsDroits::revendeur()) {\r
+                if (!is_null($demos)) {\r
+                    $or .= ' OR theme_id IN(' . implode(',', $demos) . ') ';\r
+                }\r
+                $or .= ') OR ( proprietaire IN(' . $user->ws_rights . ') ';\r
             }\r
             $sql = 'SELECT * FROM themes_vue WHERE theme_id IN (SELECT theme FROM books WHERE proprietaire IN(' . $user->ws_rights . ') ' . $or . ')';\r
         }\r
-        $r = $this->con->select($sql . ' ' . $order);\r
+        $sql .= ' ' . $order;\r
+\r
+        $r = $this->con->select($sql);\r
         return $this->factory($r);\r
     }\r
 \r
@@ -159,11 +164,11 @@ class wsDAOTheme extends commonDAO
         }\r
 \r
 \r
-        $theme=$this->selectById($c->theme_id);\r
+        $theme = $this->selectById($c->theme_id);\r
         try {\r
             $api = new ws3API();\r
             $api->createTheme($theme);\r
-        }catch (Exception $e){\r
+        } catch (Exception $e) {\r
             print_r($e);\r
             exit;\r
         }\r