// ------------ROO HOOKS------------------------------------
function applyFilters($q, $au)
{
- if (!empty($q['query']['person_not_internal'])) {
- $this->whereAdd(" join_company_id_id.isOwner = 0 ");
+ if (!empty($q['query']['from'])) {
+ $dt = date('Y-m-d' , strtotime($q['query']['from']));
+ $this->whereAdd(" Events.event_when >= '$dt' ");
}
- if (!empty($q['query']['person_internal_only_all'])) {
- // must be internal and not current user (need for distribution list)
- $this->whereAdd(" join_company_id_id.comptype = 'OWNER'");
-
+ if (!empty($q['query']['to'])) {
+ $dt = date('Y-m-d' , strtotime($q['query']['to']));
+ $this->whereAdd(" Events.event_when <= '$dt' ");
}
- // -- for distribution
- if (!empty($q['query']['person_internal_only'])) {
- // must be internal and not current user (need for distribution list)
- $this->whereAdd(" join_company_id_id.comptype = 'OWNER'");
-
- //$this->whereAdd(($this->tableName() == 'Person' ? 'Person' : "join_person_id_id") .
- // ".id != ".$au->id);
- $this->whereAdd("Person.id != {$au->id}");
- }
-
- if (!empty($q['query']['comptype_or_company_id'])) {
- // DB_DataObject::debugLevel(1);
- $bits = explode(',', $q['query']['comptype_or_company_id']);
- $id = (int) array_pop($bits);
- $ct = $this->escape($bits[0]);
-
- $this->whereAdd(" join_company_id_id.comptype = '$ct' OR Person.company_id = $id");
-
- }
-
+
}
/**
* check who is trying to access this. false == access denied..