[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15311] Stable: Merge 15306:15310 from trunk
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [15311] Stable: Merge 15306:15310 from trunk |
Date: |
Tue, 21 Jun 2016 11:23:50 +0000 (UTC) |
Revision: 15311
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15311
Author: sigurdne
Date: 2016-06-21 11:23:50 +0000 (Tue, 21 Jun 2016)
Log Message:
-----------
Stable: Merge 15306:15310 from trunk
Modified Paths:
--------------
branches/Version-2_0-branch/booking/inc/class.soapplication.inc.php
branches/Version-2_0-branch/booking/inc/class.socommon.inc.php
branches/Version-2_0-branch/booking/inc/class.uiapplication.inc.php
branches/Version-2_0-branch/sms/inc/class.sosms.inc.php
Property Changed:
----------------
branches/Version-2_0-branch/
branches/Version-2_0-branch/booking/
Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14937-15027,15165-15215,15223-15228,15230-15243,15245-15250,15254-15257
/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
+ /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14937-15027,15165-15215,15223-15228,15230-15243,15245-15250,15254-15257
/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
Property changes on: branches/Version-2_0-branch/booking
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/stavangerkommune/booking:9468-12740,12743-12875,12986
/trunk/booking:14721-14732,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14871,14886-14896,14900-14902,14917-14919,14924-14978,14980-15258,15266-15285,15287-15288,15297,15299-15305
+ /branches/stavangerkommune/booking:9468-12740,12743-12875,12986
/trunk/booking:14721-14732,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14871,14886-14896,14900-14902,14917-14919,14924-14978,14980-15258,15266-15285,15287-15288,15297,15299-15305,15307-15310
Modified: branches/Version-2_0-branch/booking/inc/class.soapplication.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.soapplication.inc.php
2016-06-21 11:22:15 UTC (rev 15310)
+++ branches/Version-2_0-branch/booking/inc/class.soapplication.inc.php
2016-06-21 11:23:50 UTC (rev 15311)
@@ -304,7 +304,7 @@
WHERE ba.id = bar.allocation_id
AND bar.resource_id in ($rids)
AND ((ba.from_ < '$from_' AND ba.to_ > '$from_')
- OR (ba.from_ >= '$from_' AND ba.to_ <= '$to_')
+ OR (ba.from_ > '$from_' AND ba.to_ < '$to_')
OR (ba.from_ < '$to_' AND ba.to_ > '$to_'))
UNION
SELECT be.id
@@ -313,7 +313,7 @@
AND be.id = bed.event_id
AND ber.resource_id in ($rids)
AND ((bed.from_ < '$from_' AND bed.to_ > '$from_')
- OR (bed.from_ >= '$from_' AND bed.to_ <= '$to_')
+ OR (bed.from_ > '$from_' AND bed.to_ < '$to_')
OR (bed.from_ < '$to_' AND bed.to_ > '$to_'))";
$this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
Modified: branches/Version-2_0-branch/booking/inc/class.socommon.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.socommon.inc.php
2016-06-21 11:22:15 UTC (rev 15310)
+++ branches/Version-2_0-branch/booking/inc/class.socommon.inc.php
2016-06-21 11:23:50 UTC (rev 15311)
@@ -289,6 +289,10 @@
function read_single( $id )
{
+ if (!$id)
+ {
+ return null;
+ }
$row = array();
$pk_params = $this->primary_key_conditions($id);
$cols_joins = $this->_get_cols_and_joins();
Modified: branches/Version-2_0-branch/booking/inc/class.uiapplication.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uiapplication.inc.php
2016-06-21 11:22:15 UTC (rev 15310)
+++ branches/Version-2_0-branch/booking/inc/class.uiapplication.inc.php
2016-06-21 11:23:50 UTC (rev 15311)
@@ -481,7 +481,7 @@
$association['link'] =
self::link(array('menuaction' => 'booking.ui' . $association['type'] . '.edit',
'id' => $association['id']));
$association['dellink'] =
self::link(array('menuaction' => 'booking.ui' . $association['type'] .
'.delete',
- 'event_id' =>
$association['id'], 'application_id' => $association['application_id']));
+ 'id' => $association['id'],
'application_id' => $association['application_id']));
$association['type'] =
lang($association['type']);
}
return $associations;
Modified: branches/Version-2_0-branch/sms/inc/class.sosms.inc.php
===================================================================
--- branches/Version-2_0-branch/sms/inc/class.sosms.inc.php 2016-06-21
11:22:15 UTC (rev 15310)
+++ branches/Version-2_0-branch/sms/inc/class.sosms.inc.php 2016-06-21
11:23:50 UTC (rev 15311)
@@ -40,6 +40,8 @@
$allrows = isset($data['allrows']) ? $data['allrows'] :
'';
$acl_location = isset($data['acl_location']) ?
$data['acl_location'] : '';
+ $filtermethod = '';
+
// if ($acl_location)
// {
//
$GLOBALS['phpgw']->acl->set_account_id($this->account);
@@ -108,12 +110,49 @@
$allrows = isset($data['allrows']) ? $data['allrows'] :
'';
$acl_location = isset($data['acl_location']) ?
$data['acl_location'] : '';
-// if ($acl_location)
-// {
-//
$GLOBALS['phpgw']->acl->set_account_id($this->account);
-// $grants =
$GLOBALS['phpgw']->acl->get_grants2('sms', $acl_location);
-// }
+ $table = 'phpgw_sms_tblsmsoutgoing';
+ $where = 'WHERE';
+ $filtermethod = '';
+ if ($acl_location)
+ {
+
$GLOBALS['phpgw']->acl->set_account_id($this->account);
+ $grants =
$GLOBALS['phpgw']->acl->get_grants2('sms', $acl_location);
+ $public_user_list = array();
+ if (is_array($grants['accounts']) &&
$grants['accounts'])
+ {
+ foreach ($grants['accounts'] as $user
=> $right)
+ {
+ $public_user_list[] = $user;
+ }
+ unset($user);
+
+ reset($public_user_list);
+ $filtermethod .= " $where ( $table.uid
IN(" . implode(',', $public_user_list) . ")";
+
+ $where = 'AND';
+ }
+
+ $public_group_list = array();
+ if (is_array($grants['groups']) &&
$grants['groups'])
+ {
+ foreach($grants['groups'] as $user =>
$_right)
+ {
+ $public_group_list[] = $user;
+ }
+ unset($user);
+ reset($public_group_list);
+ $where = $public_user_list ? 'OR' :
$where;
+ $filtermethod .= " $where
phpgw_group_map.group_id IN(" . implode(',', $public_group_list) . "))";
+ $where = 'AND';
+ }
+ if($public_user_list && !$public_group_list)
+ {
+ $filtermethod .=')';
+ }
+
+ }
+
if ($order)
{
$ordermethod = " ORDER BY $order $sort";
@@ -123,23 +162,6 @@
$ordermethod = ' ORDER BY smslog_id DESC';
}
- $table = 'phpgw_sms_tblsmsoutgoing';
-
-
- $where = 'WHERE';
-
-// if (is_array($grants))
-// {
-// while (list($user) = each($grants))
-// {
-// $public_user_list[] = $user;
-// }
-// reset($public_user_list);
-// $filtermethod = " $where ( $table.uid IN(" .
implode(',', $public_user_list) . "))";
-//
-// $where = 'AND';
-// }
-
$querymethod = '';
if ($query)
{
@@ -148,11 +170,17 @@
$querymethod = " AND p_dst $this->like
'%$query%' OR p_msg $this->like '%$query%'";
}
- $sql = "SELECT * FROM $table $filtermethod $querymethod
AND flag_deleted='0'";
+ $sql = "SELECT DISTINCT {$table}.* FROM {$table}"
+ . " {$this->join} phpgw_accounts ON
{$table}.uid=phpgw_accounts.account_id"
+ . " {$this->join} phpgw_group_map ON
(phpgw_accounts.account_id = phpgw_group_map.account_id)"
+ . " {$filtermethod} {$querymethod} {$where}
flag_deleted='0'";
- $this->db->query($sql, __LINE__, __FILE__);
- $this->total_records = $this->db->num_rows();
+ $sql_cnt = "SELECT COUNT(*) as cnt FROM ({$sql}) as t";
+ $this->db->query($sql_cnt, __LINE__, __FILE__);
+ $this->db->next_record();
+ $this->total_records = $this->db->f('cnt');
+
if (!$allrows)
{
$this->db->limit_query($sql . $ordermethod,
$start, __LINE__, __FILE__);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15311] Stable: Merge 15306:15310 from trunk,
sigurdne <=