]> _ Git - cubeextranet.git/commitdiff
wait #4528 @0.25
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 26 Jul 2021 09:37:51 +0000 (09:37 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 26 Jul 2021 09:37:51 +0000 (09:37 +0000)
inc/ws/Controlleur/class.ws.url.php

index 09db6fb46f3b24e72f111a46e038ed52837e2d0e..06f9ae6ccc9f7709c235eb7a6a86fbb805869e13 100644 (file)
@@ -57,6 +57,8 @@ class wsUrl
         $context_status_id = is_null($dashboard) ? 'contextStatusBook' : 'contextDashboard_Status' . $dashboard;
         $context_view_id = is_null($dashboard) ? 'contextViewBook' : 'contextView_Status' . $dashboard;
 
+        $report = THEME === 'ysl';
+
         if (isset($settings['search']) && !is_null($settings['search'])) {
             $dao->setSearch($settings['search']);
         }
@@ -85,20 +87,23 @@ class wsUrl
         $res .= '<th>' . commonUrl::orderby(sprintf(__('Date de%smodification'), '<br>'), 'changedate', $settings, 'sort' . $change) . '</th>';
         $res .= '<th>' . commonUrl::orderby(__(''), 'lang', $settings, 'sort' . $change) . '</th>';
         $res .= '<th>' . __('Pages') . '</th>';
-        if ($droits->admin) {
-            $res .= '<th>' . commonUrl::orderby('C', 'demo_counter', $settings, 'sort' . $change, __('Compteur de démos')) . '</th>';
-        }
-        if ($droits->revendeur) {
-            $res .= '<th>' . commonUrl::orderby(__('Proprietaire'), 'proprietaire_nom', $settings, 'sort' . $change) . '</th>';
-        } else {
-            $res .= '<th>' . commonUrl::orderby(__('Proprietaire'), 'proprietaire_utilisateur', $settings, 'sort' . $change) . '</th>';
-        }
-        if ($droits->admin) {
-            $res .= '<th>' . commonUrl::orderby(__('Facturation'), 'facturable', $settings, 'sort' . $change) . '</th>';
-        }
-        if ($droits->revendeur) {
-            $res .= '<th>' . commonUrl::orderby(__('Status'), 'status', $settings, 'sort' . $change) . '</th>';
-            $res .= '<th>' . __('V') . '</th>';
+
+        if (!$report) {
+            if ($droits->admin) {
+                $res .= '<th>' . commonUrl::orderby('C', 'demo_counter', $settings, 'sort' . $change, __('Compteur de démos')) . '</th>';
+            }
+            if ($droits->revendeur) {
+                $res .= '<th>' . commonUrl::orderby(__('Proprietaire'), 'proprietaire_nom', $settings, 'sort' . $change) . '</th>';
+            } else {
+                $res .= '<th>' . commonUrl::orderby(__('Proprietaire'), 'proprietaire_utilisateur', $settings, 'sort' . $change) . '</th>';
+            }
+            if ($droits->admin) {
+                $res .= '<th>' . commonUrl::orderby(__('Facturation'), 'facturable', $settings, 'sort' . $change) . '</th>';
+            }
+            if ($droits->revendeur) {
+                $res .= '<th>' . commonUrl::orderby(__('Status'), 'status', $settings, 'sort' . $change) . '</th>';
+                $res .= '<th>' . __('V') . '</th>';
+            }
         }
         $res .= str_repeat('<th class="min"></th>', 5);
         $res .= '</tr>';
@@ -107,6 +112,8 @@ class wsUrl
         $btVoir = '<div></div><span>' . __('voir') . '</span>';
         $btEdit = '<div></div><span>' . __('éditer') . '</span>';
         $btStats = '<div></div><span>' . __('stats') . '</span>';
+
+        $btReport = '<div></div><span>' . __('report') . '</span>';
         $btDownload = '<div></div><span>' . __('télécharger') . '</span>';
         if ($droits->creation) {
             $btDel = '<div></div><span>' . __('suppr.') . '</span>';
@@ -121,33 +128,35 @@ class wsUrl
             $res .= '<td>' . date('Y-m-d', $book->changedate) . '</td>';
             $res .= '<td>' . mb_strtoupper($book->lang) . '</td>';
             $res .= '<td>' . $book->parametres->pages . '</td>';
-            if ($droits->admin) {
-                $res .= '<td>' . $book->demo_counter . '</td>';
-            }
+            if (!$report) {
+                if ($droits->admin) {
+                    $res .= '<td>' . $book->demo_counter . '</td>';
+                }
 
-            if ($droits->revendeur) {
-                $p = str_replace(" (", '<br /><em>', html::escapeHTML($book->proprietaire));
-                $p = str_replace(')', '</em>', $p);
-                $res .= '<td><a href="#" class="popup" rel="formChangeBookProprietaire/' . $book->book_id . '" title="' . __('Modifier le proprietaire') . '">' . $p . '</a></td>';
-            } else {
-                $res .= '<td>' . html::escapeHTML($book->proprietaire_utilisateur) . '</td>';
-            }
-            if ($droits->admin) {
-                $res .= '<td>' . html::escapeHTML($book->facturable) . '</td>';
-            }
-            if ($droits->revendeur) {
-                if ($droits->admin || $book->status < 1) {
-                    $p = '';
-                    if (!is_null($book->projet)) {
-                        $p = ' <a href="' . EXTRANET_URL . '/projet/' . $book->projet . '" title="' . __('Voir les détails du projet') . '" class="blank icon">' . cubeMedia::silk('arrow_right.png') . '</a>';
-                    }
-                    $res .= '<td><a href="#" class="openContextMenu" rel="' . $context_status_id . '" rev="' . $book->book_id . '">' . $core->books_status[$book->status] . '</a>' . $p . '</td>';
+                if ($droits->revendeur) {
+                    $p = str_replace(" (", '<br /><em>', html::escapeHTML($book->proprietaire));
+                    $p = str_replace(')', '</em>', $p);
+                    $res .= '<td><a href="#" class="popup" rel="formChangeBookProprietaire/' . $book->book_id . '" title="' . __('Modifier le proprietaire') . '">' . $p . '</a></td>';
                 } else {
-                    $res .= '<td>' . $core->books_status[1] . '</td>';
+                    $res .= '<td>' . html::escapeHTML($book->proprietaire_utilisateur) . '</td>';
+                }
+                if ($droits->admin) {
+                    $res .= '<td>' . html::escapeHTML($book->facturable) . '</td>';
+                }
+                if ($droits->revendeur) {
+                    if ($droits->admin || $book->status < 1) {
+                        $p = '';
+                        if (!is_null($book->projet)) {
+                            $p = ' <a href="' . EXTRANET_URL . '/projet/' . $book->projet . '" title="' . __('Voir les détails du projet') . '" class="blank icon">' . cubeMedia::silk('arrow_right.png') . '</a>';
+                        }
+                        $res .= '<td><a href="#" class="openContextMenu" rel="' . $context_status_id . '" rev="' . $book->book_id . '">' . $core->books_status[$book->status] . '</a>' . $p . '</td>';
+                    } else {
+                        $res .= '<td>' . $core->books_status[1] . '</td>';
+                    }
+                    $res .= '<td>' . $book->version . '</td>';
                 }
-                $res .= '<td>' . $book->version . '</td>';
             }
-            if ($book->version > 1 || $droits->admin) {
+            if (!$report && ($book->version > 1 || $droits->admin)) {
                 $types = ['html5'];
                 $defaultPlayer = 'viewerh';
                 if ($book->parametres->scorm_enable) {
@@ -160,7 +169,9 @@ class wsUrl
                 $res .= '<td></td><td></td>';
             }
             $res .= '<td class="bouton"><a href="' . SITE_PATH . 'stats/' . $book->book_id . '_' . $book->hash . '" class="normallink stats btbook">' . $btStats . '</a></td>';
-            if ($book->version > 1) {
+            if ($report) {
+                $res .= '<td class="bouton"><a href="/yslReport/' . $book->book_id . '" class="download btbook">' . $btReport . '</a></td>';
+            } elseif ($book->version > 1) {
                 if ($droits->admin) {
                     $res .= '<td class="bouton"><a href="#" rel="exportbook/' . $book->book_id . '" class="popup download btbook">' . $btDownload . '</a></td>';
                 } else {
@@ -170,7 +181,7 @@ class wsUrl
             } else {
                 $res .= '<td></td>';
             }
-            if ($droits->creation && $book->status < 0) {
+            if (!$report && ($droits->creation && $book->status < 0)) {
                 $res .= '<td class="bouton"><a href="#" rel="supprimeBook/' . $book->book_id . '" class="ajax suppr btbook" title="' . __('Êtes-vous certain de vouloir supprimer cette publication ?') . '">' . $btDel . '</a></td>';
             } else {
                 $res .= '<td></td>';
@@ -1333,7 +1344,7 @@ html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-co
             $data[] = [date('Y-m-d H:i:s', $r->date), $r->page, $r->rating, $r->country, $r->function, $r->suggestions];
         }
 
-        CubeIT_Excel::simple('Survey data #'.$bid, $data, $head, $tmp, 100);
+        CubeIT_Excel::simple('Survey data #' . $bid, $data, $head, $tmp, 100);
 
         files::$mimeType['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
         cubeHTTP::downloadFile($tmp, 'ysl_survey_' . $bid . '.xlsx');