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


PHP Client::canViewItemByOwner方法代碼示例

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


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

示例1: getDatatableColumns

 protected function getDatatableColumns($entityType, $hideClient)
 {
     return [['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], ['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:sseshachala,項目名稱:invoiceninja,代碼行數:17,代碼來源:TaskService.php

示例2: getDatatableColumns

 protected function getDatatableColumns($entityType, $hideClient)
 {
     return [['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], ['amount', function ($model) {
         return Utils::formatMoney($model->amount, $model->currency_id, $model->country_id) . '<span ' . Utils::getEntityRowClass($model) . '/>';
     }], ['balance', function ($model) {
         return Utils::formatMoney($model->balance, $model->currency_id, $model->country_id);
     }], ['credit_date', function ($model) {
         return Utils::fromSqlDate($model->credit_date);
     }], ['private_notes', function ($model) {
         return $model->private_notes;
     }]];
 }
開發者ID:sseshachala,項目名稱:invoiceninja,代碼行數:17,代碼來源:CreditService.php

示例3: getDatatableColumns

 protected function getDatatableColumns($entityType, $hideClient)
 {
     return [['vendor_name', function ($model) {
         if ($model->vendor_public_id) {
             if (!Vendor::canViewItemByOwner($model->vendor_user_id)) {
                 return $model->vendor_name;
             }
             return link_to("vendors/{$model->vendor_public_id}", $model->vendor_name)->toHtml();
         } else {
             return '';
         }
     }], ['client_name', function ($model) {
         if ($model->client_public_id) {
             if (!Client::canViewItemByOwner($model->client_user_id)) {
                 return Utils::getClientDisplayName($model);
             }
             return link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model))->toHtml();
         } else {
             return '';
         }
     }], ['expense_date', function ($model) {
         if (!Expense::canEditItemByOwner($model->user_id)) {
             return Utils::fromSqlDate($model->expense_date);
         }
         return link_to("expenses/{$model->public_id}/edit", Utils::fromSqlDate($model->expense_date))->toHtml();
     }], ['amount', function ($model) {
         // show both the amount and the converted amount
         if ($model->exchange_rate != 1) {
             $converted = round($model->amount * $model->exchange_rate, 2);
             return Utils::formatMoney($model->amount, $model->expense_currency_id) . ' | ' . Utils::formatMoney($converted, $model->invoice_currency_id);
         } else {
             return Utils::formatMoney($model->amount, $model->expense_currency_id);
         }
     }], ['public_notes', function ($model) {
         return $model->public_notes != null ? substr($model->public_notes, 0, 100) : '';
     }], ['expense_status_id', function ($model) {
         return self::getStatusLabel($model->invoice_id, $model->should_be_invoiced);
     }]];
 }
開發者ID:sseshachala,項目名稱:invoiceninja,代碼行數:39,代碼來源:ExpenseService.php

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

示例5: getDatatableColumns

 protected function getDatatableColumns($entityType, $hideClient)
 {
     return [['invoice_number', function ($model) use($entityType) {
         if (!Invoice::canEditItem($model)) {
             return $model->invoice_number;
         }
         return link_to("{$entityType}s/{$model->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 link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model))->toHtml();
     }, !$hideClient], ['invoice_date', function ($model) {
         return Utils::fromSqlDate($model->invoice_date);
     }], ['amount', function ($model) {
         return Utils::formatMoney($model->amount, $model->currency_id, $model->country_id);
     }], ['balance', function ($model) {
         return $model->partial > 0 ? trans('texts.partial_remaining', ['partial' => Utils::formatMoney($model->partial, $model->currency_id, $model->country_id), 'balance' => Utils::formatMoney($model->balance, $model->currency_id, $model->country_id)]) : Utils::formatMoney($model->balance, $model->currency_id, $model->country_id);
     }, $entityType == ENTITY_INVOICE], ['due_date', function ($model) {
         return Utils::fromSqlDate($model->due_date);
     }], ['invoice_status_name', function ($model) use($entityType) {
         return $model->quote_invoice_id ? link_to("invoices/{$model->quote_invoice_id}/edit", trans('texts.converted'))->toHtml() : self::getStatusLabel($entityType, $model);
     }]];
 }
開發者ID:sseshachala,項目名稱:invoiceninja,代碼行數:24,代碼來源:InvoiceService.php


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