###END_AUTOCODE
function getProjectManagers()
{
- $c = DB_DataObject::factory('Companies');
+ $c = DB_DataObject::factory('core_company');
$c->isOwner = 1;
if (!$c->find(true)) {
return array();
}
$ret = array();
- $p = DB_DataObject::factory('Person');
+ $p = DB_DataObject::factory('core_person');
$p->whereAdd('id IN ('. implode(',', $pmids) .')');
$p->find();
while ($p->fetch()) {
*
*/
- function applyFilters($q, $au)
+ function applyFilters($q, $au, $roo)
{
$tn = $this->tableName();
if (!empty($q['query']['project_search'])) {
$s = $this->escape($q['query']['project_search']);
- $this->whereAdd(" ({$tn}.code LIKE '$s%') OR ({$tn}.name LIKE '%$s%')");
+ $this->whereAdd(" ({$tn}.code LIKE '$s%')
+ OR
+ ({$tn}.name LIKE '%$s%')
+ OR
+ join_client_id_id.name LIKE '%$s%'
+ ");
}
// types of project to list ... - default is only the open ones...
if (!empty($q['query']['project_indaterange'])) {
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'];
// DB_DataObjecT::debuglevel(1);
$this->selectAdd();
$this->selectAdd('distinct(client_id)');
- $this->selectAs(DB_DataObject::factory('Companies'), 'client_id_%s','join_client_id_id');
+ $this->selectAs(DB_DataObject::factory('core_company'), 'client_id_%s','join_client_id_id');
$this->groupBy('client_id');
}
}
- 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)) {