forked from plribeiro3000/dotproject-audit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcproject_audit.class.php
More file actions
34 lines (30 loc) · 1.34 KB
/
cproject_audit.class.php
File metadata and controls
34 lines (30 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
if (!defined('DP_BASE_DIR')) {
die('You should not access this file directly.');
}
require_once($AppUI->getModuleClass('projects'));
class CProjectAudit extends CProject {
function GetContacts($project_id) {
$this->_query->clear();
$this->_query->addTable('contacts', 'contacts');
$this->_query->addJoin('project_contacts', 'project_contacts', 'contacts.contact_id = project_contacts.contact_id');
$this->_query->addWhere('project_contacts.project_id = '.$project_id);
$sql = $this->_query->prepare();
return db_loadHashList($sql, 'contact_id');
}
function GetAuditors($project_id) {
$this->_query->clear();
$this->_query->addTable('contacts', 'contacts');
$this->_query->addJoin('auditors', 'auditors', 'contacts.contact_id = auditors.contact_id');
$this->_query->addWhere('auditors.project_id = '.$project_id);
$sql = $this->_query->prepare();
return db_loadHashList($sql, 'contact_id');
}
function isAuditor($project_id, $contact_id){
$this->_query->clear();
$this->_query->addTable('auditors', 'auditors');
$this->_query->addWhere('auditors.project_id = '.$project_id.' and auditors.contact_id = '.$contact_id);
$sql = $this->_query->prepare();
return db_loadHashList($sql, 'contact_id');
}
}