From 3641019d0418366bc8788dc007486f1b6c3e8315 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 13 Apr 2015 15:49:40 +0300 Subject: [PATCH] Enabled re-sending confirmation email --- app/Http/Controllers/AccountController.php | 8 ++++++++ app/Http/routes.php | 3 ++- resources/lang/en/texts.php | 3 +++ resources/views/accounts/details.blade.php | 2 ++ resources/views/accounts/notifications.blade.php | 6 ++++-- resources/views/header.blade.php | 2 +- resources/views/invoices/edit.blade.php | 2 +- 7 files changed, 21 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 24025cc0f835..7beab2c92cb9 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -739,4 +739,12 @@ class AccountController extends BaseController return Redirect::to('/')->with('clearGuestKey', true); } + + public function resendConfirmation() + { + $user = Auth::user(); + $this->userMailer->sendConfirmation($user); + + return Redirect::to('/company/details')->with('message', trans('texts.confirmation_resent')); + } } diff --git a/app/Http/routes.php b/app/Http/routes.php index eb5656b0880d..bdca441d9bee 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -71,7 +71,7 @@ get('/forgot', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@getEma post('/forgot', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@postEmail')); get('/password/reset', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@getReset')); post('/password/reset', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@postReset')); -get('user/confirm/{code}', 'UserController@confirm'); +get('/user/confirm/{code}', 'UserController@confirm'); /* // Confide routes @@ -167,6 +167,7 @@ Route::group(['middleware' => 'auth'], function() { Route::get('api/credits/{client_id?}', array('as'=>'api.credits', 'uses'=>'CreditController@getDatatable')); Route::post('credits/bulk', 'CreditController@bulk'); + get('/resend_confirmation', 'AccountController@resendConfirmation'); //Route::resource('timesheets', 'TimesheetController'); }); diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index a8ad30ccc7a2..823e76d13883 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -582,5 +582,8 @@ return array( 'email_approved' => 'Email me when a quote is approved', 'notification_quote_approved_subject' => 'Quote :invoice was approved by :client', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', + 'resend_confirmation' => 'Resend confirmation email', + 'confirmation_resent' => 'The confirmation email was resent', + ); diff --git a/resources/views/accounts/details.blade.php b/resources/views/accounts/details.blade.php index f1a944b3b05a..8cc1515e7a3d 100644 --- a/resources/views/accounts/details.blade.php +++ b/resources/views/accounts/details.blade.php @@ -66,6 +66,8 @@ {!! Former::text('phone') !!} @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('/resend_confirmation')->small() ) !!} @endif @endif diff --git a/resources/views/accounts/notifications.blade.php b/resources/views/accounts/notifications.blade.php index 0e4fe6f73b88..01eae5a70e3e 100644 --- a/resources/views/accounts/notifications.blade.php +++ b/resources/views/accounts/notifications.blade.php @@ -39,8 +39,10 @@ {!! Former::legend(trans('texts.custom_messages')) !!} - {!! Former::textarea('invoice_terms')->label(trans('texts.default_invoice_terms')) !!} - {!! Former::textarea('invoice_footer')->label(trans('texts.default_invoice_footer')) !!} + {!! Former::textarea('invoice_terms')->label(trans('texts.default_invoice_terms')) + ->onchange("$('#invoice_terms').val(wordWrapText($('#invoice_terms').val(), 300))") !!} + {!! Former::textarea('invoice_footer')->label(trans('texts.default_invoice_footer')) + ->onchange("$('#invoice_footer').val(wordWrapText($('#invoice_footer').val(), 600))") !!} {!! Former::textarea('email_footer')->label(trans('texts.default_email_footer')) !!} {!! Former::actions( diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index abc37c633b15..073700d45d68 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -363,7 +363,7 @@ var isFormValid = true; $(['first_name','last_name','email','password']).each(function(i, field) { var $input = $('form.signUpForm #new_'+field), - val = $.trim($input.val()); + val = $.trim($input.val()); var isValid = val && val.length >= (field == 'password' ? 6 : 1); if (isValid && field == 'email') { isValid = isValidEmailAddress(val); diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index 7be74e42d1c4..067fd93cf3fa 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -685,7 +685,7 @@ invoice.imageHeight = {{ $account->getLogoHeight() }}; @endif - return invoice; + return invoice; } function getPDFString() {