fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [7285] added WS-methods for categories, targets and s


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [7285] added WS-methods for categories, targets and statuscodes.
Date: Fri, 20 May 2011 05:08:07 +0000

Revision: 7285
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7285
Author:   erikhl
Date:     2011-05-20 05:08:06 +0000 (Fri, 20 May 2011)
Log Message:
-----------
added WS-methods for categories, targets and statuscodes.

Modified Paths:
--------------
    trunk/activitycalendar/inc/class.soactivity.inc.php

Modified: trunk/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.soactivity.inc.php 2011-05-19 08:46:26 UTC 
(rev 7284)
+++ trunk/activitycalendar/inc/class.soactivity.inc.php 2011-05-20 05:08:06 UTC 
(rev 7285)
@@ -18,6 +18,21 @@
                (
                        'name'       => 'get_activities',
                        'decription' => 'Get list of activities'
+               ),
+               array
+               (
+                       'name'       => 'get_targetgroups',
+                       'decription' => 'Get list of targetgroups'
+               ),
+               array
+               (
+                       'name'       => 'get_statuscodes',
+                       'decription' => 'Get list of statuscodes'
+               ),
+               array
+               (
+                       'name'       => 'get_category_list',
+                       'decription' => 'Get list of categories'
                )
        );
 
@@ -473,4 +488,42 @@
                return $activities;
        }
        
+       function get_statuscodes()
+       {
+               $statuscodes[] = array(0,'Ingen');
+               $statuscodes[] = array(1,'Ny');
+               $statuscodes[] = array(2,'Endring');
+               $statuscodes[] = array(3,'Akseptert');
+               $statuscodes[] = array(4,'Behandlet');
+               $statuscodes[] = array(5,'Avvist');
+
+               return $statuscodes;
+       }
+       
+       function get_targetgroups()
+       {
+               $sql = "SELECT * FROM bb_agegroup where active=1 ORDER BY sort";
+               $this->db->query($sql, __LINE__, __FILE__);
+               while($this->db->next_record()){
+                       $targets[] = array(
+                                       'id'                            => 
(int) $this->db->f('id'),
+                                       'name'                          => 
$this->db->f('name',true),
+                       );
+               }
+               return $targets;
+       }
+       
+       function get_category_list()
+       {
+               $sql = "SELECT * FROM bb_activity where active=1 and 
parent_id=1";
+               $this->db->query($sql, __LINE__, __FILE__);
+               while($this->db->next_record()){
+                       $categories[] = array(
+                                       'id'                            => 
(int) $this->db->f('id'),
+                                       'name'                          => 
$this->db->f('name',true),
+                       );
+               }
+               return $categories;
+       }
+       
 }
\ No newline at end of file




reply via email to

[Prev in Thread] Current Thread [Next in Thread]