Code

Updated template stuff
[gosa.git] / gosa-core / plugins / admin / users / class_divListUsers.inc
index 582cd892ee8aa08b059983ac27e7f88a9ee27a46..e9698c400f683b8005f1283b882dcd91f0e7c95e 100644 (file)
@@ -37,6 +37,7 @@ class divListUsers extends MultiSelectWindow
   var $ShowMailUsers;
   var $ShowSambaUsers;
   var $ShowProxyUsers;
+  var $ShowPhoneUsers;
 
   /* Subsearch checkbox */
   var $SubSearch              = false;
@@ -88,6 +89,10 @@ class divListUsers extends MultiSelectWindow
     $this->AddCheckBox("ShowSambaUsers"     ,msgPool::selectToView(_("Samba"),"enabled")      ,sprintf(_("Show %s"),_("samba users")), true);
     $this->AddCheckBox("ShowProxyUsers"     ,msgPool::selectToView(_("Proxy"),"enabled")      ,sprintf(_("Show %s"),_("proxy users")), true);
 
+    if(class_available("phoneAccount")){
+      $this->AddCheckBox("ShowPhoneUsers"     ,msgPool::selectToView(_("Phone"),"enabled")      ,sprintf(_("Show %s"),_("phone users")), true);
+    }
+
     /* Add SubSearch checkbox */
     $this->AddCheckBox(SEPERATOR);
     $this->AddCheckBox("SubSearch",  msgPool::selectToView("","subsearch"), msgPool::selectToView("","subsearch_small"), false);
@@ -106,7 +111,6 @@ class divListUsers extends MultiSelectWindow
     /* Get copy & paste icon */
     $ui = get_userinfo();
     $acl      = $ui->get_permissions($this->selectedBase,"users/user");
-    $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"users");
 
     /* Add default header */
     $listhead = MultiSelectWindow::get_default_header();
@@ -133,11 +137,11 @@ class divListUsers extends MultiSelectWindow
     $s.= "..|---|\n";
     $s.= "..|<img src='images/lists/edit.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Edit")."|"."multiple_edit|\n";
-    $s.= "..|<img src='images/list_password.png' alt='' border='0' class='center'>".
+    $s.= "..|<img src='plugins/users/images/list_password.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Change password")."|"."multiple_password_change|\n";
     $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
-    $s.= "..|<img src='images/wizard.png' alt='' border='0' class='center'>".
+    $s.= "..|<img src='plugins/users/images/wizard.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Apply template")."|"."templatize_multiple|\n";
 
     /* Add event tag */
@@ -177,8 +181,8 @@ class divListUsers extends MultiSelectWindow
     /* Variable initialation */
     $enviro     = $posix = $maila = $faxac = $samba = $netatalk = "";
     $empty      = "<img class='center' src='images/empty.png' style='width:16px;height:16px;' alt='-'>";
-    $userimg    = "<img class='center' src='images/select_user.png' alt='User' title='%s'>";
-    $tplimg     = "<img class='center' src='images/select_template.png' alt='Template' title='%s'>";
+    $userimg    = "<img class='center' src='plugins/users/images/select_user.png' alt='User' title='%s'>";
+    $tplimg     = "<img class='center' src='plugins/users/images/select_template.png' alt='Template' title='%s'>";
     $editlink   = "<a href='?plug=".validate($_GET['plug'])."&amp;id=%s&amp;act=edit_entry'>%s</a>";
 
     /* Dynamic action col, depending on snapshot icons */
@@ -197,7 +201,7 @@ class divListUsers extends MultiSelectWindow
             "apple-user"      => array("VAR"=>"netatalk"  ,"IMG"=>"netatalkimg"));
 
      /* Pictures for Extensions */
-    $usrimg   ="<input class='center' type='image' src='images/select_user.png' alt='"._("GOsa")."'
+    $usrimg   ="<input class='center' type='image' src='plugins/users/images/select_user.png' alt='"._("GOsa")."'
                     name='user_edit_%KEY%-user' title='"._("Edit generic properties")."'>";
     $posiximg = "<input class='center' type='image' src='images/penguin.png' alt='"._("Posix")."'
                     name='user_edit_%KEY%-posixAccount' title='"._("Edit UNIX properties")."'>";
@@ -205,13 +209,13 @@ class divListUsers extends MultiSelectWindow
                     name='user_edit_%KEY%-environment' title='"._("Edit environment properties")."'>";
     $mailimg  = "<input class='center' type='image' src='images/mailto.png' alt='"._("Mail")."'
                     name='user_edit_%KEY%-mailAccount' title='"._("Edit mail properties")."'>";
-    $fonimg   = "<input class='center' type='image' src='images/%image%' alt='"._("Phone")."'
+    $fonimg   = "<input class='center' type='image' src='%image%' alt='"._("Phone")."'
                     name='user_edit_%KEY%-phoneAccount' title='"._("Edit phone properties")."%title%'>";
     $faximg   = "<input class='center' type='image' src='plugins/users/images/fax_small.png' alt='"._("Fax")."'
                     name='user_edit_%KEY%-gofaxAccount' title='"._("Edit fax properies")."'>";
-    $sambaimg = "<input class='center' type='image' src='images/select_winstation.png' alt='"._("Samba")."'
+    $sambaimg = "<input class='center' type='image' src='plugins/systems/images/select_winstation.png' alt='"._("Samba")."'
                     name='user_edit_%KEY%-sambaAccount' title='"._("Edit samba properties")."'>";
-    $netatalkimg = "<input class='center' type='image' src='images/select_netatalk.png' alt='"._("Netatalk")."'
+    $netatalkimg = "<input class='center' type='image' src='plugins/netatalk/images/select_netatalk.png' alt='"._("Netatalk")."'
                     name='user_edit_%KEY%-netatalk' title='"._("Edit netatalk properties")."'>";
     $tplcreateuserimg  = "<input type='image' class='center' src='images/lists/new.png' alt='"._("Create user from template")."'
                     name='userfrom_tpl_%KEY%' title='"._("Create user with this template")."'>";
@@ -235,7 +239,6 @@ class divListUsers extends MultiSelectWindow
 
       /* Add copy & cut icons */     
       $acl      = $ui->get_permissions($val['dn'],"users/user");
-      $acl_all  = $ui->has_complete_category_acls($val['dn'],"users");
      
       /* Add copy & cut functionality */
       $action.= $this->parent->get_copypaste_action($val['dn'],"users","user");
@@ -268,7 +271,7 @@ class divListUsers extends MultiSelectWindow
 
       /* Add Password change icon, if we are able to write users/password */
       if(!in_array_ics("gosaUserTemplate",$val['objectClass']) && preg_match("/w/",$ui->get_permissions($val['dn'],"users/password"))) {
-        $action.= "<input class='center' type='image' src='images/list_password.png' alt='"._("password")."'
+        $action.= "<input class='center' type='image' src='plugins/users/images/list_password.png' alt='"._("password")."'
           name='user_chgpw_%KEY%' title='"._("Change password")."'>";
       }else{
         $action.= "<img class='center' src='images/empty.png' alt='&nbsp;' 
@@ -288,10 +291,10 @@ class divListUsers extends MultiSelectWindow
       }
 
       /* Create phonaccopunt informationm, if conencted && is phoneAccount */ 
-      if((in_array("goFonAccount"    ,$val['objectClass']))){
+      if(class_available("phoneAccount") && (in_array("goFonAccount"    ,$val['objectClass']))){
 
         /* Set defaults */
-        $fonac = preg_replace("/%image%/", "select_phone.png", $fonimg);
+        $fonac = preg_replace("/%image%/", "plugins/gofon/images/select_phone.png", $fonimg);
         $fonac = preg_replace("/%KEY%/", "$key", $fonac);
         $fonac = preg_replace("/%title%/", "", $fonac);
 
@@ -346,7 +349,7 @@ class divListUsers extends MultiSelectWindow
       $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
                       "attach" => "style='width:20px;'");
       $field1 = array("string" => sprintf($tpl,$val['dn']), "attach" => "style='text-align:center;width:20px;'");
-      $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', '&nbsp;', @LDAP::fix($val['dn']))."'");
+      $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', '&nbsp;', LDAP::fix($val['dn']))."'");
       $field3 = array("string" => $UseImg, "attach" => "style='width:166px;'");
       $field4 = array("string" => $s_img_create_from_template.preg_replace("/%KEY%/", "$key", $action),
                       "attach" => "style='width:".$action_col_size."px;border-right:0px;    text-align:right;'");
@@ -373,7 +376,7 @@ class divListUsers extends MultiSelectWindow
     $num_user_str = _("Number of listed users");
     $num_dep_str = _("Number of listed departments");
 
-    $str = "<img class='center' src='images/select_user.png'
+    $str = "<img class='center' src='plugins/users/images/select_user.png'
               title='".$num_user_str."' alt='".$num_user_str."'>&nbsp;".$num_users."&nbsp;&nbsp;&nbsp;&nbsp;";
     $str.= "<img class='center' src='images/lists/folder.png'
               title='".$num_dep_str."' alt='".$num_dep_str."'>&nbsp;".$num_deps."&nbsp;&nbsp;&nbsp;&nbsp;";