[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16882] Stable: Merge 16879:16881 from trunk
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16882] Stable: Merge 16879:16881 from trunk |
Date: |
Wed, 28 Jun 2017 06:50:06 -0400 (EDT) |
Revision: 16882
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16882
Author: sigurdne
Date: 2017-06-28 06:50:06 -0400 (Wed, 28 Jun 2017)
Log Message:
-----------
Stable: Merge 16879:16881 from trunk
Modified Paths:
--------------
branches/Version-2_0-branch/phpgwapi/inc/accounts/class.accounts_sql.inc.php
branches/Version-2_0-branch/property/inc/class.sodocument.inc.php
branches/Version-2_0-branch/property/inc/class.soreport.inc.php
Property Changed:
----------------
branches/Version-2_0-branch/
Index: branches/Version-2_0-branch
===================================================================
--- branches/Version-2_0-branch 2017-06-28 10:48:56 UTC (rev 16881)
+++ branches/Version-2_0-branch 2017-06-28 10:50:06 UTC (rev 16882)
Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
/branches/dev-syncromind:13653
/branches/dev-syncromind-2:14933-16846
/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,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240,16242,16244-16246,16248,16250-16251,16253-16255,16257-16259,16261,16263,16265,16267,16269-16276,16278,16280-16283,16285,16287-16288,16290,16292-16295,16297-16305,16307-16314,16316-16318,16320-16322,16324,16326-16330,16332,16334,16336,16338-16339,16341-16342,16344,16346,16348,16350,16352-16353,16355-16358,16360,16362,16364-16369,16371,16373,16375-16378,16380,16382-16383,16385,16387,16389,16391,16393-16395,16397,16399-16402,16404,16406,16408,16410-16415,16417,16419-16420,16422-16425,16427,16429-16440,16442,16444,16446,16448-16449,16451,16453,16455-16463,16465-16472,16474-16475,16477-16484,16486,16488,16490-16497,16499,16501-16503,16505-16512,16514-16517,16519,16521,16523,16525,16527-16532,16534,16536-16541,16543,16545-16554,16556,16558-16565,16567-16575,16577-16584,16586-16588,16590,16592-16593,16595-16596,16598,16600-16601,16603-16608,16610-16614,16616-16618,16620-16621,16623-16624,16626,16628,16630,16632-16638,16640,16642,16644,16646-16651,16653-16663,16665,16667,16669,16671,16673,16675,16677,16679-16680,16682,16684,16686,16688-16692,16694-16695,16697-16699,16701,16703,16705-16706,16708,16710,16712,16714,16716-16718,16720-16728,16730-16732,16734-16739,16741,16743-16746,16748-16750,16752-16755,16757,16759-16761,16763,16765,16767,16769-16774,16776,16778-16783,16785-16788,16790,16792,16794,16796-16802,16804-16807,16809,16811-16817,16819,16821-16825,16827-16831,16833,16835-16836,16838,16840-16844,16846-16847,16849,16851,16853-16854,16856-16859,16861,16863-16865,16867,16869-16871,16873,16875-16876,16878
\ No newline at end of property
+/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,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240,16242,16244-16246,16248,16250-16251,16253-16255,16257-16259,16261,16263,16265,16267,16269-16276,16278,16280-16283,16285,16287-16288,16290,16292-16295,16297-16305,16307-16314,16316-16318,16320-16322,16324,16326-16330,16332,16334,16336,16338-16339,16341-16342,16344,16346,16348,16350,16352-16353,16355-16358,16360,16362,16364-16369,16371,16373,16375-16378,16380,16382-16383,16385,16387,16389,16391,16393-16395,16397,16399-16402,16404,16406,16408,16410-16415,16417,16419-16420,16422-16425,16427,16429-16440,16442,16444,16446,16448-16449,16451,16453,16455-16463,16465-16472,16474-16475,16477-16484,16486,16488,16490-16497,16499,16501-16503,16505-16512,16514-16517,16519,16521,16523,16525,16527-16532,16534,16536-16541,16543,16545-16554,16556,16558-16565,16567-16575,16577-16584,16586-16588,16590,16592-16593,16595-16596,16598,16600-16601,16603-16608,16610-16614,16616-16618,16620-16621,16623-16624,16626,16628,16630,16632-16638,16640,16642,16644,16646-16651,16653-16663,16665,16667,16669,16671,16673,16675,16677,16679-16680,16682,16684,16686,16688-16692,16694-16695,16697-16699,16701,16703,16705-16706,16708,16710,16712,16714,16716-16718,16720-16728,16730-16732,16734-16739,16741,16743-16746,16748-16750,16752-16755,16757,16759-16761,16763,16765,16767,16769-16774,16776,16778-16783,16785-16788,16790,16792,16794,16796-16802,16804-16807,16809,16811-16817,16819,16821-16825,16827-16831,16833,16835-16836,16838,16840-16844,16846-16847,16849,16851,16853-16854,16856-16859,16861,16863-16865,16867,16869-16871,16873,16875-16876,16878,16880-16881
\ No newline at end of property
Modified:
branches/Version-2_0-branch/phpgwapi/inc/accounts/class.accounts_sql.inc.php
===================================================================
---
branches/Version-2_0-branch/phpgwapi/inc/accounts/class.accounts_sql.inc.php
2017-06-28 10:48:56 UTC (rev 16881)
+++
branches/Version-2_0-branch/phpgwapi/inc/accounts/class.accounts_sql.inc.php
2017-06-28 10:50:06 UTC (rev 16882)
@@ -503,7 +503,8 @@
if(strpos($query, ',' ))
{
- $whereclause .=
"account_lastname || ', ' || account_firstname $this->like '$query%')";
+ $whereclause .=
"account_lastname || ', ' || account_firstname $this->like '$query%'"
+ . " OR account_lastname
|| ',' || account_firstname $this->like '$query%')";
}
else
{
Modified: branches/Version-2_0-branch/property/inc/class.sodocument.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sodocument.inc.php
2017-06-28 10:48:56 UTC (rev 16881)
+++ branches/Version-2_0-branch/property/inc/class.sodocument.inc.php
2017-06-28 10:50:06 UTC (rev 16882)
@@ -199,6 +199,12 @@
$this->bocommon->fm_cache('sql_document_' .
$entity_id, $sql);
$this->uicols = $this->bocommon->uicols;
+
+ $this->uicols['input_type'][] = 'text';
+ $this->uicols['name'][] = 'doc_type';
+ $this->uicols['descr'][] = lang('category');
+ $this->uicols['statustext'][] =
lang('category');
+
$cols_return = $this->bocommon->cols_return;
$type_id = $this->bocommon->type_id;
$this->cols_extra = $this->bocommon->cols_extra;
@@ -388,7 +394,7 @@
. " $this->like '%$query%')";
}
- $sql = "SELECT fm_document.*, phpgw_categories.cat_name
as category FROM fm_document"
+ $sql = "SELECT DISTINCT fm_document.*,
phpgw_categories.cat_name as category FROM fm_document"
. " $this->join phpgw_categories on
fm_document.category = phpgw_categories.cat_id"
. " $filtermethod $querymethod";
Modified: branches/Version-2_0-branch/property/inc/class.soreport.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soreport.inc.php
2017-06-28 10:48:56 UTC (rev 16881)
+++ branches/Version-2_0-branch/property/inc/class.soreport.inc.php
2017-06-28 10:50:06 UTC (rev 16882)
@@ -1,4 +1,5 @@
<?php
+
/**
* phpGroupWare - property: a part of a Facilities Management System.
*
@@ -26,8 +27,7 @@
* @subpackage logistic
* @version $Id: class.soreport.inc.php 14913 2016-04-27 12:27:37Z
sigurdne $
*/
-
- class property_soreport
+ class property_soreport
{
function __construct()
@@ -35,35 +35,35 @@
$this->db = & $GLOBALS['phpgw']->db;
$this->join = & $this->db->join;
$this->left_join = & $this->db->left_join;
- $this->like = & $this->db->like;
+ $this->like = & $this->db->like;
$this->total_records = 0;
-
+
$this->operators_equal = array(
- 'equal' => '=',
- 'not_equal' => '!=',
- 'less' => '<',
- 'less_equal' => '<=',
- 'greater' => '>',
+ 'equal' => '=',
+ 'not_equal' => '!=',
+ 'less' => '<',
+ 'less_equal' => '<=',
+ 'greater' => '>',
'greater_equal' => '>='
);
$this->operators_like = array(
- 'like' => 'LIKE',
- 'not_like' => 'NOT LIKE',
- 'ilike' => 'ILIKE',
+ 'like' => 'LIKE',
+ 'not_like' => 'NOT LIKE',
+ 'ilike' => 'ILIKE',
'not_ilike' => 'NOT ILIKE'
);
$this->operators_in = array(
- 'in' => 'IN',
+ 'in' => 'IN',
'not_in' => 'NOT IN'
);
$this->operators_null = array(
- 'is_null' => 'IS NULL',
+ 'is_null' => 'IS NULL',
'is_not_null' => 'IS NOT NULL'
);
$this->operators = array_merge($this->operators_equal,
$this->operators_like, $this->operators_in, $this->operators_null);
}
- function read_single ( $id, $values = array() )
+ function read_single( $id, $values = array() )
{
$id = (int)$id;
$sql = "SELECT * FROM fm_view_dataset_report WHERE id =
{$id}";
@@ -84,8 +84,8 @@
return $values;
}
-
- public function read($data)
+
+ public function read( $data )
{
$start = isset($data['start']) && $data['start'] ?
$data['start'] : 0;
$query = isset($data['query']) ? $data['query'] : '';
@@ -94,7 +94,7 @@
$allrows = isset($data['allrows']) ? $data['allrows'] :
'';
$dataset_id = isset($data['dataset_id']) ?
$data['dataset_id'] : '';
$results = isset($data['results']) && $data['results']
? (int)$data['results'] : 0;
-
+
if ($order)
{
$ordermethod = " ORDER BY $order $sort";
@@ -149,7 +149,7 @@
return $values;
}
-
+
public function get_views()
{
$sql = "SELECT table_name as name
@@ -156,7 +156,7 @@
FROM information_schema.tables
WHERE table_schema = current_schema()
AND table_type = 'VIEW'";
-
+
$this->db->query($sql, __LINE__, __FILE__);
$values = array();
@@ -168,14 +168,14 @@
'name' => $this->db->f('name')
);
}
-
+
return $values;
}
-
+
public function get_datasets()
{
$sql = "SELECT * FROM fm_view_dataset";
-
+
$this->db->query($sql, __LINE__, __FILE__);
$values = array();
@@ -188,23 +188,23 @@
'name' => $this->db->f('dataset_name')
);
}
-
+
return $values;
}
-
- public function get_view_columns($id)
+
+ public function get_view_columns( $id )
{
$dataset = $this->read_single_dataset($id);
-
+
$sql = "SELECT column_name, data_type
FROM information_schema.columns
- WHERE table_name = '".$dataset['view_name']."'
+ WHERE table_name = '" . $dataset['view_name']
. "'
ORDER BY ordinal_position";
-
+
$this->db->query($sql, __LINE__, __FILE__);
$values = array();
-
+
while ($this->db->next_record())
{
$values[] = array
@@ -213,32 +213,32 @@
'type' => $this->db->f('data_type')
);
}
-
+
return $values;
}
-
- function get_view_content ( $id )
+
+ function get_view_content( $id )
{
$id = (int)$id;
$dataset = $this->read_single_dataset($id);
-
+
$sql = "SELECT column_name, data_type
FROM information_schema.columns
- WHERE table_name = '".$dataset['view_name']."'
+ WHERE table_name = '" . $dataset['view_name']
. "'
ORDER BY ordinal_position";
$this->db->query($sql, __LINE__, __FILE__);
$columns = array();
-
+
while ($this->db->next_record())
{
$columns[] = $this->db->f('column_name');
}
-
- $sql = "SELECT * FROM ".$dataset['view_name'];
+
+ $sql = "SELECT * FROM " . $dataset['view_name'];
$this->db->limit_query($sql, 0, __LINE__, __FILE__, 20);
-
+
$values = array();
while ($this->db->next_record())
{
@@ -249,37 +249,42 @@
}
$values[] = $value;
}
-
+
return $values;
}
-
- private function _is_date( $str ) {
- try {
- $dt = new DateTime( trim($str) );
+
+ private function _is_date( $str )
+ {
+ try
+ {
+ $dt = new DateTime(trim($str));
}
- catch( Exception $e ) {
+ catch (Exception $e)
+ {
return false;
}
$month = $dt->format('m');
$day = $dt->format('d');
$year = $dt->format('Y');
- if( checkdate($month, $day, $year) ) {
+ if (checkdate($month, $day, $year))
+ {
return true;
}
- else {
+ else
+ {
return false;
}
}
- private function _build_conditions_equal($param, $type)
- {
+ private function _build_conditions_equal( $param, $type )
+ {
$result = '';
-
- switch ($type)
+
+ switch ($type)
{
case 'character varying':
case 'text':
- $result = $param['field']."
".$this->operators[$param['operator']]." '".$param['value1']."'";
+ $result = $param['field'] . " " .
$this->operators[$param['operator']] . " '" . $param['value1'] . "'";
break;
case 'integer':
case 'smallint':
@@ -286,7 +291,7 @@
case 'numeric':
if (is_numeric($param['value1']))
{
- $result = $param['field']."
".$this->operators[$param['operator']]." ".$param['value1'];
+ $result = $param['field'] . " "
. $this->operators[$param['operator']] . " " . $param['value1'];
}
break;
case 'date':
@@ -293,14 +298,14 @@
case 'timestamp without time zone':
if ($this->_is_date($param['value1']))
{
- $result = $param['field']."
".$this->operators[$param['operator']]." '".$param['value1']."'";
+ $result = $param['field'] . " "
. $this->operators[$param['operator']] . " '" . $param['value1'] . "'";
}
- }
-
+ }
+
return $result;
}
-
- private function _build_conditions($criteria, $id)
+
+ private function _build_conditions( $criteria, $id )
{
$columns = $this->get_view_columns($id);
$_columns = array();
@@ -308,92 +313,98 @@
{
$_columns[$column['name']] = $column['type'];
}
-
+
$n = 1;
$where = array();
foreach ($criteria as $param)
{
- switch (true)
+ switch (true)
{
case
(array_key_exists($param['operator'], $this->operators_equal)):
- $result =
$this->_build_conditions_equal($param, $_columns[$param['field']]);
+ $result =
$this->_build_conditions_equal($param, $_columns[$param['field']]);
break;
case
(array_key_exists($param['operator'], $this->operators_like)):
if ($param['value1'] != '')
{
- $result =
$param['field']."::text ".$this->operators[$param['operator']]."
'%".$param['value1']."%'";
+ $result =
$param['field'] . "::text " . $this->operators[$param['operator']] . " '%" .
$param['value1'] . "%'";
}
break;
case
(array_key_exists($param['operator'], $this->operators_null)):
- $result = $param['field']."
".$this->operators[$param['operator']];
+ $result = $param['field'] . " "
. $this->operators[$param['operator']];
break;
case
(array_key_exists($param['operator'], $this->operators_in)):
if ($param['value1'] != '')
{
$values =
array_map('trim', explode(',', $param['value1']));
- $_string =
"'".implode("','", $values)."'";
- $result =
$param['field']."::text ".$this->operators[$param['operator']]."
(".$_string.")";
+ $_string = "'" .
implode("','", $values) . "'";
+ $result =
$param['field'] . "::text " . $this->operators[$param['operator']] . " (" .
$_string . ")";
}
break;
}
-
+
if ($result)
{
- $where[] = $result."
".$param['conector'];
+ $where[] = $result . " " .
$param['conector'];
}
$n++;
}
-
+
return $where;
}
-
- function read_to_export ( $id, $data = array() )
+
+ function read_to_export( $id, $data = array() )
{
$id = (int)$id;
+
if (count($data))
{
$dataset = $this->read_single_dataset($id);
$jsonB = $data;
+ $dataset_id = $id;
}
- else {
+ else
+ {
$definition = $this->read_single($id);
- $dataset =
$this->read_single_dataset($definition['dataset_id']);
+ $dataset =
$this->read_single_dataset($definition['dataset_id']);
$jsonB =
json_decode($definition['report_definition'], true);
+ $dataset_id = (int)$definition['dataset_id'];
}
$string_columns = implode(',', $jsonB['columns']);
-
+
$array_order = array();
$group = implode(',', $jsonB['group']);
if ($group)
{
- $array_order[] = $group.' ASC';
+ $array_order[] = $group . ' ASC';
}
$order = implode(',', $jsonB['order']);
if ($order)
{
- $array_order[] = $order.' ASC';
+ $array_order[] = $order . ' ASC';
}
-
+
if (count($array_order))
{
- $ordering = 'ORDER BY '.implode(', ',
array_unique($array_order));
+ $ordering = 'ORDER BY ' . implode(', ',
array_unique($array_order));
}
-
- $cond = $this->_build_conditions($jsonB['criteria'],
$id);
-
+
+ $cond = $this->_build_conditions($jsonB['criteria'],
$dataset_id);
+
if ($cond)
{
- $where = 'WHERE '.implode(' ', $cond);
+ $where = 'WHERE ' . implode(' ', $cond);
}
-
- $sql = "SELECT ".$string_columns." FROM
".$dataset['view_name']." ".$where." ".$ordering;
+ $sql = "SELECT " . $string_columns . " FROM " .
$dataset['view_name'] . " " . $where . " " . $ordering;
+
if (count($data))
{
$this->db->limit_query($sql, 0, __LINE__,
__FILE__, 20);
- } else {
+ }
+ else
+ {
$this->db->query($sql, __LINE__, __FILE__);
}
@@ -400,21 +411,21 @@
$columns = array_values($jsonB['columns']);
array_unshift($columns, "");
$functions = $jsonB['cbo_aggregate'];
-
+
$values = array();
$array_sum = array();
$array_count = array();
-
+
while ($this->db->next_record())
{
$_group = ($group) ? $this->db->f($group) :
'any_group';
-
+
$value = array();
foreach ($columns as $column)
{
$value[$column] = $this->db->f($column);
}
-
+
foreach ($functions as $k => $v)
{
if ($v == 'sum')
@@ -426,8 +437,8 @@
$array_count[$_group][$k][] =
$this->db->f($k);
}
}
-
- $values[$_group][] = $value;
+
+ $values[$_group][] = $value;
}
if (count($values))
@@ -434,25 +445,25 @@
{
$result = $this->_generate_total_sum($values,
$array_sum, $array_count);
}
-
+
return $result;
}
-
- private function _generate_total_sum($values, $array_sum,
$array_count)
- {
+
+ private function _generate_total_sum( $values, $array_sum,
$array_count )
+ {
$result = array();
$array_operations = array();
-
+
foreach ($values as $k => $group)
{
$columns = array_keys($group[0]);
-
+
$operations = array();
$empty = array();
foreach ($columns as $columm)
{
$empty[$columm] = $operations[$columm]
= '';
-
+
if (is_array($array_sum[$k][$columm]))
{
$operations[$columm] =
array_sum($array_sum[$k][$columm]);
@@ -464,19 +475,19 @@
if ($columm == '')
{
$operations[$columm] =
lang('Total');
- }
- }
-
+ }
+ }
+
$array_operations[] = $operations;
if ($k != 'any_group')
{
- $group[] = $operations;
+ $group[] = $operations;
}
- $group[] = $empty;
-
+ $group[] = $empty;
+
$result = array_merge($result, $group);
- }
-
+ }
+
$grand_total = array();
$columns = array_keys($array_operations[0]);
foreach ($array_operations as $value)
@@ -486,20 +497,20 @@
if ($columm == '')
{
$grand_total[$columm] =
lang('Grand Total');
- }
- else
- {
+ }
+ else
+ {
$grand_total[$columm] =
($grand_total[$columm] + $value[$columm]) ? ($grand_total[$columm] +
$value[$columm]) : '';
}
- }
+ }
}
-
+
$result[] = $grand_total;
-
+
return $result;
}
-
- function read_single_dataset ( $id, $values = array() )
+
+ function read_single_dataset( $id, $values = array() )
{
$id = (int)$id;
$sql = "SELECT * FROM fm_view_dataset WHERE id = {$id}";
@@ -519,8 +530,8 @@
return $values;
}
-
- function read_dataset ( $data )
+
+ function read_dataset( $data )
{
$start = isset($data['start']) && $data['start'] ?
$data['start'] : 0;
$query = isset($data['query']) ? $data['query'] : '';
@@ -528,7 +539,7 @@
$order = isset($data['order']) ? $data['order'] : '';
$allrows = isset($data['allrows']) ? $data['allrows'] :
'';
$results = isset($data['results']) && $data['results']
? (int)$data['results'] : 0;
-
+
if ($order)
{
$ordermethod = " ORDER BY $order $sort";
@@ -540,11 +551,11 @@
$where = 'HAVING';
- /*if ($dimb_id > 0)
- {
- $filtermethod .= " $where
fm_budget.ecodimb={$dimb_id}";
- $where = 'AND';
- }*/
+ /* if ($dimb_id > 0)
+ {
+ $filtermethod .= " $where
fm_budget.ecodimb={$dimb_id}";
+ $where = 'AND';
+ } */
if ($query)
{
@@ -585,8 +596,8 @@
return $values;
}
-
- function add ( $data )
+
+ function add( $data )
{
$receipt = array();
$values_insert = array
@@ -597,12 +608,12 @@
'owner_id' =>
$GLOBALS['phpgw_info']['user']['account_id'],
'entry_date' => time()
);
-
+
$this->db->transaction_begin();
$this->db->query("INSERT INTO fm_view_dataset_report ("
. implode(',', array_keys($values_insert)) . ') VALUES ('
- .
$this->db->validate_insert(array_values($values_insert)) . ')', __LINE__,
__FILE__);
-
+ .
$this->db->validate_insert(array_values($values_insert)) . ')', __LINE__,
__FILE__);
+
if ($this->db->transaction_commit())
{
$receipt['message'][] = array('msg' =>
lang('dataset has been saved'));
@@ -612,11 +623,11 @@
{
$receipt['error'][] = array('msg' =>
lang('dataset has not been saved'));
}
-
+
return $receipt;
}
- function update ( $data )
+ function update( $data )
{
$receipt = array();
@@ -632,7 +643,7 @@
$value_set = $this->db->validate_update($value_set);
$this->db->transaction_begin();
-
+
$this->db->query("UPDATE fm_view_dataset_report SET
{$value_set} WHERE id='" . $data['id'] . "'", __LINE__, __FILE__);
$receipt['id'] = $data['id'];
@@ -644,17 +655,17 @@
{
$receipt['error'][] = array('msg' =>
lang('dataset has not been updated'));
}
-
+
return $receipt;
}
-
- function delete ( $id )
+
+ function delete( $id )
{
$id = (int)$id;
$receipt = array();
$this->db->transaction_begin();
-
+
//$this->db->query("DELETE FROM fm_view_dataset WHERE
id ='{$id}'", __LINE__, __FILE__);
$this->db->query("DELETE FROM fm_view_dataset_report
WHERE id ='{$id}'", __LINE__, __FILE__);
@@ -666,11 +677,11 @@
{
$receipt['error'][] = array('msg' =>
lang('report has not been deleted'));
}
-
+
return $receipt;
- }
-
- function add_dataset ( $data )
+ }
+
+ function add_dataset( $data )
{
$receipt = array();
$values_insert = array
@@ -680,12 +691,12 @@
'owner_id' =>
$GLOBALS['phpgw_info']['user']['account_id'],
'entry_date' => time()
);
-
+
$this->db->transaction_begin();
$this->db->query("INSERT INTO fm_view_dataset (" .
implode(',', array_keys($values_insert)) . ') VALUES ('
- .
$this->db->validate_insert(array_values($values_insert)) . ')', __LINE__,
__FILE__);
-
+ .
$this->db->validate_insert(array_values($values_insert)) . ')', __LINE__,
__FILE__);
+
if ($this->db->transaction_commit())
{
$receipt['message'][] = array('msg' =>
lang('dataset has been saved'));
@@ -695,11 +706,11 @@
{
$receipt['error'][] = array('msg' =>
lang('dataset has not been saved'));
}
-
+
return $receipt;
}
- function update_dataset ( $data )
+ function update_dataset( $data )
{
$receipt = array();
@@ -714,7 +725,7 @@
$value_set = $this->db->validate_update($value_set);
$this->db->transaction_begin();
-
+
$this->db->query("UPDATE fm_view_dataset SET
{$value_set} WHERE id='" . $data['id'] . "'", __LINE__, __FILE__);
$receipt['id'] = $data['id'];
@@ -726,17 +737,17 @@
{
$receipt['error'][] = array('msg' =>
lang('dataset has not been updated'));
}
-
+
return $receipt;
}
-
- function delete_dataset ( $id )
+
+ function delete_dataset( $id )
{
$id = (int)$id;
$receipt = array();
$this->db->transaction_begin();
-
+
$this->db->query("DELETE FROM fm_view_dataset_report
WHERE dataset_id ='{$id}'", __LINE__, __FILE__);
$this->db->query("DELETE FROM fm_view_dataset WHERE id
='{$id}'", __LINE__, __FILE__);
@@ -748,8 +759,7 @@
{
$receipt['error'][] = array('msg' =>
lang('dataset has not been deleted'));
}
-
+
return $receipt;
- }
-
+ }
}
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16882] Stable: Merge 16879:16881 from trunk,
sigurdne <=