Skip to content
Permalink
Browse files

adjusted the loadAll to make sure permissions are respected

  • Loading branch information...
caseysoftware committed Dec 22, 2013
1 parent 25b6b9b commit 2602ef8f78709183c9298eadc87933f7b6a0fb2a
Showing with 30 additions and 0 deletions.
  1. +30 −0 modules/projects/projects.class.php
@@ -127,6 +127,31 @@ public function loadFull($notUsed = null, $projectId)
$this->budget = $this->getBudget();
}
/**
* Returns an array, keyed by the key field, of all elements that meet
* the where clause provided. Ordered by $order key.
*
* @param null $order
* @param null $where
*
* @return Associative
*/
public function loadAll($order = null, $where = null)
{
$q = $this->_getQuery();
$q->addTable($this->_tbl);
if ($order && property_exists($this, $order)) {
$q->addOrder($order);
}
if ($where) {
$q->addWhere($where);
}
$where = $this->getAllowedSQL($this->_AppUI->user_id, 'projects.project_id');
$q->addWhere($where);
return $q->loadHashList($this->_tbl_key);
}
protected function hook_preDelete()
{
$q = $this->_getQuery();
@@ -1028,6 +1053,11 @@ protected function reset_project_parents(&$projects)
}
}
/**
* FILTER
* @param int $company_id
* @return Array
*/
public function getProjectsByStatus($company_id = 0)
{
$q = $this->_getQuery();

0 comments on commit 2602ef8

Please sign in to comment.
You can’t perform that action at this time.