summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ea8ca9)
raw | patch | inline | side by side (parent: 7ea8ca9)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 4 Apr 2008 12:05:54 +0000 (12:05 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 4 Apr 2008 12:05:54 +0000 (12:05 +0000) |
-Hide save button if freezed.
-Inherit release STATE if freezed
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10212 594d385d-05f5-0310-b6e9-bd551577e9d8
-Inherit release STATE if freezed
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10212 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/fai/admin/fai/class_divListFai.inc | patch | blob | history | |
gosa-plugins/fai/admin/fai/class_faiManagement.inc | patch | blob | history |
diff --git a/gosa-plugins/fai/admin/fai/class_divListFai.inc b/gosa-plugins/fai/admin/fai/class_divListFai.inc
index efc16028ebd1911ebdd65e49d0edf8da11e7ec36..f1c500ddf1b06b985567500e94ee86208a1d736e 100644 (file)
"FAIprofile" => array("IMG"=> "images/fai_profile.png", "NAME"=>_("Profile") , "KZL"=> "P", "VAR"=>"ShowProfiles"),
"FAItemplate" => array("IMG"=> "images/fai_template.png", "NAME"=>_("Templates") , "KZL"=> "T", "VAR"=>"ShowTemplates"));
- $editlink ="<a href='?plug=".$_GET['plug']."&edit_entry=%KEY%' title='%TITLE%'>%NAME%</a>";
/* Dynamic action col, depending on snapshot icons */
$action_col_size = 120;
}
if(preg_match("/^freeze/", $value['FAIstate'])){
+ $editlink ="<a href='?plug=".$_GET['plug']."&edit_freeze_entry=%KEY%' title='%TITLE%'>%NAME%</a>";
$action.= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'
- name='entry_edit_%KEY%' title='"._("Edit class")."'>";
+ name='entry_freeze_edit_%KEY%' title='"._("Edit class")."'>";
$action.= "<img src='images/closedlock.png' alt='F' class='center'>";
}else{
+ $editlink ="<a href='?plug=".$_GET['plug']."&edit_entry=%KEY%' title='%TITLE%'>%NAME%</a>";
$action.= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'
name='entry_edit_%KEY%' title='"._("Edit class")."'>";
if(preg_match("/d/",$value['acl'])){
diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc
index 5a781fcf878eed1bb30b71994ccb89b82881a20b..b6ea4355990103474a06652e7e4837374fc5d400 100644 (file)
var $CopyPasteHandler = FALSE;
var $base = "";
+ var $no_save;
+
/* construction/reconstruction
*/
function faiManagement (&$config, $ui)
$display = "";
$s_action = "";
$s_entry = "";
+ $no_save = FALSE; // hide Apply / Save buttons
/* If an entry was locked, these vars will be stored in a session to allow direct edit */
- session::set('LOCK_VARS_TO_USE',array("/^edit_entry$/","/^id$/","/^entry_edit_/","/^entry_delete_/","/^item_selected/","/^remove_multiple_fai_objects/","/^menu_action/"));
+ session::set('LOCK_VARS_TO_USE',array("/^edit_freeze_entry$/","/^edit_entry$/","/^id$/","/^entry_edit_/","/^entry_delete_/","/^item_selected/","/^remove_multiple_fai_objects/","/^menu_action/"));
/****************
$s_entry = preg_replace("/^entry_edit_/","",$name);
$s_entry = preg_replace("/_.*$/","",$s_entry);
$s_action = "edit";
+ }elseif(preg_match("/^entry_freeze_edit_.*/",$name)){
+ $s_entry = preg_replace("/^entry_freeze_edit_/","",$name);
+ $s_entry = preg_replace("/_.*$/","",$s_entry);
+ $s_action = "edit";
+ $no_save = TRUE;
}elseif(preg_match("/^entry_delete_.*/",$name)){
$s_entry = preg_replace("/^entry_delete_/","",$name);
$s_entry = preg_replace("/_.*$/","",$s_entry);
$s_action = "edit";
}
+ if(isset($_GET['edit_freeze_entry'])){
+ $s_entry = $_GET['edit_freeze_entry'];
+ $s_action = "edit";
+ $no_save = TRUE;
+ }
+
if(isset($_GET['act']) && $_GET['act'] == "freeze_branch"){
$s_action = "freeze_branch";
}
$s_action = "del_multiple";
}
+
+ if(!empty($s_action)){
+ $this->no_save = $no_save;
+ }
+
/********************
Copy & Paste
********************/
add_lock ($this->dn, $this->ui->dn);
$this->dialog = new $a_setup[0]($this->config,$this->config->data['TABS'][$a_setup[2]],$this->dn,"fai");
+
$this->dialog->set_acl_base($this->dn);
$this->is_dialog = true;
- if(preg_match("/^freeze/", $entry['FAIstate'])){
- #$this->dialog->set_acl(array("*none*")) ;
+ if(preg_match("/^freeze/", $entry['FAIstate']) || $this->no_save){
+# $this->dialog->set_acl_base("freezed") ;
}
session::set('objectinfo',$this->dn);
}
if((isset($obj->is_dialog) && (!$obj->is_dialog)) || (isset($obj->dialog) && (!$obj->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(!$this->no_save){
+ $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>";
/* Ge listed ldap objects */
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
+
+ /* Get release tag
+ If current release is freezed, all objects are freezed to.
+ */
+ $ldap->cat($base);
+ $release_attrs = $ldap->fetch();
+ $force_freezed = FALSE;
+ if(isset($release_attrs['FAIstate'][0]) && preg_match("/freeze/i",$release_attrs['FAIstate'][0])){
+ $force_freezed = TRUE;
+ }
+
foreach($tmp as $entry){
/* Get some more informations about the object */
$obj['FAIstate'] = $object['FAIstate'][0];
}
+ if($force_freezed){
+ $obj['FAIstate'] = "freeze";
+ }
+
$this->objects[strtolower($obj['cn']).$obj['cn'].$type] = $obj;
$this->objects[strtolower($obj['cn']).$obj['cn'].$type]['type']=$type;
}