diff --git a/module/download/download.php b/module/download/download.php index 830f77c2..69cb3755 100644 --- a/module/download/download.php +++ b/module/download/download.php @@ -53,6 +53,9 @@ class download extends common { public static $pages; + // Nombre de téléchargements + public static $statSum = 0; + public static $states = [ false => 'Brouillon', true => 'Publié' @@ -90,7 +93,7 @@ class download extends common { public static $users = []; - const VERSION = '4.2'; + const VERSION = '1.0'; const REALNAME = 'Téléchargement'; /** @@ -426,22 +429,25 @@ class download extends common { $toApprove = 0; $approved = count($this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i],'comment'])); } - // Nombre de téléchargements - $stats = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i],'fileStats']), 'time'); // Met en forme le tableau $date = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i], 'fileDate'])), 'UTF-8', true) ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i], 'fileDate'])) : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i], 'fileDate']))); - $heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i], 'fileDate'])), 'UTF-8', true) - ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i], 'fileDate'])) - : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i], 'fileDate']))); + $heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i], 'fileDate'])), 'UTF-8', true) + ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i], 'fileDate'])) + : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i], 'fileDate']))); + $stat = count(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i],'fileStats']), 'time') ) === 0 + ? '0' + : '' . + count(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i],'fileStats']), 'time') ) . + ''; self::$items[] = [ '' . $this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i], 'title']) . '', $this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i], 'fileVersion']), $date .' à '. $heure, - '' . count($stats) . '', + $stat, self::$states[$this->getData(['module', $this->getUrl(0), 'items', $itemIds[$i], 'state'])], // Bouton pour afficher les commentaires de l'item template::button('downloadConfigComment' . $itemIds[$i], [ @@ -684,6 +690,10 @@ class download extends common { $commentIds = array_keys(helper::arrayCollumn($commentsApproved, 'createdOn', 'SORT_DESC')); // Pagination $pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['config','itemsperPage']),'#comment'); + // Nombre de téléchargements + self::$statSum = count(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'items',$this->getUrl(1),'fileStats']), 'time') ) === 0 + ? '0' + : count(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1),'fileStats']), 'time') ) ; // Liste des pages self::$pages = $pagination['pages']; // Signature de l'item @@ -836,6 +846,8 @@ class download extends common { // Construction de la page des statistiques $itemIds = array_keys($this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'fileStats'])); + // Total des téléchargements + self::$statSum = count ($itemIds); // Pagination $pagination = helper::pagination($itemIds, $this->getUrl(),$this->getData(['config','itemsperPage'])); diff --git a/module/download/view/config/config.php b/module/download/view/config/config.php index 79584139..78de2ebc 100644 --- a/module/download/view/config/config.php +++ b/module/download/view/config/config.php @@ -12,7 +12,7 @@ helper::baseUrl() . $this->getUrl(0) . '/add', 'ico' => 'plus', - 'value' => 'Item' + 'value' => 'Fichier' ]); ?>
diff --git a/module/download/view/index/index.css b/module/download/view/index/index.css index b495b1b9..21e784f9 100644 --- a/module/download/view/index/index.css +++ b/module/download/view/index/index.css @@ -26,10 +26,11 @@ padding-right: 10px; float: right; } -.downloadTitle { - /*background-color: #ECEFF1;*/ - padding: 0px; +h2{ margin-bottom: 5px; + margin-top: 0px; + padding: 0px; + } .downloadContent { float: left; diff --git a/module/download/view/index/index.php b/module/download/view/index/index.php index 5acb9519..75a06084 100644 --- a/module/download/view/index/index.php +++ b/module/download/view/index/index.php @@ -3,7 +3,7 @@
$item): ?>