Code

Added Autoscroll for department rename
[gosa.git] / plugins / admin / users / class_divListUsers.inc
index e59e5c82dad2da3dd845ed9a4b6de7237e2df27c..e63142f8a0c03a85ce7a9a6b212c77557274a47f 100644 (file)
@@ -11,12 +11,12 @@ class divListUsers extends MultiSelectWindow
   var $Regex              = "*";
 
   /* CheckBoxes */
-  var $ShowTemplates        ;
-  var $ShowFunctionalUsers  ;
-  var $ShowUnixUsers        ;
-  var $ShowMailUsers        ;
-  var $ShowSambaUsers       ;
-  var $ShowProxyUsers       ;
+  var $ShowTemplates ;
+  var $ShowFunctionalUsers;
+  var $ShowUnixUsers;
+  var $ShowMailUsers;
+  var $ShowSambaUsers;
+  var $ShowProxyUsers;
 
   /* Subsearch checkbox */
   var $SubSearch              = false;
@@ -31,12 +31,6 @@ class divListUsers extends MultiSelectWindow
     $this->parent       = $parent;
     $this->ui           = get_userinfo();
 
-    /* Set default base */
-    if(!isset($_SESSION['CurrentMainBase'])){
-      $_SESSION['CurrentMainBase'] = $this->config->current['BASE'];
-    }
-    $this->selectedBase = $_SESSION['CurrentMainBase'];
-
     /* Set list strings */
     $this->SetTitle(_("List of users"));
     $this->SetSummary(_("List of users"));
@@ -57,12 +51,12 @@ class divListUsers extends MultiSelectWindow
     $this->AddHeader(array("string"=>_("Properties"),   "attach" => "style='width:152px;'"));
     $this->AddHeader(array("string"=>_("Actions"),      "attach" => "style='width:102px;border-right:0px;text-align:right;'"));
     
-    $this->AddCheckBox("ShowTemplates"      ,_("Select to see template pseudo users")               ,_("Show templates")        ,true);
-    $this->AddCheckBox("ShowFunctionalUsers",_("Select to see users that   have only a GOsa object"),_("Show functional users") ,true);
-    $this->AddCheckBox("ShowUnixUsers"      ,_("Select to see users that have posix settings")      ,_("Show unix users")       ,true);
-    $this->AddCheckBox("ShowMailUsers"      ,_("Select to see users that have mail settings")       ,_("Show mail users")       ,true);
-    $this->AddCheckBox("ShowSambaUsers"     ,_("Select to see users that have samba settings")      ,_("Show samba users")      ,true);
-    $this->AddCheckBox("ShowProxyUsers"     ,_("Select to see users that have proxy settings")      ,_("Show proxy users")      ,true);
+    $this->AddCheckBox("ShowTemplates"      ,_("Select to see template pseudo users")               ,_("Show templates")        , false);
+    $this->AddCheckBox("ShowFunctionalUsers",_("Select to see users that have only a GOsa object"),_("Show functional users") , true);
+    $this->AddCheckBox("ShowUnixUsers"      ,_("Select to see users that have posix settings")      ,_("Show unix users")       , true);
+    $this->AddCheckBox("ShowMailUsers"      ,_("Select to see users that have mail settings")       ,_("Show mail users")       , true);
+    $this->AddCheckBox("ShowSambaUsers"     ,_("Select to see users that have samba settings")      ,_("Show samba users")      , true);
+    $this->AddCheckBox("ShowProxyUsers"     ,_("Select to see users that have proxy settings")      ,_("Show proxy users")      , true);
 
     /* Add SubSearch checkbox */
     $this->AddCheckBox(SEPERATOR);
@@ -156,16 +150,16 @@ class divListUsers extends MultiSelectWindow
     /* Possilbe objectClass image combinations */  
     $possibleAccounts = array(
             "posixAccount"    => array("VAR"=>"posix"     ,"IMG"=>"posiximg"),
-            "gotoEnvironment" => array("VAR"=>"enviro"    ,"IMG"=>"enviro"),
+            "gotoEnvironment" => array("VAR"=>"enviro"    ,"IMG"=>"eviroimg"),
             "gosaMailAccount" => array("VAR"=>"maila"     ,"IMG"=>"mailimg"),
             "goFaxAccount"    => array("VAR"=>"faxac"     ,"IMG"=>"faximg"),
             "sambaSamAccount" => array("VAR"=>"samba"     ,"IMG"=>"sambaimg"),
             "apple-user"      => array("VAR"=>"netatalk"  ,"IMG"=>"netatalkimg"));
 
      /* Pictures for Extensions */
-    $usrimg   ="<input class='center' type='image' src='images/penguin.png' alt='"._("GOsa")."'
+    $usrimg   ="<input class='center' type='image' src='images/select_user.png' alt='"._("GOsa")."'
                     name='user_edit_%KEY%-user' title='"._("Edit generic properties")."'>";
-    $posiximg = "<input class='center' type='image' src='images/select_user.png' alt='"._("Posix")."'
+    $posiximg = "<input class='center' type='image' src='images/penguin.png' alt='"._("Posix")."'
                     name='user_edit_%KEY%-posixAccount' title='"._("Edit UNIX properties")."'>";
     $eviroimg = "<input class='center' type='image' src='images/smallenv.png' alt='"._("Environment")."'
                     name='user_edit_%KEY%-environment' title='"._("Edit environment properties")."'>";
@@ -237,7 +231,7 @@ class divListUsers extends MultiSelectWindow
               $fonac = preg_replace("/%image%/", "select_phone_connected.png", $fonimg);
               $fonac = preg_replace("/%KEY%/", "$key", $fonac);
               $fonac = preg_replace("/%title%/", $connected, $fonac);
-              $ip_port= " - ".$mysql_entry[3].":".$mysql_entry[2];
+              #$ip_port= " - ".$mysql_entry[3].":".$mysql_entry[2];
             }
             if((isset($mysql_entry[0]))&&($mysql_entry[0]==0)){
               $connected = " | "._("Offline");
@@ -280,11 +274,11 @@ class divListUsers extends MultiSelectWindow
       }
 
       /* Connect all images */
-      $UseImg = $usrimg2."&nbsp;".$posix."&nbsp;".$enviro."&nbsp;".$maila."&nbsp;".$fonac."&nbsp;".$faxac."&nbsp;".$samba."&nbsp".$netatalk;
+      $UseImg = $usrimg2."&nbsp;".$posix."&nbsp;".$enviro."&nbsp;".$maila."&nbsp;".$fonac."&nbsp;".$faxac."&nbsp;".$samba."&nbsp;".$netatalk;
 
       /* Create each field */
       $field1 = array("string" => sprintf($tpl,$val['dn']), "attach" => "style='text-align:center;width:20px;'");
-      $field2 = array("string" => sprintf($editlink,$key,$display).$ip_port, "attach" => "style='' title='dn:&nbsp;".@LDAP::fix($val['dn'])."'");
+      $field2 = array("string" => sprintf($editlink,$key,$display).$ip_port, "attach" => "style='' title='".preg_replace('/ /', '&nbsp;', @LDAP::fix($val['dn']))."'");
       $field3 = array("string" => $UseImg, "attach" => "style='width:152px;'");
       $field4 = array("string" => $s_img_create_from_template.preg_replace("/%KEY%/", "$key", $action),
                       "attach" => "style='width:102px;border-right:0px;    text-align:right;'");
@@ -318,54 +312,6 @@ class divListUsers extends MultiSelectWindow
   {
     /* Save automatic created POSTs like regex, checkboxes */
     MultiSelectWindow::save_object();   
-
-    $s_action ="";
-    foreach($_POST as $key => $value){
-      if(preg_match("/^dep_back.*/i",$key)){
-        $s_action="back";
-      }elseif(preg_match("/^dep_root.*/",$key)){
-        $s_action="root";
-      }elseif(preg_match("/^dep_home.*/i",$key)){
-        $s_action="home";
-      }
-    }
-   
-    /* Save base selection from headpage selectbox*/ 
-    if(isset($_POST['CurrentMainBase'])){
-      $this->selectedBase = $_POST['CurrentMainBase'];
-    }
-
-    /* Homebutton is posted */
-    if($s_action=="home"){
-      $ui= get_userinfo();
-      $this->selectedBase=(preg_replace("/^[^,]+,/","",$ui->dn));
-      $this->selectedBase=(preg_replace("/^[^,]+,/","",$this->selectedBase));
-    }
-
-    /* Open selected department 
-       this is posted by the parent class MultiSelectWindow */
-    if(isset($_GET['act'])&& ($_GET['act'] == "dep_open")){
-      $s_entry = base64_decode($_GET['dep_id']);
-      $this->selectedBase = $this->config->departments[trim($s_entry)];
-    }
-
-    /* back to the roots ^^ */
-    if($s_action=="root"){
-      $this->selectedBase=($this->config->current['BASE']);
-    }
-
-    /* If Backbutton is Posted */
-    if($s_action=="back"){
-      $base_back          = preg_replace("/^[^,]+,/","",$this->selectedBase);
-      $base_back          = convert_department_dn($base_back);
-      if(isset($this->config->departments[trim($base_back)])){
-        $this->selectedBase= $this->config->departments[trim($base_back)];
-      }else{
-        $this->selectedBase= $this->config->departments["/"];
-      }
-    }
-
-    $_SESSION['CurrentMainBase']  = $this->selectedBase;
   }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: