Code

5d4b6dafd14b737330605439b6d037059c783d18
[gosa.git] / gosa-plugins / goto / admin / groups / apps / class_groupApplication2.inc
1 <?php
2 class appgroup2 extends plugin
3 {
4   /* CLI vars */
5   var $cli_summary= "Manage application groups";
6   var $cli_description= "Some longer text\nfor help";
7   var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
10   var $config;
11   var $curbase;
13   /* Contains the menu structure in an array.
14    */
15   var $a_Structure= array();
16   var $a_Structure_on_load = array();
17   var $Releases;
18   var $FAIrelease = 0;
19   var $apps = array();
20   var $_cache = array();
22   public function __construct(&$config, $dn= NULL, $parent= NULL)
23   {
24     plugin::plugin($config,$dn,$parent);
25     $this->dn = $dn; 
26     $this->_load_menu_structure();
27     $this->a_Structure_on_load = $this->a_Structure;
29     /* Check if we have relase mangement enabled and prepare group application for release management */
30     $tmp = $config->search("faiManagement", "CLASS",array('menu','tabs'));
31     if(!empty($tmp)){
32       $this->enableReleaseManagement = true;
33     }
35     /* Get required release informations */
36     if($this->enableReleaseManagement){
37       $this->Releases   = $this->getReleases();
38 #      $this->FAIrelease = 0;
39     }
40 #    $this->curbase = $this->config->current['BASE'];
41     $this->reload();
42   }
45   function reload()
46   {
47     $ret = array();
48     $release_info = $this->Releases[$this->FAIrelease];
50     if(1 | !isset($this->_cache['ReleaseApps'][$release_info['suffix']])){
52       $ldap = $this->config->get_ldap_link();
53       $ldap->cd($this->curbase);
54       $ldap->search("ou=apps",array("dn"));
55       $app_deps = array();
56       while($attrs = $ldap->fetch()){
57         $app_deps[] = $attrs['dn'];
58       }
60       foreach($app_deps as $dep){
61         $ldap->cd($dep);
62         $ldap->search("objectClass=FAIbranch",array("dn"));
63         while($attrs = $ldap->fetch()){
64           $app_deps[] = $attrs['dn'];
65         }
66       }
68       foreach($app_deps as $dep){
69         if(preg_match("/^".normalizePreg($release_info['suffix'])."/",$dep)){
70           $ret = array_merge($ret,get_list("(objectClass=gosaApplication)","application",$dep,array("*"),GL_NONE));
71         }
72       }
73       $this->_cache['ReleaseApps'][$release_info['suffix']] = $ret;
74     } 
75     $this->apps = $this->_cache['ReleaseApps'][$release_info['suffix']];
76   }
79   function getReleases()
80   {
81     /* Only display those releases that we are able to read */
82     $dn     = $this->config->current['BASE'];
83     $filter = "(&(objectClass=organizationalUnit)(objectClass=FAIbranch))";
84     $res    = get_list($filter,"application", $dn, array("ou"), GL_SUBSEARCH);
86     $ret =array(array("name" => "/" , "parts" => array(),"suffix" => get_ou('applicationou')));
87     foreach($res as $attrs){
88       if(preg_match("/".get_ou('applicationou')."/",$attrs['dn'])){
89         $bb     = preg_replace("/".get_ou('applicationou').".*/","",$attrs['dn']);
90         $parts  = array_reverse(split("ou=",$bb));
92         $str ="";
93         foreach($parts as $key => $part){
94           if(empty($part)) {
95             unset($parts[$key]);
96             continue;
97           }
98           $part = str_replace(",","",$part);
99           $str .= $part."/";
100           $parts[$key] = $part;
101         }
102         $name = preg_replace("/\/$/","",$str);
103         if(empty($name)) {
104           $name ="/";
105         }
106         $ret[] = array("name" => $name , "dn" => $attrs['dn'], "parts" => $parts,"suffix" => $bb.get_ou('applicationou'));
107       }
108     }
109     return($ret);
110   }
113   function _load_menu_structure()
114   {
115     $this->a_Structure  = array();
116     $ldap = $this->config->get_ldap_link();
117     $ldap->cd($this->dn);
118     $ldap->search("(|(objectClass=gotoSubmenuEntry)(objectClass=FAIbranch)(objectClass=gotoMenuEntry))",array("*"));
119     $parent_id = 0;
120     while($attrs = $ldap->fetch()){
121       $cur = &$this->a_Structure;
122       $sub_dn       = preg_replace("/,".normalizePreg($this->dn)."$/","",$attrs['dn']);
123       $sub_dn_array = split("\,",$sub_dn);
124       for($i = (count($sub_dn_array)-1) ; $i >= 0 ; $i--){
125         $name = preg_replace("/^[^=]*+=/","",$sub_dn_array[$i]);
126         if($i != 0){
127           foreach($cur as $key => $entry){
128             if($entry['NAME'] == $name){
129               $cur = &$cur[$key]['ENTRIES'];
130               $parent_id = $entry['UNIQID'];
131             }
132           }
133         }else{
135           $priority = 1;
136           if(isset($attrs['gosaApplicationPriority'])){
137             $priority= $attrs['gosaApplicationPriority'][0];
138           }
139           while(isset($cur[$priority])){
140             $priority ++;
141           }
143           $data = array();
144           if(in_array("gotoSubmenuEntry",$attrs['objectClass'])){
145             $type = "FOLDER";
146           }elseif(in_array("gotoMenuEntry",$attrs['objectClass'])){
147             $type = "ENTRY";
148           }elseif(in_array("FAIbranch",$attrs['objectClass'])){
149             $type = "RELEASE";
150             $data['FAIstate'] = $attrs['FAIstate'][0];
151           }
153           $data['DN']       = $attrs['dn'];
154           $data['NAME']     = $name;
155           $data['TYPE']     = $type;
156           $data['PRIORITY'] = $priority;
157           $data['ENTRIES']  = array();
158           $data['UNIQID']   = uniqid();
159           $data['PARENT']   = $parent_id;
160           $data['STATUS']   = "LOADED";
161           $cur[$priority]   = $data;
162           ksort($cur);
163         }
164       }
165     }
166   } 
169   function execute()
170   {
171     /* Call parent execute */
172     plugin::execute();
174     if(isset($_GET['r']))
175     $this->__construct($this->config,$this->dn);
177     $smarty = get_smarty();
179     /* Create application list */
180     $div = new divSelectBox("appgroup");
181     $div->SetHeight(300);
182     $departments = array();
183     $res = get_list("(objectClass=gosaDepartment)", "application", $this->curbase,array("description","cn","ou"),GL_SIZELIMIT);
184     foreach($res as $value){
185       $fdn = $value['dn'];
186       $fdn = preg_replace("/".normalizePreg($this->curbase)."/","",$fdn);
187       $fdn= @LDAP::fix($fdn);
188       if($value["description"][0]!=".."){
189         $departments[$value['dn']]= convert_department_dn($fdn)." - [".$value["description"][0]."]";
190       }else{
191         $departments[$value['dn']]=convert_department_dn($fdn)." ["._("Back")."]";
192       }
193     }
195     /* Create 'open' and 'add' links */
196 #    if($this->acl_is_writeable("gosaMemberApplication",$this->no_release_acls)){
197       $linkadd  = "<a href='?plug=".$_GET['plug']."&amp;act=add&amp;id=%s'>%s</a>";
198  #   }else{
199   #    $linkadd = "%s";
200    # }
201     $linkopen = "<a href='?plug=".$_GET['plug']."&amp;act=depopen&amp;depid=%s'>%s</a>";
203     /* Create base back entry */
204     $base_back = preg_replace("/^[^,]+,/","",$this->curbase);
205     if((strlen($base_back)>= strlen($this->config->current['BASE']))&&($this->curbase!=$this->config->current['BASE'])){
206       $div->AddEntry(array(
207             array("string"=>sprintf($linkopen,base64_encode($base_back),".. ["._("back")."]"),
208               "attach"=>"style='border:0px;'")
209             ));
210     }
212     /* Append departments for current base */
213     foreach($departments as $key => $app){
214       $div->AddEntry(array(
215             array("string"=>"<img class='center' src='images/folder.png' alt='"._("department")."'>&nbsp;".sprintf($linkopen,
216                 base64_encode($key),$app),
217               "attach"=>"style='border:0px;'")
218             ));
219     }
221   
222     /* Add applications found on this base */
223     $used_apps = $this->_get_used_entry_name();
224     foreach($this->apps as $key => $app){
225       if(in_array($app['cn'][0],$used_apps)){
226         continue;
227       }
228       if(!preg_match("/".get_ou('applicationou').normalizePreg($this->curbase)."$/",$app['dn'])){
229         continue;
230       }
232       $name = $app['cn'][0];
233       if(isset($app['description'])){
234         $name .= "&nbsp;[".$app['description'][0]."]";
235       }
236       $div->AddEntry(array(
237             array("string"=>sprintf("<input class='center' type='checkbox' value='1' name='AddApp_%s'>",$key).
238               "<img class='center' src='images/select_application.png' alt='"._("application")."'>&nbsp;".sprintf($linkadd,$key,$name),
239               "attach"=>"style='border:0px;'")
240             ));
241     }
243     
244     $smarty->assign("FAIrelease",$this->FAIrelease);
245     $smarty->assign("app_list",$div->DrawList());
246     $smarty->assign("releases",$this->Releases);
247     $smarty->assign("folders" , $this->_get_folder_names());
248     $entries = $this->_get_entries_for_release($this->FAIrelease);
249     $smarty->assign("entries",$entries);
250     $display= $smarty->fetch (get_template_path('app_list.tpl', TRUE, dirname(__FILE__)));
251     return($display);
252   }
254     
255   function _get_folder_names()
256   {
257     $data = $this->_get_entries_for_release($this->FAIrelease);
258     $ret = array();
259     foreach($data as $entry){
260       if($entry['TYPE'] == "FOLDER"){
261         $ret[$entry['UNIQID']] = $entry['NAME'];
262       }
263     }
264     return($ret);
265   }
267  
268   function _get_used_entry_name()
269   {
270     $data = $this->_get_entries_for_release($this->FAIrelease);
271     $ret = array();
272     foreach($data as $entry){
273       if($entry['TYPE'] == "ENTRY"){
274         $ret[] = $entry['NAME'];
275       }
276     }
277     return($ret);
278   }
279  
280   function _get_entries_for_release($release,$cur = NULL)
281   {
282     $release_info = $this->Releases[$release];
283     $cur = &$this->a_Structure;
285     $found = FALSE; 
286     foreach($release_info['parts'] as $name){
287       foreach($cur as $key => $obj){
288         if($obj['TYPE'] == "RELEASE" && $obj['NAME'] == $name){
289           $cur = &$cur[$key]['ENTRIES'];
290           $found = TRUE;
291           break;
292         }
293         $found = FALSE;
294       }
295     }
296     if($found){
297       return($this->_get_all_entries(TRUE,TRUE,$cur));
298     }else{
299       return(array());
300     }
301   }
304   function _edit_entry_edit($id)
305   {
306   }
309   function remove_from_parent()
310   {
311   }
314   function save()
315   {
316     $ldap = $this->config->get_ldap_link();
317     $all = $this->_get_all_entries();
318     $prio = 0;
319     foreach($all as $entry){
320       $prio ++;
321       $cur = $entry;
322       $dn = "";
324       do{  
325         if($cur['TYPE'] == "ENTRY"){
326           $dn.= "cn=".$cur['NAME'].",";
327         }elseif($cur['TYPE'] == "FOLDER"){
328           $dn.= "cn=".$cur['NAME'].",";
329         }elseif($cur['TYPE'] == "RELEASE"){
330           $dn.= "ou=".$cur['NAME'].",";
331         }
332         $cur = $all[$cur['PARENT']];
333         if(!isset($cur['PARENT'])){
334           $cur = NULL;
335         }
336       }while(is_array($cur));
337       $cur_dn = $dn.$this->dn;
339       $attrs = array();
340       switch($entry['TYPE']){
341         case "ENTRY"    :
342         { 
343           $attrs['objectClass'] = "gotoMenuEntry";
344           $attrs['cn']          = $entry['NAME'];
345           $attrs['gosaApplicationPriority'] = $prio;
346         }
347         break;
348         case "FOLDER"   : 
349         { 
350           $attrs['objectClass'] = "gotoSubmenuEntry";
351           $attrs['cn']          = $entry['NAME'];
352           $attrs['gosaApplicationPriority'] = $prio;
353         }
354         break;
355         case "RELEASE"  : 
356         { 
357           $attrs['ou']            = $entry['NAME'];
358           $attrs['objectClass']   = array();
359           $attrs['objectClass'][] = "top";
360           $attrs['objectClass'][] = "organizationalUnit";
361           $attrs['objectClass'][] = "FAIbranch";
362           $attrs['FAIstate']      = $entry['FAIstate'];
363         }
364         break;
365       }
366   
367       echo $entry['STATUS']." ---> ".$cur_dn."<br>";
368       if($entry['STATUS'] == "LOADED"){
369         continue;
370       }
371       if($entry['STATUS'] == "REMOVED"){
372         echo "REMOVE<br>";
373         $ldap->rmdir_recursive($cur_dn);
374         echo $ldap->get_error();
375       }
376       if($entry['STATUS'] == "EDITED"){
377         echo "EDITED<br>";
378         $ldap->cd($cur_dn);
379         $ldap->modify($attrs);
380         echo $ldap->get_error();
381         print_a($attrs);
382       }
383       if($entry['STATUS'] == "ADDED"){
384         echo "ADDED<br>";
385         $ldap->cd($cur_dn);
386         $ldap->add($attrs);
387         echo $ldap->get_error();
388         print_a($attrs);
389       }
390     }
391     print_a($this->a_Structure);
392     exit();
394   }
397   function check()
398   {
399   }
403   /* !\brief Handle ui POSTS, like sort up/down/delete
404    */ 
405   function save_object()
406   {
407     foreach($_POST as $name => $value){
408       if(preg_match("/del_/",$name)){
409         $id = preg_replace("/^del_/","",$name);
410         $id = preg_replace("/_(x|y)$/","",$id);
411         $this->_remove_entry_id($id);
412         break;
413       }
414       if(preg_match("/edit_/",$name)){
415         $id = preg_replace("/^edit_/","",$name);
416         $id = preg_replace("/_(x|y)$/","",$id);
417         $this->_edit_entry_edit($id);
418         break;
419       }
420       if(preg_match("/up_/",$name)){
421         $id = preg_replace("/^up_/","",$name);
422         $id = preg_replace("/_(x|y)$/","",$id);
423         $this->_move_entry_up($id);
424         break;
425       }
426       if(preg_match("/down_/",$name)){
427         $id = preg_replace("/^down_/","",$name);
428         $id = preg_replace("/_(x|y)$/","",$id);
429         $this->_move_entry_down($id);
430         break;
431       }
432     }
433     if(isset($_POST['FAIrelease'])){
434       $this->FAIrelease = $_POST['FAIrelease'];
435     }
436     if(isset($_GET['act']) && $_GET['act'] == 'depopen'){
437       $this->curbase = base64_decode($_GET['depid']);
438     }
439     if(isset($_POST['add_to_folder']) && isset($_POST['folder'])){
440       $folder = $_POST['folder'];
441       foreach($_POST as $name => $value){
442         if(preg_match("/^AddApp_[0-9]*$/",$name)){
443           $this->_add_app_id($folder,preg_replace("/^AddApp_/","",$name));   
444         }
445       }
446     }
447     if(isset($_POST['add_menu_to_folder']) && isset($_POST['menu_folder'])){
448       $folder = $_POST['menu_folder'];
449       $name = $_POST['menu_folder_name'];
450       if(strlen($name) > 0 && preg_match("/[a-z ]/i",$name)){
451         $this->_add_sub_folder($folder,$name);
452       }
453     }
454     $this->reload();
455   }
457   
458   function _add_sub_folder($folder,$name)
459   {
460     $all = $this->_get_all_entries();
461     if(isset($all[$folder])){
462       $a_folder = array();
463       $a_folder['STATUS'] = "ADDED";
464       $a_folder['NAME']   = $name;
465       $a_folder['UNIQID'] = uniqid();
466       $a_folder['PARENT'] = $folder;      
467       $a_folder['TYPE']   = "FOLDER";
468       $all[$folder]['ENTRIES'][] = $a_folder;
469     }
470   }
473   /* !\brief Remove the given id from the menu structure.
474       @param  String  ID to of the entry we want to remove.
475       @return Boolean TRUE on success
476    */
477   function _remove_entry_id($id)
478   {
479     $all = $this->_get_all_entries();
480     if(isset($all[$id])){
481       $all[$id]['STATUS'] = "REMOVED";
482       return(TRUE);
483     }
484     return(FALSE);
485   }
487   
488   /* !\brief Remove the given id from the menu structure.
489       @param  String  ID to of the entry we want to remove.
490       @return Boolean TRUE on success
491    */
492   function _add_entry($folder_id,$entry,$pos = 0)
493   {
494     $all = $this->_get_all_entries();
495     if(isset($all[$folder_id])){
497       $folder  = &$all[$folder_id];
498       $entries = $entry['ENTRIES'];
500       $entry['UNIQID'] = uniqid();     
501       $entry['PARENT'] = $folder_id;
502       $entry['ENTRIES']= array();
503       $entry['STATUS'] = "ADDED";
504       
505       $cnt = 0; 
506       $new = array();
507       $added =FALSE;
508       foreach($folder['ENTRIES'] as $key => $obj){
509         if($pos == $cnt){
510           $new[] = $entry;
511           $added = TRUE;
512           $cnt ++;
513         }
514         $new[] = $obj;
515       }
516       if(!$added){
517         $new[] = $entry;
518       }
519       $all[$folder_id]['ENTRIES'] = $new;
520       foreach($entries as $sub){
521         $this->_add_entry($entry['UNIQID'],$sub);
522       }
523       return(TRUE);
524     }
525     return(FALSE);
526   }
528   
529   function _add_app_id($folder_id,$app_id)
530   {
531     $all = $this->_get_all_entries();
532     if(isset($all[$folder_id]) && isset($this->apps[$app_id])){
534       $new = array();
535       $new['TYPE']  = "ENTRY";
536       $new['NAME']  = $this->apps[$app_id]['cn'][0];
537       $new['UNIQID']= uniqid(); 
538       $new['PARENT']= $folder_id;
539       $new['STATUS']= "ADDED";
540       $all[$folder_id]['ENTRIES'][] = $new;
541     }
542   }
545   /*! \brief move the object identified by the given ID one position up.
546       @param  String  The ID of the entry to be moved.
547       @return Boolean TRUE on success, else FALSE;
548    */
549   function _move_entry_up($id)
550   {
551     $all = $this->_get_all_entries(TRUE);
552     $parent = FALSE;
553     foreach($all as $entry){
554       if(isset($entry['UNIQID']) && $entry['UNIQID'] == $id){
555         if($parent != FALSE){
556           return($this->__switch_entries($id,"up",$parent));
557         }
558       }else{
559         if(in_array($entry['TYPE'],array("CLOSE","OPEN"))){
560           $parent = $entry['PARENT'];
561         }else{
562           $parent = $entry['UNIQID'];
563         }
564       }
565     }
566     return(FALSE);
567   }
570   /*! \brief move the object identified by the given ID one position down.
571       @param  String  The ID of the entry to be moved.
572       @return Boolean TRUE on success, else FALSE;
573    */
574   function _move_entry_down($id)
575   {
576     $all = $this->_get_all_entries(TRUE);
577     $found = FALSE;
578     foreach($all as $entry){
579       if(isset($entry['UNIQID']) && $entry['UNIQID'] == $id){
580         $found = TRUE;
581         continue;
582       }else{
583         if(in_array($entry['TYPE'],array("CLOSE","OPEN"))){
584           $parent = $entry['PARENT'];
585         }else{
586           $parent = $entry['UNIQID'];
587         }
588         if($found){
589           return($this->__switch_entries($id,"down",$parent));
590         }
591       }
592     }
593     return(FALSE);
594   }
597   /*! \brief  Return all entries linear. 
598       @param  Boolean   $add_tags  If TRUE, OPEN/CLOSE Tags will be appended.
599       @param  &Array    Start here, Pointer to an array.
600    */ 
601   function _get_all_entries($add_tags = FALSE, $skip_release = FALSE, $cur = NULL)
602   {
603     $ret = array();
604     if($cur == NULL){
605       $cur = &$this->a_Structure;
606     }
607     foreach($cur as $key => $entry){
609       if($skip_release && $entry['TYPE'] == "RELEASE"){
610         continue;
611       }    
612       if($entry['TYPE'] == "ENTRY"){
613         $found = FALSE;
614         foreach($this->apps as $app){
615           if($app['cn'][0] == $entry['NAME']){
616             $found = TRUE;
617             if(isset($app['description'][0])){
618               $entry['INFO'] = "[".$app['description'][0]."]";
619             }
620             break;
621           }
622         } 
623         if(!$found){
624           $entry['INFO'] = "<font color='red'>"._("Not available in release.")."</font>";
625         }
626       }
627       
629       $tmp = $entry;
630       if(!$add_tags){
631         $ret[$tmp['UNIQID']] = &$cur[$key];
632         if(isset($entry['ENTRIES']) && count($entry['ENTRIES'])){
633           $ret = array_merge($ret,$this->_get_all_entries($add_tags,$skip_release,&$cur[$key]['ENTRIES']));
634         }
635       }else{
636       
637         if(isset($tmp['ENTRIES'])){
638           unset($tmp['ENTRIES']);
639         }
641         if($tmp['STATUS'] != "REMOVED"){
642           $ret[] = $tmp;
643           if(isset($entry['ENTRIES']) && count($entry['ENTRIES'])){
644             $ret[] = array("TYPE" => "OPEN", "PARENT" => $entry['UNIQID']);
645             $ret = array_merge($ret,$this->_get_all_entries($add_tags,$skip_release,&$cur[$key]['ENTRIES']));
646             $ret[] = array("TYPE" => "CLOSE" , "PARENT" => $entry['UNIQID']);
647           }
648         }
649       }
650     }
651     return($ret);
652   }
655   /* !\brief Switch one entry with another 
656      @param  String  from  The source ID.
657      @param  String  type  "up"/"down" type switched.
658      @param  String  to    The destination ID.
659      return  Boolean TRUE on success 
660    */
661   function __switch_entries($from,$type,$to)
662   {
663     $all = $this->_get_all_entries();
665     $o_to   = &$all[$to];
666     $o_from = &$all[$from];
668     /***********************
669      * Source == Destination 
670      * Move into next parent. 
671      ************************/
672     if($to == $from){
673       $to = $o_to['PARENT'];
674       $o_to   = &$all[$to];
675     }
677     /***********************
678      * Target is container 
679      ************************/
680     if(in_array($o_to['TYPE'],array("FOLDER","RELEASE"))){
682       /***********************
683        * Move into parent folder  
684        *   + Target 
685        *   |-> Source
686        ************************/
687       if($to == $o_from['PARENT']){
689  
690         /* Check if source is a folder object 
691          */
692         $o_to_sub = &$all[$o_to['PARENT']]; 
693         if(in_array($o_to_sub['TYPE'],array("FOLDER","RELEASE"))){
695           $o_from['STATUS'] = "ADDED";
697           /* Adding new */
698           $tmp2 = array();  
699           $cnt = 0; 
700           foreach($o_to_sub['ENTRIES'] as $key => $entry){
701             $cnt ++;
702             if($entry['UNIQID'] == $to){
703               break;
704             }
705           }
706           if($type == "up"){
707             $cnt --;
708  
709          }
710          $this->_add_entry($o_to_sub['UNIQID'],$o_from,$cnt);
712           /* Removing old */
713           $tmp = array();
714           if(!$this->_remove_entry_id($from)){
715             return(FALSE);
716           }
717         } 
718       }else{
720         /***********************
721          * Target is NOT parent container
722          *  + Parent Folder
723          *  |-> Source 
724          *  + Destination
725          ************************/
727         /* Removing old */
728         $o_to   = $all[$to];
729         $o_from = $all[$from];
730         $this->_add_entry($to,$o_from);
731         $this->_remove_entry_id($from);
732       }
733     }else{
735       /***********************
736        * Source and Destination in some Folder.
737        *  + Parent folder
738        *  |-> Source
739        *  |-> Destination
740        ************************/
741       $o_to   = &$all[$to];
742       $o_from = &$all[$from];
743       $parent = &$all[$o_to['PARENT']];
745       if($o_to['PARENT'] == $o_from['PARENT']){
746         $tmp = $all[$to];
747         $all[$to]   = $o_from;
748         $all[$from] = $tmp;
749   
750         /* Ensure that the app priority is updated */
751         foreach($parent['ENTRIES'] as $key => $entry){
752           $parent['ENTRIES'][$key]['STATUS'] = "EDITED";
753         }
754       }
755     }
756   }
759   /* Return plugin informations for acl handling  */ 
760   static function plInfo()
761   {
762     return (array(
763           "plShortName"   => _("Applications"),
764           "plDescription" => _("Group applications"),
765           "plSelfModify"  => FALSE,
766           "plDepends"     => array(),
767           "plPriority"    => 0,
768           "plSection"     => array("admin"),
769           "plCategory"    => array("groups"),
770           "plProvidedAcls"=> array(
771             "gosaMemberApplication"     => _("Application"),
772             "FAIrelease"                => _("Release"),
773             "gosaApplicationParameter"  => _("Application parameter"))
774           ));
775   }
778   function PrepareForCopyPaste($source)
779   {
780   }
783   function multiple_save_object()
784   {
785     if(isset($_POST['group_apps_multi'])){
786       $this->save_object(); 
787       plugin::multiple_save_object();    
788   
789       /* Get posts */
790       foreach(array("apps") as $attr){
791         if(isset($_POST['use_'.$attr])) {
792           $this->multi_boxes[] = $attr;
793         }
794       }
795     }
796   }
797   
799   function get_multi_edit_values()
800   {
801     $ret = plugin::get_multi_edit_values();
803     if(in_array("apps",$this->multi_boxes)){
804       $ret['gosaApplicationParameter'] = $this->gosaApplicationParameter;
805       $ret['Categories']               = $this->Categories;
806       $ret['gosaMemberApplication']    = $this->gosaMemberApplication;
807       $ret['FAIrelease']               = $this->FAIrelease;
808       $ret['appoption']                = $this->appoption;
809     }
810     return($ret);
811   }
813 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
814 ?>