summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 74feec3)
raw | patch | inline | side by side (parent: 74feec3)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 20 Dec 2007 12:21:51 +0000 (12:21 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 20 Dec 2007 12:21:51 +0000 (12:21 +0000) |
-Prepared connectivity tab, to be editable in multi edit
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8157 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8157 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 70cfd87a7adab1b2713b49a7c476494f36ccbe28..6efe9d75c465ba4a18ff94eea356f6d20883f72a 100644 (file)
var $plugin_name= array();
var $CopyPasteVars = array("plugin","plugin_name");
+ var $multiple_support = TRUE;
function connectivity (&$config, $dn= NULL,$parent =NULL)
{
$this->dn= $dn;
$ui= get_userinfo();
+ $this->config = $config;
+
/* Load accounts */
foreach ($config->data['TABS']['CONNECTIVITY'] as $plug){
$name= $plug['CLASS'];
/* Mark me as connectivity tab */
$display.= "<input type='hidden' name='connectivityTab'>";
-
return($display);
}
$this->plugin[$key]->PrepareForCopyPaste($obj);
}
}
+
+
+ function enable_multiple_support()
+ {
+ plugin::enable_multiple_support();
+
+ foreach($this->plugin_name as $key => $name){
+ if($this->plugin[$name]->multiple_support){
+ $this->plugin[$name]->enable_multiple_support();
+ }else{
+ unset($this->plugin_name[$key]);
+ unset($this->plugin[$name]);
+ }
+ }
+ }
+
+
+ function multiple_execute()
+ {
+ return($this->execute());
+ }
+
+ /* Save data to object */
+ function multiple_save_object()
+ {
+ if (isset($_POST['connectivityTab'])){
+ foreach ($this->plugin_name as $name){
+ $this->plugin[$name]->multiple_save_object();
+ }
+ }
+ }
+
+ function multiple_check()
+ {
+ $message = plugin::multiple_check();
+ foreach ($this->plugin_name as $name){
+ $message = array_merge($message,$this->plugin[$name]->multiple_check());
+ }
+ return($message);
+ }
+
+ function get_multi_edit_values()
+ {
+ $ret['plugin'] = &$this->plugin;
+ return($ret);
+ }
+
+ function set_multi_edit_values($values)
+ {
+ foreach($values['plugin'] as $name => $plugin){
+ $this->plugin[$name]->set_multi_edit_values($plugin->get_multi_edit_values());
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/gosa-core/plugins/personal/connectivity/class_intranetAccount.inc b/gosa-core/plugins/personal/connectivity/class_intranetAccount.inc
index c2b9573d32e5387063491a70b98a55a178851e08..da2fb16894705514073b5c9937fce9c9610e70be 100644 (file)
var $uid ="";
var $view_logged = FALSE;
+ var $multiple_support = TRUE;
/*! \brief Konstructor
$smarty->assign("tabbed", 0);
}
-
- $smarty->assign('gosaIntranetACL', " disabled ");
- if((!$this->ReadOnly) && ( ($this->is_account && $this->acl_is_removeable())
- || (!$this->is_account && $this->acl_is_createable()))){
- $smarty->assign('gosaIntranetACL', "");
- }
-
+ $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__)));
return ($display);
}
"plProvidedAcls" => array()
));
}
+
+
+ function multiple_save_object()
+ {
+ 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";
+ }
+ }
+ }
+
+ function get_multi_edit_values()
+ {
+ $ret = plugin::get_multi_edit_values();
+ if(in_array("intranet",$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'];
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/gosa-core/plugins/personal/connectivity/intranet.tpl b/gosa-core/plugins/personal/connectivity/intranet.tpl
index f768285feb481b414cdefb7aa13425c390a12ed0..303c0fbcabc231fbb1bc6a0b047d234de41cc22e 100644 (file)
<h2>
- <input type="checkbox" name="intranet" value="B" {$intranetState} {$gosaIntranetACL}>
+ {render acl=$gosaIntranetACL checkbox=$multiple_support checked=$use_intranet}
+ <input type="checkbox" name="intranet" value="B" {$intranetState} class="center">
{t}Intranet account{/t}
+ {/render}
</h2>