mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 00:44:31 -04:00
Improved history feature
This commit is contained in:
parent
6ae83e8469
commit
933b94e8b5
@ -127,6 +127,19 @@ class Utils
|
||||
return $response;
|
||||
}
|
||||
|
||||
public static function getLastURL()
|
||||
{
|
||||
if (!count(Session::get(RECENTLY_VIEWED))) {
|
||||
return '#';
|
||||
}
|
||||
|
||||
$history = Session::get(RECENTLY_VIEWED);
|
||||
$last = $history[0];
|
||||
$penultimate = count($history) > 1 ? $history[1] : $last;
|
||||
|
||||
return Request::url() == $last->url ? $penultimate->url : $last->url;
|
||||
}
|
||||
|
||||
public static function getProLabel($feature)
|
||||
{
|
||||
if (Auth::check()
|
||||
@ -394,12 +407,8 @@ class Utils
|
||||
continue;
|
||||
}
|
||||
|
||||
// temporary fix to check for new property in session
|
||||
if (!property_exists($item, 'accountId')) {
|
||||
continue;
|
||||
}
|
||||
array_push($data, $item);
|
||||
|
||||
array_unshift($data, $item);
|
||||
if (isset($counts[$item->accountId])) {
|
||||
$counts[$item->accountId]++;
|
||||
} else {
|
||||
|
@ -336,7 +336,7 @@ class Account extends Eloquent
|
||||
|
||||
if (strstr($pattern, '{$userId}')) {
|
||||
$search[] = '{$userId}';
|
||||
$replace[] = str_pad($invoice->user->public_id, 2, '0', STR_PAD_LEFT);
|
||||
$replace[] = str_pad(($invoice->user->public_id + 1), 2, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
$matches = false;
|
||||
|
@ -33,7 +33,7 @@ class AppServiceProvider extends ServiceProvider {
|
||||
$types = $type.'s';
|
||||
$Type = ucfirst($type);
|
||||
$Types = ucfirst($types);
|
||||
$class = ( Request::is($types) || Request::is('*'.$type.'*')) && !Request::is('*advanced_settings*') ? ' active' : '';
|
||||
$class = ( Request::is($types) || Request::is('*'.$type.'*')) && !Request::is('*settings*') ? ' active' : '';
|
||||
|
||||
$str = '<li class="dropdown '.$class.'">
|
||||
<a href="'.URL::to($types).'" class="dropdown-toggle">'.trans("texts.$types").'</a>
|
||||
|
2
public/css/built.css
vendored
2
public/css/built.css
vendored
@ -3269,7 +3269,7 @@ div.dataTables_length label {
|
||||
|
||||
a .glyphicon,
|
||||
button .glyphicon {
|
||||
padding-left: 8px;
|
||||
padding-left: 12px;
|
||||
}
|
||||
|
||||
.pro-plan-modal {
|
||||
|
2
public/css/style.css
vendored
2
public/css/style.css
vendored
@ -918,7 +918,7 @@ div.dataTables_length label {
|
||||
|
||||
a .glyphicon,
|
||||
button .glyphicon {
|
||||
padding-left: 8px;
|
||||
padding-left: 12px;
|
||||
}
|
||||
|
||||
.pro-plan-modal {
|
||||
|
@ -31572,6 +31572,7 @@ function truncate(string, length){
|
||||
}
|
||||
};
|
||||
|
||||
// Show/hide the 'Select' option in the datalists
|
||||
function actionListHandler() {
|
||||
$('tbody tr').mouseover(function() {
|
||||
$(this).closest('tr').find('.tr-action').css('display', 'inline-block');
|
||||
|
@ -1694,6 +1694,7 @@ function truncate(string, length){
|
||||
}
|
||||
};
|
||||
|
||||
// Show/hide the 'Select' option in the datalists
|
||||
function actionListHandler() {
|
||||
$('tbody tr').mouseover(function() {
|
||||
$(this).closest('tr').find('.tr-action').css('display', 'inline-block');
|
||||
|
@ -304,6 +304,15 @@
|
||||
$('.primaryDropDown:not(.dropdown-toggle)').click(function() {
|
||||
window.location = '{{ URL::to('invoices/create/' . $client->public_id ) }}';
|
||||
});
|
||||
|
||||
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
||||
var target = $(e.target).attr("href") // activated tab
|
||||
localStorage.setItem('client_tab', target);
|
||||
});
|
||||
var tab = localStorage.getItem('client_tab');
|
||||
if (tab) {
|
||||
$('.nav-tabs a[href="' + tab + '"]').tab('show');
|
||||
}
|
||||
});
|
||||
|
||||
function onArchiveClick() {
|
||||
|
@ -462,7 +462,7 @@
|
||||
|
||||
<ul class="nav navbar-nav navbar-right navbar-history">
|
||||
<li class="dropdown">
|
||||
<a href="{{ count(Session::get(RECENTLY_VIEWED)) ? Session::get(RECENTLY_VIEWED)[0]->url : '#' }}" class="dropdown-toggle">
|
||||
<a href="{{ Utils::getLastURL() }}" class="dropdown-toggle">
|
||||
<span class="glyphicon glyphicon-time" title="{{ trans('texts.history') }}"/>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
Loading…
x
Reference in New Issue
Block a user