fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7236]


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [7236]
Date: Wed, 27 Apr 2011 06:09:49 +0000

Revision: 7236
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7236
Author:   erikhl
Date:     2011-04-27 06:09:48 +0000 (Wed, 27 Apr 2011)
Log Message:
-----------


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

Added Paths:
-----------
    trunk/activitycalendar/inc/class.socontactperson.inc.php
    trunk/activitycalendar/inc/class.sogroup.inc.php
    trunk/activitycalendar/inc/model/class.contact_person.inc.php
    trunk/activitycalendar/inc/model/class.group.inc.php

Modified: trunk/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.soactivity.inc.php 2011-04-26 12:57:28 UTC 
(rev 7235)
+++ trunk/activitycalendar/inc/class.soactivity.inc.php 2011-04-27 06:09:48 UTC 
(rev 7236)
@@ -1,5 +1,8 @@
 <?php
 phpgw::import_class('activitycalendar.socommon');
+phpgw::import_class('activitycalendar.soorganization');
+phpgw::import_class('activitycalendar.sogroup');
+//phpgw::import_class('activitycalendar.socontactperson');
 
 include_class('activitycalendar', 'activity', 'inc/model/');
 
@@ -93,6 +96,11 @@
                }
 
                $filter_clauses = array();
+               
+               if(isset($filters[$this->get_id_field_name()])){
+                       $id = 
$this->marshal($filters[$this->get_id_field_name()],'int');
+                       $filter_clauses[] = "activity.id = {$id}";
+               }
 /*
                // All parties with contracts of type X
                if(isset($filters['party_type']))
@@ -127,6 +135,8 @@
                        $columns[] = 'activity.arena';
                        $columns[] = 'activity.date_start';
                        $columns[] = 'activity.date_end';
+                       $columns[] = 'activity.create_date';
+                       $columns[] = 'activity.last_change_date';
                        $columns[] = 'activity.contact_person_1';
                        $columns[] = 'activity.contact_person_2';
                        
@@ -138,7 +148,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}";
        }
 
@@ -153,7 +163,8 @@
        function add(&$activity)
        {
                // Insert a new activity
-               $q ="INSERT INTO activity_activity (organization_id) VALUES 
(1)";
+               $ts_now = strtotime('now');
+               $q ="INSERT INTO activity_activity (organization_id, 
create_date) VALUES (1, $ts_now)";
                $result = $this->db->query($q);
 
                if(isset($result)) {
@@ -177,19 +188,21 @@
        function update($activity)
        {
                $id = intval($activity->get_id());
+               $ts_now = strtotime('now');
                        
                $values = array(
-                       'organization_id = '. 
$this->marshal($activity->get_organization_id(), 'string'),
-                       'group_id = '     . 
$this->marshal($activity->get_group_id(), 'string'),
-                       'district =  '     . 
$this->marshal($activity->get_district(), 'string'),
-                       'category = '          . 
$this->marshal($activity->get_category(), 'string'),
-                       'target = '   . $this->marshal($activity->get_target(), 
'string'),
+                       'organization_id = '. 
$this->marshal($activity->get_organization_id(), 'int'),
+                       'group_id = '     . 
$this->marshal($activity->get_group_id(), 'int'),
+                       'district =  '     . 
$this->marshal($activity->get_district(), 'int'),
+                       'category = '          . 
$this->marshal($activity->get_category(), 'int'),
+                       //'target = '   . 
$this->marshal($activity->get_target(), 'string'),
                        'description = '     . 
$this->marshal($activity->get_description(), 'string'),
-                       'arena = '      . 
$this->marshal($activity->get_arena(), 'string'),
-                       'date_start = '      . 
$this->marshal($activity->get_date_start(), 'string'),
-                       'date_end = '    . 
$this->marshal($activity->get_date_end(), 'string'),
-                       'contact_person_1 = '          . 
$this->marshal($activity->get_contact_person_1(), 'string'),
-                       'contact_person_2 = '          . 
$this->marshal($activity->get_contact_person_2(), 'string')
+                       'arena = '      . 
$this->marshal($activity->get_arena(), 'int'),
+                       'date_start = '      . 
$this->marshal($activity->get_date_start(), 'int'),
+                       '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')
                );
                
                $result = $this->db->query('UPDATE activity_activity SET ' . 
join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
@@ -223,8 +236,8 @@
 
                        
$activity->set_organization_id($this->unmarshal($this->db->f('organization_id'),
 'int'));
                        
$activity->set_group_id($this->unmarshal($this->db->f('group_id'), 'int'));
-                       
$activity->set_district($this->unmarshal($this->db->f('district'), 'string'));
-                       
$activity->set_category($this->unmarshal($this->db->f('category'), 'string'));
+                       
$activity->set_district($this->unmarshal($this->db->f('district'), 'int'));
+                       
$activity->set_category($this->unmarshal($this->db->f('category'), 'int'));
                        
$activity->set_description($this->unmarshal($this->db->f('description'), 
'string'));
                        
$activity->set_arena($this->unmarshal($this->db->f('arena'), 'string'));
                        
$activity->set_date_start($this->unmarshal($this->db->f('date_start'), 'int'));

Modified: trunk/activitycalendar/inc/class.soarena.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.soarena.inc.php    2011-04-26 12:57:28 UTC 
(rev 7235)
+++ trunk/activitycalendar/inc/class.soarena.inc.php    2011-04-27 06:09:48 UTC 
(rev 7236)
@@ -161,6 +161,21 @@
                return $arena;
        }
        
+       function get_arena_name($arena_id)
+       {
+               $result = "Ingen";
+       if(isset($arena_id)){
+               $q1="SELECT arena_name FROM activity_arena WHERE 
id={$arena_id}";
+                       $this->db->query($q1, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $result = $this->db->f('arena_name');
+                       }
+       }
+               
+               return $result;
+       }
+       
+       
        /**
         * Function for adding a new arena to the database. Updates the arena 
object.
         *

Added: trunk/activitycalendar/inc/class.socontactperson.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.socontactperson.inc.php                    
        (rev 0)
+++ trunk/activitycalendar/inc/class.socontactperson.inc.php    2011-04-27 
06:09:48 UTC (rev 7236)
@@ -0,0 +1,267 @@
+<?php
+phpgw::import_class('activitycalendar.socommon');
+
+include_class('activitycalendar', 'contact_person', 'inc/model/');
+
+class activitycalendar_socontactperson extends activitycalendar_socommon
+{
+       protected static $so;
+
+       /**
+        * Get a static reference to the storage object associated with this 
model object
+        *
+        * @return rental_soparty the storage object
+        */
+       public static function get_instance()
+       {
+               if (self::$so == null) {
+                       self::$so = 
CreateObject('activitycalendar.socontactperson');
+               }
+               return self::$so;
+       }
+       
+       /**
+        * Generate SQL query
+        *
+        * @todo Add support for filter "party_type", meaning what type of 
contracts
+        * the party is involved in.
+        *
+        * @param string $sort_field
+        * @param boolean $ascending
+        * @param string $search_for
+        * @param string $search_type
+        * @param array $filters
+        * @param boolean $return_count
+        * @return string SQL
+        */
+       protected function get_query(string $sort_field, boolean $ascending, 
string $search_for, string $search_type, array $filters, boolean $return_count)
+       {
+               $clauses = array('1=1');
+               $table = "";
+
+               //Add columns to this array to include them in the query
+               $columns = array();
+
+/*             if($sort_field != null) {
+                       $dir = $ascending ? 'ASC' : 'DESC';
+                       $order = "ORDER BY id $dir";
+               }
+               */
+               if($search_for)
+               {
+                       $query = $this->marshal($search_for,'string');
+                       $like_pattern = "'%".$search_for."%'";
+                       $like_clauses = array();
+                       switch($search_type){
+                               case "name":
+                                       $like_clauses[] = "party.first_name 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.last_name 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.company_name 
$this->like $like_pattern";
+                                       break;
+                               case "address":
+                                       $like_clauses[] = "party.address_1 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.address_2 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.postal_code 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.place 
$this->like $like_pattern";
+                                       break;
+                               case "identifier":
+                                       $like_clauses[] = "party.identifier 
$this->like $like_pattern";
+                                       break;
+                               case "reskontro":
+                                       $like_clauses[] = "party.reskontro 
$this->like $like_pattern";
+                                       break;
+                               case "result_unit_number":
+                                       $like_clauses[] = 
"party.result_unit_number $this->like $like_pattern";
+                                       break;
+                               case "all":
+                                       $like_clauses[] = "party.first_name 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.last_name 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.company_name 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.address_1 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.address_2 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.postal_code 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.place 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.identifier 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.comment 
$this->like $like_pattern";
+                                       $like_clauses[] = "party.reskontro 
$this->like $like_pattern";
+                                       break;
+                       }
+
+
+                       if(count($like_clauses))
+                       {
+                               $clauses[] = '(' . join(' OR ', $like_clauses) 
. ')';
+                       }
+               }
+               
+               $filter_clauses = array();
+               $contact_person_id = $this->marshal($filters['id'],'int');
+               if(isset($filters['org_id']))
+               {
+                       $org_id = $this->marshal($filters['org_id'],'int');
+                       if(isset($org_id) && $org_id > 0)
+                       {
+                               $filter_clauses[] = 
"organization_contact.organization_id = {$org_id}";
+                               $filter_clauses[] = "organization_contact.id = 
{$contact_person_id}";
+                               $table = "bb_organization_contact 
organization_contact";
+                               
+                       }
+               }
+               else if(isset($filters['group_id']))
+               {
+                       $group_id = $this->marshal($filters['group_id'],'int');
+                       if(isset($group_id) && $group_id > 0)
+                       {
+                               $filter_clauses[] = "group_contact.group_id = 
{$group_id}";
+                               $filter_clauses[] = "group_contact.id = 
{$contact_person_id}";
+                               $table = "bb_group_contact group_contact";
+                       }
+               }
+/*
+               // All parties with contracts of type X
+               if(isset($filters['party_type']))
+               {
+                       $party_type = 
$this->marshal($filters['party_type'],'int');
+                       if(isset($party_type) && $party_type > 0)
+                       {
+                               $filter_clauses[] = "contract.location_id = 
{$party_type}";
+                       }
+               }
+*/             
+               
+               if(count($filter_clauses))
+               {
+                       $clauses[] = join(' AND ', $filter_clauses);
+               }
+
+               $condition =  join(' AND ', $clauses);
+
+               if($table == "bb_organization_contact")
+               {
+                       if($return_count) // We should only return a count
+                       {
+                               $cols = 
'COUNT(DISTINCT(organization_contact.id)) AS count';
+                       }
+                       else
+                       {
+                               $columns[] = 'organization_contact.id';
+                               $columns[] = 'organization_contact.name';
+                               $columns[] = 'organization_contact.ssn';
+                               $columns[] = 'organization_contact.phone';
+                               $columns[] = 'organization_contact.email';
+                               $columns[] = 
'organization_contact.organization_id';
+                               
+                               $cols = implode(',',$columns);
+                       }
+               }
+               else
+               {
+                       if($return_count) // We should only return a count
+                       {
+                               $cols = 'COUNT(DISTINCT(group_contact.id)) AS 
count';
+                       }
+                       else
+                       {
+                               $columns[] = 'group_contact.id';
+                               $columns[] = 'group_contact.name';
+                               $columns[] = 'group_contact.phone';
+                               $columns[] = 'group_contact.email';
+                               $columns[] = 'group_contact.group_id';
+                               
+                               $cols = implode(',',$columns);
+                       }
+               }
+
+               $tables = $table;
+
+               //$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}");
+               return "SELECT {$cols} FROM {$tables} WHERE {$condition} 
{$order}";
+       }
+
+
+       function get_group_contact_name($id)
+       {
+               $result = "Ingen";
+       if(isset($id)){
+               $q1="SELECT name FROM bb_group_contact WHERE id={$id}";
+                       $this->db->query($q1, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $result = $this->db->f('name');
+                       }
+       }
+               return $result;
+       }
+       
+       function get_org_contact_name($id)
+       {
+               $result = "Ingen";
+       if(isset($id)){
+               $q1="SELECT name FROM bb_organization_contact WHERE id={$id}";
+                       $this->db->query($q1, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $result = $this->db->f('name');
+                       }
+       }
+               return $result;
+       }
+       
+
+       /**
+        * Function for adding a new activity to the database. Updates the 
activity object.
+        *
+        * @param activitycalendar_activity $activity the party to be added
+        * @return bool true if successful, false otherwise
+        */
+       function add(&$contact_person)
+       {
+               return false;
+       }
+
+       /**
+        * Update the database values for an existing activity object.
+        *
+        * @param $activity the activity to be updated
+        * @return boolean true if successful, false otherwise
+        */
+       function update($contact_person)
+       {
+               return false;
+       }
+
+       public function get_id_field_name($extended_info = false)
+       {
+               if(!$extended_info)
+               {
+                       $ret = 'id';
+               }
+               else
+               {
+                       $ret = array
+                       (
+                               'table'                 => 'activity', // alias
+                               'field'                 => 'id',
+                               'translated'    => 'id'
+                       );
+               }
+               return $ret;
+       }
+
+       protected function populate(int $contact_person_id, &$contact_person)
+       {
+
+               if($contact_person == null) {
+                       $contact_person = new 
activitycalendar_contact_person((int) $contact_person_id);
+
+                       
$contact_person->set_organization_id($this->unmarshal($this->db->f('organization_id'),
 'int'));
+                       
$contact_person->set_group_id($this->unmarshal($this->db->f('group_id'), 
'int'));
+                       
$contact_person->set_name($this->unmarshal($this->db->f('name'), 'string'));
+                       
$contact_person->set_phone($this->unmarshal($this->db->f('phone'), 'string'));
+                       
$contact_person->set_email($this->unmarshal($this->db->f('email'), 'string'));
+                       
$contact_person->set_ssn($this->unmarshal($this->db->f('ssn'), 'string'));
+               }
+               return $contact_person;
+       }
+}
\ No newline at end of file

Added: trunk/activitycalendar/inc/class.sogroup.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.sogroup.inc.php                            
(rev 0)
+++ trunk/activitycalendar/inc/class.sogroup.inc.php    2011-04-27 06:09:48 UTC 
(rev 7236)
@@ -0,0 +1,184 @@
+<?php
+
+phpgw::import_class('activitycalendar.socommon');
+
+include_class('activitycalendar', 'group', 'inc/model/');
+
+class activitycalendar_sogroup extends activitycalendar_socommon
+{
+       protected static $so;
+
+       /**
+        * Get a static reference to the storage object associated with this 
model object
+        *
+        * @return rental_soparty the storage object
+        */
+       public static function get_instance()
+       {
+               if (self::$so == null) {
+                       self::$so = CreateObject('activitycalendar.sogroup');
+               }
+               return self::$so;
+       }
+
+       /**
+        * Generate SQL query
+        *
+        * @todo Add support for filter "party_type", meaning what type of 
contracts
+        * the party is involved in.
+        *
+        * @param string $sort_field
+        * @param boolean $ascending
+        * @param string $search_for
+        * @param string $search_type
+        * @param array $filters
+        * @param boolean $return_count
+        * @return string SQL
+        */
+       protected function get_query(string $sort_field, boolean $ascending, 
string $search_for, string $search_type, array $filters, boolean $return_count)
+       {
+               $clauses = array('1=1');
+
+               //Add columns to this array to include them in the query
+               $columns = array();
+
+               if($sort_field != null) {
+                       $dir = $ascending ? 'ASC' : 'DESC';
+                       $order = "ORDER BY bb_group.id $dir";
+               }
+               if($search_for)
+               {
+                       $query = $this->marshal($search_for,'string');
+                       $like_pattern = "'%".$search_for."%'";
+                       $like_clauses = array();
+                       switch($search_type){
+                               case "name":
+                                       $like_clauses[] = "group.name 
$this->like $like_pattern";
+                                       $like_clauses[] = "group.shortname 
$this->like $like_pattern";
+                                       break;
+                       }
+
+
+                       if(count($like_clauses))
+                       {
+                               $clauses[] = '(' . join(' OR ', $like_clauses) 
. ')';
+                       }
+               }
+
+               $filter_clauses = array();
+               $filter_clauses[] = "bb_group.show_in_portal=1"; 
+               if(isset($filters['org_id']))
+               {
+                       $group_org_id = 
$this->marshal($filters['org_id'],'int');
+                       if(isset($group_org_id) && $group_org_id > 0)
+                       {
+                               $filter_clauses[] = "bb_group.organization_id = 
{$group_org_id}";
+                       }
+               }               
+               
+               if(count($filter_clauses))
+               {
+                       $clauses[] = join(' AND ', $filter_clauses);
+               }
+
+               $condition =  join(' AND ', $clauses);
+
+               if($return_count) // We should only return a count
+               {
+                       $cols = 'COUNT(DISTINCT(bb_group.id)) AS count';
+               }
+               else
+               {
+                       $columns[] = 'bb_group.id';
+                       $columns[] = 'bb_group.name';
+                       $columns[] = 'bb_group.description';
+                       $columns[] = 'bb_group.organization_id';
+                       $columns[] = 'bb_group.activity_id';
+                       $columns[] = 'bb_group.active';
+                       $columns[] = 'bb_group.shortname';
+                       $columns[] = 'bb_group.show_in_portal';
+                       
+                       $cols = implode(',',$columns);
+               }
+
+               $tables = "bb_group";
+
+               //$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}");
+               return "SELECT {$cols} FROM {$tables} WHERE {$condition} 
{$order}";
+       }
+
+
+
+       /**
+        * Function for adding a new party to the database. Updates the party 
object.
+        *
+        * @param rental_party $party the party to be added
+        * @return bool true if successful, false otherwise
+        */
+       function add(&$group)
+       {
+               return false;
+       }
+
+       /**
+        * Update the database values for an existing party object.
+        *
+        * @param $party the party to be updated
+        * @return boolean true if successful, false otherwise
+        */
+       function update($group)
+       {
+               return false;
+       }
+
+       public function get_id_field_name($extended_info = false)
+       {
+               if(!$extended_info)
+               {
+                       $ret = 'id';
+               }
+               else
+               {
+                       $ret = array
+                       (
+                               'table'                 => 'group', // alias
+                               'field'                 => 'id',
+                               'translated'    => 'id'
+                       );
+               }
+               return $ret;
+       }
+       
+       function get_group_name($group_id)
+       {
+               $result = "Ingen";
+       if(isset($org_id)){
+               $q1="SELECT name FROM bb_group WHERE id={$group_id}";
+                       $this->db->query($q1, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $result = $this->db->f('name');
+                       }
+       }
+               
+               return $result;
+       }
+
+       protected function populate(int $group_id, &$group)
+       {
+
+               if($group == null) {
+                       $group = new activitycalendar_group((int) $group_id);
+
+                       $group->set_name($this->unmarshal($this->db->f('name'), 
'string'));
+                       
$group->set_organization_id($this->unmarshal($this->db->f('organization_id'), 
'int'));
+                       
$group->set_shortname($this->unmarshal($this->db->f('shortname'), 'string'));
+                       
$group->set_description($this->unmarshal($this->db->f('description'), 
'string'));
+                       
$group->set_show_in_portal($this->unmarshal($this->db->f('show_in_portal'), 
'int'));
+               }
+               return $group;
+       }
+}
+?>

Modified: trunk/activitycalendar/inc/class.soorganization.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.soorganization.inc.php     2011-04-26 
12:57:28 UTC (rev 7235)
+++ trunk/activitycalendar/inc/class.soorganization.inc.php     2011-04-27 
06:09:48 UTC (rev 7236)
@@ -53,37 +53,15 @@
                        $like_clauses = array();
                        switch($search_type){
                                case "name":
-                                       $like_clauses[] = "party.first_name 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.last_name 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.company_name 
$this->like $like_pattern";
+                                       $like_clauses[] = "org.name $this->like 
$like_pattern";
+                                       $like_clauses[] = "org.shortname 
$this->like $like_pattern";
                                        break;
-                               case "address":
-                                       $like_clauses[] = "party.address_1 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.address_2 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.postal_code 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.place 
$this->like $like_pattern";
+                               case "org_id":
+                                       $like_clauses[] = 
"org.organization_number $this->like $like_pattern";
                                        break;
-                               case "identifier":
-                                       $like_clauses[] = "party.identifier 
$this->like $like_pattern";
+                               case "district":
+                                       $like_clauses[] = "org.district 
$this->like $like_pattern";
                                        break;
-                               case "reskontro":
-                                       $like_clauses[] = "party.reskontro 
$this->like $like_pattern";
-                                       break;
-                               case "result_unit_number":
-                                       $like_clauses[] = 
"party.result_unit_number $this->like $like_pattern";
-                                       break;
-                               case "all":
-                                       $like_clauses[] = "party.first_name 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.last_name 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.company_name 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.address_1 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.address_2 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.postal_code 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.place 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.identifier 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.comment 
$this->like $like_pattern";
-                                       $like_clauses[] = "party.reskontro 
$this->like $like_pattern";
-                                       break;
                        }
 
 
@@ -95,6 +73,7 @@
 
                $filter_clauses = array();
                $filter_clauses[] = "show_in_portal=1";
+
 /*
                // All parties with contracts of type X
                if(isset($filters['party_type']))
@@ -153,8 +132,20 @@
                return "SELECT {$cols} FROM {$tables} WHERE {$condition} 
{$order}";
        }
 
+       function get_organization_name($org_id)
+       {
+               $result = "Ingen";
+       if(isset($org_id)){
+               $q1="SELECT name FROM bb_organization WHERE id={$org_id}";
+                       $this->db->query($q1, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $result = $this->db->f('name');
+                       }
+       }
+               
+               return $result;
+       }
 
-
        /**
         * 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-26 
12:57:28 UTC (rev 7235)
+++ trunk/activitycalendar/inc/class.uiactivities.inc.php       2011-04-27 
06:09:48 UTC (rev 7236)
@@ -3,6 +3,7 @@
 phpgw::import_class('activitycalendar.soactivity');
 phpgw::import_class('activitycalendar.soarena');
 phpgw::import_class('activitycalendar.soorganization');
+phpgw::import_class('activitycalendar.sogroup');
 
 include_class('activitycalendar', 'activity', 'inc/model/');
 
@@ -21,7 +22,7 @@
        
        public function __construct()
        {
-               parent::__construct();
+               //parent::__construct();
                self::set_active_menu('activitycalendar::activities');
                $config = CreateObject('phpgwapi.config','activitycalendar');
                $config->read();
@@ -39,65 +40,6 @@
        {
                $this->render('activity_list.php');
        }
-               /*public function index()
-               {
-                       if(phpgw::get_var('phpgw_return_as') == 'json') {
-                               return $this->index_json();
-                       }
-                       //$GLOBALS['phpgw_info']['apps']['manual']['section'] = 
'booking_manual';
-                       //self::add_javascript('booking', 'booking', 
'datatable.js');
-                       phpgwapi_yui::load_widget('datatable');
-                       phpgwapi_yui::load_widget('paginator');
-                       $data = array(
-                               'datatable' => array(
-                                       'source' => 
self::link(array('menuaction' => 'booking.uidashboard.index', 'phpgw_return_as' 
=> 'json')),
-                                       'field' => array(
-                                               array(
-                                                       'key' => 'id',
-                                                       'label' => lang('ID'),
-                                                       'formatter' => 
'YAHOO.booking.formatLink'
-                                               ),
-                                               array(
-                                                       'key' => 'status',
-                                                       'label' => 
lang('Status')
-                                               ),
-                                               array(
-                                                       'key' => 'type',
-                                                       'label' => lang('Type')
-                                               ),
-                                               array(
-                                                       'key' => 'created',
-                                                       'label' => 
lang('Created')
-                                               ),
-                                               array(
-                                                       'key' => 'modified',
-                                                       'label' => lang('Last 
modified')
-                                               ),
-                                               array(
-                                                       'key' => 'what',
-                                                       'label' => lang('What')
-                                               ),
-                                               array(
-                                                       'key' => 
'activity_name',
-                                                       'label' => 
lang('Activity')
-                                               ),
-                                               array(
-                                                       'key' => 'contact_name',
-                                                       'label' => 
lang('Contact')
-                                               ),
-                                               array(
-                                                       'key' => 
'case_officer_name',
-                                                       'label' => lang('Case 
Officer')
-                                               ),
-                                               array(
-                                                       'key' => 'link',
-                                                       'hidden' => true
-                                               )
-                                       )
-                               )
-                       );
-                       self::render_template('datatable', $data);
-               }*/
        
        /**
         * Displays info about one single billing job.
@@ -127,12 +69,13 @@
                $GLOBALS['phpgw_info']['flags']['app_header'] .= 
'::'.lang('edit');
                // Get the contract part id
                $activity_id = (int)phpgw::get_var('id');
+               //var_dump($activity_id);
                
                
                // Retrieve the arena object or create a new one
                if(isset($activity_id) && $activity_id > 0)
                {       
-                       $arena = 
activitycalendar_soactivity::get_instance()->get_single($activity_id); 
+                       $activity = 
activitycalendar_soactivity::get_instance()->get_single($activity_id); 
                }
                else
                {
@@ -141,15 +84,23 @@
                
                $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
                        {
                                // ... set all parameters
-                               
$activity->set_internal_arena_id(phpgw::get_var('internal_arena_id'));
-                               
$activity->set_arena_name(phpgw::get_var('arena_name'));
-                               
$activity->set_address(phpgw::get_var('address'));
+                               
$activity->set_organization_id(phpgw::get_var('organization_id'));
+                               
$activity->set_group_id(phpgw::get_var('group_id'));
+                               
$activity->set_arena(phpgw::get_var('arena_id'));
+                               
$activity->set_district(phpgw::get_var('district'));
+                               
$activity->set_category(phpgw::get_var('category'));
+                               
$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'));
                                
                                
if(activitycalendar_soactivity::get_instance()->store($activity)) // ... and 
then try to store the object
                                {
@@ -166,6 +117,7 @@
                        (
                                'activity'      => $activity,
                                'organizations' => $organizations,
+                               'groups' => $groups,
                                'arenas' => $arenas,
                                'editable' => true,
                                'message' => isset($message) ? $message : 
phpgw::get_var('message'),
@@ -176,11 +128,6 @@
        
        public function query()
        {
-               if(!$this->isExecutiveOfficer())
-               {
-                       $this->render('permission_denied.php');
-                       return;
-               }
                
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
                {
                        $user_rows_per_page = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
@@ -211,34 +158,21 @@
                
                switch($query_type)
                {
-                       case 'all_billings':
+                       case 'all_activities':
                                $filters = array();
-                               if($sort_field == 'responsibility_title'){
-                                       $sort_field = 'location_id';
-                               }
-                               $result_objects = 
rental_sobilling::get_instance()->get($start_index, $num_of_objects, 
$sort_field, $sort_ascending, $search_for, $search_type, $filters);
-                               $object_count = 
rental_sobilling::get_instance()->get_count($search_for, $search_type, 
$filters);
+                               $result_objects = 
activitycalendar_soactivity::get_instance()->get($start_index, $num_of_objects, 
$sort_field, $sort_ascending, $search_for, $search_type, $filters);
+                               $object_count = 
activitycalendar_soactivity::get_instance()->get_count($search_for, 
$search_type, $filters);
                                break;
-                       case 'invoices':
-                               if($sort_field == 'term_label'){
-                                       $sort_field = 'term_id';
-                               }
-                               $filters = array('billing_id' => 
phpgw::get_var('billing_id'));
-                               $result_objects = 
rental_soinvoice::get_instance()->get($start_index, $num_of_objects, 
$sort_field, $sort_ascending, $search_for, $search_type, $filters);
-                               $object_count = 
rental_soinvoice::get_instance()->get_count($search_for, $search_type, 
$filters);
-                               break;
                }
                
                //Create an empty row set
                $rows = array();
                foreach($result_objects as $result) {
+                       //var_dump($result);
                        if(isset($result))
                        {
-                               if($result->has_permission(PHPGW_ACL_READ))
-                               {
-                                       // ... add a serialized result
-                                       $rows[] = $result->serialize();
-                               }
+                               // ... add a serialized result
+                               $rows[] = $result->serialize();
                        }
                }
                
@@ -281,61 +215,5 @@
                                break;
                }
     }
-    
-    public function download_export()
-    {
-               if(!$this->isExecutiveOfficer())
-               {
-                       $this->render('permission_denied.php');
-                       return;
-               }
-       //$browser = CreateObject('phpgwapi.browser');
-               //$browser->content_header('export.txt','text/plain');
-               
-               $stop = phpgw::get_var('date');
-               
-               $cs15 = phpgw::get_var('generate_cs15');
-               if($cs15 == null){
-                       $export_format = 
explode('_',phpgw::get_var('export_format'));
-                       $file_ending = $export_format[1];
-                       if($file_ending == 'gl07')
-                       {
-                               $type = 'intern';
-                       }
-                       else if($file_ending == 'lg04')
-                       {
-                               $type = 'faktura';
-                       }
-                       $date = date('Ymd', $stop);
-                       header('Content-type: text/plain');
-                       header("Content-Disposition: attachment; 
filename=PE_{$type}_{$date}.{$file_ending}");
-                       
-                       $id = phpgw::get_var('id');
-                       $path = "/rental/billings/{$id}";
-                       
-                       $vfs = CreateObject('phpgwapi.vfs');
-                       $vfs->override_acl = 1;
-                       
-                       print $vfs->read
-                       (
-                               array
-                               (
-                                       'string' => $path,
-                                       RELATIVE_NONE
-                               )
-                       );
-                       
-                       //print 
rental_sobilling::get_instance()->get_export_data((int)phpgw::get_var('id'));
-               }
-               else{
-                       $file_ending = 'cs15';
-                       $type = 'kundefil';
-                       $date = date('Ymd', $stop);
-                       header('Content-type: text/plain');
-                       header("Content-Disposition: attachment; 
filename=PE_{$type}_{$date}.{$file_ending}");
-                       print 
rental_sobilling::get_instance()->generate_customer_export((int)phpgw::get_var('id'));
-               }
-    }
-
 }
 ?>

Modified: trunk/activitycalendar/inc/class.uiorganization.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.uiorganization.inc.php     2011-04-26 
12:57:28 UTC (rev 7235)
+++ trunk/activitycalendar/inc/class.uiorganization.inc.php     2011-04-27 
06:09:48 UTC (rev 7236)
@@ -1,8 +1,9 @@
 <?php
 phpgw::import_class('activitycalendar.uicommon');
 phpgw::import_class('activitycalendar.soorganization');
+phpgw::import_class('activitycalendar.sogroup');
 
-//include_class('activitycalendar', 'organization', 'inc/model/');
+include_class('activitycalendar', 'organization', 'inc/model/');
 
 class activitycalendar_uiorganization extends activitycalendar_uicommon
 {
@@ -64,30 +65,15 @@
                //Retrieve the type of query and perform type specific logic
                $type = phpgw::get_var('type');
 
-               /*$config       = 
CreateObject('phpgwapi.config','activitycalendar');
-               $config->read();
                switch($type)
                {
-                       case 'included_parties': // ... get all parties 
incolved in the contract
-                               $filters = array('contract_id' => $contract_id);
-                               break;
-                       case 'not_included_parties': // ... get all parties not 
included in the contract
-                               $filters = array('not_contract_id' => 
$contract_id, 'party_type' => phpgw::get_var('party_type'));
-                               break;
-                       case 'sync_parties':
-                       case 'sync_parties_res_unit':
-                       case 'sync_parties_identifier':
                        case 'sync_parties_org_unit':
-                               $filters = array('sync' => $type, 'party_type' 
=> phpgw::get_var('party_type'), 'active' => phpgw::get_var('active'));
-                               if($use_fellesdata)
-                               {
-                                       $bofelles = 
rental_bofellesdata::get_instance();
-                               }
+                               //$filters = array('sync' => $type, 
'party_type' => phpgw::get_var('party_type'), 'active' => 
phpgw::get_var('active'));
                                break;
                        default: // ... get all parties of a given type
                                //$filters = array('party_type' => 
phpgw::get_var('party_type'), 'active' => phpgw::get_var('active'));
                                break;
-               }*/
+               }
                
                $result_objects = 
activitycalendar_soorganization::get_instance()->get($start_index, 
$num_of_objects, $sort_field, $sort_ascending, $search_for, $search_type, 
$filters);
                $result_count = 
activitycalendar_soorganization::get_instance()->get_count($search_for, 
$search_type, $filters);
@@ -98,7 +84,19 @@
                foreach ($result_objects as $result) {
                        if(isset($result))
                        {
-                               $rows[] = $result->serialize();
+                               $res = $result->serialize();
+                               $org_id = $result->get_id();
+                               //$rows[] = $result->serialize();
+                               $rows[] = $res;
+                               $filter_group = array('org_id' => $org_id);
+                               $result_groups = 
activitycalendar_sogroup::get_instance()->get(null, null, $sort_field, 
$sort_ascending, $search_for, $search_type, $filter_group);
+                               foreach ($result_groups as $result_group) {
+                                       if(isset($result_group))
+                                       {
+                                               $res_g = 
$result_group->serialize();
+                                               $rows[] = $res_g;
+                                       }
+                               }
                        }
                }
                // ... add result data
@@ -182,7 +180,13 @@
                {
                        case 'all_organizations':
                                $value['ajax'][] = false;
-                               $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'booking.uiorganization.show', 'id' => $value['id'])));
+                               if($value['organization_id'] != '' && 
$value['organization_id'] != null){
+                                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 'booking.uigroup.show', 
'id' => $value['id'])));
+                               }
+                               else
+                               {
+                                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'booking.uiorganization.show', 'id' => $value['id'])));
+                               }
                                $value['labels'][] = lang('show');
                                break;
                }

Modified: trunk/activitycalendar/inc/model/class.activity.inc.php
===================================================================
--- trunk/activitycalendar/inc/model/class.activity.inc.php     2011-04-26 
12:57:28 UTC (rev 7235)
+++ trunk/activitycalendar/inc/model/class.activity.inc.php     2011-04-27 
06:09:48 UTC (rev 7236)
@@ -1,5 +1,8 @@
 <?php
-
+       phpgw::import_class('activitycalendar.soorganization');
+       phpgw::import_class('activitycalendar.sogroup');
+       phpgw::import_class('activitycalendar.soarena');
+       phpgw::import_class('activitycalendar.socontactperson');
        include_class('activitycalendar', 'model', 'inc/model/');
 
        class activitycalendar_activity extends activitycalendar_model
@@ -15,6 +18,8 @@
                protected $arena;
                protected $date_start;
                protected $date_end;
+               protected $create_date;
+               protected $last_change_date;
                protected $contact_person_1;
                protected $contact_person_2;
                
@@ -71,6 +76,13 @@
                
                public function get_description() { return $this->description; }
                
+               public function set_state($state)
+               {
+                       $this->state = $state;
+               }
+               
+               public function get_state() { return $this->state; }
+               
                public function set_arena($arena)
                {
                        $this->arena = $arena;
@@ -92,6 +104,20 @@
                
                public function get_date_end() { return $this->date_end; }
                
+               public function set_create_date($create_date)
+               {
+                       $this->create_date = $create_date;
+               }
+               
+               public function get_create_date() { return $this->create_date; }
+               
+               public function get_last_change_date() { return 
$this->last_change_date; }
+               
+               public function set_last_change_date($last_change_date)
+               {
+                       $this->last_change_date = $last_change_date;
+               }
+               
                public function set_contact_person_1($contact_person_1)
                {
                        $this->contact_person_1 = $contact_person_1;
@@ -114,7 +140,7 @@
                public static function get_so()
                {
                        if (self::$so == null) {
-                               self::$so = CreateObject('rental.socontract');
+                               self::$so = 
CreateObject('activitycalendar.soactivity');
                        }
                        
                        return self::$so;
@@ -122,18 +148,34 @@
                
                public function serialize()
                {
+                       /*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());
+                       }
+                       else if(isset($this->group_id) && $this->get_group_id() 
> 0)
+                       {
+                               $contact_1 = 
activitycalendar_socontactperson::get_instance()->get_group_contact_name($this->get_contact_person_1());
+                               $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' => 
$this->get_organization_id(),
-                               'group_id' => $this->get_group_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(),
                                'description' => $this->get_description(),
-                               'arena' => $this->get_arena(),
+                               '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(),
-                               'contact_person_1' => 
$this->get_contact_person_1(),
-                               'contact_person_2' => 
$this->get_contact_person_2()
+                               'contact_person_1' => $contact_1,
+                               'contact_person_2' => $contact_2
                        );
                }
        }

Added: trunk/activitycalendar/inc/model/class.contact_person.inc.php
===================================================================
--- trunk/activitycalendar/inc/model/class.contact_person.inc.php               
                (rev 0)
+++ trunk/activitycalendar/inc/model/class.contact_person.inc.php       
2011-04-27 06:09:48 UTC (rev 7236)
@@ -0,0 +1,121 @@
+<?php
+
+       include_class('activitycalendar', 'model', 'inc/model/');
+
+       class activitycalendar_contact_person extends activitycalendar_model
+       {
+               public static $so;
+               
+               protected $id;
+               protected $name;
+               protected $ssn;
+               protected $phone;
+               protected $email;
+               protected $organization_id;
+               protected $group_id;
+               
+               /**
+                * 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 set_ssn($ssn)
+               {
+                       $this->ssn = $ssn;
+               }
+       
+               public function get_ssn()
+               {
+                       return $this->ssn;
+               }
+               
+               public function set_phone($phone)
+               {
+                       $this->phone = $phone;
+               }
+       
+               public function get_phone()
+               {
+                       return $this->phone;
+               }
+               
+               public function set_email($email)
+               {
+                       $this->email = $email;
+               }
+       
+               public function get_email()
+               {
+                       return $this->email;
+               }
+               
+               public function set_organization_id($organization_id)
+               {
+                       $this->organization_id = $organization_id;
+               }
+       
+               public function get_organization_id()
+               {
+                       return $this->organization_id;
+               }
+               
+               public function set_group_id($group_id)
+               {
+                       $this->group_id = $group_id;
+               }
+       
+               public function get_group_id()
+               {
+                       return $this->group_id;
+               }
+
+               /**
+                * Get a static reference to the storage object associated with 
this model object
+                * 
+                * @return the storage object
+                */
+               public static function get_so()
+               {
+                       if (self::$so == null) {
+                               self::$so = CreateObject('rental.socontract');
+                       }
+                       
+                       return self::$so;
+               }
+               
+               public function serialize()
+               {
+                       return array(
+                               'id' => $this->get_id(),
+                               'name' => $this->get_name(),
+                               'ssn' => $this->get_ssn(),
+                               'phone' => $this->get_phone(),
+                               'email' => $this->get_email(),
+                               'organization_id' => 
$this->get_organization_id(),
+                               'group_id' => $this->get_group_id()
+                       );
+               }
+       }
+
+?>
\ No newline at end of file

Added: trunk/activitycalendar/inc/model/class.group.inc.php
===================================================================
--- trunk/activitycalendar/inc/model/class.group.inc.php                        
        (rev 0)
+++ trunk/activitycalendar/inc/model/class.group.inc.php        2011-04-27 
06:09:48 UTC (rev 7236)
@@ -0,0 +1,81 @@
+<?php
+       include_class('activitycalendar', 'model', 'inc/model/');
+
+       class activitycalendar_group extends activitycalendar_model
+       {
+               public static $so;
+               
+               protected $id;
+               protected $name;
+               protected $description;
+               protected $organization_id;
+               protected $show_in_portal;
+               protected $shortname;
+               
+               /**
+                * Constructor.  Takes an optional ID.  If a organization 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 organization
+                */
+               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 set_description($description)
+               {
+                       $this->description = $description;
+               }
+               
+               public function get_description() { return $this->description; }
+               
+               public function set_organization_id($organization_id)
+               {
+                       $this->organization_id = $organization_id;
+               }
+               
+               public function get_organization_id() { return 
$this->organization_id; }
+               
+               public function set_show_in_portal($show_in_portal)
+               {
+                       $this->show_in_portal = $show_in_portal;
+               }
+               
+               public function get_show_in_portal() { return 
$this->show_in_portal; }
+               
+               public function set_shortname($shortname)
+               {
+                       $this->shortname = $shortname;
+               }
+               
+               public function get_shortname() { return $this->shortname; }
+               
+               public function serialize()
+               {
+                       return array(
+                               'id' => $this->get_id(),
+                               'name' => $this->get_name(),
+                               'organization_id' => 
$this->get_organization_id(),
+                               'shortname' => $this->get_shortname(),
+                               'description' => $this->get_description(),
+                               'show_in_portal' => $this->get_show_in_portal()
+                       );
+               }
+               
+       }
+?>
\ No newline at end of file

Modified: trunk/activitycalendar/setup/phpgw_no.lang
===================================================================
--- trunk/activitycalendar/setup/phpgw_no.lang  2011-04-26 12:57:28 UTC (rev 
7235)
+++ trunk/activitycalendar/setup/phpgw_no.lang  2011-04-27 06:09:48 UTC (rev 
7236)
@@ -324,3 +324,33 @@
 Agegroups kan not be larger than 9999 peoples  activitycalendar        no      
Estimert antall deltakere kan ikke være større en 9999 personer
 Contact information name is to long. max 50 characters activitycalendar        
no      Navn i kontakt informasjon er for langt. Maks 50 tegn
 Unable to fill report  activitycalendar        no      Greide ikke å fylle ut 
rapport
+arena  activitycalendar        no      Arena
+description    activitycalendar        no      Beskrivelse
+date_start     activitycalendar        no      Startdato
+date_end       activitycalendar        no      Sluttdato
+contact_person_1       activitycalendar        no      Kontaktperson 1
+contact_person_2       activitycalendar        no      Kontaktperson 2
+Activities     activitycalendar        no      Aktiviteter
+activities     activitycalendar        no      Aktiviteter
+Arena  activitycalendar        no      Arena
+arenas activitycalendar        no      Arena
+OrganizationList       activitycalendar        no      Organisasjoner/Grupper
+f_new_activity activitycalendar        no      Ny aktivitet
+f_new_arena    activitycalendar        no      Ny arena
+search_for     activitycalendar        no      Søk etter
+activity_type  activitycalendar        no      Aktivitetstype
+all    activitycalendar        no      Alle
+not_internal   activitycalendar        no      Ikke intern
+organization_id        activitycalendar        no      Organisasjon ID
+arena_type     activitycalendar        no      Arenatype
+internal_arena_id      activitycalendar        no      Intern arena ID
+reset  activitycalendar        no      Nullstill
+organization_number    activitycalendar        no      Organisasjonsnummer
+elements_pr_page       activitycalendar        no      elementer per side
+shows_from     activitycalendar        no      Viser fra
+of_total       activitycalendar        no      av totalt
+DATATABLE_MSG_EMPTY    activitycalendar        no      Ingen elementer
+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

Modified: trunk/activitycalendar/setup/setup.inc.php
===================================================================
--- trunk/activitycalendar/setup/setup.inc.php  2011-04-26 12:57:28 UTC (rev 
7235)
+++ trunk/activitycalendar/setup/setup.inc.php  2011-04-27 06:09:48 UTC (rev 
7236)
@@ -22,12 +22,12 @@
        /* Dependencies for this app to work */
        $setup_info['activitycalendar']['depends'][] = array(
                'appname' => 'phpgwapi',
-               'versions' => array('0.9.17', '0.9.18')
+               'versions' => array('0.9.17', '0.9.18','0.9.19')
        );
 
        $setup_info['activitycalendar']['depends'][] = array(
                'appname' => 'booking',
-               'versions' => array('0.2.05')
+               'versions' => array('0.2.05','0.2.06','0.2.07')
        );
 
        $setup_info['activitycalendar']['depends'][] = array(

Modified: trunk/activitycalendar/setup/tables_current.inc.php
===================================================================
--- trunk/activitycalendar/setup/tables_current.inc.php 2011-04-26 12:57:28 UTC 
(rev 7235)
+++ trunk/activitycalendar/setup/tables_current.inc.php 2011-04-27 06:09:48 UTC 
(rev 7236)
@@ -8,10 +8,13 @@
                                'district' => array('type' => 
'varchar','precision' => '255'),
                                'category' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
                                'target' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => True),
+                               'state' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => True),
                                'description' => array('type' => 
'varchar','precision' => '255'),
                                'arena' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => True),
                                'date_start' => array('type' => 'int', 
'precision' => 4, 'precision' => '8', 'nullable' => true),
                                'date_end' => array('type' => 'int', 
'precision' => 4, 'precision' => '8', 'nullable' => true),
+                               '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')
                        ),

Modified: trunk/activitycalendar/templates/base/activity.php
===================================================================
--- trunk/activitycalendar/templates/base/activity.php  2011-04-26 12:57:28 UTC 
(rev 7235)
+++ trunk/activitycalendar/templates/base/activity.php  2011-04-27 06:09:48 UTC 
(rev 7236)
@@ -21,7 +21,7 @@
                                        {
                                                ?>
                                                <select name="organization_id">
-                                                       <option>Ingen 
organisasjon valgt</option>
+                                                       <option value="">Ingen 
organisasjon valgt</option>
                                                        <?php
                                                        foreach($organizations 
as $organization)
                                                        {
@@ -51,7 +51,7 @@
                                        {
                                                ?>
                                                <select name="group_id">
-                                                       <option>Ingen gruppe 
valgt</option>
+                                                       <option value="0">Ingen 
gruppe valgt</option>
                                                        <?php
                                                        foreach($groups as 
$group)
                                                        {
@@ -81,7 +81,7 @@
                                        {
                                                ?>
                                                <select name="arena_id">
-                                                       <option>Ingen arena 
valgt</option>
+                                                       <option value="0">Ingen 
arena valgt</option>
                                                        <?php
                                                        foreach($arenas as 
$arena)
                                                        {
@@ -116,6 +116,117 @@
                                        }
                                        ?>
                                </dd>
+                               <dt>
+                                       <?php if($activity->get_category() || 
$editable) { ?>
+                                       <label for="category"><?php echo 
lang('category') ?></label>
+                                       <?php  } ?>
+                               </dt>
+                               <dd>
+                                       <?php
+                                       if ($editable)
+                                       {
+                                       ?>
+                                               <input type="text" 
name="category" id="category" value="<?php echo $activity->get_category() ?>" />
+                                       <?php
+                                       }
+                                       else
+                                       {
+                                               echo $activity->get_category();
+                                       }
+                                       ?>
+                               </dd>
+                               <dt>
+                                       <?php if($activity->get_description() 
|| $editable) { ?>
+                                       <label for="description"><?php echo 
lang('description') ?></label>
+                                       <?php  } ?>
+                               </dt>
+                               <dd>
+                                       <?php
+                                       if ($editable)
+                                       {
+                                       ?>
+                                               <input type="text" 
name="description" id="description" value="<?php echo 
$activity->get_description() ?>" />
+                                       <?php
+                                       }
+                                       else
+                                       {
+                                               echo 
$activity->get_description();
+                                       }
+                                       ?>
+                               </dd>
+                               <dt>
+                                       <?php if($activity->get_date_start() || 
$editable) { ?>
+                                       <label for="start_date"><?php echo 
lang('date_start') ?></label>
+                                       <?php  } ?>
+                               </dt>
+                               <dd>
+                                       <?php
+                                               $start_date = 
$activity->get_date_start() ? 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$activity->get_date_start()) : '-';
+                                               $start_date_yui = 
$activity->get_date_start() ? date('Y-m-d', $activity->get_date_start()) : '';
+                                               $start_date_cal = 
$GLOBALS['phpgw']->yuical->add_listener('start_date', $start_date);?>
+                                       <?php if ($editable) {
+                                                       echo 
$GLOBALS['phpgw']->yuical->add_listener('start_date', $start_date);
+                                               } else {
+                                                       echo $start_date;
+                                               }
+                                       ?>
+                               </dd>
+                               <dt>
+                                       <?php if($activity->get_date_end() || 
$editable) { ?>
+                                       <label for="end_date"><?php echo 
lang('date_end') ?></label>
+                                       <?php  } ?>
+                               </dt>
+                               <dd>
+                                       <?php
+                                               $end_date = 
$activity->get_date_end() ? 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$activity->get_date_end()) : '-';
+                                               $end_date_yui = 
$activity->get_date_end() ? date('Y-m-d', $activity->get_date_end()) : '';
+                                               $end_date_cal =  
$GLOBALS['phpgw']->yuical->add_listener('end_date', $end_date);
+                                       ?>
+                                       <?php if ($editable) {
+                                                       echo 
$GLOBALS['phpgw']->yuical->add_listener('end_date', $end_date);
+                                               } else {
+                                                       echo $end_date;
+                                        }?>
+                                       <br/>
+                               </dd>
+                               <dt>
+                                       <?php 
if($activity->get_contact_person_1() || $editable) { ?>
+                                       <label for="contact_person_1"><?php 
echo lang('contact_person_1') ?></label>
+                                       <?php  } ?>
+                               </dt>
+                               <dd>
+                                       <?php
+                                       if ($editable)
+                                       {
+                                       ?>
+                                               <input type="text" 
name="contact_person_1" id="contact_person_1" value="<?php echo 
$activity->get_contact_person_1() ?>" />
+                                       <?php
+                                       }
+                                       else
+                                       {
+                                               echo 
$activity->get_contact_person_1();
+                                       }
+                                       ?>
+                               </dd>
+                               <dt>
+                                       <?php 
if($activity->get_contact_person_2() || $editable) { ?>
+                                       <label for="contact_person_2"><?php 
echo lang('contact_person_2') ?></label>
+                                       <?php  } ?>
+                               </dt>
+                               <dd>
+                                       <?php
+                                       if ($editable)
+                                       {
+                                       ?>
+                                               <input type="text" 
name="contact_person_2" id="contact_person_2" value="<?php echo 
$activity->get_contact_person_2() ?>" />
+                                       <?php
+                                       }
+                                       else
+                                       {
+                                               echo 
$activity->get_contact_person_2();
+                                       }
+                                       ?>
+                               </dd>
                        </dl>
                        <div class="form-buttons">
                                <?php

Modified: trunk/activitycalendar/templates/base/activity_list.php
===================================================================
--- trunk/activitycalendar/templates/base/activity_list.php     2011-04-26 
12:57:28 UTC (rev 7235)
+++ trunk/activitycalendar/templates/base/activity_list.php     2011-04-27 
06:09:48 UTC (rev 7236)
@@ -23,126 +23,19 @@
 
 
 <?php
-       $list_form = true;
+       $list_form = true;
        $list_id = 'all_activities';
        $url_add_on = '&amp;type=all_activities';
        include('activity_list_partial.php');
 ?>
-
+<!-- 
 <hr/>
-<hr/>
-<table>
-       <tr>
-               
<th>Navn</th><th>bydel</th><th>kategori</th><th>målgruppe</th><th>arena</th><th>kontor</th><th>epost</th><th>dato
 oppdatert</th>
-       </tr>
-       <tr>
-               <td>test</td><td>Fana</td><td>idrett</td><td>alle</td><td>Fana 
bydelshus</td><td>Fana</td><td>address@hidden</td><td>2011-03-24</td>
-       </tr>
-</table>
-<hr/>
-
-<div class="toolbar-container"><div class="toolbar"><form method="POST" 
action="/pe/index.php?menuaction=property.uilocation.index&amp;type_id=1&amp;district_id=&amp;part_of_town_id=&amp;cat_id=&amp;click_history=ed9d0b13fdf51556bfabd136e6d73aee">
 <div style="float:left" class="field"><input id="btn_cat_id" type="button" 
name="cat_id" value="Kategori" class="button" tabindex="1"></div>
 <div style="float:left" class="field"><input id="btn_district_id" 
type="button" name="district_id" value="Område" class="button" 
tabindex="2"></div>
 
 <div style="float:left" class="field"><input id="btn_part_of_town_id" 
type="button" name="part_of_town_id" value="Bydel" class="button" 
tabindex="3"></div>
 <div style="float:left" class="field"><input id="btn_owner_id" type="button" 
name="owner_id" value="Filter" class="button" tabindex="4"></div>
-<div style="float:right" class="field"><a id="btn_columns" href="#" 
onclick="Javascript:window.open('/pe/index.php?menuaction=property.uilocation.columns&amp;type_id=1&amp;click_history=ed9d0b13fdf51556bfabd136e6d73aee','','width=300,height=600,scrollbars=1')"
 tabindex="9">kolonner</a></div>
-<div style="float:right" class="field"><input id="btn_export" type="button" 
name="" value="Last ned" class="button" tabindex="8"></div>
-<div style="float:right" class="field"><input id="type_id" type="hidden" 
name="" value="1" class="hidden"></div>
-<div style="float:right" class="field"><input id="btn_search" type="button" 
name="search" value="Søk" class="button" tabindex="6"></div>
-<div style="float:right" class="field"><input id="txt_query" type="text" 
name="query" value="" class="text" size="28" tabindex="5" onkeypress="return 
pulsar(event)"></div>
-<div style="float:right" class="field"><input id="btn_new" type="button" 
name="" value="Legg til" class="button" tabindex="7"></div>
-</form></div></div><script type="text/javascript">
-                                       function Exchange_values(data)
-                                       {
-
-                                       }
-                               </script><br><div id="message"></div><div 
id="paging"></div><div class="datatable-container"></div><div 
id="datatable-detail" 
style="background-color:#000000;color:#FFFFFF;display:none">
-<div class="hd" style="background-color:#000000;color:#000000; border:0; 
text-align:center"> Record Detail </div>
-<div class="bd" style="text-align:center;"></div>
-</div><div id="footer"></div>
 <script type="text/javascript">
-               var allow_allrows = "1";
-
-               var property_js = "/pe/property/js/yahoo/property.js";
-
-               var base_java_url = 
"{menuaction:'property.uilocation.index',type_id:'1',query:'',district_id: 
'',part_of_town_id:'',lookup:'',second_display:1,lookup_tenant:'',lookup_name:'',cat_id:'',status:'',location_code:'',block_query:''}";
- 
-               
-                               var json_data = 
{"recordsReturned":"10","totalRecords":626,"startIndex":0,"sort":"loc1","dir":"asc","records":[],"integrationurl":"","hidden":{"dependent":[{"id":"","value":"#!no
 part of address@hidden address@hidden address@hidden address@hidden 
address@hidden address@hidden address@hidden  address@hidden@6#YTREBYGDA  
BYDEL@"}]},"rights":[{"my_name":"view","text":"Kontrakter","action":"\/pe\/index.php?menuaction=rental.uicontract.index&search_type=location_id&contract_status=all&populate_form=yes&click_history=ed9d0b13fdf51556bfabd136e6d73aee","parameters":{"parameter":[{"name":"search_for","source":"location_code"}]}},{"my_name":"view","text":"Vis","action":"\/pe\/index.php?menuaction=property.uilocation.view&click_history=ed9d0b13fdf51556bfabd136e6d73aee","parameters":{"parameter":[{"name":"location_code","source":"location_code"}]}},{"my_name":"view","text":"\u00c5pne
 visning i nytt 
vindu","action":"\/pe\/index.php?menuaction=property.uilocation.view&target=_blank&click_history=ed9d0b13fdf51556bfabd136e6d73aee","parameters":{"parameter":[{"name":"location_code","source":"location_code"}]}}]};
-                       
-
-               var myColumnDefs = [
-                       
-                               {
-                                       key: "location_code",
-                                       label: "dummy",
-                                       resizeable:true,
-                                       sortable: false,
-                                       visible: false,
-                                       format: "hidden",
-                                       formatter: "",
-                                       source: "",
-                                       className: ""
-                               },
-                               {
-                                       key: "loc1",
-                                       label: "Eiendom",
-                                       resizeable:true,
-                                       sortable: true,
-                                       visible: true,
-                                       format: "number",
-                                       formatter: "",
-                                       source: "fm_location1.loc1",
-                                       className: ""
-                               },
-                               {
-                                       key: "loc1_name",
-                                       label: "Eiendom Navn",
-                                       resizeable:true,
-                                       sortable: false,
-                                       visible: true,
-                                       format: "varchar",
-                                       formatter: "",
-                                       source: "",
-                                       className: ""
-                               },
-                               {
-                                       key: "adresse1",
-                                       label: "Adresse1",
-                                       resizeable:true,
-                                       sortable: true,
-                                       visible: true,
-                                       format: "varchar",
-                                       formatter: "",
-                                       source: "adresse1",
-                                       className: ""
-                               },
-                               {
-                                       key: "postnummer",
-                                       label: "Postnummer",
-                                       resizeable:true,
-                                       sortable: true,
-                                       visible: true,
-                                       format: "number",
-                                       formatter: "",
-                                       source: "postnummer",
-                                       className: ""
-                               },
-                               {
-                                       key: "poststed",
-                                       label: "Poststed",
-                                       resizeable:true,
-                                       sortable: true,
-                                       visible: true,
-                                       format: "varchar",
-                                       formatter: "",
-                                       source: "poststed",
-                                       className: ""
-                               }
-               ];
-
                var values_combo_box = [
                        
                                {
@@ -164,4 +57,5 @@
                ];
 
 
-       </script>
\ No newline at end of file
+       </script>
+-->
\ No newline at end of file

Modified: trunk/activitycalendar/templates/base/activity_list_partial.php
===================================================================
--- trunk/activitycalendar/templates/base/activity_list_partial.php     
2011-04-26 12:57:28 UTC (rev 7235)
+++ trunk/activitycalendar/templates/base/activity_list_partial.php     
2011-04-27 06:09:48 UTC (rev 7236)
@@ -17,21 +17,56 @@
            sortable: true
        },
        {
-               key: "arena_name",
-               label: "<?php echo lang('name') ?>",
+               key: "organization_id",
+               label: "<?php echo lang('organization') ?>",
            sortable: true
        },
        {
-               key: "internal_arena_id",
-               label: "<?php echo lang('internal_arena_id') ?>",
+               key: "group_id",
+               label: "<?php echo lang('group') ?>",
            sortable: true
        },
        {
-               key: "address",
-               label: "<?php echo lang('address') ?>",
+               key: "district",
+               label: "<?php echo lang('district') ?>",
            sortable: true
        },
        {
+               key: "category",
+               label: "<?php echo lang('category') ?>",
+           sortable: true
+       },
+       {
+               key: "description",
+               label: "<?php echo lang('description') ?>",
+           sortable: true
+       },
+       {
+               key: "arena",
+               label: "<?php echo lang('arena') ?>",
+           sortable: true
+       },
+       {
+               key: "date_start",
+               label: "<?php echo lang('date_start') ?>",
+           sortable: true
+       },
+       {
+               key: "date_end",
+               label: "<?php echo lang('date_end') ?>",
+           sortable: true
+       },
+       {
+               key: "contact_person_1",
+               label: "<?php echo lang('contact_person_1') ?>",
+           sortable: true
+       },
+       {
+               key: "contact_person_2",
+               label: "<?php echo lang('contact_person_2') ?>",
+           sortable: true
+       },
+       {
                key: "actions",
                hidden: true
        },
@@ -117,6 +152,15 @@
                        <option value="1"><?php echo lang('internal') 
?></option>
                        <option value="2" ><?php echo lang('not_internal') 
?></option>
                </select>
+               <label class="toolbar_element_label" 
for="ctrl_toggle_activity_state"><?php echo lang('activity_state') ?></label>
+               <select name="activity_state" id="<?php echo $list_id 
?>_ctrl_toggle_activity_state">
+                       <option value="all"><?php echo lang('all') ?></option>
+                       <option value="1"><?php echo lang('new') ?></option>
+                       <option value="2" ><?php echo lang('change') ?></option>
+                       <option value="3" ><?php echo lang('accepted') 
?></option>
+                       <option value="4" ><?php echo lang('processed') 
?></option>
+                       <option value="5" ><?php echo lang('rejected') 
?></option>
+               </select>
        </fieldset>
        
        




reply via email to

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