[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16220] Stable: Merge 16213:16219 from trunk
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16220] Stable: Merge 16213:16219 from trunk |
Date: |
Wed, 1 Feb 2017 05:55:30 -0500 (EST) |
Revision: 16220
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16220
Author: sigurdne
Date: 2017-02-01 05:55:30 -0500 (Wed, 01 Feb 2017)
Log Message:
-----------
Stable: Merge 16213:16219 from trunk
Modified Paths:
--------------
branches/Version-2_0-branch/eventplanner/inc/class.socustomer.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.sovendor.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php
branches/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php
branches/Version-2_0-branch/eventplannerfrontend/inc/class.uibooking.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.uicommon.inc.php
branches/Version-2_0-branch/phpgwapi/templates/base/datatable_jquery.xsl
Property Changed:
----------------
branches/Version-2_0-branch/
Index: branches/Version-2_0-branch
===================================================================
--- branches/Version-2_0-branch 2017-02-01 10:52:44 UTC (rev 16219)
+++ branches/Version-2_0-branch 2017-02-01 10:55:30 UTC (rev 16220)
Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
/branches/dev-syncromind:13653
/branches/dev-syncromind-2:14933-16188
/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
\ 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
\ No newline at end of property
Modified: branches/Version-2_0-branch/eventplanner/inc/class.socustomer.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.socustomer.inc.php
2017-02-01 10:52:44 UTC (rev 16219)
+++ branches/Version-2_0-branch/eventplanner/inc/class.socustomer.inc.php
2017-02-01 10:55:30 UTC (rev 16220)
@@ -37,6 +37,8 @@
public function __construct()
{
parent::__construct('eventplanner_customer',
eventplanner_customer::get_fields());
+ $this->acl_location =
eventplanner_customer::acl_location;
+ $this->use_acl = true;
}
/**
Modified: branches/Version-2_0-branch/eventplanner/inc/class.sovendor.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.sovendor.inc.php
2017-02-01 10:52:44 UTC (rev 16219)
+++ branches/Version-2_0-branch/eventplanner/inc/class.sovendor.inc.php
2017-02-01 10:55:30 UTC (rev 16220)
@@ -36,6 +36,8 @@
public function __construct()
{
parent::__construct('eventplanner_vendor',
eventplanner_vendor::get_fields());
+ $this->acl_location = eventplanner_vendor::acl_location;
+ $this->use_acl = true;
}
/**
Modified:
branches/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php
2017-02-01 10:52:44 UTC (rev 16219)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php
2017-02-01 10:55:30 UTC (rev 16220)
@@ -337,7 +337,7 @@
$datatable_def[] = array(
'container' => 'datatable-container_1',
- 'requestUrl' =>
json_encode(self::link(array('menuaction' =>
"{$this->currentapp}.uibooking.query",
+ 'requestUrl' =>
json_encode(self::link(array('menuaction' =>
"{$this->currentapp}.uibooking.query_relaxed",
'filter_application_id' => $id,
'filter_active' => 1,
'phpgw_return_as' => 'json'))),
Modified: branches/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php
2017-02-01 10:52:44 UTC (rev 16219)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php
2017-02-01 10:55:30 UTC (rev 16220)
@@ -38,6 +38,7 @@
'add' => true,
'index' => true,
'query' => true,
+ 'query_relaxed'=> true,
'get_list'=> true,
'view' => true,
'edit' => true,
Modified:
branches/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php
2017-02-01 10:52:44 UTC (rev 16219)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php
2017-02-01 10:55:30 UTC (rev 16220)
@@ -96,6 +96,7 @@
'label' => 'id',
'sortable'=> true,
'formatter' =>
'JqueryPortico.formatLink',
+ 'public' => true
),
'owner_id' => array('action'=> PHPGW_ACL_ADD,
'type' => 'int',
@@ -117,6 +118,7 @@
'label' => 'from',
'history' => true,
'required' => true,
+ 'public' => true
),
'to_' => array('action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
'type' => 'date',
@@ -123,6 +125,7 @@
'label' => 'to',
'history' => true,
'required' => true,
+ 'public' => true
),
'application_id' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
'type' => 'int',
@@ -129,11 +132,13 @@
'label' => 'application',
'sortable' => true,
'required' => true,
+ 'public' => true
),
'application_name' => array('action'=>
PHPGW_ACL_READ,
'type' => 'string',
'query' => true,
'label' => 'application',
+ 'public' => true,
'join' => array(
'table' =>
'eventplanner_application',
'fkey' => 'application_id',
@@ -146,11 +151,13 @@
'label' => 'customer',
'sortable' => true,
'history' => true,
+ 'public' => true
),
'customer_name' => array('action'=>
PHPGW_ACL_READ,
'type' => 'string',
'query' => true,
'label' => 'customer',
+ 'public' => true,
'join' => array(
'table' =>
'eventplanner_customer',
'fkey' => 'customer_id',
@@ -190,6 +197,7 @@
'query' => true,
'label' => 'location',
'history' => true,
+ 'public' => true
),
'comments' => array(
'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
Modified:
branches/Version-2_0-branch/eventplannerfrontend/inc/class.uibooking.inc.php
===================================================================
---
branches/Version-2_0-branch/eventplannerfrontend/inc/class.uibooking.inc.php
2017-02-01 10:52:44 UTC (rev 16219)
+++
branches/Version-2_0-branch/eventplannerfrontend/inc/class.uibooking.inc.php
2017-02-01 10:55:30 UTC (rev 16220)
@@ -20,6 +20,17 @@
return $this->jquery_results($values);
}
+ public function query_relaxed()
+ {
+ $params = $this->bo->build_default_read_params();
+ $params['relaxe_acl'] = true;
+ $params['filters']['status'] =
eventplanner_application::STATUS_APPROVED;
+ $values = $this->bo->read($params);
+ array_walk($values["results"], array($this,
"_add_links"), "eventplannerfrontend.uibooking.edit");
+
+ return $this->jquery_results($values);
+ }
+
public function edit()
{
parent::edit();
Modified: branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
2017-02-01 10:52:44 UTC (rev 16219)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
2017-02-01 10:55:30 UTC (rev 16220)
@@ -43,6 +43,7 @@
protected $use_acl = false;
protected $currentapp;
protected $acl;
+ protected $relaxe_acl;
public function __construct( $table_name, $fields )
{
@@ -210,10 +211,13 @@
$dir = isset($params['dir']) && $params['dir'] ?
$params['dir'] : 'asc';
$query = isset($params['query']) && $params['query'] ?
$params['query'] : null;
$filters = isset($params['filters']) &&
$params['filters'] ? $params['filters'] : array();
+ $relaxe_acl = isset($params['relaxe_acl']) &&
$params['relaxe_acl'] ? $params['relaxe_acl'] : false;
+ $this->relaxe_acl = $relaxe_acl;
$cols_joins = $this->_get_cols_and_joins($filters);
$cols = join(',', $cols_joins[0]);
$joins = join(' ', $cols_joins[1]);
$condition = $this->_get_conditions($query, $filters);
+ $this->relaxe_acl = false;
// Calculate total number of records
$this->db->query("SELECT count(1) AS count FROM
$this->table_name $joins WHERE $condition", __LINE__, __FILE__);
@@ -256,6 +260,11 @@
$row = array();
foreach ($this->fields as $field => $params)
{
+ if($relaxe_acl && !$params['public'])
+ {
+ continue;
+ }
+
$row[$field] =
$this->unmarshal($this->db->f($field, false), $params['type']);
}
$results[] = $row;
@@ -268,6 +277,10 @@
}
foreach ($this->fields as $field => $params)
{
+ if($relaxe_acl && !$params['public'])
+ {
+ continue;
+ }
if ($params['manytomany'])
{
$table =
$params['manytomany']['table'];
@@ -346,7 +359,9 @@
$id_value = intval($id_params);
}
- return $this->table_name . '.id=' . $id_value;
+ $conditions = "{$this->table_name}.id={$id_value}";
+
+ return $conditions;
}
function read_single( $id, $return_object = false )
@@ -357,12 +372,34 @@
}
$row = array();
$pk_params = $this->primary_key_conditions($id);
+
+ $acl_condition = $this->get_acl_condition();
+
$cols_joins = $this->_get_cols_and_joins();
$cols = join(',', $cols_joins[0]);
$joins = join(' ', $cols_joins[1]);
- $this->db->query("SELECT $cols FROM $this->table_name
$joins WHERE $pk_params", __LINE__, __FILE__);
+
+ /**
+ * test
+ */
+ $acl_test = false;
+ if($acl_condition)
+ {
+ $this->db->query("SELECT DISTINCT {$cols} FROM
{$this->table_name} {$joins} WHERE {$pk_params} AND {$acl_condition}",
__LINE__, __FILE__); //DISTINCT: There might be LEFT JOINs..
+ if ($this->db->next_record())
+ {
+ $acl_test = true;
+ }
+ }
+
+ $this->db->query("SELECT DISTINCT $cols FROM
$this->table_name $joins WHERE $pk_params", __LINE__, __FILE__); //DISTINCT:
There might be LEFT JOINs..
if ($this->db->next_record())
{
+ if($acl_condition && !$acl_test)
+ {
+ phpgw::no_access();
+ }
+
foreach ($this->fields as $field => $params)
{
if (!empty($params['manytomany']))
@@ -523,7 +560,7 @@
{
$clause = '';
- if($this->use_acl && $this->currentapp &&
$this->acl_location)
+ if(!$this->relaxe_acl && ($this->use_acl &&
$this->currentapp && $this->acl_location))
{
$paranthesis = false;
@@ -608,7 +645,7 @@
}
}
- if($this->use_acl && $this->currentapp &&
$this->acl_location)
+ if(!$this->relaxe_acl && ($this->use_acl &&
$this->currentapp && $this->acl_location))
{
$joins[] = " JOIN phpgw_accounts ON
({$this->table_name}.owner_id = phpgw_accounts.account_id)";
$joins[] = " JOIN phpgw_group_map ON
(phpgw_accounts.account_id = phpgw_group_map.account_id)";
Modified: branches/Version-2_0-branch/phpgwapi/inc/class.uicommon.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.uicommon.inc.php
2017-02-01 10:52:44 UTC (rev 16219)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.uicommon.inc.php
2017-02-01 10:55:30 UTC (rev 16220)
@@ -37,6 +37,7 @@
'add' => true,
'index' => true,
'query' => true,
+ 'query_relaxed'=> true,
'view' => true,
'edit' => true,
'save' => true,
@@ -211,7 +212,7 @@
}
}
- private function get_data()
+ private function get_data($relaxe_acl = false)
{
if (empty($this->permissions[PHPGW_ACL_READ]))
{
@@ -218,6 +219,7 @@
phpgw::no_access();
}
$params = $this->bo->build_default_read_params();
+ $params['relaxe_acl'] = $relaxe_acl;
return $this->bo->read($params);
}
@@ -225,14 +227,20 @@
* (non-PHPdoc)
* @see eventplanner/inc/eventplanner_uicommon#query()
*/
- public function query()
+ public function query($relaxe_acl = false)
{
- $values = $this->get_data();
+ $values = $this->get_data($relaxe_acl);
array_walk($values["results"], array($this,
"_add_links"),
"{$this->called_class_arr[0]}.{$this->called_class_arr[1]}.edit");
return $this->jquery_results($values);
}
+ public function query_relaxed()
+ {
+ $relaxe_acl = true;
+ return $this->query($relaxe_acl);
+ }
+
/**
* Returns a minimum for - let say - autocomplete
* @param void
Modified:
branches/Version-2_0-branch/phpgwapi/templates/base/datatable_jquery.xsl
===================================================================
--- branches/Version-2_0-branch/phpgwapi/templates/base/datatable_jquery.xsl
2017-02-01 10:52:44 UTC (rev 16219)
+++ branches/Version-2_0-branch/phpgwapi/templates/base/datatable_jquery.xsl
2017-02-01 10:55:30 UTC (rev 16220)
@@ -901,8 +901,10 @@
if(isChrome == true)
{
+ group_buttons = false;
+ }
+ //disable grouping for now
group_buttons = false;
- }
if(group_buttons === true)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16220] Stable: Merge 16213:16219 from trunk,
sigurdne <=