fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7592] Merge 7585:7591 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [7592] Merge 7585:7591 from trunk
Date: Thu, 15 Sep 2011 06:35:44 +0000

Revision: 7592
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7592
Author:   sigurdne
Date:     2011-09-15 06:35:42 +0000 (Thu, 15 Sep 2011)
Log Message:
-----------
Merge 7585:7591 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/controller/inc/class.menu.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
    branches/Version-1_0-branch/controller/inc/model/class.control.inc.php
    branches/Version-1_0-branch/controller/setup/phpgw_no.lang
    branches/Version-1_0-branch/controller/setup/setup.inc.php
    branches/Version-1_0-branch/controller/setup/tables_current.inc.php
    branches/Version-1_0-branch/controller/templates/base/control.php
    branches/Version-1_0-branch/phpgwapi/inc/class.send.inc.php
    branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
    branches/Version-1_0-branch/property/inc/class.bowo_hour.inc.php
    branches/Version-1_0-branch/property/inc/class.boworkorder.inc.php
    branches/Version-1_0-branch/property/inc/class.soentity.inc.php
    branches/Version-1_0-branch/property/inc/class.solocation.inc.php
    branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
    branches/Version-1_0-branch/property/inc/class.sotts.inc.php
    branches/Version-1_0-branch/property/inc/class.sowo_hour.inc.php
    branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php
    branches/Version-1_0-branch/property/templates/base/wo_hour.xsl

Added Paths:
-----------
    branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
    branches/Version-1_0-branch/controller/templates/base/control_item.php
    branches/Version-1_0-branch/controller/templates/base/unit_list_partial.php

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


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591

Modified: branches/Version-1_0-branch/controller/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.menu.inc.php       
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/controller/inc/class.menu.inc.php       
2011-09-15 06:35:42 UTC (rev 7592)
@@ -12,7 +12,7 @@
                                'controller' => array
                                (
                                        'text'  => lang('Controller'),
-                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'activitycalendar.uiactivities.index') ),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicontrol.index') ),
                     'image'    => array('property', 'location'),
                                        'order' => 10,
                                        'group' => 'office'
@@ -27,20 +27,12 @@
                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicontrol.index') ),
                                  'image'       => array('property', 
'location_1'),
                                ),
-                               'organizationList' => array
+                               'control_item' => array
                                (
-                                       'text'  => lang('OrganizationList'),
-                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'activitycalendar.uiorganization.index') ),
-                           'image'     => array('property', 'location_tenant'),
-                                       'children'      => array(
-                                                               
'changed_organizations' => array
-                                                               (
-                                                                       'text'  
=> lang('changed_org_group'),
-                                                                       'url'   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'activitycalendar.uiorganization.changed_organizations') ),
-                                                                       'image' 
=> array('property', 'location_tenant')
-                                                               )
-                                                       )
-                               )      
+                                       'text'  => lang('Control_item'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicontrol_item.index') ),
+                                 'image'       => array('property', 
'location_1'),
+                               )     
                        );
                        
                        $menus['folders'] = 
phpgwapi_menu::get_categories('bergen');

Modified: branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2011-09-15 06:35:42 UTC (rev 7592)
@@ -31,8 +31,6 @@
                
                $title = $control->get_title();
                
-               var_dump("i add");
-               
                $sql = "INSERT INTO controller_control (title) VALUES 
('$title')";
                $result = $this->db->query($sql, __LINE__,__FILE__);
 
@@ -67,8 +65,8 @@
                        'description = ' . 
$this->marshal($control->get_description(), 'string'),
                        'start_date = ' . 
$this->marshal($control->get_start_date(), 'int'),
                        'end_date = ' . 
$this->marshal($control->get_end_date(), 'int'),
-                       'repeat_date = ' . 
$this->marshal($control->get_repeat_date(), 'int'),
                        'repeat_day = ' . 
$this->marshal($control->get_repeat_day(), 'int'),
+                       'repeat_type = ' . 
$this->marshal($control->get_repeat_type(), 'int'),
                        'repeat_interval = ' . 
$this->marshal($control->get_repeat_interval(), 'int'),
                
                );

Copied: 
branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php (from 
rev 7591, trunk/controller/inc/class.socontrol_group.inc.php)
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php    
                        (rev 0)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php    
2011-09-15 06:35:42 UTC (rev 7592)
@@ -0,0 +1,176 @@
+<?php
+phpgw::import_class('controller.socommon');
+
+include_class('controller', 'control_group', 'inc/model/');
+
+class controller_socontrol_group extends controller_socommon
+{
+       protected static $so;
+
+       /**
+        * Get a static reference to the storage object associated with this 
model object
+        *
+        * @return controller_soparty the storage object
+        */
+       public static function get_instance()
+       {
+               if (self::$so == null) {
+                       self::$so = CreateObject('controller.socontrol_group');
+               }
+               return self::$so;
+       }
+
+       /**
+        * 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(&$control_group)
+       {
+               
+               $control_group = $control_group->get_control_group();
+               
+               $sql = "INSERT INTO controller_control_group (group_name) 
VALUES ('$title')";
+               $result = $this->db->query($sql, __LINE__,__FILE__);
+
+               if(isset($result)) {
+                       // Set the new party ID
+                       
$control_group->set_id($this->db->get_last_insert_id('controller_control_group',
 'id'));
+                       // Forward this request to the update method
+                       return $this->update($control_group);
+               }
+               else
+               {
+                       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($control_group)
+       {       
+               $id = intval($control_group->get_id());
+                       
+               $values = array(
+                       '$group_name = ' . 
$this->marshal($control_group->get_group_name(), 'string')
+               );
+               
+               //var_dump('UPDATE activity_activity SET ' . join(',', $values) 
. " WHERE id=$id");
+               $result = $this->db->query('UPDATE controller_control_group SET 
' . join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
+               
+               return isset($result);
+       }
+       
+       /**
+        * Get single procedure
+        * 
+        * @param       $id     id of the procedure to return
+        * @return a controller_procedure
+        */
+       function get_single($id)
+       {
+               $id = (int)$id;
+               
+               $sql = "SELECT p.* FROM controller_control_group p WHERE p.id = 
" . $id;
+               $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+               $this->db->next_record();
+               
+               $control_group = new 
controller_control_group($this->unmarshal($this->db->f('id', true), 'int'));
+               
$control_group->set_group_name($this->unmarshal($this->db->f('group_name', 
true), 'string'));
+               
+               return $control_group;
+       }
+       
+       /**
+        * Get a list of procedure objects matching the specific filters
+        * 
+        * @param $start search result offset
+        * @param $results number of results to return
+        * @param $sort field to sort by
+        * @param $query LIKE-based query string
+        * @param $filters array of custom filters
+        * @return list of rental_composite objects
+        */
+       function get_control_group_array($start = 0, $results = 1000, $sort = 
null, $dir = '', $query = null, $search_option = null, $filters = array())
+       {
+               $results = array();
+               
+               //$condition = $this->get_conditions($query, 
$filters,$search_option);
+               $order = $sort ? "ORDER BY $sort $dir ": '';
+               
+               //$sql = "SELECT * FROM controller_procedure WHERE $condition 
$order";
+               $sql = "SELECT * FROM controller_control_group $order";
+               $this->db->limit_query($sql, $start, __LINE__, __FILE__, 
$limit);
+               
+               while ($this->db->next_record()) {
+                       $control_group = new 
controller_control_group($this->unmarshal($this->db->f('id', true), 'int'));
+                       
$control_group->set_group_name($this->unmarshal($this->db->f('group_name', 
true), 'string'));
+                       
+                       $results[] = $control_group;
+               }
+               
+               return $results;
+       }       
+       
+       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 get_query(string $sort_field, boolean $ascending, 
string $search_for, string $search_type, array $filters, boolean $return_count)
+       {
+               
+               
+       }
+       
+       function populate(int $control_group_id, &$control_group)
+       {
+               /*
+               if($control_group == null) {
+                       $control_group = new activitycalendar_activity((int) 
$activity_id);
+
+                       
$control_group->set_title($this->unmarshal($this->db->f('title'), 'string'));
+                       
$control_group->set_organization_id($this->unmarshal($this->db->f('organization_id'),
 'int'));
+                       
$control_group->set_group_id($this->unmarshal($this->db->f('group_id'), 'int'));
+                       
$control_group->set_district($this->unmarshal($this->db->f('district'), 'int'));
+                       
$control_group->set_office($this->unmarshal($this->db->f('office'), 'int'));
+                       
$control_group->set_category($this->unmarshal($this->db->f('category'), 'int'));
+                       
$control_group->set_state($this->unmarshal($this->db->f('state'), 'int'));
+                       
$control_group->set_target($this->unmarshal($this->db->f('target'), 'string'));
+                       
$control_group->set_description($this->unmarshal($this->db->f('description'), 
'string'));
+                       
$control_group->set_arena($this->unmarshal($this->db->f('arena'), 'string'));
+                       
$control_group->set_internal_arena($this->unmarshal($this->db->f('internal_arena'),
 'string'));
+                       
$control_group->set_time($this->unmarshal($this->db->f('time'), 'string'));
+                       
$control_group->set_last_change_date($this->unmarshal($this->db->f('last_change_date'),
 'int'));
+                       
$control_group->set_special_adaptation($this->unmarshal($this->db->f('special_adaptation',
 'bool')));
+                       
$control_group->set_secret($this->unmarshal($this->db->f('secret'), 'string'));
+                       
+                       
+               }
+               */
+               return $control_group;
+       }
+       
+}

Copied: branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php 
(from rev 7591, trunk/controller/inc/class.socontrol_item.inc.php)
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php     
                        (rev 0)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php     
2011-09-15 06:35:42 UTC (rev 7592)
@@ -0,0 +1,190 @@
+<?php
+phpgw::import_class('controller.socommon');
+
+include_class('controller', 'control_item', 'inc/model/');
+
+class controller_socontrol_item extends controller_socommon
+{
+       protected static $so;
+
+       /**
+        * Get a static reference to the storage object associated with this 
model object
+        *
+        * @return controller_soparty the storage object
+        */
+       public static function get_instance()
+       {
+               if (self::$so == null) {
+                       self::$so = CreateObject('controller.socontrol_item');
+               }
+               return self::$so;
+       }
+
+       /**
+        * 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(&$control_item)
+       {
+               
+               $title = $control_item->get_title();
+               
+               $sql = "INSERT INTO controller_control_item (title) VALUES 
('$title')";
+               $result = $this->db->query($sql, __LINE__,__FILE__);
+
+               if(isset($result)) {
+                       // Set the new party ID
+                       
$control_item->set_id($this->db->get_last_insert_id('controller_control_item', 
'id'));
+                       // Forward this request to the update method
+                       return $this->update($control_item);
+               }
+               else
+               {
+                       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($control_item)
+       {       
+               $id = intval($control_item->get_id());
+                       
+               $values = array(
+                       '$purpose = ' . 
$this->marshal($control_item->get_purpose(), 'string'),
+                       'responsibility = ' . 
$this->marshal($control_item->get_responsibility(), 'int'),
+                       'description = ' . 
$this->marshal($control_item->get_description(), 'int'),
+                       'reference = ' . 
$this->marshal($control_item->get_reference(), 'int'),
+                       'attachment = ' . 
$this->marshal($control_item->get_attachment(), 'int')
+               );
+               
+               //var_dump('UPDATE activity_activity SET ' . join(',', $values) 
. " WHERE id=$id");
+               $result = $this->db->query('UPDATE controller_control_item SET 
' . join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
+               
+               return isset($result);
+       }
+       
+       /**
+        * Get single procedure
+        * 
+        * @param       $id     id of the procedure to return
+        * @return a controller_procedure
+        */
+       function get_single($id)
+       {
+               $id = (int)$id;
+               
+               $sql = "SELECT p.* FROM controller_control_item p WHERE p.id = 
" . $id;
+               $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+               $this->db->next_record();
+               
+               $control_item = new 
controller_control_item($this->unmarshal($this->db->f('id', true), 'int'));
+               $control_item->set_title($this->unmarshal($this->db->f('title', 
true), 'string'));
+               
$control_item->set_purpose($this->unmarshal($this->db->f('purpose', true), 
'string'));
+               
$control_item->set_responsibility($this->unmarshal($this->db->f('responsibility',
 true), 'string'));
+               
$control_item->set_description($this->unmarshal($this->db->f('description', 
true), 'string'));
+               
$control_item->set_reference($this->unmarshal($this->db->f('reference', true), 
'string'));
+               
$control_item->set_attachment($this->unmarshal($this->db->f('attachment', 
true), 'string'));
+               
+               return $control_item;
+       }
+       
+       /**
+        * Get a list of procedure objects matching the specific filters
+        * 
+        * @param $start search result offset
+        * @param $results number of results to return
+        * @param $sort field to sort by
+        * @param $query LIKE-based query string
+        * @param $filters array of custom filters
+        * @return list of rental_composite objects
+        */
+       function get_control_item_array($start = 0, $results = 1000, $sort = 
null, $dir = '', $query = null, $search_option = null, $filters = array())
+       {
+               $results = array();
+               
+               //$condition = $this->get_conditions($query, 
$filters,$search_option);
+               $order = $sort ? "ORDER BY $sort $dir ": '';
+               
+               //$sql = "SELECT * FROM controller_procedure WHERE $condition 
$order";
+               $sql = "SELECT * FROM controller_control_item $order";
+               $this->db->limit_query($sql, $start, __LINE__, __FILE__, 
$limit);
+               
+               while ($this->db->next_record()) {
+                       $control_item = new 
controller_control_item($this->unmarshal($this->db->f('id', true), 'int'));
+                       
$control_item->set_title($this->unmarshal($this->db->f('title', true), 
'string'));
+                       
$control_item->set_required($this->unmarshal($this->db->f('required', true), 
'boolean'));
+                       
$control_item->set_what_to_desc($this->unmarshal($this->db->f('what_to_desc', 
true), 'string'));
+                       
$control_item->set_how_to_desc($this->unmarshal($this->db->f('how_to_desc', 
true), 'string'));
+                       
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
 true), 'int'));
+                       
$control_item->set_control_type_id($this->unmarshal($this->db->f('control_type_id',
 true), 'int'));
+                       
+                       $results[] = $control_item;
+               }
+               
+               return $results;
+       }       
+       
+       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 get_query(string $sort_field, boolean $ascending, 
string $search_for, string $search_type, array $filters, boolean $return_count)
+       {
+               
+               
+       }
+       
+       function populate(int $control_item_id, &$control_item)
+       {
+               /*
+               if($control_item == null) {
+                       $control_item = new activitycalendar_activity((int) 
$activity_id);
+
+                       
$control_item->set_title($this->unmarshal($this->db->f('title'), 'string'));
+                       
$control_item->set_organization_id($this->unmarshal($this->db->f('organization_id'),
 'int'));
+                       
$control_item->set_group_id($this->unmarshal($this->db->f('group_id'), 'int'));
+                       
$control_item->set_district($this->unmarshal($this->db->f('district'), 'int'));
+                       
$control_item->set_office($this->unmarshal($this->db->f('office'), 'int'));
+                       
$control_item->set_category($this->unmarshal($this->db->f('category'), 'int'));
+                       
$control_item->set_state($this->unmarshal($this->db->f('state'), 'int'));
+                       
$control_item->set_target($this->unmarshal($this->db->f('target'), 'string'));
+                       
$control_item->set_description($this->unmarshal($this->db->f('description'), 
'string'));
+                       
$control_item->set_arena($this->unmarshal($this->db->f('arena'), 'string'));
+                       
$control_item->set_internal_arena($this->unmarshal($this->db->f('internal_arena'),
 'string'));
+                       
$control_item->set_time($this->unmarshal($this->db->f('time'), 'string'));
+                       
$control_item->set_last_change_date($this->unmarshal($this->db->f('last_change_date'),
 'int'));
+                       
$control_item->set_special_adaptation($this->unmarshal($this->db->f('special_adaptation',
 'bool')));
+                       
$control_item->set_secret($this->unmarshal($this->db->f('secret'), 'string'));
+                       
+                       
+               }
+               */
+               return $control_item;
+       }
+       
+}

Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2011-09-15 06:35:42 UTC (rev 7592)
@@ -20,7 +20,7 @@
                public function __construct()
                {
                        parent::__construct();
-                       
+
                        $this->so = CreateObject('controller.socontrol');
                        $this->so_proc = CreateObject('controller.soprocedure');
                        $this->bo = CreateObject('property.boevent',true);
@@ -28,21 +28,27 @@
                
                public function index()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"controller::control";
+                       
                        $repeat_type = $this->bo->get_rpt_type_list();
                        $repeat_day = $this->bo->get_rpt_day_list();
 
                        if(isset($_POST['save_control'])) // The user has 
pressed the save button
                        {
-                               if(isset($control)) // If an control object is 
created
+                               if(isset($control)) // Edit control
                                {
                                        
$control->set_title(phpgw::get_var('title'));
-                                       $control->set_description($desc);
+                                       
$control->set_description(phpgw::get_var('description'));
                                        $control->set_start_date( strtotime( 
phpgw::get_var('start_date')  ) );
                                        $control->set_end_date( strtotime( 
phpgw::get_var('end_date') ) );
+                                       $control->set_repeat_day( strtotime( 
phpgw::get_var('repeat_day') ) );
+                                       $control->set_repeat_type( strtotime( 
phpgw::get_var('repeat_type') ) );
+                                       $control->set_repeat_interval( 
strtotime( phpgw::get_var('repeat_interval') ) );
+                                       $control->set_enabled( true );
                                                                        
                                        $this->so->add($control);
                                }
-                               else 
+                               else // Add new control
                                {
 
                                        $control = new controller_control();
@@ -54,7 +60,7 @@
                                        $control->set_repeat_day( strtotime( 
phpgw::get_var('repeat_day') ) );
                                        $control->set_repeat_type( strtotime( 
phpgw::get_var('repeat_type') ) );
                                        $control->set_repeat_interval( 
strtotime( phpgw::get_var('repeat_interval') ) );
-                                       
+                                       $control->set_enabled( true );
                                                                        
                                        $this->so->add($control);
                                }

Copied: branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php 
(from rev 7591, trunk/controller/inc/class.uicontrol_item.inc.php)
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php     
                        (rev 0)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php     
2011-09-15 06:35:42 UTC (rev 7592)
@@ -0,0 +1,88 @@
+<?php
+       phpgw::import_class('controller.uicommon');
+       phpgw::import_class('property.boevent');
+       phpgw::import_class('controller.socontrol');
+       phpgw::import_class('controller.socontrol_item');
+       phpgw::import_class('controller.socontrol_group');
+       
+       include_class('controller', 'control', 'inc/model/');
+
+       class controller_uicontrol_item extends controller_uicommon
+       {
+               private $bo; 
+               private $so;
+               private $so_proc; 
+               
+               public $public_functions = array
+               (
+                       'index' =>      true
+               );
+
+               public function __construct()
+               {
+                       parent::__construct();
+
+                       $this->so = CreateObject('controller.socontrol');
+                       $this->so_control_item = 
CreateObject('controller.socontrol_item');
+                       $this->so_control_group = 
CreateObject('controller.socontrol_group');
+                       $this->bo = CreateObject('property.boevent',true);
+               }
+               
+               public function index()
+               {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"controller::control";
+                       
+                       $repeat_type = $this->bo->get_rpt_type_list();
+                       $repeat_day = $this->bo->get_rpt_day_list();
+
+                       if(isset($_POST['save_control'])) // The user has 
pressed the save button
+                       {
+                               if(isset($control)) // Edit control
+                               {
+                                       
$control->set_title(phpgw::get_var('title'));
+                                       
$control->set_description(phpgw::get_var('description'));
+                                       $control->set_start_date( strtotime( 
phpgw::get_var('start_date')  ) );
+                                       $control->set_end_date( strtotime( 
phpgw::get_var('end_date') ) );
+                                       $control->set_repeat_day( strtotime( 
phpgw::get_var('repeat_day') ) );
+                                       $control->set_repeat_type( strtotime( 
phpgw::get_var('repeat_type') ) );
+                                       $control->set_repeat_interval( 
strtotime( phpgw::get_var('repeat_interval') ) );
+                                       $control->set_enabled( true );
+                                                                       
+                                       $this->so->add($control);
+                               }
+                               else // Add new control
+                               {
+
+                                       $control = new controller_control();
+                                       
+                                       
$control->set_title(phpgw::get_var('title'));
+                                       
$control->set_description(phpgw::get_var('description'));
+                                       $control->set_start_date( strtotime( 
phpgw::get_var('start_date')  ) );
+                                       $control->set_end_date( strtotime( 
phpgw::get_var('end_date') ) );
+                                       $control->set_repeat_day( strtotime( 
phpgw::get_var('repeat_day') ) );
+                                       $control->set_repeat_type( strtotime( 
phpgw::get_var('repeat_type') ) );
+                                       $control->set_repeat_interval( 
strtotime( phpgw::get_var('repeat_interval') ) );
+                                       $control->set_enabled( true );
+                                                                       
+                                       $this->so->add($control);
+                               }
+                       }
+                       
+                       $control_item_array = 
$this->so_control_item->get_control_item_array();
+                       $control_group_array = 
$this->so_control_group->get_control_group_array();
+                       
+                       $this->render('control_item.php', array
+                                               (
+                                               'editable' => true,
+                                               'control_item_array' => 
$control_item_array,
+                                               'control_group_array' => 
$control_group_array 
+                                               )
+                                       );
+               }
+                                       
+               public function query()
+               {
+                       var_dump("Er i uicontrol");
+
+               }       
+       }
\ No newline at end of file

Modified: branches/Version-1_0-branch/controller/inc/model/class.control.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.control.inc.php      
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/controller/inc/model/class.control.inc.php      
2011-09-15 06:35:42 UTC (rev 7592)
@@ -10,7 +10,11 @@
                protected $description;
                protected $start_date;
                protected $end_date;
-               
+               protected $repeat_day;
+               protected $repeat_type;
+               protected $repeat_interval;
+               protected $enabled;
+                               
                /**
                 * 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.
@@ -57,7 +61,34 @@
                
                public function get_start_date() { return $this->start_date; }
                
+               public function set_repeat_day($repeat_day)
+               {
+                       $this->repeat_day = $repeat_day;
+               }
                
+               public function get_repeat_day() { return $this->repeat_day; }
+               
+               public function set_repeat_type($repeat_type)
+               {
+                       $this->repeat_type = $repeat_type;
+               }
+                                       
+               public function get_repeat_type() { return $this->repeat_type; }
+               
+               public function set_repeat_interval($repeat_interval)
+               {
+                       $this->repeat_interval = $repeat_interval;
+               }
+               
+               public function get_repeat_interval() { return 
$this->repeat_interval; }
+               
+               public function set_enabled($enabled)
+               {
+                       $this->enabled = $enabled;
+               }
+               
+               public function get_enabled() { return $this->enabled; }
+                               
                /**
                 * Get a static reference to the storage object associated with 
this model object
                 * 

Modified: branches/Version-1_0-branch/controller/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/controller/setup/phpgw_no.lang  2011-09-15 
05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/controller/setup/phpgw_no.lang  2011-09-15 
06:35:42 UTC (rev 7592)
@@ -35,7 +35,7 @@
 select_date    controller      no      Velg dato
 year controller        no      År
 location_code  controller      no      Enhetsnummer
-included_units controller      no      Leieobjektets enheter
+included_units controller      no      Kontrollens enheter
 floor  controller      no      Etasje
 section        controller      no      Seksjon
 room   controller      no      Rom
@@ -306,7 +306,6 @@
 in_operation   controller      no      I drift
 inactive_party controller      no      Kontraktspart er inaktiv
 inactive       controller      no      Inaktiv
-included_units controller      no      Leieobjektets enheter
 internal       controller      no      Interne kontraktsparter
 interval       controller      no      Intervall
 Invalid location code for the building.        controller      no      Ugyldig 
objektnummer for bygg.
@@ -627,4 +626,6 @@
 year   controller      no      År
 yes    controller      no      Ja
 your_notifications     controller      no      Dine varsler
-control_items  controller      no      Kontrollpunkt
\ No newline at end of file
+control_items  controller      no      Kontrollpunkt
+Control_item   controller      no      Kontrollpunkt
+

Modified: branches/Version-1_0-branch/controller/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/setup.inc.php  2011-09-15 
05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/controller/setup/setup.inc.php  2011-09-15 
06:35:42 UTC (rev 7592)
@@ -35,11 +35,12 @@
        (
                'controller_control',
                'controller_control_schedule',
-               'controller_control_point_list',
-               'controller_control_point',
+               'controller_control_item_list',
+               'controller_control_item',
                'controller_control_group',
-               'controller_check_point',
-               'controller_check_list'
+               'controller_check_item',
+               'controller_check_list',
+               'controller_procedure',
+               'controller_control_type'
        );
-       
-?>
+?>
\ No newline at end of file

Modified: branches/Version-1_0-branch/controller/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_current.inc.php 
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/controller/setup/tables_current.inc.php 
2011-09-15 06:35:42 UTC (rev 7592)
@@ -7,7 +7,6 @@
                                'description' => array('type' => 'varchar', 
'precision' => '255', 'nullable' => True),
                                'start_date' => array('type' => 'int', 
'precision' => 8, 'nullable' => True),
                                'end_date' => array('type' => 'int', 
'precision' => 8, 'nullable' => True),
-                               'frequency_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
                                'procedure_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
                                'requirement_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
                                'costResponsibility_id' => array('type' => 
'int', 'precision' => 4, 'nullable' => True),
@@ -17,7 +16,6 @@
                                'equipment_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
                                'location_code' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
                                'repeat_type' => array('type' => 'int', 
'precision' => 2, 'nullable' => True),
-                               'repeat_day' => array('type' => 'int', 
'precision' => 2, 'nullable' => True),
                                'repeat_interval' => array('type' => 'int', 
'precision' => 2, 'nullable' => True),
                                'enabled' => array('type' => 'int', 'precision' 
=> 2, 'nullable' => True)
                        ),
@@ -26,17 +24,6 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-               'controller_control_schedule' => array(
-                       'fd' => array(
-                               'id' => array('type' => 'auto','precision' => 
4,'nullable' => False),
-                               'control_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
-                               'schedule_time' => array('type' => 'int', 
'precision' => 8, 'nullable' => True)
-                       ),
-                       'pk' => array('id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
                'controller_control_item_list' => array(
                        'fd' => array(
                                'id' => array('type' => 'auto','precision' => 
4,'nullable' => False),
@@ -114,5 +101,15 @@
                        'fk' => array(),
                        'ix' => array(),
                        'uc' => array()
+               ),
+               'controller_control_type' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'auto','precision' => 
4,'nullable' => False),
+                               'title' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False)
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
                )
        );

Modified: branches/Version-1_0-branch/controller/templates/base/control.php
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control.php   
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/controller/templates/base/control.php   
2011-09-15 06:35:42 UTC (rev 7592)
@@ -7,10 +7,6 @@
 
 <div class="identifier-header">
 <h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/actions/go-home.png" /> <?php echo lang('control') ?></h1>
-       <div>
-               <button onclick="javascript:window.location.href ='<?php echo 
$cancel_link;?>;'">&laquo;&nbsp;<?php //echo 
lang('composite_back');?></button><br/>
-               <label><?php echo lang('name') ?> </label><?php //echo 
$composite->get_name() ?>
-       </div>
 </div>
 
 
@@ -41,7 +37,7 @@
                                                <label 
for="description">Beskrivelse</label>
                                        </dt>
                                        <dd>
-                                               <input type="text" 
name="description" id="description" value="" />
+                                               <textarea cols="70" rows="5" 
name="description" id="description" value="" /></textarea>
                                        </dd>
                                        <dt>
                                                <label 
for="start_date">Startdato</label>
@@ -50,7 +46,7 @@
                                                <?php
                                                        $start_date = "-";
                                                        $start_date_yui = 
date('Y-m-d');
-                                                       $start_date_cal = 
$GLOBALS['phpgw']->yuical->add_listener('date_start', $start_date);
+                                                       $start_date_cal = 
$GLOBALS['phpgw']->yuical->add_listener('start_date', $start_date);
                                                
                                                        echo $start_date_cal;
                                                ?>
@@ -61,28 +57,16 @@
                                        <dd>
                                                <?php
                                                        $end_date = "";
-                                                       $end_date_yui;
-                                                       $end_date_cal =  
$GLOBALS['phpgw']->yuical->add_listener('date_end');
+                                                       $end_date_yui = 
date('Y-m-d');
+                                                       $end_date_cal =  
$GLOBALS['phpgw']->yuical->add_listener('end_date', $end_date);
                                                
                                                        echo $end_date_cal;
                                                ?>
                                        </dd>
                                        <dt>
-                                               <label>Dag</label>
+                                               <label>Frekvenstype</label>
                                        </dt>
                                        <dd>
-                                               <input type="checkbox" 
value="0" name="repeat_day[]" title="Mandag">Mandag
-                                               <input type="checkbox" 
value="1" name="repeat_day[]" title="Tirsdag">Tirsdag
-                                               <input type="checkbox" 
value="2" name="repeat_day[]" title="Onsdag">Onsdag
-                                               <input type="checkbox" 
value="3" name="repeat_day[]" title="Torsdag">Torsdag
-                                               <input type="checkbox" 
value="4" name="repeat_day[]" title="Fredag">Fredag
-                                               <input type="checkbox" 
value="5" name="repeat_day[]" title="Lørdag">Lørdag
-                                               <input type="checkbox" 
value="6" name="repeat_day[]" title="Søndag">Søndag
-                                       </dd>
-                                       <dt>
-                                               <label>Type</label>
-                                       </dt>
-                                       <dd>
                                                <select id="repeat_type" 
name="repeat_type">
                                                        <option value="0">Ikke 
angitt</option>
                                                        <option 
value="1">Daglig</option>
@@ -93,10 +77,10 @@
                                                </select>
                                        </dd>
                                        <dt>
-                                               <label>Intervall</label>
+                                               <label>Frekvens</label>
                                        </dt>
                                        <dd>
-                                               <input type="text" 
name="repeat_interval" value="" />
+                                               <input size="2" type="text" 
name="repeat_interval" value="" />
                                        </dd>
                                        <dt>
                                                <label>Prosedyre</label>
@@ -108,7 +92,6 @@
                                                                        echo 
"<option value='" . $procedure->get_id() . "'>" . $procedure->get_title() . 
"</option>";
                                                                }
                                                        ?>
-                                                       
                                                </select>
                                        </dd>
                                </dl>
@@ -129,8 +112,9 @@
                                        $list_id = 'included_units';
                                        //$url_add_on = 
'&amp;control_id='.$control->get_id();
                                        unset($extra_cols);
-                                       include('unit_list_partial.php');
+                                       //include('unit_list_partial.php');
        
+                               $editable = 'true';
                                        
                    if ($editable) { 
                                    echo '<h3>'.lang('all_locations').'</h3>';

Copied: branches/Version-1_0-branch/controller/templates/base/control_item.php 
(from rev 7591, trunk/controller/templates/base/control_item.php)
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control_item.php      
                        (rev 0)
+++ branches/Version-1_0-branch/controller/templates/base/control_item.php      
2011-09-15 06:35:42 UTC (rev 7592)
@@ -0,0 +1,74 @@
+<?php  
+       //include common logic for all templates
+       include("common.php");
+?>
+
+<div class="identifier-header">
+<h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/actions/go-home.png" /> <?php echo lang('Control_item') ?></h1>
+</div>
+
+<div class="yui-content">
+               <div id="details">
+                       <form action="#" method="post">
+                               <input type="hidden" name="id" value="<?php 
if(!empty($control)){ echo $control->get_id(); } else { echo '0'; }  ?>"/>
+                               <dl class="proplist-col">
+                                       <dt>
+                                               <label 
for="title">Tittel</label>
+                                       </dt>
+                                       <dd>
+                                               <input type="text" name="title" 
id="title" value="" />
+                                       </dd>
+                                       <dt>
+                                               <label 
for="required">Obligatorisk</label>
+                                       </dt>
+                                       <dd>
+                                               <input type="checkbox" value="" 
/>
+                                       </dd>
+                                       <dt>
+                                               <label for="what_to_do">Hva 
skal utføres</label>
+                                       </dt>
+                                       <dd>
+                                               <textarea id="what_to_do" 
rows="5" cols="60"></textarea>
+                                       </dd>
+                                       <dt>
+                                               <label 
for="how_to_do">Utførelsesbeskrivelse</label>
+                                       </dt>
+                                       <dd>
+                                               <textarea id="how_to_do" 
rows="5" cols="60"></textarea>
+                                       </dd>
+                                       <dt>
+                                               <label 
for="control_group">Kontrollgruppe</label>
+                                       </dt>
+                                       <dd>
+                                               <select id="control_group" 
name="control_group">
+                                                       <?php 
+                                                               foreach 
($control_group_array as $control_group) {
+                                                                       echo 
"<option value='" . $control_group->get_id() . "'>" . 
$control_group->get_title() . "</option>";
+                                                               }
+                                                       ?>
+                                               </select>
+                                       </dd>
+                                       <dt>
+                                               <label 
for="control_type">Kontrolltype</label>
+                                       </dt>
+                                       <dd>
+                                               <select id="control_type" 
name="control_type">
+                                                       <?php 
+                                                               foreach 
($control_type_array as $control_type) {
+                                                                       echo 
"<option value='" . $control_type->get_id() . "'>" . $control_type->get_title() 
. "</option>";
+                                                               }
+                                                       ?>
+                                               </select>
+                                       </dd>                           
+                               </dl>
+                               
+                               <div class="form-buttons">
+                                       <?php
+                                               echo '<input type="submit" 
name="save_control" value="' . lang('save') . '"/>';
+                                       ?>
+                               </div>
+                               
+                       </form>
+                                               
+               </div>
+</div>
\ No newline at end of file

Copied: 
branches/Version-1_0-branch/controller/templates/base/unit_list_partial.php 
(from rev 7591, trunk/controller/templates/base/unit_list_partial.php)
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/unit_list_partial.php 
                        (rev 0)
+++ branches/Version-1_0-branch/controller/templates/base/unit_list_partial.php 
2011-09-15 06:35:42 UTC (rev 7592)
@@ -0,0 +1,146 @@
+<script type="text/javascript">
+       //Add listener resetting form: redirects browser to call index  again
+       YAHOO.util.Event.addListener(
+               'ctrl_reset_button',
+               'click',
+               function(e)
+               {
+               YAHOO.util.Event.stopEvent(e);
+       window.location = 'index.php?menuaction=rental.uicomposite.edit';
+               }
+       );
+
+       var formatArea = function(elCell, oRecord, oColumn, oData) {
+               if (oData != undefined && oData != 0) {
+                       elCell.innerHTML = YAHOO.util.Number.format( oData,
+                       {
+                               suffix: " <?php echo 
isset($config->config_data['area_suffix']) && 
$config->config_data['area_suffix'] ? $config->config_data['area_suffix'] : 
'kvm'; ?>",
+                               thousandsSeparator: "<?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['thousands_separator'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['thousands_separator'] 
? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['thousands_separator'] 
: '.'; ?>",
+                               decimalSeparator: "<?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] : 
',';?>",
+                               decimalPlaces: <?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['area_decimal_places'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['area_decimal_places'] 
? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['area_decimal_places'] 
: 2; ?>
+                   });
+               }
+       }
+       
+       //Columns for added areas datatable
+       var columnDefs = [{
+               key: "location_code",
+               label: "<?php echo lang('object_number') ?>",
+               sortable: true
+       },
+       {
+               key: "loc1_name",
+               label: "<?php echo lang('property') ?>",
+               sortable: false
+       },
+       {
+               key: "loc2_name",
+               label: "<?php echo lang('building') ?>",
+               sortable: false
+       },
+       {
+               key: "loc3_name",
+               label: "<?php echo lang('floor') ?>",
+               sortable: false
+       },
+       {
+               key: "loc4_name",
+               label: "<?php echo lang('section') ?>",
+               sortable: false
+       },
+       {
+               key: "loc5_name",
+               label: "<?php echo lang('room') ?>",
+               sortable: false
+       },
+       {
+               key: "address",
+               label: "<?php echo lang('address') ?>",
+         sortable: false
+       },
+       {
+               key: "area_gros",
+               label: "<?php echo lang('area_gros') ?>",
+               formatter: formatArea,
+         sortable: false
+       },
+       {
+               key: "area_net",
+               label: "<?php echo lang('area_net') ?>",
+               formatter: formatArea,
+         sortable: false
+       },
+       {
+               key: "actions",
+               hidden: true
+       },
+       {
+               key: "labels",
+               hidden: true
+       },
+       {
+               key: "ajax",
+               hidden: true
+       }];
+
+       <?php
+                       if(isset($extra_cols)){
+                               foreach($extra_cols as $col){
+                                       $literal = "{key: \"".$col["key"]."\",
+                                                       label: 
\"".$col["label"]."\"}";
+                                       if($col["index"]){
+                                               echo 
"columnDefs.splice(".$col["index"].", 0,".$literal.");";
+                                       } else {
+                                               echo 
"columnDefs.push($literal);";
+                                       }
+                               }
+                       }
+               ?>
+
+       // Initiating the data source
+       setDataSource(
+                       
'index.php?menuaction=rental.uiunit.query&amp;phpgw_return_as=json<?php echo 
$url_add_on ?>&amp;editable=<?php echo $editable ? "true" : "false"; ?>',
+                       columnDefs,
+                       '<?php echo $list_id ?>_form',
+                       [],
+                       '<?php echo $list_id ?>_container',
+                       '<?php echo $list_id ?>_paginator',
+                       '<?php echo $list_id ?>',
+                       new Array(<?php
+                                       if(isset($related)){
+                                               foreach($related as $r){
+                                                       echo "\"".$r."\"";
+                                               }
+                                       }
+                               ?>)
+       );
+</script>
+<?php
+       if($list_form)
+       {
+?>
+<form id="<?php echo $list_id ?>_form" method="GET">
+       <fieldset>
+               <!-- Filters -->
+               <h3><?php echo lang('filters') ?></h3>
+               <?
+               // TODO: We should get the levels dynamically
+               ?>
+               <label for="ctrl_toggle_level"><?php echo lang('level') 
?></label>
+               <select name="level" id="<?php echo $list_id 
?>_ctrl_toggle_level">
+                       <option value="1"><?php echo lang('property') 
?></option>
+                       <option value="2" selected="selected"><?php echo 
lang('building') ?></option>
+                       <option value="3"><?php echo lang('floor') ?></option>
+                       <option value="4"><?php echo lang('section') ?></option>
+                       <option value="5"><?php echo lang('room') ?></option>
+               </select>
+
+               <label class="toolbar_element_label" for="available_date"><?php 
echo lang('available_at') ?></label>
+               <?php echo 
$GLOBALS['phpgw']->yuical->add_listener("{$list_id}_available_date", 
$notification_date); ?>
+       </fieldset>
+</form>
+<?php 
+       }
+?>
+<div id="<?php echo $list_id ?>_paginator" class="paginator"></div>
+<div id="<?php echo $list_id ?>_container" class="datatable_container"></div>

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.send.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.send.inc.php 2011-09-15 
05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.send.inc.php 2011-09-15 
06:35:42 UTC (rev 7592)
@@ -56,6 +56,7 @@
                function send_email($to, $subject, $body, $msgtype, $cc, $bcc, 
$from, $sender, $content_type, $ignored,$attachments, $receive_notification)
                {
                        $smtp = createObject('phpgwapi.mailer_smtp');
+                       $from = 
str_replace(array('[',']'),array('<','>'),$from);
                        $from_array = split('<', $from);
                        unset($from);
                        if ( count($from_array) == 2 )
@@ -80,6 +81,7 @@
                        
                        foreach ($to as $entry)
                        {
+                               $entry = 
str_replace(array('[',']'),array('<','>'),$entry);
                                $to_array = split('<', $entry);
                                if ( count($to_array) == 2 )
                                {
@@ -105,6 +107,7 @@
                        
                                foreach ($cc as $entry)
                                {
+                                       $entry = 
str_replace(array('[',']'),array('<','>'),$entry);
                                        $cc_array = split('<', $entry);
                                        if ( count($cc_array) == 2 )
                                        {
@@ -130,6 +133,7 @@
                        
                                foreach ($bcc as $entry)
                                {
+                                       $entry = 
str_replace(array('[',']'),array('<','>'),$entry);
                                        $bcc_array = split('<', $entry);
                                        if ( count($bcc_array) == 2 )
                                        {

Modified: branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bocommon.inc.php     
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/property/inc/class.bocommon.inc.php     
2011-09-15 06:35:42 UTC (rev 7592)
@@ -1163,7 +1163,7 @@
                                {
                                        $type_id        = 
count($location_types);
                                }
-
+                               $cols.= ",fm_location1.loc1_name";
                                $this->join = $this->socommon->join;
                                $joinmethod .= " $this->join  fm_location1 ON 
($entity_table.loc1 = fm_location1.loc1))";
                                $paranthesis .='(';

Modified: branches/Version-1_0-branch/property/inc/class.bowo_hour.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bowo_hour.inc.php    
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/property/inc/class.bowo_hour.inc.php    
2011-09-15 06:35:42 UTC (rev 7592)
@@ -408,35 +408,15 @@
                        return $receipt;
                }
 
-               function get_email($to_email,$vendor_id)
+               function get_email($selected, $vendor_id)
                {
-                       $selected = $to_email;
+                       $email_list = $this->so->get_email($vendor_id);
 
-                       $email_ist = $this->so->get_email($vendor_id);
-
-                       while (is_array($email_ist) && list(,$email_entry) = 
each($email_ist))
+                       foreach( $email_list as &$email_entry )
                        {
-                               $sel_email = '';
-                               if ($email_entry['email']==$selected)
-                               {
-                                       $sel_email = 'selected';
-                               }
-
-                               $email_list[] = array
-                                       (
-                                               'email'         => 
$email_entry['email'],
-                                               'selected'      => $sel_email
-                                       );
+                               $email_entry['selected'] = 
trim($email_entry['email']) == trim($selected) ? 1 : 0;
                        }
 
-                       for ($i=0;$i<count($email_list);$i++)
-                       {
-                               if ($email_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($email_list[$i]['selected']);
-                               }
-                       }
-
                        return  $email_list;
                }
 

Modified: branches/Version-1_0-branch/property/inc/class.boworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boworkorder.inc.php  
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/property/inc/class.boworkorder.inc.php  
2011-09-15 06:35:42 UTC (rev 7592)
@@ -601,7 +601,7 @@
                                case 'P': $type = lang('Priority changed'); 
break;
                                case 'M':
                                        $type = lang('Sent by email to');
-                                       $_order_sent_adress = explode(' 
',$value['new_value']);
+                                       $_order_sent_adress = 
explode('::',$value['new_value']);
                                        $this->order_sent_adress = 
$_order_sent_adress[0]; // in case we want to resend the order as an reminder
                                        unset($_order_sent_adress);
                                        break;

Modified: branches/Version-1_0-branch/property/inc/class.soentity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soentity.inc.php     
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/property/inc/class.soentity.inc.php     
2011-09-15 06:35:42 UTC (rev 7592)
@@ -154,7 +154,7 @@
                                $cols_return_extra      = array();
                                $cols_return            = array();
                                $uicols                         = array();
-                               $cols                           = $entity_table 
. '.*';
+                               $cols                           = 
"{$entity_table}.*";
 
                                $cols_return[]                          = 
'location_code';
                                $uicols['input_type'][]         = 'hidden';
@@ -208,7 +208,7 @@
                                        $uicols['classname'][]          = '';
                                }
 
-                               $cols .= ", {$entity_table}.user_id";
+               //              $cols .= ", {$entity_table}.user_id";
                                $cols_return[]                          = 
'user_id';
 
                                $cols_return_extra[]= array
@@ -223,7 +223,7 @@
 
                                $sql = 
$this->bocommon->generate_sql(array('entity_table'=>$entity_table,'cols_return'=>$cols_return,'cols'=>$cols,
                                        
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query,'lookup'=>$lookup,'location_level'=>$category['location_level']));
-                               $sql =  str_replace('SELECT', 'SELECT 
DISTINCT',$sql);
+                               //$sql =        str_replace('SELECT', 'SELECT 
DISTINCT',$sql);
 
                                
$this->bocommon->fm_cache("sql_{$this->type}_{$entity_id}_{$cat_id}_{$lookup}", 
$sql);
                                
$this->bocommon->fm_cache("uicols_{$this->type}_{$entity_id}_{$cat_id}_{$lookup}",
 $this->bocommon->uicols);
@@ -546,9 +546,35 @@
                        $sql .= " $filtermethod $querymethod";
 
 //_debug_array($sql);
-                       $this->db->query("SELECT DISTINCT {$entity_table}.id " 
. substr($sql,strripos($sql,'from')),__LINE__,__FILE__);
-                       $this->total_records = $this->db->num_rows();
 
+                       $cache_info = 
phpgwapi_cache::session_get('property',"{$entity_table}_listing_metadata");
+
+                       if (!isset($cache_info['sql_hash']) || 
$cache_info['sql_hash'] != md5($sql))
+                       {
+                               $cache_info = array();
+                       }
+                       
+                       if(!$cache_info)
+                       {
+                               $sql_cnt = "SELECT DISTINCT {$entity_table}.id 
" . substr($sql,strripos($sql,'FROM'));
+                               $sql2 = "SELECT count(*) as cnt FROM 
({$sql_cnt}) as t";
+
+                               $this->db->query($sql2,__LINE__,__FILE__);
+                               $this->db->next_record();
+                               unset($sql2);
+                               unset($sql_cnt);
+
+                               $cache_info = array
+                               (
+                                       'total_records'         => 
$this->db->f('cnt'),
+                                       'sql_hash'                      => 
md5($sql)
+                               );
+                               
phpgwapi_cache::session_set('property',"{$entity_table}_listing_metadata",$cache_info);
+                       }
+
+                       $this->total_records    = $cache_info['total_records'];
+
+
                        if($dry_run)
                        {
                                return array();

Modified: branches/Version-1_0-branch/property/inc/class.solocation.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.solocation.inc.php   
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/property/inc/class.solocation.inc.php   
2011-09-15 06:35:42 UTC (rev 7592)
@@ -861,10 +861,32 @@
                        $sql .= "$filtermethod $querymethod";
 
                        $values = array();
-                       $this->db->query('SELECT count(*) AS cnt ' . 
substr($sql,strripos($sql,' from')),__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $this->total_records = $this->db->f('cnt');
+//                     $this->db->query('SELECT count(*) AS cnt ' . 
substr($sql,strripos($sql,' from')),__LINE__,__FILE__);
+//                     $this->db->next_record();
+//                     $this->total_records = $this->db->f('cnt');
 
+                       $cache_info = 
phpgwapi_cache::session_get('property',"location{$type_id}_listing_metadata");
+
+                       if (!isset($cache_info['sql_hash']) || 
$cache_info['sql_hash'] != md5($sql))
+                       {
+                               $cache_info = array();
+                       }
+                       
+                       if(!$cache_info)
+                       {
+                               $this->db->query('SELECT count(*) AS cnt ' . 
substr($sql,strripos($sql,' from')),__LINE__,__FILE__);
+                               $this->db->next_record();
+
+                               $cache_info = array
+                               (
+                                       'total_records'         => 
$this->db->f('cnt'),
+                                       'sql_hash'                      => 
md5($sql)
+                               );
+                               
phpgwapi_cache::session_set('property',"location{$type_id}_listing_metadata",$cache_info);
+                       }
+
+                       $this->total_records    = $cache_info['total_records'];
+
                        //address@hidden 23/07/08 avoid retrieve data in first 
time, only render definition for headers (var myColumnDefs)
                        if($dry_run)
                        {

Modified: branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2011-09-15 06:35:42 UTC (rev 7592)
@@ -239,7 +239,7 @@
 
                        $cols.= ",fm_request_status.descr as status";
                        $cols_return[]                          = 'status';
-                       $cols_group[]                           = 'status';
+                       $cols_group[]                           = 
'fm_request_status.descr';
                        $uicols['input_type'][]         = 'text';
                        $uicols['name'][]                       = 'status';
                        $uicols['descr'][]                      = 
lang('status');

Modified: branches/Version-1_0-branch/property/inc/class.sotts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sotts.inc.php        
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/property/inc/class.sotts.inc.php        
2011-09-15 06:35:42 UTC (rev 7592)
@@ -457,14 +457,34 @@
 
 //_debug_array($sql);
 
-                       $sql2 = "SELECT count(*) as cnt, sum(budget) as 
sum_budget, sum(actual_cost) as sum_actual_cost FROM ({$sql_cnt}) as t";
-                       $this->db->query($sql2,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $this->total_records    = $this->db->f('cnt');
-                       $this->sum_budget               = 
$this->db->f('sum_budget');
-                       $this->sum_actual_cost  = 
$this->db->f('sum_actual_cost');
-                       unset($sql2);
+                       $cache_info = 
phpgwapi_cache::session_get('property','tts_listing_metadata');
 
+                       if (!isset($cache_info['sql_hash']) || 
$cache_info['sql_hash'] != md5($sql_cnt))
+                       {
+                               $cache_info = array();
+                       }
+                       
+                       if(!$cache_info)
+                       {
+                               $sql2 = "SELECT count(*) as cnt, sum(budget) as 
sum_budget, sum(actual_cost) as sum_actual_cost FROM ({$sql_cnt}) as t";
+                               $this->db->query($sql2,__LINE__,__FILE__);
+                               $this->db->next_record();
+                               unset($sql2);
+
+                               $cache_info = array
+                               (
+                                       'total_records'         => 
$this->db->f('cnt'),
+                                       'sum_budget'            => 
$this->db->f('sum_budget'),
+                                       'sum_actual_cost'       => 
$this->db->f('sum_actual_cost'),
+                                       'sql_hash'                      => 
md5($sql_cnt)
+                               );
+                               
phpgwapi_cache::session_set('property','tts_listing_metadata',$cache_info);
+                       }
+
+                       $this->total_records    = $cache_info['total_records'];
+                       $this->sum_budget               = 
$cache_info['sum_budget'];
+                       $this->sum_actual_cost  = 
$cache_info['sum_actual_cost'];
+
                        $tickets = array();
                        if(!$dry_run)
                        {

Modified: branches/Version-1_0-branch/property/inc/class.sowo_hour.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sowo_hour.inc.php    
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/property/inc/class.sowo_hour.inc.php    
2011-09-15 06:35:42 UTC (rev 7592)
@@ -683,16 +683,19 @@
                {
                        $vendor_id=(int)$vendor_id;
                        $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', '.vendor');
-                       $this->db->query("select column_name from 
phpgw_cust_attribute WHERE location_id = {$location_id} AND 
datatype='email'",__LINE__,__FILE__);
+                       $this->db->query("SELECT column_name FROM 
phpgw_cust_attribute WHERE location_id = {$location_id} AND 
datatype='email'",__LINE__,__FILE__);
                        $email_list = array();
                        while ($this->db->next_record())
                        {
-                               $this->db2->query("select " . 
$this->db->f('column_name') . " from fm_vendor where 
id=$vendor_id",__LINE__,__FILE__);
+                               $this->db2->query("SELECT " . 
$this->db->f('column_name') . " FROM fm_vendor WHERE 
id=$vendor_id",__LINE__,__FILE__);
                                while ($this->db2->next_record())
                                {
                                        
if($this->db2->f($this->db->f('column_name')))
                                        {
-                                               $email_list[] = array('email' 
=> $this->db2->f($this->db->f('column_name')));
+                                               $email_list[] = array
+                                               (
+                                                       'email' => 
$this->db2->f($this->db->f('column_name'))
+                                               );
                                        }
                                }
                        }

Modified: branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php    
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php    
2011-09-15 06:35:42 UTC (rev 7592)
@@ -1190,7 +1190,7 @@
 
                        $show_cost              = phpgw::get_var('show_cost', 
'bool');
                        $show_details   = true;//phpgw::get_var('show_details', 
'bool');
-                       $to_email               = phpgw::get_var('to_email', 
'email');
+                       $to_email               = phpgw::get_var('to_email', 
'string');
                        $update_email   = phpgw::get_var('update_email', 
'bool');
                        $send_order             = phpgw::get_var('send_order', 
'bool');
                        $no_email               = phpgw::get_var('no_email', 
'bool');
@@ -1555,8 +1555,9 @@
 
                                if ($rcpt)
                                {
+                                       $_attachment_log = $attachment_log ? 
"::$attachment_log" : '';
                                        $historylog     = 
CreateObject('property.historylog','workorder');
-                                       
$historylog->add('M',$workorder_id,"{$to_email} {$attachment_log}");
+                                       
$historylog->add('M',$workorder_id,"{$to_email}{$_attachment_log}");
                                        
$receipt['message'][]=array('msg'=>lang('Workorder is sent by email!'));
                                        if($attachment_log)
                                        {
@@ -1608,14 +1609,12 @@
                        {
                                $to_email= 
$this->boworkorder->order_sent_adress;
                        }
-                       else
+
+                       $email_list     = 
$this->bo->get_email($to_email,$workorder['vendor_id']);
+                       if(count($email_list)==1)
                        {
-                               $email_list     = 
$this->bo->get_email($to_email,$workorder['vendor_id']);
-                               if(count($email_list)==1)
-                               {
-                                       $to_email= $email_list[0]['email'];
-                                       unset($email_list);
-                               }
+                               $to_email= $email_list[0]['email'];
+                               unset($email_list);
                        }
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);

Modified: branches/Version-1_0-branch/property/templates/base/wo_hour.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/wo_hour.xsl     
2011-09-15 05:48:34 UTC (rev 7591)
+++ branches/Version-1_0-branch/property/templates/base/wo_hour.xsl     
2011-09-15 06:35:42 UTC (rev 7592)
@@ -331,7 +331,7 @@
        <xsl:template match="email_list">
                <xsl:variable name="email"><xsl:value-of 
select="email"/></xsl:variable>
                <xsl:choose>
-                       <xsl:when test="selected">
+                       <xsl:when test="selected != 0">
                                <option value="{$email}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="email"/></option>
                        </xsl:when>
                        <xsl:otherwise>
@@ -407,7 +407,7 @@
                                                                                
                </td>
                                                                                
                <td  align="left">
                                                                                
                        <xsl:variable 
name="lang_to_email_address_statustext"><xsl:value-of 
select="lang_to_email_address_statustext"/></xsl:variable>
-                                                                               
                        <select name="to_email" class="forms" 
onMouseover="window.status='{$lang_to_email_address_statustext}'; return true;" 
onMouseout="window.status='';return true;">
+                                                                               
                        <select name="to_email" class="forms" 
title="{$lang_to_email_address_statustext}">
                                                                                
                                <option value=""><xsl:value-of 
select="lang_select_email"/></option>
                                                                                
                                <xsl:apply-templates select="email_list"/>
                                                                                
                        </select>
@@ -429,28 +429,30 @@
                                                                                
        </tr>
                                                                                
        <tr>
                                                                                
                <td class="th_text"  align="left">
-                                                                               
                        <xsl:value-of select="php:function('lang', 'request an 
email receipt')" />
+                                                                               
                        <xsl:value-of select="lang_update_email"/>
                                                                                
                </td>
                                                                                
                <td  align="left">
-                                                                               
                        <input type="checkbox" name="email_receipt" 
value="true">
+                                                                               
                        <input type="checkbox" name="update_email" value="true" 
 onMouseout="window.status='';return true;">
                                                                                
                                <xsl:attribute name="title">
-                                                                               
                                        <xsl:value-of 
select="php:function('lang', 'request a confirmation email when your email is 
opened by the recipient')" />
+                                                                               
                                        <xsl:value-of 
select="lang_update_email_statustext"/>
                                                                                
                                </xsl:attribute>
-                                                                               
                                <xsl:if test="requst_email_receipt != 0">
-                                                                               
                                        <xsl:attribute name="checked" 
value="checked" />
-                                                                               
                                </xsl:if>
                                                                                
                        </input>
                                                                                
                </td>
                                                                                
        </tr>
+                                                                               
</xsl:otherwise>
+                                                                       
</xsl:choose>
                                                                                
        <tr>
                                                                                
                <td class="th_text"  align="left">
-                                                                               
                        <xsl:value-of select="lang_update_email"/>
+                                                                               
                        <xsl:value-of select="php:function('lang', 'request an 
email receipt')" />
                                                                                
                </td>
                                                                                
                <td  align="left">
-                                                                               
                        <input type="checkbox" name="update_email" value="true" 
 onMouseout="window.status='';return true;">
+                                                                               
                        <input type="checkbox" name="email_receipt" 
value="true">
                                                                                
                                <xsl:attribute name="title">
-                                                                               
                                        <xsl:value-of 
select="lang_update_email_statustext"/>
+                                                                               
                                        <xsl:value-of 
select="php:function('lang', 'request a confirmation email when your email is 
opened by the recipient')" />
                                                                                
                                </xsl:attribute>
+                                                                               
                                <xsl:if test="requst_email_receipt != 0">
+                                                                               
                                        <xsl:attribute name="checked" 
value="checked" />
+                                                                               
                                </xsl:if>
                                                                                
                        </input>
                                                                                
                </td>
                                                                                
        </tr>
@@ -509,8 +511,7 @@
                                                                                
                        </input>
                                                                                
                </td>
                                                                                
        </tr>
-                                                                               
</xsl:otherwise>
-                                                                       
</xsl:choose>
+
                                                </table></td></tr>
                                        </xsl:when>
                                </xsl:choose>




reply via email to

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