summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 10e67b5)
raw | patch | inline | side by side (parent: 10e67b5)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 20 Dec 2007 12:52:49 +0000 (12:52 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 20 Dec 2007 12:52:49 +0000 (12:52 +0000) |
-Enabled multiple edit for a set of connectivity addons
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8158 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8158 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/plugins/personal/connectivity/class_connectivity.inc b/gosa-core/plugins/personal/connectivity/class_connectivity.inc
index 6efe9d75c465ba4a18ff94eea356f6d20883f72a..8aa1836d6d8eb584cde33e1e7762b8e2449202a1 100644 (file)
return($message);
}
+ function get_multi_init_values()
+ {
+ $ret = array();
+ foreach($this->plugin as $name => $plugin){
+ $ret = array_merge($ret,$plugin->get_multi_init_values());
+ }
+ return($ret);
+ }
+
+ function init_multiple_support($attrs,$attr)
+ {
+ foreach($this->plugin as $name => $plugin){
+ $this->plugin[$name]->init_multiple_support($attrs,$attr);
+ }
+ }
+
function get_multi_edit_values()
{
$ret['plugin'] = &$this->plugin;
diff --git a/gosa-core/plugins/personal/connectivity/class_intranetAccount.inc b/gosa-core/plugins/personal/connectivity/class_intranetAccount.inc
index da2fb16894705514073b5c9937fce9c9610e70be..e1c9ffca9a423e21d4ba0b2b1848ebe2da060a67 100644 (file)
}
$smarty->assign('gosaIntranetACL', $this->getacl("",$this->ReadOnly));
-
$smarty->assign("use_intranet",in_array("intranet",$this->multi_boxes));
$smarty->assign("multiple_support",$this->multiple_support_active);
$display.= $smarty->fetch (get_template_path('intranet.tpl', TRUE, dirname(__FILE__)));
{
if (isset($_POST['connectivityTab'])){
plugin::multiple_save_object();
- if (isset($_POST['intranet'])){
- if (!$this->is_account && $_POST['intranet'] == "B"){
- if($this->acl_is_createable()){
- $this->is_account= TRUE;
- }
- }
- } else {
- if($this->acl_is_removeable()){
- $this->is_account= FALSE;
- }
- }
if(isset($_POST['use_intranet'])){
$this->multi_boxes[] = "intranet";
+ if (isset($_POST['intranet'])){
+ if (!$this->is_account && $_POST['intranet'] == "B"){
+ if($this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
+ }
+ } else {
+ if($this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }
+ }
}
}
}
$this->is_account = $values['is_account'];
}
}
+
+ function init_multiple_support($attrs,$all)
+ {
+ plugin::init_multiple_support($attrs,$all);
+ if(isset($attrs['objectClass']) && in_array("gosaIntranetAccount",$attrs['objectClass'])){
+ $this->is_account = TRUE;
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/gosa-core/plugins/personal/connectivity/class_phpgwAccount.inc b/gosa-core/plugins/personal/connectivity/class_phpgwAccount.inc
index 7c5cf6e2c879a59af2bf835153c17505ddcd3cd7..0e2ac36b1fd0d4ce411b765d16b3e72617fed403 100644 (file)
var $uid = "";
var $view_logged = FALSE;
+
+ var $multiple_support = TRUE;
function phpgwAccount (&$config, $dn= NULL)
{
$smarty->assign("phpgwState", "");
}
- if((!$this->ReadOnly)&&(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable()))) {
- $smarty->assign('phpgwAccountACL', "");
- }else{
- $smarty->assign('phpgwAccountACL', " disabled ");
- }
-
+ $smarty->assign('phpgwAccountACL', $this->getacl("",$this->ReadOnly));
+ $smarty->assign("multiple_support",$this->multiple_support_active);
+ $smarty->assign("use_phpgw",in_array("phpgw",$this->multi_boxes));
$display.= $smarty->fetch (get_template_path('phpgw.tpl', TRUE, dirname(__FILE__)));
return ($display);
}
"plProvidedAcls" => array()
));
}
+
+
+ function multiple_save_object()
+ {
+ if (isset($_POST['connectivityTab'])){
+ plugin::multiple_save_object();
+
+ /* Do we need to flip is_account state? */
+ if(isset($_POST['use_phpgw'])){
+ $this->multi_boxes[] = "phpgw";
+ if (isset($_POST['connectivityTab'])){
+ if (isset($_POST['phpgw'])){
+ if (!$this->is_account && $_POST['phpgw'] == "B"){
+ if($this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
+ }
+ } else {
+ if($this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ function get_multi_edit_values()
+ {
+ $ret = plugin::get_multi_edit_values();
+ if(in_array("phpgw",$this->multi_boxes)){
+ $ret['is_account'] = $this->is_account;
+ }
+ return($ret);
+ }
+
+ function set_multi_edit_values($values)
+ {
+ plugin::set_multi_edit_values($values);
+ if(isset($values['is_account'])){
+ $this->is_account = $values['is_account'];
+ }
+ }
+
+ function init_multiple_support($attrs,$all)
+ {
+ plugin::init_multiple_support($attrs,$all);
+ if(isset($attrs['objectClass']) && in_array("phpgwAccount",$attrs['objectClass'])){
+ $this->is_account = TRUE;
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/gosa-core/plugins/personal/connectivity/class_webdavAccount.inc b/gosa-core/plugins/personal/connectivity/class_webdavAccount.inc
index 59fdb60ef8ce24000dbdc102a315a9ae81be5242..4d7c179ded461f579c81029d8f377cf5d72db18f 100644 (file)
var $view_logged = FALSE;
var $uid ="";
+ var $multiple_support =TRUE;
+
function webdavAccount (&$config, $dn= NULL)
{
plugin::plugin ($config, $dn);
$smarty->assign("tabbed", 1);
}
- if((!$this->ReadOnly) && (($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable()))) {
- $smarty->assign('webdavAccountACL', "");
- }else{
- $smarty->assign('webdavAccountACL', " disabled ");
- }
-
+ $smarty->assign('webdavAccountACL', $this->getacl("",$this->ReadOnly));
+ $smarty->assign("use_webdav",in_array("webdav",$this->multi_boxes));
+ $smarty->assign("multiple_support",$this->multiple_support_active);
$display.= $smarty->fetch (get_template_path('webdav.tpl', TRUE, dirname(__FILE__)));
return ($display);
}
"plProvidedAcls" => array()
));
}
+
+ function multiple_save_object()
+ {
+ if (isset($_POST['connectivityTab'])){
+ plugin::multiple_save_object();
+
+ if(isset($_POST['use_webdav'])){
+ $this->multi_boxes[] = "webdav";
+ if (isset($_POST['webdav'])){
+ if (!$this->is_account && $_POST['webdav'] == "B"){
+ if($this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
+ }
+ } else {
+ if($this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }
+ }
+ }
+ }
+ }
+
+ function get_multi_edit_values()
+ {
+ $ret = plugin::get_multi_edit_values();
+ if(in_array("webdav",$this->multi_boxes)){
+ $ret['is_account'] = $this->is_account;
+ }
+ return($ret);
+ }
+
+ function set_multi_edit_values($values)
+ {
+ plugin::set_multi_edit_values($values);
+ if(isset($values['is_account'])){
+ $this->is_account = $values['is_account'];
+ }
+ }
+
+ function init_multiple_support($attrs,$all)
+ {
+ plugin::init_multiple_support($attrs,$all);
+ if(isset($attrs['objectClass']) && in_array("gosaWebdavAccount",$attrs['objectClass'])){
+ $this->is_account = TRUE;
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/gosa-core/plugins/personal/connectivity/phpgw.tpl b/gosa-core/plugins/personal/connectivity/phpgw.tpl
index 299da67162db24bf52d9d2aeecad805369e9991f..a63cddaa2e71ff2194831f9c42e564e7277f6906 100644 (file)
<h2>
- <input type="checkbox" name="phpgw" value="B" {$phpgwState} {$phpgwAccountACL}>
+{render acl=$phpgwAccountACL checkbox=$multiple_support checked=$use_phpgw}
+ <input type="checkbox" name="phpgw" value="B" {$phpgwState} class="center">
+{/render}
{t}PHPGroupware account{/t}
+
</h2>
diff --git a/gosa-core/plugins/personal/connectivity/webdav.tpl b/gosa-core/plugins/personal/connectivity/webdav.tpl
index ecd567cd3ba9523db04467400ef6f448bc95aa00..df52197a50415fbf36462fb5564d28650a1c40cd 100644 (file)
<h2>
- <input type="checkbox" name="webdav" value="B" {$webdavState} {$webdavAccountACL}>
+{render acl=$webdavAccountACL checkbox=$multiple_support checked=$use_webdav}
+ <input type="checkbox" name="webdav" value="B" {$webdavState} class="center">
+{/render}
{t}WebDAV account{/t}
</h2>