本文整理汇总了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();
}]];
}
示例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);
}]];
}
示例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();
}]];
}