fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7240]


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [7240]
Date: Mon, 02 May 2011 05:58:08 +0000

Revision: 7240
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7240
Author:   erikhl
Date:     2011-05-02 05:58:07 +0000 (Mon, 02 May 2011)
Log Message:
-----------


Modified Paths:
--------------
    trunk/activitycalendar/inc/class.soactivity.inc.php
    trunk/activitycalendar/inc/class.soarena.inc.php
    trunk/activitycalendar/inc/class.sogroup.inc.php
    trunk/activitycalendar/inc/class.soorganization.inc.php
    trunk/activitycalendar/inc/class.uiactivities.inc.php
    trunk/activitycalendar/inc/class.uiarena.inc.php
    trunk/activitycalendar/inc/model/class.activity.inc.php
    trunk/activitycalendar/inc/model/class.arena.inc.php
    trunk/activitycalendar/inc/model/class.contact_person.inc.php
    trunk/activitycalendar/setup/phpgw_no.lang
    trunk/activitycalendar/setup/tables_current.inc.php
    trunk/activitycalendar/templates/base/activity.php
    trunk/activitycalendar/templates/base/activity_list_partial.php
    trunk/activitycalendar/templates/base/arena.php

Added Paths:
-----------
    trunk/activitycalendar/inc/model/class.building.inc.php
    trunk/activitycalendar/inc/model/class.category.inc.php
    trunk/activitycalendar/inc/model/class.target.inc.php

Modified: trunk/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.soactivity.inc.php 2011-04-30 18:13:44 UTC 
(rev 7239)
+++ trunk/activitycalendar/inc/class.soactivity.inc.php 2011-05-02 05:58:07 UTC 
(rev 7240)
@@ -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: trunk/activitycalendar/inc/class.soarena.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.soarena.inc.php    2011-04-30 18:13:44 UTC 
(rev 7239)
+++ trunk/activitycalendar/inc/class.soarena.inc.php    2011-05-02 05:58:07 UTC 
(rev 7240)
@@ -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: trunk/activitycalendar/inc/class.sogroup.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.sogroup.inc.php    2011-04-30 18:13:44 UTC 
(rev 7239)
+++ trunk/activitycalendar/inc/class.sogroup.inc.php    2011-05-02 05:58:07 UTC 
(rev 7240)
@@ -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: trunk/activitycalendar/inc/class.soorganization.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.soorganization.inc.php     2011-04-30 
18:13:44 UTC (rev 7239)
+++ trunk/activitycalendar/inc/class.soorganization.inc.php     2011-05-02 
05:58:07 UTC (rev 7240)
@@ -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: trunk/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.uiactivities.inc.php       2011-04-30 
18:13:44 UTC (rev 7239)
+++ trunk/activitycalendar/inc/class.uiactivities.inc.php       2011-05-02 
05:58:07 UTC (rev 7240)
@@ -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: trunk/activitycalendar/inc/class.uiarena.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.uiarena.inc.php    2011-04-30 18:13:44 UTC 
(rev 7239)
+++ trunk/activitycalendar/inc/class.uiarena.inc.php    2011-05-02 05:58:07 UTC 
(rev 7240)
@@ -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: trunk/activitycalendar/inc/model/class.activity.inc.php
===================================================================
--- trunk/activitycalendar/inc/model/class.activity.inc.php     2011-04-30 
18:13:44 UTC (rev 7239)
+++ trunk/activitycalendar/inc/model/class.activity.inc.php     2011-05-02 
05:58:07 UTC (rev 7240)
@@ -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: trunk/activitycalendar/inc/model/class.arena.inc.php
===================================================================
--- trunk/activitycalendar/inc/model/class.arena.inc.php        2011-04-30 
18:13:44 UTC (rev 7239)
+++ trunk/activitycalendar/inc/model/class.arena.inc.php        2011-05-02 
05:58:07 UTC (rev 7240)
@@ -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()
                        );
                }

Added: trunk/activitycalendar/inc/model/class.building.inc.php
===================================================================
--- trunk/activitycalendar/inc/model/class.building.inc.php                     
        (rev 0)
+++ trunk/activitycalendar/inc/model/class.building.inc.php     2011-05-02 
05:58:07 UTC (rev 7240)
@@ -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

Added: trunk/activitycalendar/inc/model/class.category.inc.php
===================================================================
--- trunk/activitycalendar/inc/model/class.category.inc.php                     
        (rev 0)
+++ trunk/activitycalendar/inc/model/class.category.inc.php     2011-05-02 
05:58:07 UTC (rev 7240)
@@ -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: trunk/activitycalendar/inc/model/class.contact_person.inc.php
===================================================================
--- trunk/activitycalendar/inc/model/class.contact_person.inc.php       
2011-04-30 18:13:44 UTC (rev 7239)
+++ trunk/activitycalendar/inc/model/class.contact_person.inc.php       
2011-05-02 05:58:07 UTC (rev 7240)
@@ -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;

Added: trunk/activitycalendar/inc/model/class.target.inc.php
===================================================================
--- trunk/activitycalendar/inc/model/class.target.inc.php                       
        (rev 0)
+++ trunk/activitycalendar/inc/model/class.target.inc.php       2011-05-02 
05:58:07 UTC (rev 7240)
@@ -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: trunk/activitycalendar/setup/phpgw_no.lang
===================================================================
--- trunk/activitycalendar/setup/phpgw_no.lang  2011-04-30 18:13:44 UTC (rev 
7239)
+++ trunk/activitycalendar/setup/phpgw_no.lang  2011-05-02 05:58:07 UTC (rev 
7240)
@@ -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: trunk/activitycalendar/setup/tables_current.inc.php
===================================================================
--- trunk/activitycalendar/setup/tables_current.inc.php 2011-04-30 18:13:44 UTC 
(rev 7239)
+++ trunk/activitycalendar/setup/tables_current.inc.php 2011-05-02 05:58:07 UTC 
(rev 7240)
@@ -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: trunk/activitycalendar/templates/base/activity.php
===================================================================
--- trunk/activitycalendar/templates/base/activity.php  2011-04-30 18:13:44 UTC 
(rev 7239)
+++ trunk/activitycalendar/templates/base/activity.php  2011-05-02 05:58:07 UTC 
(rev 7240)
@@ -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: trunk/activitycalendar/templates/base/activity_list_partial.php
===================================================================
--- trunk/activitycalendar/templates/base/activity_list_partial.php     
2011-04-30 18:13:44 UTC (rev 7239)
+++ trunk/activitycalendar/templates/base/activity_list_partial.php     
2011-05-02 05:58:07 UTC (rev 7240)
@@ -67,6 +67,11 @@
            sortable: true
        },
        {
+               key: "last_change_date",
+               label: "<?php echo lang('last_change_date') ?>",
+           sortable: true
+       },
+       {
                key: "actions",
                hidden: true
        },

Modified: trunk/activitycalendar/templates/base/arena.php
===================================================================
--- trunk/activitycalendar/templates/base/arena.php     2011-04-30 18:13:44 UTC 
(rev 7239)
+++ trunk/activitycalendar/templates/base/arena.php     2011-05-02 05:58:07 UTC 
(rev 7240)
@@ -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>




reply via email to

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