From b65295e794ca996fe144849d6bc69aaec1f726f4 Mon Sep 17 00:00:00 2001 From: Laurynas Sakalauskas Date: Sun, 8 Mar 2015 16:27:04 +0000 Subject: [PATCH 001/118] Updated barryvdh/laravel-debugbar version. Laravel 4 must use 1.8 version. dev-master is for Laravel 5 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 541d68ee88c4..6213a2a0df13 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "patricktalmadge/bootstrapper": "4.1.x", "zizaco/confide": "3.1.x", "anahkiasen/former": "3.4.x", - "barryvdh/laravel-debugbar": "dev-master", + "barryvdh/laravel-debugbar": "~1.8", "chumper/datatable": "2.x", "omnipay/omnipay": "~2.0", "intervention/image": "1.x", From 886fccadfd3deb9a10c4489f092dd93f674c9728 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 9 Mar 2015 00:13:25 +0200 Subject: [PATCH 002/118] Fix for Viewing invoice as Guest #250 --- app/controllers/InvoiceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php index dabbb0c00c10..28a04b3cbaf9 100755 --- a/app/controllers/InvoiceController.php +++ b/app/controllers/InvoiceController.php @@ -185,7 +185,7 @@ class InvoiceController extends \BaseController 'invoiceLabels' => $client->account->getInvoiceLabels(), 'contact' => $contact, 'hasToken' => $client->getGatewayToken(), - 'countGateways' => AccountGateway::scope()->count(), + 'countGateways' => AccountGateway::scope(false, $client->account->id)->count(), ); return View::make('invoices.view', $data); From 173b45ec847a8560416ea342fd96a1636983f85f Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 9 Mar 2015 13:37:24 +0200 Subject: [PATCH 003/118] Set payment cancelUrl to client invoice page --- app/controllers/PaymentController.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/PaymentController.php b/app/controllers/PaymentController.php index af651e117c3e..b1c67aa80284 100755 --- a/app/controllers/PaymentController.php +++ b/app/controllers/PaymentController.php @@ -223,8 +223,9 @@ class PaymentController extends \BaseController ]; } - private function getPaymentDetails($invoice, $input = null) + private function getPaymentDetails($invitation, $input = null) { + $invoice = $invitation->invoice; $key = $invoice->invoice_number.'_details'; $gateway = $invoice->client->account->getGatewayByType(Session::get('payment_type'))->gateway; $paymentLibrary = $gateway->paymentlibrary; @@ -288,7 +289,7 @@ class PaymentController extends \BaseController 'card' => $card, 'currency' => $currencyCode, 'returnUrl' => URL::to('complete'), - 'cancelUrl' => URL::to('/') + 'cancelUrl' => $invitation->getLink(), ]; } else { return $data; @@ -557,7 +558,7 @@ class PaymentController extends \BaseController try { if ($paymentLibrary->id == PAYMENT_LIBRARY_OMNIPAY) { $gateway = self::createGateway($accountGateway); - $details = self::getPaymentDetails($invoice, $useToken || !$onSite ? false : Input::all()); + $details = self::getPaymentDetails($invitation, $useToken || !$onSite ? false : Input::all()); if ($accountGateway->gateway_id == GATEWAY_STRIPE) { if ($useToken) { @@ -671,7 +672,7 @@ class PaymentController extends \BaseController $gateway = self::createGateway($accountGateway); try { - $details = self::getPaymentDetails($invoice); + $details = self::getPaymentDetails($invitation); $response = $gateway->completePurchase($details)->send(); $ref = $response->getTransactionReference(); From df439d9a54c21f16f1674eebfbab9063cd348d3a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 9 Mar 2015 13:52:35 +0200 Subject: [PATCH 004/118] Set additional payment gateway fields --- app/controllers/PaymentController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/PaymentController.php b/app/controllers/PaymentController.php index b1c67aa80284..9cef3a375895 100755 --- a/app/controllers/PaymentController.php +++ b/app/controllers/PaymentController.php @@ -290,6 +290,8 @@ class PaymentController extends \BaseController 'currency' => $currencyCode, 'returnUrl' => URL::to('complete'), 'cancelUrl' => $invitation->getLink(), + 'description' => trans('texts.' . $invoice->getEntityType()) . " {$invoice->invoice_number}", + 'transactionId' => $invoice->invoice_number, ]; } else { return $data; From 463d0546afa85b078a05b5f05ecb3d26532cf398 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 9 Mar 2015 14:01:48 +0200 Subject: [PATCH 005/118] =?UTF-8?q?Add=20=E2=80=9Corder=20by=E2=80=9D=20fo?= =?UTF-8?q?r=20invoice=20items?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/Invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/Invoice.php b/app/models/Invoice.php index 0d7687d4a8fe..09e1f887d34d 100755 --- a/app/models/Invoice.php +++ b/app/models/Invoice.php @@ -19,7 +19,7 @@ class Invoice extends EntityModel public function invoice_items() { - return $this->hasMany('InvoiceItem'); + return $this->hasMany('InvoiceItem')->orderBy('id'); } public function invoice_status() From d13a377ff79d24088ec69e715115bb3fe5b90c7e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 9 Mar 2015 17:15:28 +0200 Subject: [PATCH 006/118] Added ip to activities table --- app/controllers/PaymentController.php | 1 - .../2015_03_09_151011_add_ip_to_activity.php | 34 +++++++++++++++++++ app/filters.php | 2 +- app/models/Activity.php | 1 + 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 app/database/migrations/2015_03_09_151011_add_ip_to_activity.php diff --git a/app/controllers/PaymentController.php b/app/controllers/PaymentController.php index 9cef3a375895..c0241a8979fe 100755 --- a/app/controllers/PaymentController.php +++ b/app/controllers/PaymentController.php @@ -291,7 +291,6 @@ class PaymentController extends \BaseController 'returnUrl' => URL::to('complete'), 'cancelUrl' => $invitation->getLink(), 'description' => trans('texts.' . $invoice->getEntityType()) . " {$invoice->invoice_number}", - 'transactionId' => $invoice->invoice_number, ]; } else { return $data; diff --git a/app/database/migrations/2015_03_09_151011_add_ip_to_activity.php b/app/database/migrations/2015_03_09_151011_add_ip_to_activity.php new file mode 100644 index 000000000000..552f75dfa808 --- /dev/null +++ b/app/database/migrations/2015_03_09_151011_add_ip_to_activity.php @@ -0,0 +1,34 @@ +string('ip')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('activities', function($table) + { + $table->dropColumn('ip'); + }); + } + +} diff --git a/app/filters.php b/app/filters.php index 8dddcf16f908..7aa8d6cbd11f 100755 --- a/app/filters.php +++ b/app/filters.php @@ -264,7 +264,7 @@ Route::filter('csrf', function() if (Session::token() != $token) { - Session::flash('warning', trans('texts.session_expired')); + Session::flash('warning', trans('texts.session_expired')); return Redirect::to('/'); //throw new Illuminate\Session\TokenMismatchException; diff --git a/app/models/Activity.php b/app/models/Activity.php index 912aa554be7f..9fe82178c612 100755 --- a/app/models/Activity.php +++ b/app/models/Activity.php @@ -35,6 +35,7 @@ class Activity extends Eloquent } $activity->token_id = Session::get('token_id', null); + $activity->ip = Request::getClientIp(); return $activity; } From e42c6b3ca2d0fd79f2d964a24ad99dd9fe0be508 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 9 Mar 2015 21:14:00 +0200 Subject: [PATCH 007/118] Combined advanced settings pages --- app/lang/da/texts.php | 4 +++- app/lang/de/texts.php | 5 ++++- app/lang/en/texts.php | 4 ++++ app/lang/es/texts.php | 3 +++ app/lang/fr/texts.php | 3 +++ app/lang/it/texts.php | 3 +++ app/lang/lt/texts.php | 3 +++ app/lang/nb_NO/texts.php | 3 +++ app/lang/nl/texts.php | 3 +++ app/lang/pt_BR/texts.php | 3 +++ app/views/accounts/nav_advanced.blade.php | 10 +++------- app/views/accounts/user_management.blade.php | 9 ++++++--- app/views/reports/report_builder.blade.php | 10 +++++++--- 13 files changed, 48 insertions(+), 15 deletions(-) diff --git a/app/lang/da/texts.php b/app/lang/da/texts.php index 5f6f867cc4ab..f80e354f8326 100644 --- a/app/lang/da/texts.php +++ b/app/lang/da/texts.php @@ -566,6 +566,8 @@ return array( 'password_error_incorrect' => 'The current password is incorrect.', 'password_error_invalid' => 'The new password is invalid.', 'updated_password' => 'Successfully updated password', - + 'api_tokens' => 'API Tokens', + 'users_and_tokens' => 'Users & Tokens', + ); diff --git a/app/lang/de/texts.php b/app/lang/de/texts.php index d75323867887..bd682f3150c8 100644 --- a/app/lang/de/texts.php +++ b/app/lang/de/texts.php @@ -557,6 +557,9 @@ return array( 'password_error_incorrect' => 'Das aktuelle Passwort ist nicht korrekt.', 'password_error_invalid' => 'Das neue Kennwort ist ungültig.', 'updated_password' => 'Passwort erfolgreich aktualisiert', - + + 'api_tokens' => 'API Tokens', + 'users_and_tokens' => 'Users & Tokens', + ); diff --git a/app/lang/en/texts.php b/app/lang/en/texts.php index 7d06c89a6f4e..c14670739451 100644 --- a/app/lang/en/texts.php +++ b/app/lang/en/texts.php @@ -565,4 +565,8 @@ return array( 'password_error_invalid' => 'The new password is invalid.', 'updated_password' => 'Successfully updated password', + 'api_tokens' => 'API Tokens', + 'users_and_tokens' => 'Users & Tokens', + + ); diff --git a/app/lang/es/texts.php b/app/lang/es/texts.php index f400c21b21bd..a540e47e39ca 100644 --- a/app/lang/es/texts.php +++ b/app/lang/es/texts.php @@ -537,5 +537,8 @@ return array( 'password_error_invalid' => 'The new password is invalid.', 'updated_password' => 'Successfully updated password', + 'api_tokens' => 'API Tokens', + 'users_and_tokens' => 'Users & Tokens', + ); \ No newline at end of file diff --git a/app/lang/fr/texts.php b/app/lang/fr/texts.php index 36ca7b9c7311..e304cad8b6c0 100644 --- a/app/lang/fr/texts.php +++ b/app/lang/fr/texts.php @@ -558,5 +558,8 @@ return array( 'password_error_invalid' => 'The new password is invalid.', 'updated_password' => 'Successfully updated password', + 'api_tokens' => 'API Tokens', + 'users_and_tokens' => 'Users & Tokens', + ); \ No newline at end of file diff --git a/app/lang/it/texts.php b/app/lang/it/texts.php index b3772a45764d..e4dcb5e926bc 100644 --- a/app/lang/it/texts.php +++ b/app/lang/it/texts.php @@ -560,5 +560,8 @@ return array( 'password_error_invalid' => 'The new password is invalid.', 'updated_password' => 'Successfully updated password', + 'api_tokens' => 'API Tokens', + 'users_and_tokens' => 'Users & Tokens', + ); diff --git a/app/lang/lt/texts.php b/app/lang/lt/texts.php index d144838b8ddd..943194ac8672 100644 --- a/app/lang/lt/texts.php +++ b/app/lang/lt/texts.php @@ -568,6 +568,9 @@ return array( 'password_error_invalid' => 'The new password is invalid.', 'updated_password' => 'Successfully updated password', + 'api_tokens' => 'API Tokens', + 'users_and_tokens' => 'Users & Tokens', + ); diff --git a/app/lang/nb_NO/texts.php b/app/lang/nb_NO/texts.php index e1efa117ccae..80d4b6cc58ce 100644 --- a/app/lang/nb_NO/texts.php +++ b/app/lang/nb_NO/texts.php @@ -566,5 +566,8 @@ return array( 'password_error_invalid' => 'The new password is invalid.', 'updated_password' => 'Successfully updated password', + 'api_tokens' => 'API Tokens', + 'users_and_tokens' => 'Users & Tokens', + ); \ No newline at end of file diff --git a/app/lang/nl/texts.php b/app/lang/nl/texts.php index d4d233db6248..8cb6331b7e1f 100644 --- a/app/lang/nl/texts.php +++ b/app/lang/nl/texts.php @@ -561,6 +561,9 @@ return array( 'password_error_invalid' => 'The new password is invalid.', 'updated_password' => 'Successfully updated password', + 'api_tokens' => 'API Tokens', + 'users_and_tokens' => 'Users & Tokens', + ); \ No newline at end of file diff --git a/app/lang/pt_BR/texts.php b/app/lang/pt_BR/texts.php index 9fcd74d41adc..28ac859e91f1 100644 --- a/app/lang/pt_BR/texts.php +++ b/app/lang/pt_BR/texts.php @@ -549,5 +549,8 @@ return array( 'password_error_invalid' => 'The new password is invalid.', 'updated_password' => 'Successfully updated password', + 'api_tokens' => 'API Tokens', + 'users_and_tokens' => 'Users & Tokens', + ); diff --git a/app/views/accounts/nav_advanced.blade.php b/app/views/accounts/nav_advanced.blade.php index 7c344f575419..3f0d62789ca5 100644 --- a/app/views/accounts/nav_advanced.blade.php +++ b/app/views/accounts/nav_advanced.blade.php @@ -2,20 +2,16 @@ {{ HTML::nav_link('company/advanced_settings/invoice_settings', 'invoice_settings') }} {{ HTML::nav_link('company/advanced_settings/invoice_design', 'invoice_design') }} {{ HTML::nav_link('company/advanced_settings/email_templates', 'email_templates') }} - {{ HTML::nav_link('company/advanced_settings/data_visualizations', 'data_visualizations') }} {{ HTML::nav_link('company/advanced_settings/chart_builder', 'chart_builder') }} - {{ HTML::nav_link('company/advanced_settings/user_management', 'users', 'users') }} - {{ HTML::nav_link('company/advanced_settings/token_management', 'tokens', 'tokens') }} + {{ HTML::nav_link('company/advanced_settings/user_management', 'users_and_tokens') }}

 

@if (!Auth::user()->account->isPro()) -
-
+
{{ trans('texts.pro_plan_advanced_settings', ['link'=>''.trans('texts.pro_plan.remove_logo_link').'']) }}
 

  -

-
+ @endif
\ No newline at end of file diff --git a/app/views/accounts/user_management.blade.php b/app/views/accounts/user_management.blade.php index 8a1a66df9b46..c0e8e2819e8e 100644 --- a/app/views/accounts/user_management.blade.php +++ b/app/views/accounts/user_management.blade.php @@ -13,9 +13,12 @@ {{ Former::close() }} - @if (Utils::isPro()) - {{ Button::success_link(URL::to('users/create'), trans("texts.add_user"), array('class' => 'pull-right'))->append_with_icon('plus-sign') }} - @endif +
+ @if (Utils::isPro()) + {{ Button::success_link(URL::to('users/create'), trans("texts.add_user"))->append_with_icon('plus-sign') }} + @endif + {{ Button::default_link(URL::to('company/advanced_settings/token_management'), trans("texts.api_tokens"))->append_with_icon('cloud') }} +