mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-22 10:52:00 +02:00
Trying to get cats and other filters to behave, this is the best yet
This commit is contained in:
parent
6a59701d07
commit
2f87627bf7
@ -291,7 +291,7 @@
|
|||||||
|
|
||||||
// send this the range, query, sort, order and whatever fields you want to see
|
// send this the range, query, sort, order and whatever fields you want to see
|
||||||
// 'rights' and 'access' are unused at this time
|
// 'rights' and 'access' are unused at this time
|
||||||
function read($start=0,$offset=0,$fields="",$query="",$filter="",$sort="",$order="",$rights="",$access="")
|
function read($start=0,$offset=0,$fields="",$query="",$filter="",$sort="",$order="")
|
||||||
{
|
{
|
||||||
global $phpgw,$phpgw_info;
|
global $phpgw,$phpgw_info;
|
||||||
|
|
||||||
@ -300,6 +300,7 @@
|
|||||||
|
|
||||||
list($stock_fields,$stock_fieldnames,$extra_fields) = $this->split_stock_and_extras($fields);
|
list($stock_fields,$stock_fieldnames,$extra_fields) = $this->split_stock_and_extras($fields);
|
||||||
|
|
||||||
|
$filterfields = array();
|
||||||
// turn filter's a=b,c=d OR a=b into an array
|
// turn filter's a=b,c=d OR a=b into an array
|
||||||
if ($filter) {
|
if ($filter) {
|
||||||
if ($DEBUG) { echo "DEBUG - Inbound filter is: #".$filter."#"; }
|
if ($DEBUG) { echo "DEBUG - Inbound filter is: #".$filter."#"; }
|
||||||
@ -321,12 +322,26 @@
|
|||||||
$filterfields = array($this->non_contact_fields[$name] => $value);
|
$filterfields = array($this->non_contact_fields[$name] => $value);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$filterfields = array(
|
$filterfields += array('phpgwtypeid' => 'n');
|
||||||
'phpgwtypeid' => 'n'
|
|
||||||
);
|
|
||||||
if ($DEBUG) { echo "<br>DEBUG - Filter strings: #phpgwtypeid=n#"; }
|
if ($DEBUG) { echo "<br>DEBUG - Filter strings: #phpgwtypeid=n#"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_array($this->grants))
|
||||||
|
{
|
||||||
|
$filterfields += array('phpgwaccess' => 'public');
|
||||||
|
$grants = $this->grants;
|
||||||
|
while (list($user) = each($grants))
|
||||||
|
{
|
||||||
|
if ($DEBUG) { echo "<br>DEBUG - Grant from owner: ".$user; }
|
||||||
|
$filterfields += array('phpgwowner' => $user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//if ($DEBUG) {
|
||||||
|
// while(list($name,$value) = each($filterfields)) {
|
||||||
|
// echo "<br>DEBUG - Filter strings: #".$name.",".$value."#";
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
if (!$sort) { $sort = "ASC"; }
|
if (!$sort) { $sort = "ASC"; }
|
||||||
|
|
||||||
if (!$order) {
|
if (!$order) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user