Code

Updated member selection for printer
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jan 2010 10:47:16 +0000 (10:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jan 2010 10:47:16 +0000 (10:47 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15362 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc
gosa-plugins/goto/admin/systems/goto/printer.tpl

index e296759f613fdfc2f33251d92ef93fdd7dc5f5b0..f584a00693c71a60307469f0975c243d69565922 100644 (file)
@@ -49,6 +49,11 @@ class printgeneric extends plugin
   var $view_logged    = FALSE;
   var $parent;
 
+
+  // Memeber dialog object
+  var $userSelect;
+  var $adminUserSelect;
+
   function printgeneric (&$config, $dn,$parent_init,$parent)
   {
     $this->config = &$config;
@@ -530,24 +535,40 @@ class printgeneric extends plugin
       $users = array();
       if($this->userSelect instanceOf userGroupSelect){
         $users = $this->userSelect->save();
+        $add = '';
       }elseif($this->adminUserSelect instanceOf userGroupSelect){
         $users = $this->adminUserSelect->save();
+        $add = 'Admin';
       }
       foreach($users as $user){
-        print_a($user);
-#       foreach($data as $mem){
-#         $this->AddMember($new['type'], $mem['dn']);
-#       }
+        if(in_array('gosaAccount', $user['objectClass'])){
+          $type = 'Add'.$add.'User';  
+        }else{
+          $type = 'Add'.$add.'Group';  
+        }
+        $this->AddMember($type, $user['dn']);
       }
       $this->dialog=FALSE;
       $this->userSelect = NULL;
       $this->adminUserSelect = NULL;
     }
 
-    if($this->userSelect instanceOf userGroupSelect){
-      return($this->userSelect->execute());
-    }elseif($this->adminUserSelect instanceOf userGroupSelect){
-      return($this->adminUserSelect->execute());
+    // Display add user/group dialogs 
+    if($this->userSelect instanceOf userGroupSelect || $this->adminUserSelect instanceOf userGroupSelect){
+
+      // Build up blocklist
+      $used = array();
+      foreach($this->member as $type => $members){
+        foreach($members as $member){
+          $used['dn'][] = $member['dn'];
+        }
+      }
+      session::set('filterBlacklist', $used);
+      if($this->userSelect instanceOf userGroupSelect){
+        return($this->userSelect->execute());
+      }elseif($this->adminUserSelect instanceOf userGroupSelect){
+        return($this->adminUserSelect->execute());
+      }
     }
 
 
index 535d948352d15ed7f441716d558f75274574a8ab..4d63647c52f8dd64ff267a70a40d00d8d677de50 100644 (file)
       </select><br>
 {/render}
 {render acl=$gotoUserPrinterACL}
-      <input type="submit" value="{t}Add user{/t}"  name="AddUser">
-{/render}
-{render acl=$gotoUserPrinterACL}
-      <input type="submit" value="{t}Add group{/t}" name="AddGroup">
+      <input type="submit" value="{msgPool type=addButton}"  name="AddUser">
 {/render}
 {render acl=$gotoUserPrinterACL}
       <input type="submit" value="{msgPool type=delButton}" name="DelUser">
                    </select><br>
 {/render}
 {render acl=$gotoUserPrinterACL}
-       <input type="submit" value="{t}Add user{/t}"  name="AddAdminUser">
-{/render}
-{render acl=$gotoUserPrinterACL}
-       <input type="submit" value="{t}Add group{/t}" name="AddAdminGroup">
+       <input type="submit" value="{msgPool type=addButton}"  name="AddAdminUser">
 {/render}
 {render acl=$gotoUserPrinterACL}
        <input type="submit" value="{msgPool type=delButton}" name="DelAdmin">