当前位置: 首页>>代码示例>>PHP>>正文


PHP person::set_id方法代码示例

本文整理汇总了PHP中person::set_id方法的典型用法代码示例。如果您正苦于以下问题:PHP person::set_id方法的具体用法?PHP person::set_id怎么用?PHP person::set_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在person的用法示例。


在下文中一共展示了person::set_id方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show_users_stats

function show_users_stats($template)
{
    global $TPL;
    global $db;
    $stats = new stats();
    $projects = $stats->project_stats();
    $tasks = $stats->task_stats();
    $comments = $stats->comment_stats();
    $persons = array();
    $query = "SELECT * FROM person ORDER BY username";
    $db->query($query);
    while ($db->next_record()) {
        $person = new person();
        $person->read_db_record($db);
        array_push($persons, $person->get_id());
    }
    usort($persons, "compare");
    for ($i = 0; $i < count($persons); $i++) {
        $person = new person();
        $person->set_id($persons[$i]);
        $person->select();
        $TPL["user_username"] = $person->get_value("username");
        $TPL["user_projects_current"] = $projects["current"][$person->get_id()] + 0;
        $TPL["user_projects_total"] = $projects["current"][$person->get_id()] + $projects["archived"][$person->get_id()];
        $TPL["user_tasks_current"] = $tasks["current"][$person->get_id()] + 0;
        $TPL["user_tasks_total"] = $tasks["current"][$person->get_id()] + $tasks["completed"][$person->get_id()];
        $TPL["user_comments_total"] = $comments["total"][$person->get_id()] + 0;
        $TPL["user_graph"] = "<a href=\"" . $TPL["url_alloc_statsImage"] . "id=" . $person->get_id() . "&width=640&multiplier=8&labels=true\">";
        $TPL["user_graph"] .= "<img alt=\"User graph\" src=\"" . $TPL["url_alloc_statsImage"] . "id=" . $person->get_id() . "&width=400&multiplier=2\"></a>";
        if ($TPL["user_projects_total"] + $TPL["user_tasks_total"] + $TPL["user_comments_total"] > 0) {
            $TPL["odd_even"] = $TPL["odd_even"] == "odd" ? "even" : "odd";
            include_template($template);
        }
    }
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:35,代码来源:stats.php

示例2: show_overdue

function show_overdue($template_name)
{
    global $db;
    global $TPL;
    $current_user =& singleton("current_user");
    $db = new db_alloc();
    $temp = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
    $today = date("Y", $temp) . "-" . date("m", $temp) . "-" . date("d", $temp);
    $q = prepare("SELECT itemName,itemType,item.itemID,dateBorrowed,dateToBeReturned,loan.personID \n                  FROM loan,item \n                 WHERE dateToBeReturned < '%s' \n\t\t\t\t\t         AND dateReturned = '0000-00-00' \n\t\t\t\t\t         AND item.itemID = loan.itemID\n               ", $today);
    if (!have_entity_perm("loan", PERM_READ, $current_user, false)) {
        $q .= prepare("AND loan.personID = %d", $current_user->get_id());
    }
    $db->query($q);
    while ($db->next_record()) {
        $i++;
        $item = new item();
        $loan = new loan();
        $item->read_db_record($db);
        $loan->read_db_record($db);
        $item->set_values();
        $loan->set_values();
        $person = new person();
        $person->set_id($loan->get_value("personID"));
        $person->select();
        $TPL["person"] = $person->get_name();
        $TPL["overdue"] = "<a href=\"" . $TPL["url_alloc_item"] . "itemID=" . $item->get_id() . "&return=true\">Overdue!</a>";
        include_template($template_name);
    }
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:29,代码来源:itemLoan.php

示例3: meta

$TPL["fromTfOptions"] = page::select_options($options, $selectedTfID);
$m = new meta("currencyType");
$currencyOps = $m->get_assoc_array("currencyTypeID", "currencyTypeID");
$TPL["currencyTypeOptions"] = page::select_options($currencyOps, $transaction_to_edit->get_value("currencyTypeID"));
if (is_object($expenseForm) && $expenseForm->get_value("clientID")) {
    $clientID_sql = prepare(" AND clientID = %d", $expenseForm->get_value("clientID"));
}
$q = "SELECT projectID AS value, projectName AS label \n        FROM project \n       WHERE projectStatus = 'Current' \n             " . $clientID_sql . " \n    ORDER BY projectName";
$TPL["projectOptions"] = page::select_options($q, $selectedProjectID);
if (is_object($expenseForm)) {
    $expenseForm->set_values();
    $TPL["expenseFormID"] = $expenseForm->get_id();
}
if (is_object($expenseForm) && $expenseForm->get_value("expenseFormCreatedUser")) {
    $p = new person();
    $p->set_id($expenseForm->get_value("expenseFormCreatedUser"));
    $p->select();
    $TPL["user"] = $p->get_name();
}
if ($_POST["cancel"]) {
    if (is_object($expenseForm)) {
        $expenseForm->delete_transactions();
        $expenseForm->delete();
        alloc_redirect($TPL["url_alloc_expenseFormList"]);
    } else {
        alloc_error("Unable to delete Expense Form");
    }
} else {
    if ($_POST["changeTransactionStatus"] == "pending") {
        $expenseForm->set_value("expenseFormComment", rtrim($expenseForm->get_value("expenseFormComment")));
        $expenseForm->save();
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:expenseForm.php

示例4: person

if ($task->get_value("closerID") && $task->get_value("dateClosed")) {
    $TPL["task_closed_by"] = person::get_fullname($task->get_value("closerID"));
    $TPL["task_closed_when"] = $task->get_value("dateClosed");
}
$person = new person();
$person->set_id($task->get_value("personID"));
$person->select();
$TPL["person_username"] = $person->get_name();
$TPL["person_username_personID"] = $person->get_id();
$manager = new person();
$manager->set_id($task->get_value("managerID"));
$manager->select();
$TPL["manager_username"] = $manager->get_name();
$TPL["manager_username_personID"] = $manager->get_id();
$estimator = new person();
$estimator->set_id($task->get_value("estimatorID"));
$estimator->select();
$TPL["estimator_username"] = $estimator->get_name();
$TPL["estimator_username_personID"] = $estimator->get_id();
// If we've been sent here by a "New Message" or "New Fault" option in the Quick List dropdown
if (!$taskID && $_GET["tasktype"]) {
    $task->set_value("taskTypeID", $_GET["tasktype"]);
}
// If we've been sent here by a "New Task" link from the calendar
if (!$taskID && $_GET["dateTargetStart"]) {
    $TPL["task_dateTargetStart"] = $_GET["dateTargetStart"];
    $task->set_value("personID", $_GET["personID"]);
}
// Set options for the dropdown boxen
$task->set_option_tpl_values();
$time_billed = $task->get_time_billed(false);
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:task.php

示例5: singleton

 function set_option_tpl_values()
 {
     // Set template values to provide options for edit selects
     global $TPL;
     $current_user =& singleton("current_user");
     global $isMessage;
     $db = new db_alloc();
     $projectID = $_GET["projectID"] or $projectID = $this->get_value("projectID");
     $TPL["personOptions"] = "<select name=\"personID\"><option value=\"\">" . $this->get_personList_dropdown($projectID, "personID") . "</select>";
     $TPL["managerPersonOptions"] = "<select name=\"managerID\"><option value=\"\">" . $this->get_personList_dropdown($projectID, "managerID") . "</select>";
     $TPL["estimatorPersonOptions"] = "<select name=\"estimatorID\"><option value=\"\">" . $this->get_personList_dropdown($projectID, "estimatorID") . "</select>";
     // TaskType Options
     $taskType = new meta("taskType");
     $taskType_array = $taskType->get_assoc_array("taskTypeID", "taskTypeID");
     $TPL["taskTypeOptions"] = page::select_options($taskType_array, $this->get_value("taskTypeID"));
     // Project dropdown
     $TPL["projectOptions"] = task::get_project_options($projectID);
     // We're building these two with the <select> tags because they will be
     // replaced by an AJAX created dropdown when the projectID changes.
     $TPL["parentTaskOptions"] = $this->get_parent_task_select();
     $TPL["interestedPartyOptions"] = $this->get_task_cc_list_select();
     $db->query(prepare("SELECT fullName, emailAddress, clientContactPhone, clientContactMobile\n                          FROM interestedParty\n                     LEFT JOIN clientContact ON interestedParty.clientContactID = clientContact.clientContactID\n                         WHERE entity='task' \n                           AND entityID = %d\n                           AND interestedPartyActive = 1\n                      ORDER BY fullName", $this->get_id()));
     while ($db->next_record()) {
         $value = interestedParty::get_encoded_interested_party_identifier($db->f("fullName"), $db->f("emailAddress"));
         $phone = array("p" => $db->f('clientContactPhone'), "m" => $db->f('clientContactMobile'));
         $TPL["interestedParties"][] = array('key' => $value, 'name' => $db->f("fullName"), 'email' => $db->f("emailAddress"), 'phone' => $phone);
     }
     $TPL["task_taskStatusLabel"] = $this->get_task_status("label");
     $TPL["task_taskStatusColour"] = $this->get_task_status("colour");
     $TPL["task_taskStatusValue"] = $this->get_value("taskStatus");
     $TPL["task_taskStatusOptions"] = page::select_options(task::get_task_statii_array(true), $this->get_value("taskStatus"));
     // Project label
     if (has("project")) {
         $p = new project();
         $p->set_id($this->get_value("projectID"));
         $p->select();
         $TPL["projectName"] = $p->get_display_value();
     }
     $taskPriorities = config::get_config_item("taskPriorities") or $taskPriorities = array();
     $projectPriorities = config::get_config_item("projectPriorities") or $projectPriorities = array();
     $priority = $this->get_value("priority") or $priority = 3;
     $TPL["priorityOptions"] = page::select_options(array_kv($taskPriorities, null, "label"), $priority);
     $TPL["priorityLabel"] = " <div style=\"display:inline; color:" . $taskPriorities[$priority]["colour"] . "\">[";
     if (is_object($p)) {
         list($priorityFactor, $daysUntilDue) = $this->get_overall_priority($p->get_value("projectPriority"), $this->get_value("priority"), $this->get_value("dateTargetCompletion"));
         $str = "Task priority: " . $taskPriorities[$this->get_value("priority")]["label"] . "<br>";
         $str .= "Project priority: " . $projectPriorities[$p->get_value("projectPriority")]["label"] . "<br>";
         $str .= "Days until due: " . $daysUntilDue . "<br>";
         $str .= "Calculated priority: " . $priorityFactor;
         $TPL["priorityLabel"] .= page::help($str, $this->get_priority_label());
     } else {
         $TPL["priorityLabel"] .= $this->get_priority_label();
     }
     $TPL["priorityLabel"] .= "]</div>";
     // If we're viewing the printer friendly view
     if ($_GET["media"] == "print") {
         // Parent Task label
         $t = new task();
         $t->set_id($this->get_value("parentTaskID"));
         $t->select();
         $TPL["parentTask"] = $t->get_display_value();
         // Task Type label
         $TPL["taskType"] = $this->get_value("taskTypeID");
         // Priority
         $TPL["priority"] = $this->get_value("priority");
         // Assignee label
         $p = new person();
         $p->set_id($this->get_value("personID"));
         $p->select();
         $TPL["person"] = $p->get_display_value();
     }
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:72,代码来源:task.inc.php

示例6: person

            }
        }
    }
}
// display the approved by admin and managers name and date
$person = new person();
if ($timeSheet->get_value("approvedByManagerPersonID")) {
    $person_approvedByManager = new person();
    $person_approvedByManager->set_id($timeSheet->get_value("approvedByManagerPersonID"));
    $person_approvedByManager->select();
    $TPL["timeSheet_approvedByManagerPersonID_username"] = $person_approvedByManager->get_name();
    $TPL["timeSheet_approvedByManagerPersonID"] = $timeSheet->get_value("approvedByManagerPersonID");
}
if ($timeSheet->get_value("approvedByAdminPersonID")) {
    $person_approvedByAdmin = new person();
    $person_approvedByAdmin->set_id($timeSheet->get_value("approvedByAdminPersonID"));
    $person_approvedByAdmin->select();
    $TPL["timeSheet_approvedByAdminPersonID_username"] = $person_approvedByAdmin->get_name();
    $TPL["timeSheet_approvedByAdminPersonID"] = $timeSheet->get_value("approvedByAdminPersonID");
}
// display the project name.
if (($timeSheet->get_value("status") == 'edit' || $timeSheet->get_value("status") == 'rejected') && !$timeSheet->get_value("projectID")) {
    $query = prepare("SELECT * FROM project WHERE projectStatus = 'Current' ORDER by projectName");
    #.prepare("  LEFT JOIN projectPerson on projectPerson.projectID = project.projectID ")
    #.prepare("WHERE projectPerson.personID = '%d' ORDER BY projectName", $current_user->get_id());
} else {
    $query = prepare("SELECT * FROM project ORDER by projectName");
}
// This needs to be just above the newTimeSheet_projectID logic
$projectID = $timeSheet->get_value("projectID");
// If we are entering the page from a project link: New time sheet
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:timeSheet.php

示例7: singleton

 function load_productSale_filter($_FORM)
 {
     $current_user =& singleton("current_user");
     // display the list of project name.
     $db = new db_alloc();
     if (!$_FORM['showAllProjects']) {
         $filter = "WHERE projectStatus = 'Current' ";
     }
     $query = prepare("SELECT projectID AS value, projectName AS label FROM project {$filter} ORDER by projectName");
     $rtn["show_project_options"] = page::select_options($query, $_FORM["projectID"], 70);
     // display the list of user name.
     if (have_entity_perm("productSale", PERM_READ, $current_user, false)) {
         $rtn["show_userID_options"] = page::select_options(person::get_username_list(), $_FORM["personID"]);
     } else {
         $person = new person();
         $person->set_id($current_user->get_id());
         $person->select();
         $person_array = array($current_user->get_id() => $person->get_name());
         $rtn["show_userID_options"] = page::select_options($person_array, $_FORM["personID"]);
     }
     // display a list of status
     $status_array = productSale::get_statii();
     unset($status_array["create"]);
     $rtn["show_status_options"] = page::select_options($status_array, $_FORM["status"]);
     // display the date from filter value
     $rtn["showAllProjects"] = $_FORM["showAllProjects"];
     $options["clientStatus"] = array("Current");
     $options["return"] = "dropdown_options";
     $ops = client::get_list($options);
     $ops = array_kv($ops, "clientID", "clientName");
     $rtn["clientOptions"] = page::select_options($ops, $_FORM["clientID"]);
     // Get
     $rtn["FORM"] = "FORM=" . urlencode(serialize($_FORM));
     return $rtn;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:35,代码来源:productSale.inc.php

示例8: while

     }
 }
 if ($_POST["field_quotes"] == "single") {
     $quotes = "'";
 }
 if ($_POST["field_quotes"] == "double") {
     $quotes = "\"";
 }
 while ($db->next_record()) {
     $odd_even = $odd_even == "even" ? "odd" : "even";
     $TPL["result_row"] .= sprintf($start_row_separator, $odd_even);
     foreach ($fields as $k => $field) {
         $field = end(explode(".", $field));
         if (stripos("ModifiedUser", $field) !== FALSE || stripos("personID", $field) !== FALSE) {
             $person = new person();
             $person->set_id($db->f($field));
             $person->select();
             $result = $person->get_name(array("format" => "nick"));
         } else {
             if (stripos("tfID", $field) !== FALSE) {
                 $result = tf::get_name($db->f($field));
             } else {
                 $result = $db->f($field);
             }
         }
         $TPL["result_row"] .= $start_field_separator;
         $TPL["result_row"] .= $quotes . $result . $quotes;
         if (isset($fields[$k + 1]) || !$_POST["generate_file"]) {
             $TPL["result_row"] .= $end_field_separator;
         }
     }
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:report.php

示例9: person

*/
define("NO_AUTH", true);
define("IS_GOD", true);
require_once "../alloc.php";
if (date("D") == "Sat" || date("D") == "Sun") {
    alloc_error("IT'S THE WEEKEND - GET OUTTA HERE", true);
}
// Do announcements ONCE up here.
$announcement = person::get_announcements_for_email();
$db = new db_alloc();
$db->query("SELECT personID,emailAddress,firstName,surname FROM person WHERE personActive = '1'");
// AND username='alla'"); // or username=\"ashridah\"");
while ($db->next_record()) {
    $person = new person();
    $person->read_db_record($db);
    $person->set_id($db->f("personID"));
    $person->load_prefs();
    if (!$person->prefs["dailyTaskEmail"]) {
        continue;
    }
    $msg = "";
    $tasks = "";
    $to = "";
    if ($announcement["heading"]) {
        $msg .= $announcement["heading"];
        $msg .= "\n" . $announcement["body"] . "\n";
        $msg .= "\n- - - - - - - - - -\n";
    }
    if ($person->get_value("emailAddress")) {
        $tasks = $person->get_tasks_for_email();
        $msg .= $tasks;
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:sendEmail.php

示例10: person

    }
}
if ($_POST["returnItem"]) {
    $dbTemp = new db_alloc();
    $dbTemp->query("select * from loan where itemID=%d and dateReturned='0000-00-00'", $itemID);
    $db = new db_alloc();
    $db->query("select * from loan where loan.itemID=%d and dateBorrowed>dateReturned", $itemID);
    $db->next_record();
    $loan->set_id($db->f("loanID"));
    if ($loan->select()) {
        $loan->set_value("dateReturned", $today);
        $loan->set_value("itemID", $itemID);
        // check to see if admin/manager returning someone elses item, and sent email
        if ($loan->get_value("personID") != $current_user->get_id()) {
            if ($current_user->have_role("admin") || $current_user->have_role("manage")) {
                $person = new person();
                $person->set_id($loan->get_value("personID"));
                $person->select();
                $loan->save();
            }
        } else {
            $loan->save();
        }
    }
    alloc_redirect($TPL["url_alloc_loanAndReturn"]);
}
if ($_GET["return"]) {
    include_template("templates/itemReturnM.tpl");
} else {
    include_template("templates/itemBorrowM.tpl");
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:item.php

示例11: export_csv

function export_csv($projectID)
{
    $project = new project();
    $project->set_id($projectID);
    $project->select();
    $retstr = '"Task Name","Estimated Time","Assignee"';
    // Export all tasks in the project
    $taskOptions["projectIDs"] = array($project->get_id());
    $taskOptions["return"] = "array";
    $taskOptions["taskView"] = "byProject";
    $tasks = task::get_list($taskOptions);
    // Sort by taskID--we assume taskIDs were assigned linearly on import/creation--so as to produce an identical file
    foreach ($tasks as $task) {
        $taskIDs[] = $task['taskID'];
    }
    array_multisort($taskIDs, $tasks);
    foreach ($tasks as $task) {
        $assignee = new person();
        $assignee->set_id($task['personID']);
        $assignee->select();
        $estimatedHours = $task['timeExpected'];
        is_numeric($estimatedHours) or $estimatedHours = 0;
        $retstr .= "\n" . export_escape_csv($task['taskName']) . ',' . export_escape_csv($estimatedHours) . ',' . export_escape_csv($assignee->get_name(array("format" => "nick")));
    }
    return $retstr;
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:26,代码来源:import_export.inc.php

示例12: include_management_fields

{
    global $skill_header;
    return $skill_header;
}
function include_management_fields()
{
    global $person;
    if ($person->have_perm(PERM_PERSON_READ_MANAGEMENT)) {
        include_template("templates/personManagementFieldsS.tpl");
    }
}
$skill_header = false;
$person = new person();
$personID = $_POST["personID"] or $personID = $_GET["personID"];
if ($personID) {
    $person->set_id($personID);
    $person->select();
}
if ($_POST["personExpertiseItem_add"] || $_POST["personExpertiseItem_save"] || $_POST["personExpertiseItem_delete"]) {
    $proficiency = new proficiency();
    $proficiency->read_globals();
    if ($_POST["skillID"] != null) {
        if ($_POST["personExpertiseItem_delete"]) {
            $proficiency->delete();
        } else {
            if ($_POST["personExpertiseItem_save"]) {
                $proficiency->save();
            } else {
                if ($_POST["personExpertiseItem_add"]) {
                    // skillID is an array if when adding but not when saving or deleting
                    $skillProficiency = $proficiency->get_value('skillProficiency');
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:person.php

示例13: sprintf

 function get_stats_for_email($format)
 {
     if ($format == "html") {
         $msg = "<br><br><h4>Alloc Stats For Today</h4>";
         $msg .= sprintf("%d New and %d Active Projects<br><br>", $this->projects["new"]["total"], $this->projects["current"]["total"]);
         $msg .= "<table >";
     } else {
         $msg = "\n- - - - - - - - - -\n";
         $msg .= "Alloc Stats For Today\n";
         $msg .= "\n";
         $msg .= sprintf("%d New and %d Active Projects\n", $this->projects["new"]["total"], $this->projects["current"]["total"]);
         $msg .= "\n";
         $msg .= "Top Users:\n";
     }
     $num_users = 3;
     for ($i = 0; $i < $num_users && $i < count($this->persons); $i++) {
         $person = new person();
         $person->set_id($this->persons[$i]["id"]);
         $person->select();
         if ($format == "html") {
             $msg .= "<tr>";
             $msg .= sprintf("<td>%s has</td>", $person->get_value("username"));
             $msg .= sprintf("<td>%d New and</td>", $this->tasks["new"][$person->get_id()]["total"]);
             $msg .= sprintf("<td>%d Active Tasks</td>", $this->tasks["current"][$person->get_id()]);
             $msg .= "</tr>";
         } else {
             $msg .= sprintf("* %-15s %-15s %s\n", sprintf("%s has", $person->get_value("username")), sprintf("%d New and", $this->tasks["new"][$person->get_id()]["total"]), sprintf("%d Active Tasks", $this->tasks["current"][$person->get_id()]));
         }
     }
     if ($format == "html") {
         $msg .= "<hr />\nTo disable these daily emails, change the \"Daily Email\" setting on the Personal page.\n";
         $msg .= "</table>";
     } else {
         $msg .= "\n- - - - - - - - - -\nTo disable these daily emails, change the \"Daily Email\" setting on the Personal page.\n";
     }
     return $msg;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:37,代码来源:stats.inc.php

示例14: date

 function find_email($debug = false, $get_blobs = false, $ignore_date = false)
 {
     $info = inbox::get_mail_info();
     $mailbox = $this->get_value("commentMaster") . $this->get_value("commentMasterID");
     $mail = new email_receive($info);
     $mail->open_mailbox(config::get_config_item("allocEmailFolder") . "/" . $mailbox, OP_HALFOPEN + OP_READONLY);
     $mail->check_mail();
     $msg_nums = $mail->get_all_email_msg_uids();
     $debug and print "<hr><br><b>find_email(): " . date("Y-m-d H:i:s") . " found " . count($msg_nums) . " emails for mailbox: " . $mailbox . "</b>";
     // fetch and parse email
     foreach ((array) $msg_nums as $num) {
         $debug and print "<hr><br>Examining message number: " . $num;
         unset($mimebits);
         // this will stream output
         $mail->set_msg($num);
         $mail->get_msg_header();
         $text = $mail->fetch_mail_text();
         list($from1, $e1n) = parse_email_address($mail->mail_headers["from"]);
         list($from2, $e2n) = parse_email_address($this->get_value("commentCreatedUserText"));
         if (!$from2 && $this->get_value("commentCreatedUser")) {
             $p = new person();
             $p->set_id($this->get_value("commentCreatedUser"));
             $p->select();
             $from2 = $p->get_value("emailAddress");
         }
         if (!$from2 && $this->get_value("commentCreatedUserClientContactID")) {
             $p = new clientContact();
             $p->set_id($this->get_value("commentCreatedUserClientContactID"));
             $p->select();
             $from2 = $p->get_value("clientContactEmail");
         }
         $text1 = str_replace(array("\\s", "\n", "\r"), "", trim($text));
         $text2 = str_replace(array("\\s", "\n", "\r"), "", trim($this->get_value("comment")));
         $date = format_date("U", $this->get_value("commentCreatedTime"));
         $date1 = strtotime($mail->mail_headers["date"]) - 300;
         $date3 = strtotime($mail->mail_headers["date"]) + 300;
         similar_text($text1, $text2, $percent);
         if ($percent >= 99 && ($from1 == $from2 || !$from2 || same_email_address($from1, config::get_config_item("AllocFromEmailAddress"))) && ($date > $date1 && $date < $date3 || $ignore_date)) {
             $debug and print "<br><b style='color:green'>Found you! Msg no: " . $num . " in mailbox: " . $mailbox . " for commentID: " . $this->get_id() . "</b>";
             foreach ((array) $mail->mail_parts as $v) {
                 $s = $v["part_object"];
                 // structure
                 $raw_data = imap_fetchbody($mail->connection, $mail->msg_uid, $v["part_number"], FT_UID | FT_PEEK);
                 $thing = $mail->decode_part($s->encoding, $raw_data);
                 $filename = $mail->get_parameter_attribute_value($s->parameters, "name");
                 $filename or $filename = $mail->get_parameter_attribute_value($s->parameters, "filename");
                 $filename or $filename = $mail->get_parameter_attribute_value($s->dparameters, "name");
                 $filename or $filename = $mail->get_parameter_attribute_value($s->dparameters, "filename");
                 $bits = array();
                 $bits["part"] = $v["part_number"];
                 $bits["name"] = $filename;
                 $bits["size"] = strlen($thing);
                 $get_blobs and $bits["blob"] = $thing;
                 $filename and $mimebits[] = $bits;
             }
             $mail->close();
             return array($mail, $text, $mimebits);
         } else {
             similar_text($text1, $text2, $percent);
             $debug and print "<br>TEXT: " . sprintf("%d", $text1 == $text2) . " (" . sprintf("%d", $percent) . "%)";
             #$debug and print "<br>Text1:<br>".$text1."<br>* * *<br>";
             #$debug and print "Text2:<br>".$text2."<br>+ + +</br>";
             $debug and print "<br>FROM: " . sprintf("%d", $from1 == $from2 || !$from2 || same_email_address($from1, config::get_config_item("AllocFromEmailAddress")));
             $debug and print " From1: " . page::htmlentities($from1);
             $debug and print " From2: " . page::htmlentities($from2);
             $debug and print "<br>DATE: " . sprintf("%d", $date > $date1 && $date < $date3) . " (" . date("Y-m-d H:i:s", $date) . " | " . date("Y-m-d H:i:s", $date1) . " | " . date("Y-m-d H:i:s", $date3) . ")";
             $debug and print "<br>";
         }
     }
     $mail->close();
     return array(false, false, false);
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:72,代码来源:comment.inc.php

示例15: array

 function get_all_parties($projectID = "")
 {
     $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();
     }
     $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);
     }
     if (is_object($this)) {
         if ($this->get_value("personID")) {
             $p = new person();
             $p->set_id($this->get_value("personID"));
             $p->select();
             $p->get_value("emailAddress") and $interestedPartyOptions[$p->get_value("emailAddress")] = array("name" => $p->get_value("firstName") . " " . $p->get_value("surname"), "role" => "assignee", "selected" => false, "personID" => $this->get_value("personID"));
         }
         if ($this->get_value("approvedByManagerPersonID")) {
             $p = new person();
             $p->set_id($this->get_value("approvedByManagerPersonID"));
             $p->select();
             $p->get_value("emailAddress") and $interestedPartyOptions[$p->get_value("emailAddress")] = array("name" => $p->get_value("firstName") . " " . $p->get_value("surname"), "role" => "manager", "selected" => true, "personID" => $this->get_value("approvedByManagerPersonID"));
         }
         $this_id = $this->get_id();
     }
     // return an aggregation of the current task/proj/client parties + the existing interested parties
     $interestedPartyOptions = interestedParty::get_interested_parties("timeSheet", $this_id, $interestedPartyOptions);
     return $interestedPartyOptions;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:34,代码来源:timeSheet.inc.php


注:本文中的person::set_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。