本文整理汇总了PHP中client::get_all_parties方法的典型用法代码示例。如果您正苦于以下问题:PHP client::get_all_parties方法的具体用法?PHP client::get_all_parties怎么用?PHP client::get_all_parties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类client
的用法示例。
在下文中一共展示了client::get_all_parties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: singleton
function get_all_parties($projectID = false, $task_exists = false)
{
$current_user =& singleton("current_user");
if (!$projectID && is_object($this)) {
$projectID = $this->get_id();
}
if ($projectID) {
$extra_interested_parties = config::get_config_item("defaultInterestedParties");
foreach ((array) $extra_interested_parties as $name => $email) {
$interestedPartyOptions[$email]["name"] = $name;
}
// Get primary client contact from Project page
$db = new db_alloc();
$q = prepare("SELECT projectClientName,projectClientEMail FROM project WHERE projectID = %d", $projectID);
$db->query($q);
$db->next_record();
$interestedPartyOptions[$db->f("projectClientEMail")]["name"] = $db->f("projectClientName");
$interestedPartyOptions[$db->f("projectClientEMail")]["external"] = "1";
// Get all other client contacts from the Client pages for this Project
$q = prepare("SELECT clientID FROM project WHERE projectID = %d", $projectID);
$db->query($q);
$db->next_record();
$clientID = $db->f("clientID");
if ($clientID) {
$client = new client($clientID);
$interestedPartyOptions = array_merge((array) $interestedPartyOptions, (array) $client->get_all_parties());
}
// Get all the project people for this tasks project
$q = prepare("SELECT emailAddress, firstName, surname, person.personID, username\n FROM projectPerson \n LEFT JOIN person on projectPerson.personID = person.personID \n WHERE projectPerson.projectID = %d AND person.personActive = 1 ", $projectID);
$db->query($q);
while ($db->next_record()) {
unset($name);
$db->f("firstName") && $db->f("surname") and $name = $db->f("firstName") . " " . $db->f("surname");
$name or $name = $db->f("username");
$interestedPartyOptions[$db->f("emailAddress")]["name"] = $name;
$interestedPartyOptions[$db->f("emailAddress")]["personID"] = $db->f("personID");
$interestedPartyOptions[$db->f("emailAddress")]["internal"] = true;
}
}
if (is_object($current_user) && $current_user->get_id()) {
$interestedPartyOptions[$current_user->get_value("emailAddress")]["name"] = $current_user->get_name();
$interestedPartyOptions[$current_user->get_value("emailAddress")]["personID"] = $current_user->get_id();
}
// return an aggregation of the current task/proj/client parties + the existing interested parties
$interestedPartyOptions = interestedParty::get_interested_parties("project", $projectID, $interestedPartyOptions, $task_exists);
return (array) $interestedPartyOptions;
}
示例2: array
function get_all_parties($projectID = "", $clientID = "")
{
$db = new db_alloc();
$interestedPartyOptions = array();
if (!$projectID && is_object($this)) {
$projectID = $this->get_value("projectID");
}
if ($projectID) {
$project = new project($projectID);
$interestedPartyOptions = $project->get_all_parties();
}
if ($clientID) {
$client = new client($clientID);
$interestedPartyOptions = array_merge((array) $interestedPartyOptions, (array) $client->get_all_parties());
}
$extra_interested_parties = config::get_config_item("defaultInterestedParties") or $extra_interested_parties = array();
foreach ($extra_interested_parties as $name => $email) {
$interestedPartyOptions[$email] = array("name" => $name);
}
// return an aggregation of the current task/proj/client parties + the existing interested parties
$interestedPartyOptions = interestedParty::get_interested_parties("invoice", $this->get_id(), $interestedPartyOptions);
return $interestedPartyOptions;
}