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