mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Proposals
This commit is contained in:
parent
7618053c60
commit
1474627dda
@ -15,15 +15,23 @@ class ProposalSnippetDatatable extends EntityDatatable
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
'name',
|
'proposal',
|
||||||
function ($model) {
|
function ($model) {
|
||||||
if (! Auth::user()->can('editByOwner', [ENTITY_PROPOSAL_SNIPPET, $model->user_id])) {
|
if (! Auth::user()->can('editByOwner', [ENTITY_PROPOSAL_SNIPPET, $model->user_id])) {
|
||||||
return $model->name;
|
return $model->proposal;
|
||||||
}
|
}
|
||||||
|
|
||||||
return link_to("proposal_snippets/{$model->public_id}", $model->name)->toHtml();
|
return link_to("proposals/snippets/{$model->public_id}/edit", $model->proposal)->toHtml();
|
||||||
//$str = link_to("proposal_snippets/{$model->public_id}", $model->name)->toHtml();
|
},
|
||||||
//return $this->addNote($str, $model->private_notes);
|
],
|
||||||
|
[
|
||||||
|
'category',
|
||||||
|
function ($model) {
|
||||||
|
if (! Auth::user()->can('editByOwner', [ENTITY_PROPOSAL_CATEGORY, $model->category_user_id])) {
|
||||||
|
return $model->category;
|
||||||
|
}
|
||||||
|
|
||||||
|
return link_to("proposals/categories/{$model->category_public_id}/edit", $model->category)->toHtml();
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
@ -33,9 +41,9 @@ class ProposalSnippetDatatable extends EntityDatatable
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
trans('texts.edit_snippet'),
|
trans('texts.edit_proposal_snippet'),
|
||||||
function ($model) {
|
function ($model) {
|
||||||
return URL::to("proposals_snippets/{$model->public_id}/edit");
|
return URL::to("proposals/snippets/{$model->public_id}/edit");
|
||||||
},
|
},
|
||||||
function ($model) {
|
function ($model) {
|
||||||
return Auth::user()->can('editByOwner', [ENTITY_PROPOSAL_SNIPPET, $model->user_id]);
|
return Auth::user()->can('editByOwner', [ENTITY_PROPOSAL_SNIPPET, $model->user_id]);
|
||||||
|
@ -32,7 +32,9 @@ class ProposalSnippetRepository extends BaseRepository
|
|||||||
'proposal_snippets.deleted_at',
|
'proposal_snippets.deleted_at',
|
||||||
'proposal_snippets.is_deleted',
|
'proposal_snippets.is_deleted',
|
||||||
'proposal_snippets.private_notes',
|
'proposal_snippets.private_notes',
|
||||||
'proposal_categories.name'
|
'proposal_categories.name as category',
|
||||||
|
'proposal_categories.public_id as category_public_id',
|
||||||
|
'proposal_categories.user_id as category_user_id'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->applyFilters($query, ENTITY_PROPOSAL_SNIPPET);
|
$this->applyFilters($query, ENTITY_PROPOSAL_SNIPPET);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user