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


PHP project::get_id方法代码示例

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


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

示例1: date

 function project_stats()
 {
     // date from which a project is counted as being new. if monday then date back to friday, else the previous day
     $days = date("w") == 1 ? 3 : 1;
     $date = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - $days, date("Y")));
     $query = "SELECT * FROM project";
     $db = new db_alloc();
     $db_sub = new db_alloc();
     $db->query($query);
     while ($db->next_record()) {
         $project = new project();
         $project->read_db_record($db);
         $this->projects["total"]["total"]++;
         switch ($project->get_value("projectStatus")) {
             case "current":
             case "overdue":
                 $this->projects["current"]["total"]++;
                 break;
             case "archived":
                 $this->projects["archived"]["total"]++;
                 break;
         }
         $query = prepare("SELECT * FROM projectPerson WHERE projectID=%d", $project->get_id());
         $db_sub->query($query);
         while ($db_sub->next_record()) {
             $projectPerson = new projectPerson();
             $projectPerson->read_db_record($db_sub);
             $this->projects["total"][$projectPerson->get_value("personID")]++;
             switch ($project->get_value("projectStatus")) {
                 case "current":
                 case "overdue":
                     $this->projects["current"][$projectPerson->get_value("personID")]++;
                     break;
                 case "archived":
                     $this->projects["archived"][$projectPerson->get_value("personID")]++;
                     break;
             }
             if ($project->get_value("dateActualStart") != "") {
                 if (!isset($this->projects["all"][$projectPerson->get_value("personID")])) {
                     $this->projects["all"][$projectPerson->get_value("personID")] = array();
                 }
                 $this->projects["all"][$projectPerson->get_value("personID")][$project->get_value("dateActualStart")]++;
                 $this->projects["all"][$projectPerson->get_value("personID")]["total"]++;
                 $this->projects["all"]["total"][$project->get_value("dateActualStart")]++;
                 if (strcmp($date, $project->get_value("dateActualStart")) <= 0) {
                     if (!isset($this->projects["new"][$projectPerson->get_value("personID")])) {
                         $this->projects["new"][$projectPerson->get_value("personID")] = array();
                     }
                     $this->projects["new"][$projectPerson->get_value("personID")][$project->get_value("dateActualStart")]++;
                     $this->projects["new"][$projectPerson->get_value("personID")]["total"]++;
                     $this->projects["new"]["total"][$project->get_value("dateActualStart")]++;
                 }
             }
         }
     }
     return $this->projects;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:57,代码来源:stats.inc.php

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

示例3: client

         $client = new client();
         $client->read_db_record($db);
         $parent_names[$client->get_id()] = $client->get_value('clientName');
     }
 } else {
     if ($parentType == "project") {
         if ($current_user->have_role("admin")) {
             $query = "SELECT * FROM project WHERE projectStatus != 'Archived' ORDER BY projectName";
         } else {
             $query = prepare("SELECT * \n                          FROM project \n                     LEFT JOIN projectPerson ON project.projectID=projectPerson.projectID \n                         WHERE personID='%d' \n                           AND projectStatus != 'Archived'\n                      ORDER BY projectName", $personID);
         }
         $db->query($query);
         while ($db->next_record()) {
             $project = new project();
             $project->read_db_record($db);
             $parent_names[$project->get_id()] = $project->get_value('projectName');
         }
     } else {
         if ($parentType == "task") {
             if ($current_user->have_role("admin")) {
                 $query = "SELECT * FROM task";
             } else {
                 $query = prepare("SELECT * FROM task WHERE personID=%d ORDER BY taskName", $personID);
             }
             $db->query($query);
             while ($db->next_record()) {
                 $task = new task();
                 $task->read_db_record($db);
                 if (substr($task->get_value("taskStatus"), 0, 6) != "closed") {
                     $parent_names[$task->get_id()] = $task->get_value('taskName');
                 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:reminder.php

示例4: count

    $project->select();
    $projectManagers = $project->get_timeSheetRecipients();
    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") {
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:timeSheet.php

示例5: prepare

 $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);
     $projectPerson->set_id("");
     $projectPerson->set_value("projectID", $p2->get_id());
     $projectPerson->save();
     $TPL["message_good"]["projectPeople"] = "Project people copied successfully.";
 }
 // Copy commissions
 $q = prepare("SELECT * FROM projectCommissionPerson WHERE projectID = %d", $p->get_id());
 $db = new db_alloc();
 $db->query($q);
 while ($row = $db->row()) {
     $projectCommissionPerson = new projectCommissionPerson();
     $projectCommissionPerson->read_row_record($row);
     $projectCommissionPerson->set_id("");
     $projectCommissionPerson->set_value("projectID", $p2->get_id());
     $projectCommissionPerson->save();
     $TPL["message_good"]["projectCommissions"] = "Project commissions copied successfully.";
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:project.php

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

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


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