fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7242] Merge 7239:7241 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [7242] Merge 7239:7241 from trunk
Date: Mon, 02 May 2011 08:58:17 +0000

Revision: 7242
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7242
Author:   sigurdne
Date:     2011-05-02 08:58:16 +0000 (Mon, 02 May 2011)
Log Message:
-----------
Merge 7239:7241 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/model/class.arena.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/model/class.contact_person.inc.php
    branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
    branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php
    branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
    
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
    branches/Version-1_0-branch/activitycalendar/templates/base/arena.php
    branches/Version-1_0-branch/booking/inc/class.menu.inc.php
    branches/Version-1_0-branch/booking/setup/phpgw_no.lang
    branches/Version-1_0-branch/booking/setup/setup.inc.php
    branches/Version-1_0-branch/booking/setup/tables_update.inc.php

Added Paths:
-----------
    
branches/Version-1_0-branch/activitycalendar/inc/model/class.building.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/model/class.category.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/model/class.target.inc.php

Property Changed:
----------------
    branches/Version-1_0-branch/


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2011-05-02 08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2011-05-02 08:58:16 UTC (rev 7242)
@@ -5,6 +5,8 @@
 //phpgw::import_class('activitycalendar.socontactperson');
 
 include_class('activitycalendar', 'activity', 'inc/model/');
+include_class('activitycalendar', 'target', 'inc/model/');
+include_class('activitycalendar', 'category', 'inc/model/');
 
 class activitycalendar_soactivity extends activitycalendar_socommon
 {
@@ -148,7 +150,7 @@
                //$join_contracts = "   {$this->left_join} 
rental_contract_party c_p ON (c_p.party_id = party.id)
                //{$this->left_join} rental_contract contract ON (contract.id = 
c_p.contract_id)";
                
-               var_dump("SELECT {$cols} FROM {$tables} WHERE {$condition} 
{$order}");
+               //var_dump("SELECT {$cols} FROM {$tables} WHERE {$condition} 
{$order}");
                return "SELECT {$cols} FROM {$tables} WHERE {$condition} 
{$order}";
        }
 
@@ -164,7 +166,7 @@
        {
                // Insert a new activity
                $ts_now = strtotime('now');
-               $q ="INSERT INTO activity_activity (organization_id, 
create_date) VALUES (1, $ts_now)";
+               $q ="INSERT INTO activity_activity (organization_id, state, 
create_date) VALUES (1, 1, $ts_now)";
                $result = $this->db->query($q);
 
                if(isset($result)) {
@@ -202,11 +204,12 @@
                        'date_end = '    . 
$this->marshal($activity->get_date_end(), 'int'),
                        'last_change_date = '    . $this->marshal($ts_now, 
'int'),
                        'contact_person_1 = '          . 
$this->marshal($activity->get_contact_person_1(), 'int'),
-                       'contact_person_2 = '          . 
$this->marshal($activity->get_contact_person_2(), 'int')
+                       'contact_person_2 = '          . 
$this->marshal($activity->get_contact_person_2(), 'int'),
+                       'special_adaptation = '                 
.($activity->get_special_adaptation() ? "true" : "false")
                );
                
                $result = $this->db->query('UPDATE activity_activity SET ' . 
join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
-                       
+
                return isset($result);
        }
 
@@ -244,7 +247,66 @@
                        
$activity->set_date_end($this->unmarshal($this->db->f('date_end'), 'int'));
                        
$activity->set_contact_person_1($this->unmarshal($this->db->f('contact_person_1'),
 'int'));
                        
$activity->set_contact_person_2($this->unmarshal($this->db->f('contact_person_2'),
 'int'));
+                       
$activity->set_last_change_date($this->unmarshal($this->db->f('last_change_date'),
 'int'));
+                       
$activity->set_special_adaptation($this->unmarshal($this->db->f('special_adaptation',
 'bool')));
                }
                return $activity;
        }
+       
+       function get_category_name($category_id)
+       {
+               $result = "Ingen";
+               if($category_id != null)
+               {
+                       $sql = "SELECT name FROM bb_activity where 
id=$category_id";
+                       $this->db->query($sql, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $result = $this->db->f('name');
+                       }
+       }
+               return $result;
+       }
+       
+       function get_categories()
+       {
+               $categories = array();
+               $sql = "SELECT * FROM bb_activity where active=1 and 
parent_id=1";
+               $this->db->query($sql, __LINE__, __FILE__);
+               while($this->db->next_record()){
+                       $category = new 
activitycalendar_category($this->db->f('id'));
+                       $category->set_parent_id($this->db->f('parent_id'));
+                       $category->set_name($this->db->f('name'));
+                       $categories[] = $category;
+               }
+               return $categories;
+       }
+       
+       function get_target_name($target_id)
+       {
+               $result = "Ingen";
+               if($target_id != null)
+               {
+                       $sql = "SELECT name FROM bb_agegroup where 
id=$target_id";
+                       $this->db->query($sql, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $result = $this->db->f('name');
+                       }
+       }
+               return $result;
+       }
+       
+       function get_targets()
+       {
+               $targets = array();
+               $sql = "SELECT * FROM bb_agegroup where active=1";
+               $this->db->query($sql, __LINE__, __FILE__);
+               while($this->db->next_record()){
+                       $target = new 
activitycalendar_target($this->db->f('id'));
+                       $target->set_description($this->db->f('description'));
+                       $target->set_name($this->db->f('name'));
+                       $targets[] = $target;
+               }
+               return $targets;
+       }
+       
 }
\ No newline at end of file

Modified: branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php      
2011-05-02 08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php      
2011-05-02 08:58:16 UTC (rev 7242)
@@ -3,6 +3,7 @@
 phpgw::import_class('activitycalendar.socommon');
 
 include_class('activitycalendar', 'arena', 'inc/model/');
+include_class('activitycalendar', 'building', 'inc/model/');
 
 class activitycalendar_soarena extends activitycalendar_socommon
 {
@@ -175,7 +176,32 @@
                return $result;
        }
        
+       function get_buildings()
+       {
+               $buildings = array();
+       $q_buildings="SELECT id, name FROM bb_building WHERE active=1 ORDER BY 
id";
+       var_dump($q_buildings);
+               $this->db->query($q_buildings, __LINE__, __FILE__);
+               while($this->db->next_record()){
+                       $id = $this->db->f('id');
+                       $buildings[$id] = $this->db->f('name');
+               }
+               return $buildings;
+       }
        
+       function get_building_name($building_id){
+               if(isset($building_id))
+               {
+                       $q1="SELECT name FROM bb_building WHERE 
id={$building_id}";
+                       $this->db->query($q1, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $result = $this->db->f('name');
+                       }
+               }
+               return $result;
+       }
+       
+       
        /**
         * Function for adding a new arena to the database. Updates the arena 
object.
         *
@@ -203,7 +229,7 @@
        /**
         * Update the database values for an existing arena object.
         *
-        * @param $arena the party to be updated
+        * @param $arena the arena to be updated
         * @return boolean true if successful, false otherwise
         */
        function update($arena)

Modified: branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php      
2011-05-02 08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php      
2011-05-02 08:58:16 UTC (rev 7242)
@@ -155,7 +155,7 @@
        function get_group_name($group_id)
        {
                $result = "Ingen";
-       if(isset($org_id)){
+       if(isset($group_id)){
                $q1="SELECT name FROM bb_group WHERE id={$group_id}";
                        $this->db->query($q1, __LINE__, __FILE__);
                        while($this->db->next_record()){
@@ -165,6 +165,21 @@
                
                return $result;
        }
+       
+       function get_contacts($group_id)
+       {
+               $contacts = array();
+       if(isset($group_id)){
+               $q1="SELECT id FROM bb_group_contact WHERE 
group_id={$group_id}";
+                       $this->db->query($q1, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $contacts[] = $this->db->f('id');
+                       }
+                       //$result = $contacts;
+       }
+               
+               return $contacts;
+       }
 
        protected function populate(int $group_id, &$group)
        {

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2011-05-02 08:54:32 UTC (rev 7241)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2011-05-02 08:58:16 UTC (rev 7242)
@@ -145,6 +145,21 @@
                
                return $result;
        }
+       
+       function get_contacts($organization_id)
+       {
+               $contacts = array();
+       if(isset($organization_id)){
+               $q1="SELECT id FROM bb_organization_contact WHERE 
organization_id={$organization_id}";
+                       $this->db->query($q1, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $cont_id = $this->db->f('id');
+                               $contacts[] = $cont_id;
+                       }
+                       //$result=$contacts;
+       }
+               return $contacts;
+       }
 
        /**
         * Function for adding a new party to the database. Updates the party 
object.

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2011-05-02 08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2011-05-02 08:58:16 UTC (rev 7242)
@@ -22,7 +22,7 @@
        
        public function __construct()
        {
-               //parent::__construct();
+               parent::__construct();
                self::set_active_menu('activitycalendar::activities');
                $config = CreateObject('phpgwapi.config','activitycalendar');
                $config->read();
@@ -71,7 +71,9 @@
                $activity_id = (int)phpgw::get_var('id');
                //var_dump($activity_id);
                
-               
+               $categories = 
activitycalendar_soactivity::get_instance()->get_categories();
+               $targets = 
activitycalendar_soactivity::get_instance()->get_targets();
+                               
                // Retrieve the arena object or create a new one
                if(isset($activity_id) && $activity_id > 0)
                {       
@@ -81,14 +83,23 @@
                {
                        $activity = new activitycalendar_activity();
                }
-               
+               $g_id = phpgw::get_var('group_id');
+               $o_id = phpgw::get_var('organization_id');
+               if(isset($g_id) && $g_id > 0)
+               {
+                       $persons = 
activitycalendar_sogroup::get_instance()->get_contacts($g_id);
+               }
+               else if(isset($o_id) && $o_id > 0)
+               {
+                       $persons = 
activitycalendar_soorganization::get_instance()->get_contacts($o_id);
+               }
                $arenas = activitycalendar_soarena::get_instance()->get(null, 
null, null, null, null, null, null);
                $organizations = 
activitycalendar_soorganization::get_instance()->get(null, null, null, null, 
null, null, null);
                $groups = activitycalendar_sogroup::get_instance()->get(null, 
null, null, null, null, null, null);
 
                if(isset($_POST['save_activity'])) // The user has pressed the 
save button
                {
-                       if(isset($activity)) // If a arena object is created
+                       if(isset($activity)) // If a activity object is created
                        {
                                // ... set all parameters
                                
$activity->set_organization_id(phpgw::get_var('organization_id'));
@@ -96,11 +107,12 @@
                                
$activity->set_arena(phpgw::get_var('arena_id'));
                                
$activity->set_district(phpgw::get_var('district'));
                                
$activity->set_category(phpgw::get_var('category'));
+                               $activity->set_target(phpgw::get_var('target'));
                                
$activity->set_description(phpgw::get_var('description'));
                                
$activity->set_date_start(phpgw::get_var('date_start_hidden'));
                                
$activity->set_date_end(phpgw::get_var('date_end_hidden'));
-                               
$activity->set_contact_person_1(phpgw::get_var('contact_person_1'));
-                               
$activity->set_contact_person_2(phpgw::get_var('contact_person_2'));
+                               $activity->set_contact_persons($persons);
+                               
$activity->set_special_adaptation(phpgw::get_var('special_adaptation'));
                                
                                
if(activitycalendar_soactivity::get_instance()->store($activity)) // ... and 
then try to store the object
                                {
@@ -119,6 +131,8 @@
                                'organizations' => $organizations,
                                'groups' => $groups,
                                'arenas' => $arenas,
+                               'categories' => $categories,
+                               'targets' => $targets,
                                'editable' => true,
                                'message' => isset($message) ? $message : 
phpgw::get_var('message'),
                                'error' => isset($error) ? $error : 
phpgw::get_var('error')

Modified: branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php      
2011-05-02 08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php      
2011-05-02 08:58:16 UTC (rev 7242)
@@ -72,6 +72,8 @@
                // Get the contract part id
                $arena_id = (int)phpgw::get_var('id');
                
+               $buildings = 
activitycalendar_soarena::get_instance()->get_buildings();
+               //var_dump($buildings);
                
                // Retrieve the arena object or create a new one
                if(isset($arena_id) && $arena_id > 0)
@@ -82,7 +84,7 @@
                {
                        $arena = new activitycalendar_arena();
                }
-
+               
                if(isset($_POST['save_arena'])) // The user has pressed the 
save button
                {
                        if(isset($arena)) // If a arena object is created
@@ -106,6 +108,7 @@
                return $this->render('arena.php', array
                        (
                                'arena'         => $arena,
+                               'buildings' => $buildings,
                                'editable' => true,
                                'message' => isset($message) ? $message : 
phpgw::get_var('message'),
                                'error' => isset($error) ? $error : 
phpgw::get_var('error')

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php   
    2011-05-02 08:54:32 UTC (rev 7241)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php   
    2011-05-02 08:58:16 UTC (rev 7242)
@@ -14,6 +14,7 @@
                protected $group_id;
                protected $district;
                protected $category;
+               protected $target;
                protected $description;
                protected $arena;
                protected $date_start;
@@ -22,6 +23,7 @@
                protected $last_change_date;
                protected $contact_person_1;
                protected $contact_person_2;
+               protected $special_adaptation;
                
                /**
                 * Constructor.  Takes an optional ID.  If a contract is 
created from outside
@@ -62,6 +64,13 @@
                
                public function get_district() { return $this->district; }
                
+               public function set_target($target)
+               {
+                       $this->target = $target;
+               }
+               
+               public function get_target() { return $this->target; }
+               
                public function set_category($category)
                {
                        $this->category = $category;
@@ -118,6 +127,23 @@
                        $this->last_change_date = $last_change_date;
                }
                
+               public function set_contact_persons($persons)
+               {
+                       $count=0;
+                       foreach($persons as $person)
+                       {
+                               if($count == 0)
+                               {
+                                       
$this->set_contact_person_1($persons[0]);
+                               }
+                               else
+                               {
+                                       
$this->set_contact_person_2($persons[1]);
+                               }
+                               $count++;
+                       }
+               }
+               
                public function set_contact_person_1($contact_person_1)
                {
                        $this->contact_person_1 = $contact_person_1;
@@ -132,6 +158,13 @@
                
                public function get_contact_person_2() { return 
$this->contact_person_2; }
                
+               public function set_special_adaptation($special_adaptation)
+               {
+                       $this->special_adaptation = $special_adaptation;
+               }
+               
+               public function get_special_adaptation() { return 
$this->special_adaptation; }
+               
                /**
                 * Get a static reference to the storage object associated with 
this model object
                 * 
@@ -148,7 +181,8 @@
                
                public function serialize()
                {
-                       /*if(isset($this->organization_id) && 
$this->get_organization_id() > 0)
+                       $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       if(isset($this->organization_id) && 
$this->get_organization_id() > 0)
                        {
                                $contact_1 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name($this->get_contact_person_1());
                                $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name($this->get_contact_person_2());
@@ -159,23 +193,25 @@
                                $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_group_contact_name($this->get_contact_person_2());
                        }
                        else
-                       {*/
+                       {
                                $contact_1 = "";
                                $contact_2 = "";
-                       //}
+                       }
                        return array(
                                'id' => $this->get_id(),
                                'organization_id' => 
activitycalendar_soorganization::get_instance()->get_organization_name($this->get_organization_id()),
                                'group_id' => 
activitycalendar_sogroup::get_instance()->get_group_name($this->get_group_id()),
                                'district' => $this->get_district(),
-                               'category' => $this->get_category(),
+                               'category' => 
$this->get_so()->get_category_name($this->get_category()),
                                'description' => $this->get_description(),
                                'state' => $this->get_state(),
                                'arena' => 
activitycalendar_soarena::get_instance()->get_arena_name($this->get_arena()),
-                               'date_start' => $this->get_date_start(),
-                               'date_end' => $this->get_date_end(),
+                               'date_start' => 
$this->get_date_start()!=NULL?date($date_format,$this->get_date_start()):'' ,
+                               'date_end' => 
$this->get_date_end()!=NULL?date($date_format,$this->get_date_end()):'' ,
                                'contact_person_1' => $contact_1,
-                               'contact_person_2' => $contact_2
+                               'contact_person_2' => $contact_2,
+                               'special_adaptation' => 
$this->get_special_adaptation(),
+                               'last_change_date' => 
$this->get_last_change_date()!=NULL?date($date_format, 
$this->get_last_change_date()):''
                        );
                }
        }

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/model/class.arena.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/model/class.arena.inc.php  
2011-05-02 08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/activitycalendar/inc/model/class.arena.inc.php  
2011-05-02 08:58:16 UTC (rev 7242)
@@ -1,5 +1,5 @@
 <?php
-
+       phpgw::import_class('activitycalendar.soarena');
        include_class('activitycalendar', 'model', 'inc/model/');
 
        class activitycalendar_arena extends activitycalendar_model
@@ -77,7 +77,7 @@
                        return array(
                                'id' => $this->get_id(),
                                'arena_name' => $this->get_arena_name(),
-                               'internal_arena_id' => 
$this->get_internal_arena_id(),
+                               'internal_arena_id' => 
activitycalendar_soarena::get_instance()->get_building_name($this->get_internal_arena_id()),
                                'address' => $this->get_address()
                        );
                }

Copied: 
branches/Version-1_0-branch/activitycalendar/inc/model/class.building.inc.php 
(from rev 7241, trunk/activitycalendar/inc/model/class.building.inc.php)
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/model/class.building.inc.php   
                            (rev 0)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/model/class.building.inc.php   
    2011-05-02 08:58:16 UTC (rev 7242)
@@ -0,0 +1,42 @@
+<?php
+       include_class('activitycalendar', 'model', 'inc/model/');
+
+       class activitycalendar_building extends activitycalendar_model
+       {
+               public static $so;
+               
+               protected $id;
+               protected $name;
+               
+               /**
+                * Constructor.  Takes an optional ID.  If a contract is 
created from outside
+                * the database the ID should be empty so the database can add 
one according to its logic.
+                * 
+                * @param int $id the id of this composite
+                */
+               public function __construct(int $id = null)
+               {
+                       $this->id = (int)$id;
+               }
+               
+               public function set_id($id)
+               {
+                       $this->id = $id;
+               }
+               
+               public function get_id() { return $this->id; }
+               
+               public function set_name($name)
+               {
+                       $this->name = $name;
+               }
+               
+               public function get_name() { return $this->name; }
+               
+               public function serialize()
+               {
+                       return;
+               }
+               
+       }
+?>
\ No newline at end of file

Copied: 
branches/Version-1_0-branch/activitycalendar/inc/model/class.category.inc.php 
(from rev 7241, trunk/activitycalendar/inc/model/class.category.inc.php)
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/model/class.category.inc.php   
                            (rev 0)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/model/class.category.inc.php   
    2011-05-02 08:58:16 UTC (rev 7242)
@@ -0,0 +1,50 @@
+<?php
+       include_class('activitycalendar', 'model', 'inc/model/');
+
+       class activitycalendar_category extends activitycalendar_model
+       {
+               public static $so;
+               
+               protected $id;
+               protected $parent_id;
+               protected $name;
+               
+               /**
+                * Constructor.  Takes an optional ID.  If a contract is 
created from outside
+                * the database the ID should be empty so the database can add 
one according to its logic.
+                * 
+                * @param int $id the id of this composite
+                */
+               public function __construct(int $id = null)
+               {
+                       $this->id = (int)$id;
+               }
+               
+               public function set_id($id)
+               {
+                       $this->id = $id;
+               }
+               
+               public function get_id() { return $this->id; }
+               
+               public function set_parent_id($parent_id)
+               {
+                       $this->parent_id = $parent_id;
+               }
+               
+               public function get_parent_id() { return $this->parent_id; }
+
+               public function set_name($name)
+               {
+                       $this->name = $name;
+               }
+               
+               public function get_name() { return $this->name; }
+               
+               public function serialize()
+               {
+                       return;
+               }
+               
+       }
+?>
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/model/class.contact_person.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/model/class.contact_person.inc.php
 2011-05-02 08:54:32 UTC (rev 7241)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/model/class.contact_person.inc.php
 2011-05-02 08:58:16 UTC (rev 7242)
@@ -98,7 +98,7 @@
                public static function get_so()
                {
                        if (self::$so == null) {
-                               self::$so = CreateObject('rental.socontract');
+                               self::$so = 
CreateObject('rental.socontactperson');
                        }
                        
                        return self::$so;

Copied: 
branches/Version-1_0-branch/activitycalendar/inc/model/class.target.inc.php 
(from rev 7241, trunk/activitycalendar/inc/model/class.target.inc.php)
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/model/class.target.inc.php 
                        (rev 0)
+++ branches/Version-1_0-branch/activitycalendar/inc/model/class.target.inc.php 
2011-05-02 08:58:16 UTC (rev 7242)
@@ -0,0 +1,49 @@
+<?php
+       include_class('activitycalendar', 'model', 'inc/model/');
+
+       class activitycalendar_target extends activitycalendar_model
+       {
+               public static $so;
+               
+               protected $id;
+               protected $name;
+               protected $description;
+               
+               /**
+                * Constructor.  Takes an optional ID.  If a contract is 
created from outside
+                * the database the ID should be empty so the database can add 
one according to its logic.
+                * 
+                * @param int $id the id of this composite
+                */
+               public function __construct(int $id = null)
+               {
+                       $this->id = (int)$id;
+               }
+               
+               public function set_id($id)
+               {
+                       $this->id = $id;
+               }
+               
+               public function get_id() { return $this->id; }
+               
+               public function set_description($description)
+               {
+                       $this->description = $description;
+               }
+               
+               public function get_description() { return $this->description; }
+
+               public function set_name($name)
+               {
+                       $this->name = $name;
+               }
+               
+               public function get_name() { return $this->name; }
+               
+               public function serialize()
+               {
+                       return;
+               }
+       }
+?>
\ No newline at end of file

Modified: branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang    
2011-05-02 08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang    
2011-05-02 08:58:16 UTC (rev 7242)
@@ -353,4 +353,8 @@
 export_to      activitycalendar        no      Eksporter til
 activity_state activitycalendar        no      Status
 processed      activitycalendar        no      Behandlet
-show   activitycalendar        no      Vis
\ No newline at end of file
+show   activitycalendar        no      Vis
+last_change_date       activitycalendar        no      Sist endret
+first  activitycalendar        no      Første
+last   activitycalendar        no      Siste
+previous       activitycalendar        no      Forrige
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php   
2011-05-02 08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php   
2011-05-02 08:58:16 UTC (rev 7242)
@@ -3,6 +3,7 @@
                'activity_activity' => array(
                        'fd' => array(
                                'id' => array('type' => 'auto','precision' => 
4,'nullable' => False),
+                               'title' => array('type' => 
'varchar','precision' => '255', 'nullable' => False),
                                'organization_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
                                'group_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
                                'district' => array('type' => 
'varchar','precision' => '255'),
@@ -16,7 +17,8 @@
                                'create_date' => array('type' => 'int', 
'precision' => 4, 'precision' => '8', 'nullable' => false),
                                'last_change_date' => array('type' => 'int', 
'precision' => 4, 'precision' => '8', 'nullable' => true),
                                'contact_person_1' => array('type' => 
'varchar','precision' => '255'),
-                               'contact_person_2' => array('type' => 
'varchar','precision' => '255')
+                               'contact_person_2' => array('type' => 
'varchar','precision' => '255'),
+                               'special_adaptation' => array('type' => 
'bool','nullable' => true,'default' => 'false')
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/activity.php    
2011-05-02 08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/activity.php    
2011-05-02 08:58:16 UTC (rev 7242)
@@ -98,27 +98,36 @@
                                        ?>
                                </dd>
                                <dt>
-                                       <?php if($activity->get_district() || 
$editable) { ?>
-                                       <label for="district"><?php echo 
lang('district') ?></label>
+                                       <?php if($activity->get_category() || 
$editable) { ?>
+                                       <label for="category"><?php echo 
lang('category') ?></label>
                                        <?php  } ?>
                                </dt>
                                <dd>
                                        <?php
+                                       $current_category_id = 
$activity->get_category();
                                        if ($editable)
                                        {
-                                       ?>
-                                               <input type="text" 
name="district" id="district" value="<?php echo $activity->get_district() ?>" />
-                                       <?php
+                                               ?>
+                                               <select name="category">
+                                                       <option value="0">Ingen 
kategori valgt</option>
+                                                       <?php
+                                                       foreach($categories as 
$category)
+                                                       {
+                                                               echo "<option 
".($current_category_id == $category->get_id() ? 'selected="selected"' : "")." 
value=\"{$category->get_id()}\">".$category->get_name()."</option>";
+                                                       }
+                                                       ?>
+                                               </select>
+                                               <?php
                                        }
                                        else
                                        {
-                                               echo $activity->get_district();
+                                               echo $activity->get_category();
                                        }
                                        ?>
                                </dd>
                                <dt>
-                                       <?php if($activity->get_category() || 
$editable) { ?>
-                                       <label for="category"><?php echo 
lang('category') ?></label>
+                                       <?php if($activity->get_district() || 
$editable) { ?>
+                                       <label for="district"><?php echo 
lang('district') ?></label>
                                        <?php  } ?>
                                </dt>
                                <dd>
@@ -126,12 +135,12 @@
                                        if ($editable)
                                        {
                                        ?>
-                                               <input type="text" 
name="category" id="category" value="<?php echo $activity->get_category() ?>" />
+                                               <input type="text" 
name="district" id="district" value="<?php echo $activity->get_district() ?>" />
                                        <?php
                                        }
                                        else
                                        {
-                                               echo $activity->get_category();
+                                               echo $activity->get_district();
                                        }
                                        ?>
                                </dd>
@@ -227,6 +236,12 @@
                                        }
                                        ?>
                                </dd>
+                           <dt>
+                                       <label for="special_adaptation"><?php 
echo lang('special_adaptation') ?></label>
+                               </dt>
+                               <dd>
+                                       <input type="checkbox" 
name="special_adaptation" id="special_adaptation"<?php echo 
$activity->get_special_adaptation() ? ' checked="checked"' : '' ?> <?php echo 
!$editable ? ' disabled="disabled"' : '' ?>/>
+                               </dd>
                        </dl>
                        <div class="form-buttons">
                                <?php

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
       2011-05-02 08:54:32 UTC (rev 7241)
+++ 
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
       2011-05-02 08:58:16 UTC (rev 7242)
@@ -67,6 +67,11 @@
            sortable: true
        },
        {
+               key: "last_change_date",
+               label: "<?php echo lang('last_change_date') ?>",
+           sortable: true
+       },
+       {
                key: "actions",
                hidden: true
        },

Modified: branches/Version-1_0-branch/activitycalendar/templates/base/arena.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/arena.php       
2011-05-02 08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/arena.php       
2011-05-02 08:58:16 UTC (rev 7242)
@@ -36,20 +36,29 @@
                                </dd>
                                <dt>
                                        <?php 
if($arena->get_internal_arena_id() || $editable) { ?>
-                                       <label for="internal_arena_id"><?php 
echo lang('internal_arena_id') ?></label>
+                                       <label for="internal_arena_id"><?php 
echo lang('internal_arena') ?></label>
                                        <?php  } ?>
                                </dt>
                                <dd>
                                        <?php
+                                       $current_building_id = 
$arena->get_internal_arena_id();
                                        if ($editable)
                                        {
-                                       ?>
-                                               <input type="text" 
name="internal_arena_id" id="internal_arena_id" value="<?php echo 
$arena->get_internal_arena_id() ?>" />
-                                       <?php
+                                               ?>
+                                               <select 
name="internal_arena_id">
+                                                       <option value="0">Ingen 
arena valgt</option>
+                                                       <?php
+                                                       foreach($buildings as 
$building_id => $building_name)
+                                                       {
+                                                               echo "<option 
".($current_building_id == $building_id? 'selected="selected"' : "")." 
value=\"{$building_id}\">".$building_name."</option>";
+                                                       }
+                                                       ?>
+                                               </select>
+                                               <?php
                                        }
                                        else
                                        {
-                                               echo 
$arena->get_internal_arena_id();
+                                               echo 
activitycalendar_soarena::get_instance()->get_building_name($arena->get_internal_arena_id());
                                        }
                                        ?>
                                </dd>

Modified: branches/Version-1_0-branch/booking/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.menu.inc.php  2011-05-02 
08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/booking/inc/class.menu.inc.php  2011-05-02 
08:58:16 UTC (rev 7242)
@@ -251,6 +251,19 @@
                                                                'text'  => 
lang('Asynchronous Tasks'),
                                                                'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'booking.uiasync_settings.index', 'appname' => 'booking') )
                                                        ),
+                                                       'office'        => array
+                                                       (
+                                                               'text'  => 
lang('office'),
+                                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'bb_office') ),
+                                                               'children' => 
array
+                                                               (
+                                                                       
'office_user'   => array
+                                                                       (
+                                                                               
'text'  => lang('office user'),
+                                                                               
'url'   => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'bb_office_user') )
+                                                                       )
+                                                               )
+                                                       ),
                                                )
                                        );
                        }
@@ -270,6 +283,11 @@
                                                'text'  => lang('Root 
Permissions'),
                                                'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'booking.uipermission_root.index', 'appname' => 'booking') )
                                        ),
+                                       'acl'   => array
+                                       (
+                                               'text'  => lang('Configure 
Access Permissions'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'preferences.uiadmin_acl.list_acl', 'acl_app' => 'booking') )
+                                       ),
                                        'activity'      => array
                                        (
                                                'text'  => lang('Activity'),

Modified: branches/Version-1_0-branch/booking/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/booking/setup/phpgw_no.lang     2011-05-02 
08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/booking/setup/phpgw_no.lang     2011-05-02 
08:58:16 UTC (rev 7242)
@@ -497,3 +497,5 @@
 Delete allocations     booking no      Slett tildelinger
 Allocations that will be deleted       booking no      Tildelinger som vil bli 
slettet
 Allocations  with existing bookings (%1)       booking no      Tildeinger med 
eksisterende bookinger (%1)
+office booking no      Kontor
+office user    booking no      Bruker koplet til kontor

Modified: branches/Version-1_0-branch/booking/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/setup/setup.inc.php     2011-05-02 
08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/booking/setup/setup.inc.php     2011-05-02 
08:58:16 UTC (rev 7242)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['booking']['name'] = 'booking';
-       $setup_info['booking']['version'] = '0.2.06';
+       $setup_info['booking']['version'] = '0.2.07';
        $setup_info['booking']['app_order'] = 9;
        $setup_info['booking']['enable'] = 1;
        $setup_info['booking']['app_group'] = 'office';
@@ -52,7 +52,9 @@
                'bb_account_code_set',
                'bb_completed_reservation_export_configuration',
                'bb_billing_sequential_number_generator',
-               'bb_system_message'
+               'bb_system_message',
+               'bb_office',
+               'bb_office_user'
        );
 
        $setup_info['booking']['description'] = 'Bergen kommune booking';

Modified: branches/Version-1_0-branch/booking/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/setup/tables_update.inc.php     
2011-05-02 08:54:32 UTC (rev 7241)
+++ branches/Version-1_0-branch/booking/setup/tables_update.inc.php     
2011-05-02 08:58:16 UTC (rev 7242)
@@ -2509,3 +2509,76 @@
                }
        }
 
+       $test[] = '0.2.06';
+       /**
+       * Update booking version from 0.2.06 to 0.2.07
+       * Add office and office/user relation (User is added as a custom value)
+       * 
+       */
+
+       function booking_upgrade0_2_06()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'bb_office', array(
+                               'fd' => array(
+                                       'id' => array('type' => 'auto', 
'precision' => 4,'nullable' => False),
+                                       'name' => array('type' => 'varchar', 
'precision' => 200,'nullable' => False),
+                                       'user_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                                       'entry_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                                       'modified_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'bb_office_user', array(
+                               'fd' => array(
+                                       'id' => array('type' => 'auto', 
'precision' => 4,'nullable' => False),
+                                       'office' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                                       'user_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                                       'entry_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                                       'modified_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array('bb_office' => array('office' => 
'id')),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               $GLOBALS['phpgw']->locations->add('.office', 'office', 
'booking');
+               $GLOBALS['phpgw']->locations->add('.office.user', 'office/user 
relation', 'booking', false, 'bb_office_user');
+               $GLOBALS['phpgw']->db = 
clone($GLOBALS['phpgw_setup']->oProc->m_odb);
+
+               $attrib = array
+               (
+                       'appname'               => 'booking',
+                       'location'              => '.office.user',
+                       'column_name'   => 'account_id',
+                       'input_text'    => 'User',
+                       'statustext'    => 'System user',
+                       'search'                => true,
+                       'list'                  => true,
+                       'column_info'   => array
+                       (
+                               'type'                  => 'user',
+                               'nullable'              => 'False',
+                               'custom'                => 1
+                       )
+               );
+
+               $GLOBALS['phpgw']->custom_fields->add($attrib, 
'bb_office_user');
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['booking']['currentver'] = 
'0.2.07';
+                       return $GLOBALS['setup_info']['booking']['currentver'];
+               }
+       }
+




reply via email to

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