From: hickert Date: Thu, 7 Jul 2011 12:26:05 +0000 (+0000) Subject: Updated device tab X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=65813e6885f0017543d9cafb15253a172f52c817;p=gosa.git Updated device tab git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20944 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl b/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl index 2256d3c7a..0a966a195 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl +++ b/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl @@ -5,7 +5,7 @@

{t}Device{/t}

- +
{if $registeredRequired}{$must}{/if} {render acl=$cnACL} @@ -109,7 +109,7 @@

{t}Registration{/t}

- +
{render acl=$deviceUUIDACL} @@ -133,7 +133,7 @@ - -
+ {render acl=$deviceStatusACL} @@ -142,7 +142,7 @@
+ {render acl=$managerACL} 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 c2b102cd5..30d276a34 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc @@ -100,6 +100,10 @@ class Device extends plugin foreach($this->attributes as $attr){ $smarty->assign($attr, set_post($this->$attr)); } + + // If one attribute of the registered device is given, all others are required too. + $str = $this->manager.$this->deviceUUID.$this->deviceStatus; + $smarty->assign("registeredRequired", !empty($str)); return($smarty->fetch(get_template_path('goto/Device/Device.tpl', TRUE))); } @@ -114,11 +118,14 @@ class Device extends plugin // the others have to be set too. $str = $this->manager.$this->deviceUUID.$this->deviceStatus; if(!empty($str)){ - foreach($this->dynClasses['registeredDevice'] as $attr){ - if(empty($this->$attr)){ - $message[] = "Please set all values for 'registered device' or leave all blank! {$attr}"; - break; - } + if(empty($this->deviceStatus)){ + $message[] = msgPool::required(_("Status")); + } + if(empty($this->manager)){ + $message[] = msgPool::required(_("Manager")); + } + if(empty($this->deviceUUID)){ + $message[] = msgPool::required(_("Device UUID")); } }