1
0
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:
Hillel Coren 2017-11-30 13:57:39 +02:00
parent c4e74f35d1
commit 31d7481903
6 changed files with 16 additions and 15 deletions

View File

@ -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];
}

View File

@ -327,6 +327,7 @@ class EntityModel extends Eloquent
'settings' => 'cog',
'self-update' => 'download',
'reports' => 'th-list',
'projects' => 'briefcase',
];
return array_get($icons, $entityType);

View File

@ -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',
);

View File

@ -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

View File

@ -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',

View File

@ -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))