當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Invoice::canEditItemByOwner方法代碼示例

本文整理匯總了PHP中app\models\Invoice::canEditItemByOwner方法的典型用法代碼示例。如果您正苦於以下問題:PHP Invoice::canEditItemByOwner方法的具體用法?PHP Invoice::canEditItemByOwner怎麽用?PHP Invoice::canEditItemByOwner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\models\Invoice的用法示例。


在下文中一共展示了Invoice::canEditItemByOwner方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getDatatableActions

 protected function getDatatableActions($entityType)
 {
     return [[trans('texts.edit_task'), function ($model) {
         return URL::to('tasks/' . $model->public_id . '/edit');
     }, function ($model) {
         return (!$model->deleted_at || $model->deleted_at == '0000-00-00') && Task::canEditItem($model);
     }], [trans('texts.view_invoice'), function ($model) {
         return URL::to("/invoices/{$model->invoice_public_id}/edit");
     }, function ($model) {
         return $model->invoice_number && Invoice::canEditItemByOwner($model->invoice_user_id);
     }], [trans('texts.stop_task'), function ($model) {
         return "javascript:stopTask({$model->public_id})";
     }, function ($model) {
         return $model->is_running && Task::canEditItem($model);
     }], [trans('texts.invoice_task'), function ($model) {
         return "javascript:invoiceEntity({$model->public_id})";
     }, function ($model) {
         return !$model->invoice_number && (!$model->deleted_at || $model->deleted_at == '0000-00-00') && Invoice::canCreate();
     }]];
 }
開發者ID:sseshachala,項目名稱:invoiceninja,代碼行數:20,代碼來源:TaskService.php

示例2: getDatatableColumns

 protected function getDatatableColumns($entityType, $hideClient)
 {
     return [['invoice_number', function ($model) {
         if (!Invoice::canEditItemByOwner($model->invoice_user_id)) {
             return $model->invoice_number;
         }
         return link_to("invoices/{$model->invoice_public_id}/edit", $model->invoice_number, ['class' => Utils::getEntityRowClass($model)])->toHtml();
     }], ['client_name', function ($model) {
         if (!Client::canViewItemByOwner($model->client_user_id)) {
             return Utils::getClientDisplayName($model);
         }
         return $model->client_public_id ? link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model))->toHtml() : '';
     }, !$hideClient], ['transaction_reference', function ($model) {
         return $model->transaction_reference ? $model->transaction_reference : '<i>Manual entry</i>';
     }], ['payment_type', function ($model) {
         return $model->payment_type ? $model->payment_type : ($model->account_gateway_id ? $model->gateway_name : '');
     }], ['amount', function ($model) {
         return Utils::formatMoney($model->amount, $model->currency_id, $model->country_id);
     }], ['payment_date', function ($model) {
         return Utils::dateToString($model->payment_date);
     }]];
 }
開發者ID:sseshachala,項目名稱:invoiceninja,代碼行數:22,代碼來源:PaymentService.php

示例3: getDatatableActions

 protected function getDatatableActions($entityType)
 {
     return [[trans('texts.edit_expense'), function ($model) {
         return URL::to("expenses/{$model->public_id}/edit");
     }, function ($model) {
         return Expense::canEditItem($model);
     }], [trans('texts.view_invoice'), function ($model) {
         return URL::to("/invoices/{$model->invoice_public_id}/edit");
     }, function ($model) {
         return $model->invoice_public_id && Invoice::canEditItemByOwner($model->invoice_user_id);
     }], [trans('texts.invoice_expense'), function ($model) {
         return "javascript:invoiceEntity({$model->public_id})";
     }, function ($model) {
         return !$model->invoice_id && (!$model->deleted_at || $model->deleted_at == '0000-00-00') && Invoice::canCreate();
     }]];
 }
開發者ID:sseshachala,項目名稱:invoiceninja,代碼行數:16,代碼來源:ExpenseService.php


注:本文中的app\models\Invoice::canEditItemByOwner方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。