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


PHP models\Task类代码示例

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


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

示例1: updateRowOrder

 protected function updateRowOrder(Task $task, $input)
 {
     if (array_key_exists('order', $input) && array_key_exists('ordertask', $input)) {
         try {
             $task->updateOrder($input['order'], $input['ordertask']);
         } catch (MoveNotPossibleException $e) {
             $result['success'] = false;
             $result['msg'] = "Cannot make a page a child of self.";
             return $result;
         }
     }
 }
开发者ID:BhattaRj,项目名称:pms,代码行数:12,代码来源:TaskRepository.php

示例2: update

 public function update(CreateCommentRequest $request, $id)
 {
     $comment = $this->comment;
     $comment->user_id = $request->get('name');
     $comment->content = $request->get('content');
     $comment->project_id = $id;
     $comment->save();
     $project = Project::whereId($id)->first();
     $slug = $project->slug;
     $task = new Task();
     $tasks = $task->whereProject_id($id)->orderBy('id', 'desc')->first();
     //return view('projects.show', ['project' => $project, 'task' => $tasks]);
     return redirect()->route('projects.show', ['slug' => $slug, 'task' => $tasks]);
 }
开发者ID:berkapavel,项目名称:Laravel5-Time-Tracker-Project-manager,代码行数:14,代码来源:CommentController.php

示例3: actionIndex

 public function actionIndex()
 {
     $user = Yii::$app->user;
     $dashboard = [];
     if ($user->can('partner_view')) {
         $dashboard[] = ['name' => Html::tag('b', __('Partners')), 'link' => Url::to(['partner/index']), 'count' => Partner::find()->count()];
     }
     if ($user->can('visit_view') || $user->can('visit_view_all')) {
         $dashboard[] = ['name' => __('Visits'), 'link' => Url::to(['visit/index']), 'count' => Visit::find()->count()];
     }
     if ($user->can('donate_view') || $user->can('donate_view_all')) {
         $dashboard[] = ['name' => __('Donates'), 'link' => Url::to(['donate/index']), 'count' => Donate::find()->count()];
     }
     if ($user->can('task_view') || $user->can('task_view_all')) {
         $dashboard[] = ['name' => __('Tasks'), 'link' => Url::to(['task/index']), 'count' => Task::find()->count()];
     }
     if ($user->can('newsletter_view')) {
         $dashboard[] = ['name' => __('Mailing lists'), 'link' => Url::to(['mailing-list/index']), 'count' => MailingList::find()->count()];
         $dashboard[] = ['name' => __('Newsletters'), 'link' => Url::to(['newsletter/index']), 'count' => Newsletter::find()->count()];
         $dashboard[] = ['name' => __('Printing templates'), 'link' => Url::to(['print-template/index']), 'count' => PrintTemplate::find()->count()];
     }
     if ($user->can('user_manage')) {
         $dashboard[] = ['name' => __('Users'), 'link' => Url::to(['user/index']), 'count' => User::find()->count()];
     }
     return $this->render('index', ['dashboard' => $dashboard]);
 }
开发者ID:vsguts,项目名称:crm,代码行数:26,代码来源:SiteController.php

示例4: saveAssign

 private function saveAssign($new_assign, $send_notification)
 {
     $model = Task::findOne($this->id);
     $old_assigned = $model->getAssignedToArray();
     if ($old_assigned) {
         if (!$new_assign) {
             return self::deleteAssign($old_assigned);
         }
         //remove elementos a mais
         $to_delete = array_diff($old_assigned, $new_assign);
         if ($to_delete && !self::deleteAssign($to_delete)) {
             return false;
         }
         $to_create = array_diff($new_assign, $old_assigned);
         if ($to_create && !self::createAssign($to_create, $send_notification)) {
             return false;
         }
     } else {
         if ($new_assign) {
             //Cria novo
             return self::createAssign($new_assign, $send_notification);
         }
     }
     return true;
 }
开发者ID:afernandes465,项目名称:memoboard,代码行数:25,代码来源:Task.php

示例5: down

 public function down()
 {
     $this->dropColumn(Project::tableName(), 'keep_version_num');
     $this->dropColumn(Task::tableName(), 'enable_rollback');
     echo "m151027_063246_keep_version_num was reverted.\n";
     return true;
 }
开发者ID:9618211,项目名称:walle-web,代码行数:7,代码来源:m151027_063246_keep_version_num.php

示例6: actionDashboard

 public function actionDashboard()
 {
     $searchModel = new WindowSearch();
     $searchModel->dateFrom = date('Y-m-d');
     $searchModel->dateTo = date('Y-m-d');
     $dataProvider = $searchModel->search(Yii::$app->request->post());
     // eagerly load process info
     $dataProvider->query->with('process');
     $from = strtotime('today', $searchModel->timestampFrom);
     $to = strtotime('tomorrow', $searchModel->timestampTo);
     $processList = StatsHelper::getProcessList($from, $to);
     $this->view->registerJs('var dashboardProcess = ' . json_encode($processList), View::POS_HEAD);
     $timeline = StatsHelper::timeline($from, $to);
     $this->view->registerJs('var dashboardTimeline = ' . json_encode($timeline), View::POS_HEAD);
     $this->view->registerAssetBundle(ColorStripAsset::className());
     // Durations split by process
     $durations = StatsHelper::getProcessWindowHierarchy($from, $to);
     $this->view->registerJs('var dashboardDurations = ' . json_encode($durations), View::POS_HEAD);
     $this->view->registerAssetBundle(SunburstAsset::className());
     // Durations split by task
     $durations = StatsHelper::getTaskWindowHierarchy($from, $to);
     $this->view->registerJs('var dashboardTaskDurations = ' . json_encode($durations), View::POS_HEAD);
     // Keys
     $keysActivity = StatsHelper::keysActivity($from, $to);
     $this->view->registerJs('var dashboardKeys = ' . json_encode($keysActivity), View::POS_HEAD);
     $this->view->registerAssetBundle(KeysAsset::className());
     $this->view->registerAssetBundle(KeysAreaAsset::className());
     $this->clusterChart($searchModel);
     $tasks = array_map(function ($task) {
         return ['id' => $task->id, 'name' => $task->name];
     }, Task::find()->all());
     $this->view->registerJs('var dashboardTasks = ' . json_encode($tasks), View::POS_HEAD);
     $this->view->registerAssetBundle(DashboardAsset::className());
     return $this->render('dashboard', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel, 'totalActivity' => StatsHelper::totalActivity($from, $to)]);
 }
开发者ID:alxkolm,项目名称:php-selftop,代码行数:35,代码来源:SummaryController.php

示例7: actionView

 /**
  *
  */
 public function actionView()
 {
     /** @var User[] $users */
     $users = User::find()->all();
     /** @var Task[] $tasks */
     $tasks = Task::find()->all();
     foreach ($users as $user) {
         echo 'Username : ' . $user->username . "\n";
         echo 'TimeZone : ' . $user->timeZone . "\n";
         echo 'Tasks : ' . "\n";
         foreach ($tasks as $task) {
             echo "\t" . 'Task : ' . $task->title . "\n";
             \Yii::$app->formatter->timeZone = 'UTC';
             echo "\t" . 'Time UTC start : ' . \Yii::$app->formatter->asDatetime($task->timeStart) . "\n";
             echo "\t" . 'Time UTC end : ' . \Yii::$app->formatter->asDatetime($task->timeEnd) . "\n\n";
             \Yii::$app->formatter->timeZone = $user->timeZone;
             echo "\t" . 'Time ' . $user->timeZone . ' start : ' . \Yii::$app->formatter->asDatetime($task->timeStart) . "\n";
             echo "\t" . 'Time ' . $user->timeZone . ' end : ' . \Yii::$app->formatter->asDatetime($task->timeEnd) . "\n";
             echo "\t--------\n";
             // timestamp wont change if we apply timezone
             //                $date = new \DateTime();
             //                $date->setTimestamp($task->timeStart);
             //                $date->setTimezone(new \DateTimeZone($user->timeZone));
             //                echo $task->timeStart . ' => ' . $date->getTimestamp() . "\n"; // same timestamp
         }
         echo "=========== \n";
     }
 }
开发者ID:sergey-program,项目名称:test-tasks,代码行数:31,代码来源:TasksController.php

示例8: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $tasks = \App\Models\Task::all();
     foreach ($tasks as $task) {
         $startTime = strtotime($task->start_time);
         if (!$task->time_log || !count(json_decode($task->time_log))) {
             $task->time_log = json_encode([[$startTime, $startTime + $task->duration]]);
             $task->save();
         } elseif ($task->getDuration() != intval($task->duration)) {
             $task->time_log = json_encode([[$startTime, $startTime + $task->duration]]);
             $task->save();
         }
     }
     Schema::table('tasks', function ($table) {
         $table->dropColumn('start_time');
         $table->dropColumn('duration');
         $table->dropColumn('break_duration');
         $table->dropColumn('resume_time');
     });
     Schema::table('users', function ($table) {
         $table->boolean('dark_mode')->default(false)->nullable();
     });
     Schema::table('users', function ($table) {
         $table->dropColumn('theme_id');
     });
 }
开发者ID:magicians,项目名称:invoiceninja,代码行数:31,代码来源:2015_07_08_114333_simplify_tasks.php

示例9: search

 public function search($params, $dueDateOperator = null, $dueDate = null, $inCompleted = false)
 {
     $query = Task::find();
     $query->joinWith(["milestone.project", "milestone", "user"]);
     if (Yii::$app->user->identity->isViewingProject) {
         $query->andWhere(["project.id" => Yii::$app->user->identity->fkIDWithProjectID]);
     }
     if ($dueDateOperator != null && $dueDate != null) {
         $query->andWhere("task.dueDate " . $dueDateOperator . " '" . $dueDate . "'");
     }
     if ($inCompleted) {
         $query->andWhere(["task.completed" => 0]);
     }
     $activeDataProvider = new ActiveDataProvider(["query" => $query, "pagination" => ["pageSize" => 20]]);
     $activeDataProvider->sort->attributes["userFullName"] = ["asc" => ["user.fullName" => SORT_ASC], "desc" => ["user.fullName" => SORT_DESC]];
     $activeDataProvider->sort->attributes["projectName"] = ["asc" => ["project.name" => SORT_ASC], "desc" => ["project.name" => SORT_DESC]];
     $activeDataProvider->sort->attributes["milestoneName"] = ["asc" => ["milestone.name" => SORT_ASC], "desc" => ["milestone.name" => SORT_DESC]];
     if (!$this->load($params) || !$this->validate()) {
         if (Yii::$app->user->identity->defaultTasksAssignedToMe) {
             $this->userFullName = Yii::$app->user->id;
         }
         return $activeDataProvider;
     }
     $query->andFilterWhere(["like", "task.id", $this->id])->andFilterWhere(["like", "task.name", $this->name])->andFilterWhere(["like", "user.id", $this->userFullName])->andFilterWhere(["like", "project.name", $this->projectName])->andFilterWhere(["like", "milestone.name", $this->milestoneName])->andFilterWhere(["like", "task.dueDate", !empty($this->dueDate) ? Yii::$app->formatter->asDate($this->dueDate, "Y-MM-dd") : null])->andFilterWhere(["like", "task.completed", $this->completed]);
     return $activeDataProvider;
 }
开发者ID:JamesBarnsley,项目名称:Neptune,代码行数:26,代码来源:TaskSearch.php

示例10: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $tasks = Task::where('date', '>=', Carbon::parse(date('d-m-Y')))->where('date', '<=', Carbon::parse(date('d-m-Y'))->addDay(7))->orderBy('date', 'asc')->get();
     \Mail::send('emails.remainder', ['tasks' => $tasks], function ($m) {
         $m->to(env('REMAINDER_EMAIL'), env('REMAINDER_NAME'))->subject('[SUN TASK] Your Task Reminder.');
     });
 }
开发者ID:princesust,项目名称:SUN-TASK,代码行数:12,代码来源:Remainder.php

示例11: index

 /**
  * 显示当前课程列表
  * @author FuRongxin
  * @date    2016-03-29
  * @version 2.0
  * @return  \Illuminate\Http\Response 教师课程列表
  */
 public function index()
 {
     $tasks = Task::with(['course' => function ($query) {
         $query->select('kch', 'kcmc', 'xs');
     }])->whereJsgh(Auth::user()->jsgh)->whereNd(session('year'))->whereXq(session('term'))->orderBy('kcxh')->get();
     $title = session('year') . '年度' . Term::find(session('term'))->mc . '学期';
     return view('tes.index')->withTitle($title . '课程列表')->withTasks($tasks);
 }
开发者ID:rxfu,项目名称:teacher,代码行数:15,代码来源:TesController.php

示例12: getTasksNearest

 /**
  * Returns first nearest tasks
  * @param int $iTotalCount if provided total count will be returned to this value
  * @return Task[]
  */
 public static function getTasksNearest(&$iTotalCount = 0)
 {
     $query = Task::find()->where(['closed' => 0])->orderBy('date')->limit(10);
     if (func_num_args()) {
         $iTotalCount = $query->count();
     }
     return $query->andWhere('date')->all();
 }
开发者ID:sapozhkov,项目名称:goal,代码行数:13,代码来源:Dashboard.php

示例13: databaseReset

 /**
  * To reset database
  *
  * @param $key
  *
  * @return \Laravel\Lumen\Http\Redirector
  */
 public function databaseReset($key)
 {
     if (env('APP_DATA_RESET_KEY') == $key) {
         Task::truncate();
         return redirect('/');
     }
     return redirect('/');
 }
开发者ID:princesust,项目名称:SUN-TASK,代码行数:15,代码来源:ResetController.php

示例14: monitoring

 public function monitoring()
 {
     //print_r(auth()->user());
     $page = 2;
     $tasks = Task::query()->paginate($page);
     $links = $tasks->render();
     return view('front.task.monitoring', compact('tasks', 'links'));
 }
开发者ID:zrcing,项目名称:APM,代码行数:8,代码来源:TaskController.php

示例15: postCreate

 public function postCreate(Request $request)
 {
     $input = $request->only(['name']);
     $input['user_id'] = Auth::id();
     $input['course_id'] = Auth::user()->course_id;
     Task::create($input);
     flash()->message('Zadanie bolo vytvorené');
     return redirect()->back();
 }
开发者ID:psiskova,项目名称:blog-academy,代码行数:9,代码来源:TaskController.php


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