mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 12:42:36 +01:00
Working on proposals
This commit is contained in:
parent
de040a4455
commit
f45c39d6f4
@ -55,14 +55,14 @@ class ProposalCategoryController extends BaseController
|
||||
'account' => auth()->user()->account,
|
||||
'proposalCategory' => null,
|
||||
'method' => 'POST',
|
||||
'url' => 'proposal_categories',
|
||||
'url' => 'proposals/categories',
|
||||
'title' => trans('texts.new_proposal_category'),
|
||||
'quotes' => Invoice::scope()->with('client.contacts')->quotes()->orderBy('id')->get(),
|
||||
'templates' => ProposalCategory::scope()->orderBy('name')->get(),
|
||||
'quotePublicId' => $request->quote_id,
|
||||
];
|
||||
|
||||
return View::make('proposals/categories/edit', $data);
|
||||
return View::make('proposals/categories.edit', $data);
|
||||
}
|
||||
|
||||
public function edit(ProposalCategoryRequest $request)
|
||||
@ -73,7 +73,7 @@ class ProposalCategoryController extends BaseController
|
||||
'account' => auth()->user()->account,
|
||||
'proposalCategory' => $proposalCategory,
|
||||
'method' => 'PUT',
|
||||
'url' => 'proposal_categories/' . $proposalCategory->public_id,
|
||||
'url' => 'proposals/categories/' . $proposalCategory->public_id,
|
||||
'title' => trans('texts.edit_proposal_category'),
|
||||
'clients' => Client::scope()->with('contacts')->orderBy('name')->get(),
|
||||
'clientPublicId' => $proposalCategory->client ? $proposalCategory->client->public_id : null,
|
||||
@ -118,6 +118,6 @@ class ProposalCategoryController extends BaseController
|
||||
Session::flash('message', $message);
|
||||
}
|
||||
|
||||
return redirect()->to('/proposal_categories');
|
||||
return redirect()->to('/proposals/categories');
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class ProposalSnippetController extends BaseController
|
||||
'account' => auth()->user()->account,
|
||||
'proposalSnippet' => null,
|
||||
'method' => 'POST',
|
||||
'url' => 'proposal_snippets',
|
||||
'url' => 'proposals/snippets',
|
||||
'title' => trans('texts.new_proposal_snippet'),
|
||||
'quotes' => Invoice::scope()->with('client.contacts')->quotes()->orderBy('id')->get(),
|
||||
'templates' => ProposalSnippet::scope()->orderBy('name')->get(),
|
||||
@ -73,13 +73,13 @@ class ProposalSnippetController extends BaseController
|
||||
'account' => auth()->user()->account,
|
||||
'proposalSnippet' => $proposalSnippet,
|
||||
'method' => 'PUT',
|
||||
'url' => 'proposal_snippets/' . $proposalSnippet->public_id,
|
||||
'url' => 'proposals/snippets/' . $proposalSnippet->public_id,
|
||||
'title' => trans('texts.edit_proposal_snippet'),
|
||||
'clients' => Client::scope()->with('contacts')->orderBy('name')->get(),
|
||||
'clientPublicId' => $proposalSnippet->client ? $proposalSnippet->client->public_id : null,
|
||||
];
|
||||
|
||||
return View::make('proposals/snippets/edit', $data);
|
||||
return View::make('proposals/snippets.edit', $data);
|
||||
}
|
||||
|
||||
public function store(CreateProposalSnippetRequest $request)
|
||||
|
@ -55,7 +55,7 @@ class ProposalTemplateController extends BaseController
|
||||
'account' => auth()->user()->account,
|
||||
'proposalTemplate' => null,
|
||||
'method' => 'POST',
|
||||
'url' => 'proposal_templates',
|
||||
'url' => 'proposals/templates',
|
||||
'title' => trans('texts.new_proposal_template'),
|
||||
'quotes' => Invoice::scope()->with('client.contacts')->quotes()->orderBy('id')->get(),
|
||||
'templates' => ProposalTemplate::scope()->orderBy('name')->get(),
|
||||
@ -73,7 +73,7 @@ class ProposalTemplateController extends BaseController
|
||||
'account' => auth()->user()->account,
|
||||
'proposalTemplate' => $proposalTemplate,
|
||||
'method' => 'PUT',
|
||||
'url' => 'proposal_templates/' . $proposalTemplate->public_id,
|
||||
'url' => 'proposals/templates/' . $proposalTemplate->public_id,
|
||||
'title' => trans('texts.edit_proposal_template'),
|
||||
'clients' => Client::scope()->with('contacts')->orderBy('name')->get(),
|
||||
'clientPublicId' => $proposalTemplate->client ? $proposalTemplate->client->public_id : null,
|
||||
@ -118,6 +118,6 @@ class ProposalTemplateController extends BaseController
|
||||
Session::flash('message', $message);
|
||||
}
|
||||
|
||||
return redirect()->to('/proposal_templates');
|
||||
return redirect()->to('/proposals/templates');
|
||||
}
|
||||
}
|
||||
|
@ -50,22 +50,22 @@
|
||||
{!! DropdownButton::normal(trans('texts.proposal_templates'))
|
||||
->withAttributes(['class'=>'templatesDropdown'])
|
||||
->withContents([
|
||||
['label' => trans('texts.new_proposal_template'), 'url' => url('/proposal_templates/create')],
|
||||
['label' => trans('texts.new_proposal_template'), 'url' => url('/proposals/templates/create')],
|
||||
]
|
||||
)->split() !!}
|
||||
{!! DropdownButton::normal(trans('texts.proposal_snippets'))
|
||||
->withAttributes(['class'=>'snippetsDropdown'])
|
||||
->withContents([
|
||||
['label' => trans('texts.new_proposal_snippet'), 'url' => url('/proposal_snippets/create')],
|
||||
['label' => trans('texts.new_proposal_snippet'), 'url' => url('/proposals/snippets/create')],
|
||||
]
|
||||
)->split() !!}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('.templatesDropdown:not(.dropdown-toggle)').click(function(event) {
|
||||
openUrlOnClick('{{ url('/proposal_templates') }}', event);
|
||||
openUrlOnClick('{{ url('/proposals/templates') }}', event);
|
||||
});
|
||||
$('.snippetsDropdown:not(.dropdown-toggle)').click(function(event) {
|
||||
openUrlOnClick('{{ url('/proposal_snippets') }}', event);
|
||||
openUrlOnClick('{{ url('/proposals/snippets') }}', event);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -73,13 +73,13 @@
|
||||
{!! DropdownButton::normal(trans('texts.proposal_categories'))
|
||||
->withAttributes(['class'=>'categoriesDropdown'])
|
||||
->withContents([
|
||||
['label' => trans('texts.new_proposal_category'), 'url' => url('/proposal_categories/create')],
|
||||
['label' => trans('texts.new_proposal_category'), 'url' => url('/proposals/categories/create')],
|
||||
]
|
||||
)->split() !!}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('.categoriesDropdown:not(.dropdown-toggle)').click(function(event) {
|
||||
openUrlOnClick('{{ url('/proposal_categories') }}', event);
|
||||
openUrlOnClick('{{ url('/proposals/categories') }}', event);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -112,7 +112,12 @@
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->can('create', $entityType) && empty($vendorId))
|
||||
{!! Button::primary(mtrans($entityType, "new_{$entityType}"))->asLinkTo(url(Utils::pluralizeEntityType($entityType) . '/create/' . (isset($clientId) ? ($clientId . (isset($projectId) ? '/' . $projectId : '')) : '')))->appendIcon(Icon::create('plus-sign')) !!}
|
||||
{!! Button::primary(mtrans($entityType, "new_{$entityType}"))
|
||||
->asLinkTo(url(
|
||||
(in_array($entityType, [ENTITY_PROPOSAL_SNIPPET, ENTITY_PROPOSAL_CATEGORY, ENTITY_PROPOSAL_TEMPLATE]) ? str_replace('_', 's/', Utils::pluralizeEntityType($entityType)) : Utils::pluralizeEntityType($entityType)) .
|
||||
'/create/' . (isset($clientId) ? ($clientId . (isset($projectId) ? '/' . $projectId : '')) : '')
|
||||
))
|
||||
->appendIcon(Icon::create('plus-sign')) !!}
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
@ -205,17 +205,17 @@ Route::group(['middleware' => ['lookup:user', 'auth:user']], function () {
|
||||
Route::get('api/quotes/{client_id?}', 'QuoteController@getDatatable');
|
||||
Route::post('quotes/bulk', 'QuoteController@bulk');
|
||||
|
||||
Route::get('proposal_categories/create', 'ProposalCategoryController@create');
|
||||
Route::resource('proposal_categories', 'ProposalCategoryController');
|
||||
Route::get('api/proposal_categories', 'ProposalCategoryController@getDatatable');
|
||||
Route::get('proposals/categories/create', 'ProposalCategoryController@create');
|
||||
Route::resource('proposals/categories', 'ProposalCategoryController');
|
||||
Route::get('api/proposal/categories', 'ProposalCategoryController@getDatatable');
|
||||
|
||||
Route::get('proposal_snippets/create', 'ProposalSnippetController@create');
|
||||
Route::resource('proposal_snippets', 'ProposalSnippetController');
|
||||
Route::get('api/proposal_snippets', 'ProposalSnippetController@getDatatable');
|
||||
Route::get('proposals/snippets/create', 'ProposalSnippetController@create');
|
||||
Route::resource('proposals/snippets', 'ProposalSnippetController');
|
||||
Route::get('api/proposal/snippets', 'ProposalSnippetController@getDatatable');
|
||||
|
||||
Route::get('proposal_templates/create', 'ProposalTemplateController@create');
|
||||
Route::resource('proposal_templates', 'ProposalTemplateController');
|
||||
Route::get('api/proposal_templates', 'ProposalTemplateController@getDatatable');
|
||||
Route::get('proposals/templates/create', 'ProposalTemplateController@create');
|
||||
Route::resource('proposals/templates', 'ProposalTemplateController');
|
||||
Route::get('api/proposals/templates', 'ProposalTemplateController@getDatatable');
|
||||
|
||||
Route::get('proposals/create/{quote_id?}', 'ProposalController@create');
|
||||
Route::resource('proposals', 'ProposalController');
|
||||
|
Loading…
Reference in New Issue
Block a user