Permalink
Browse files

Merge branch 'master' of github.com:web2project/web2project

  • Loading branch information...
2 parents 0a387b4 + fe4a816 commit 958d13df301fd68cbc8051445914ebf7d1693bd0 @caseysoftware caseysoftware committed Mar 31, 2013
Showing with 6 additions and 6 deletions.
  1. +5 −5 modules/contacts/contacts.class.php
  2. +1 −1 modules/tasks/vw_log_update.php
@@ -468,12 +468,12 @@ public static function searchContacts($AppUI = null, $where = '', $searchString
)');
//TODO: We need to convert this from static to use ->overrideDatabase() for testing.
- $q2 = new w2p_Database_Query();
$company = new CCompany;
- $company->setAllowedSQL($AppUI->user_id, $q2);
- $q2->addWhere('company_id IS NULL');
- $q->addWhere('(' . implode(' OR ', $q2->where) . ')');
-
+ $allow_where = $company->getAllowedSQL($AppUI->user_id,'contact_company');
+ if (count($allow_where)) {
+ $q->addWhere('contact_company = 0 OR contact_company IS NULL OR (' . implode(' AND ', $allow_where). ')');
+ }
+
//TODO: We need to convert this from static to use ->overrideDatabase() for testing.
$department = new CDepartment;
$department->setAllowedSQL($AppUI->user_id, $q);
@@ -10,7 +10,7 @@
$task_log_id = (int) w2PgetParam($_GET, 'task_log_id', 0);
$log = new CTask_Log();
-$log->task_log_id = $task_log_id;
+$log->load($task_log_id);
$canAuthor = $log->canCreate();
if (!$canAuthor && !$task_id) {

0 comments on commit 958d13d

Please sign in to comment.