From 1e8b4cdd030672371b1b07b31cb2322b22e7c245 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 17 Sep 2010 12:02:56 +0000 Subject: [PATCH] Updated the device templates git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19753 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/goto/Device/InstallRecipe.tpl | 52 ++++++++++++++----- .../systems/goto/Device/class_Device.inc | 9 ++++ .../goto/Device/class_InstallRecipe.inc | 14 +++++ 3 files changed, 62 insertions(+), 13 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/Device/InstallRecipe.tpl b/gosa-plugins/goto/admin/systems/goto/Device/InstallRecipe.tpl index 6200e2295..93db16246 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/InstallRecipe.tpl +++ b/gosa-plugins/goto/admin/systems/goto/Device/InstallRecipe.tpl @@ -1,57 +1,83 @@ - - - - - - - - - - - - -
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc index ccbc6a7a7..a6a8a42fa 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc @@ -108,6 +108,11 @@ class Device extends plugin $message[]= msgPool::invalid(_("IP address"), "", "", "192.168.1.10"); } + // Check if there a cn given + if (empty($this->cn)){ + $message[]= msgPool::required(_("Name")); + } + // Check mac-address if (!empty($this->ipHostNumber) && !tests::is_ip($this->macAddress)){ $message[]= msgPool::invalid(_("MAC address"), "", "", "00:0C:7F:31:33:F1"); @@ -164,6 +169,10 @@ class Device extends plugin $this->dialog = new singleUserSelect($this->config, get_userinfo()); } + // Remove owner initiated + if(isset($_POST['removeManager'])) $this->manager = ""; + if(isset($_POST['removeOwner'])) $this->owner = ""; + // The user selection dialog has send that it has finished its job. // Store the posted user-dn as manager or owner. if($this->dialog && $this->dialog instanceOf singleUserSelect && count($this->dialog->detectPostActions())){ diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc index 91539f109..201ba9a45 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc @@ -24,12 +24,26 @@ class InstallRecipe extends plugin function __construct(&$config, $dn) { plugin::plugin($config, $dn); + + // Prepare list of timezones + $tmp = timezone::_get_tz_zones(); + $list = array(); + foreach($tmp['TIMEZONES'] as $name => $offset){ + if($offset >= 0){ + $list[$name] = $name." ( + ".sprintf("%0.2f",$offset/(60*60))." "._("hours").")"; + }else{ + $offset = $offset * -1; + $list[$name] = $name." ( - ".sprintf("%0.2f",($offset/(60*60)))." "._("hours").")"; + } + } + $this->timezones = $list; } function execute() { plugin::execute(); $smarty = get_smarty(); + $smarty->assign('timezones', $this->timezones); foreach($this->attributes as $attr){ $smarty->assign($attr, $this->$attr); } -- 2.30.2