diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc
index b4f83907f3eb9bf15762786d0735aa31ed574b83..78ec8dede967db3de03095669ac666ad1e540fdb 100644 (file)
/* Definitions */
var $plHeadline = "Applications";
var $plDescription = "This does something";
+ var $plIcon = "plugins/goto/images/application.png";
/* Dialog attributes */
var $apptabs = NULL;
var $enableReleaseManagement = false;
var $start_pasting_copied_objects = FALSE;
+ var $acl_base ="";
var $app_base ="";
var $app_release ="";
var $acl_module = array("application");
$this->ui = &$ui;
/* Check if copy & paste is activated */
- if($this->config->boolValueIsTrue("MAIN","ENABLECOPYPASTE")){
+ if($this->config->boolValueIsTrue("MAIN","COPYPASTE")){
$this->CopyPasteHandler = new CopyPasteHandler($this->config);
}
$this->DivListApplication = new divListApplication($this->config,$this);
if($this->IsReleaseManagementActivated()){
- /* Check if we should enable the release selection */
+ $this->acl_base = $this->config->current['BASE'];
+
+ /* Check if we should enable the release selection */
$this->enableReleaseManagement = true;
/* Hide SubSearch checkbox */
$this->DivListApplication->DisableCheckBox("SubSearch");
+ }else{
+ $this->acl_base = &$this->DivListApplication->selectedBase;
}
/* Set default release */
if(!$this->IsReleaseManagementActivated()){
- $this->app_base = get_ou("applicationou").$this->config->current['BASE'];
+ $this->app_base = get_ou("applicationRDN").$this->config->current['BASE'];
if(!session::is_set("app_filter")){
session::set("app_filter",array("app_base" => $this->app_base));
}
$app_filter = session::get("app_filter");
- $this->app_base = $app_filter['app_base'];
}else{
- $this->app_base = get_ou("applicationou").$this->config->current['BASE'];
+
+ /* Set intial release */
+ $this->app_base = get_ou("applicationRDN").$this->config->current['BASE'];
+ $rel = $config->search("faiManagement","DEFAULTFAIRELEASE",array("menu"));
+ $rels = array_flip($this->getReleases());
+ if(isset($rels[$rel])){
+ $rel = $rels[$rel];
+ }else{
+ $rel = $this->app_base;
+ }
+
if(!session::is_set("app_filter")){
- session::set("app_filter",array("app_base" => $this->app_base,"app_release" => $this->app_base));
+ session::set("app_filter",array("app_base" => $this->app_base,"app_release" => $rel));
}
$app_filter = session::get("app_filter");
$this->app_base = $app_filter['app_base'];
/* Create new usertab object */
$this->apptabs= new apptabs($this->config,$this->config->data['TABS']['APPSTABS'], $this->dn,"application");
$this->apptabs->parent = &$this;
- $this->apptabs->set_acl_base($this->app_base);
+ $this->apptabs->set_acl_base($this->acl_base);
}
/* Register apptabs to trigger edit dialog */
$this->apptabs= new apptabs($this->config,$this->config->data['TABS']['APPSTABS'], $this->dn,"application");
+ if($this->IsReleaseManagementActivated()){
+ $this->apptabs->set_FAIstate($this->applications[$s_entry]['FAIstate'][0]);
+ }
$this->apptabs->parent = &$this;
$this->apptabs->set_acl_base($this->dn);
session::set('objectinfo',$this->dn);
$dns_names = array();
foreach($this->dns as $dn){
add_lock ($dn, $this->ui->dn);
- $dns_names[] =@LDAP::fix($dn);
+ $dns_names[] =LDAP::fix($dn);
}
/* Lock the current entry, so nobody will edit it during deletion */
/* Lock the current entry, so nobody will edit it during deletion */
add_lock ($this->dn, $this->ui->dn);
$smarty= get_smarty();
- $smarty->assign("intro",msgPool::deleteInfo(@LDAP::fix($this->dn),_("application")));
+ $smarty->assign("intro",msgPool::deleteInfo(LDAP::fix($this->dn),_("application")));
$smarty->assign("multiple", false);
return($smarty->fetch (get_template_path('remove.tpl', TRUE)));
} else {
/* Don't show buttons if tab dialog requests this */
if (!$this->apptabs->by_object[$this->apptabs->current]->dialog){
$display.= "<p style=\"text-align:right\">\n";
- $display.= "<input type=\"submit\" name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
- $display.= " \n";
- if ($this->dn != "new"){
- $display.= "<input type=submit name=\"edit_apply\" value=\"".msgPool::applyButton()."\">\n";
+
+ if(isset($this->apptabs->FAIstate) && !preg_match("/freeze/i",$this->apptabs->FAIstate)){
+ $display.= "<input type=\"submit\" name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
$display.= " \n";
+ if ($this->dn != "new"){
+ $display.= "<input type=submit name=\"edit_apply\" value=\"".msgPool::applyButton()."\">\n";
+ $display.= " \n";
+ }
}
$display.= "<input type=\"submit\" name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
$display.= "</p>";
if(!$this->IsReleaseManagementActivated()){
$use_base = $this->app_base;
if($SubSearch){
- $use_base = preg_replace("/^".normalizePreg(get_ou("applicationou"))."/","",$use_base);
+ $use_base = preg_replace("/^".preg_quote(get_ou("applicationRDN"), '/')."/","",$use_base);
}
}else{
$use_base = $this->app_release;
$SubSearch= FALSE;
}
-
+
+ /* Add FAIstate to the search attributes */
+ $search_attrs = array("cn","description","dn","objectClass");
+ if($this->IsReleaseManagementActivated()) {
+ $search_attrs[] = "FAIstate";
+ }
+
if($SubSearch){
- $res= get_sub_list($Filter, "application",get_ou("applicationou"), $use_base, array("cn","description","dn","objectClass"), $Flags);
+ $res= get_sub_list($Filter, "application",get_ou("applicationRDN"), $use_base, $search_attrs, $Flags);
}else{
- $res= get_list($Filter, "application",$use_base, array("cn","description","dn","objectClass"), $Flags);
+ $res= get_list($Filter, "application",$use_base, $search_attrs, $Flags);
}
$tmp2 = array();
foreach ($res as $val){
+ if(!isset($val['FAIstate'])){
+ $val['FAIstate'][0] = "";
+ }
$tmp[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']]=$val;
$tmp2[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']] = strtolower($val['cn'][0]).$val['cn'][0].$val['dn'];
}
$app_filter['app_release'] = $this->app_release;
session::set("app_filter",$app_filter);
}elseif(!$this->IsReleaseManagementActivated()){
- $this->app_base = get_ou("applicationou").$this->DivListApplication->selectedBase;
+ $this->app_base = get_ou("applicationRDN").$this->DivListApplication->selectedBase;
$app_filter = session::get("app_filter");
$app_filter['app_base'] = $this->app_base;
session::set("app_filter",$app_filter);