mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Standardize archive/deleted behaviors
This commit is contained in:
parent
48f2f58d3f
commit
147df1ef91
@ -85,7 +85,7 @@ class ProductController extends BaseController
|
|||||||
$data = [
|
$data = [
|
||||||
'account' => $account,
|
'account' => $account,
|
||||||
'taxRates' => $account->invoice_item_taxes ? TaxRate::scope()->get(['id', 'name', 'rate']) : null,
|
'taxRates' => $account->invoice_item_taxes ? TaxRate::scope()->get(['id', 'name', 'rate']) : null,
|
||||||
'product' => Product::scope($publicId)->firstOrFail(),
|
'product' => Product::scope($publicId)->withTrashed()->firstOrFail(),
|
||||||
'method' => 'PUT',
|
'method' => 'PUT',
|
||||||
'url' => 'products/'.$publicId,
|
'url' => 'products/'.$publicId,
|
||||||
'title' => trans('texts.edit_product'),
|
'title' => trans('texts.edit_product'),
|
||||||
@ -137,7 +137,7 @@ class ProductController extends BaseController
|
|||||||
private function save($productPublicId = false)
|
private function save($productPublicId = false)
|
||||||
{
|
{
|
||||||
if ($productPublicId) {
|
if ($productPublicId) {
|
||||||
$product = Product::scope($productPublicId)->firstOrFail();
|
$product = Product::scope($productPublicId)->withTrashed()->firstOrFail();
|
||||||
} else {
|
} else {
|
||||||
$product = Product::createNew();
|
$product = Product::createNew();
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,9 @@ class UserController extends BaseController
|
|||||||
public function edit($publicId)
|
public function edit($publicId)
|
||||||
{
|
{
|
||||||
$user = User::where('account_id', '=', Auth::user()->account_id)
|
$user = User::where('account_id', '=', Auth::user()->account_id)
|
||||||
->where('public_id', '=', $publicId)->firstOrFail();
|
->where('public_id', '=', $publicId)
|
||||||
|
->withTrashed()
|
||||||
|
->firstOrFail();
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
@ -157,7 +159,9 @@ class UserController extends BaseController
|
|||||||
|
|
||||||
if ($userPublicId) {
|
if ($userPublicId) {
|
||||||
$user = User::where('account_id', '=', Auth::user()->account_id)
|
$user = User::where('account_id', '=', Auth::user()->account_id)
|
||||||
->where('public_id', '=', $userPublicId)->firstOrFail();
|
->where('public_id', '=', $userPublicId)
|
||||||
|
->withTrashed()
|
||||||
|
->firstOrFail();
|
||||||
|
|
||||||
$rules['email'] = 'required|email|unique:users,email,'.$user->id.',id';
|
$rules['email'] = 'required|email|unique:users,email,'.$user->id.',id';
|
||||||
} else {
|
} else {
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
class UpdateTaxRateRequest extends TaxRateRequest
|
class UpdateTaxRateRequest extends TaxRateRequest
|
||||||
{
|
{
|
||||||
// Expenses
|
|
||||||
/**
|
/**
|
||||||
* Determine if the user is authorized to make this request.
|
* Determine if the user is authorized to make this request.
|
||||||
*
|
*
|
||||||
|
@ -123,7 +123,9 @@ class ActivityListener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$backupInvoice = Invoice::with('invoice_items', 'client.account', 'client.contacts')->find($event->invoice->id);
|
$backupInvoice = Invoice::with('invoice_items', 'client.account', 'client.contacts')
|
||||||
|
->withArchived()
|
||||||
|
->find($event->invoice->id);
|
||||||
|
|
||||||
$activity = $this->activityRepo->create(
|
$activity = $this->activityRepo->create(
|
||||||
$event->invoice,
|
$event->invoice,
|
||||||
|
@ -89,7 +89,11 @@ class PaymentDatatable extends EntityDatatable
|
|||||||
[
|
[
|
||||||
'payment_date',
|
'payment_date',
|
||||||
function ($model) {
|
function ($model) {
|
||||||
return Utils::dateToString($model->payment_date);
|
if ($model->is_deleted) {
|
||||||
|
return Utils::dateToString($model->payment_date);
|
||||||
|
} else {
|
||||||
|
return link_to("payments/{$model->public_id}/edit", Utils::dateToString($model->payment_date))->toHtml();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -80,6 +80,10 @@ class ClientRepository extends BaseRepository
|
|||||||
$client = Client::scope($publicId)->with('contacts')->firstOrFail();
|
$client = Client::scope($publicId)->with('contacts')->firstOrFail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($client->is_deleted) {
|
||||||
|
return $client;
|
||||||
|
}
|
||||||
|
|
||||||
// convert currency code to id
|
// convert currency code to id
|
||||||
if (isset($data['currency_code'])) {
|
if (isset($data['currency_code'])) {
|
||||||
$currencyCode = strtolower($data['currency_code']);
|
$currencyCode = strtolower($data['currency_code']);
|
||||||
|
@ -118,11 +118,17 @@ class ExpenseRepository extends BaseRepository
|
|||||||
// do nothing
|
// do nothing
|
||||||
} elseif ($publicId) {
|
} elseif ($publicId) {
|
||||||
$expense = Expense::scope($publicId)->firstOrFail();
|
$expense = Expense::scope($publicId)->firstOrFail();
|
||||||
\Log::warning('Entity not set in expense repo save');
|
if (Utils::isNinjaDev()) {
|
||||||
|
\Log::warning('Entity not set in expense repo save');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$expense = Expense::createNew();
|
$expense = Expense::createNew();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($expense->is_deleted) {
|
||||||
|
return $expense;
|
||||||
|
}
|
||||||
|
|
||||||
// First auto fill
|
// First auto fill
|
||||||
$expense->fill($input);
|
$expense->fill($input);
|
||||||
|
|
||||||
|
@ -280,7 +280,13 @@ class InvoiceRepository extends BaseRepository
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$invoice = Invoice::scope($publicId)->firstOrFail();
|
$invoice = Invoice::scope($publicId)->firstOrFail();
|
||||||
\Log::warning('Entity not set in invoice repo save');
|
if (Utils::isNinjaDev()) {
|
||||||
|
\Log::warning('Entity not set in invoice repo save');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($invoice->is_deleted) {
|
||||||
|
return $invoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
$invoice->fill($data);
|
$invoice->fill($data);
|
||||||
|
@ -150,11 +150,17 @@ class PaymentRepository extends BaseRepository
|
|||||||
// do nothing
|
// do nothing
|
||||||
} elseif ($publicId) {
|
} elseif ($publicId) {
|
||||||
$payment = Payment::scope($publicId)->firstOrFail();
|
$payment = Payment::scope($publicId)->firstOrFail();
|
||||||
\Log::warning('Entity not set in payment repo save');
|
if (Utils::isNinjaDev()) {
|
||||||
|
\Log::warning('Entity not set in payment repo save');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$payment = Payment::createNew();
|
$payment = Payment::createNew();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($payment->is_deleted) {
|
||||||
|
return $payment;
|
||||||
|
}
|
||||||
|
|
||||||
$paymentTypeId = false;
|
$paymentTypeId = false;
|
||||||
if (isset($input['payment_type_id'])) {
|
if (isset($input['payment_type_id'])) {
|
||||||
$paymentTypeId = $input['payment_type_id'] ? $input['payment_type_id'] : null;
|
$paymentTypeId = $input['payment_type_id'] ? $input['payment_type_id'] : null;
|
||||||
|
@ -67,11 +67,15 @@ class TaskRepository
|
|||||||
if ($task) {
|
if ($task) {
|
||||||
// do nothing
|
// do nothing
|
||||||
} elseif ($publicId) {
|
} elseif ($publicId) {
|
||||||
$task = Task::scope($publicId)->firstOrFail();
|
$task = Task::scope($publicId)->withTrashed()->firstOrFail();
|
||||||
} else {
|
} else {
|
||||||
$task = Task::createNew();
|
$task = Task::createNew();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($task->is_deleted) {
|
||||||
|
return $task;
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($data['client']) && $data['client']) {
|
if (isset($data['client']) && $data['client']) {
|
||||||
$task->client_id = Client::getPrivateId($data['client']);
|
$task->client_id = Client::getPrivateId($data['client']);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?php namespace App\Ninja\Repositories;
|
<?php namespace App\Ninja\Repositories;
|
||||||
|
|
||||||
|
use Utils;
|
||||||
use DB;
|
use DB;
|
||||||
use App\Models\Vendor;
|
use App\Models\Vendor;
|
||||||
|
|
||||||
@ -70,7 +71,13 @@ class VendorRepository extends BaseRepository
|
|||||||
$vendor = Vendor::createNew();
|
$vendor = Vendor::createNew();
|
||||||
} else {
|
} else {
|
||||||
$vendor = Vendor::scope($publicId)->with('vendor_contacts')->firstOrFail();
|
$vendor = Vendor::scope($publicId)->with('vendor_contacts')->firstOrFail();
|
||||||
\Log::warning('Entity not set in vendor repo save');
|
if (Utils::isNinjaDev()) {
|
||||||
|
\Log::warning('Entity not set in vendor repo save');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($vendor->is_deleted) {
|
||||||
|
return $vendor;
|
||||||
}
|
}
|
||||||
|
|
||||||
$vendor->fill($data);
|
$vendor->fill($data);
|
||||||
|
@ -77,6 +77,7 @@ class DatatableService
|
|||||||
if (!$model->deleted_at || $model->deleted_at == '0000-00-00') {
|
if (!$model->deleted_at || $model->deleted_at == '0000-00-00') {
|
||||||
foreach ($datatable->actions() as $action) {
|
foreach ($datatable->actions() as $action) {
|
||||||
if (count($action)) {
|
if (count($action)) {
|
||||||
|
// if show function isn't set default to true
|
||||||
if (count($action) == 2) {
|
if (count($action) == 2) {
|
||||||
$action[] = function() {
|
$action[] = function() {
|
||||||
return true;
|
return true;
|
||||||
@ -84,11 +85,10 @@ class DatatableService
|
|||||||
}
|
}
|
||||||
list($value, $url, $visible) = $action;
|
list($value, $url, $visible) = $action;
|
||||||
if ($visible($model)) {
|
if ($visible($model)) {
|
||||||
if($value == '--divider--'){
|
if ($value == '--divider--') {
|
||||||
$dropdown_contents .= '<li class="divider"></li>';
|
$dropdown_contents .= '<li class="divider"></li>';
|
||||||
$lastIsDivider = true;
|
$lastIsDivider = true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$urlVal = $url($model);
|
$urlVal = $url($model);
|
||||||
$urlStr = is_string($urlVal) ? $urlVal : $urlVal['url'];
|
$urlStr = is_string($urlVal) ? $urlVal : $urlVal['url'];
|
||||||
$attributes = '';
|
$attributes = '';
|
||||||
|
@ -131,7 +131,7 @@ class PaymentService extends BaseService
|
|||||||
if(!Utils::hasPermission('view_all')){
|
if(!Utils::hasPermission('view_all')){
|
||||||
$query->where('payments.user_id', '=', Auth::user()->id);
|
$query->where('payments.user_id', '=', Auth::user()->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->datatableService->createDatatable($datatable, $query);
|
return $this->datatableService->createDatatable($datatable, $query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
@parent
|
@parent
|
||||||
|
|
||||||
{!! Former::open_for_files()->addClass('warn-on-exit')->rules(array(
|
{!! Former::open_for_files()->addClass('warn-on-exit')->rules(array(
|
||||||
|
'first_name' => 'required',
|
||||||
|
'last_name' => 'required',
|
||||||
'email' => 'email|required'
|
'email' => 'email|required'
|
||||||
)) !!}
|
)) !!}
|
||||||
|
|
||||||
|
@ -44,26 +44,34 @@
|
|||||||
->withAttributes(['target' => '_blank']) !!}
|
->withAttributes(['target' => '_blank']) !!}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if ( ! $client->is_deleted)
|
||||||
|
@can('edit', $client)
|
||||||
|
{!! DropdownButton::normal(trans('texts.edit_client'))
|
||||||
|
->withAttributes(['class'=>'normalDropDown'])
|
||||||
|
->withContents([
|
||||||
|
($client->trashed() ? false : ['label' => trans('texts.archive_client'), 'url' => "javascript:onArchiveClick()"]),
|
||||||
|
['label' => trans('texts.delete_client'), 'url' => "javascript:onDeleteClick()"],
|
||||||
|
]
|
||||||
|
)->split() !!}
|
||||||
|
@endcan
|
||||||
|
@if ( ! $client->trashed())
|
||||||
|
@can('create', ENTITY_INVOICE)
|
||||||
|
{!! DropdownButton::primary(trans('texts.new_invoice'))
|
||||||
|
->withAttributes(['class'=>'primaryDropDown'])
|
||||||
|
->withContents($actionLinks)->split() !!}
|
||||||
|
@endcan
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
|
||||||
@if ($client->trashed())
|
@if ($client->trashed())
|
||||||
@can('edit', $client)
|
@can('edit', $client)
|
||||||
{!! Button::primary(trans('texts.restore_client'))->withAttributes(['onclick' => 'onRestoreClick()']) !!}
|
{!! Button::primary(trans('texts.restore_client'))
|
||||||
@endcan
|
->appendIcon(Icon::create('cloud-download'))
|
||||||
@else
|
->withAttributes(['onclick' => 'onRestoreClick()']) !!}
|
||||||
@can('edit', $client)
|
|
||||||
{!! DropdownButton::normal(trans('texts.edit_client'))
|
|
||||||
->withAttributes(['class'=>'normalDropDown'])
|
|
||||||
->withContents([
|
|
||||||
['label' => trans('texts.archive_client'), 'url' => "javascript:onArchiveClick()"],
|
|
||||||
['label' => trans('texts.delete_client'), 'url' => "javascript:onDeleteClick()"],
|
|
||||||
]
|
|
||||||
)->split() !!}
|
|
||||||
@endcan
|
|
||||||
@can('create', ENTITY_INVOICE)
|
|
||||||
{!! DropdownButton::primary(trans('texts.new_invoice'))
|
|
||||||
->withAttributes(['class'=>'primaryDropDown'])
|
|
||||||
->withContents($actionLinks)->split() !!}
|
|
||||||
@endcan
|
@endcan
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
{!! Former::close() !!}
|
{!! Former::close() !!}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -171,28 +171,38 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (Auth::user()->canCreateOrEdit(ENTITY_EXPENSE, $expense))
|
<center class="buttons">
|
||||||
<center class="buttons">
|
{!! Button::normal(trans('texts.cancel'))
|
||||||
{!! Button::normal(trans('texts.cancel'))
|
->asLinkTo(URL::to('/expenses'))
|
||||||
->asLinkTo(URL::to('/expenses'))
|
->appendIcon(Icon::create('remove-circle'))
|
||||||
->appendIcon(Icon::create('remove-circle'))
|
->large() !!}
|
||||||
->large() !!}
|
|
||||||
|
|
||||||
|
@if (Auth::user()->canCreateOrEdit(ENTITY_EXPENSE, $expense))
|
||||||
@if (Auth::user()->hasFeature(FEATURE_EXPENSES))
|
@if (Auth::user()->hasFeature(FEATURE_EXPENSES))
|
||||||
{!! Button::success(trans('texts.save'))
|
@if (!$expense || !$expense->is_deleted)
|
||||||
->appendIcon(Icon::create('floppy-disk'))
|
{!! Button::success(trans('texts.save'))
|
||||||
->large()
|
->appendIcon(Icon::create('floppy-disk'))
|
||||||
->submit() !!}
|
->large()
|
||||||
|
->submit() !!}
|
||||||
|
@endif
|
||||||
|
|
||||||
@if ($expense)
|
@if ($expense && !$expense->trashed())
|
||||||
{!! DropdownButton::normal(trans('texts.more_actions'))
|
{!! DropdownButton::normal(trans('texts.more_actions'))
|
||||||
->withContents($actions)
|
->withContents($actions)
|
||||||
->large()
|
->large()
|
||||||
->dropup() !!}
|
->dropup() !!}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if ($expense && $expense->trashed())
|
||||||
|
{!! Button::primary(trans('texts.restore'))
|
||||||
|
->withAttributes(['onclick' => 'submitAction("restore")'])
|
||||||
|
->appendIcon(Icon::create('cloud-download'))
|
||||||
|
->large() !!}
|
||||||
|
@endif
|
||||||
|
|
||||||
@endif
|
@endif
|
||||||
</center>
|
@endif
|
||||||
@endif
|
</center>
|
||||||
|
|
||||||
{!! Former::close() !!}
|
{!! Former::close() !!}
|
||||||
|
|
||||||
|
@ -539,19 +539,24 @@
|
|||||||
@if (Auth::user()->canCreateOrEdit(ENTITY_INVOICE, $invoice))
|
@if (Auth::user()->canCreateOrEdit(ENTITY_INVOICE, $invoice))
|
||||||
@if ($invoice->isClientTrashed())
|
@if ($invoice->isClientTrashed())
|
||||||
<!-- do nothing -->
|
<!-- do nothing -->
|
||||||
@elseif ($invoice->trashed())
|
@else
|
||||||
{!! Button::success(trans('texts.restore'))->withAttributes(['onclick' => 'submitBulkAction("restore")'])->appendIcon(Icon::create('cloud-download')) !!}
|
@if (!$invoice->is_deleted)
|
||||||
@elseif (!$invoice->trashed())
|
{!! Button::success(trans("texts.save_{$entityType}"))->withAttributes(array('id' => 'saveButton', 'onclick' => 'onSaveClick()'))->appendIcon(Icon::create('floppy-disk')) !!}
|
||||||
{!! Button::success(trans("texts.save_{$entityType}"))->withAttributes(array('id' => 'saveButton', 'onclick' => 'onSaveClick()'))->appendIcon(Icon::create('floppy-disk')) !!}
|
{!! Button::info(trans("texts.email_{$entityType}"))->withAttributes(array('id' => 'emailButton', 'onclick' => 'onEmailClick()'))->appendIcon(Icon::create('send')) !!}
|
||||||
{!! Button::info(trans("texts.email_{$entityType}"))->withAttributes(array('id' => 'emailButton', 'onclick' => 'onEmailClick()'))->appendIcon(Icon::create('send')) !!}
|
@if (!$invoice->trashed())
|
||||||
@if ($invoice->id)
|
@if ($invoice->id)
|
||||||
{!! DropdownButton::normal(trans('texts.more_actions'))
|
{!! DropdownButton::normal(trans('texts.more_actions'))
|
||||||
->withContents($actions)
|
->withContents($actions)
|
||||||
->dropup() !!}
|
->dropup() !!}
|
||||||
@elseif ( ! $invoice->isQuote() && Request::is('*/clone'))
|
@elseif ( ! $invoice->isQuote() && Request::is('*/clone'))
|
||||||
{!! Button::normal(trans($invoice->is_recurring ? 'texts.disable_recurring' : 'texts.enable_recurring'))->withAttributes(['id' => 'recurrButton', 'onclick' => 'onRecurrClick()'])->appendIcon(Icon::create('repeat')) !!}
|
{!! Button::normal(trans($invoice->is_recurring ? 'texts.disable_recurring' : 'texts.enable_recurring'))->withAttributes(['id' => 'recurrButton', 'onclick' => 'onRecurrClick()'])->appendIcon(Icon::create('repeat')) !!}
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
@if ($invoice->trashed())
|
||||||
|
{!! Button::primary(trans('texts.restore'))->withAttributes(['onclick' => 'submitBulkAction("restore")'])->appendIcon(Icon::create('cloud-download')) !!}
|
||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -1334,7 +1339,7 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@if ($invoice->trashed())
|
@if ($invoice->is_deleted)
|
||||||
if ($('#bulk_action').val() != 'restore') {
|
if ($('#bulk_action').val() != 'restore') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -13,11 +13,11 @@
|
|||||||
@stop
|
@stop
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
{!! Former::open($url)->addClass('col-md-10 col-md-offset-1 warn-on-exit')->method($method)->rules(array(
|
{!! Former::open($url)->addClass('col-md-10 col-md-offset-1 warn-on-exit')->method($method)->rules(array(
|
||||||
'client' => 'required',
|
'client' => 'required',
|
||||||
'invoice' => 'required',
|
'invoice' => 'required',
|
||||||
'amount' => 'required',
|
'amount' => 'required',
|
||||||
)) !!}
|
)) !!}
|
||||||
|
|
||||||
@if ($payment)
|
@if ($payment)
|
||||||
@ -27,7 +27,7 @@
|
|||||||
<span style="display:none">
|
<span style="display:none">
|
||||||
{!! Former::text('public_id') !!}
|
{!! Former::text('public_id') !!}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-10 col-md-offset-1">
|
<div class="col-md-10 col-md-offset-1">
|
||||||
|
|
||||||
@ -70,7 +70,9 @@
|
|||||||
|
|
||||||
<center class="buttons">
|
<center class="buttons">
|
||||||
{!! Button::normal(trans('texts.cancel'))->appendIcon(Icon::create('remove-circle'))->asLinkTo(URL::to('/payments'))->large() !!}
|
{!! Button::normal(trans('texts.cancel'))->appendIcon(Icon::create('remove-circle'))->asLinkTo(URL::to('/payments'))->large() !!}
|
||||||
{!! Button::success(trans('texts.save'))->appendIcon(Icon::create('floppy-disk'))->submit()->large() !!}
|
@if (!$payment || !$payment->is_deleted)
|
||||||
|
{!! Button::success(trans('texts.save'))->appendIcon(Icon::create('floppy-disk'))->submit()->large() !!}
|
||||||
|
@endif
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
{!! Former::close() !!}
|
{!! Former::close() !!}
|
||||||
@ -89,7 +91,7 @@
|
|||||||
populateInvoiceComboboxes({{ $clientPublicId }}, {{ $invoicePublicId }});
|
populateInvoiceComboboxes({{ $clientPublicId }}, {{ $invoicePublicId }});
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
$('#payment_type_id').combobox();
|
$('#payment_type_id').combobox();
|
||||||
|
|
||||||
@if (!$payment && !$clientPublicId)
|
@if (!$payment && !$clientPublicId)
|
||||||
$('.client-select input.form-control').focus();
|
$('.client-select input.form-control').focus();
|
||||||
@ -106,4 +108,4 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@stop
|
@stop
|
||||||
|
@ -128,35 +128,41 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<center class="buttons">
|
||||||
|
|
||||||
@if (Auth::user()->canCreateOrEdit(ENTITY_TASK, $task))
|
@if (Auth::user()->canCreateOrEdit(ENTITY_TASK, $task))
|
||||||
<center class="buttons">
|
@if (Auth::user()->hasFeature(FEATURE_TASKS))
|
||||||
@if (Auth::user()->hasFeature(FEATURE_TASKS))
|
@if ($task && $task->is_running)
|
||||||
@if ($task && $task->is_running)
|
{!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button']) !!}
|
||||||
{!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button']) !!}
|
{!! Button::primary(trans('texts.stop'))->large()->appendIcon(Icon::create('stop'))->withAttributes(['id' => 'stop-button']) !!}
|
||||||
{!! Button::primary(trans('texts.stop'))->large()->appendIcon(Icon::create('stop'))->withAttributes(['id' => 'stop-button']) !!}
|
@elseif ($task && $task->is_deleted)
|
||||||
@elseif ($task && $task->trashed())
|
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/tasks'))->appendIcon(Icon::create('remove-circle')) !!}
|
||||||
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/tasks'))->appendIcon(Icon::create('remove-circle')) !!}
|
{!! Button::primary(trans('texts.restore'))->large()->withAttributes(['onclick' => 'submitAction("restore")'])->appendIcon(Icon::create('cloud-download')) !!}
|
||||||
{!! Button::success(trans('texts.restore'))->large()->withAttributes(['onclick' => 'submitAction("restore")'])->appendIcon(Icon::create('cloud-download')) !!}
|
@elseif ($task && $task->trashed())
|
||||||
@else
|
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/tasks'))->appendIcon(Icon::create('remove-circle')) !!}
|
||||||
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/tasks'))->appendIcon(Icon::create('remove-circle')) !!}
|
{!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button']) !!}
|
||||||
@if ($task)
|
{!! Button::primary(trans('texts.restore'))->large()->withAttributes(['onclick' => 'submitAction("restore")'])->appendIcon(Icon::create('cloud-download')) !!}
|
||||||
{!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button']) !!}
|
|
||||||
{!! Button::primary(trans('texts.resume'))->large()->appendIcon(Icon::create('play'))->withAttributes(['id' => 'resume-button']) !!}
|
|
||||||
{!! DropdownButton::normal(trans('texts.more_actions'))
|
|
||||||
->withContents($actions)
|
|
||||||
->large()
|
|
||||||
->dropup() !!}
|
|
||||||
@else
|
|
||||||
{!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button']) !!}
|
|
||||||
{!! Button::success(trans('texts.start'))->large()->appendIcon(Icon::create('play'))->withAttributes(['id' => 'start-button']) !!}
|
|
||||||
@endif
|
|
||||||
@endif
|
|
||||||
@else
|
@else
|
||||||
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/tasks'))->appendIcon(Icon::create('remove-circle')) !!}
|
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/tasks'))->appendIcon(Icon::create('remove-circle')) !!}
|
||||||
|
@if ($task)
|
||||||
|
{!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button']) !!}
|
||||||
|
{!! Button::primary(trans('texts.resume'))->large()->appendIcon(Icon::create('play'))->withAttributes(['id' => 'resume-button']) !!}
|
||||||
|
{!! DropdownButton::normal(trans('texts.more_actions'))
|
||||||
|
->withContents($actions)
|
||||||
|
->large()
|
||||||
|
->dropup() !!}
|
||||||
|
@else
|
||||||
|
{!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button']) !!}
|
||||||
|
{!! Button::success(trans('texts.start'))->large()->appendIcon(Icon::create('play'))->withAttributes(['id' => 'start-button']) !!}
|
||||||
|
@endif
|
||||||
@endif
|
@endif
|
||||||
</center>
|
@else
|
||||||
|
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/tasks'))->appendIcon(Icon::create('remove-circle')) !!}
|
||||||
|
@endif
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
</center>
|
||||||
|
|
||||||
{!! Former::close() !!}
|
{!! Former::close() !!}
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
41
resources/views/vendors/show.blade.php
vendored
41
resources/views/vendors/show.blade.php
vendored
@ -28,21 +28,34 @@
|
|||||||
{!! Former::text('public_id')->value($vendor->public_id) !!}
|
{!! Former::text('public_id')->value($vendor->public_id) !!}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if ($vendor->trashed())
|
@if ( ! $vendor->is_deleted)
|
||||||
{!! Button::primary(trans('texts.restore_vendor'))->withAttributes(['onclick' => 'onRestoreClick()']) !!}
|
@can('edit', $vendor)
|
||||||
@else
|
{!! DropdownButton::normal(trans('texts.edit_vendor'))
|
||||||
{!! DropdownButton::normal(trans('texts.edit_vendor'))
|
->withAttributes(['class'=>'normalDropDown'])
|
||||||
->withAttributes(['class'=>'normalDropDown'])
|
->withContents([
|
||||||
->withContents([
|
($vendor->trashed() ? false : ['label' => trans('texts.archive_vendor'), 'url' => "javascript:onArchiveClick()"]),
|
||||||
['label' => trans('texts.archive_vendor'), 'url' => "javascript:onArchiveClick()"],
|
['label' => trans('texts.delete_vendor'), 'url' => "javascript:onDeleteClick()"],
|
||||||
['label' => trans('texts.delete_vendor'), 'url' => "javascript:onDeleteClick()"],
|
]
|
||||||
]
|
)->split() !!}
|
||||||
)->split() !!}
|
@endcan
|
||||||
|
@if ( ! $vendor->trashed())
|
||||||
|
@can('create', ENTITY_EXPENSE)
|
||||||
|
{!! Button::primary(trans("texts.new_expense"))
|
||||||
|
->asLinkTo(URL::to("/expenses/create/{$vendor->public_id}"))
|
||||||
|
->appendIcon(Icon::create('plus-sign')) !!}
|
||||||
|
@endcan
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($vendor->trashed())
|
||||||
|
@can('edit', $vendor)
|
||||||
|
{!! Button::primary(trans('texts.restore_vendor'))
|
||||||
|
->appendIcon(Icon::create('cloud-download'))
|
||||||
|
->withAttributes(['onclick' => 'onRestoreClick()']) !!}
|
||||||
|
@endcan
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
{!! Button::primary(trans("texts.new_expense"))
|
|
||||||
->asLinkTo(URL::to("/expenses/create/{$vendor->public_id}"))
|
|
||||||
->appendIcon(Icon::create('plus-sign')) !!}
|
|
||||||
@endif
|
|
||||||
{!! Former::close() !!}
|
{!! Former::close() !!}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user