fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8136]


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [8136]
Date: Mon, 21 Nov 2011 07:09:10 +0000

Revision: 8136
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8136
Author:   erikhl
Date:     2011-11-21 07:09:10 +0000 (Mon, 21 Nov 2011)
Log Message:
-----------


Modified Paths:
--------------
    trunk/activitycalendar/inc/class.sogroup.inc.php
    trunk/activitycalendar/inc/class.soorganization.inc.php

Modified: trunk/activitycalendar/inc/class.sogroup.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.sogroup.inc.php    2011-11-20 21:45:19 UTC 
(rev 8135)
+++ trunk/activitycalendar/inc/class.sogroup.inc.php    2011-11-21 07:09:10 UTC 
(rev 8136)
@@ -343,5 +343,39 @@
                        return 0;
                }
        }
+       
+       function get_group_local($g_id)
+       {
+               $columns[] = 'activity_group.id';
+               $columns[] = 'activity_group.name';
+               $columns[] = 'activity_group.description';
+               $columns[] = 'activity_group.organization_id';
+               $columns[] = 'activity_group.change_type';
+               $columns[] = 'activity_group.transferred';
+               
+               $dir = $ascending ? 'ASC' : 'DESC';
+               $order = "ORDER BY activity_group.id $dir";
+               
+               $cols = implode(',',$columns);
+               $table = "activity_group";
+               
+               $sql = "SELECT {$cols} FROM {$table} WHERE 
activity_group.id={$g_id}";
+               $result = $this->db->query($sql, __LINE__, __FILE__);
+               if(isset($result))
+               {
+                       $group = new activitycalendar_group((int) $group_id);
+
+                       $group->set_name($this->unmarshal($this->db->f('name'), 
'string'));
+                       
$group->set_organization_id($this->unmarshal($this->db->f('organization_id'), 
'int'));
+                       
$group->set_shortname($this->unmarshal($this->db->f('shortname'), 'string'));
+                       
$group->set_description($this->unmarshal($this->db->f('description'), 
'string'));
+                       
$group->set_show_in_portal($this->unmarshal($this->db->f('show_in_portal'), 
'int'));
+                       
$group->set_change_type($this->unmarshal($this->db->f('change_type'), 
'string'));
+                       
$group->set_transferred($this->unmarshal($this->db->f('transferred'), 'bool'));
+                       
+                       return $group;
+               }
+               
+       }
 }
 ?>

Modified: trunk/activitycalendar/inc/class.soorganization.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.soorganization.inc.php     2011-11-20 
21:45:19 UTC (rev 8135)
+++ trunk/activitycalendar/inc/class.soorganization.inc.php     2011-11-21 
07:09:10 UTC (rev 8136)
@@ -270,7 +270,7 @@
                $contacts = array();
        if(isset($organization_id)){
                $q1="SELECT id FROM activity_contact_person WHERE 
organization_id='{$organization_id}'";
-               var_dump($q1);
+               //var_dump($q1);
                        $this->db->query($q1, __LINE__, __FILE__);
                        while($this->db->next_record()){
                                $cont_id = $this->db->f('id');
@@ -534,6 +534,45 @@
                }
        }
        
+       function get_organization_local($org_id)
+       {
+               $columns[] = 'org.id';
+               $columns[] = 'org.name';
+               $columns[] = 'org.homepage';
+               $columns[] = 'org.phone';
+               $columns[] = 'org.email';
+               $columns[] = 'org.description';
+               $columns[] = 'org.address';
+               $columns[] = 'org.district';
+               $columns[] = 'org.change_type';
+               $columns[] = 'org.transferred';
+               $columns[] = 'org.orgno AS organization_number';
+                               
+               $cols = implode(',',$columns);  
+               $table = "activity_organization org";
+               
+               $sql = "SELECT ${cols} FROM {$table} WHERE org.id={$org_id}";
+               $result = $this->db->query($sql, __LINE__, __FILE__);
+               if(isset($result))
+               {
+                       $organization = new activitycalendar_organization((int) 
$org_id);
+       
+                       
$organization->set_name($this->unmarshal($this->db->f('name'), 'string'));
+                       
$organization->set_organization_number($this->unmarshal($this->db->f('organization_number'),
 'int'));
+                       
$organization->set_address($this->unmarshal($this->db->f('address'), 'string'));
+                       
$organization->set_phone($this->unmarshal($this->db->f('phone'), 'string'));
+                       
$organization->set_email($this->unmarshal($this->db->f('email'), 'string'));
+                       
$organization->set_homepage($this->unmarshal($this->db->f('homepage'), 
'string'));
+                       
$organization->set_district($this->unmarshal($this->db->f('district'), 
'string'));
+                       
$organization->set_description($this->unmarshal($this->db->f('description'), 
'string'));
+                       
$organization->set_change_type($this->unmarshal($this->db->f('change_type'), 
'string'));
+                       
$organization->set_transferred($this->unmarshal($this->db->f('transferred'), 
'bool'));
+                       
$organization->set_show_in_portal($this->unmarshal($this->db->f('show_in_portal'),
 'int'));
+                       
+                       return $organization;
+               }
+       }
+       
        function update($organization)
        {
                return false;




reply via email to

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