Browse Source

dev terminé pour éliminer le bug #289
- visualisation des non lus du feed selectionné.
A noter : qu’il faudra publier la correction sur le plugin scrollRead.

cobalt74 5 years ago
parent
commit
4ce04f1b5b
4 changed files with 27 additions and 4 deletions
  1. 7 0
      article.php
  2. 13 0
      index.php
  3. 2 2
      templates/marigolds/index.html
  4. 5 2
      templates/marigolds/js/script.js

+ 7 - 0
article.php

@@ -53,6 +53,13 @@ switch($action){
         $order = (isset($_['order'])?$allowedOrder[$_['order']]:$allowedOrder['date']);
         $events = $currentFeed->getEvents($startArticle,$articlePerPages,$order,$target);
     break;
+    /* AFFICHAGE DES EVENEMENTS D'UN FLUX EN PARTICULIER en mode non lus */
+    case 'selectedFeedNonLu':
+        $currentFeed = $feedManager->getById($_['feed']);
+        $filter = array('unread'=>1, 'feed'=>$currentFeed->getId());
+        $order = 'pubdate DESC';
+        $events = $eventManager->loadAllOnlyColumn($target,$filter,$order,$startArticle.','.$articlePerPages);
+    break;
     /* AFFICHAGE DES EVENEMENTS D'UN DOSSIER EN PARTICULIER */
     case 'selectedFolder':
         $currentFolder = $folderManager->getById($_['folder']);

+ 13 - 0
index.php

@@ -80,6 +80,19 @@ switch($action){
         $tpl->assign('order',(isset($_['order'])?$_['order']:''));
 
     break;
+    /* AFFICHAGE DES EVENEMENTS D'UN FLUX EN PARTICULIER en mode non lus */
+    case 'selectedFeedNonLu':
+        $currentFeed = $feedManager->getById($_['feed']);
+        $tpl->assign('currentFeed',$currentFeed);
+        $filter = array('unread'=>1, 'feed'=>$currentFeed->getId());
+        $numberOfItem = $eventManager->rowCount($filter);
+        $order = 'pubdate DESC';
+        $page = (isset($_['page'])?$_['page']:1);
+        $pages = ceil($numberOfItem/$articlePerPages);
+        $startArticle = ($page-1)*$articlePerPages;
+        $events = $eventManager->loadAllOnlyColumn($target,$filter,$order,$startArticle.','.$articlePerPages);
+
+        break;
     /* AFFICHAGE DES EVENEMENTS D'UN DOSSIER EN PARTICULIER */
     case 'selectedFolder':
         $currentFolder = $folderManager->getById($_['folder']);

+ 2 - 2
templates/marigolds/index.html

@@ -159,7 +159,7 @@
                 <!-- ENTETE ARTICLE -->
                 <header class="articleHead">
 
-                {if="$action=='selectedFeed'"}
+                {if="$action=='selectedFeed' || ($action=='selectedFeedNonLu')"}
                 <!-- AFFICHAGE DES EVENEMENTS D'UN FLUX EN PARTICULIER -->
 
 
@@ -167,7 +167,7 @@
                     <div class="clear"></div>
                         {$currentFeed->getDescription()}
                             {function="_t('SEE_THE')"}
-                    <a href="index.php?action=selectedFeed&amp;feed={$_['feed']}&amp;page={$page}&amp;order=unread">{function="ucfirst(_t('UNREAD'))"}</a> |
+                    <a href="index.php?action=selectedFeedNonLu&amp;feed={$_['feed']}&amp;page={$page}">{function="ucfirst(_t('UNREAD'))"}</a> |
                     <a href="index.php?action=selectedFeed&amp;feed={$_['feed']}&amp;page={$page}&amp;order=older">{function="_t('OLDER')"}</a> {function="_t('IN_FIRST')"}
                 {/if}
 

+ 5 - 2
templates/marigolds/js/script.js

@@ -448,6 +448,7 @@ function readThis(element,id,from,callback){
                             $('#nbarticle').html(parseInt($('#nbarticle').html()) - 1)
                         break;
                         case 'selectedFolder':
+                        case 'selectedFeedNonLu':
                             parent.addClass('eventRead');
                             if(callback){
                                 callback();
@@ -483,7 +484,8 @@ function readThis(element,id,from,callback){
                             if( console && console.log && msg!="" ) console.log(msg);
                             parent.removeClass('eventRead');
                             // on compte combien d'article ont été remis à non lus
-                            if ( (activeScreen=='') || (activeScreen=='selectedFolder') ) $(window).data('nblus', $(window).data('nblus')-1);
+                            if ((activeScreen=='') || (activeScreen=='selectedFolder')|| (activeScreen=='selectedFeedNonLu'))
+                                $(window).data('nblus', $(window).data('nblus')-1);
                             if(callback){
                                 callback();
                             }
@@ -510,7 +512,8 @@ function unReadThis(element,id,from){
                         if( console && console.log && msg!="" ) console.log(msg);
                         parent.removeClass('eventRead');
                         // on compte combien d'article ont été remis à non lus
-                        if ( (activeScreen=='') || (activeScreen=='selectedFolder') ) $(window).data('nblus', $(window).data('nblus')-1);
+                        if ((activeScreen=='') || (activeScreen=='selectedFolder')|| (activeScreen=='selectedFeedNonLu'))
+                            $(window).data('nblus', $(window).data('nblus')-1);
                         // on augmente le nombre d'article en haut de page
                         if (activeScreen=='') $('#nbarticle').html(parseInt($('#nbarticle').html()) + 1);
                     }