当前位置: 首页>>代码示例>>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;未经允许,请勿转载。