1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Bug fixes

This commit is contained in:
Hillel Coren 2015-10-25 13:08:11 +02:00
parent 6a2fc89962
commit 4a3beeeae7
15 changed files with 25 additions and 5 deletions

View File

@ -476,7 +476,11 @@ class AccountController extends BaseController
{
if (Auth::user()->account->isPro()) {
$rules = [];
$rules = [
'invoice_number_pattern' => 'has_counter',
'quote_number_pattern' => 'has_counter',
];
$user = Auth::user();
$iframeURL = preg_replace('/[^a-zA-Z0-9_\-\:\/\.]/', '', substr(strtolower(Input::get('iframe_url')), 0, MAX_IFRAME_URL_LENGTH));
$iframeURL = rtrim($iframeURL, "/");

View File

@ -144,6 +144,10 @@ class AppServiceProvider extends ServiceProvider {
Validator::replacer('less_than', function($message, $attribute, $rule, $parameters) {
return str_replace(':value', $parameters[0], $message);
});
Validator::extend('has_counter', function($attribute, $value, $parameters) {
return !$value || strstr($value, '{$counter}');
});
}
/**

View File

@ -77,6 +77,7 @@ return array(
"has_credit" => "The client does not have enough credit.",
"notmasked" => "The values are masked",
"less_than" => 'The :attribute must be less than :value',
"has_counter" => 'The value must contain {$counter}',
/*
|--------------------------------------------------------------------------

View File

@ -75,7 +75,8 @@ return array(
"has_credit" => "Der Kunde hat nicht genug Guthaben.",
"notmasked" => "The values are masked",
"less_than" => 'The :attribute must be less than :value',
"has_counter" => 'The value must contain {$counter}',
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines

View File

@ -73,6 +73,7 @@ return array(
"has_credit" => "The client does not have enough credit.",
"notmasked" => "The values are masked",
"less_than" => 'The :attribute must be less than :value',
"has_counter" => 'The value must contain {$counter}',
/*
|--------------------------------------------------------------------------

View File

@ -74,7 +74,8 @@ return array(
"has_credit" => "el cliente no tiene crédito suficiente.",
"notmasked" => "The values are masked",
"less_than" => 'The :attribute must be less than :value',
"has_counter" => 'The value must contain {$counter}',
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines

View File

@ -74,6 +74,7 @@ return array(
"has_credit" => "el cliente no tiene crédito suficiente.",
"notmasked" => "The values are masked",
"less_than" => 'The :attribute must be less than :value',
"has_counter" => 'The value must contain {$counter}',
/*
|--------------------------------------------------------------------------

View File

@ -75,6 +75,7 @@ return array(
"has_credit" => "The client does not have enough credit.",
"notmasked" => "The values are masked",
"less_than" => 'The :attribute must be less than :value',
"has_counter" => 'The value must contain {$counter}',
/*
|--------------------------------------------------------------------------

View File

@ -75,6 +75,7 @@ return array(
"has_credit" => "Le client n'a pas un crédit suffisant.",
"notmasked" => "Les valeurs sont masquées",
"less_than" => 'The :attribute must be less than :value',
"has_counter" => 'The value must contain {$counter}',
/*
|--------------------------------------------------------------------------

View File

@ -74,6 +74,7 @@ return array(
"has_credit" => "The client does not have enough credit.",
"notmasked" => "The values are masked",
"less_than" => 'The :attribute must be less than :value',
"has_counter" => 'The value must contain {$counter}',
/*
|--------------------------------------------------------------------------

View File

@ -73,6 +73,7 @@ return array(
"has_credit" => "Klienten har ikke høy nok kreditt.",
"notmasked" => "Verdiene er skjult",
"less_than" => 'The :attribute must be less than :value',
"has_counter" => 'The value must contain {$counter}',
/*
|--------------------------------------------------------------------------

View File

@ -75,6 +75,7 @@ return array(
"has_credit" => "De klant heeft niet voldoende krediet.",
"notmasked" => "De waarden zijn verborgen",
"less_than" => 'Het :attribute moet minder zijn dan :value',
"has_counter" => 'The value must contain {$counter}',
/*
|--------------------------------------------------------------------------

View File

@ -73,6 +73,7 @@ return array(
"has_credit" => "O cliente não possui crédito suficiente.",
"notmasked" => "The values are masked",
"less_than" => 'The :attribute must be less than :value',
"has_counter" => 'The value must contain {$counter}',
/*
|--------------------------------------------------------------------------

View File

@ -77,6 +77,7 @@ return [
"has_credit" => "The client does not have enough credit.",
"notmasked" => "The values are masked",
"less_than" => 'The :attribute must be less than :value',
"has_counter" => 'The value must contain {$counter}',
/*
|--------------------------------------------------------------------------

View File

@ -241,9 +241,9 @@
<ul>
@foreach (\App\Models\Invoice::$patternFields as $field)
@if ($field == 'date:')
<li>$date:format ({!! link_to(PHP_DATE_FORMATS, trans('texts.see_options'), ['target' => '_blank']) !!})</li>
<li>{$date:format} - {!! link_to(PHP_DATE_FORMATS, trans('texts.see_options'), ['target' => '_blank']) !!}</li>
@else
<li>${{ $field }}</li>
<li>{${{ $field }}}</li>
@endif
@endforeach
</ul>