*
*/
- function applyFilters($q, $au)
+ function applyFilters($q, $au, $roo)
{
$tn = $this->tableName();
case 'A': // all
break;
case 'C': // current
- $this->whereAdd("{$tn}.close_date >= NOW()");
+ $this->whereAdd("{$tn}.close_date is NULL OR {$tn}.close_date >= NOW()");
break;
case 'O': // old
$this->whereAdd("{$tn}.close_date < NOW()");
}
}
- if (empty($q['query']['project_filter']) || $q['query']['project_filter'] != 'ALL') {
+ if (empty($q['_is_update_request']) &&
+
+ (empty($q['query']['project_filter']) || $q['query']['project_filter'] != 'ALL')) {
$pf = empty($q['query']['project_filter']) ? 'P,N,U' : $q['query']['project_filter'];
//&& $au->hasPerm('Documents.Documents','S') << this is dependant on the doc modules
- if (!$au->hasPerm('Core.Projects_All','S') ) {
+ if (php_sapi_name() != 'cli' && !$au->hasPerm('Core.Projects_All','S') ) {
}
- function onInsert()
+ function onInsert($request,$roo)
{
$oo = clone($this);
if (empty($this->code)) {
}
}
- function onUpdate($old)
+ function onUpdate($old, $request, $roo)
{
$oo = clone($this);
if (empty($this->code)) {
return $au->hasPerm("Core.Projects_Member_Of",$lvl) || $au->hasPerm("Core.Projects_All",$lvl);
}
+ static $cache = array();
+ function cacheLoad($id)
+ {
+ if (isset(self::$cache[$id])) {
+ return self::$cache[$id];
+ }
+ $n = $this->factorySelf();
+ $n->get($id);
+ $n->cacheSave();
+ return $n;
+ }
+
+ function cacheSave()
+ {
+ self::$cache[$this->id] = $this;
+ }
+
+
+
}