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


PHP project::select方法代码示例

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


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

示例1: get_list

 public static function get_list($_FORM)
 {
     /*
      *
      * Get a list of task history items with sophisticated filtering and somewhat sophisticated output
      *
      * (n.b., the output from this generally needs to be post-processed to handle the semantic meaning of changes in various fields)
      *
      */
     $filter = audit::get_list_filter($_FORM);
     if (is_array($filter) && count($filter)) {
         $where_clause = " WHERE " . implode(" AND ", $filter);
     }
     if ($_FORM["projectID"]) {
         $entity = new project();
         $entity->set_id($_FORM["projectID"]);
         $entity->select();
     } else {
         if ($_FORM["taskID"]) {
             $entity = new task();
             $entity->set_id($_FORM["taskID"]);
             $entity->select();
         }
     }
     $q = "SELECT *\n            FROM audit\n          {$where_clause}\n        ORDER BY dateChanged";
     $db = new db_alloc();
     $db->query($q);
     $items = array();
     while ($row = $db->next_record()) {
         $audit = new audit();
         $audit->read_db_record($db);
         $rows[] = $row;
     }
     return $rows;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:35,代码来源:audit.inc.php

示例2: project

 function is_owner($person = "")
 {
     $project = new project();
     $project->set_id($this->get_value("projectID"));
     $project->select();
     return $project->is_owner($person);
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:7,代码来源:projectCommissionPerson.inc.php

示例3: project

 function is_owner($person = "")
 {
     if (!$this->get_id()) {
         return true;
     } else {
         $project = new project();
         $project->set_id($this->get_value("projectID"));
         $project->select();
         return $project->is_owner($person);
     }
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:11,代码来源:projectPerson.inc.php

示例4: show_all_exp

function show_all_exp($template)
{
    global $TPL;
    global $expenseForm;
    global $db;
    global $transaction_to_edit;
    if ($expenseForm->get_id()) {
        if ($_POST["transactionID"] && ($_POST["edit"] || is_object($transaction_to_edit) && $transaction_to_edit->get_id())) {
            // if edit is clicked OR if we've rejected changes made to something so are still editing it
            $query = prepare("SELECT * FROM transaction WHERE expenseFormID=%d AND transactionID<>%d ORDER BY transactionID DESC", $expenseForm->get_id(), $_POST["transactionID"]);
        } else {
            $query = prepare("SELECT * FROM transaction WHERE expenseFormID=%d ORDER BY transactionID DESC", $expenseForm->get_id());
        }
        $db->query($query);
        while ($db->next_record()) {
            $transaction = new transaction();
            $transaction->read_db_record($db);
            $transaction->set_values();
            $transaction->get_value("quantity") and $TPL["amount"] = $transaction->get_value("amount") / $transaction->get_value("quantity");
            $TPL["lineTotal"] = $TPL["amount"] * $transaction->get_value("quantity");
            $tf = new tf();
            $tf->set_id($transaction->get_value("fromTfID"));
            $tf->select();
            $TPL["fromTfIDLink"] = $tf->get_link();
            $tf = new tf();
            $tf->set_id($transaction->get_value("tfID"));
            $tf->select();
            $TPL["tfIDLink"] = $tf->get_link();
            $projectID = $transaction->get_value("projectID");
            if ($projectID) {
                $project = new project();
                $project->set_id($transaction->get_value("projectID"));
                $project->select();
                $TPL["projectName"] = $project->get_value("projectName");
            }
            if ($transaction->get_value("fromTfID") == config::get_config_item("expenseFormTfID")) {
                $TPL['expense_class'] = "loud";
            } else {
                $TPL['expense_class'] = "";
            }
            include_template($template);
        }
    }
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:44,代码来源:expenseForm.php

示例5: show_projects

function show_projects($template_name)
{
    global $TPL;
    global $default;
    $_FORM = task::load_form_data($defaults);
    $arr = task::load_task_filter($_FORM);
    is_array($arr) and $TPL = array_merge($TPL, $arr);
    if (is_array($_FORM["projectID"])) {
        $projectIDs = $_FORM["projectID"];
        foreach ($projectIDs as $projectID) {
            $project = new project();
            $project->set_id($projectID);
            $project->select();
            $_FORM["projectID"] = array($projectID);
            $TPL["graphTitle"] = urlencode($project->get_value("projectName"));
            $arr = task::load_task_filter($_FORM);
            is_array($arr) and $TPL = array_merge($TPL, $arr);
            include_template($template_name);
        }
    }
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:21,代码来源:projectGraph.php

示例6: project

 function translate_meta_tfID($tfID = "")
 {
     // The special -1 and -2 tfID's represent META TF, i.e. calculated at runtime
     // -1 == META: Project TF
     if ($tfID == -1) {
         if ($this->get_value("projectID")) {
             $project = new project();
             $project->set_id($this->get_value("projectID"));
             $project->select();
             $tfID = $project->get_value("cost_centre_tfID");
         }
         if (!$tfID) {
             alloc_error("Unable to use META: Project TF. Please ensure the project has a TF set, or adjust the transactions.");
         }
         // -2 == META: Salesperson TF
     } else {
         if ($tfID == -2) {
             if ($this->get_value("personID")) {
                 $person = new person();
                 $person->set_id($this->get_value("personID"));
                 $person->select();
                 $tfID = $person->get_value("preferred_tfID");
                 if (!$tfID) {
                     alloc_error("Unable to use META: Salesperson TF. Please ensure the Saleperson has a Preferred Payment TF.");
                 }
             } else {
                 alloc_error("Unable to use META: Salesperson TF. No product salesperson set.");
             }
         } else {
             if ($tfID == -3) {
                 $tfID = $this->get_value("tfID");
                 $tfID or alloc_error("Unable to use META: Sale TF not set.");
             }
         }
     }
     return $tfID;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:37,代码来源:productSale.inc.php

示例7: while

{
    global $person_query;
    global $project;
    global $TPL;
    $db = new db_alloc();
    $db->query($person_query);
    while ($db->next_record()) {
        $person = new person();
        $person->read_db_record($db);
        $person->set_values("person_");
        $TPL["graphTitle"] = urlencode($person->get_name());
        include_template($template_name);
    }
}
$projectID = $_POST["projectID"] or $projectID = $_GET["projectID"];
if ($projectID) {
    $project = new project();
    $project->set_id($projectID);
    $project->select();
    $TPL["navigation_links"] = $project->get_navigation_links();
    $person_query = prepare("SELECT person.*\n                             FROM person, projectPerson\n                            WHERE person.personID = projectPerson.personID\n                              AND projectPerson.projectID=%d", $project->get_id());
} else {
    if ($_GET["personID"]) {
        $person_query = prepare("SELECT * FROM person WHERE personID = %d ORDER BY username", $_GET["personID"]);
    } else {
        $person_query = prepare("SELECT * FROM person ORDER BY username");
    }
}
$TPL["projectID"] = $projectID;
$TPL["main_alloc_title"] = "Allocation Graph - " . APPLICATION_NAME;
include_template("templates/personGraphM.tpl");
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:personGraph.php

示例8: project

 function update_search_index_doc(&$index)
 {
     $p =& get_cached_table("person");
     $creatorID = $this->get_value("creatorID");
     $creator_field = $creatorID . " " . $p[$creatorID]["username"] . " " . $p[$creatorID]["name"];
     $closerID = $this->get_value("closerID");
     $closer_field = $closerID . " " . $p[$closerID]["username"] . " " . $p[$closerID]["name"];
     $personID = $this->get_value("personID");
     $person_field = $personID . " " . $p[$personID]["username"] . " " . $p[$personID]["name"];
     $managerID = $this->get_value("managerID");
     $manager_field = $managerID . " " . $p[$managerID]["username"] . " " . $p[$managerID]["name"];
     $taskModifiedUser = $this->get_value("taskModifiedUser");
     $taskModifiedUser_field = $taskModifiedUser . " " . $p[$taskModifiedUser]["username"] . " " . $p[$taskModifiedUser]["name"];
     $status = $this->get_value("taskStatus");
     if ($this->get_value("projectID")) {
         $project = new project();
         $project->set_id($this->get_value("projectID"));
         $project->select();
         $projectName = $project->get_name();
         $projectShortName = $project->get_name(array("showShortProjectLink" => true));
         $projectShortName && $projectShortName != $projectName and $projectName .= " " . $projectShortName;
     }
     $doc = new Zend_Search_Lucene_Document();
     $doc->addField(Zend_Search_Lucene_Field::Keyword('id', $this->get_id()));
     $doc->addField(Zend_Search_Lucene_Field::Text('name', $this->get_value("taskName"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('project', $projectName, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('pid', $this->get_value("projectID"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('creator', $creator_field, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('closer', $closer_field, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('assignee', $person_field, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('manager', $manager_field, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('modifier', $taskModifiedUser_field, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('desc', $this->get_value("taskDescription"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('priority', $this->get_value("priority"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('limit', $this->get_value("timeLimit"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('best', $this->get_value("timeBest"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('worst', $this->get_value("timeWorst"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('expected', $this->get_value("timeExpected"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('type', $this->get_value("taskTypeID"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('status', $status, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateCreated', str_replace("-", "", $this->get_value("dateCreated")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateAssigned', str_replace("-", "", $this->get_value("dateAssigned")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateClosed', str_replace("-", "", $this->get_value("dateClosed")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateTargetStart', str_replace("-", "", $this->get_value("dateTargetStart")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateTargetCompletion', str_replace("-", "", $this->get_value("dateTargetCompletion")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateStart', str_replace("-", "", $this->get_value("dateActualStart")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateCompletion', str_replace("-", "", $this->get_value("dateActualCompletion")), "utf-8"));
     $index->addDocument($doc);
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:49,代码来源:task.inc.php

示例9: project

 function update_search_index_doc(&$index)
 {
     $p =& get_cached_table("person");
     $personID = $this->get_value("personID");
     $person_field = $personID . " " . $p[$personID]["username"] . " " . $p[$personID]["name"];
     $managerID = $this->get_value("approvedByManagerPersonID");
     $manager_field = $managerID . " " . $p[$managerID]["username"] . " " . $p[$managerID]["name"];
     $adminID = $this->get_value("approvedByAdminPersonID");
     $admin_field = $adminID . " " . $p[$adminID]["username"] . " " . $p[$adminID]["name"];
     $tf_field = $this->get_value("recipient_tfID") . " " . tf::get_name($this->get_value("recipient_tfID"));
     if ($this->get_value("projectID")) {
         $project = new project();
         $project->set_id($this->get_value("projectID"));
         $project->select();
         $projectName = $project->get_name();
         $projectShortName = $project->get_name(array("showShortProjectLink" => true));
         $projectShortName && $projectShortName != $projectName and $projectName .= " " . $projectShortName;
     }
     $q = prepare("SELECT dateTimeSheetItem, taskID, description, comment, commentPrivate \n                    FROM timeSheetItem \n                   WHERE timeSheetID = %d \n                ORDER BY dateTimeSheetItem ASC", $this->get_id());
     $db = new db_alloc();
     $db->query($q);
     while ($r = $db->row()) {
         $desc .= $br . $r["dateTimeSheetItem"] . " " . $r["taskID"] . " " . $r["description"] . "\n";
         $r["comment"] && $r["commentPrivate"] or $desc .= $r["comment"] . "\n";
         $br = "\n";
     }
     $doc = new Zend_Search_Lucene_Document();
     $doc->addField(Zend_Search_Lucene_Field::Keyword('id', $this->get_id()));
     $doc->addField(Zend_Search_Lucene_Field::Text('project', $projectName, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('pid', $this->get_value("projectID"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('creator', $person_field, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('desc', $desc, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('status', $this->get_value("status"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('tf', $tf_field, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('manager', $manager_field, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('admin', $admin_field, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateManager', str_replace("-", "", $this->get_value("dateSubmittedToManager")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateAdmin', str_replace("-", "", $this->get_value("dateSubmittedToAdmin")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateFrom', str_replace("-", "", $this->get_value("dateFrom")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateTo', str_replace("-", "", $this->get_value("dateTo")), "utf-8"));
     $index->addDocument($doc);
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:42,代码来源:timeSheet.inc.php

示例10: project

            $projectPerson->set_value("personID", $current_user->get_id());
            $projectPerson->save();
        }
        alloc_redirect($TPL["url_alloc_project"] . "projectID=" . $project->get_id());
    }
} else {
    if ($_POST["delete"]) {
        $project->read_globals();
        $project->delete();
        alloc_redirect($TPL["url_alloc_projectList"]);
        // If they are creating a new project that is based on an existing one
    } else {
        if ($_POST["copy_project_save"] && $_POST["copy_projectID"] && $_POST["copy_project_name"]) {
            $p = new project();
            $p->set_id($_POST["copy_projectID"]);
            if ($p->select()) {
                $p2 = new project();
                $p2->read_row_record($p->row());
                $p2->set_id("");
                $p2->set_value("projectName", $_POST["copy_project_name"]);
                $p2->set_value("projectShortName", "");
                $p2->save();
                $TPL["message_good"][] = "Project details copied successfully.";
                // Copy project people
                $q = prepare("SELECT * FROM projectPerson WHERE projectID = %d", $p->get_id());
                $db = new db_alloc();
                $db->query($q);
                while ($row = $db->row()) {
                    $projectPerson = new projectPerson();
                    $projectPerson->currency = $p->get_value("currencyTypeID");
                    $projectPerson->read_row_record($row);
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:project.php

示例11: singleton

 function populate_string($str, $entity, $entityID = false)
 {
     // Actually do the text substitution
     $current_user =& singleton("current_user");
     is_object($current_user) and $swap["cu"] = person::get_fullname($current_user->get_id());
     if ($entity == "timeSheet" && $entityID) {
         $timeSheet = new timeSheet();
         $timeSheet->set_id($entityID);
         $timeSheet->select();
         $timeSheet->load_pay_info();
         foreach ($timeSheet->pay_info as $k => $v) {
             $swap[$k] = $v;
         }
         if ($timeSheet->get_value("approvedByManagerPersonID")) {
             $swap["tm"] = person::get_fullname($timeSheet->get_value("approvedByManagerPersonID"));
         } else {
             $project = $timeSheet->get_foreign_object("project");
             $projectManagers = $project->get_timeSheetRecipients();
             if (is_array($projectManagers) && count($projectManagers)) {
                 $people =& get_cached_table("person");
                 foreach ($projectManagers as $pID) {
                     $swap["tm"] .= $commar . $people[$pID]["name"];
                     $commar = ", ";
                 }
             }
         }
         if ($timeSheet->get_value("approvedByAdminPersonID")) {
             $swap["tc"] = person::get_fullname($timeSheet->get_value("approvedByAdminPersonID"));
         } else {
             $people =& get_cached_table("person");
             $timeSheetAdministrators = config::get_config_item('defaultTimeSheetAdminList');
             if (count($timeSheetAdministrators)) {
                 $swap["tc"] = "";
                 $comma = "";
                 foreach ($timeSheetAdministrators as $adminID) {
                     $swap["tc"] .= $comma . $people[$adminID]["name"];
                     $comma = ", ";
                 }
             } else {
                 $swap["tc"] = 'no-one';
             }
         }
         $swap["ti"] = $timeSheet->get_id();
         $swap["to"] = person::get_fullname($timeSheet->get_value("personID"));
         $swap["ta"] = person::get_fullname($timeSheet->get_value("personID"));
         $swap["tf"] = $timeSheet->get_value("dateFrom");
         $swap["tt"] = $timeSheet->get_value("dateTo");
         $swap["ts"] = $timeSheet->get_timeSheet_status();
         $swap["tu"] = config::get_config_item("allocURL") . "time/timeSheet.php?timeSheetID=" . $timeSheet->get_id();
         $projectID = $timeSheet->get_value("projectID");
     }
     if ($entity == "task" && $entityID) {
         $task = new task();
         $task->set_id($entityID);
         $task->select();
         $swap["ti"] = $task->get_id();
         $swap["to"] = person::get_fullname($task->get_value("creatorID"));
         $swap["ta"] = person::get_fullname($task->get_value("personID"));
         $swap["tm"] = person::get_fullname($task->get_value("managerID"));
         $swap["tc"] = person::get_fullname($task->get_value("closerID"));
         $swap["tn"] = $task->get_value("taskName");
         $swap["td"] = $task->get_value("taskDescription");
         $swap["tu"] = config::get_config_item("allocURL") . "task/task.php?taskID=" . $task->get_id();
         $swap["tp"] = $task->get_priority_label();
         $swap["ts"] = $task->get_task_status("label");
         $swap["teb"] = $task->get_value("timeBest");
         $swap["tem"] = $task->get_value("timeExpected");
         $swap["tew"] = $task->get_value("timeWorst");
         $swap["tep"] = person::get_fullname($task->get_value("estimatorID"));
         //time estimate person, when it's implemented
         $projectID = $task->get_value("projectID");
     }
     if ($entity == "project" && $entityID || $projectID) {
         $project = new project();
         if ($projectID) {
             $project->set_id($projectID);
         } else {
             $project->set_id($entityID);
         }
         $project->select();
         $swap["pn"] = $project->get_value("projectName");
         $swap["pi"] = $project->get_id();
         $clientID = $project->get_value("clientID");
     }
     if ($entity == "client" && $entityID || $clientID) {
         $client = new client();
         if ($clientID) {
             $client->set_id($clientID);
         } else {
             $client->set_id($entityID);
         }
         $client->select();
         $swap["li"] = $client->get_id();
         $swap["cc"] = $client->get_value("clientName");
     }
     $swap["cd"] = config::get_config_item("companyContactAddress");
     $swap["cd"] .= " " . config::get_config_item("companyContactAddress2");
     $swap["cd"] .= " " . config::get_config_item("companyContactAddress3");
     $swap["cd"] .= "\nP: " . config::get_config_item("companyContactPhone");
     $swap["cd"] .= "\nF: " . config::get_config_item("companyContactFax");
//.........这里部分代码省略.........
开发者ID:cjbayliss,项目名称:alloc,代码行数:101,代码来源:commentTemplate.inc.php

示例12: project

 function get_client_and_project_dropdowns_and_links($clientID = false, $projectID = false, $onlymine = false)
 {
     // This function returns dropdown lists and links for both client and
     // project. The two dropdown lists are linked, in that if you change the
     // client, then the project dropdown dynamically updates
     global $TPL;
     $project = new project();
     $project->set_id($projectID);
     $project->select();
     if (!$clientID) {
         $clientID = $project->get_value("clientID");
     }
     $client = new client();
     $client->set_id($clientID);
     $client->select();
     $options["clientStatus"] = "Current";
     $ops = client::get_list($options);
     $ops = array_kv($ops, "clientID", "clientName");
     $client->get_id() and $ops[$client->get_id()] = $client->get_value("clientName");
     $client_select = "<select id=\"clientID\" name=\"clientID\" onChange=\"makeAjaxRequest('" . $TPL["url_alloc_updateProjectListByClient"] . "clientID='+\$('#clientID').attr('value')+'&onlymine=" . sprintf("%d", $onlymine) . "','projectDropdown')\"><option></option>";
     $client_select .= page::select_options($ops, $clientID, 100) . "</select>";
     $client_link = $client->get_link();
     $project_select = '<div id="projectDropdown" style="display:inline">' . $project->get_dropdown_by_client($clientID, $onlymine) . '</div>';
     $project_link = $project->get_link();
     return array($client_select, $client_link, $project_select, $project_link);
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:26,代码来源:client.inc.php

示例13: 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

示例14: 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;
//.........这里部分代码省略.........
开发者ID:cjbayliss,项目名称:alloc,代码行数:101,代码来源:timeSheetPrint.inc.php

示例15: 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);
//.........这里部分代码省略.........
开发者ID:cjbayliss,项目名称:alloc,代码行数:101,代码来源:services.inc.php


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