From: hickert Date: Wed, 28 Nov 2007 10:12:23 +0000 (+0000) Subject: Closes #283 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ea2b2d78651d3596200f8e33ec8099193805308f;p=gosa.git Closes #283 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7927 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/branch_selector.tpl b/plugins/admin/fai/branch_selector.tpl index 2285737e5..addb5a7a2 100644 --- a/plugins/admin/fai/branch_selector.tpl +++ b/plugins/admin/fai/branch_selector.tpl @@ -17,26 +17,23 @@ {if $allow_create} - -   - {t}Create new branch{/t} + + {t}Create new branch{/t}
- + + {t}Create new locked branch{/t} {else} {t}Branch{/t} -   {t}Create new branch{/t}
{t}Freeze{/t} + {t}Create new locked branch{/t} {/if} -   - {t}Create new locked branch{/t} {if $selectedBranch != "main" && $allow_remove}
- -   - {t}Delete current release{/t} + + {t}Delete current release{/t} {/if} diff --git a/plugins/admin/fai/class_divListFai.inc b/plugins/admin/fai/class_divListFai.inc index c2ae1b9b5..b42bac348 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -103,6 +103,11 @@ class divListFai extends MultiSelectWindow $smarty->assign("selectedBranch",$this->selectedBranch); $smarty->assign("branchimage","images/branch.png"); $smarty->assign("branches",$this->AvailableBranches); + $plug_id = 0; + if(isset($_GET['plug'])){ + $plug_id = $_GET['plug']; + } + $smarty->assign("plug_id",$plug_id); $str = $smarty->fetch(get_template_path('branch_selector.tpl', TRUE)); } return($str); diff --git a/plugins/admin/fai/class_faiManagement.inc b/plugins/admin/fai/class_faiManagement.inc index 67446d5e4..f7004efa2 100644 --- a/plugins/admin/fai/class_faiManagement.inc +++ b/plugins/admin/fai/class_faiManagement.inc @@ -118,6 +118,16 @@ class faiManagement extends plugin $s_entry = $_GET['edit_entry']; $s_action = "edit"; } + + if(isset($_GET['act']) && $_GET['act'] == "freeze_branch"){ + $s_action = "freeze_branch"; + } + if(isset($_GET['act']) && $_GET['act'] == "branch_branch"){ + $s_action = "branch_branch"; + } + if(isset($_GET['act']) && $_GET['act'] == "remove_branch"){ + $s_action = "remove_branch"; + } if((isset($_POST['CancelBranchName'])) || (isset($_POST['CloseIFrame']))){ $this->dispNewBranch = false; @@ -494,7 +504,9 @@ class faiManagement extends plugin ****************/ if(isset($_GET['PerformBranch'])){ - + + $base= $this->DivListFai->selectedBranch; + $this->set_acl_base($base); if(!$this->acl_is_createable()){ print_red(_("You are not allowed to create a new branch.")); }else{ @@ -626,10 +638,16 @@ class faiManagement extends plugin */ if("" != $this->config->search("faiManagement", "POSTCREATE",array('menu','tabs'))){ if(($s_action == "branch_branch")||($this->dispNewBranch)){ - $this->dispNewBranch=true; - $smarty->assign("iframe",false); - $display .= $smarty->fetch(get_template_path('faiNewBranch.tpl', TRUE, dirname(__FILE__))); - return($display); + $base= $this->DivListFai->selectedBranch; + $this->set_acl_base($base); + if(!$this->acl_is_createable()){ + print_red(_("You are not allowed to create a new branch.")); + }else{ + $this->dispNewBranch=true; + $smarty->assign("iframe",false); + $display .= $smarty->fetch(get_template_path('faiNewBranch.tpl', TRUE, dirname(__FILE__))); + return($display); + } } } @@ -643,10 +661,16 @@ class faiManagement extends plugin */ if("" != $this->config->search("faiManagement", "POSTCREATE",array('menu','tabs'))){ if(($s_action == "freeze_branch")||($this->dispNewFreeze)){ - $this->dispNewFreeze = true; - $smarty->assign("iframe",false); - $display .= $smarty->fetch(get_template_path('faiNewBranch.tpl', TRUE, dirname(__FILE__))); - return($display); + $base= $this->DivListFai->selectedBranch; + $this->set_acl_base($base); + if(!$this->acl_is_createable()){ + print_red(_("You are not allowed to create a new branch.")); + }else{ + $this->dispNewFreeze = true; + $smarty->assign("iframe",false); + $display .= $smarty->fetch(get_template_path('faiNewBranch.tpl', TRUE, dirname(__FILE__))); + return($display); + } } } @@ -840,7 +864,7 @@ class faiManagement extends plugin /* Get available branches for current base */ function getBranches($base = false,$prefix = "") { - $ret = array("main"=>"/"); + $ret = array("/"=>"main"); $ldap = $this->config->get_ldap_link(); if(!$base){ $base= $_SESSION['CurrentMainBase']; @@ -851,6 +875,7 @@ class faiManagement extends plugin } natcasesort($ret); $ret = array_flip($ret); + return ($ret); }