Code

Page position will be saved in Lists now
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 2 Aug 2005 06:10:18 +0000 (06:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 2 Aug 2005 06:10:18 +0000 (06:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1040 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_divlist.inc
plugins/admin/applications/class_applicationManagement.inc
plugins/admin/departments/class_departmentManagement.inc
plugins/admin/groups/class_groupManagement.inc
plugins/admin/ogroups/class_ogroupManagement.inc
plugins/admin/systems/class_systemManagement.inc
plugins/admin/users/class_userManagement.inc
plugins/gofax/blocklists/class_blocklistManagement.inc
plugins/gofon/macro/class_gofonMacroManagement.inc

index d94da0bfe8987ea2b7338de71add320fca6fc4b5..7b62d34c50c2a2d352ca1e348dc1a561feeadeac 100644 (file)
@@ -7,22 +7,23 @@ class divlist {
        var $b_displayPageNums;         
        var $summary;
        var $cols;
+       var $pageid;
 
        // Members for page managment
        var $i_currentPage;
        var $i_entriesPerPage;
        
        
-       function __construct(){
-               $this->i_currentPage    =0;
-               $this->i_entriesPerPage =10;
-               $this->s_summary                ="";
-               $this->a_entries                =array();
-               $this->a_header                 =array();
-               $this->b_displayPageNums                =true;
-               $this->cols = 0;
+       function __construct($pageid){
+               $this->i_currentPage    = 0;
+               $this->i_entriesPerPage = 10;
+               $this->s_summary                = "";
+               $this->a_entries                = array();
+               $this->a_header                 = array();
+               $this->b_displayPageNums= true;
+               $this->cols                     = 0;
+               $this->pageid                   = $pageid ;
        }
-       
 
        function __destruct(){
        
@@ -108,12 +109,21 @@ class divlist {
                $i_alternate=0;
        
                if(isset($_GET['start'])){
+                       $_SESSION['start'.$this->pageid]=$_GET['start'];
                        $start = $_GET['start'];
                }else{
-                       $start=0;
+                       if(isset($_SESSION['start'.$this->pageid])){
+                               $start = $_SESSION['start'.$this->pageid];
+                       }else{
+                               $start=0;
+                       }
                }
-               $stop  = $start + $this->i_entriesPerPage;
                
+               while($start > $this->_numentries()){
+                       $start = $start - $this->i_entriesPerPage;
+               }       
+
+               $stop  = $start + $this->i_entriesPerPage;
 
                $appendempty = ($this->_numentries() -$start);
 
index fb4d3f98d939e1233926c77a08caceab1682ebb4..4ac2c0ca080031c6615f6744a53da9aae54a2c53 100644 (file)
@@ -358,7 +358,7 @@ class applicationManagement extends plugin
         $empty    = "<img src='images/empty.png' style='width:16px;height:16px;' alt=''>";
 
 
-        $divlist = new divlist();
+        $divlist = new divlist("applicationtabs");
         $divlist->SetHeader(array(
               array("string" => ""),
               array("string" => _("Application name")." / "._("Department")),
index ceb81431bcd140de0b270efb7cc3bcf4d1a4e3d0..79f1807a15c3e0b2a0994f0cf69cf7bc21cf9066 100644 (file)
@@ -290,7 +290,7 @@ class departmentManagement extends plugin
                                                "</div>";
 
                        /* Show main page */
-                       $divlist = new divlist();
+                       $divlist = new divlist("departmenttabs");
                        $divlist->SetSummary(_("This table displays all departments, in the selected tree."));
                        $divlist->SetEntriesPerPage(20);
                        $actions= "<input type='image' src='images/edit.png'             alt='"._("edit")."'    name='dep_edit_%KEY%' title='"._("Edit this entry")."'>";
index a3fde2f34d85a6d546ae4534c1fc7b03c372a99b..ae0356d769ab973a9bf383fe9c3dd4c4d71ff1c4 100644 (file)
@@ -388,7 +388,7 @@ class groupManagement extends plugin
     $empty    = "<img src='images/empty.png' style='width:16px;height:16px;' alt=''>";
 
 
-    $divlist = new divlist();
+    $divlist = new divlist("groupstab");
     $divlist->SetHeader(array(
           array("string" => "&nbsp;"),
           array("string" => _("Groupname")." / "._("Department")),
index 4d01afdbaff0dc570c80df138c68035aad687822..060d36c0ab4cb71349724da77653a3b4a417c44c 100644 (file)
@@ -394,7 +394,7 @@ name='dep_root' alt='"._("Root")."'>&nbsp;".
     $empty    = "<img src='images/empty.png' style='width:16px;height:16px;' alt=''>";
 
     // List Setup
-    $divlist = new divlist();
+    $divlist = new divlist("ogroubstab");
     $divlist->SetHeader(array(
           array("string" => "&nbsp;","attach"=>"style='width:20px;'"),
           array("string" => _("Name of object groups")." / "._("Departments")),
index e34d4802bf07d8f15cc59d0c79cd7d8bc22e73b6..c6195ce8b123333e310d7cbe6ac63518c2b123f9 100644 (file)
@@ -547,7 +547,7 @@ class systems extends plugin
     $action.= "<input type='image' src='images/editdelete.png' alt='"._("delete")."'   name='user_del_%KEY%' title='"._("Delete system")."'>";
 
 
-    $divlist = new divlist();
+    $divlist = new divlist("systemstab");
     $divlist->SetHeader(array(
           array("string" => "&nbsp;"),
           array("string" => _("System")." / "._("Department")),
index 4f00b47098f014d83ecbb40a3aabc0c072635bf8..7e8d1ea0f6e21186b3180e25a81501f7c43a7574 100644 (file)
@@ -636,7 +636,7 @@ class userManagement extends plugin
 
 
 
-    $divlist = new divlist();
+    $divlist = new divlist("userstab");
     $divlist->SetHeader(array(
                               array("string" => "&nbsp;"),
                               array("string" => _("Username")." / "._("Department")),
index 10a682e84a06b6228d2a9b35c4ffdae270099b4c..bc42936f2e5eb81f2c1a6ed9c811c2741e05760c 100644 (file)
@@ -299,7 +299,7 @@ class blocklist extends plugin
       $action.= "<input type='image' src='images/editdelete.png' alt='"._("delete")."'   name='user_del_%KEY%' title='"._("Delete user")."'>";
 
 
-      $divlist = new divlist();
+      $divlist = new divlist("faxtabs");
       $divlist->SetHeader(array(
             array("string" => "&nbsp;"),
             array("string" => _("Blocklist name")." / "._("Department")),
index 1190f7ba5fe830c16f36cbc5437740990b5d7654..24e34e856404197ba0c1fa2c14e0909198bd4697 100755 (executable)
@@ -336,7 +336,7 @@ class gofonMacro extends plugin
     $action= "<input type='image' src='images/edit.png' alt='"._("edit")."'     name='user_edit_%KEY%' title='"._("Edit user")."'>";
     $action.= "<input type='image' src='images/editdelete.png' alt='"._("delete")."'   name='user_del_%KEY%' title='"._("Delete user")."'>";
 
-    $divlist = new divlist();
+    $divlist = new divlist("macrotabs");
     $divlist->SetHeader(array(
                               array("string" => "&nbsp;"),
                               array("string" => _("Username")." / "._("Department")),