• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP task类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中task的典型用法代码示例。如果您正苦于以下问题:PHP task类的具体用法?PHP task怎么用?PHP task使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: buildCal

 /**
  * Populates the array of calendar information
  * 
  * @return array
  */
 private function buildCal()
 {
     $counter = 0;
     $ms = new milestone();
     $tsk = new task();
     for ($j = 0; $j < $this->weeksInMonth; $j++) {
         for ($i = 0; $i < 7; $i++) {
             $counter++;
             $theday = $counter - $this->firstDay;
             if ($theday < 1) {
                 $this->calendar[$j][$i]["val"] = $this->daysLastMonth + $theday;
                 $this->calendar[$j][$i]["currmonth"] = 0;
             } elseif ($theday > $this->daysInMonth) {
                 $this->calendar[$j][$i]["val"] = $theday - $this->daysInMonth;
                 $this->calendar[$j][$i]["currmonth"] = 0;
             } else {
                 $miles = $ms->getTodayMilestones($this->month, $this->year, $theday, $this->project);
                 $milesnum = count($miles);
                 $tasks = $tsk->getTodayTasks($this->month, $this->year, $theday, $this->project);
                 $tasksnum = count($tasks);
                 $this->calendar[$j][$i] = array("val" => $theday, "milestones" => $miles, "milesnum" => $milesnum, "tasks" => $tasks, "tasksnum" => $tasksnum, "currmonth" => 1);
             }
         }
     }
     return $this;
 }
开发者ID:raum01,项目名称:Collabtive,代码行数:31,代码来源:class.calendar.php


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


示例3: get_task_comments

 /**
  * Get all the commments on a task
  * @param string $taskID
  * @return array an array of comments
  */
 public function get_task_comments($taskID)
 {
     if ($taskID) {
         $task = new task();
         $task->set_id($taskID);
         $task->select();
         return $task->get_task_comments_array();
     }
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:14,代码来源:services.inc.php


示例4: show_tasks

 function show_tasks()
 {
     $current_user =& singleton("current_user");
     global $tasks_date;
     list($ts_open, $ts_pending, $ts_closed) = task::get_task_status_in_set_sql();
     $q = prepare("SELECT * \n                  FROM task \n                  WHERE (task.taskStatus NOT IN (" . $ts_closed . ") AND task.taskTypeID = 'Message') \n                  AND (personID = %d) \n                  ORDER BY priority\n                 ", $current_user->get_id());
     $db = new db_alloc();
     $db->query($q);
     while ($db->next_record()) {
         $task = new task();
         $task->read_db_record($db);
         echo $br . $task->get_task_image() . $task->get_task_link(array("return" => "html"));
         $br = "<br>";
     }
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:15,代码来源:task_message_list_home_item.inc.php


示例5: start

 static function start($task_callback, $context = array())
 {
     $tasks = task::get_definitions();
     $task = task::create($tasks[$task_callback], array());
     $task->log(t("Task %task_name started (task id %task_id)", array("task_name" => $task->name, "task_id" => $task->id)));
     return $task;
 }
开发者ID:kandsten,项目名称:gallery3,代码行数:7,代码来源:task.php


示例6: show_task_children

function show_task_children($template)
{
    global $TPL;
    global $task;
    if ($task->get_value("taskTypeID") == "Parent") {
        $options["parentTaskID"] = $task->get_id();
        $options["taskView"] = "byProject";
        $task->get_value("projectID") and $options["projectIDs"][] = $task->get_value("projectID");
        $options["showDates"] = true;
        #$options["showCreator"] = true;
        $options["showAssigned"] = true;
        $options["showPercent"] = true;
        $options["showHeader"] = true;
        $options["showTimes"] = true;
        $options["showTaskID"] = true;
        $options["showTotals"] = true;
        $options["showStatus"] = true;
        $options["showEdit"] = true;
        $options["showPriorityFactor"] = true;
        $options["returnURL"] = $TPL["url_alloc_task"] . "taskID=" . $task->get_id();
        $_GET["media"] == "print" and $options["showDescription"] = true;
        $_GET["media"] == "print" and $options["showComments"] = true;
        $TPL["taskListRows"] = task::get_list($options);
        $TPL["taskListOptions"] = $options;
        include_template($template);
    }
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:27,代码来源:task.php


示例7: gallery_shutdown

 /**
  * At this point, the output has been sent to the browser, so we can take some time
  * to run a schedule task.
  */
 static function gallery_shutdown()
 {
     try {
         $schedule = ORM::factory("schedule")->where("next_run_datetime", "<=", time())->where("busy", "!=", 1)->order_by("next_run_datetime")->find_all(1);
         if ($schedule->count()) {
             $schedule = $schedule->current();
             $schedule->busy = true;
             $schedule->save();
             try {
                 if (empty($schedule->task_id)) {
                     $task = task::start($schedule->task_callback);
                     $schedule->task_id = $task->id;
                 }
                 $task = task::run($schedule->task_id);
                 if ($task->done) {
                     $schedule->next_run_datetime += $schedule->interval;
                     $schedule->task_id = null;
                 }
                 $schedule->busy = false;
                 $schedule->save();
             } catch (Exception $e) {
                 $schedule->busy = false;
                 $schedule->save();
                 throw $e;
             }
         }
     } catch (Exception $e) {
         Kohana_Log::add("error", (string) $e);
     }
 }
开发者ID:ady1503,项目名称:gallery3-contrib,代码行数:34,代码来源:scheduler_event.php


示例8: listTasksByUser

function listTasksByUser($inuserid)
{
    $tasks = array();
    $dbhandle = db_connect();
    $query = "SELECT TaskID FROM Tasks WHERE Lister={$inuserid}";
    $result = $dbhandle->query($query);
    while ($row = $result->fetch_array()) {
        $newtask = new task();
        $newtask->getFromDB($row['TaskID']);
        if ($newtask->active == 0) {
            continue;
        }
        array_push($tasks, $newtask);
    }
    $dbhandle->close();
    return $tasks;
}
开发者ID:sammyr2011,项目名称:Task_Master,代码行数:17,代码来源:lister.php


示例9: show

 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $tasks = task::find($id);
     if (!$tasks) {
         return Response::json(['error' => ['message' => 'Task does not exist', 'code' => 195]], 404);
     }
     return Response::json(['data' => $this->transform($tasks->toArray())], 200);
     //
 }
开发者ID:pfores,项目名称:tasksAPI,代码行数:15,代码来源:TaskController.php


示例10: GET

 public function GET($id)
 {
     if (!task::IFDELETED($id)) {
         $getQuery = "SELECT \r\n\t\t\t\t\tid,\r\n\t\t\t\t\tname,\r\n\t\t\t\t\tconvert(varchar(max), description) as description, \r\n\t\t\t\t\tinsert_datetime, \r\n\t\t\t\t\tdeadlineDate, \r\n\t\t\t\t\tfinishedDate, \r\n\t\t\t\t\tgiver_userID, \r\n\t\t\t\t\tdoer_userID, \r\n\t\t\t\t\tpriorityID, \r\n\t\t\t\t\tstatusID, \r\n\t\t\t\t\tsiteID\r\n\t\t\t\tFROM \r\n\t\t\t\t\t[dbo].[task] \r\n\t\t\t\tWHERE \r\n\t\t\t\t\tid={$id};";
         $row = mssql_fetch_array(mssql_query($getQuery));
         $result = new task($row["id"], $row["name"], $row["description"], $row["insert_datetime"], $row["deadlineDate"], $row["finishedDate"], $row["giver_userID"], $row["doer_userID"], $row["priorityID"], $row["statusID"], $row["siteID"]);
         return $result;
     }
 }
开发者ID:Tacit007,项目名称:Tacit007-php-framework,代码行数:9,代码来源:task.php


示例11: add_tsiHint

 function add_tsiHint($stuff)
 {
     $current_user =& singleton("current_user");
     $errstr = "Failed to record new time sheet item hint. ";
     $username = $stuff["username"];
     $people = person::get_people_by_username();
     $personID = $people[$username]["personID"];
     $personID or alloc_error("Person " . $username . " not found.");
     $taskID = $stuff["taskID"];
     $projectID = $stuff["projectID"];
     $duration = $stuff["duration"];
     $comment = $stuff["comment"];
     $date = $stuff["date"];
     if ($taskID) {
         $task = new task();
         $task->set_id($taskID);
         $task->select();
         $projectID = $task->get_value("projectID");
         $extra = " for task " . $taskID;
     }
     $projectID or alloc_error(sprintf($errstr . "No project found%s.", $extra));
     $row_projectPerson = projectPerson::get_projectPerson_row($projectID, $current_user->get_id());
     $row_projectPerson or alloc_error($errstr . "The person(" . $current_user->get_id() . ") has not been added to the project(" . $projectID . ").");
     if ($row_projectPerson && $projectID) {
         // Add new time sheet item
         $tsiHint = new tsiHint();
         $d = $date or $d = date("Y-m-d");
         $tsiHint->set_value("date", $d);
         $tsiHint->set_value("duration", $duration);
         if (is_object($task)) {
             $tsiHint->set_value("taskID", sprintf("%d", $taskID));
         }
         $tsiHint->set_value("personID", $personID);
         $tsiHint->set_value("comment", $comment);
         $tsiHint->save();
         $ID = $tsiHint->get_id();
     }
     if ($ID) {
         return array("status" => "yay", "message" => $ID);
     } else {
         alloc_error($errstr . "Time hint not added.");
     }
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:43,代码来源:tsiHint.inc.php


示例12: post_delete

 public function post_delete($id)
 {
     try {
         $delete = task::find($id);
         $delete->delete();
         return Redirect::action('page1controller@get_index');
     } catch (Exception $e) {
         return $e;
     }
 }
开发者ID:sdjukelic,项目名称:todoapp,代码行数:10,代码来源:page1controller.php


示例13: newEntry

 public function newEntry()
 {
     if (user::accessLevel($_COOKIE['id']) == 1) {
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             task::INSERT($_POST['name'], $_POST['description'], $_POST['deadlineDate'], $_POST['giver_userID'], $_POST['doer_userID'], $_POST['priorityID'], $_POST['statusID'], $_POST['siteID']);
             //header("Location: /task");
         } else {
             taskController::loadView('new', $args = array());
         }
     } else {
         echo "You have no access";
     }
 }
开发者ID:Tacit007,项目名称:Tacit007-php-framework,代码行数:13,代码来源:taskController.php


示例14: index

 /**
  * Show a list of all available, running and finished tasks.
  */
 public function index()
 {
     $query = db::build()->update("tasks")->set("state", "stalled")->where("done", "=", 0)->where("state", "<>", "stalled")->where(new Database_Expression("UNIX_TIMESTAMP(NOW()) - `updated` > 15"))->execute();
     $stalled_count = $query->count();
     if ($stalled_count) {
         log::warning("tasks", t2("One task is stalled", "%count tasks are stalled", $stalled_count), t('<a href="%url">view</a>', array("url" => html::mark_clean(url::site("admin/maintenance")))));
     }
     $view = new Admin_View("admin.html");
     $view->page_title = t("Maintenance tasks");
     $view->content = new View("admin_schedule.html");
     $view->content->task_definitions = task::get_definitions();
     $view->content->running_tasks = ORM::factory("task")->where("done", "=", 0)->order_by("updated", "DESC")->find_all();
     $view->content->finished_tasks = ORM::factory("task")->where("done", "=", 1)->order_by("updated", "DESC")->find_all();
     $view->content->schedule_definitions = scheduler::get_definitions();
     print $view;
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:19,代码来源:admin_schedule.php


示例15: render

 function render()
 {
     global $TPL;
     $defaults = array("showHeader" => true, "showTaskID" => true, "taskView" => "prioritised", "showStatus" => "true", "url_form_action" => $TPL["url_alloc_home"], "form_name" => "taskListHome_filter");
     $current_user =& singleton("current_user");
     if (!$current_user->prefs["taskListHome_filter"]) {
         $defaults["taskStatus"] = "open";
         $defaults["personID"] = $current_user->get_id();
         $defaults["showStatus"] = true;
         $defaults["showProject"] = true;
         $defaults["limit"] = 10;
         $defaults["applyFilter"] = true;
     }
     $_FORM = task::load_form_data($defaults);
     $TPL["taskListRows"] = task::get_list($_FORM);
     $TPL["_FORM"] = $_FORM;
     return true;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:18,代码来源:task_list_home_item.inc.php


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


示例17: singleton

 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
 * License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with allocPSA. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "../alloc.php";
include "lib/task_graph.inc.php";
$current_user =& singleton("current_user");
global $show_weeks;
global $for_home_item;
$options = unserialize(stripslashes($_GET["FORM"]));
$options["return"] = "array";
$options["padding"] = 0;
$options["debug"] = 0;
$tasks = task::get_list($options) or $tasks = array();
foreach ($tasks as $task) {
    $objects[$task["taskID"]] = $task["object"];
}
$task_graph = new task_graph();
$task_graph->set_title($_GET["graphTitle"]);
$task_graph->set_width($_GET["graphWidth"]);
$task_graph->init($objects);
$task_graph->draw_grid();
foreach ($tasks as $task) {
    $task_graph->draw_task($task);
}
$task_graph->draw_milestones();
$task_graph->draw_today();
$task_graph->draw_legend();
$task_graph->output();
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:projectGraphImage.php


示例18: task

 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 ***************************************************************************/
#######################################################################
## check login again
if (!$loginInst->id) {
    echo $lang['common_accessDenied'] . "\n";
    exit;
}
$taskInst = new task();
if (tool::securePost('action') == "save") {
    $taskId = tool::securePost('taskid');
}
if ($taskId) {
    $taskInst->activate($taskId);
} else {
    $taskId = tool::secureGet('taskid');
    $taskInst->activate($taskId);
}
if (!$taskInst->id) {
    echo "no task found.\n";
    exit;
}
$projectInst = new project($taskInst->projectId);
$userInst = new user($taskInst->userId);
开发者ID:pmtool,项目名称:pmtool,代码行数:31,代码来源:taskdetails.php


示例19: define

 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with allocPSA. If not, see <http://www.gnu.org/licenses/>.
*/
define("NO_REDIRECT", 1);
require_once "../alloc.php";
//usleep(1000);
$t = timeSheetItem::parse_time_string($_REQUEST["time_item"]);
$timeUnit = new timeUnit();
$units = $timeUnit->get_assoc_array("timeUnitID", "timeUnitLabelA");
$timeSheetItemMultiplier = new meta("timeSheetItemMultiplier");
$tsims = $timeSheetItemMultiplier->get_list();
foreach ($t as $k => $v) {
    if ($v) {
        if ($k == "taskID") {
            $task = new task();
            $task->set_id($v);
            if ($task->select()) {
                $v = $task->get_id() . " " . $task->get_link();
            } else {
                $v = "Task " . $v . " not found.";
            }
        } else {
            if ($k == "unit") {
                $v = $units[$v];
            } else {
                if ($k == "multiplier") {
                    $v = $tsims[sprintf("%0.2f", $v)]["timeSheetItemMultiplierName"];
                }
            }
        }
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:updateTimeSheetHome.php


示例20: db_alloc

$db = new db_alloc();
$display = array("", "username", ", ", "emailAddress");
$person = new person();
$people =& get_cached_table("person");
foreach ($people as $p) {
    $peeps[$p["personID"]] = $p["name"];
}
// get the default time sheet manager/admin options
$TPL["defaultTimeSheetManagerListText"] = get_person_list(config::get_config_item("defaultTimeSheetManagerList"));
$TPL["defaultTimeSheetAdminListText"] = get_person_list(config::get_config_item("defaultTimeSheetAdminList"));
$days = array("Sun" => "Sun", "Mon" => "Mon", "Tue" => "Tue", "Wed" => "Wed", "Thu" => "Thu", "Fri" => "Fri", "Sat" => "Sat");
$TPL["calendarFirstDayOptions"] = page::select_options($days, config::get_config_item("calendarFirstDay"));
$TPL["timeSheetPrintOptions"] = page::select_options($TPL["timeSheetPrintOptions"], $TPL["timeSheetPrint"]);
$commentTemplate = new commentTemplate();
$ops = $commentTemplate->get_assoc_array("commentTemplateID", "commentTemplateName");
$TPL["rssStatusFilterOptions"] = page::select_options(task::get_task_statii_array(true), config::get_config_item("rssStatusFilter"));
if (has("timeUnit")) {
    $timeUnit = new timeUnit();
    $rate_type_array = $timeUnit->get_assoc_array("timeUnitID", "timeUnitLabelB");
}
$TPL["timesheetRate_options"] = page::select_options($rate_type_array, config::get_config_item("defaultTimeSheetUnit"));
$TPL["main_alloc_title"] = "Setup - " . APPLICATION_NAME;
include_template("templates/configM.tpl");
function get_person_list($personID_array)
{
    global $peeps;
    $people = array();
    foreach ($personID_array as $personID) {
        $people[] = $peeps[$personID];
    }
    if (count($people) > 0) {
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:config.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP td_block_layout类代码示例发布时间:2022-05-23
下一篇:
PHP tar类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap