mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Add projects to top level navigation
This commit is contained in:
parent
c4e74f35d1
commit
31d7481903
@ -216,7 +216,6 @@ class Account extends Eloquent
|
||||
ENTITY_QUOTE => 4,
|
||||
ENTITY_TASK => 8,
|
||||
ENTITY_EXPENSE => 16,
|
||||
ENTITY_VENDOR => 32,
|
||||
];
|
||||
|
||||
public static $dashboardSections = [
|
||||
@ -1617,10 +1616,17 @@ class Account extends Eloquent
|
||||
ENTITY_TASK,
|
||||
ENTITY_EXPENSE,
|
||||
ENTITY_VENDOR,
|
||||
ENTITY_PROJECT,
|
||||
])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($entityType == ENTITY_VENDOR) {
|
||||
$entityType = ENTITY_EXPENSE;
|
||||
} elseif ($entityType == ENTITY_PROJECT) {
|
||||
$entityType = ENTITY_TASK;
|
||||
}
|
||||
|
||||
// note: single & checks bitmask match
|
||||
return $this->enabled_modules & static::$modules[$entityType];
|
||||
}
|
||||
|
@ -327,6 +327,7 @@ class EntityModel extends Eloquent
|
||||
'settings' => 'cog',
|
||||
'self-update' => 'download',
|
||||
'reports' => 'th-list',
|
||||
'projects' => 'briefcase',
|
||||
];
|
||||
|
||||
return array_get($icons, $entityType);
|
||||
|
@ -2588,6 +2588,11 @@ $LANG = array(
|
||||
'archived_subscription' => 'Successfully archived subscription',
|
||||
'project_error_multiple_clients' => 'The projects can\'t belong to different clients',
|
||||
'invoice_project' => 'Invoice Project',
|
||||
'module_recurring_invoice' => 'Recurring Invoices',
|
||||
'module_credit' => 'Credits',
|
||||
'module_quote' => 'Quotes',
|
||||
'module_task' => 'Tasks & Projects',
|
||||
'module_expense' => 'Expenses & Vendors',
|
||||
|
||||
);
|
||||
|
||||
|
@ -185,7 +185,7 @@
|
||||
@foreach (\App\Models\Account::$modules as $entityType => $value)
|
||||
<div class="checkbox">
|
||||
<label for="modules_{{ $value}}">
|
||||
<input name="modules[]" id="modules_{{ $value}}" type="checkbox" {{ Auth::user()->account->isModuleEnabled($entityType) ? 'checked="checked"' : '' }} value="{{ $value }}">{{ trans("texts.{$entityType}s") }}
|
||||
<input name="modules[]" id="modules_{{ $value}}" type="checkbox" {{ Auth::user()->account->isModuleEnabled($entityType) ? 'checked="checked"' : '' }} value="{{ $value }}">{{ trans("texts.module_{$entityType}") }}
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
|
@ -347,6 +347,7 @@
|
||||
'payments' => false,
|
||||
'credits' => false,
|
||||
'quotes' => false,
|
||||
'projects' => false,
|
||||
'tasks' => false,
|
||||
'expenses' => false,
|
||||
'vendors' => false,
|
||||
@ -373,6 +374,7 @@
|
||||
'payments',
|
||||
'credits',
|
||||
'quotes',
|
||||
'projects',
|
||||
'tasks',
|
||||
'expenses',
|
||||
'vendors',
|
||||
|
@ -85,19 +85,6 @@
|
||||
</script>
|
||||
@elseif ($entityType == ENTITY_TASK)
|
||||
{!! Button::normal(trans('texts.time_tracker'))->asLinkTo('javascript:openTimeTracker()')->appendIcon(Icon::create('time')) !!}
|
||||
{!! DropdownButton::normal(trans('texts.projects'))
|
||||
->withAttributes(['class'=>'projectsDropdown'])
|
||||
->withContents([
|
||||
['label' => trans('texts.new_project'), 'url' => url('/projects/create')],
|
||||
]
|
||||
)->split() !!}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('.projectsDropdown:not(.dropdown-toggle)').click(function(event) {
|
||||
openUrlOnClick('{{ url('/projects') }}', event);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->can('create', $entityType) && empty($vendorId))
|
||||
|
Loading…
Reference in New Issue
Block a user