diff --git a/README.md b/README.md index 7bfd991b1d71..98dfbef05972 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Most online invoicing sites are expensive. They shouldn't be. The aim of this project is to provide a free, open-source alternative. Additionally, the hope is the codebase will serve as a sample site for Laravel as well as other JavaScript technologies. +For discussion of the code please use the [Google Group](https://groups.google.com/d/forum/invoiceninja). + For updates follow [@invoiceninja](https://twitter.com/invoiceninja) or join the [Facebook Group](https://www.facebook.com/invoiceninja) Site design by [kantorp-wegl.in](http://kantorp-wegl.in/) diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 8470e52f0ce1..ef1363aa7f79 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -461,7 +461,7 @@ class AccountController extends \BaseController { else { $account = Account::findOrFail(Auth::user()->account_id); - $account->account_gateways()->forceDelete(); + $account->account_gateways()->delete(); if ($gatewayId) { diff --git a/app/controllers/UserController.php b/app/controllers/UserController.php index 89d8c7504695..e49828d85bbe 100755 --- a/app/controllers/UserController.php +++ b/app/controllers/UserController.php @@ -20,6 +20,17 @@ class UserController extends BaseController { return Redirect::to(Input::get('path')); } + public function forcePDFJS() + { + $user = Auth::user(); + $user->force_pdfjs = true; + $user->save(); + + Session::flash('message', 'Successfully updated PDF settings'); + + return Redirect::to('/invoices/create'); + } + /** * Displays the form for account creation * @@ -110,18 +121,18 @@ class UserController extends BaseController { // with the second parameter as true. // logAttempt will check if the 'email' perhaps is the username. // Get the value from the config file instead of changing the controller - if ( Confide::logAttempt( $input, false ) ) + if ( Input::get( 'login_email' ) && Confide::logAttempt( $input, false ) ) { Event::fire('user.login'); // Redirect the user to the URL they were trying to access before // caught by the authentication filter IE Redirect::guest('user/login'). // Otherwise fallback to '/' // Fix pull #145 - return Redirect::intended('/clients'); // change it to '/admin', '/dashboard' or something + return Redirect::intended('/dashboard'); // change it to '/admin', '/dashboard' or something } else { - $user = new User; + //$user = new User; // Check if there was too many login attempts if( Confide::isThrottled( $input ) ) diff --git a/app/database/migrations/2014_03_23_051736_enable_forcing_jspdf.php b/app/database/migrations/2014_03_23_051736_enable_forcing_jspdf.php new file mode 100644 index 000000000000..30d7c664e451 --- /dev/null +++ b/app/database/migrations/2014_03_23_051736_enable_forcing_jspdf.php @@ -0,0 +1,34 @@ +boolean('force_pdfjs')->default(false); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function($table) + { + $table->dropColumn('force_pdfjs'); + }); + } + +} diff --git a/app/models/Activity.php b/app/models/Activity.php index 227590fb0927..5cb9b861b3ca 100755 --- a/app/models/Activity.php +++ b/app/models/Activity.php @@ -96,13 +96,13 @@ class Activity extends Eloquent public static function createInvoice($invoice) { - if ($invoice->is_recurring) + if (Auth::check()) { - $message = Utils::encodeActivity(null, 'created recurring', $invoice); + $message = Utils::encodeActivity(Auth::user(), 'created', $invoice); } else { - $message = Utils::encodeActivity(Auth::user(), 'created', $invoice); + $message = Utils::encodeActivity(null, 'created', $invoice); } $client = $invoice->client; diff --git a/app/routes.php b/app/routes.php index 332bd03adfdd..ff83260e0141 100755 --- a/app/routes.php +++ b/app/routes.php @@ -1,5 +1,7 @@ 'auth'), function() { Route::get('dashboard', 'DashboardController@index'); Route::get('view_archive/{entity_type}/{visible}', 'AccountController@setTrashVisible'); + Route::get('force_inline_pdf', 'UserController@forcePDFJS'); Route::get('account/getSearchData', array('as' => 'getSearchData', 'uses' => 'AccountController@getSearchData')); Route::get('company/{section?}', 'AccountController@showSection'); @@ -281,4 +283,11 @@ Event::listen('illuminate.query', function($query, $bindings, $time, $name) Log::info($query, $data); }); -*/ \ No newline at end of file +*/ + +/* +if (Auth::check() && Auth::user()->id === 1) +{ + Auth::loginUsingId(1); +} +*/ diff --git a/app/views/header.blade.php b/app/views/header.blade.php index ff130b570153..0303b6ad202f 100755 --- a/app/views/header.blade.php +++ b/app/views/header.blade.php @@ -388,10 +388,10 @@ $.ajax({ type: 'POST', url: '{{ URL::to('signup/submit') }}', - data: 'new_email=' + $('form.signUpForm #new_email').val() + - '&new_password=' + $('form.signUpForm #new_password').val() + - '&new_first_name=' + $('form.signUpForm #new_first_name').val() + - '&new_last_name=' + $('form.signUpForm #new_last_name').val(), + data: 'new_email=' + encodeURIComponent($('form.signUpForm #new_email').val()) + + '&new_password=' + encodeURIComponent($('form.signUpForm #new_password').val()) + + '&new_first_name=' + encodeURIComponent($('form.signUpForm #new_first_name').val()) + + '&new_last_name=' + encodeURIComponent($('form.signUpForm #new_last_name').val()), success: function(result) { if (result) { localStorage.setItem('guest_key', ''); diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index e4c35c5c4e88..56d7e70c18eb 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -623,7 +623,7 @@ return doc.output('datauristring'); } function refreshPDF() { - if (isFirefox || (isChrome && !isChromium)) { + if ({{ Auth::user()->force_pdfjs ? 'false' : 'true' }} && (isFirefox || (isChrome && !isChromium))) { var string = getPDFString(); $('#theFrame').attr('src', string).show(); } else {