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

Bug fixes

This commit is contained in:
Hillel Coren 2015-10-18 10:30:28 +03:00
parent c24b2f352d
commit 9283362d28
23 changed files with 8060 additions and 99 deletions

View File

@ -130,6 +130,16 @@ module.exports = function(grunt) {
options: {
process: false
}
},
js_pdf: {
src: [
'public/js/pdf_viewer.js',
'public/js/compatibility.js',
'public/js/pdfmake.min.js',
'public/js/vfs_fonts.js',
],
dest: 'public/js/pdf.built.js',
nonull: true
}
}
});

View File

@ -730,7 +730,7 @@ class AccountController extends BaseController
{
$rules = array(
'name' => 'required',
'logo' => 'sometimes|max:1024|mimes:jpeg,gif,png',
'logo' => 'sometimes|max:512|mimes:jpeg,gif,png',
);
$validator = Validator::make(Input::all(), $rules);
@ -930,7 +930,10 @@ class AccountController extends BaseController
$this->userMailer->sendTo(CONTACT_EMAIL, $email, $name, 'Invoice Ninja Feedback [Canceled Account]', 'contact', $data);
}
$user = Auth::user();
$account = Auth::user()->account;
\Log::info("Canceled Account: {$account->name} - {$user->email}");
$this->accountRepo->unlinkAccount($account);
$account->forceDelete();

View File

@ -92,7 +92,7 @@ class AuthController extends Controller {
// we're linking a new account
if ($userId && Auth::user()->id != $userId) {
$users = $this->accountRepo->associateAccounts($userId, Auth::user()->id);
Session::flash('message', trans('texts.associated_accounts'));
Session::flash('warning', trans('texts.associated_accounts'));
// check if other accounts are linked
} else {
$users = $this->accountRepo->loadAccounts(Auth::user()->id);

View File

@ -21,10 +21,10 @@
//Log::error('test');
// Application setup
Route::get('setup', 'AppController@showSetup');
Route::post('setup', 'AppController@doSetup');
Route::get('install', 'AppController@install');
Route::get('update', 'AppController@update');
Route::get('/setup', 'AppController@showSetup');
Route::post('/setup', 'AppController@doSetup');
Route::get('/install', 'AppController@install');
Route::get('/update', 'AppController@update');
/*
// Codeception code coverage
@ -35,11 +35,11 @@ Route::get('/c3.php', function () {
// Public pages
Route::get('/', 'HomeController@showIndex');
Route::get('terms', 'HomeController@showTerms');
Route::get('log_error', 'HomeController@logError');
Route::get('invoice_now', 'HomeController@invoiceNow');
Route::get('keep_alive', 'HomeController@keepAlive');
Route::post('get_started', 'AccountController@getStarted');
Route::get('/terms', 'HomeController@showTerms');
Route::get('/log_error', 'HomeController@logError');
Route::get('/invoice_now', 'HomeController@invoiceNow');
Route::get('/keep_alive', 'HomeController@keepAlive');
Route::post('/get_started', 'AccountController@getStarted');
// Client visible pages
Route::get('view/{invitation_key}', 'InvoiceController@view');
@ -64,11 +64,11 @@ Route::get('claim_license', 'PaymentController@claim_license');
Route::post('signup/validate', 'AccountController@checkEmail');
Route::post('signup/submit', 'AccountController@submitSignup');
Route::get('auth/{provider}', 'Auth\AuthController@authLogin');
Route::get('auth_unlink', 'Auth\AuthController@authUnlink');
Route::get('/auth/{provider}', 'Auth\AuthController@authLogin');
Route::get('/auth_unlink', 'Auth\AuthController@authUnlink');
Route::post('hook/email_bounced', 'AppController@emailBounced');
Route::post('hook/email_opened', 'AppController@emailOpened');
Route::post('/hook/email_bounced', 'AppController@emailBounced');
Route::post('/hook/email_opened', 'AppController@emailOpened');
// Laravel auth routes
@ -309,14 +309,17 @@ if (!defined('CONTACT_EMAIL')) {
define('RECENTLY_VIEWED_LIMIT', 8);
define('LOGGED_ERROR_LIMIT', 100);
define('RANDOM_KEY_LENGTH', 32);
define('MAX_NUM_CLIENTS', 500);
define('MAX_NUM_CLIENTS_PRO', 20000);
define('MAX_NUM_USERS', 20);
define('MAX_SUBDOMAIN_LENGTH', 30);
define('MAX_IFRAME_URL_LENGTH', 250);
define('DEFAULT_FONT_SIZE', 9);
define('DEFAULT_SEND_RECURRING_HOUR', 8);
define('MAX_NUM_CLIENTS', 100);
define('MAX_NUM_CLIENTS_PRO', 20000);
define('MAX_NUM_CLIENTS_LEGACY', 500);
define('LEGACY_CUTOFF', 57800);
define('INVOICE_STATUS_DRAFT', 1);
define('INVOICE_STATUS_SENT', 2);
define('INVOICE_STATUS_VIEWED', 3);

View File

@ -142,7 +142,15 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
public function getMaxNumClients()
{
return $this->isPro() ? MAX_NUM_CLIENTS_PRO : MAX_NUM_CLIENTS;
if ($this->isPro()) {
return MAX_NUM_CLIENTS_PRO;
}
if ($this->id < LEGACY_CUTOFF) {
return MAX_NUM_CLIENTS_LEGACY;
}
return MAX_NUM_CLIENTS;
}
public function getRememberToken()

View File

@ -14,10 +14,10 @@ class AddInvoiceNumberSettings extends Migration {
{
Schema::table('accounts', function($table)
{
$table->text('invoice_number_prefix')->nullable();
$table->string('invoice_number_prefix')->nullable();
$table->integer('invoice_number_counter')->default(1)->nullable();
$table->text('quote_number_prefix')->nullable();
$table->string('quote_number_prefix')->nullable();
$table->integer('quote_number_counter')->default(1)->nullable();
$table->boolean('share_counter')->default(true);

View File

@ -839,7 +839,7 @@ html {
display: inline-block;
width: 9px;
height: 15px;
background: url({{ asset('images/social/facebook.svg') }}) no-repeat;
background: url('../images/social/facebook.svg') no-repeat;
margin: 0 6px 0 0;
position: relative;
top: 3px;
@ -850,7 +850,7 @@ html {
display: inline-block;
width: 19px;
height: 16px;
background: url({{ asset('images/social/twitter.svg') }}) no-repeat;
background: url('../images/social/twitter.svg') no-repeat;
margin: 0 6px 0 0;
position: relative;
top: 3px;
@ -861,7 +861,7 @@ html {
display: inline-block;
width: 19px;
height: 16px;
background: url({{ asset('images/social/github.png') }}) no-repeat;
background: url('../images/social/github.png') no-repeat;
margin: 0 6px 0 0;
position: relative;
top: 3px;

View File

@ -57,7 +57,7 @@ html {
display: inline-block;
width: 9px;
height: 15px;
background: url({{ asset('images/social/facebook.svg') }}) no-repeat;
background: url('../images/social/facebook.svg') no-repeat;
margin: 0 6px 0 0;
position: relative;
top: 3px;
@ -68,7 +68,7 @@ html {
display: inline-block;
width: 19px;
height: 16px;
background: url({{ asset('images/social/twitter.svg') }}) no-repeat;
background: url('../images/social/twitter.svg') no-repeat;
margin: 0 6px 0 0;
position: relative;
top: 3px;
@ -79,7 +79,7 @@ html {
display: inline-block;
width: 19px;
height: 16px;
background: url({{ asset('images/social/github.png') }}) no-repeat;
background: url('../images/social/github.png') no-repeat;
margin: 0 6px 0 0;
position: relative;
top: 3px;

7928
public/js/pdf.built.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -827,6 +827,9 @@ return array(
'general_settings' => 'General Settings',
'customize' => 'Customize',
'oneclick_login_help' => 'Connect an account to login without a password',
'referral_code_help' => 'Earn money by sharing our app online',
);

View File

@ -3,14 +3,11 @@
@section('head')
@parent
<script src="{{ asset('js/pdf_viewer.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/compatibility.js') }}" type="text/javascript"></script>
<link href="{{ asset('css/jsoneditor.min.css') }}" rel="stylesheet" type="text/css">
<script src="{{ asset('js/jsoneditor.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/pdfmake.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/vfs_fonts.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/pdf.built.js') }}" type="text/javascript"></script>
<style type="text/css">

View File

@ -3,10 +3,7 @@
@section('head')
@parent
<script src="{{ asset('js/pdf_viewer.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/compatibility.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/pdfmake.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/vfs_fonts.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/pdf.built.js') }}" type="text/javascript"></script>
@stop

View File

@ -13,10 +13,15 @@
{{ Former::populateField('last_name', $user->last_name) }}
{{ Former::populateField('email', $user->email) }}
{{ Former::populateField('phone', $user->phone) }}
@if (Utils::isNinjaDev())
{{ Former::populateField('dark_mode', intval($user->dark_mode)) }}
@endif
@if (Input::has('affiliate'))
{{ Former::populateField('referral_code', true) }}
@endif
@include('accounts.nav', ['selected' => ACCOUNT_USER_DETAILS])
<div class="row">
@ -32,20 +37,25 @@
{!! Former::text('email') !!}
{!! Former::text('phone') !!}
<br/>
@if (Utils::isNinja())
{!! Former::plaintext('oneclick_login')->value(
$user->oauth_provider_id ?
$oauthProviderName . ' - ' . link_to('#', trans('texts.disable'), ['onclick' => 'disableSocialLogin()']) :
DropdownButton::primary(trans('texts.enable'))->withContents($oauthLoginUrls)->small()
) !!}
)->help('oneclick_login_help')
!!}
@endif
@if (Utils::isNinja() && $user->confirmed)
@if (Utils::isNinja())
@if ($user->referral_code)
{!! Former::plaintext('referral_code')
->help(trans('texts.referral_code_help'))
->value($user->referral_code . ' <a href="'.REFERRAL_PROGRAM_URL.'" target="_blank" title="'.trans('texts.learn_more').'">' . Icon::create('question-sign') . '</a>') !!}
@else
@elseif (Input::has('affiliate'))
{!! Former::checkbox('referral_code')
->help(trans('texts.referral_code_help'))
->text(trans('texts.enable') . ' <a href="'.REFERRAL_PROGRAM_URL.'" target="_blank" title="'.trans('texts.learn_more').'">' . Icon::create('question-sign') . '</a>') !!}
@endif
@endif
@ -54,19 +64,18 @@
{!! Former::checkbox('dark_mode')->text(trans('texts.dark_mode_help')) !!}
@endif
@if (Utils::isNinja())
<br/>
@if (Auth::user()->confirmed)
{!! Former::actions( Button::primary(trans('texts.change_password'))->small()->withAttributes(['onclick'=>'showChangePassword()'])) !!}
@elseif (Auth::user()->registered)
{!! Former::actions( Button::primary(trans('texts.resend_confirmation'))->asLinkTo(URL::to('/resend_confirmation'))->small() ) !!}
@endif
@endif
</div>
</div>
</div>
<center>
@if (Utils::isNinja())
@if (Auth::user()->confirmed)
{!! Button::primary(trans('texts.change_password'))->large()->withAttributes(['onclick'=>'showChangePassword()']) !!}
@elseif (Auth::user()->registered)
{!! Button::primary(trans('texts.resend_confirmation'))->asLinkTo(URL::to('/resend_confirmation'))->large() !!}
@endif
@endif
{!! Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')) !!}
</center>
</div>

View File

@ -91,7 +91,16 @@
<p>{!! Button::primary(trans('texts.new_company'))->asLinkTo(URL::to('/invoice_now?new_company=true&sign_up=true'))->large()->submit()->block() !!}</p><br/>
@elseif (Utils::isNinja())
<center><p>- {{ trans('texts.or') }} -</p></center>
@include('partials.social_login_buttons', ['type' => 'login'])<br/>
<div class="row">
@foreach (App\Services\AuthService::$providers as $provider)
<div class="col-md-6">
<a href="{{ URL::to('auth/' . $provider) }}" class="btn btn-primary btn-block social-login-button" id="{{ strtolower($provider) }}LoginButton">
<i class="fa fa-{{ strtolower($provider) }}"></i> &nbsp;
{{ $provider }}
</a><br/>
</div>
@endforeach
</div>
@endif
<p class="link">
@ -164,12 +173,12 @@
$('#email').focus();
}
// If they're using OAuth we'll show just their provider button
/*
var authProvider = localStorage.getItem('auth_provider');
if (authProvider) {
//$('#loginButton').removeClass('btn-success').addClass('btn-primary');
$('#' + authProvider + 'LoginButton').removeClass('btn-primary').addClass('btn-success');
}
*/
})
</script>

View File

@ -256,5 +256,13 @@
</div>
</div>
<script type="text/javascript">
$(function() {
$('.normalDropDown:not(.dropdown-toggle)').click(function() {
window.location = '{{ URL::to('invoices/create') }}';
});
});
</script>
@stop

View File

@ -247,6 +247,10 @@
$('.signup-form input[type=text], .signup-form button').prop('disabled', !enabled);
}
function setSocialLoginProvider(provider) {
localStorage.setItem('auth_provider', provider);
}
$(function() {
window.setTimeout(function() {
$(".alert-hide").fadeOut();
@ -548,7 +552,13 @@
@if (Utils::isNinja())
<div class="col-md-4 col-md-offset-1">
<h4>{{ trans('texts.sign_up_using') }}</h4><br/>
@include('partials.social_login_buttons', ['type' => 'sign_up'])
@foreach (App\Services\AuthService::$providers as $provider)
<a href="{{ URL::to('auth/' . $provider) }}" class="btn btn-primary btn-block"
onclick="setSocialLoginProvider('{{ strtolower($provider) }}')" id="{{ strtolower($provider) }}LoginButton">
<i class="fa fa-{{ strtolower($provider) }}"></i> &nbsp;
{{ $provider }}
</a>
@endforeach
</div>
<div class="col-md-1">
<div style="border-right:thin solid #CCCCCC;height:110px;width:8px;margin-bottom:10px;"></div>

View File

@ -94,6 +94,8 @@
<div class="col-md-3 logo">
@if ($account->hasLogo())
{!! HTML::image($account->getLogoPath()) !!}
@else
<h2>{{ $account->name}}</h2>
@endif
</div>
<div class="col-md-3 col-md-offset-3 address-details">

View File

@ -3,10 +3,7 @@
@section('head')
@parent
<script src="{{ asset('js/pdf_viewer.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/compatibility.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/pdfmake.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/vfs_fonts.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/pdf.built.js') }}" type="text/javascript"></script>
@stop
@ -109,23 +106,22 @@
@endif
@if ($entityType == ENTITY_INVOICE)
@if ($invoice && $invoice->recurring_invoice)
<div class="pull-right" style="padding-top: 6px">
<div class="form-group" style="margin-bottom: 8px">
<div class="col-lg-8 col-sm-8 col-sm-offset-4" style="padding-top: 10px">
@if ($invoice && $invoice->recurring_invoice)
{!! trans('texts.created_by_invoice', ['invoice' => link_to('/invoices/'.$invoice->recurring_invoice->public_id, trans('texts.recurring_invoice'))]) !!}
</div>
@elseif ($invoice)
<div class="pull-right" style="padding-top: 6px">
@if (isset($lastSent) && $lastSent)
{!! trans('texts.last_sent_on', ['date' => link_to('/invoices/'.$lastSent->public_id, $invoice->last_sent_date, ['id' => 'lastSent'])]) !!} &nbsp;
@elseif ($invoice)
@if (isset($lastSent) && $lastSent)
{!! trans('texts.last_sent_on', ['date' => link_to('/invoices/'.$lastSent->public_id, $invoice->last_sent_date, ['id' => 'lastSent'])]) !!} <br/>
@endif
@if ($invoice->is_recurring && $invoice->getNextSendDate())
{!! trans('texts.next_send_on', ['date' => '<span data-bind="tooltip: {title: \''.$invoice->getPrettySchedule().'\', html: true}">'.$account->formatDate($invoice->getNextSendDate()).
'<span class="glyphicon glyphicon-info-sign" style="padding-left:10px;color:#B1B5BA"></span></span>']) !!}
@endif
@endif
@if ($invoice->is_recurring && $invoice->getNextSendDate())
{!! trans('texts.next_send_on', ['date' => '<span data-bind="tooltip: {title: \''.$invoice->getPrettySchedule().'\', html: true}">'.$account->formatDate($invoice->getNextSendDate()).
'<span class="glyphicon glyphicon-info-sign" style="padding-left:10px;color:#B1B5BA"></span></span>']) !!}
@endif
</div>
@endif
@endif
@endif
</div>
</div>
</div>
<div class="col-md-4" id="col_2">
@ -1923,7 +1919,7 @@
@endif
@endif
model.invoice().tax(model.getTaxRate(model.invoice().tax_name(), model.invoice().tax_rate()));
model.invoice().tax(model.getTaxRate(model.invoice().tax_name(), model.invoice().tax_rate()));
for (var i=0; i<model.invoice().invoice_items().length; i++) {
var item = model.invoice().invoice_items()[i];
item.tax(model.getTaxRate(item.tax_name(), item.tax_rate()));
@ -1937,7 +1933,7 @@
if (!model.invoice().custom_value1()) model.invoice().custom_value1('');
if (!model.invoice().custom_value2()) model.invoice().custom_value2('');
ko.applyBindings(model);
ko.applyBindings(model);
onItemChange();
</script>

View File

@ -3,10 +3,7 @@
@section('head')
@parent
<script src="{{ asset('js/pdf_viewer.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/compatibility.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/pdfmake.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/vfs_fonts.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/pdf.built.js') }}" type="text/javascript"></script>
<script>

View File

@ -5,11 +5,8 @@
@include('script')
<script src="{{ asset('js/pdf_viewer.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/compatibility.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/pdfmake.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/vfs_fonts.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/pdf.built.js') }}" type="text/javascript"></script>
<style type="text/css">
body {
background-color: #f8f8f8;

View File

@ -11,7 +11,7 @@
<meta property="og:site_name" content="Invoice Ninja" />
<meta property="og:url" content="{{ SITE_URL }}" />
<meta property="og:title" content="Invoice Ninja" />
<meta property="og:image" content="{{ SITE_URL }}/images/social.jpg" />
<meta property="og:image" content="{{ SITE_URL }}/images/round_logo.png" />
<meta property="og:description" content="Simple, Intuitive Invoicing." />
<meta name="viewport" content="width=device-width, initial-scale=1.0">

View File

@ -1,16 +0,0 @@
@foreach (App\Services\AuthService::$providers as $provider)
<button type="button" class="btn btn-primary btn-block" onclick="socialSignup('{{ strtolower($provider) }}')" id="{{ strtolower($provider) }}LoginButton">
<i class="fa fa-{{ strtolower($provider) }}"></i> &nbsp;
{{ $provider }}
</button>
@endforeach
<script type="text/javascript">
function socialSignup(provider) {
trackEvent('/account', '/social_{{ $type }}/' + provider);
localStorage.setItem('auth_provider', provider);
setTimeout(function() {
window.location = '{{ SITE_URL }}/auth/' + provider;
}, 150);
}
</script>

View File

@ -108,10 +108,10 @@
<footer id="footer" role="contentinfo">
<div class="top">
<div class="wrap">
@if (!isset($hideLogo) || !$hideLogo)
@if (!isset($hideLogo) || !$hideLogo)
<div id="footer-menu" class="menu-wrap">
<ul id="menu-footer-menu" class="menu">
<li id="menu-item-31" class="menu-item-31">
<li id="menu-item-31" class="menu-item-31">
{!! link_to('#', 'Facebook', ['target' => '_blank', 'onclick' => 'openUrl("https://www.facebook.com/invoiceninja", "/footer/social/facebook")']) !!}
</li>
<li id="menu-item-32" class="menu-item-32">