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


PHP Task::calcDuration方法代码示例

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


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

示例1: getDatatableColumns

 protected function getDatatableColumns($entityType, $hideClient)
 {
     return [['client_name', function ($model) {
         return $model->client_public_id ? link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model)) : '';
     }, !$hideClient], ['created_at', function ($model) {
         return link_to("tasks/{$model->public_id}/edit", Task::calcStartTime($model));
     }], ['time_log', function ($model) {
         return Utils::formatTime(Task::calcDuration($model));
     }], ['description', function ($model) {
         return $model->description;
     }], ['invoice_number', function ($model) {
         return self::getStatusLabel($model);
     }]];
 }
开发者ID:magicians,项目名称:invoiceninja,代码行数:14,代码来源:TaskService.php

示例2: getDatatable

 public function getDatatable($clientPublicId = null)
 {
     $tasks = $this->taskRepo->find($clientPublicId, Input::get('sSearch'));
     $table = Datatable::query($tasks);
     if (!$clientPublicId) {
         $table->addColumn('checkbox', function ($model) {
             return '<input type="checkbox" name="ids[]" value="' . $model->public_id . '" ' . Utils::getEntityRowClass($model) . '>';
         })->addColumn('client_name', function ($model) {
             return $model->client_public_id ? link_to('clients/' . $model->client_public_id, Utils::getClientDisplayName($model)) : '';
         });
     }
     return $table->addColumn('created_at', function ($model) {
         return link_to("tasks/{$model->public_id}/edit", Task::calcStartTime($model));
     })->addColumn('time_log', function ($model) {
         return gmdate('H:i:s', Task::calcDuration($model));
     })->addColumn('description', function ($model) {
         return $model->description;
     })->addColumn('invoice_number', function ($model) {
         return self::getStatusLabel($model);
     })->addColumn('dropdown', function ($model) {
         $str = '<div class="btn-group tr-action" style="visibility:hidden;">
   							<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
     							' . trans('texts.select') . ' <span class="caret"></span>
   							</button>
   							<ul class="dropdown-menu" role="menu">';
         if (!$model->deleted_at || $model->deleted_at == '0000-00-00') {
             $str .= '<li><a href="' . URL::to('tasks/' . $model->public_id . '/edit') . '">' . trans('texts.edit_task') . '</a></li>';
         }
         if ($model->invoice_number) {
             $str .= '<li>' . link_to("/invoices/{$model->invoice_public_id}/edit", trans('texts.view_invoice')) . '</li>';
         } elseif ($model->is_running) {
             $str .= '<li><a href="javascript:stopTask(' . $model->public_id . ')">' . trans('texts.stop_task') . '</a></li>';
         } elseif (!$model->deleted_at || $model->deleted_at == '0000-00-00') {
             $str .= '<li><a href="javascript:invoiceTask(' . $model->public_id . ')">' . trans('texts.invoice_task') . '</a></li>';
         }
         if (!$model->deleted_at || $model->deleted_at == '0000-00-00') {
             $str .= '<li class="divider"></li>
 						    <li><a href="javascript:archiveEntity(' . $model->public_id . ')">' . trans('texts.archive_task') . '</a></li>';
         } else {
             $str .= '<li><a href="javascript:restoreEntity(' . $model->public_id . ')">' . trans('texts.restore_task') . '</a></li>';
         }
         if (!$model->is_deleted) {
             $str .= '<li><a href="javascript:deleteEntity(' . $model->public_id . ')">' . trans('texts.delete_task') . '</a></li></ul>';
         }
         return $str . '</div>';
     })->make();
 }
开发者ID:GhDj,项目名称:erp-fac-fin,代码行数:47,代码来源:TaskController.php

示例3: columns

 public function columns()
 {
     return [['client_name', function ($model) {
         if (!Auth::user()->can('viewByOwner', [ENTITY_CLIENT, $model->client_user_id])) {
             return Utils::getClientDisplayName($model);
         }
         return $model->client_public_id ? link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model))->toHtml() : '';
     }, !$this->hideClient], ['created_at', function ($model) {
         return link_to("tasks/{$model->public_id}/edit", Task::calcStartTime($model))->toHtml();
     }], ['time_log', function ($model) {
         return Utils::formatTime(Task::calcDuration($model));
     }], ['description', function ($model) {
         return $model->description;
     }], ['invoice_number', function ($model) {
         return self::getStatusLabel($model);
     }]];
 }
开发者ID:rafaelsisweb,项目名称:invoice-ninja,代码行数:17,代码来源:TaskDatatable.php


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