mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 19:24:42 -04:00
Bug fixes
This commit is contained in:
parent
4a7432cc41
commit
b11ab39a9f
@ -701,6 +701,8 @@ class AccountController extends \BaseController {
|
||||
Session::set(REQUESTED_PRO_PLAN, true);
|
||||
}
|
||||
|
||||
Session::set(SESSION_COUNTER, -1);
|
||||
|
||||
return "{$user->first_name} {$user->last_name}";
|
||||
}
|
||||
}
|
@ -13,6 +13,9 @@
|
||||
|
||||
App::before(function($request)
|
||||
{
|
||||
$count = Session::get(SESSION_COUNTER, 0);
|
||||
Session::put(SESSION_COUNTER, ++$count);
|
||||
|
||||
if (App::environment() == ENV_PRODUCTION)
|
||||
{
|
||||
if (!Request::secure())
|
||||
|
@ -71,6 +71,10 @@ return array(
|
||||
"unique" => ":attribute ist schon vergeben.",
|
||||
"url" => "Das Format von :attribute ist ungültig.",
|
||||
|
||||
"positive" => "The :attribute must be greater than zero.",
|
||||
"has_credit" => "The client does not have enough credit.",
|
||||
"notmasked" => "The values are masked",
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Validation Language Lines
|
||||
|
@ -323,7 +323,7 @@ return array(
|
||||
'field_label' => 'Field Label',
|
||||
'field_value' => 'Field Value',
|
||||
'edit' => 'Edit',
|
||||
|
||||
'set_name' => 'Set your company name',
|
||||
|
||||
|
||||
|
||||
|
@ -71,7 +71,7 @@ return array(
|
||||
|
||||
"positive" => "The :attribute must be greater than zero.",
|
||||
"has_credit" => "The client does not have enough credit.",
|
||||
|
||||
"notmasked" => "The values are masked",
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -73,6 +73,10 @@ return array(
|
||||
"positive" => ":attribute debe ser mayor que cero.",
|
||||
"has_credit" => "el cliente no tiene crédito suficiente.",
|
||||
|
||||
"positive" => "The :attribute must be greater than zero.",
|
||||
"has_credit" => "The client does not have enough credit.",
|
||||
"notmasked" => "The values are masked",
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -71,6 +71,10 @@ return array(
|
||||
"unique" => "La valeur du champ :attribute est déjà utilisée.",
|
||||
"url" => "Le format de l'URL de :attribute n'est pas valide.",
|
||||
|
||||
"positive" => "The :attribute must be greater than zero.",
|
||||
"has_credit" => "The client does not have enough credit.",
|
||||
"notmasked" => "The values are masked",
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Validation Language Lines
|
||||
|
@ -70,6 +70,10 @@ return array(
|
||||
"unique" => ":attribute è stato già utilizzato.",
|
||||
"url" => ":attribute deve essere un URL.",
|
||||
|
||||
"positive" => "The :attribute must be greater than zero.",
|
||||
"has_credit" => "The client does not have enough credit.",
|
||||
"notmasked" => "The values are masked",
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Validation Language Lines
|
||||
|
@ -74,6 +74,10 @@ return array(
|
||||
"positive" => ":attribute moet groter zijn dan nul.",
|
||||
"has_credit" => "De klant heeft niet voldoende krediet.",
|
||||
|
||||
"positive" => "The :attribute must be greater than zero.",
|
||||
"has_credit" => "The client does not have enough credit.",
|
||||
"notmasked" => "The values are masked",
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Validation Language Lines
|
||||
|
@ -72,6 +72,10 @@ return array(
|
||||
"positive" => ":attribute deve ser maior que zero.",
|
||||
"has_credit" => "O cliente não possui crédito suficiente.",
|
||||
|
||||
"positive" => "The :attribute must be greater than zero.",
|
||||
"has_credit" => "The client does not have enough credit.",
|
||||
"notmasked" => "The values are masked",
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -114,12 +114,32 @@ class User extends ConfideUser implements UserInterface, RemindableInterface
|
||||
return !$this->theme_id || in_array($this->theme_id, [2, 3, 5, 6, 7, 8, 10, 11, 12]);
|
||||
}
|
||||
|
||||
public function showSignUpPopOver()
|
||||
public function getRequestsCount()
|
||||
{
|
||||
$count = Session::get(SESSION_COUNTER, 0);
|
||||
Session::put(SESSION_COUNTER, ++$count);
|
||||
return Session::get(SESSION_COUNTER, 0);
|
||||
}
|
||||
|
||||
return $count == 1 || $count % 7 == 0;
|
||||
public function getPopOverText()
|
||||
{
|
||||
if (!Auth::check())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$count = self::getRequestsCount();
|
||||
if ($count == 1 || $count % 5 == 0)
|
||||
{
|
||||
if (!Utils::isRegistered())
|
||||
{
|
||||
return trans('texts.sign_up_to_save');
|
||||
}
|
||||
else if (!Auth::user()->account->name)
|
||||
{
|
||||
return trans('texts.set_name');
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function afterSave($success=true, $forced = false)
|
||||
|
@ -108,32 +108,29 @@
|
||||
<div class="navbar-form navbar-right">
|
||||
@if (Auth::check() && !Auth::user()->registered)
|
||||
{{ Button::sm_success_primary(trans('texts.sign_up'), array('id' => 'signUpButton', 'data-toggle'=>'modal', 'data-target'=>'#signUpModal')) }}
|
||||
@endif
|
||||
|
||||
@if (Auth::check() && Auth::user()->showSignUpPopOver())
|
||||
<button id="signUpPopOver" type="button" class="btn btn-default" data-toggle="popover" data-placement="bottom" data-content="{{ trans('texts.sign_up_to_save') }}" data-html="true" style="display:none">
|
||||
@if (Auth::user()->getPopOverText() && !Utils::isRegistered())
|
||||
<button id="ninjaPopOver" type="button" class="btn btn-default" data-toggle="popover" data-placement="bottom" data-content="{{ Auth::user()->getPopOverText() }}" data-html="true" style="display:none">
|
||||
{{ trans('texts.sign_up') }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->getPopOverText())
|
||||
<script>
|
||||
$(function() {
|
||||
$('#signUpPopOver').show().popover('show').hide();
|
||||
$('#ninjaPopOver').show().popover('show').hide();
|
||||
$('body').click(function() {
|
||||
$('#signUpPopOver').popover('hide');
|
||||
$('#ninjaPopOver').popover('hide');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@endif
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
|
||||
<span id="myAccountButton">
|
||||
@if (Auth::user()->registered)
|
||||
{{ Auth::user()->getFullName() }}
|
||||
@else
|
||||
{{ trans('texts.guest') }}
|
||||
@endif
|
||||
{{ Auth::user()->getDisplayName() }}
|
||||
</span>
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
@ -148,6 +145,16 @@
|
||||
<li>{{ link_to('#', trans('texts.logout'), array('onclick'=>'logout()')) }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@if (Auth::user()->getPopOverText() && Utils::isRegistered())
|
||||
<button id="ninjaPopOver" type="button" class="btn btn-default" data-toggle="popover" data-placement="bottom" data-content="{{ Auth::user()->getPopOverText() }}" data-html="true" style="display:none">
|
||||
{{ Auth::user()->getDisplayName() }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user