fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15796] Syncromind: merge 15776:15795 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [15796] Syncromind: merge 15776:15795 from trunk
Date: Tue, 4 Oct 2016 11:08:28 +0000 (UTC)

Revision: 15796
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15796
Author:   sigurdne
Date:     2016-10-04 11:08:28 +0000 (Tue, 04 Oct 2016)
Log Message:
-----------
Syncromind: merge 15776:15795 from trunk

Modified Paths:
--------------
    branches/dev-syncromind-2/logistic/inc/class.soactivity.inc.php
    branches/dev-syncromind-2/logistic/inc/class.socommon.inc.php
    branches/dev-syncromind-2/logistic/inc/class.soproject.inc.php
    branches/dev-syncromind-2/logistic/inc/class.sorequirement.inc.php
    
branches/dev-syncromind-2/logistic/inc/class.sorequirement_resource_allocation.inc.php
    branches/dev-syncromind-2/logistic/inc/class.sorequirement_value.inc.php
    
branches/dev-syncromind-2/logistic/inc/class.soresource_type_requirement.inc.php
    branches/dev-syncromind-2/logistic/inc/class.uiactivity.inc.php
    branches/dev-syncromind-2/logistic/inc/class.uiproject.inc.php
    branches/dev-syncromind-2/logistic/inc/class.uirequirement.inc.php
    
branches/dev-syncromind-2/logistic/inc/class.uirequirement_resource_allocation.inc.php
    
branches/dev-syncromind-2/logistic/inc/class.uiresource_type_requirement.inc.php
    branches/dev-syncromind-2/logistic/inc/model/class.model.inc.php
    
branches/dev-syncromind-2/logistic/templates/base/activity/add_activity_item.xsl
    branches/dev-syncromind-2/logistic/templates/base/project/project_item.xsl
    branches/dev-syncromind-2/phpgwapi/inc/class.db.inc.php
    branches/dev-syncromind-2/property/inc/class.soadmin_entity.inc.php
    branches/dev-syncromind-2/property/inc/class.soentity.inc.php
    branches/dev-syncromind-2/property/inc/class.uitts.inc.php
    
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
    
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
    branches/dev-syncromind-2/property/inc/soap_client/bra5/soap.php
    branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php
    branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
    branches/dev-syncromind-2/rental/inc/model/class.composite.inc.php
    branches/dev-syncromind-2/rental/setup/setup.inc.php
    branches/dev-syncromind-2/rental/setup/tables_current.inc.php
    branches/dev-syncromind-2/rental/setup/tables_update.inc.php
    branches/dev-syncromind-2/rental/templates/base/composite.xsl

Property Changed:
----------------
    branches/dev-syncromind-2/


Property changes on: branches/dev-syncromind-2
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14934-14935,15165-15215,15218-15220,15222-15304,15306-15337,15339,15341-15398,15400-15421,15423-15474,15476-15607,15609,15611,15613-15652,15654-15732,15734,15736-15746,15750-15770,15772-15775
   + /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14934-14935,15165-15215,15218-15220,15222-15304,15306-15337,15339,15341-15398,15400-15421,15423-15474,15476-15607,15609,15611,15613-15652,15654-15732,15734,15736-15746,15750-15770,15772-15775,15777-15795

Modified: branches/dev-syncromind-2/logistic/inc/class.soactivity.inc.php
===================================================================
--- branches/dev-syncromind-2/logistic/inc/class.soactivity.inc.php     
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/logistic/inc/class.soactivity.inc.php     
2016-10-04 11:08:28 UTC (rev 15796)
@@ -143,7 +143,7 @@
                        return $ret;
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
                        $clauses = array('1=1');
 
@@ -207,7 +207,7 @@
                 * @param $start_index int with index of first object.
                 * @param $num_of_objects int with max number of objects to 
return.
                 * @param $sort_field string representing the object field to 
sort on.
-                * @param $ascending boolean true for ascending sort on sort 
field, false
+                * @param $ascending bool true for ascending sort on sort 
field, false
                 * for descending.
                 * @param $search_for string with free text search query.
                 * @param $search_type string with the query type.
@@ -236,7 +236,7 @@
 
                public function get_single( int $id )
                {
-                       $objects = parent::get(null, null, null, null, null, 
null, array($this->get_id_field_name() => $id));
+                       $objects = parent::get(0, 0, '', false, '', '', 
array($this->get_id_field_name() => $id));
                        if (count($objects) > 0)
                        {
                                $keys = array_keys($objects);

Modified: branches/dev-syncromind-2/logistic/inc/class.socommon.inc.php
===================================================================
--- branches/dev-syncromind-2/logistic/inc/class.socommon.inc.php       
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/logistic/inc/class.socommon.inc.php       
2016-10-04 11:08:28 UTC (rev 15796)
@@ -92,11 +92,11 @@
                {
                        if ($type == 'bool')
                        {
-                               return (boolean)$value;
+                               return (bool)$value;
                        }
-                       else if ($type == 'boolean')
+                       else if ($type == 'bool')
                        {
-                               return (boolean)$value;
+                               return (bool)$value;
                        }
                        else if ($type == 'int')
                        {
@@ -149,7 +149,7 @@
                 */
                public function get_single( int $id )
                {
-                       $objects = $this->get(null, null, null, null, null, 
null, array($this->get_id_field_name() => $id));
+                       $objects = $this->get(0, 0, '', false, '', '', 
array($this->get_id_field_name() => $id));
                        if (count($objects) > 0)
                        {
                                $keys = array_keys($objects);
@@ -172,7 +172,7 @@
                 * @param $start_index int with index of first object.
                 * @param $num_of_objects int with max number of objects to 
return.
                 * @param $sort_field string representing the object field to 
sort on.
-                * @param $ascending boolean true for ascending sort on sort 
field, false
+                * @param $ascending bool true for ascending sort on sort 
field, false
                 * for descending.
                 * @param $search_for string with free text search query.
                 * @param $search_type string with the query type.
@@ -180,7 +180,7 @@
                 * @return array of objects. May return an empty
                 * array, never null. The array keys are the respective index 
numbers.
                 */
-               public function get( int $start_index, int $num_of_objects, 
string $sort_field, boolean $ascending, string $search_for, string 
$search_type, array $filters )
+               public function get( int $start_index, int $num_of_objects, 
string $sort_field, bool $ascending, string $search_for, string $search_type, 
array $filters )
                {
                        $results = array();   // Array to store result objects
                        $map = array(); // Array to hold number of records per 
target object
@@ -309,7 +309,7 @@
                 */
                public function get_count( string $search_for, string 
$search_type, array $filters )
                {
-                       return $this->get_query_count($this->get_query(null, 
null, $search_for, $search_type, $filters, true));
+                       return $this->get_query_count($this->get_query('', 
false, $search_for, $search_type, $filters, true));
                }
 
                /**
@@ -326,16 +326,16 @@
                 * @param $start_index int with index of first object.
                 * @param $num_of_objects int with max number of objects to 
return.
                 * @param $sort_field string representing the object field to 
sort on.
-                * @param $ascending boolean true for ascending sort on sort 
field, false
+                * @param $ascending bool true for ascending sort on sort 
field, false
                 * for descending.
                 * @param $search_for string with free text search query.
                 * @param $search_type string with the query type.
                 * @param $filters array with key => value of filters.
-                * @param $return_count boolean telling to return only the 
count of the
+                * @param $return_count bool telling to return only the count 
of the
                 * matching objects, or the objects themself.
                 * @return string with SQL.
                 */
-               protected abstract function get_query( string $sort_field, 
boolean $ascending, string $search_for, string $search_type, array $filters, 
boolean $return_count );
+               protected abstract function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count );
 
                protected abstract function populate( int $object_id, &$object 
);
 

Modified: branches/dev-syncromind-2/logistic/inc/class.soproject.inc.php
===================================================================
--- branches/dev-syncromind-2/logistic/inc/class.soproject.inc.php      
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/logistic/inc/class.soproject.inc.php      
2016-10-04 11:08:28 UTC (rev 15796)
@@ -139,7 +139,7 @@
                        return $ret;
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
                        $clauses = array('1=1');
                        $project_type = false;
@@ -217,8 +217,8 @@
                        {
                                $project = new 
logistic_project((int)$project_id);
 
-                               
$project->set_name($this->unmarshal($this->db->f('name'), 'string'));
-                               
$project->set_description($this->unmarshal($this->db->f('description'), 
'string'));
+                               
$project->set_name($this->unmarshal($this->db->f('name',true), 'string'));
+                               
$project->set_description($this->unmarshal($this->db->f('description',true), 
'string'));
                                
$project->set_project_type_id($this->unmarshal($this->db->f('project_type_id'), 
'int'));
                                if ($project->get_project_type_id() && 
$project->get_project_type_id() > 0)
                                {
@@ -231,12 +231,71 @@
                        return $project;
                }
 
+               public function copy_project_activities( $from, $to, 
$start_date )
+               {
+                       //throw new Exception('Implement me');
+
+                       $start_date = $start_date ? $start_date : time();
+                       $from = (int) $from;
+                       $to = (int) $to;
+                       
+                       $this->db->transaction_begin();
+                       $this->db->query("SELECT start_date FROM lg_project 
WHERE id = " . (int)$from, __LINE__, __FILE__);
+                       $this->db->next_record();
+                       $orig_start_date = $this->db->f('start_date');
+
+                       $this->db->query("SELECT start_date FROM lg_project 
WHERE id = " . (int)$to, __LINE__, __FILE__);
+                       $this->db->next_record();
+                       $new_start_date = $this->db->f('start_date');
+
+                       $date_diff = $new_start_date - $orig_start_date;
+
+                       $this->db->query("SELECT * FROM lg_activity WHERE 
project_id = {$from} ORDER BY id", __LINE__, __FILE__);
+
+                       $id_map = array();
+                       $values = array();
+                       while ($this->db->next_record())
+                       {
+                               $values[] = $this->db->Record;
+                       }
+
+                       foreach ($values as &$entry)
+                       {
+                               $orig_id = $entry['id'];
+                               unset($entry['id']);
+                               $entry['project_id'] = $to;
+                               $entry['start_date'] += $date_diff;
+                               $entry['end_date'] += $date_diff;
+
+                               $this->db->query("INSERT INTO lg_activity (" . 
implode(',', array_keys($entry)) . ') VALUES ('
+                                       . 
$this->db->validate_insert(array_values($entry)) . ')', __LINE__, __FILE__);
+
+                               $new_id = 
$this->db->get_last_insert_id('lg_activity', 'id');
+
+                               $id_map[$orig_id] = $new_id;
+                       }
+
+                       foreach ($id_map as $orig_id => $new_id)
+                       {
+                               $this->db->query("SELECT parent_activity_id 
FROM lg_activity WHERE parent_activity_id IS NOT NULL AND id = " . 
(int)$new_id, __LINE__, __FILE__);
+                               $this->db->next_record();
+                               $parent_activity_id = 
$this->db->f('parent_activity_id');
+                               if($parent_activity_id)
+                               {
+                                       $new_parent_id = 
(int)$id_map[$parent_activity_id];
+                                       $this->db->query("UPDATE lg_activity 
SET parent_activity_id = {$new_parent_id} WHERE id = " . (int)$new_id, 
__LINE__, __FILE__);
+                               }
+                       }
+
+                       $this->db->transaction_commit();
+
+               }
                public function get_projects()
                {
                        $project_array = array();
                        $project_array[] = array(
                                'id' => '',
-                               'name' => lang('all_types'),
+                               'name' => lang('select'),
                                'selected' => 1
                        );
                        $sql = "SELECT id, name FROM lg_project";

Modified: branches/dev-syncromind-2/logistic/inc/class.sorequirement.inc.php
===================================================================
--- branches/dev-syncromind-2/logistic/inc/class.sorequirement.inc.php  
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/logistic/inc/class.sorequirement.inc.php  
2016-10-04 11:08:28 UTC (rev 15796)
@@ -130,7 +130,7 @@
                        return $ret;
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
                        $clauses = array('1=1');
 

Modified: 
branches/dev-syncromind-2/logistic/inc/class.sorequirement_resource_allocation.inc.php
===================================================================
--- 
branches/dev-syncromind-2/logistic/inc/class.sorequirement_resource_allocation.inc.php
      2016-10-04 11:05:30 UTC (rev 15795)
+++ 
branches/dev-syncromind-2/logistic/inc/class.sorequirement_resource_allocation.inc.php
      2016-10-04 11:08:28 UTC (rev 15796)
@@ -181,7 +181,7 @@
                        return $ret;
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
                        $clauses = array('1=1');
 
@@ -222,7 +222,8 @@
                                $cols .= "lg_calendar.item_inventory_amount as 
count,";
                                $cols .= "lg_calendar.item_inventory_id as 
inventory_id,";
                                $cols .= "phpgw_locations.descr AS 
resource_type_descr, ";
-                               $cols .= "fm_bim_item.location_code AS 
location_code, (xpath('//address/node()', 
fm_bim_item.xml_representation))[1]::text AS fm_bim_item_address, 
(xpath('//navn[1]/text()', fm_bim_item.xml_representation))[1]::text AS 
fm_bim_item_name ";
+//                             $cols .= "fm_bim_item.location_code AS 
location_code, (xpath('//address/node()', 
fm_bim_item.xml_representation))[1]::text AS fm_bim_item_address, 
(xpath('//navn[1]/text()', fm_bim_item.xml_representation))[1]::text AS 
fm_bim_item_name ";
+                               $cols .= "fm_bim_item.location_code AS 
location_code, fm_bim_item.json_representation->>'address' AS 
fm_bim_item_address, fm_bim_item.json_representation->>'navn' AS 
fm_bim_item_name ";
                        }
 
                        $dir = $ascending ? 'ASC' : 'DESC';

Modified: 
branches/dev-syncromind-2/logistic/inc/class.sorequirement_value.inc.php
===================================================================
--- branches/dev-syncromind-2/logistic/inc/class.sorequirement_value.inc.php    
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/logistic/inc/class.sorequirement_value.inc.php    
2016-10-04 11:08:28 UTC (rev 15796)
@@ -111,7 +111,7 @@
                        return $ret;
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
                        $clauses = array('1=1');
 

Modified: 
branches/dev-syncromind-2/logistic/inc/class.soresource_type_requirement.inc.php
===================================================================
--- 
branches/dev-syncromind-2/logistic/inc/class.soresource_type_requirement.inc.php
    2016-10-04 11:05:30 UTC (rev 15795)
+++ 
branches/dev-syncromind-2/logistic/inc/class.soresource_type_requirement.inc.php
    2016-10-04 11:08:28 UTC (rev 15796)
@@ -83,7 +83,7 @@
                        return $ret;
                }
 
-               protected function get_query( string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count )
+               protected function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count )
                {
                        $clauses = array('1=1');
 

Modified: branches/dev-syncromind-2/logistic/inc/class.uiactivity.inc.php
===================================================================
--- branches/dev-syncromind-2/logistic/inc/class.uiactivity.inc.php     
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/logistic/inc/class.uiactivity.inc.php     
2016-10-04 11:08:28 UTC (rev 15796)
@@ -262,8 +262,8 @@
                        $params = array(
                                'start' => phpgw::get_var('start', 'int', 
'REQUEST', 0),
                                'results' => phpgw::get_var('length', 'int', 
'REQUEST', $user_rows_per_page),
-                               'query' => $search['value'],
-                               'order' => 
$columns[$order[0]['column']]['data'],
+                               'query' => !empty($search['value']) ? 
$search['value'] : '',
+                               'order' => 
!empty($columns[$order[0]['column']]['data']) ? 
$columns[$order[0]['column']]['data'] : '',
                                'sort' => $order[0]['dir'],
                                'allrows' => phpgw::get_var('length', 'int') == 
-1,
                        );
@@ -274,7 +274,7 @@
                        $sort_ascending = $params['sort'] == 'desc' ? false : 
true;
                        // Form variables
                        $search_for = $params['query'];
-                       $search_type = phpgw::get_var('search_option');
+                       $search_type = phpgw::get_var('search_option', 
'string', 'REQUEST', '');
 
                        // Create an empty result set
                        $result_objects = array();
@@ -298,7 +298,7 @@
                                        $activity_id = 
phpgw::get_var('activity_id');
                                        $filters = array('id' => $activity_id);
                                        $result_objects = 
$this->so->get($start_index, $num_of_objects, $sort_field, $sort_ascending, 
$search_for, $search_type, $filters, $params['allrows']);
-                                       $object_count = $this->so->get_count();
+                                       $object_count = 
$this->so->get_count('', '', array());
                                        array_shift($result_objects);
                                        if ($result_objects)
                                        {
@@ -327,7 +327,7 @@
                                if (isset($activity))
                                {
                                        $filters = array('activity' => 
$activity->get_id());
-                                       $requirements_for_activity = 
$this->so_requirement->get(0, null, null, null, null, null, $filters);
+                                       $requirements_for_activity = 
$this->so_requirement->get(0, 0, '', false, '', '', $filters);
 
                                        if (count($requirements_for_activity) > 
0)
                                        {
@@ -337,7 +337,7 @@
                                                foreach 
($requirements_for_activity as $requirement)
                                                {
                                                        $filters = 
array('requirement_id' => $requirement->get_id());
-                                                       $num_allocated = 
$this->so_resource_allocation->get_count(null, null, $filters);
+                                                       $num_allocated = 
$this->so_resource_allocation->get_count('', '', $filters);
 
                                                        $num_required = 
$requirement->get_no_of_items();
 
@@ -435,7 +435,7 @@
 
                        $accounts = 
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_READ, 'run', 'logistic');
 
-                       $activities = $this->so->get(0, 0, 'name', true, null, 
null, null, true);
+                       $activities = $this->so->get(0, 0, 'name', true, '', 
'', array('project' => $project_id), true);
 
                        if ($activity_id)
                        {
@@ -475,12 +475,12 @@
 //                     if(     $activity_id )
                        if ($project_id)
                        {
-                               $parent_activity = 
$this->so->get_single($activity->get_parent_id());
+                               $parent_activity = 
$this->so->get_single((int)$activity->get_parent_id());
                                $data['parent_activity'] = $parent_activity;
                        }
                        else
                        {
-                               $projects = $this->so_project->get();
+                               $projects = 
$this->so_project->get(0,0,'',false,'','',array());
                                $data['projects'] = $projects;
                        }
 

Modified: branches/dev-syncromind-2/logistic/inc/class.uiproject.inc.php
===================================================================
--- branches/dev-syncromind-2/logistic/inc/class.uiproject.inc.php      
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/logistic/inc/class.uiproject.inc.php      
2016-10-04 11:08:28 UTC (rev 15796)
@@ -86,8 +86,8 @@
                        $params = array(
                                'start' => phpgw::get_var('start', 'int', 
'REQUEST', 0),
                                'results' => phpgw::get_var('length', 'int', 
'REQUEST', $user_rows_per_page),
-                               'query' => $search['value'],
-                               'order' => 
$columns[$order[0]['column']]['data'],
+                               'query' => !empty($search['value']) ? 
$search['value'] : '',
+                               'order' => 
!empty($columns[$order[0]['column']]['data']) ? 
$columns[$order[0]['column']]['data'] : '',
                                'sort' => $order[0]['dir'],
                                'allrows' => phpgw::get_var('length', 'int') == 
-1,
                        );
@@ -98,7 +98,7 @@
                        $sort_ascending = $params['sort'] == 'desc' ? false : 
true;
                        // Form variables
                        $search_for = $params['query'];
-                       $search_type = phpgw::get_var('search_option');
+                       $search_type = phpgw::get_var('search_option', 
'string', 'REQUEST', '');
                        // Create an empty result set
                        $result_objects = array();
                        $result_count = 0;
@@ -116,6 +116,7 @@
 
                        //Retrieve the type of query and perform type specific 
logic
                        $query_type = phpgw::get_var('type');
+                       $filters = array();
                        //var_dump($query_type);
                        switch ($query_type)
                        {
@@ -409,7 +410,7 @@
                        {
                                if ($project_type_id && 
is_numeric($project_type_id))
                                {
-                                       $objects = $this->so->get(null, null, 
null, null, null, 'project_type', array(
+                                       $objects = 
$this->so->get(0,0,'',false,'', 'project_type', array(
                                                'id' => $project_type_id));
                                        if (count($objects) > 0)
                                        {
@@ -432,7 +433,7 @@
                        $project_type_id = phpgw::get_var('id');
                        if ($project_type_id && is_numeric($project_type_id))
                        {
-                               $objects = $this->so->get(null, null, null, 
null, null, 'project_type', array(
+                               $objects = $this->so->get(0,0,'',false,'', 
'project_type', array(
                                        'id' => $project_type_id));
                                if (count($objects) > 0)
                                {
@@ -486,7 +487,7 @@
 
                        if ($project_type_id && is_numeric($project_type_id))
                        {
-                               $objects = $this->so->get(null, null, null, 
null, null, 'project_type', array(
+                               $objects = $this->so->get(0,0,'',false,'', 
'project_type', array(
                                        'id' => $project_type_id));
                                if (count($objects) > 0)
                                {
@@ -513,9 +514,11 @@
                public function edit( $project = null )
                {
                        $project_id = phpgw::get_var('id');
+                       $activities = array();
                        if ($project_id && is_numeric($project_id))
                        {
                                $project = $this->so->get_single($project_id);
+                               $activities = 
createObject('logistic.soactivity')->get(0, 1, 'name', true, '', '', 
array('project' => $project_id), true);
                        }
                        else
                        {
@@ -523,6 +526,10 @@
                                {
                                        $project = new logistic_project();
                                }
+                               if($project->get_id())
+                               {
+                                       $activities = 
createObject('logistic.soactivity')->get(0, 1, 'name', true, '', '', 
array('project' => $project->get_id()), true);
+                               }
                        }
 
                        $project_types = $this->so->get_project_types();
@@ -534,10 +541,22 @@
                                }
                        }
 
+                       $project_list = $this->so->get_projects();
+
+                       foreach ($project_list as $key => $entry)
+                       {
+                               if($project_id && $entry['id'] ==  $project_id)
+                               {
+                                       unset($project_list[$key]);
+                               }
+                       }
+
                        $data = array
                                (
                                'project' => $project,
                                'options' => $project_types,
+                               'project_list'  => array('options' => 
$project_list),
+                               'activities'    => false,//!!$activities,
                                'editable' => true
                        );
 
@@ -570,6 +589,11 @@
                        if ($project->validate())
                        {
                                $project_id = $this->so->store($project);
+                               $copy_from_project_id = 
phpgw::get_var('copy_project_activities', 'int');
+                               if($copy_from_project_id)
+                               {
+                                       
$this->so->copy_project_activities($copy_from_project_id,$project_id, 
$project->get_start_date());
+                               }
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.view',
                                        'id' => $project_id));
                        }

Modified: branches/dev-syncromind-2/logistic/inc/class.uirequirement.inc.php
===================================================================
--- branches/dev-syncromind-2/logistic/inc/class.uirequirement.inc.php  
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/logistic/inc/class.uirequirement.inc.php  
2016-10-04 11:08:28 UTC (rev 15796)
@@ -127,8 +127,8 @@
                        $params = array(
                                'start' => phpgw::get_var('start', 'int', 
'REQUEST', 0),
                                'results' => phpgw::get_var('length', 'int', 
'REQUEST', $user_rows_per_page),
-                               'query' => $search['value'],
-                               'order' => 
$columns[$order[0]['column']]['data'],
+                               'query' => !empty($search['value']) ? 
$search['value'] : '',
+                               'order' => 
!empty($columns[$order[0]['column']]['data']) ? 
$columns[$order[0]['column']]['data'] : '',
                                'sort' => $order[0]['dir'],
                                'allrows' => phpgw::get_var('length', 'int') == 
-1,
                        );
@@ -142,7 +142,7 @@
 
                        $activity_id = phpgw::get_var('activity_id');
 
-                       $search_type = phpgw::get_var('search_option');
+                       $search_type = phpgw::get_var('search_option', 
'string', 'REQUEST', '');
                        // Create an empty result set
                        $result_objects = array();
                        $result_count = 0;
@@ -155,7 +155,7 @@
                        if (isset($exp_param))
                        {
                                $export = true;
-                               $num_of_objects = null;
+                               $num_of_objects = 0;
                        }
 
                        //Retrieve the type of query and perform type specific 
logic
@@ -166,7 +166,7 @@
                                default: // ... all composites, filters (active 
and vacant)
                                        phpgwapi_cache::session_set('logistic', 
'requirement_query', $search_for);
                                        $filters = array('activity' => 
$activity_id);
-                                       $result_objects = 
$this->so->get($start_index, $num_of_objects, $sort_field, $sort_ascending, 
$search_for, $search_type, $filters, $params['allrows']);
+                                       $result_objects = 
$this->so->get($start_index, (int)$num_of_objects, $sort_field, 
$sort_ascending, $search_for, $search_type, $filters, $params['allrows']);
                                        $object_count = 
$this->so->get_count($search_for, $search_type, $filters);
                                        break;
                        }
@@ -470,7 +470,7 @@
 
                        $filters = array('project_type_id' => 
$project->get_project_type_id());
                        $search_type = 'distinct_location_id';
-                       $distict_location_ids = 
$this->so_resource_type_requirement->get($start_index, $num_of_objects, 
$sort_field, $sort_ascending, $search_for, $search_type, $filters);
+                       $distict_location_ids = 
$this->so_resource_type_requirement->get((int)$start_index, 
(int)$num_of_objects, (string)$sort_field, (bool)$sort_ascending, 
(string)$search_for, (string)$search_type, $filters);
 
                        $distict_location_ids_array = array();
 

Modified: 
branches/dev-syncromind-2/logistic/inc/class.uirequirement_resource_allocation.inc.php
===================================================================
--- 
branches/dev-syncromind-2/logistic/inc/class.uirequirement_resource_allocation.inc.php
      2016-10-04 11:05:30 UTC (rev 15795)
+++ 
branches/dev-syncromind-2/logistic/inc/class.uirequirement_resource_allocation.inc.php
      2016-10-04 11:08:28 UTC (rev 15796)
@@ -183,8 +183,8 @@
                        $params = array(
                                'start' => phpgw::get_var('start', 'int', 
'REQUEST', 0),
                                'results' => phpgw::get_var('length', 'int', 
'REQUEST', $user_rows_per_page),
-                               'query' => $search['value'],
-                               'order' => 
$columns[$order[0]['column']]['data'],
+                               'query' => !empty($search['value']) ? 
$search['value'] : '',
+                               'order' => 
!empty($columns[$order[0]['column']]['data']) ? 
$columns[$order[0]['column']]['data'] : '',
                                'sort' => $order[0]['dir'],
                                'allrows' => phpgw::get_var('length', 'int') == 
-1,
                        );
@@ -196,7 +196,7 @@
                        // Form variables
                        $search_for = $params['query'];
 
-                       $search_type = phpgw::get_var('search_option');
+                       $search_type = phpgw::get_var('search_option', 
'string', 'REQUEST', '');
 
                        // Create an empty result set
                        $result_objects = array();
@@ -362,7 +362,7 @@
 
                        if ($requirement)
                        {
-                               $requirement_values = 
$this->so_requirement_value->get(null, null, null, null, null, null, array(
+                               $requirement_values = 
$this->so_requirement_value->get(0, 0, '', false, '', '', array(
                                        'requirement_id' => 
$requirement->get_id()));
 
                                $criterias_array = array();
@@ -534,7 +534,7 @@
                        //FIXME: Bruk 'allocation_id' i staden.
 //_debug_array($inventory_ids_orig);die();
                        $filters = array('requirement_id' => 
$requirement->get_id());
-                       $num_allocated = $this->so->get_count($search_for, 
$search_type, $filters);
+                       $num_allocated = 
$this->so->get_count((string)$search_for, (string)$search_type, $filters);
 
                        $num_required = $requirement->get_no_of_items();
 

Modified: 
branches/dev-syncromind-2/logistic/inc/class.uiresource_type_requirement.inc.php
===================================================================
--- 
branches/dev-syncromind-2/logistic/inc/class.uiresource_type_requirement.inc.php
    2016-10-04 11:05:30 UTC (rev 15795)
+++ 
branches/dev-syncromind-2/logistic/inc/class.uiresource_type_requirement.inc.php
    2016-10-04 11:08:28 UTC (rev 15796)
@@ -89,8 +89,8 @@
                        $params = array(
                                'start' => phpgw::get_var('start', 'int', 
'REQUEST', 0),
                                'results' => phpgw::get_var('length', 'int', 
'REQUEST', $user_rows_per_page),
-                               'query' => $search['value'],
-                               'order' => 
$columns[$order[0]['column']]['data'],
+                               'query' => !empty($search['value']) ? 
$search['value'] : '',
+                               'order' => 
!empty($columns[$order[0]['column']]['data']) ? 
$columns[$order[0]['column']]['data'] : '',
                                'sort' => $order[0]['dir'],
                                'allrows' => phpgw::get_var('length', 'int') == 
-1,
                        );
@@ -104,7 +104,7 @@
 
                        $activity_id = phpgw::get_var('activity_id');
 
-                       $search_type = phpgw::get_var('search_option');
+                       $search_type = phpgw::get_var('search_option', 
'string', 'REQUEST', '');
 
                        // Form variables
                        $search_type = phpgw::get_var('search_option');
@@ -270,7 +270,7 @@
                        $project_type_id = phpgw::get_var('project_type_id');
                        if ($location_id)
                        {
-                               $req_types = $this->so->get(null, null, null, 
null, null, null, array('location_id' => $location_id,
+                               $req_types = $this->so->get(0,0,'',false,'','', 
array('location_id' => $location_id,
                                        'project_type_id' => $project_type_id));
                                if (count($req_types) > 0)
                                {
@@ -293,7 +293,7 @@
                                $cust_attr_ids = phpgw::get_var('attributes');
                                $selected_attributes[] = array();
 
-                               $req_type_array = $this->so->get(null, null, 
null, null, null, null, array('location_id' => $location_id,
+                               $req_type_array = 
$this->so->get(0,0,'',false,'','', array('location_id' => $location_id,
                                        'project_type_id' => $project_type_id));
                                $req_types_for_delete = array();
                                if (count($req_type_array) > 0)
@@ -446,7 +446,7 @@
 
                        if ($location_id && is_numeric($location_id))
                        {
-                               $req_types = $this->so->get(null, null, null, 
null, null, null, array('location_id' => $location_id,
+                               $req_types = $this->so->get(0,0,'',false,'','', 
array('location_id' => $location_id,
                                        'project_type_id' => $project_type_id));
                                $loc_arr = 
$GLOBALS['phpgw']->locations->get_name($location_id);
                                $entity_arr = explode('.', 
$loc_arr['location']);
@@ -469,7 +469,7 @@
                                        }
                                }
 
-                               $objects = $this->so_project->get(null, null, 
null, null, null, 'project_type', array(
+                               $objects = 
$this->so_project->get(0,0,'',false,'', 'project_type', array(
                                        'id' => $project_type_id));
                                if (count($objects) > 0)
                                {

Modified: branches/dev-syncromind-2/logistic/inc/model/class.model.inc.php
===================================================================
--- branches/dev-syncromind-2/logistic/inc/model/class.model.inc.php    
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/logistic/inc/model/class.model.inc.php    
2016-10-04 11:08:28 UTC (rev 15796)
@@ -82,7 +82,7 @@
                 * in order to validate against the standard database rules.  
The subclasses can in addition
                 * add their own specific validation logic.
                 *
-                * @return boolean true if the object is valid, false otherwise
+                * @return bool true if the object is valid, false otherwise
                 */
                public function validates()
                {

Modified: 
branches/dev-syncromind-2/logistic/templates/base/activity/add_activity_item.xsl
===================================================================
--- 
branches/dev-syncromind-2/logistic/templates/base/activity/add_activity_item.xsl
    2016-10-04 11:05:30 UTC (rev 15795)
+++ 
branches/dev-syncromind-2/logistic/templates/base/activity/add_activity_item.xsl
    2016-10-04 11:08:28 UTC (rev 15796)
@@ -9,52 +9,52 @@
 
        <div>
 
-       <xsl:choose>
-               <xsl:when test="project/id != '' or project/id != 0">
-                       <h1>
-                               <xsl:value-of select="php:function('lang', 'Add 
activity to project')" />
+               <xsl:choose>
+                       <xsl:when test="project/id != '' or project/id != 0">
+                               <h1>
+                                       <xsl:value-of 
select="php:function('lang', 'Add activity to project')" />
                                        <span style="margin-left:5px;">
                                                <xsl:value-of 
select="project/name" />
                                        </span>
-                       </h1>
-               </xsl:when>
-               <xsl:when test="activity/id != '' and activity/id != 0">
-                       <h1>
-                               <xsl:value-of select="php:function('lang', 
'Edit activity')" />
-                       </h1>
-               </xsl:when>
-               <xsl:otherwise>
-                       <h1>
-                               <xsl:value-of select="php:function('lang', 'Add 
activity')" />
-                       </h1>
-               </xsl:otherwise>
-       </xsl:choose>
+                               </h1>
+                       </xsl:when>
+                       <xsl:when test="activity/id != '' and activity/id != 0">
+                               <h1>
+                                       <xsl:value-of 
select="php:function('lang', 'Edit activity')" />
+                               </h1>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <h1>
+                                       <xsl:value-of 
select="php:function('lang', 'Add activity')" />
+                               </h1>
+                       </xsl:otherwise>
+               </xsl:choose>
 
         
-       <xsl:choose>
-               <xsl:when test="breadcrumb != ''">
-                       <xsl:call-template name="breadcrumb" />
-               </xsl:when>
-       </xsl:choose>
+               <xsl:choose>
+                       <xsl:when test="breadcrumb != ''">
+                               <xsl:call-template name="breadcrumb" />
+                       </xsl:when>
+               </xsl:choose>
        
-       <div id="activity_details" class="content-wrp">
-               <div id="details">
-                       <xsl:variable name="action_url">
-                               <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', 
'menuaction:logistic.uiactivity.save')" />
-                       </xsl:variable>
+               <div id="activity_details" class="content-wrp">
+                       <div id="details">
+                               <xsl:variable name="action_url">
+                                       <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', 
'menuaction:logistic.uiactivity.save')" />
+                               </xsl:variable>
                                <xsl:variable name="parent_id">
                                        <xsl:value-of 
select="parent_activity/id"/>
                                </xsl:variable>
-                       <form id='activity_form' action="{$action_url}" 
method="post">
-                               <input type="hidden" name="id" value = 
"{activity/id}" />
-                               <input type="hidden" name="project_id" 
value="{activity/project_id}" />
-                               <input type="hidden" name="parent_id" 
value="{parent_activity/id}" />
+                               <form id='activity_form' action="{$action_url}" 
method="post">
+                                       <input type="hidden" name="id" value = 
"{activity/id}" />
+                                       <input type="hidden" name="project_id" 
value="{activity/project_id}" />
+                                       <input type="hidden" name="parent_id" 
value="{parent_activity/id}" />
                                
-                               <dl class="proplist-col">
+                                       <dl class="proplist-col">
 
-                                 <xsl:choose>
-                                               <xsl:when test="(editable) and 
(activities !='')">
-                                                       <dt>            
+                                               <xsl:choose>
+                                                       <xsl:when 
test="(editable) and (activities !='')">
+                                                               <dt>
                                                                        <div 
style="margin-bottom: 1em;">
                                                                                
<label style="display:block;">
                                                                                
        <xsl:value-of select="php:function('lang', 'Choose another main 
activity for this sub activity')" />
@@ -62,39 +62,39 @@
                                                                                
<select id="select_parent_activity" name="parent_activity_id">
                                                                                
        <option value="0">Velg annen hovedaktivitet</option>
                                                                                
        <xsl:for-each select="activities">
-                                                                       <option 
value="{id}">
-                                                                               
<xsl:if test="id = $parent_id">
-                                                                               
        <xsl:attribute name="selected">
-                                                                               
                <xsl:text>selected</xsl:text>
-                                                                               
                </xsl:attribute>
-                                                                               
</xsl:if>
-                                                                       
<xsl:value-of disable-output-escaping="yes" select="name"/>
-                                                                       
</option>
-                                                                               
  </xsl:for-each>
+                                                                               
                <option value="{id}">
+                                                                               
                        <xsl:if test="id = $parent_id">
+                                                                               
                                <xsl:attribute name="selected">
+                                                                               
                                        <xsl:text>selected</xsl:text>
+                                                                               
                                </xsl:attribute>
+                                                                               
                        </xsl:if>
+                                                                               
                        <xsl:value-of disable-output-escaping="yes" 
select="name"/>
+                                                                               
                </option>
+                                                                               
        </xsl:for-each>
                                                                                
</select>                                       
                                                                        </div>
                                                                </dt>
-                                                 </xsl:when>
-                                                <!-- <xsl:when 
test="(editable) and not(parent_activity) and not(project)">
-                                                       <dt>            
-                                                                       <div 
style="margin-bottom: 1em;">
-                                                                               
<label style="display:block;"><xsl:value-of select="php:function('lang', 
'Choose the project in which the activity is part of')" /></label>
-                                                                               
<select id="select_project" name="select_project">
-                                                                               
        <option><xsl:value-of select="php:function('lang', 'Choose project')" 
/></option>
-                                                                               
        <xsl:for-each select="projects">
-                                                                       <option 
value="{id}">
-                                                                               
<xsl:if test="project/id = project_id">
-                                                                               
        <xsl:attribute name="selected">
-                                                                               
                        selected
-                                                                               
                        </xsl:attribute>
-                                                                               
</xsl:if>
-                                                                       
<xsl:value-of disable-output-escaping="yes" select="name"/>
-                                                                       
</option>
-                                                                               
  </xsl:for-each>
-                                                                               
</select>                                       
-                                                                       </div>
-                                                               </dt>
-                                                 </xsl:when>-->
+                                                       </xsl:when>
+                                                       <!-- <xsl:when 
test="(editable) and not(parent_activity) and not(project)">
+                                                         <dt>
+                                                                         <div 
style="margin-bottom: 1em;">
+                                                                               
  <label style="display:block;"><xsl:value-of select="php:function('lang', 
'Choose the project in which the activity is part of')" /></label>
+                                                                               
  <select id="select_project" name="select_project">
+                                                                               
          <option><xsl:value-of select="php:function('lang', 'Choose project')" 
/></option>
+                                                                               
          <xsl:for-each select="projects">
+                                                                               
  <option value="{id}">
+                                                                               
          <xsl:if test="project/id = project_id">
+                                                                               
                  <xsl:attribute name="selected">
+                                                                               
                                  selected
+                                                                               
                          </xsl:attribute>
+                                                                               
          </xsl:if>
+                                                                               
  <xsl:value-of disable-output-escaping="yes" select="name"/>
+                                                                               
  </option>
+                                                                               
        </xsl:for-each>
+                                                                               
  </select>
+                                                                         </div>
+                                                                 </dt>
+                                                       </xsl:when>-->
                                                </xsl:choose>
                                                <xsl:choose>
                                                        <xsl:when 
test="projects != ''">
@@ -110,37 +110,37 @@
                                                                                
        <option value=''>
                                                                                
                <xsl:value-of select="php:function('lang', 'Choose another 
project')" />
                                                                                
        </option>
-                                                                               
                <xsl:for-each select="projects">
-                                                                               
                        <option value="{id}">
-                                                                               
                        <xsl:if test="project/id = project_id">
-                                                                               
                        <xsl:attribute name="selected">
-                                                                               
                                        selected
-                                                                               
                                        </xsl:attribute>
-                                                                               
                </xsl:if>
-                                                                               
                        <xsl:value-of disable-output-escaping="yes" 
select="name"/>
-                                                                               
            </option>
-                                                                               
                </xsl:for-each>
+                                                                               
        <xsl:for-each select="projects">
+                                                                               
                <option value="{id}">
+                                                                               
                        <xsl:if test="project/id = project_id">
+                                                                               
                                <xsl:attribute name="selected">
+                                                                               
                                        selected
+                                                                               
                                </xsl:attribute>
+                                                                               
                        </xsl:if>
+                                                                               
                        <xsl:value-of disable-output-escaping="yes" 
select="name"/>
+                                                                               
                </option>
+                                                                               
        </xsl:for-each>
                                                                                
</select>                                       
                                                                        </div>
                                                                </dt>
-                                                 </xsl:when>
-                                         </xsl:choose>
-                                       <dt>
+                                                       </xsl:when>
+                                               </xsl:choose>
+                                               <dt>
                                                        <label for="name">
                                                                <xsl:value-of 
select="php:function('lang','Activity name')" />
                                                        </label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:if 
test="activity/error_msg_array/name != ''">
+                                               </dt>
+                                               <dd>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="editable">
+                                                                       <xsl:if 
test="activity/error_msg_array/name != ''">
                                                                                
<xsl:variable name="error_msg">
                                                                                
        <xsl:value-of select="activity/error_msg_array/name" />
                                                                                
</xsl:variable>
                                                                                
<div class='input_error_msg'>
                                                                                
        <xsl:value-of select="php:function('lang', $error_msg)" />
                                                                                
</div>
-                                                       </xsl:if>
+                                                                       
</xsl:if>
                                                                        <div 
class="help_text">
                                                                                
<xsl:value-of select="php:function('lang','Give name to this activity')" />
                                                                        </div>
@@ -149,199 +149,199 @@
                                                                                
        <xsl:text>required</xsl:text>
                                                                                
</xsl:attribute>
                                                                        </input>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="activity/name" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       
<xsl:value-of select="activity/name" />
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </dd>
+                                               <dt>
                                                        <label 
for="description">
                                                                <xsl:value-of 
select="php:function('lang', 'Description')" />
                                                        </label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:if 
test="activity/error_msg_array/description != ''">
+                                               </dt>
+                                               <dd>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="editable">
+                                                                       <xsl:if 
test="activity/error_msg_array/description != ''">
                                                                                
<xsl:variable name="error_msg">
                                                                                
        <xsl:value-of select="activity/error_msg_array/description" />
                                                                                
</xsl:variable>
                                                                                
<div class='input_error_msg'>
                                                                                
        <xsl:value-of select="php:function('lang', $error_msg)" />
                                                                                
</div>
-                                                       </xsl:if>
+                                                                       
</xsl:if>
                                                                        <div 
class="help_text">
                                                                                
<xsl:value-of select="php:function('lang','Give description to activity')" />
                                                                        </div>
                                                                        
<textarea id="description" name="description" rows="5" cols="60">
-                                                                               
<xsl:value-of select="activity/description" disable-output-escaping="yes"/>
                                                                                
<xsl:attribute name="data-validation">
                                                                                
        <xsl:text>required</xsl:text>
                                                                                
</xsl:attribute>
+                                                                               
<xsl:value-of select="activity/description" disable-output-escaping="yes"/>
                                                                        
</textarea>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="activity/description" disable-output-escaping="yes"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       
<xsl:value-of select="activity/description" disable-output-escaping="yes"/>
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </dd>
+                                               <dt>
                                                        <label for="start_date">
                                                                <xsl:value-of 
select="php:function('lang','Start date')" />
                                                        </label>
-                                       </dt>
-                                       <dd>
-                                               <xsl:choose>
-                                                       <xsl:when 
test="editable">
-                                                               <xsl:if 
test="activity/error_msg_array/start_date != ''">
+                                               </dt>
+                                               <dd>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="editable">
+                                                                       <xsl:if 
test="activity/error_msg_array/start_date != ''">
                                                                                
<xsl:variable name="error_msg">
                                                                                
        <xsl:value-of select="activity/error_msg_array/start_date" />
                                                                                
</xsl:variable>
                                                                                
<div class='input_error_msg'>
                                                                                
        <xsl:value-of select="php:function('lang', $error_msg)" />
                                                                                
</div>
-                                                               </xsl:if>
+                                                                       
</xsl:if>
                                                                        <div 
class="help_text">
                                                                                
<xsl:value-of select="php:function('lang','Give start date to activity')" />
                                                                        </div>
-                                                               <input 
class="datetime" id="start_date" name="start_date" type="text">
-                                                       <xsl:if 
test="activity/start_date != ''">
+                                                                       <input 
class="datetime" id="start_date" name="start_date" type="text">
+                                                                               
<xsl:if test="activity/start_date != ''">
                                                                                
        <xsl:attribute name="value">
                                                                                
                <xsl:value-of select="php:function('date', $datetime_format, 
number(activity/start_date))"/>
                                                                                
        </xsl:attribute>
-                                                       </xsl:if>
+                                                                               
</xsl:if>
 
                                                                                
<xsl:attribute name="data-validation">
                                                                                
        <xsl:text>required</xsl:text>
                                                                                
</xsl:attribute>
-                                               </input>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
+                                                                       </input>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
                                                                        <span>
                                                                                
<xsl:value-of select="php:function('date', $datetime_format, 
number(activity/start_date))"/>
                                                                        </span>
-                                                       </xsl:otherwise>
-                                               </xsl:choose>
-                                       </dd>
-                                       <dt>
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </dd>
+                                               <dt>
                                                        <label for="end_date">
                                                                <xsl:value-of 
select="php:function('lang','End date')" />
                                                        </label>
-                                       </dt>
-                                       <dd>
-                                               <xsl:choose>
-                                                       <xsl:when 
test="editable">
-                                                               <xsl:if 
test="activity/error_msg_array/end_date != ''">
+                                               </dt>
+                                               <dd>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="editable">
+                                                                       <xsl:if 
test="activity/error_msg_array/end_date != ''">
                                                                                
<xsl:variable name="error_msg">
                                                                                
        <xsl:value-of select="activity/error_msg_array/end_date" />
                                                                                
</xsl:variable>
                                                                                
<div class='input_error_msg'>
                                                                                
        <xsl:value-of select="php:function('lang', $error_msg)" />
                                                                                
</div>
-                                                               </xsl:if>
+                                                                       
</xsl:if>
                                                                        <div 
class="help_text">
                                                                                
<xsl:value-of select="php:function('lang','Give end date to activity')" />
                                                                        </div>
-                                                               <input 
class="datetime" id="end_date" name="end_date" type="text">
-                                                       <xsl:if 
test="activity/end_date != ''">
+                                                                       <input 
class="datetime" id="end_date" name="end_date" type="text">
+                                                                               
<xsl:if test="activity/end_date != ''">
                                                                                
        <xsl:attribute name="value">
                                                                                
                <xsl:value-of select="php:function('date', $datetime_format, 
number(activity/end_date))"/>
                                                                                
        </xsl:attribute>
-                                                       </xsl:if>
-                                               </input>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
+                                                                               
</xsl:if>
+                                                                       </input>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
                                                                        <span>
                                                                                
<xsl:value-of select="php:function('date', $datetime_format, 
number(activity/end_date))"/>
                                                                        </span>
-                                                       </xsl:otherwise>
-                                               </xsl:choose>
-                                       </dd>
-                                       <dt>
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </dd>
+                                               <dt>
                                                        <label for="end_date">
                                                                <xsl:value-of 
select="php:function('lang', 'Responsible person')" />
                                                        </label>
-                                       </dt>
-                                       <dd>
-                                               <xsl:choose>
-                                                       <xsl:when 
test="editable">
-                                                               <xsl:if 
test="activity/error_msg_array/responsible_user_id != ''">
+                                               </dt>
+                                               <dd>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="editable">
+                                                                       <xsl:if 
test="activity/error_msg_array/responsible_user_id != ''">
                                                                                
<xsl:variable name="error_msg">
                                                                                
        <xsl:value-of select="activity/error_msg_array/responsible_user_id" />
                                                                                
</xsl:variable>
                                                                                
<div class='input_error_msg'>
                                                                                
        <xsl:value-of select="php:function('lang', $error_msg)" />
                                                                                
</div>
-                                                               </xsl:if>
+                                                                       
</xsl:if>
                                                                        <div 
class="help_text">
                                                                                
<xsl:value-of select="php:function('lang', 'Responsible person for activity')" 
/>
                                                                        </div>
-                                                               <select 
name="responsible_user_id">
+                                                                       <select 
name="responsible_user_id">
                                                                                
<xsl:attribute name="data-validation">
                                                                                
        <xsl:text>required</xsl:text>
                                                                                
</xsl:attribute>
-                                                                       <option 
value="">Velg ansvarlig bruker</option>
-                                               <xsl:for-each 
select="responsible_users">
-                                                       <xsl:variable 
name="full_name">
+                                                                               
<option value="">Velg ansvarlig bruker</option>
+                                                                               
<xsl:for-each select="responsible_users">
+                                                                               
        <xsl:variable name="full_name">
                                                                                
                <xsl:value-of disable-output-escaping="yes" 
select="account_firstname"/>
                                                                                
                <xsl:text> </xsl:text>
-                                                               <xsl:value-of 
disable-output-escaping="yes" select="account_lastname"/>
-                                                       </xsl:variable>
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="//activity/responsible_user_id = account_id">
-                                                                               
                <option selected="selected" value="{account_id}">
-                                                                               
<xsl:value-of disable-output-escaping="yes" select="$full_name"/>
-                                                                       
</option>
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       <option 
value="{account_id}">
-                                                                               
<xsl:value-of disable-output-escaping="yes" select="$full_name"/>
-                                                                       
</option>
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                               </xsl:for-each>
-                                             </select>
-                                             </xsl:when>
-                                                       <xsl:otherwise>
+                                                                               
                <xsl:value-of disable-output-escaping="yes" 
select="account_lastname"/>
+                                                                               
        </xsl:variable>
+                                                                               
        <xsl:choose>
+                                                                               
                <xsl:when test="//activity/responsible_user_id = account_id">
+                                                                               
                        <option selected="selected" value="{account_id}">
+                                                                               
                                <xsl:value-of disable-output-escaping="yes" 
select="$full_name"/>
+                                                                               
                        </option>
+                                                                               
                </xsl:when>
+                                                                               
                <xsl:otherwise>
+                                                                               
                        <option value="{account_id}">
+                                                                               
                                <xsl:value-of disable-output-escaping="yes" 
select="$full_name"/>
+                                                                               
                        </option>
+                                                                               
                </xsl:otherwise>
+                                                                               
        </xsl:choose>
+                                                                               
</xsl:for-each>
+                                                                       
</select>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
                                                                        <span>
                                                                                
<xsl:value-of select="activity/responsible_user_name"/>
                                                                        </span>
-                                                       </xsl:otherwise>
-                                               </xsl:choose>
-                                       </dd>
-                               </dl>
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </dd>
+                                       </dl>
                                
-                               <div class="form-buttons">
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
+                                       <div class="form-buttons">
+                                               <xsl:choose>
+                                                       <xsl:when 
test="editable">
                                                                <xsl:variable 
name="lang_save">
                                                                        
<xsl:value-of select="php:function('lang', 'save')" />
                                                                </xsl:variable>
                                                                <xsl:variable 
name="lang_cancel">
                                                                        
<xsl:value-of select="php:function('lang', 'cancel')" />
                                                                </xsl:variable>
-                                                       <input type="submit" 
name="save_activity" value="{$lang_save}" title = "{$lang_save}" />
-                                                       <input class="submit" 
type="button" name="cancel_activity" id ='cancel_activity' 
value="{$lang_cancel}" title = "{$lang_cancel}" 
onClick="document.cancel_form.submit();"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:variable 
name="params">
-                                                               
<xsl:text>menuaction:logistic.uiactivity.edit, id:</xsl:text>
-                                                               <xsl:value-of 
select="activity/id" />
-                                                       </xsl:variable>
-                                                       <xsl:variable 
name="edit_url">
-                                                               <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', $params )" />
-                                                       </xsl:variable>
+                                                               <input 
type="submit" name="save_activity" value="{$lang_save}" title = "{$lang_save}" 
/>
+                                                               <input 
class="submit" type="button" name="cancel_activity" id ='cancel_activity' 
value="{$lang_cancel}" title = "{$lang_cancel}" 
onClick="document.cancel_form.submit();"/>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <xsl:variable 
name="params">
+                                                                       
<xsl:text>menuaction:logistic.uiactivity.edit, id:</xsl:text>
+                                                                       
<xsl:value-of select="activity/id" />
+                                                               </xsl:variable>
+                                                               <xsl:variable 
name="edit_url">
+                                                                       
<xsl:value-of select="php:function('get_phpgw_link', '/index.php', $params )" />
+                                                               </xsl:variable>
                                                                <a class="btn" 
href="{$edit_url}">
                                                                        
<xsl:value-of select="php:function('lang', 'edit')" />
                                                                </a>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </div>
-                       </form>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                       </div>
+                               </form>
+                       </div>
                </div>
        </div>
-       </div>
 
        <xsl:variable name="cancel_url">
                <xsl:value-of select="php:function('get_phpgw_link', 
'/index.php', 'menuaction:logistic.uiactivity.index')" />
@@ -365,7 +365,7 @@
 
 <!-- =========== BREADCRUMB TEMPLATE  ============== -->
 <xsl:template name="breadcrumb">
-  <div id="breadcrumb">
+       <div id="breadcrumb">
                <span class="intro">Du er her:</span>
                <xsl:for-each select="breadcrumb">
                        <xsl:choose>
@@ -381,8 +381,8 @@
                                </xsl:otherwise>
                        </xsl:choose>
                        <xsl:if test="not( position() = last() )">
-                       <img src="logistic/images/arrow_right.png" />
-                       </xsl:if>
-      </xsl:for-each>
+                               <img src="logistic/images/arrow_right.png" />
+                       </xsl:if>
+               </xsl:for-each>
        </div>
 </xsl:template>

Modified: 
branches/dev-syncromind-2/logistic/templates/base/project/project_item.xsl
===================================================================
--- branches/dev-syncromind-2/logistic/templates/base/project/project_item.xsl  
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/logistic/templates/base/project/project_item.xsl  
2016-10-04 11:08:28 UTC (rev 15796)
@@ -2,159 +2,233 @@
 <!-- item  -->
 
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
-<xsl:variable name="date_format"><xsl:value-of 
select="php:function('get_phpgw_info', 
'user|preferences|common|dateformat')"/></xsl:variable>
-<div>
-       <xsl:choose>
-               <xsl:when test="project/id != '' or project/id != 0">
-                       <h1>
-                               <xsl:value-of select="php:function('lang', 
'Edit project')" />
-                       </h1>
-               </xsl:when>
-               <xsl:otherwise>
-                       <h1>
-                               <xsl:value-of select="php:function('lang', 'Add 
project')" />
-                       </h1>
-               </xsl:otherwise>
-       </xsl:choose>
+       <xsl:variable name="date_format">
+               <xsl:value-of select="php:function('get_phpgw_info', 
'user|preferences|common|dateformat')"/>
+       </xsl:variable>
+       <div>
+               <xsl:choose>
+                       <xsl:when test="project/id != '' or project/id != 0">
+                               <h1>
+                                       <xsl:value-of 
select="php:function('lang', 'Edit project')" />
+                               </h1>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <h1>
+                                       <xsl:value-of 
select="php:function('lang', 'Add project')" />
+                               </h1>
+                       </xsl:otherwise>
+               </xsl:choose>
        
-       <div id="project_details" class="content-wrp">
-               <div id="details">
-                       <xsl:variable name="action_url">
-                               <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', 
'menuaction:logistic.uiproject.save')" />
-                       </xsl:variable>
-                       <form action="{$action_url}" method="post">
-                               <input type="hidden" name="id" 
value="{project/id}">
-                               </input>
-                               <dl class="proplist-col">
-                                       <dt>
-                                               <label for="name"><xsl:value-of 
select="php:function('lang','Project title')" /></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:if 
test="project/error_msg_array/name != ''">
-                                                               <xsl:variable 
name="error_msg"><xsl:value-of select="project/error_msg_array/name" 
/></xsl:variable>
-                                                               <div 
class='input_error_msg'><xsl:value-of select="php:function('lang', $error_msg)" 
/></div>
-                                                       </xsl:if>
-                                                       <div 
style="margin-left:0; margin-bottom: 3px;" class="help_text line"><xsl:value-of 
select="php:function('lang','Give project name')" /></div>
-                                                       <input type="text" 
name="name" id="name" value="{project/name}" size="100"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="project/name" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="project_type"><xsl:value-of select="php:function('lang','Project_type')" 
/></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:if 
test="project/error_msg_array/project_type_id != ''">
-                                                               <xsl:variable 
name="error_msg"><xsl:value-of select="project/error_msg_array/project_type_id" 
/></xsl:variable>
-                                                               <div 
class='input_error_msg'><xsl:value-of select="php:function('lang', $error_msg)" 
/></div>
-                                                       </xsl:if>
-                                                       <div 
style="margin-left:0; margin-bottom: 3px;" class="help_text line"><xsl:value-of 
select="php:function('lang','Give project type')" /></div>
-                                                       <select 
id="project_type_id" name="project_type_id">
-                                                               
<xsl:apply-templates select="options"/>
-                                                       </select>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="project/project_type_label" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="description"><xsl:value-of select="php:function('lang', 'Description')" 
/></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:if 
test="project/error_msg_array/description != ''">
-                                                               <xsl:variable 
name="error_msg"><xsl:value-of select="project/error_msg_array/description" 
/></xsl:variable>
-                                                               <div 
class='input_error_msg'><xsl:value-of select="php:function('lang', $error_msg)" 
/></div>
-                                                       </xsl:if>
-                                                       <div 
style="margin-left:0; margin-bottom: 3px;" class="help_text line"><xsl:value-of 
select="php:function('lang','Give description to the project')" /></div>
-                                                       <textarea 
id="description" name="description" rows="5" cols="60"><xsl:value-of 
select="project/description" disable-output-escaping="yes"/></textarea>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="project/description" disable-output-escaping="yes"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="start_date"><xsl:value-of select="php:function('lang','Start date')" 
/></label>
-                                       </dt>
-                                       <dd>
+               <div id="project_details" class="content-wrp">
+                       <div id="details">
+                               <xsl:variable name="action_url">
+                                       <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', 
'menuaction:logistic.uiproject.save')" />
+                               </xsl:variable>
+                               <form action="{$action_url}" method="post">
+                                       <input type="hidden" name="id" 
value="{project/id}">
+                                       </input>
+                                       <dl class="proplist-col">
+                                               <dt>
+                                                       <label for="name">
+                                                               <xsl:value-of 
select="php:function('lang','Project title')" />
+                                                       </label>
+                                               </dt>
+                                               <dd>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="editable">
+                                                                       <xsl:if 
test="project/error_msg_array/name != ''">
+                                                                               
<xsl:variable name="error_msg">
+                                                                               
        <xsl:value-of select="project/error_msg_array/name" />
+                                                                               
</xsl:variable>
+                                                                               
<div class='input_error_msg'>
+                                                                               
        <xsl:value-of select="php:function('lang', $error_msg)" />
+                                                                               
</div>
+                                                                       
</xsl:if>
+                                                                       <div 
style="margin-left:0; margin-bottom: 3px;" class="help_text line">
+                                                                               
<xsl:value-of select="php:function('lang','Give project name')" />
+                                                                       </div>
+                                                                       <input 
type="text" name="name" id="name" value="{project/name}" size="100"/>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       
<xsl:value-of select="project/name" />
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </dd>
+                                               <dt>
+                                                       <label 
for="project_type">
+                                                               <xsl:value-of 
select="php:function('lang','Project_type')" />
+                                                       </label>
+                                               </dt>
+                                               <dd>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="editable">
+                                                                       <xsl:if 
test="project/error_msg_array/project_type_id != ''">
+                                                                               
<xsl:variable name="error_msg">
+                                                                               
        <xsl:value-of select="project/error_msg_array/project_type_id" />
+                                                                               
</xsl:variable>
+                                                                               
<div class='input_error_msg'>
+                                                                               
        <xsl:value-of select="php:function('lang', $error_msg)" />
+                                                                               
</div>
+                                                                       
</xsl:if>
+                                                                       <div 
style="margin-left:0; margin-bottom: 3px;" class="help_text line">
+                                                                               
<xsl:value-of select="php:function('lang','Give project type')" />
+                                                                       </div>
+                                                                       <select 
id="project_type_id" name="project_type_id">
+                                                                               
<xsl:apply-templates select="options"/>
+                                                                       
</select>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       
<xsl:value-of select="project/project_type_label" />
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </dd>
+                                               <dt>
+                                                       <label 
for="copy_project_activities">
+                                                               <xsl:value-of 
select="php:function('lang','Copy activities from')" />
+                                                       </label>
+                                               </dt>
+                                               <dd>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="editable = '1' and activities !='1' ">
+                                                                       <select 
id="copy_project_activities" name="copy_project_activities">
+                                                                               
<xsl:apply-templates select="project_list/options"/>
+                                                                       
</select>
+                                                               </xsl:when>
+                                                       </xsl:choose>
+                                               </dd>
+                                               <dt>
+                                                       <label 
for="description">
+                                                               <xsl:value-of 
select="php:function('lang', 'Description')" />
+                                                       </label>
+                                               </dt>
+                                               <dd>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="editable">
+                                                                       <xsl:if 
test="project/error_msg_array/description != ''">
+                                                                               
<xsl:variable name="error_msg">
+                                                                               
        <xsl:value-of select="project/error_msg_array/description" />
+                                                                               
</xsl:variable>
+                                                                               
<div class='input_error_msg'>
+                                                                               
        <xsl:value-of select="php:function('lang', $error_msg)" />
+                                                                               
</div>
+                                                                       
</xsl:if>
+                                                                       <div 
style="margin-left:0; margin-bottom: 3px;" class="help_text line">
+                                                                               
<xsl:value-of select="php:function('lang','Give description to the project')" />
+                                                                       </div>
+                                                                       
<textarea id="description" name="description" rows="5" cols="60">
+                                                                               
<xsl:value-of select="project/description" disable-output-escaping="yes"/>
+                                                                       
</textarea>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       
<xsl:value-of select="project/description" disable-output-escaping="yes"/>
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </dd>
+                                               <dt>
+                                                       <label for="start_date">
+                                                               <xsl:value-of 
select="php:function('lang','Start date')" />
+                                                       </label>
+                                               </dt>
+                                               <dd>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="editable">
+                                                                       <xsl:if 
test="project/error_msg_array/start_date != ''">
+                                                                               
<xsl:variable name="error_msg">
+                                                                               
        <xsl:value-of select="project/error_msg_array/start_date" />
+                                                                               
</xsl:variable>
+                                                                               
<div class='input_error_msg'>
+                                                                               
        <xsl:value-of select="php:function('lang', $error_msg)" />
+                                                                               
</div>
+                                                                       
</xsl:if>
+                                                                       <input 
class="date" id="start_date" name="start_date" type="text">
+                                                                               
<xsl:if test="project/start_date != ''">
+                                                                               
        <xsl:attribute name="value">
+                                                                               
                <xsl:value-of select="php:function('date', $date_format, 
number(project/start_date))"/>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:if>
+                                                                       </input>
+                                                                       <span 
class="help_text line">
+                                                                               
<xsl:value-of select="php:function('lang','Give start date to project')" />
+                                                                       </span>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       <span>
+                                                                               
<xsl:value-of select="php:function('date', $date_format, 
number(project/start_date))"/>
+                                                                       </span>
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </dd>
+                                               <dt>
+                                                       <label for="end_date">
+                                                               <xsl:value-of 
select="php:function('lang','End date')" />
+                                                       </label>
+                                               </dt>
+                                               <dd>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="editable">
+                                                                       <xsl:if 
test="project/error_msg_array/end_date != ''">
+                                                                               
<xsl:variable name="error_msg">
+                                                                               
        <xsl:value-of select="project/error_msg_array/end_date" />
+                                                                               
</xsl:variable>
+                                                                               
<div class='input_error_msg'>
+                                                                               
        <xsl:value-of select="php:function('lang', $error_msg)" />
+                                                                               
</div>
+                                                                       
</xsl:if>
+                                                                       <input 
class="date" id="end_date" name="end_date" type="text">
+                                                                               
<xsl:if test="project/end_date != ''">
+                                                                               
        <xsl:attribute name="value">
+                                                                               
                <xsl:value-of select="php:function('date', $date_format, 
number(project/end_date))"/>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:if>
+                                                                       </input>
+                                                                       <span 
class="help_text line">
+                                                                               
<xsl:value-of select="php:function('lang','Give end date to project')" />
+                                                                       </span>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       <span>
+                                                                               
<xsl:value-of select="php:function('date', $date_format, 
number(project/end_date))"/>
+                                                                       </span>
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </dd>
+                                       </dl>
+
+                                       <div class="form-buttons">
                                                <xsl:choose>
                                                        <xsl:when 
test="editable">
-                                                               <xsl:if 
test="project/error_msg_array/start_date != ''">
-                                                                       
<xsl:variable name="error_msg"><xsl:value-of 
select="project/error_msg_array/start_date" /></xsl:variable>
-                                                                       <div 
class='input_error_msg'><xsl:value-of select="php:function('lang', $error_msg)" 
/></div>
-                                                               </xsl:if>
-                                                               <input 
class="date" id="start_date" name="start_date" type="text">
-                                                       <xsl:if 
test="project/start_date != ''">
-                                                       <xsl:attribute 
name="value"><xsl:value-of select="php:function('date', $date_format, 
number(project/start_date))"/></xsl:attribute>
-                                                       </xsl:if>
-                                               </input>
-                                               <span class="help_text 
line"><xsl:value-of select="php:function('lang','Give start date to project')" 
/></span>
+                                                               <xsl:variable 
name="lang_save">
+                                                                       
<xsl:value-of select="php:function('lang', 'save')" />
+                                                               </xsl:variable>
+                                                               <input 
type="submit" name="save_project" value="{$lang_save}" title = "{$lang_save}" />
+                                                       
+                                                               <xsl:variable 
name="view_projects_url">
+                                                                       
<xsl:value-of select="php:function('get_phpgw_link', '/index.php', 
'menuaction:logistic.uiproject.index' )" />
+                                                               </xsl:variable>
+                                                               <a class="btn" 
href="{$view_projects_url}">
+                                                                       
<xsl:value-of select="php:function('lang', 'Cancel')" />
+                                                               </a>
                                                        </xsl:when>
                                                        <xsl:otherwise>
-                                                       <span><xsl:value-of 
select="php:function('date', $date_format, number(project/start_date))"/></span>
+                                                               <xsl:variable 
name="lang_edit">
+                                                                       
<xsl:value-of select="php:function('lang', 'edit')" />
+                                                               </xsl:variable>
+                                                               <input 
type="submit" name="edit_project" value="{$lang_edit}" title = "{$lang_edit}" />
+                                                       
+                                                               <xsl:variable 
name="view_projects_url_2">
+                                                                       
<xsl:value-of select="php:function('get_phpgw_link', '/index.php', 
'menuaction:logistic.uiproject.index' )" />
+                                                               </xsl:variable>
+                                                               <a class="btn" 
href="{$view_projects_url_2}">
+                                                                       
<xsl:value-of select="php:function('lang','Show project overview')" />
+                                                               </a>
                                                        </xsl:otherwise>
                                                </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="end_date"><xsl:value-of select="php:function('lang','End date')" /></label>
-                                       </dt>
-                                       <dd>
-                                               <xsl:choose>
-                                                       <xsl:when 
test="editable">
-                                                               <xsl:if 
test="project/error_msg_array/end_date != ''">
-                                                                       
<xsl:variable name="error_msg"><xsl:value-of 
select="project/error_msg_array/end_date" /></xsl:variable>
-                                                                       <div 
class='input_error_msg'><xsl:value-of select="php:function('lang', $error_msg)" 
/></div>
-                                                               </xsl:if>
-                                                               <input 
class="date" id="end_date" name="end_date" type="text">
-                                                       <xsl:if 
test="project/end_date != ''">
-                                                       <xsl:attribute 
name="value"><xsl:value-of select="php:function('date', $date_format, 
number(project/end_date))"/></xsl:attribute>
-                                                       </xsl:if>
-                                               </input>
-                                               <span class="help_text 
line"><xsl:value-of select="php:function('lang','Give end date to project')" 
/></span>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
-                                                       <span><xsl:value-of 
select="php:function('date', $date_format, number(project/end_date))"/></span>
-                                                       </xsl:otherwise>
-                                               </xsl:choose>
-                                       </dd>
-                               </dl>
-
-                               <div class="form-buttons">
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save')" 
/></xsl:variable>
-                                                       <input type="submit" 
name="save_project" value="{$lang_save}" title = "{$lang_save}" />
-                                                       
-                                                       <xsl:variable 
name="view_projects_url">
-                                                               <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', 
'menuaction:logistic.uiproject.index' )" />
-                                                       </xsl:variable>
-                                                       <a class="btn" 
href="{$view_projects_url}"><xsl:value-of select="php:function('lang', 
'Cancel')" /></a>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
-                                                       <input type="submit" 
name="edit_project" value="{$lang_edit}" title = "{$lang_edit}" />
-                                                       
-                                                       <xsl:variable 
name="view_projects_url_2">
-                                                               <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', 
'menuaction:logistic.uiproject.index' )" />
-                                                       </xsl:variable>
-                                                       <a class="btn" 
href="{$view_projects_url_2}"><xsl:value-of select="php:function('lang','Show 
project overview')" /></a>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </div>
-                       </form>
+                                       </div>
+                               </form>
+                       </div>
                </div>
        </div>
-</div>
-<xsl:call-template name="jquery_phpgw_i18n"/>
+       <xsl:call-template name="jquery_phpgw_i18n"/>
 </xsl:template>
 
 <xsl:template match="options">

Modified: branches/dev-syncromind-2/phpgwapi/inc/class.db.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/class.db.inc.php     2016-10-04 
11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/phpgwapi/inc/class.db.inc.php     2016-10-04 
11:08:28 UTC (rev 15796)
@@ -99,6 +99,7 @@
                protected $Transaction  = false;
 
                var $persistent = false;
+               var $delayPointer = false;
                /**
                * Constructor
                * @param string $query query to be executed (optional)

Modified: branches/dev-syncromind-2/property/inc/class.soadmin_entity.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.soadmin_entity.inc.php 
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/property/inc/class.soadmin_entity.inc.php 
2016-10-04 11:08:28 UTC (rev 15796)
@@ -3,7 +3,7 @@
         * phpGroupWare - property: a Facilities Management System.
         *
         * @author Sigurd Nes <address@hidden>
-        * @copyright Copyright (C) 2003-2010 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * @copyright Copyright (C) 2003-2016 Free Software Foundation, Inc. 
http://www.fsf.org/
         * This file is part of phpGroupWare.
         *
         * phpGroupWare is free software; you can redistribute it and/or modify
@@ -1185,28 +1185,11 @@
                                                $type = 
$this->db->get_last_insert_id('fm_bim_type', 'id');
 
                                                $sql = "SELECT * FROM 
fm_{$this->type}_{$category['entity_id']}_{$category['id']}";
-                                               $this->db->query($sql, 
__LINE__, __FILE__);
-                                               while ($this->db->next_record())
+                                               $this->db2->query($sql, 
__LINE__, __FILE__);
+                                               while 
($this->db2->next_record())
                                                {
-                                                       $data = 
$this->db->Record;
-/*
-                                                       $xmldata = 
phpgwapi_xmlhelper::toXML($data, 
"_{$this->type}_{$category['entity_id']}_{$category['id']}");
-                                                       $doc = new 
DOMDocument('1.0', 'utf-8');
-                                                       $doc->loadXML($xmldata);
-                                                       $domElement = 
$doc->getElementsByTagName("_{$this->type}_{$category['entity_id']}_{$category['id']}")->item(0);
-                                                       $domAttribute = 
$doc->createAttribute('appname');
-                                                       $domAttribute->value = 
'property';
+                                                       $data = 
$this->db2->Record;
 
-                                                       // Don't forget to 
append it to the element
-                                                       
$domElement->appendChild($domAttribute);
-
-                                                       // Append it to the 
document itself
-                                                       
$doc->appendChild($domElement);
-
-                                                       
$doc->preserveWhiteSpace = true;
-                                                       $doc->formatOutput = 
true;
-                                                       $xml = $doc->saveXML();
-*/
                                                        $p_location_id = '';
                                                        if ($data['p_cat_id'])
                                                        {
@@ -1233,7 +1216,6 @@
                                                                'location_id' 
=> $location_id,
                                                                'type' => $type,
                                                                'guid' => $guid,
-//                                                             
'xml_representation' => $this->db->db_addslashes($xml),
                                                                
'json_representation' => json_encode($data),
                                                                'model' => 0,
                                                                'p_location_id' 
=> $p_location_id,

Modified: branches/dev-syncromind-2/property/inc/class.soentity.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.soentity.inc.php       
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/property/inc/class.soentity.inc.php       
2016-10-04 11:08:28 UTC (rev 15796)
@@ -335,7 +335,7 @@
                        unset($sql_cnt);
 
                        $this->total_records = $this->db->f('cnt');
-                       _debug_array($sql . $ordermethod);
+//                     _debug_array($sql . $ordermethod);
                        $ordermethod = '';
                        if (!$allrows)
                        {
@@ -837,7 +837,7 @@
                                        {
                                                if(!empty($attibute['choice']))
                                                {
-                                                       $_querymethod[] = 
"CAST( json_representation->>'status' AS integer) < 90";
+                                                       $_querymethod[] = 
"(json_representation->>'status' IS NULL OR CAST( 
json_representation->>'status' AS integer) < 90)";
                                                        $__querymethod = 
array(); // remove block
                                                }
                                        }

Modified: branches/dev-syncromind-2/property/inc/class.uitts.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.uitts.inc.php  2016-10-04 
11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/property/inc/class.uitts.inc.php  2016-10-04 
11:08:28 UTC (rev 15796)
@@ -2048,7 +2048,7 @@
 
                                $need_approval = 
isset($this->bo->config->config_data['workorder_approval']) ? 
$this->bo->config->config_data['workorder_approval'] : '';
 
-                               $supervisor_email = 
$this->get_supervisor_email($supervisor_id,  $need_approval);
+               //              $supervisor_email = 
$this->get_supervisor_email($supervisor_id,  $need_approval);
                                // approval
                        }
 
@@ -2940,7 +2940,7 @@
                                'year_list' => array('options' => 
$this->bocommon->select_list($ticket['actual_cost_year'] ? 
$ticket['actual_cost_year'] : date('Y'), $year_list)),
                                'period_list' => array('options' => 
execMethod('property.boinvoice.period_list', date('Ym'))),
                                'need_approval' => $need_approval,
-                               'value_approval_mail_address' => 
$supervisor_email,
+       //                      'value_approval_mail_address' => 
$supervisor_email,
                                'contact_data' => $contact_data,
                                'lookup_type' => $lookup_type,
                                'simple' => $this->simple,
@@ -3065,11 +3065,18 @@
 
                public function check_purchase_right()
                {
+                       $need_approval = 
isset($this->bo->config->config_data['workorder_approval']) ? 
$this->bo->config->config_data['workorder_approval'] : '';
+                       if(!$need_approval)
+                       {
+                               return;
+                       }
+
                        $config         = CreateObject('admin.soconfig', 
$GLOBALS['phpgw']->locations->get_id('property', '.ticket'));
                        $check_external_register= 
!!$config->config_data['external_register']['check_external_register'];
-                       $id = phpgw::get_var('ecodimb');
-               //      $id ='013000';
 
+                       $id = sprintf("%06s", phpgw::get_var('ecodimb'));
+       //              $id ='013000';
+
                        $amount =phpgw::get_var('amount', 'int');
 
                        if($check_external_register && $id)
@@ -3193,6 +3200,14 @@
                                                'required'      => true
                                        );
                                }
+                               else
+                               {
+                                       $supervisor_email[] = array(
+                                               'id' => $supervisor_id,
+                                               'address' => 
$GLOBALS['phpgw']->accounts->id2name($supervisor_id) . '@bergen.kommune.no',
+                                               'required'      => true
+                                       );
+                               }
 
                                if (isset($prefs['approval_from']) && 
$prefs['approval_from'])
                                {

Modified: 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
===================================================================
--- 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
  2016-10-04 11:05:30 UTC (rev 15795)
+++ 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
  2016-10-04 11:08:28 UTC (rev 15796)
@@ -222,7 +222,7 @@
                        return $filename;
                }
 
-               public function transfer( )
+               public function transfer( $debug )
                {
                        $this->db->transaction_begin();
 
@@ -244,7 +244,7 @@
 
                        $transfer_ok = false;
 //                     if ($this->config->config_data['common']['method'] == 
'ftp' || $this->config->config_data['common']['method'] == 'ssh')
-                       if (false)//Not yet...
+                       if (!$debug)//Not yet...
                        {
                                if (!$connection = $this->connection)
                                {
@@ -292,6 +292,18 @@
                        //              @unlink($filename);
                                }
                        }
+                       else
+                       {
+                               $transfer_ok = true;
+
+                               $GLOBALS['phpgw_info']['flags']['noheader'] = 
true;
+                               $GLOBALS['phpgw_info']['flags']['nofooter'] = 
true;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
false;
+                               $size = strlen($content);
+                               $browser = CreateObject('phpgwapi.browser');
+                               $browser->content_header(basename($filename), 
'', $size);
+                               echo $content;
+                       }
                        return $transfer_ok;
                }
 

Modified: 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
===================================================================
--- 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
      2016-10-04 11:05:30 UTC (rev 15795)
+++ 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
      2016-10-04 11:08:28 UTC (rev 15796)
@@ -40,6 +40,7 @@
        class lag_agresso_ordre_fra_melding
        {
 
+               var $debug = true;
                function __construct()
                {
                        
@@ -48,7 +49,7 @@
                public function transfer( $id )
                {
                        $_ticket = ExecMethod('property.sotts.read_single', 
$id);
-                       if ($_ticket['order_sent'])
+                       if (!$this->debug && $_ticket['order_sent'])
                        {
                                return 2;
                        }
@@ -153,9 +154,9 @@
 
                        $exporter_ordre = new 
BkBygg_exporter_data_til_Agresso(array('order_id' => $_ticket['order_id']));
                        $exporter_ordre->create_transfer_xml($param);
-                       $exporter_ordre->output();
-                       die();
-                       $export_ok = $exporter_ordre->transfer();
+
+                       $export_ok = $exporter_ordre->transfer($this->debug);
+
                        if ($export_ok)
                        {
                                $this->log_transfer( $id );

Modified: branches/dev-syncromind-2/property/inc/soap_client/bra5/soap.php
===================================================================
--- branches/dev-syncromind-2/property/inc/soap_client/bra5/soap.php    
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/property/inc/soap_client/bra5/soap.php    
2016-10-04 11:08:28 UTC (rev 15796)
@@ -78,8 +78,22 @@
        $section = phpgw::get_var('section', 'string');
        $fileid = phpgw::get_var('fileid', 'string');
 
-       $where_parameter =  phpgw::get_var('where_parameter', 'string');
+       $c = CreateObject('admin.soconfig', $location_id);
 
+       $login = $c->config_data[$section]['anonymous_user'];
+       $passwd = $c->config_data[$section]['anonymous_pass'];
+       $location_url = $c->config_data[$section]['location_url'];
+       $braarkiv_user = $c->config_data[$section]['braarkiv_user'];
+       $braarkiv_pass = $c->config_data[$section]['braarkiv_pass'];
+       $classname = $c->config_data[$section]['arkd'];
+       $where_parameter = $c->config_data[$section]['where_parameter'];
+       $baseclassname = !empty($c->config_data[$section]['baseclassname']) ? 
$c->config_data[$section]['baseclassname'] : 'Eiendomsarkiver';
+
+       if(!$where_parameter)
+       {
+               $where_parameter =  phpgw::get_var('where_parameter', 'string');
+       }
+
        $_where = '';
        if (!$fileid)
        {
@@ -99,15 +113,7 @@
                }
        }
 
-       $c = CreateObject('admin.soconfig', $location_id);
 
-       $login = $c->config_data[$section]['anonymous_user'];
-       $passwd = $c->config_data[$section]['anonymous_pass'];
-       $location_url = $c->config_data[$section]['location_url'];
-       $braarkiv_user = $c->config_data[$section]['braarkiv_user'];
-       $braarkiv_pass = $c->config_data[$section]['braarkiv_pass'];
-       $classname = $c->config_data[$section]['arkd'];
-
        $_POST['submitit'] = "";
 
        //avoid confusion
@@ -190,7 +196,7 @@
        }
        $bra5ServiceSearch = new Bra5ServiceSearch();
        /*
-         if($bra5ServiceSearch->searchDocument(new 
Bra5StructSearchDocument($secKey,$_baseclassname = 
'Eiendomsarkiver',$classname,$_where,$_maxhits = 2)))
+         if($bra5ServiceSearch->searchDocument(new 
Bra5StructSearchDocument($secKey,$baseclassname,$classname,$_where,$_maxhits = 
2)))
          {
          //            _debug_array($bra5ServiceSearch->getResult());
          }
@@ -199,7 +205,7 @@
          print_r($bra5ServiceSearch->getLastError());
          }
         */
-       if ($bra5ServiceSearch->searchAndGetDocuments(new 
Bra5StructSearchAndGetDocuments($secKey, $_baseclassname = 'Eiendomsarkiver', 
$classname, $_where, $_maxhits = -1)))
+       if ($bra5ServiceSearch->searchAndGetDocuments(new 
Bra5StructSearchAndGetDocuments($secKey, $baseclassname, $classname, $_where, 
$_maxhits = -1)))
        {
 //             _debug_array($bra5ServiceSearch->getResult());die();
                $_result = 
$bra5ServiceSearch->getResult()->getsearchAndGetDocumentsResult()->getExtendedDocument()->getsearchAndGetDocumentsResult()->ExtendedDocument;

Modified: branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php      
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php      
2016-10-04 11:08:28 UTC (rev 15796)
@@ -237,7 +237,7 @@
                                          rental_composite.address_2, 
rental_composite.postcode, rental_composite.place,
                                          rental_composite.is_active, 
rental_composite.area, rental_composite.description,
                                          rental_composite.furnish_type_id, 
rental_composite.standard_id,rental_composite.composite_type_id,
-                                         rental_composite.part_of_town_id, 
rental_composite.custom_prize_factor,";
+                                         rental_composite.part_of_town_id, 
rental_composite.custom_prize_factor, rental_composite.custom_prize, 
rental_composite.prize_type_id,";
                                $cols .= "rental_contract.id AS contract_id, 
rental_contract.date_start, rental_contract.date_end, 
rental_contract.old_contract_id, ";
                                $cols .= "rental_application.id AS 
application_id, rental_application.date_start AS application_date_start, 
rental_application.date_end AS application_date_end, ";
                                $cols .= "
@@ -316,6 +316,8 @@
                                
$composite->set_composite_type_id($this->unmarshal($this->db->f('composite_type_id'),
 'int'));
                                
$composite->set_part_of_town_id($this->unmarshal($this->db->f('part_of_town_id'),
 'int'));
                                
$composite->set_custom_prize_factor($this->unmarshal($this->db->f('custom_prize_factor',
 true), 'float'));
+                               
$composite->set_prize_type_id($this->unmarshal($this->db->f('prize_type_id'), 
'int'));
+                               
$composite->set_custom_prize($this->unmarshal($this->db->f('custom_prize'), 
'float'));
                        }
                        // Location code
                        $location_code = 
$this->unmarshal($this->db->f('location_code', true), 'string');
@@ -460,7 +462,9 @@
                                'standard_id = ' . 
$composite->get_standard_id(),
                                'composite_type_id = ' . 
$composite->get_composite_type_id(),
                                'part_of_town_id = ' . 
$composite->get_part_of_town_id(),
-                               'custom_prize_factor = \'' . 
$composite->get_custom_prize_factor() . '\''
+                               'custom_prize_factor = \'' . 
$composite->get_custom_prize_factor() . '\'',
+                               'prize_type_id = ' . 
$composite->get_prize_type_id(),
+                               'custom_prize = \'' . 
$composite->get_custom_prize() . '\''
                        );
 
                        $result = $this->db->query('UPDATE rental_composite SET 
' . join(',', $values) . " WHERE id=$id", __LINE__, __FILE__);
@@ -480,7 +484,7 @@
                        // Build a db-friendly array of the composite object
                        $cols = array('name', 'description', 
'has_custom_address', 'address_1', 'address_2',
                                'house_number', 'postcode', 'place', 
'object_type_id', 'area', 'furnish_type_id',
-                               'standard_id','composite_type_id', 
'part_of_town_id', 'custom_prize_factor');
+                               'standard_id','composite_type_id', 
'part_of_town_id', 'custom_prize_factor','prize_type_id', 'custom_prize');
                        $values = array(
                                "'" . $composite->get_name() . "'",
                                "'" . $composite->get_description() . "'",
@@ -496,7 +500,9 @@
                                $composite->get_standard_id(),
                                $composite->get_composite_type_id(),
                                $composite->get_part_of_town_id(),
-                               $composite->get_custom_prize_factor()
+                               "'" . $composite->get_custom_prize_factor() . 
"'",
+                               $composite->get_prize_type_id(),
+                               "'" . $composite->get_custom_prize() . "'"
                        );
 
                        $query = "INSERT INTO rental_composite (" . join(',', 
$cols) . ") VALUES (" . join(',', $values) . ")";

Modified: branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php      
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php      
2016-10-04 11:08:28 UTC (rev 15796)
@@ -7,6 +7,7 @@
        include_class('rental', 'composite', 'inc/model/');
        include_class('rental', 'application', 'inc/model/');
        include_class('rental', 'property_location', 'inc/model/');
+       include_class('rental', 'price_item', 'inc/model/');
 
        class rental_uicomposite extends rental_uicommon
        {
@@ -1010,6 +1011,16 @@
 JS;
                        $GLOBALS['phpgw']->js->add_code('', $code);
 
+                       $current_prize_type_id = 
$composite->get_prize_type_id();
+                       $prize_type_options = array();
+                       $price_item = new rental_price_item();
+                       foreach ($price_item->get_price_types() as 
$prize_type_id => $prize_type_title)
+                       {
+                               $selected = ($current_prize_type_id == 
$prize_type_id) ? 1 : 0;
+                               $prize_type_options[] = array('id' => 
$prize_type_id, 'name' => lang($prize_type_title),
+                                       'selected' => $selected);
+                       }
+
                        $data = array
                                (
                                'datatable_def' => $datatable_def,
@@ -1021,6 +1032,8 @@
                                'value_name' => $composite->get_name(),
                                'value_composite_standard_name' => 
$composite_standard_name,
                                'list_composite_standard' => array('options' => 
$composite_standard_options),
+                               'value_custom_prize' => 
$composite->get_custom_prize(),
+                               'list_prize_type' => array('options' => 
$prize_type_options),
                                'value_composite_type_name' => 
$composite_type_name,
                                'list_composite_type' => array('options' => 
$composite_type_options),
                                'value_furnish_type_name' => $furnish_type_name,
@@ -1094,6 +1107,8 @@
                                
$composite->set_composite_type_id(phpgw::get_var('composite_type_id', 'int'));
                                
$composite->set_part_of_town_id(phpgw::get_var('part_of_town_id', 'int'));
                                
$composite->set_custom_prize_factor(phpgw::get_var('custom_prize_factor', 
'float'));
+                               
$composite->set_custom_prize(phpgw::get_var('custom_prize', 'float'));
+                               
$composite->set_prize_type_id(phpgw::get_var('prize_type_id', 'int'));
 
                                if 
(rental_socomposite::get_instance()->store($composite))
                                {

Modified: branches/dev-syncromind-2/rental/inc/model/class.composite.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/model/class.composite.inc.php  
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/rental/inc/model/class.composite.inc.php  
2016-10-04 11:08:28 UTC (rev 15796)
@@ -30,6 +30,8 @@
                protected $contracts;
                protected $part_of_town_id;
                protected $custom_prize_factor = '1.00';
+               protected $custom_prize;
+               protected $prize_type_id;
                protected static $furnish_types_arr;
 
                /**
@@ -372,6 +374,26 @@
                        return (int)$this->composite_type_id;
                }
 
+               public function set_custom_prize( $custom_prize )
+               {
+                       $this->custom_prize = (float)$custom_prize;
+               }
+
+               public function get_custom_prize()
+               {
+                       return (float)$this->custom_prize;
+               }
+
+               public function set_prize_type_id( $prize_type_id )
+               {
+                       $this->prize_type_id = (int)$prize_type_id;
+               }
+
+               public function get_prize_type_id()
+               {
+                       return (int)$this->prize_type_id;
+               }
+
                /**
                 * Fetch composite standards on the form array(array('id' => 1, 
'name' => 'some text', 'selected' => 1|0))
                 * @return array
@@ -510,6 +532,8 @@
                                'composite_type_id' =>  
$this->get_composite_type_id(),
                                'part_of_town_id' =>  
$this->get_part_of_town_id(),
                                'custom_prize_factor' =>  
$this->get_custom_prize_factor(),
+                               'custom_prize' =>  $this->get_custom_prize(),
+                               'prize_type_id' =>  $this->get_prize_type_id(),
                        );
                }
        }
\ No newline at end of file

Modified: branches/dev-syncromind-2/rental/setup/setup.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/setup/setup.inc.php        2016-10-04 
11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/rental/setup/setup.inc.php        2016-10-04 
11:08:28 UTC (rev 15796)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['rental']['name'] = 'rental';  // Module identifier
-       $setup_info['rental']['version'] = '0.1.0.29'; // Current module version
+       $setup_info['rental']['version'] = '0.1.0.30'; // Current module version
        $setup_info['rental']['app_order'] = 51;  // (?)
        $setup_info['rental']['tables'] = array(
                'rental_party', // All contract participants, tenants etc.

Modified: branches/dev-syncromind-2/rental/setup/tables_current.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/setup/tables_current.inc.php       
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/rental/setup/tables_current.inc.php       
2016-10-04 11:08:28 UTC (rev 15796)
@@ -32,6 +32,8 @@
                                'standard_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => true),
                                'part_of_town_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => true),
                                'custom_prize_factor' => array('type' => 
'decimal', 'precision' => '20', 'scale' => '2', 'nullable' => true, 'default' 
=> '1.00'),
+                               'custom_prize' => array('type' => 'decimal', 
'precision' => '20', 'scale' => '2', 'nullable' => true, 'default' => '1.00'),
+                               'prize_type_id'  => array('type' => 'int', 
'precision' => 2, 'nullable' => true,'default' => 1),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: branches/dev-syncromind-2/rental/setup/tables_update.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/setup/tables_update.inc.php        
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/rental/setup/tables_update.inc.php        
2016-10-04 11:08:28 UTC (rev 15796)
@@ -695,3 +695,29 @@
                }
        }
 
+       $test[] = '0.1.0.29';
+       function rental_upgrade0_1_0_29()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->AddColumn('rental_composite', 
'prize_type_id', array(
+                       'type' => 'int',
+                       'precision' => '2',
+                       'nullable' => true,
+                       'default' => 2
+                       ));
+               $GLOBALS['phpgw_setup']->oProc->AddColumn('rental_composite', 
'custom_prize',array(
+                       'type' => 'decimal',
+                       'precision' => '20',
+                       'scale' => '2',
+                       'nullable' => true,
+                       'default' => '0.00'
+                       ));
+
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['rental']['currentver'] = 
'0.1.0.30';
+                       return $GLOBALS['setup_info']['rental']['currentver'];
+               }
+       }

Modified: branches/dev-syncromind-2/rental/templates/base/composite.xsl
===================================================================
--- branches/dev-syncromind-2/rental/templates/base/composite.xsl       
2016-10-04 11:05:30 UTC (rev 15795)
+++ branches/dev-syncromind-2/rental/templates/base/composite.xsl       
2016-10-04 11:08:28 UTC (rev 15796)
@@ -78,6 +78,22 @@
                                                        </select>
                                                </div>
                                                <xsl:if 
test="contract_furnished_status = 1">
+                                                       <div 
class="pure-control-group">
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'custom prize')"/>
+                                                               </label>
+                                                               <input 
type="text" name="custom_prize" id="custom_prize" value="{value_custom_prize}"/>
+                                                       </div>
+                                                       <div 
class="pure-control-group">
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'prize type')"/>
+                                                               </label>
+                                                               <xsl:if 
test="count(//list_prize_type/options) > 0">
+                                                                       <select 
id="prize_type_id" name="prize_type_id">
+                                                                               
<xsl:apply-templates select="list_prize_type/options"/>
+                                                                       
</select>
+                                                               </xsl:if>
+                                                       </div>
 
                                                        <div 
class="pure-control-group">
                                                                <label>




reply via email to

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