summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0b380e5)
raw | patch | inline | side by side (parent: 0b380e5)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 5 Mar 2010 15:26:54 +0000 (15:26 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 5 Mar 2010 15:26:54 +0000 (15:26 +0000) |
Allow groups to store application flags for associated applications.
They are stored as a special gosaApplicationParameter and only if
they changed compared to the original application (otherwise the gosaApplicationFlag
attribute of the group is removed from LDAP)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@16310 594d385d-05f5-0310-b6e9-bd551577e9d8
They are stored as a special gosaApplicationParameter and only if
they changed compared to the original application (otherwise the gosaApplicationFlag
attribute of the group is removed from LDAP)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@16310 594d385d-05f5-0310-b6e9-bd551577e9d8
trunk/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc | patch | blob | history | |
trunk/gosa-plugins/goto/admin/groups/apps/edit_entry.tpl | patch | blob | history |
diff --git a/trunk/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc b/trunk/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc
index 5e3b15c7ed3a9b8a42ee46e592ae4af8654b637a..8f2da4d290e13f0ea74571095dc5f5ea43e7d2a3 100644 (file)
var $enableReleaseManagement = FALSE;
var $copied_release = "";
+ var $gosaApplicationFlags;
+ var $app_flags = array(
+ "placeOnDesktop" => "D",
+ "placeOnKicker" => "L",
+ "placeInStartmenu" => "M",
+ );
public function __construct(&$config, $dn= NULL, $parent= NULL)
if(isset($attrs['gosaApplicationParameter'])){
for($p = 0 ; $p < $attrs['gosaApplicationParameter']['count'] ; $p ++){
if(preg_match("/:/",$attrs['gosaApplicationParameter'][$p])){
- $tmp = split(":",$attrs['gosaApplicationParameter'][$p]);
- $data['PARAMETER'][$tmp[0]] = preg_replace('/^[^:]+:/', '', $attrs['gosaApplicationParameter'][$p]);
+ list($key, $value) = split(":",$attrs['gosaApplicationParameter'][$p]);
+ if ($key == "gosaApplicationFlags") {
+ $data['FLAGS'] = $value;
+ }
+ else {
+ $data['PARAMETER'][$key] = $value;
+ }
}elseif($attrs['gosaApplicationParameter'][$p] == "*separator*"){
$type = "SEPERATOR";
$data['PARAMETER'] = array();
$this->__construct($this->config,$this->dn);
if(count($this->edit_entry)){
+ $smarty = get_smarty();
+ /* Checkboxes */
+ foreach ($this->app_flags as $name => $flag){
+ if (preg_match("/$flag/", $this->gosaApplicationFlags) && $this->acl_is_readable("$name")){
+
+ $smarty->assign("$name", "checked");
+ } else {
+ $smarty->assign("$name", "");
+ }
+ }
+
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $name => $translation){
+ $smarty->assign($name."ACL",$this->getacl($name));
+ }
+
if($this->edit_entry['TYPE'] == "ENTRY"){
- $smarty = get_smarty();
$smarty->assign("type", "ENTRY");
$smarty->assign("entry",$this->edit_entry);
$smarty->assign("paras",$this->app_parameter);
return($display);
}
if($this->edit_entry['TYPE'] == "FOLDER"){
- $smarty = get_smarty();
session::set("binarytype" , "image/jpeg");
session::set("binary" , $this->edit_entry['ICON']);
if($entry['TYPE'] == "ENTRY"){
$r_entry['PARAMETER'] = $this->app_parameter;
+ $r_entry['FLAGS'] = $this->gosaApplicationFlags;
if($r_entry['STATUS'] != "ADDED"){
$r_entry['STATUS'] = "EDITED";
}
}
}
if($found){
-
/* Create a list of editable parameter */
if(isset($app['gosaApplicationParameter'])){
for($i = 0 ; $i < $app['gosaApplicationParameter']['count'] ; $i++) {
}
}
+ if(isset($app['gosaApplicationFlags'])) {
+ $this->gosaApplicationFlags = $app['gosaApplicationFlags'][0];
+ }
+
/* Overwrite parameters with entry parameters */
foreach($entry['PARAMETER'] as $name => $value){
$this->app_parameter[$name] = $value;
}
+
+ if (isset($entry['FLAGS'])) {
+ $this->gosaApplicationFlags = $entry['FLAGS'];
+ }
$this->dialog = TRUE;
$this->edit_entry = $entry;
$this->app_parameter[$name] = $value;
}
}
+
if(isset($_POST['FAIrelease'])){
$this->FAIrelease = $_POST['FAIrelease'];
$this->_check_missing_release($this->FAIrelease);
}
}
if(isset($_POST['app_entry_save'])){
+ foreach($this->app_flags as $name => $flag) {
+ if($this->acl_is_writeable($name)) {
+ if(!isset($_POST[$name]) && strstr($this->gosaApplicationFlags,$flag)){
+ $this->gosaApplicationFlags = str_replace($flag,"",$this->gosaApplicationFlags);
+ }elseif(isset($_POST[$name]) && !strstr($this->gosaApplicationFlags,$flag)){
+ $this->gosaApplicationFlags = str_replace("]", "$flag]", $this->gosaApplicationFlags);
+ }
+ }
+ }
+
$this->_save_entry_edit();
}
$attrs['cn'] = $entry['NAME'];
$attrs['gosaApplicationPriority'] = $prio;
$attrs['gosaApplicationParameter'] = array();
-
+
+ if (isset($entry['FLAGS'])) {
+ /* Check if the flags changed at all */
+ $diff = FALSE;
+ foreach($this->apps as $id => $app) {
+ if($app['cn'][0] == $entry['NAME']){
+ $orig_flags = $app['gosaApplicationFlags'][0];
+ foreach($this->app_flags as $name => $flag) {
+ if((strstr($orig_flags, $flag) && !strstr($entry['FLAGS'],$flag)) || !strstr($orig_flags, $flag) && strstr($entry['FLAGS'], $flag)) {
+ $diff = TRUE;
+ break;
+ }
+ }
+ }
+ }
+ /* Only store appflags into LDAP if its different from the original app */
+ if ($diff) {
+ $attrs['gosaApplicationParameter'][] = "gosaApplicationFlags:".$entry['FLAGS'];
+ }
+ }
+
foreach($entry['PARAMETER'] as $name => $value){
$attrs['gosaApplicationParameter'][] = $name.":".$value;
}
"plProvidedAcls"=> array(
"gosaMemberApplication" => _("Application"),
"FAIrelease" => _("Release"),
- "gosaApplicationParameter" => _("Application parameter"))
- ));
+ "gosaApplicationParameter" => _("Application parameter"),
+ "placeOnDesktop" => _("Place icon on members desktop"), // D
+ "placeOnKicker" => _("Place entry in members launch bar"), // L
+ "placeInStartmenu" => _("Place entry in members startmenu") // M
+ )));
}
diff --git a/trunk/gosa-plugins/goto/admin/groups/apps/edit_entry.tpl b/trunk/gosa-plugins/goto/admin/groups/apps/edit_entry.tpl
index a0cb2fccb640e3d898408a014ffad72aa43d416f..30447c6a3ee24626cc72c6ed291302fc5a89e33a 100644 (file)
{/foreach}
</table>
{/if}
+
+<hr>
+{render acl=$placeOnDesktopACL}
+ <input type=checkbox name="placeOnDesktop" value="1" {$placeOnDesktop}>
+{/render}
+ {t}Place icon on members desktop{/t}
+ <br>
+{render acl=$placeInStartmenuACL}
+ <input type=checkbox name="placeInStartmenu" value="1" {$placeInStartmenu}>
+{/render}
+ {t}Place entry in members startmenu{/t}
+ <br>
+{render acl=$placeOnKickerACL}
+ <input type=checkbox name="placeOnKicker" value="1" {$placeOnKicker}>
+{/render}
+ {t}Place entry in members launch bar{/t}
+
<p class="seperator">
</p>
<div style="width:100%; text-align:right; padding:3px;">