Code

Renamed notification event parameter
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Sep 2008 10:06:10 +0000 (10:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Sep 2008 10:06:10 +0000 (10:06 +0000)
-users to user and groups to group

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12355 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/addons/goto/events/DaemonEvent_notify.tpl
gosa-plugins/goto/addons/goto/events/class_DaemonEvent_notify.inc

index 479dafb61409ee02ee33773aae4c7c53c56863fa..87e0927411034448410485bdbe01997791b586ee 100644 (file)
           <td style="width:50%;">
             <b>{t}Target users{/t}</b>
             <br>
-                       <select style="height:180px;width:100%" name="users[]"  multiple size=4>
-                               {html_options options=$users}
+                       <select style="height:180px;width:100%" name="user[]"  multiple size=4>
+                               {html_options options=$user}
                        </select>
           </td>
           <td>
             <b>{t}Target groups{/t}</b>
             <br>
-                       <select style="height:180px;width:100%" name="groups[]"  multiple size=4>
-                               {html_options options=$groups}
+                       <select style="height:180px;width:100%" name="group[]"  multiple size=4>
+                               {html_options options=$group}
                        </select>
           </td>
         </tr>
index 5c257964c179bab6dd63a9722018a34c174993ce..13bf90dd827c484585dadc17538ad52f442278a6 100644 (file)
@@ -24,14 +24,14 @@ class DaemonEvent_notify extends DaemonEvent
 {
   var $visible_for = USER_EVENT;
 
-  var $users = array();
-  var $groups= array(); 
+  var $user = array();
+  var $group= array(); 
 
   var $message = "";
   var $subject = "";
   var $from    = "";
 
-  var $attributes = array("from","users","groups","message","subject");
+  var $attributes = array("from","user","group","message","subject");
 
   public function __construct($config,$data = array())
   {
@@ -71,8 +71,8 @@ class DaemonEvent_notify extends DaemonEvent
     $smarty->assign("is_new"      , $this->is_new);
     $smarty->assign("timestamp"   , $this->get_time_select());
     
-    $smarty->assign("users" , $this->users);
-    $smarty->assign("groups" , $this->groups);
+    $smarty->assign("user" , $this->user);
+    $smarty->assign("group" , $this->group);
     
     $smarty->assign("add_str", msgPool::addButton(_("Target")));
     $smarty->assign("del_str", msgPool::delButton(_("Target")));
@@ -99,7 +99,7 @@ class DaemonEvent_notify extends DaemonEvent
     if(empty($this->from)){
       $msgs[] = msgPool::required(_("From"));
     }
-    if(!count($this->groups) && !count($this->users)){
+    if(!count($this->group) && !count($this->user)){
       $msgs[] = msgPool::required(_("Target"));
     }
     return($msgs);
@@ -110,17 +110,17 @@ class DaemonEvent_notify extends DaemonEvent
   {
     DaemonEvent::save_object();
 
-    if(isset($_POST['del_any_target']) && isset($_POST['groups'])){
-      foreach($_POST['groups'] as $id){
-        if(isset($this->groups[$id])){
-          unset($this->groups[$id]);
+    if(isset($_POST['del_any_target']) && isset($_POST['group'])){
+      foreach($_POST['group'] as $id){
+        if(isset($this->group[$id])){
+          unset($this->group[$id]);
         }
       }
     }
-    if(isset($_POST['del_any_target']) && isset($_POST['users'])){
-      foreach($_POST['users'] as $id){
-        if(isset($this->users[$id])){
-          unset($this->users[$id]);
+    if(isset($_POST['del_any_target']) && isset($_POST['user'])){
+      foreach($_POST['user'] as $id){
+        if(isset($this->user[$id])){
+          unset($this->user[$id]);
         }
       }
     }
@@ -143,8 +143,8 @@ class DaemonEvent_notify extends DaemonEvent
       $add = array($add);
     }
     foreach($add as $target){
-      if(!in_array($target,$this->users)){
-        $this->users[] = $target;
+      if(!in_array($target,$this->user)){
+        $this->user[] = $target;
       }
     }
   }
@@ -157,8 +157,8 @@ class DaemonEvent_notify extends DaemonEvent
       $add = array($add);
     }
     foreach($add as $target){
-      if(!in_array($target,$this->groups)){
-        $this->groups[] = $target;
+      if(!in_array($target,$this->group)){
+        $this->group[] = $target;
       }
     }
   }
@@ -200,8 +200,8 @@ class DaemonEvent_notify extends DaemonEvent
   {
     $ret = DaemonEvent::save();
     $ret['delivery_time'] = $ret['timestamp'];
-    $ret['users']   = array_values( $ret['users']);
-    $ret['groups']  = array_values( $ret['groups']);
+    $ret['user']   = array_values( $ret['user']);
+    $ret['group']  = array_values( $ret['group']);
     $ret['subject'] = base64_encode($ret['subject']);
     $ret['message'] = base64_encode($ret['message']);
     return($ret);