[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15788] Stable: Merge 15768:15787 from trunk
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [15788] Stable: Merge 15768:15787 from trunk |
Date: |
Mon, 3 Oct 2016 08:36:55 +0000 (UTC) |
Revision: 15788
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15788
Author: sigurdne
Date: 2016-10-03 08:36:54 +0000 (Mon, 03 Oct 2016)
Log Message:
-----------
Stable: Merge 15768:15787 from trunk
Modified Paths:
--------------
branches/Version-2_0-branch/logistic/inc/class.soactivity.inc.php
branches/Version-2_0-branch/logistic/inc/class.socommon.inc.php
branches/Version-2_0-branch/logistic/inc/class.soproject.inc.php
branches/Version-2_0-branch/logistic/inc/class.sorequirement.inc.php
branches/Version-2_0-branch/logistic/inc/class.sorequirement_resource_allocation.inc.php
branches/Version-2_0-branch/logistic/inc/class.sorequirement_value.inc.php
branches/Version-2_0-branch/logistic/inc/class.soresource_type_requirement.inc.php
branches/Version-2_0-branch/logistic/inc/class.uiactivity.inc.php
branches/Version-2_0-branch/logistic/inc/class.uiproject.inc.php
branches/Version-2_0-branch/logistic/inc/class.uirequirement.inc.php
branches/Version-2_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
branches/Version-2_0-branch/logistic/inc/class.uiresource_type_requirement.inc.php
branches/Version-2_0-branch/logistic/inc/model/class.model.inc.php
branches/Version-2_0-branch/logistic/templates/base/activity/add_activity_item.xsl
branches/Version-2_0-branch/logistic/templates/base/project/project_item.xsl
branches/Version-2_0-branch/phpgwapi/inc/class.db.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
branches/Version-2_0-branch/property/inc/class.soadmin_entity.inc.php
branches/Version-2_0-branch/property/inc/class.soentity.inc.php
branches/Version-2_0-branch/property/inc/class.sogeneric.inc.php
branches/Version-2_0-branch/property/inc/soap_client/bra5/soap.php
branches/Version-2_0-branch/rental/inc/class.menu.inc.php
branches/Version-2_0-branch/rental/inc/class.socomposite.inc.php
branches/Version-2_0-branch/rental/inc/class.socontract_price_item.inc.php
branches/Version-2_0-branch/rental/inc/class.soprice_item.inc.php
branches/Version-2_0-branch/rental/inc/class.uiapplication.inc.php
branches/Version-2_0-branch/rental/inc/class.uicomposite.inc.php
branches/Version-2_0-branch/rental/inc/class.uicontract.inc.php
branches/Version-2_0-branch/rental/inc/class.uiprice_item.inc.php
branches/Version-2_0-branch/rental/inc/model/class.agresso_gl07.inc.php
branches/Version-2_0-branch/rental/inc/model/class.composite.inc.php
branches/Version-2_0-branch/rental/inc/model/class.contract.inc.php
branches/Version-2_0-branch/rental/inc/model/class.model.inc.php
branches/Version-2_0-branch/rental/setup/default_records.inc.php
branches/Version-2_0-branch/rental/setup/phpgw_no.lang
branches/Version-2_0-branch/rental/setup/setup.inc.php
branches/Version-2_0-branch/rental/setup/tables_current.inc.php
branches/Version-2_0-branch/rental/setup/tables_update.inc.php
branches/Version-2_0-branch/rental/templates/base/application.xsl
branches/Version-2_0-branch/rental/templates/base/composite.xsl
branches/Version-2_0-branch/rental/templates/base/css/base.css
Added Paths:
-----------
branches/Version-2_0-branch/phpgwapi/inc/model/
branches/Version-2_0-branch/rental/inc/class.bogeneric.inc.php
branches/Version-2_0-branch/rental/inc/class.sogeneric.inc.php
branches/Version-2_0-branch/rental/inc/class.uigeneric.inc.php
Property Changed:
----------------
branches/Version-2_0-branch/
Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14933-15747
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767
+ /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14933-15747
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787
Modified: branches/Version-2_0-branch/logistic/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-2_0-branch/logistic/inc/class.soactivity.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/logistic/inc/class.soactivity.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/inc/class.socommon.inc.php
===================================================================
--- branches/Version-2_0-branch/logistic/inc/class.socommon.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/logistic/inc/class.socommon.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/inc/class.soproject.inc.php
===================================================================
--- branches/Version-2_0-branch/logistic/inc/class.soproject.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/logistic/inc/class.soproject.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/inc/class.sorequirement.inc.php
===================================================================
--- branches/Version-2_0-branch/logistic/inc/class.sorequirement.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/logistic/inc/class.sorequirement.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/inc/class.sorequirement_resource_allocation.inc.php
===================================================================
---
branches/Version-2_0-branch/logistic/inc/class.sorequirement_resource_allocation.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++
branches/Version-2_0-branch/logistic/inc/class.sorequirement_resource_allocation.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/inc/class.sorequirement_value.inc.php
===================================================================
--- branches/Version-2_0-branch/logistic/inc/class.sorequirement_value.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/logistic/inc/class.sorequirement_value.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/inc/class.soresource_type_requirement.inc.php
===================================================================
---
branches/Version-2_0-branch/logistic/inc/class.soresource_type_requirement.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++
branches/Version-2_0-branch/logistic/inc/class.soresource_type_requirement.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/inc/class.uiactivity.inc.php
===================================================================
--- branches/Version-2_0-branch/logistic/inc/class.uiactivity.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/logistic/inc/class.uiactivity.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/inc/class.uiproject.inc.php
===================================================================
--- branches/Version-2_0-branch/logistic/inc/class.uiproject.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/logistic/inc/class.uiproject.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/inc/class.uirequirement.inc.php
===================================================================
--- branches/Version-2_0-branch/logistic/inc/class.uirequirement.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/logistic/inc/class.uirequirement.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
===================================================================
---
branches/Version-2_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++
branches/Version-2_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/inc/class.uiresource_type_requirement.inc.php
===================================================================
---
branches/Version-2_0-branch/logistic/inc/class.uiresource_type_requirement.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++
branches/Version-2_0-branch/logistic/inc/class.uiresource_type_requirement.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/inc/model/class.model.inc.php
===================================================================
--- branches/Version-2_0-branch/logistic/inc/model/class.model.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/logistic/inc/model/class.model.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/templates/base/activity/add_activity_item.xsl
===================================================================
---
branches/Version-2_0-branch/logistic/templates/base/activity/add_activity_item.xsl
2016-10-03 08:32:08 UTC (rev 15787)
+++
branches/Version-2_0-branch/logistic/templates/base/activity/add_activity_item.xsl
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/logistic/templates/base/project/project_item.xsl
===================================================================
---
branches/Version-2_0-branch/logistic/templates/base/project/project_item.xsl
2016-10-03 08:32:08 UTC (rev 15787)
+++
branches/Version-2_0-branch/logistic/templates/base/project/project_item.xsl
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/phpgwapi/inc/class.db.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.db.inc.php 2016-10-03
08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.db.inc.php 2016-10-03
08:36:54 UTC (rev 15788)
@@ -99,6 +99,7 @@
protected $Transaction = false;
var $persistent = false;
+ var $delayPointer = false;
/**
* Constructor
* @param string $query query to be executed (optional)
Modified: branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -352,7 +352,7 @@
{
foreach ($this->fields as $field => $params)
{
- if ($params['manytomany'])
+ if (!empty($params['manytomany']))
{
$table =
$params['manytomany']['table'];
$key =
$params['manytomany']['key'];
Modified: branches/Version-2_0-branch/property/inc/class.soadmin_entity.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soadmin_entity.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/property/inc/class.soadmin_entity.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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/Version-2_0-branch/property/inc/class.soentity.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soentity.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/property/inc/class.soentity.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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)
{
Modified: branches/Version-2_0-branch/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sogeneric.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/property/inc/class.sogeneric.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -2533,107 +2533,6 @@
break;
// END CONTROLLER TABLES
-// START RENTAL TABLES
- case 'location_factor':
- $info = array
- (
- 'table' =>
'rental_location_factor',
- 'id' => array('name' => 'id',
'type' => 'auto'),
- 'fields' => array(
- array(
- 'name' =>
'part_of_town_id',
- 'descr' =>
lang('location'),
- 'type' =>
'select',
- 'nullable' =>
false,
- 'filter' =>
true,
- 'values_def' =>
array(
-
'valueset' => false,
-
'get_single_value' => 'property.sogeneric.get_name',
-
'method' => 'property.bogeneric.get_list',
-
'method_input' => array('type' => 'part_of_town', 'selected' =>
'##part_of_town_id##')
- )
- ),
- array(
- 'name' =>
'factor',
- 'descr' =>
lang('factor'),
- 'type' =>
'numeric',
- 'nullable' =>
false,
- 'size' => 4,
- 'sortable' =>
true
- ),
- array(
- 'name' =>
'remark',
- 'descr' =>
lang('remark'),
- 'type' => 'text'
- )
- ),
- 'edit_msg' => lang('edit unit'),
- 'add_msg' => lang('add unit'),
- 'name' => lang('unit'),
- 'acl_app' => 'rental',
- 'acl_location' => '.admin',
- 'menu_selection' =>
'admin::rental::location_factor',
- 'default' => array(
- 'user_id' =>
array('add' => '$this->account'),
- 'entry_date' =>
array('add' => 'time()'),
- 'modified_date' =>
array('edit' => 'time()'),
- )
- );
- break;
- case 'composite_standard':
- $info = array
- (
- 'table' =>
'rental_composite_standard',
- 'id' => array('name' => 'id',
'type' => 'int'),
- 'fields' => array
- (
- array
- (
- 'name' =>
'name',
- 'descr' =>
lang('name'),
- 'type' =>
'varchar'
- ),
- array
- (
- 'name' =>
'factor',
- 'descr' =>
lang('factor'),
- 'type' =>
'numeric',
- 'nullable' =>
false,
- 'size' => 4,
- 'sortable' =>
true
- )
- ),
- 'edit_msg' => lang('edit unit'),
- 'add_msg' => lang('add unit'),
- 'name' => lang('unit'),
- 'acl_app' => 'rental',
- 'acl_location' => '.admin',
- 'menu_selection' =>
'admin::rental::composite_standard'
- );
- break;
- case 'responsibility_unit':
- $info = array
- (
- 'table' =>
'rental_contract_responsibility_unit',
- 'id' => array('name' => 'id',
'type' => 'int'),
- 'fields' => array
- (
- array
- (
- 'name' =>
'name',
- 'descr' =>
lang('name'),
- 'type' =>
'varchar'
- ),
- ),
- 'edit_msg' => lang('edit unit'),
- 'add_msg' => lang('add unit'),
- 'name' => lang('unit'),
- 'acl_app' => 'rental',
- 'acl_location' => '.admin',
- 'menu_selection' =>
'admin::rental::responsibility_unit'
- );
- break;
-// END RENTAL TABLES
default:
$message = lang('ERROR: illegal type
%1', $type);
Modified: branches/Version-2_0-branch/property/inc/soap_client/bra5/soap.php
===================================================================
--- branches/Version-2_0-branch/property/inc/soap_client/bra5/soap.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/property/inc/soap_client/bra5/soap.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -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;
Copied: branches/Version-2_0-branch/rental/inc/class.bogeneric.inc.php (from
rev 15787, trunk/rental/inc/class.bogeneric.inc.php)
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.bogeneric.inc.php
(rev 0)
+++ branches/Version-2_0-branch/rental/inc/class.bogeneric.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -0,0 +1,37 @@
+<?php
+/**
+ * phpGroupWare - rental: a part of a Facilities Management System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 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
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/ and Nordlandssykehuset
+ * @package rental
+ * @subpackage application
+ * @version $Id: $
+ */
+ phpgw::import_class('property.bogeneric');
+
+ class rental_bogeneric extends property_bogeneric
+ {
+ public function __construct()
+ {
+ parent::__construct();
+ }
+ }
\ No newline at end of file
Modified: branches/Version-2_0-branch/rental/inc/class.menu.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.menu.inc.php 2016-10-03
08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/inc/class.menu.inc.php 2016-10-03
08:36:54 UTC (rev 15788)
@@ -175,22 +175,28 @@
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'preferences.uiadmin_acl.list_acl',
'acl_app' => 'rental'))
),
+ 'composite_type' => array
+ (
+ 'text' => lang('composite type'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uigeneric.index',
+ 'type' => 'composite_type',
'admin' => true))
+ ),
'composite_standard' => array
(
'text' => lang('composite standard'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index',
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uigeneric.index',
'type' => 'composite_standard',
'admin' => true))
),
'location_factor' => array
(
'text' => lang('location factor'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index',
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uigeneric.index',
'type' => 'location_factor',
'admin' => true))
),
'responsibility_unit' => array
(
'text' => lang('responsibility'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index',
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uigeneric.index',
'type' =>
'responsibility_unit', 'admin' => true))
),
'import' => array
Modified: branches/Version-2_0-branch/rental/inc/class.socomposite.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.socomposite.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/inc/class.socomposite.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -184,6 +184,11 @@
$filter_clauses[] = "application_id =
{$this->marshal($filters['application_id'], 'int')}";
}
+ if (isset($filters['composite_type_id']))
+ {
+ $filter_clauses[] =
"rental_composite.composite_type_id =
{$this->marshal($filters['composite_type_id'], 'int')}";
+ }
+
if (isset($filters[$this->get_id_field_name()]))
{
$filter_clauses[] = "rental_composite.id =
{$this->marshal($filters[$this->get_id_field_name()], 'int')}";
@@ -231,7 +236,7 @@
rental_composite.has_custom_address,
rental_composite.address_1, rental_composite.house_number,
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.furnish_type_id,
rental_composite.standard_id,rental_composite.composite_type_id,
rental_composite.part_of_town_id,
rental_composite.custom_prize_factor,";
$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, ";
@@ -308,6 +313,7 @@
$composite->set_area($this->unmarshal($this->db->f('area', true), 'float'));
$composite->set_furnish_type_id($this->unmarshal($this->db->f('furnish_type_id'),
'int'));
$composite->set_standard_id($this->unmarshal($this->db->f('standard_id'),
'int'));
+
$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'));
}
@@ -452,6 +458,7 @@
'area = ' .
$this->marshal($composite->get_area(), 'float'),
'furnish_type_id = ' .
$composite->get_furnish_type_id(),
'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() . '\''
);
@@ -473,7 +480,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', 'part_of_town_id',
'custom_prize_factor');
+ 'standard_id','composite_type_id',
'part_of_town_id', 'custom_prize_factor');
$values = array(
"'" . $composite->get_name() . "'",
"'" . $composite->get_description() . "'",
@@ -487,6 +494,7 @@
$this->marshal($composite->get_area(), 'float'),
$composite->get_furnish_type_id(),
$composite->get_standard_id(),
+ $composite->get_composite_type_id(),
$composite->get_part_of_town_id(),
$composite->get_custom_prize_factor()
);
Modified:
branches/Version-2_0-branch/rental/inc/class.socontract_price_item.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.socontract_price_item.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/inc/class.socontract_price_item.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -305,14 +305,14 @@
$custom_factor =
$composite_obj->get_custom_prize_factor();
$custom_factor = $custom_factor ? (float)$custom_factor
: 1;
- $location_info = ExecMethod('property.bogeneric.read',
array(
+ $location_info = ExecMethod('rental.bogeneric.read',
array(
'location_info'=> array('type' =>
'location_factor'),
'custom_filter' => array('part_of_town_id = ' .
(int)$composite_obj->get_part_of_town_id())
)
);
$location_factor =
(float)abs($location_info[0]['factor']) > 0 ?
(float)$location_info[0]['factor'] : 1;
- $standard_info =
ExecMethod('property.bogeneric.read_single', array('type' =>
'composite_standard', 'id' => $composite_obj->get_standard_id()));
+ $standard_info =
ExecMethod('rental.bogeneric.read_single', array('type' =>
'composite_standard', 'id' => $composite_obj->get_standard_id()));
$standard_factor = (float)abs($standard_info['factor'])
> 0 ? (float)$standard_info['factor'] : 1;
$factor = $location_factor * $standard_factor *
$custom_factor;
Copied: branches/Version-2_0-branch/rental/inc/class.sogeneric.inc.php (from
rev 15787, trunk/rental/inc/class.sogeneric.inc.php)
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.sogeneric.inc.php
(rev 0)
+++ branches/Version-2_0-branch/rental/inc/class.sogeneric.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -0,0 +1,183 @@
+<?php
+/**
+ * phpGroupWare - rental: a part of a Facilities Management System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 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
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/ and Nordlandssykehuset
+ * @package rental
+ * @subpackage application
+ * @version $Id: $
+ */
+ phpgw::import_class('property.sogeneric_');
+
+ class rental_sogeneric extends property_sogeneric_
+ {
+ function __construct( $type = '', $type_id = 0 )
+ {
+ parent::__construct($type, $type_id);
+ }
+
+ public function get_location_info( $type, $type_id )
+ {
+
+ $type_id = (int)$type_id;
+ $this->type = $type;
+ $this->type_id = $type_id;
+ $info = array();
+
+ if (!$type)
+ {
+ return $info;
+ }
+
+ switch ($type)
+ {
+// START RENTAL TABLES
+ case 'location_factor':
+ $info = array
+ (
+ 'table' =>
'rental_location_factor',
+ 'id' => array('name' => 'id',
'type' => 'auto'),
+ 'fields' => array(
+ array(
+ 'name' =>
'part_of_town_id',
+ 'descr' =>
lang('location'),
+ 'type' =>
'select',
+ 'nullable' =>
false,
+ 'filter' =>
true,
+ 'values_def' =>
array(
+
'valueset' => false,
+
'get_single_value' => 'property.sogeneric.get_name',
+
'method' => 'property.bogeneric.get_list',
+
'method_input' => array('type' => 'part_of_town', 'selected' =>
'##part_of_town_id##')
+ )
+ ),
+ array(
+ 'name' =>
'factor',
+ 'descr' =>
lang('factor'),
+ 'type' =>
'numeric',
+ 'nullable' =>
false,
+ 'size' => 4,
+ 'sortable' =>
true
+ ),
+ array(
+ 'name' =>
'remark',
+ 'descr' =>
lang('remark'),
+ 'type' => 'text'
+ )
+ ),
+ 'edit_msg' => lang('edit unit'),
+ 'add_msg' => lang('add unit'),
+ 'name' => lang('unit'),
+ 'acl_app' => 'rental',
+ 'acl_location' => '.admin',
+ 'menu_selection' =>
'admin::rental::location_factor',
+ 'default' => array(
+ 'user_id' =>
array('add' => '$this->account'),
+ 'entry_date' =>
array('add' => 'time()'),
+ 'modified_date' =>
array('edit' => 'time()'),
+ )
+ );
+ break;
+ case 'composite_standard':
+ $info = array
+ (
+ 'table' =>
'rental_composite_standard',
+ 'id' => array('name' => 'id',
'type' => 'int'),
+ 'fields' => array
+ (
+ array
+ (
+ 'name' =>
'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ ),
+ array
+ (
+ 'name' =>
'factor',
+ 'descr' =>
lang('factor'),
+ 'type' =>
'numeric',
+ 'nullable' =>
false,
+ 'size' => 4,
+ 'sortable' =>
true
+ )
+ ),
+ 'edit_msg' => lang('edit unit'),
+ 'add_msg' => lang('add unit'),
+ 'name' => lang('unit'),
+ 'acl_app' => 'rental',
+ 'acl_location' => '.admin',
+ 'menu_selection' =>
'admin::rental::composite_standard'
+ );
+ break;
+ case 'responsibility_unit':
+ $info = array
+ (
+ 'table' =>
'rental_contract_responsibility_unit',
+ 'id' => array('name' => 'id',
'type' => 'int'),
+ 'fields' => array
+ (
+ array
+ (
+ 'name' =>
'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ ),
+ ),
+ 'edit_msg' => lang('edit unit'),
+ 'add_msg' => lang('add unit'),
+ 'name' => lang('unit'),
+ 'acl_app' => 'rental',
+ 'acl_location' => '.admin',
+ 'menu_selection' =>
'admin::rental::responsibility_unit'
+ );
+ break;
+ case 'composite_type':
+ $info = array
+ (
+ 'table' =>
'rental_composite_type',
+ 'id' => array('name' => 'id',
'type' => 'int'),
+ 'fields' => array(
+ array(
+ 'name' =>
'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ )
+ ),
+ 'edit_msg' => lang('edit type'),
+ 'add_msg' => lang('add type'),
+ 'name' => lang('type'),
+ 'acl_app' => 'rental',
+ 'acl_location' => '.admin',
+ 'menu_selection' =>
'admin::rental::composite_type'
+ );
+ break;
+// END RENTAL TABLES
+
+ default:
+ $message = lang('ERROR: illegal type
%1', $type);
+ phpgwapi_cache::message_set($message,
'error');
+ }
+
+ $this->location_info = $info;
+ return $info;
+ }
+ }
\ No newline at end of file
Modified: branches/Version-2_0-branch/rental/inc/class.soprice_item.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.soprice_item.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/inc/class.soprice_item.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -389,13 +389,13 @@
{
$custom_factor =
$composite_obj->get_custom_prize_factor();
$custom_factor = $custom_factor ?
(float)$custom_factor : 1;
- $location_info =
ExecMethod('property.bogeneric.read', array(
+ $location_info =
ExecMethod('rental.bogeneric.read', array(
'location_info'=> array('type' =>
'location_factor'),
'custom_filter' =>
array('part_of_town_id = ' . (int)$composite_obj->get_part_of_town_id())
)
);
$location_factor =
(float)abs($location_info[0]['factor']) > 0 ?
(float)$location_info[0]['factor'] : 1;
- $standard_info =
ExecMethod('property.bogeneric.read_single', array('type' =>
'composite_standard', 'id' => $composite_obj->get_standard_id()));
+ $standard_info =
ExecMethod('rental.bogeneric.read_single', array('type' =>
'composite_standard', 'id' => $composite_obj->get_standard_id()));
$standard_factor =
(float)abs($standard_info['factor']) > 0 ? (float)$standard_info['factor'] : 1;
}
Modified: branches/Version-2_0-branch/rental/inc/class.uiapplication.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.uiapplication.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/inc/class.uiapplication.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -50,6 +50,7 @@
$fields,
$composite_types,
$payment_methods;
+ private $bo;
public function __construct()
{
@@ -69,6 +70,27 @@
$this->fields = rental_application::get_fields();
}
+ private function get_composite_type_options( $selected = 0 )
+ {
+ $type_options = array();
+ $type_list = execMethod('rental.bogeneric.get_list',
array('type' => 'composite_type'));
+
+ $type_options[] = array(
+ 'id' => '',
+ 'name' => lang('select')
+ );
+
+ foreach ($type_list as $type)
+ {
+ $type_options[] = array(
+ 'id' => $type['id'],
+ 'name' => $type['name'],
+ 'selected' => $type['id'] == $selected
? 1 : 0
+ );
+ }
+ return $type_options;
+ }
+
private function get_status_options( $selected = 0 )
{
$status_options = array();
@@ -143,6 +165,12 @@
'text' =>
lang('status'),
'list' =>
$status_options
),
+ array(
+ 'type' =>
'filter',
+ 'name' =>
'filter_composite_type_id',
+ 'text' =>
lang('composite type'),
+ 'list' =>
$this->get_composite_type_options()
+ ),
array('type' =>
'autocomplete',
'name' =>
'ecodimb',
'app' =>
'property',
@@ -284,10 +312,10 @@
$bocommon = CreateObject('property.bocommon');
- $GLOBALS['phpgw']->jqcal->add_listener('date_start');
- $GLOBALS['phpgw']->jqcal->add_listener('date_end');
-
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_start');
-
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_end');
+
$GLOBALS['phpgw']->jqcal->add_listener('date_start','datetime');
+
$GLOBALS['phpgw']->jqcal->add_listener('date_end','datetime');
+
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_start','datetime');
+
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_end','datetime');
$accounts =
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT,
$this->acl_location, 'rental');
$executive_officer_options[] = array('id' => '', 'name'
=> lang('nobody'), 'selected' => 0);
@@ -324,11 +352,20 @@
)
);
+ if(!$application->assign_date_start &&
$application->date_start)
+ {
+ $application->assign_date_start =
$application->date_start;
+ }
+ if(!$application->assign_date_end &&
$application->date_end)
+ {
+ $application->assign_date_end =
$application->date_end;
+ }
+
$data = array(
'datatable_def' => $datatable_def,
'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uiapplication.save')),
'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uiapplication.index',)),
- 'application' => $application,//->toArray(),
+ 'application' => $application,
'list_executive_officer' => array('options' =>
$executive_officer_options),
'step' => $step,
'value_ecodimb_descr' =>
ExecMethod('property.bogeneric.get_single_attrib_value', array(
@@ -337,7 +374,7 @@
'attrib_name' => 'descr')
),
'district_list' => array('options' =>
$bocommon->select_district_list('', $application->district_id)),
- 'composite_type_list' => array('options' =>
$bocommon->select_list($application->composite_type_id, $composite_types)),
+ 'composite_type_list' => array('options' =>
$this->get_composite_type_options($application->composite_type_id)),
'payment_method_list' => array('options' =>
$bocommon->select_list($application->payment_method, $payment_methods)),
'status_list' => array('options' =>
$this->get_status_options($application->status)),
'mode' => $mode,
@@ -358,11 +395,15 @@
$editable = phpgw::get_var('editable', 'bool');
$type = 'all_composites';
-// $filters = rental_uicomposite::get_filters();
$filters = ExecMethod('rental.uicomposite.get_filters');
- foreach ($filters as $k1 => $filter)
+ foreach ($filters as $k1 => &$filter)
{
+ if ($filter['name'] == 'district_id')
+ {
+ unset($filters[$k1]);
+ continue;
+ }
if ($filter['name'] == 'has_contract')
{
foreach ($filter['list'] as $k2 =>
$option)
@@ -631,7 +672,7 @@
foreach ($applications['results'] as $key =>
&$application)
{
$application['status'] =
$status_text[$application['status']];
- $application['composite_type'] =
$this->composite_types[$application['composite_type']];
+ $application['composite_type'] =
$this->composite_types[$application['composite_type_id']];
$application['entry_date'] =
$GLOBALS['phpgw']->common->show_date($application['entry_date']);
$application['assign_date_start'] =
$GLOBALS['phpgw']->common->show_date($application['assign_date_start'],
$dateformat);
Modified: branches/Version-2_0-branch/rental/inc/class.uicomposite.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.uicomposite.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/inc/class.uicomposite.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -196,10 +196,16 @@
phpgwapi_cache::session_set('rental',
'composite_status', phpgw::get_var('is_active'));
phpgwapi_cache::session_set('rental',
'composite_status_contract', phpgw::get_var('has_contract'));
phpgwapi_cache::session_set('rental',
'composite_furnished_status', phpgw::get_var('furnished_status'));
- $filters = array('furnished_status' =>
phpgw::get_var('furnished_status'),
- 'is_active' =>
phpgw::get_var('is_active'), 'is_vacant' => phpgw::get_var('occupancy'),
- 'has_contract' =>
phpgw::get_var('has_contract'), 'availability_date_from' =>
phpgw::get_var('availability_date_from'),
- 'availability_date_to' =>
phpgw::get_var('availability_date_to'), 'district_id' => $district_id);
+ $filters = array(
+ 'furnished_status' =>
phpgw::get_var('furnished_status'),
+ 'is_active' =>
phpgw::get_var('is_active'),
+ 'is_vacant' =>
phpgw::get_var('occupancy'),
+ 'has_contract' =>
phpgw::get_var('has_contract'),
+ 'availability_date_from' =>
phpgw::get_var('availability_date_from'),
+ 'availability_date_to' =>
phpgw::get_var('availability_date_to'),
+ 'district_id' => $district_id,
+ 'composite_type_id' =>
phpgw::get_var('composite_type_id', 'int'),
+ );
if ($application_id > 0)
{
$filters['application_id'] =
$application_id;
@@ -966,6 +972,20 @@
$composite_standard_options[] = array('id' =>
$composite_standard['id'], 'name' => $composite_standard['name'],
'selected' => $selected);
}
+ $composite_type_name = '';
+ $cur_type_id = $composite->get_composite_type_id();
+ $composite_type_arr =
$composite->get_types($cur_type_id);
+ $composite_type_options = array();
+ foreach ($composite_type_arr as $composite_type)
+ {
+ $selected = ($composite_type['selected']) ? 1 :
0;
+ if ($selected)
+ {
+ $composite_type_name =
$composite_type['name'];
+ }
+ $composite_type_options[] = array('id' =>
$composite_type['id'], 'name' => $composite_type['name'],
+ 'selected' => $selected);
+ }
$furnish_type_name = '';
$furnish_types_arr = $composite->get_furnish_types();
@@ -1001,6 +1021,8 @@
'value_name' => $composite->get_name(),
'value_composite_standard_name' =>
$composite_standard_name,
'list_composite_standard' => array('options' =>
$composite_standard_options),
+ 'value_composite_type_name' =>
$composite_type_name,
+ 'list_composite_type' => array('options' =>
$composite_type_options),
'value_furnish_type_name' => $furnish_type_name,
'list_furnish_type' => array('options' =>
$furnish_types_options),
'contract_furnished_status' =>
!empty($this->config->config_data['contract_furnished_status']),
@@ -1069,6 +1091,7 @@
$composite->set_description(phpgw::get_var('description'));
$composite->set_furnish_type_id(phpgw::get_var('furnish_type_id'));
$composite->set_standard_id(phpgw::get_var('composite_standard_id', 'int'));
+
$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'));
Modified: branches/Version-2_0-branch/rental/inc/class.uicontract.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.uicontract.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/inc/class.uicontract.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -576,7 +576,7 @@
"
);
/*
- $sogeneric = CreateObject('property.sogeneric',
'composite_standard');
+ $sogeneric = CreateObject('rental.sogeneric',
'composite_standard');
$composite_standards =
$sogeneric->read(array('allrows' => true));
foreach ($composite_standards as
$composite_standard)
{
Copied: branches/Version-2_0-branch/rental/inc/class.uigeneric.inc.php (from
rev 15787, trunk/rental/inc/class.uigeneric.inc.php)
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.uigeneric.inc.php
(rev 0)
+++ branches/Version-2_0-branch/rental/inc/class.uigeneric.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -0,0 +1,37 @@
+<?php
+/**
+ * phpGroupWare - rental: a part of a Facilities Management System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 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
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/ and Nordlandssykehuset
+ * @package rental
+ * @subpackage application
+ * @version $Id: $
+ */
+ phpgw::import_class('property.uigeneric');
+
+ class rental_uigeneric extends property_uigeneric
+ {
+ public function __construct()
+ {
+ parent::__construct();
+ }
+ }
\ No newline at end of file
Modified: branches/Version-2_0-branch/rental/inc/class.uiprice_item.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.uiprice_item.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/inc/class.uiprice_item.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -550,7 +550,7 @@
$value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'rental.uicontract.add_price_item', 'price_item_id' => $value['id'],
'contract_id' => $contract_id)));
$value['labels'][] = lang('add');
- $sogeneric =
CreateObject('property.sogeneric','composite_standard');
+ $sogeneric =
CreateObject('rental.sogeneric','composite_standard');
$composite_standards = $sogeneric->read(array('allrows' =>
true));
foreach($composite_standards as $composite_standard)
{
Modified:
branches/Version-2_0-branch/rental/inc/model/class.agresso_gl07.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/model/class.agresso_gl07.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/inc/model/class.agresso_gl07.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -61,7 +61,7 @@
static $responsibility_check = array();
if(!$responsibility_arr)
{
- $responsibility_arr =
execMethod('property.bogeneric.get_list',array('type' =>
'responsibility_unit'));
+ $responsibility_arr =
execMethod('rental.bogeneric.get_list',array('type' => 'responsibility_unit'));
foreach ($responsibility_arr as $responsibility_entry)
{
$responsibility_check[$responsibility_entry['id']] =
true;
Modified: branches/Version-2_0-branch/rental/inc/model/class.composite.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/model/class.composite.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/inc/model/class.composite.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -25,6 +25,7 @@
protected $status;
protected $furnish_type_id;
protected $standard_id;
+ protected $composite_type_id;
protected $units;
protected $contracts;
protected $part_of_town_id;
@@ -354,7 +355,6 @@
public function set_standard_id( $standard_id )
{
-// _debug_array($standard_id);die();
$this->standard_id = (int)$standard_id;
}
@@ -362,14 +362,23 @@
{
return (int)$this->standard_id;
}
+ public function set_composite_type_id( $composite_type_id )
+ {
+ $this->composite_type_id = (int)$composite_type_id;
+ }
+ public function get_composite_type_id()
+ {
+ return (int)$this->composite_type_id;
+ }
+
/**
* Fetch composite standards on the form array(array('id' => 1,
'name' => 'some text', 'selected' => 1|0))
* @return array
*/
public function get_standards( $selected )
{
- if ($composite_standards =
execMethod('property.bogeneric.get_list', array('type' => 'composite_standard',
+ if ($composite_standards =
execMethod('rental.bogeneric.get_list', array('type' => 'composite_standard',
'selected' => $selected)))
{
array_unshift($composite_standards, array('id'
=> '', 'name' => lang('none')));
@@ -377,6 +386,20 @@
return $composite_standards;
}
+ /**
+ * Fetch composite types on the form array(array('id' => 1,
'name' => 'some text', 'selected' => 1|0))
+ * @return array
+ */
+ public function get_types( $selected )
+ {
+ if ($composite_types =
execMethod('rental.bogeneric.get_list', array('type' => 'composite_type',
+ 'selected' => $selected)))
+ {
+ array_unshift($composite_types, array('id' =>
'', 'name' => lang('none')));
+ }
+ return $composite_types;
+ }
+
public function set_area( $area )
{
$this->area = $area;
@@ -484,6 +507,7 @@
'contracts' => $contract_dates,
'furnished_status' => $this->get_furnish_type(),
'standard_id' => $this->get_standard_id(),
+ '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(),
);
Modified: branches/Version-2_0-branch/rental/inc/model/class.contract.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/model/class.contract.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/inc/model/class.contract.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -1187,7 +1187,7 @@
*/
public function get_responsibility_arr( $selected )
{
- if ($responsibility_arr =
execMethod('property.bogeneric.get_list', array('type' => 'responsibility_unit',
+ if ($responsibility_arr =
execMethod('rental.bogeneric.get_list', array('type' => 'responsibility_unit',
'selected' => $selected)))
{
array_unshift($responsibility_arr, array('id'
=> '', 'name' => lang('none')));
Modified: branches/Version-2_0-branch/rental/inc/model/class.model.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/model/class.model.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/inc/model/class.model.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -234,11 +234,12 @@
return $rental_item_arr;
}
+
function validate( )
{
$errors = array();
$this->preValidate( $this );
- $this->_validate( $this, $errors);
+ $this->_validate( $this, array(), $errors);
$this->doValidate( $this, $errors);
foreach ($errors as $key => $message)
{
@@ -263,9 +264,12 @@
}
- private function _validate( $entity, array &$errors )
+ private function _validate( $entity, array $fields, array
&$errors )
{
- $fields = $this->get_fields();
+ if(!$fields)
+ {
+ $fields = $this->get_fields();
+ }
foreach ($fields as $field => $params)
{
if (!is_array($params))
@@ -289,7 +293,8 @@
foreach ($value as $key =>
$sub_entity)
{
$this->_validate(
-
(array)$sub_entity, (array)$params['manytomany']['column'], $errors,
sprintf('%s%s[%s]', $field_prefix, empty($field_prefix) ? $field :
"[{$field}]", (is_string($key) ? $key : $sub_entity_count))
+//
(array)$sub_entity, (array)$params['manytomany']['column'], $errors,
sprintf('%s%s[%s]', $field_prefix, empty($field_prefix) ? $field :
"[{$field}]", (is_string($key) ? $key : $sub_entity_count))
+
(array)$sub_entity, (array)$params['manytomany']['column'], $errors
);
$sub_entity_count++;
}
Modified: branches/Version-2_0-branch/rental/setup/default_records.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/setup/default_records.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/setup/default_records.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -275,3 +275,7 @@
array('day' => "*/1"), 'rental_run_adjustments',
'rental.soadjustment.run_adjustments', null
);
+ $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
rental_composite_type"
+ . " (id, name) VALUES (1, 'Type 1' )", __LINE__,
__FILE__);
+ $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
rental_composite_type"
+ . " (id, name) VALUES (2, 'Type 2' )", __LINE__,
__FILE__);
Modified: branches/Version-2_0-branch/rental/setup/phpgw_no.lang
===================================================================
--- branches/Version-2_0-branch/rental/setup/phpgw_no.lang 2016-10-03
08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/setup/phpgw_no.lang 2016-10-03
08:36:54 UTC (rev 15788)
@@ -635,4 +635,6 @@
approved rental no Godkjent
location rental no Lokalisering
custom prize factor rental no Prisfaktor
-standard rental no Standard
\ No newline at end of file
+standard rental no Standard
+composite type rental no Leieobjekt type
+type rental no Type
\ No newline at end of file
Modified: branches/Version-2_0-branch/rental/setup/setup.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/setup/setup.inc.php 2016-10-03
08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/setup/setup.inc.php 2016-10-03
08:36:54 UTC (rev 15788)
@@ -1,6 +1,6 @@
<?php
$setup_info['rental']['name'] = 'rental'; // Module identifier
- $setup_info['rental']['version'] = '0.1.0.28'; // Current module version
+ $setup_info['rental']['version'] = '0.1.0.29'; // Current module version
$setup_info['rental']['app_order'] = 51; // (?)
$setup_info['rental']['tables'] = array(
'rental_party', // All contract participants, tenants etc.
@@ -9,6 +9,7 @@
'rental_contract_party', // Connection between tenants and
contracts
'rental_composite', // Rental object, an aggregation of rental
units
'rental_location_factor', // for location based prizing
+ 'rental_composite_type', // classification
'rental_composite_standard', // Optional standard classes
'rental_contract_price_item', // Price items from the price
book tied to a contract
'rental_contract_responsibility_unit', // optional list of
candidates
Modified: branches/Version-2_0-branch/rental/setup/tables_current.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/setup/tables_current.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/setup/tables_current.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -26,6 +26,7 @@
'has_custom_address' => array('type' => 'bool',
'nullable' => false, 'default' => 'false'),
'object_type_id' => array('type' => 'int',
'precision' => 2, 'nullable' => true,
'default' => null),
+ 'composite_type_id' => array('type' => 'int',
'precision' => 2, 'nullable' => true,'default' => 1),
'area' => array('type' => 'decimal',
'precision' => '20', 'scale' => '2', 'nullable' => true),
'furnish_type_id' => array('type' => 'int',
'precision' => 4, 'nullable' => true),
'standard_id' => array('type' => 'int',
'precision' => 4, 'nullable' => true),
@@ -63,6 +64,16 @@
'ix' => array(),
'uc' => array()
),
+ 'rental_composite_type' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'int', 'precision' =>
4, 'nullable' => false),
+ 'name' => array('type' => 'varchar',
'precision' => '255', 'nullable' => false),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
'rental_unit' => array(
'fd' => array(
'id' => array('type' => 'auto', 'nullable' =>
false),
Modified: branches/Version-2_0-branch/rental/setup/tables_update.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/setup/tables_update.inc.php
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/setup/tables_update.inc.php
2016-10-03 08:36:54 UTC (rev 15788)
@@ -657,3 +657,41 @@
}
}
+ $test[] = '0.1.0.28';
+ function rental_upgrade0_1_0_28()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+ $GLOBALS['phpgw_setup']->oProc->AddColumn('rental_composite',
'composite_type_id', array(
+ 'type' => 'int',
+ 'precision' => '2',
+ 'nullable' => true,
+ ));
+
+ $GLOBALS['phpgw_setup']->oProc->CreateTable(
+ 'rental_composite_type', array(
+ 'fd' => array(
+ 'id' => array('type' => 'int',
'precision' => 4, 'nullable' => false),
+ 'name' => array('type' => 'varchar',
'precision' => '255', 'nullable' => false),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ )
+ );
+
+ $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
rental_composite_type"
+ . " (id, name) VALUES (1, 'Type 1' )", __LINE__,
__FILE__);
+ $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
rental_composite_type"
+ . " (id, name) VALUES (2, 'Type 2' )", __LINE__,
__FILE__);
+
+ $GLOBALS['phpgw_setup']->oProc->query("UPDATE rental_composite
SET composite_type_id = 1", __LINE__, __FILE__);
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['rental']['currentver'] =
'0.1.0.29';
+ return $GLOBALS['setup_info']['rental']['currentver'];
+ }
+ }
+
Modified: branches/Version-2_0-branch/rental/templates/base/application.xsl
===================================================================
--- branches/Version-2_0-branch/rental/templates/base/application.xsl
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/templates/base/application.xsl
2016-10-03 08:36:54 UTC (rev 15788)
@@ -10,7 +10,6 @@
</xsl:when>
<xsl:when test="adjustment_price">
<xsl:apply-templates select="adjustment_price" />
-
</xsl:when>
</xsl:choose>
@@ -20,6 +19,7 @@
<xsl:template xmlns:php="http://php.net/xsl" match="edit">
<xsl:variable name="date_format">
<xsl:value-of select="php:function('get_phpgw_info',
'user|preferences|common|dateformat')" />
+ <xsl:text> H:m</xsl:text>
</xsl:variable>
<div>
@@ -36,7 +36,7 @@
<input type="hidden" id="active_tab"
name="active_tab" value="{value_active_tab}"/>
<div id="application">
<fieldset>
- <xsl:if test="application/id !=
''">
+ <xsl:if test="application/id >
0">
<div
class="pure-control-group">
<label>
<xsl:value-of select="php:function('lang', 'id')"/>
@@ -74,7 +74,7 @@
<xsl:value-of
select="$lang_district"/>
</label>
- <select
name="district_id">
+ <select
id="district_id" name="district_id">
<xsl:attribute
name="title">
<xsl:value-of select="$lang_district"/>
</xsl:attribute>
@@ -98,7 +98,7 @@
<xsl:value-of
select="$lang_composite_type"/>
</label>
- <select
name="composite_type_id">
+ <select
id="composite_type_id" name="composite_type_id">
<xsl:attribute
name="title">
<xsl:value-of select="$lang_composite_type"/>
</xsl:attribute>
@@ -108,9 +108,6 @@
<xsl:attribute
name="data-validation-error-msg">
<xsl:value-of select="$lang_composite_type"/>
</xsl:attribute>
- <option
value="">
-
<xsl:value-of select="$lang_composite_type"/>
- </option>
<xsl:apply-templates select="composite_type_list/options"/>
</select>
</div>
@@ -121,7 +118,7 @@
<label>
<xsl:value-of
select="$lang_date_start"/>
</label>
- <input type="text"
id="date_start" name="date_start" size="10" readonly="readonly">
+ <input type="text"
id="date_start" name="date_start" readonly="readonly" size="16">
<xsl:if
test="application/date_start != 0 and application/date_start != ''">
<xsl:attribute name="value">
<xsl:value-of select="php:function('date', $date_format,
number(application/date_start))"/>
@@ -143,7 +140,7 @@
<label>
<xsl:value-of
select="$lang_date_end"/>
</label>
- <input type="text"
id="date_end" name="date_end" size="10" readonly="readonly">
+ <input type="text"
id="date_end" name="date_end" size="16" readonly="readonly">
<xsl:if
test="application/date_end != 0 and application/date_end != ''">
<xsl:attribute name="value">
<xsl:value-of select="php:function('date', $date_format,
number(application/date_end))"/>
@@ -338,7 +335,7 @@
<label>
<xsl:value-of select="$lang_date_start"/>
</label>
- <input
type="text" id="assign_date_start" name="assign_date_start" size="10"
readonly="readonly">
+ <input
type="text" id="assign_date_start" name="assign_date_start" size="16"
readonly="readonly">
<xsl:if
test="application/assign_date_start != 0 and application/assign_date_start !=
''">
<xsl:attribute name="value">
<xsl:value-of select="php:function('date', $date_format,
number(application/assign_date_start))"/>
@@ -352,6 +349,9 @@
</xsl:attribute-->
</input>
+ <xsl:text> [
</xsl:text>
+ <xsl:value-of
select="php:function('date', $date_format, number(application/date_start))"/>
+ <xsl:text>
]</xsl:text>
</div>
<div
class="pure-control-group">
<xsl:variable
name="lang_date_end">
@@ -360,7 +360,7 @@
<label>
<xsl:value-of select="$lang_date_end"/>
</label>
- <input
type="text" id="assign_date_end" name="assign_date_end" size="10"
readonly="readonly">
+ <input
type="text" id="assign_date_end" name="assign_date_end" size="16"
readonly="readonly">
<xsl:if
test="application/assign_date_end != 0 and application/assign_date_end != ''">
<xsl:attribute name="value">
<xsl:value-of select="php:function('date', $date_format,
number(application/assign_date_end))"/>
@@ -374,6 +374,9 @@
</xsl:attribute-->
</input>
+ <xsl:text> [
</xsl:text>
+ <xsl:value-of
select="php:function('date', $date_format, number(application/date_end))"/>
+ <xsl:text>
]</xsl:text>
</div>
<div
class="pure-control-group">
<xsl:variable
name="lang_status">
@@ -452,6 +455,8 @@
schedule.params.length = $('#cboNObjects').val();
schedule.params.search = $('#txtSearchSchedule').val();
schedule.params.start = 0;
+
schedule.params.district_id = $('#district_id').val();
+
schedule.params.composite_type_id = $('#composite_type_id').val();
schedule.params.availability_date_from = "";
schedule.params.availability_date_to = "";
@@ -495,24 +500,30 @@
$("#cal_container #datepicker").datepicker("setDate", parseISO8601(state));
}
schedule.toolbar = <xsl:value-of select="schedule/toolbar" />;
-
+
$('#date_start').datepicker("option", "onSelect", function (a, e) {
console.log(a);
var adstart_date = a.substr(6,4) + "-" + a.substr(3,2) + "-" + a.substr(0,2);
-
schedule.params.availability_date_from = adstart_date;
-
schedule.rental.availability_from = new Date(adstart_date);
-
schedule.date = parseISO8601(adstart_date);
-
$("#cal_container #datepicker").datepicker( "option", "minDate", adstart_date );
-
schedule.updateSchedule(schedule.date);
+
if(a)
+
{
+
schedule.params.availability_date_from = adstart_date;
+
schedule.rental.availability_from = new Date(adstart_date);
+
schedule.date = parseISO8601(adstart_date);
+
$("#cal_container #datepicker").datepicker( "option", "minDate",
adstart_date );
+
schedule.updateSchedule(schedule.date);
+
}
});
$('#date_end').datepicker("option", "onSelect", function (a, e) {
console.log(a);
-
var adstart_end = a.substr(6,4) + "-" + a.substr(3,2) + "-" + a.substr(0,2);
-
schedule.params.availability_date_to = adstart_end;
-
schedule.rental.availability_to = new Date(adend_date);
-
$("#cal_container #datepicker").datepicker( "option", "maxDate", adstart_end );
-
schedule.updateSchedule(schedule.date);
+
if(a)
+
{
+
var adstart_end = a.substr(6,4) + "-" + a.substr(3,2) + "-" +
a.substr(0,2);
+
schedule.params.availability_date_to = adstart_end;
+
schedule.rental.availability_to = new Date(adend_date);
+
$("#cal_container #datepicker").datepicker( "option", "maxDate",
adstart_end );
+
schedule.updateSchedule(schedule.date);
+
}
});
composites.rental = {};
Modified: branches/Version-2_0-branch/rental/templates/base/composite.xsl
===================================================================
--- branches/Version-2_0-branch/rental/templates/base/composite.xsl
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/templates/base/composite.xsl
2016-10-03 08:36:54 UTC (rev 15788)
@@ -97,6 +97,16 @@
</div>
<div
class="pure-control-group">
<label>
+
<xsl:value-of select="php:function('lang', 'composite type')"/>
+ </label>
+ <xsl:if
test="count(//list_composite_type/options) > 0">
+ <select
id="composite_type_id" name="composite_type_id">
+
<xsl:apply-templates select="list_composite_type/options"/>
+
</select>
+ </xsl:if>
+ </div>
+ <div
class="pure-control-group">
+ <label>
<xsl:value-of select="php:function('lang', 'furnish_type')"/>
</label>
<select
id="furnish_type_id" name="furnish_type_id">
@@ -399,6 +409,12 @@
</div>
<div class="pure-control-group">
<label>
+ <xsl:value-of
select="php:function('lang', 'composite type')"/>
+ </label>
+ <xsl:value-of
select="value_composite_type_name"/>
+ </div>
+ <div class="pure-control-group">
+ <label>
<xsl:value-of
select="php:function('lang', 'furnish_type')"/>
</label>
<xsl:value-of
select="value_furnish_type_name"/>
Modified: branches/Version-2_0-branch/rental/templates/base/css/base.css
===================================================================
--- branches/Version-2_0-branch/rental/templates/base/css/base.css
2016-10-03 08:32:08 UTC (rev 15787)
+++ branches/Version-2_0-branch/rental/templates/base/css/base.css
2016-10-03 08:36:54 UTC (rev 15788)
@@ -495,7 +495,7 @@
}
#date_start, #date_end{
- width: 90px;
+/* width: 90px; */
}
input.email, input.url, #unit_leader{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15788] Stable: Merge 15768:15787 from trunk,
sigurdne <=