From: hickert Date: Thu, 20 Dec 2007 12:52:49 +0000 (+0000) Subject: Multiple edit X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=14ade781a544a7eaf7b475c6832e9bfcff6ecc30;p=gosa.git Multiple edit -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 --- diff --git a/gosa-core/plugins/personal/connectivity/class_connectivity.inc b/gosa-core/plugins/personal/connectivity/class_connectivity.inc index 6efe9d75c..8aa1836d6 100644 --- a/gosa-core/plugins/personal/connectivity/class_connectivity.inc +++ b/gosa-core/plugins/personal/connectivity/class_connectivity.inc @@ -227,6 +227,22 @@ class connectivity extends plugin 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 da2fb1689..e1c9ffca9 100644 --- a/gosa-core/plugins/personal/connectivity/class_intranetAccount.inc +++ b/gosa-core/plugins/personal/connectivity/class_intranetAccount.inc @@ -87,7 +87,6 @@ class intranetAccount extends plugin } $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__))); @@ -211,19 +210,19 @@ class intranetAccount extends plugin { 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; + } + } } } } @@ -244,6 +243,14 @@ class intranetAccount extends plugin $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 7c5cf6e2c..0e2ac36b1 100644 --- a/gosa-core/plugins/personal/connectivity/class_phpgwAccount.inc +++ b/gosa-core/plugins/personal/connectivity/class_phpgwAccount.inc @@ -17,6 +17,8 @@ class phpgwAccount extends plugin var $uid = ""; var $view_logged = FALSE; + + var $multiple_support = TRUE; function phpgwAccount (&$config, $dn= NULL) { @@ -55,12 +57,9 @@ class phpgwAccount extends plugin $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); } @@ -166,6 +165,57 @@ class phpgwAccount extends plugin "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 59fdb60ef..4d7c179de 100644 --- a/gosa-core/plugins/personal/connectivity/class_webdavAccount.inc +++ b/gosa-core/plugins/personal/connectivity/class_webdavAccount.inc @@ -13,6 +13,8 @@ class webdavAccount extends plugin var $view_logged = FALSE; var $uid =""; + var $multiple_support =TRUE; + function webdavAccount (&$config, $dn= NULL) { plugin::plugin ($config, $dn); @@ -51,12 +53,9 @@ class webdavAccount extends plugin $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); } @@ -165,6 +164,53 @@ class webdavAccount extends plugin "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 299da6716..a63cddaa2 100644 --- a/gosa-core/plugins/personal/connectivity/phpgw.tpl +++ b/gosa-core/plugins/personal/connectivity/phpgw.tpl @@ -1,4 +1,7 @@

- +{render acl=$phpgwAccountACL checkbox=$multiple_support checked=$use_phpgw} + +{/render} {t}PHPGroupware account{/t} +

diff --git a/gosa-core/plugins/personal/connectivity/webdav.tpl b/gosa-core/plugins/personal/connectivity/webdav.tpl index ecd567cd3..df52197a5 100644 --- a/gosa-core/plugins/personal/connectivity/webdav.tpl +++ b/gosa-core/plugins/personal/connectivity/webdav.tpl @@ -1,4 +1,6 @@

- +{render acl=$webdavAccountACL checkbox=$multiple_support checked=$use_webdav} + +{/render} {t}WebDAV account{/t}