summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d8e29b7)
raw | patch | inline | side by side (parent: d8e29b7)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 8 Apr 2010 11:49:54 +0000 (11:49 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 8 Apr 2010 11:49:54 +0000 (11:49 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17546 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc b/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc
index 78db0864b678b219b47cb9bd32dce9ea74a8ca45..17f31a9041f79d63ab54f2ed41cdcb2206a35883 100644 (file)
$this->is_account= TRUE;
}
$this->initially_was_account = $this->is_account;
+
+ // Prepare lists
+ $this->applicationList = new sortableListing();
+ $this->applicationList->setDeleteable(false);
+ $this->applicationList->setEditable(true);
+ $this->applicationList->setWidth("100%");
+ $this->applicationList->setHeight("400px");
+ $this->applicationList->setColspecs(array('20px','20px','*'));
+ $this->applicationList->setHeader(array(" "," ",_("Application")));
+ $this->applicationList->setDefaultSortColumn(2);
+ $this->applicationList->setAcl('rwcdm'); // All ACLs, we filter on our own here.
+
}
}
}
- $linkopen = "<a href='?plug=".$_GET['plug']."&act=depopen&depid=%s'>%s</a>";
-
/* Create base back entry */
$base_back = preg_replace("/^[^,]+,/","",$this->curbase);
if((strlen($base_back)>= strlen($this->config->current['BASE']))&&($this->curbase!=$this->config->current['BASE'])){
- $div->AddEntry(array(
- array("string"=>sprintf($linkopen,postEncode($base_back),".. ["._("back")."]"),
- "attach"=>"style='border:0px;'")
- ));
+ $departments[$base_back]=".. ["._("back")."]";
}
- /* Append departments for current base */
+ // Append departments for current base
+ $data = $lData = array();
foreach($departments as $key => $app){
- $div->AddEntry(array(
- array("string"=>image('images/lists/folder.png')." ".
- sprintf($linkopen,postEncode($key),$app),
- "attach"=>"style='border:0px;'")
- ));
+ $img = image('images/lists/folder.png');
+ $data[$key] = array('TYPE'=>'DEP','ID'=> $app);
+ $lData[$key] = array('data' => array($img," ",$app));
+
}
-
- /* Add applications found on this base */
+ // Add applications found on this base
$used_apps = $this->_get_used_entry_name();
foreach($this->apps as $key => $app){
- if(in_array($app['cn'][0],$used_apps)){
- continue;
- }
- if(!preg_match("/".get_ou('applicationRDN').preg_quote($this->curbase, '/')."$/",$app['dn'])){
- continue;
- }
+ if(in_array($app['cn'][0],$used_apps)) continue;
+ if(!preg_match("/".get_ou('applicationRDN').preg_quote($this->curbase, '/')."$/",$app['dn'])){
+ continue;
+ }
- $name = $app['cn'][0];
- if(isset($app['description'])){
- $name .= " [".$app['description'][0]."]";
- }
- $div->AddEntry(array(
- array("string"=>sprintf("<input class='center' type='checkbox' value='1' name='AddApp_%s'>",$key).
- image('plugins/goto/images/select_application.png')." ".$name,
- "attach"=>"style='border:0px;'")
- ));
+ $name = $app['cn'][0];
+ if(isset($app['description'])){
+ $name .= " [".$app['description'][0]."]";
+ }
+ $img = image('plugins/goto/images/select_application.png');
+ $chk = "<input class='center' type='checkbox' value='1' name='AddApp_".$key."'>";
+ $data[$key] = array('TYPE'=>'APP','ID'=> $app);
+ $lData[$key] = array('data' => array($img,$chk,$name));
}
+ $this->applicationList->setListData($data,$lData);
+ $this->applicationList->update();
/* Assign copy / paste values
*/
}
$smarty->assign("enableReleaseManagement",$this->enableReleaseManagement);
$smarty->assign("FAIrelease",$this->FAIrelease);
- $smarty->assign("app_list",$div->DrawList());
+ $smarty->assign("app_list",$this->applicationList->render());
$smarty->assign("i",0);
$smarty->assign("releases",$this->Releases);
$smarty->assign("folders" , $this->_get_folder_names());
$this->FAIrelease = $_POST['FAIrelease'];
$this->_check_missing_release($this->FAIrelease);
}
- if(isset($_GET['act']) && $_GET['act'] == 'depopen'){
- $this->curbase = postDecode($_GET['depid']);
+
+ $this->applicationList->save_object();
+ $action = $this->applicationList->getAction();
+ if($action['action'] == "edit"){
+ $data= $this->applicationList->getData($action['targets'][0]);
+ $dn= $this->applicationList->getKey($action['targets'][0]);
+ if($data['TYPE'] == 'DEP'){
+ $this->curbase = $dn;
+ }elseif($data['TYPE'] == 'APP' && isset($_POST['folder'])){
+ $this->_add_app_id($_POST['folder'],$dn);
+ }
}
if(isset($_POST['add_to_folder']) && isset($_POST['folder'])){
$folder = $_POST['folder'];