本文整理汇总了PHP中project::get_foreign_object方法的典型用法代码示例。如果您正苦于以下问题:PHP project::get_foreign_object方法的具体用法?PHP project::get_foreign_object怎么用?PHP project::get_foreign_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类project
的用法示例。
在下文中一共展示了project::get_foreign_object方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: timeSheet
function get_printable_timeSheet_file($timeSheetID, $timeSheetPrintMode, $printDesc, $format)
{
global $TPL;
$TPL["timeSheetID"] = $timeSheetID;
$TPL["timeSheetPrintMode"] = $timeSheetPrintMode;
$TPL["printDesc"] = $printDesc;
$TPL["format"] = $format;
$db = new db_alloc();
if ($timeSheetID) {
$timeSheet = new timeSheet();
$timeSheet->set_id($timeSheetID);
$timeSheet->select();
$timeSheet->set_tpl_values();
$person = $timeSheet->get_foreign_object("person");
$TPL["timeSheet_personName"] = $person->get_name();
$timeSheet->set_tpl_values("timeSheet_");
// Display the project name.
$project = new project();
$project->set_id($timeSheet->get_value("projectID"));
$project->select();
$TPL["timeSheet_projectName"] = $project->get_value("projectName", DST_HTML_DISPLAY);
// Get client name
$client = $project->get_foreign_object("client");
$client->set_tpl_values();
$TPL["clientName"] = $client->get_value("clientName", DST_HTML_DISPLAY);
$TPL["companyName"] = config::get_config_item("companyName");
$TPL["companyNos1"] = config::get_config_item("companyACN");
$TPL["companyNos2"] = config::get_config_item("companyABN");
unset($br);
$phone = config::get_config_item("companyContactPhone");
$fax = config::get_config_item("companyContactFax");
$phone and $TPL["phone"] = "Ph: " . $phone;
$fax and $TPL["fax"] = "Fax: " . $fax;
$timeSheet->load_pay_info();
$db->query(prepare("SELECT max(dateTimeSheetItem) AS maxDate\n ,min(dateTimeSheetItem) AS minDate\n ,count(timeSheetItemID) as count\n FROM timeSheetItem \n WHERE timeSheetID=%d ", $timeSheetID));
$db->next_record();
$timeSheet->set_id($timeSheetID);
$timeSheet->select() || alloc_error("Unable to select time sheet, trying to use id: " . $timeSheetID);
$TPL["period"] = format_date(DATE_FORMAT, $db->f("minDate")) . " to " . format_date(DATE_FORMAT, $db->f("maxDate"));
$TPL["img"] = config::get_config_item("companyImage");
$TPL["companyContactAddress"] = config::get_config_item("companyContactAddress");
$TPL["companyContactAddress2"] = config::get_config_item("companyContactAddress2");
$TPL["companyContactAddress3"] = config::get_config_item("companyContactAddress3");
$email = config::get_config_item("companyContactEmail");
$email and $TPL["companyContactEmail"] = "Email: " . $email;
$web = config::get_config_item("companyContactHomePage");
$web and $TPL["companyContactHomePage"] = "Web: " . $web;
$TPL["footer"] = config::get_config_item("timeSheetPrintFooter");
$TPL["taxName"] = config::get_config_item("taxName");
$default_header = "Time Sheet";
$default_id_label = "Time Sheet ID";
$default_contractor_label = "Contractor";
$default_total_label = "TOTAL AMOUNT PAYABLE";
if ($timeSheetPrintMode == "money") {
$default_header = "Tax Invoice";
$default_id_label = "Invoice Number";
}
if ($timeSheetPrintMode == "estimate") {
$default_header = "Estimate";
$default_id_label = "Estimate Number";
$default_contractor_label = "Issued By";
$default_total_label = "TOTAL AMOUNT ESTIMATED";
}
if ($format != "html") {
// Build PDF document
$font1 = ALLOC_MOD_DIR . "util/fonts/Helvetica.afm";
$font2 = ALLOC_MOD_DIR . "util/fonts/Helvetica-Oblique.afm";
$pdf_table_options = array("showLines" => 0, "shaded" => 0, "showHeadings" => 0, "xPos" => "left", "xOrientation" => "right", "fontSize" => 10, "rowGap" => 0, "fontSize" => 10);
$cols = array("one" => "", "two" => "", "three" => "", "four" => "");
$cols3 = array("one" => "", "two" => "");
$cols_settings["one"] = array("justification" => "right");
$cols_settings["three"] = array("justification" => "right");
$pdf_table_options2 = array("showLines" => 0, "shaded" => 0, "showHeadings" => 0, "width" => 400, "fontSize" => 10, "xPos" => "center", "xOrientation" => "center", "cols" => $cols_settings);
$cols_settings2["gst"] = array("justification" => "right");
$cols_settings2["money"] = array("justification" => "right");
$pdf_table_options3 = array("showLines" => 2, "shaded" => 0, "width" => 400, "xPos" => "center", "fontSize" => 10, "cols" => $cols_settings2, "lineCol" => array(0.8, 0.8, 0.8), "splitRows" => 1, "protectRows" => 0);
$cols_settings["two"] = array("justification" => "right", "width" => 80);
$pdf_table_options4 = array("showLines" => 2, "shaded" => 0, "width" => 400, "showHeadings" => 0, "fontSize" => 10, "xPos" => "center", "cols" => $cols_settings, "lineCol" => array(0.8, 0.8, 0.8));
$pdf = new Cezpdf();
$pdf->ezSetMargins(90, 90, 90, 90);
$pdf->selectFont($font1);
$pdf->ezStartPageNumbers(436, 80, 10, 'right', 'Page {PAGENUM} of {TOTALPAGENUM}');
$pdf->ezStartPageNumbers(200, 80, 10, 'left', '<b>' . $default_id_label . ': </b>' . $TPL["timeSheetID"]);
$pdf->ezSetY(775);
$TPL["companyName"] and $contact_info[] = array($TPL["companyName"]);
$TPL["companyContactAddress"] and $contact_info[] = array($TPL["companyContactAddress"]);
$TPL["companyContactAddress2"] and $contact_info[] = array($TPL["companyContactAddress2"]);
$TPL["companyContactAddress3"] and $contact_info[] = array($TPL["companyContactAddress3"]);
$TPL["companyContactEmail"] and $contact_info[] = array($TPL["companyContactEmail"]);
$TPL["companyContactHomePage"] and $contact_info[] = array($TPL["companyContactHomePage"]);
$TPL["phone"] and $contact_info[] = array($TPL["phone"]);
$TPL["fax"] and $contact_info[] = array($TPL["fax"]);
$pdf->selectFont($font2);
$y = $pdf->ezTable($contact_info, false, "", $pdf_table_options);
$pdf->selectFont($font1);
$line_y = $y - 10;
$pdf->setLineStyle(1, "round");
$pdf->line(90, $line_y, 510, $line_y);
$pdf->ezSetY(782);
$image_jpg = ALLOC_LOGO;
//.........这里部分代码省略.........
示例2: count
if (!$projectManagers) {
$TPL["managers"] = "N/A";
$TPL["timeSheet_dateSubmittedToManager"] = "N/A";
$TPL["timeSheet_approvedByManagerPersonID_username"] = "N/A";
} else {
count($projectManagers) > 1 and $TPL["manager_plural"] = "s";
$people =& get_cached_table("person");
foreach ($projectManagers as $pID) {
$TPL["managers"] .= $commar . $people[$pID]["name"];
$commar = ", ";
}
}
$clientID = $project->get_value("clientID");
$projectID = $project->get_id();
// Get client name
$client = $project->get_foreign_object("client");
$TPL["clientName"] = $client_link;
$TPL["clientID"] = $clientID = $client->get_id();
$TPL["show_client_options"] = $client_link;
}
list($client_select, $client_link, $project_select, $project_link) = client::get_client_and_project_dropdowns_and_links($clientID, $projectID, true);
$TPL["invoice_link"] = $timeSheet->get_invoice_link();
list($amount_used, $amount_allocated) = $timeSheet->get_amount_allocated();
if ($amount_allocated) {
$TPL["amount_allocated_label"] = "Amount Used / Allocated:";
$TPL["amount_allocated"] = $amount_allocated;
$TPL["amount_used"] = $amount_used . " / ";
}
if (!$timeSheet->get_id() || $timeSheet->get_value("status") == "edit" || $timeSheet->get_value("status") == "rejected") {
$TPL["show_project_options"] = $project_select;
$TPL["show_client_options"] = $client_select;
示例3: get_people
/**
* Convert a comma separated string of names, into an array with email addresses
* @param string $people
* @param string $entity the related entity that can assist in the look up
* @param integer $entityID the id of the related entity
* @return array an array of people, indexed by their email address
*/
public function get_people($options = array(), $entity = "", $entityID = "")
{
$person_table =& get_cached_table("person");
$people = $options;
if ($entity && $entityID) {
$e = new $entity();
$e->set_id($entityID);
$e->select();
in_array("default", $people) and $default_recipients = $e->get_all_parties();
in_array("internal", $people) and $internal_recipients = $e->get_all_parties();
}
// remove default and internal from the array
$clean_people = array_diff($people, array("default", "internal"));
if (is_object($e)) {
$projectID = $e->get_project_id();
$p = new project();
$p->set_id($projectID);
$p->select();
$client = $p->get_foreign_object("client");
$clientID = $client->get_id();
}
foreach ((array) $default_recipients as $email => $info) {
if ($info["selected"]) {
$rtn[$email] = $this->reduce_person_info($info);
}
}
foreach ((array) $internal_recipients as $email => $info) {
if ($info["selected"] && !$info["external"]) {
$rtn[$email] = $this->reduce_person_info($info);
}
}
foreach ((array) $clean_people as $person) {
$bad_person = true;
$person = trim($person);
// personID
if (is_numeric($person)) {
if ($person_table[$person]["personActive"]) {
$rtn[$person_table[$person]["emailAddress"]] = $person_table[$person];
$bad_person = false;
continue;
}
// email addresses
} else {
if (in_str("@", $person)) {
foreach ($person_table as $pid => $data) {
if (same_email_address($person, $data["emailAddress"]) && $data["personActive"]) {
$rtn[$data["emailAddress"]] = $data;
$bad_person = false;
continue 2;
}
}
if ($ccID = clientContact::find_by_email($person)) {
$cc = new clientContact();
$cc->set_id($ccID);
$cc->select();
$rtn[$cc->get_value("clientContactEmail")] = $cc->row();
$bad_person = false;
continue;
}
// If we get here, then return the email address entered
list($e, $n) = parse_email_address($person);
$rtn[$e] = array("emailAddress" => $e, "name" => $n);
$bad_person = false;
continue;
// usernames, partial and full names
} else {
foreach ($person_table as $pid => $data) {
// If matches username
if (strtolower($person) == strtolower($data["username"]) && $data["personActive"]) {
$rtn[$data["emailAddress"]] = $data;
$bad_person = false;
continue 2;
}
}
foreach ($person_table as $pid => $data) {
// If matches name
if (strtolower($person) == strtolower($data["firstName"] . " " . $data["surname"]) && $data["personActive"]) {
$rtn[$data["emailAddress"]] = $data;
$bad_person = false;
continue 2;
}
}
foreach ($person_table as $pid => $data) {
// If matches a section of name, eg: a search for "Ale" will match the full name "Alex Lance"
if (strtolower($person) == strtolower(substr(strtolower($data["firstName"] . " " . $data["surname"]), 0, strlen($person))) && $data["personActive"]) {
$rtn[$data["emailAddress"]] = $data;
$bad_person = false;
continue 2;
}
}
if ($ccID = clientContact::find_by_nick($person, $clientID)) {
$cc = new clientContact();
$cc->set_id($ccID);
//.........这里部分代码省略.........