From 4a033ce925d58f7d1d1ce2599959fe6a39de14c3 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 17 Feb 2016 08:57:06 +1100 Subject: [PATCH 001/130] Improving error reporting API --- app/Http/Controllers/InvoiceApiController.php | 11 +++++++---- app/Ninja/Mailers/ContactMailer.php | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index f6a5b9b60b3d..f22be4b78770 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -282,12 +282,15 @@ class InvoiceApiController extends BaseAPIController $data = Input::all(); $error = null; - $invoice = Invoice::scope($data['id'])->firstOrFail(); + $invoice = Invoice::scope($data['id'])->withTrashed()->first(); - $this->mailer->sendInvoice($invoice); + if(!$invoice) + return $this->errorResponse(['message'=>'Invoice does not exist.'], 400); - if($error) { - $response['error'] = "There was an error sending the invoice"; + $emailAction = $this->mailer->sendInvoice($invoice); + + if(($error) || ($emailAction === FALSE)) { + return $this->errorResponse(['message'=>'There was an error sending the invoice'], 400); } else { $response = json_encode(RESULT_SUCCESS, JSON_PRETTY_PRINT); diff --git a/app/Ninja/Mailers/ContactMailer.php b/app/Ninja/Mailers/ContactMailer.php index 8959602ce6a2..a5861ab94a3a 100644 --- a/app/Ninja/Mailers/ContactMailer.php +++ b/app/Ninja/Mailers/ContactMailer.php @@ -41,6 +41,8 @@ class ContactMailer extends Mailer $client = $invoice->client; $account = $invoice->account; + $response = false; + if ($client->trashed()) { return trans('texts.email_errors.inactive_client'); } elseif ($invoice->trashed()) { From 2295102b98f13599adaee334e6778b9cf32c3fbd Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 00:07:05 +0200 Subject: [PATCH 002/130] Adding back change from conflict --- app/Http/Controllers/ClientApiController.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/ClientApiController.php b/app/Http/Controllers/ClientApiController.php index aa5c2fa6bfd4..a3fea1435fb4 100644 --- a/app/Http/Controllers/ClientApiController.php +++ b/app/Http/Controllers/ClientApiController.php @@ -1,5 +1,6 @@ action == ACTION_ARCHIVE) { - $client = Client::scope($publicId)->withTrashed()->first(); - if(!$client) - return $this->errorResponse(['message'=>'Client not found.']); + try { + $client = Client::scope($publicId)->withTrashed()->firstOrFail(); + } catch (ModelNotFoundException $e) { + return $this->errorResponse(['message'=>'Record not found'], 400); + } $this->clientRepo->archive($client); From 746b6ef362ed0f8d76bd72397392703645d7d4cd Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 17 Feb 2016 09:09:32 +1100 Subject: [PATCH 003/130] Improving error reporting API --- app/Http/Controllers/InvoiceApiController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index f22be4b78770..6bac870557b0 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -1,6 +1,7 @@ withTrashed()->first(); if(!$invoice) From 31720b59fde1a26a7135befe2fa7da7661dd3434 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 17 Feb 2016 09:12:34 +1100 Subject: [PATCH 004/130] Improving error reporting API --- app/Http/Controllers/InvoiceApiController.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index 6bac870557b0..17259da12a43 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -284,15 +284,21 @@ class InvoiceApiController extends BaseAPIController $error = null; Log::info($data); - + $invoice = Invoice::scope($data['id'])->withTrashed()->first(); if(!$invoice) return $this->errorResponse(['message'=>'Invoice does not exist.'], 400); - $emailAction = $this->mailer->sendInvoice($invoice); + try { + $this->mailer->sendInvoice($invoice); + } + catch(\Exception $e) + { + $this->errorResponse(['message'=>'There was an error sending the invoice'], 400); + } - if(($error) || ($emailAction === FALSE)) { + if($error) { return $this->errorResponse(['message'=>'There was an error sending the invoice'], 400); } else { From 170ee5a40b789d603eab5790047df4cab4f77710 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 17 Feb 2016 09:28:00 +1100 Subject: [PATCH 005/130] Improving error reporting API --- app/Http/Controllers/InvoiceApiController.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index 17259da12a43..350869fec8af 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -283,22 +283,16 @@ class InvoiceApiController extends BaseAPIController $data = Input::all(); $error = null; - Log::info($data); - $invoice = Invoice::scope($data['id'])->withTrashed()->first(); if(!$invoice) return $this->errorResponse(['message'=>'Invoice does not exist.'], 400); - try { - $this->mailer->sendInvoice($invoice); - } - catch(\Exception $e) - { - $this->errorResponse(['message'=>'There was an error sending the invoice'], 400); - } - if($error) { + $emailResponse = $this->mailer->sendInvoice($invoice, false, false); + + + if($emailResponse === FALSE) { return $this->errorResponse(['message'=>'There was an error sending the invoice'], 400); } else { From 1fde9261e66023d17c794f106b3609dad7adfec0 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 17 Feb 2016 09:38:23 +1100 Subject: [PATCH 006/130] Improving error reporting API --- app/Http/Controllers/InvoiceApiController.php | 4 ++-- app/Ninja/Mailers/ContactMailer.php | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index 350869fec8af..b293ccef407a 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -289,10 +289,10 @@ class InvoiceApiController extends BaseAPIController return $this->errorResponse(['message'=>'Invoice does not exist.'], 400); - $emailResponse = $this->mailer->sendInvoice($invoice, false, false); + $this->mailer->sendInvoice($invoice, false, $invoice->getPDFString()); - if($emailResponse === FALSE) { + if($error) { return $this->errorResponse(['message'=>'There was an error sending the invoice'], 400); } else { diff --git a/app/Ninja/Mailers/ContactMailer.php b/app/Ninja/Mailers/ContactMailer.php index a5861ab94a3a..8959602ce6a2 100644 --- a/app/Ninja/Mailers/ContactMailer.php +++ b/app/Ninja/Mailers/ContactMailer.php @@ -41,8 +41,6 @@ class ContactMailer extends Mailer $client = $invoice->client; $account = $invoice->account; - $response = false; - if ($client->trashed()) { return trans('texts.email_errors.inactive_client'); } elseif ($invoice->trashed()) { From a1be1f3529f918c327f87b8b5c51d1473048fb07 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 17 Feb 2016 09:45:28 +1100 Subject: [PATCH 007/130] Improving error reporting API --- app/Http/Controllers/InvoiceApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index b293ccef407a..54e527385d66 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -289,7 +289,7 @@ class InvoiceApiController extends BaseAPIController return $this->errorResponse(['message'=>'Invoice does not exist.'], 400); - $this->mailer->sendInvoice($invoice, false, $invoice->getPDFString()); + $this->mailer->sendInvoice($invoice, false, false); if($error) { From 09650123d7bd3e347629110a9cd4bcca092c66f1 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 17 Feb 2016 10:05:08 +1100 Subject: [PATCH 008/130] Improving error reporting API --- app/Models/Invoice.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index e93c8d3b07f5..f87dc20aa756 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -1,5 +1,6 @@ Date: Wed, 17 Feb 2016 10:29:18 +1100 Subject: [PATCH 009/130] Improving error reporting API --- app/Models/Invoice.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index f87dc20aa756..72c255ae0947 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -753,15 +753,17 @@ class Invoice extends EntityModel implements BalanceAffecting ], ]; - Log::info($opts); - curl_setopt_array($curl, $opts); $response = curl_exec($curl); curl_close($curl); + Log::info($response); + $encodedString = strip_tags($response); $pdfString = Utils::decodePDF($encodedString); + Log::info($pdfString); + if ( ! $pdfString || strlen($pdfString) < 200) { Utils::logError("PhantomJSCloud - failed to create pdf: {$encodedString}"); } From 1a953c5bcbae82d2c02559d71a28e7e0ea727f20 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 17 Feb 2016 10:34:23 +1100 Subject: [PATCH 010/130] Improving error reporting API --- app/Models/Invoice.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 72c255ae0947..7198eff647fa 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -744,7 +744,7 @@ class Invoice extends EntityModel implements BalanceAffecting $opts = [ CURLOPT_URL => PHANTOMJS_CLOUD . env('PHANTOMJS_CLOUD_KEY') . '/', CURLOPT_RETURNTRANSFER => true, - CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $jsonEncodedData, CURLOPT_HTTPHEADER => [ @@ -757,13 +757,9 @@ class Invoice extends EntityModel implements BalanceAffecting $response = curl_exec($curl); curl_close($curl); - Log::info($response); - $encodedString = strip_tags($response); $pdfString = Utils::decodePDF($encodedString); - Log::info($pdfString); - if ( ! $pdfString || strlen($pdfString) < 200) { Utils::logError("PhantomJSCloud - failed to create pdf: {$encodedString}"); } From 7cd3bac29c450db1d88e4e0b4ff4c8e2a38e915a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 17 Feb 2016 10:35:54 +1100 Subject: [PATCH 011/130] Improving error reporting API --- app/Models/Invoice.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 7198eff647fa..b82e8ea9cf6b 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -757,6 +757,8 @@ class Invoice extends EntityModel implements BalanceAffecting $response = curl_exec($curl); curl_close($curl); + Log::info($response); + $encodedString = strip_tags($response); $pdfString = Utils::decodePDF($encodedString); From 7da522599c8c651909b00fafab2c3bd3365311a2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 17 Feb 2016 10:36:45 +1100 Subject: [PATCH 012/130] Improving error reporting API --- app/Models/Invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index b82e8ea9cf6b..1da325ff01e0 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -744,7 +744,7 @@ class Invoice extends EntityModel implements BalanceAffecting $opts = [ CURLOPT_URL => PHANTOMJS_CLOUD . env('PHANTOMJS_CLOUD_KEY') . '/', CURLOPT_RETURNTRANSFER => true, - CURLOPT_CUSTOMREQUEST => 'GET', + CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $jsonEncodedData, CURLOPT_HTTPHEADER => [ @@ -758,7 +758,7 @@ class Invoice extends EntityModel implements BalanceAffecting curl_close($curl); Log::info($response); - + $encodedString = strip_tags($response); $pdfString = Utils::decodePDF($encodedString); From e3ee79f369a5d5ea8018da141630414d40749146 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 17 Feb 2016 10:44:01 +1100 Subject: [PATCH 013/130] Improving error reporting API --- app/Models/Invoice.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 1da325ff01e0..e93c8d3b07f5 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -1,6 +1,5 @@ Date: Wed, 17 Feb 2016 14:32:20 +1100 Subject: [PATCH 014/130] Expense and Vendor Transformers for API --- app/Http/Controllers/ExpenseApiController.php | 64 +++++++++++++++++++ app/Http/Controllers/VendorApiController.php | 1 + app/Http/routes.php | 1 + app/Models/Vendor.php | 5 ++ app/Ninja/Mailers/ContactMailer.php | 2 + app/Ninja/Transformers/ExpenseTransformer.php | 29 +++++++++ app/Ninja/Transformers/VendorTransformer.php | 15 +++-- 7 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 app/Http/Controllers/ExpenseApiController.php create mode 100644 app/Ninja/Transformers/ExpenseTransformer.php diff --git a/app/Http/Controllers/ExpenseApiController.php b/app/Http/Controllers/ExpenseApiController.php new file mode 100644 index 000000000000..88ff5497cefd --- /dev/null +++ b/app/Http/Controllers/ExpenseApiController.php @@ -0,0 +1,64 @@ +expenseRepo = $expenseRepo; + $this->expenseService = $expenseService; + } + + public function index() + { + + $expenses = Expense::scope() + ->withTrashed() + ->orderBy('created_at','desc'); + + $expenses = $expenses->paginate(); + + $transformer = new ExpenseTransformer(Auth::user()->account, Input::get('serializer')); + $paginator = Expense::scope()->withTrashed()->paginate(); + + $data = $this->createCollection($expenses, $transformer, ENTITY_EXPENSE, $paginator); + + return $this->response($data); + + } + + public function update() + { + //stub + + } + + public function store() + { + //stub + + } + + public function destroy() + { + //stub + + } + + +} \ No newline at end of file diff --git a/app/Http/Controllers/VendorApiController.php b/app/Http/Controllers/VendorApiController.php index 80236226dda0..e2cec175bada 100644 --- a/app/Http/Controllers/VendorApiController.php +++ b/app/Http/Controllers/VendorApiController.php @@ -48,6 +48,7 @@ class VendorApiController extends BaseAPIController { $vendors = Vendor::scope() ->with($this->getIncluded()) + ->withTrashed() ->orderBy('created_at', 'desc') ->paginate(); diff --git a/app/Http/routes.php b/app/Http/routes.php index 9001c18e6256..97002c05b14c 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -236,6 +236,7 @@ Route::group(['middleware' => 'api', 'prefix' => 'api/v1'], function() Route::resource('products', 'ProductApiController'); Route::resource('tax_rates', 'TaxRateApiController'); Route::resource('users', 'UserApiController'); + Route::resource('expenses','ExpenseApiController'); // Vendor Route::resource('vendors', 'VendorApiController'); diff --git a/app/Models/Vendor.php b/app/Models/Vendor.php index a93fc6e5d7b4..ce21a6446364 100644 --- a/app/Models/Vendor.php +++ b/app/Models/Vendor.php @@ -124,6 +124,11 @@ class Vendor extends EntityModel return $this->belongsTo('App\Models\Industry'); } + public function expenses() + { + return $this->hasMany('App\Models\Expense','vendor_id','id'); + } + public function addVendorContact($data, $isPrimary = false) { $publicId = isset($data['public_id']) ? $data['public_id'] : false; diff --git a/app/Ninja/Mailers/ContactMailer.php b/app/Ninja/Mailers/ContactMailer.php index 8959602ce6a2..dc513c3e8822 100644 --- a/app/Ninja/Mailers/ContactMailer.php +++ b/app/Ninja/Mailers/ContactMailer.php @@ -41,6 +41,8 @@ class ContactMailer extends Mailer $client = $invoice->client; $account = $invoice->account; + $response = null; + if ($client->trashed()) { return trans('texts.email_errors.inactive_client'); } elseif ($invoice->trashed()) { diff --git a/app/Ninja/Transformers/ExpenseTransformer.php b/app/Ninja/Transformers/ExpenseTransformer.php new file mode 100644 index 000000000000..26729f4ddb17 --- /dev/null +++ b/app/Ninja/Transformers/ExpenseTransformer.php @@ -0,0 +1,29 @@ + (int) $expense->public_id, + 'private_notes' => $expense->private_notes, + 'public_notes' => $expense->public_notes, + 'should_be_invoiced' => (bool) $expense->should_be_invoiced, + 'updated_at' => $this->getTimestamp($expense->updated_at), + 'archived_at' => $this->getTimestamp($expense->deleted_at), + 'transaction_id' => $expense->transaction_id, + 'bank_id' => $expense->bank_id, + 'expense_currency_id' => (int) $expense->expense_currency_id, + 'account_key' => $this->account->account_key, + 'amount' => (float) $expense->amount, + 'expense_date' => $expense->expense_date, + 'exchange_rate' => (float) $expense->exchange_rate, + 'invoice_currency_id' => (int) $expense->invoice_currency_id, + 'is_deleted' => (bool) $expense->is_deleted, + ]; + } +} \ No newline at end of file diff --git a/app/Ninja/Transformers/VendorTransformer.php b/app/Ninja/Transformers/VendorTransformer.php index c1714b27a120..f0b8fd0415f0 100644 --- a/app/Ninja/Transformers/VendorTransformer.php +++ b/app/Ninja/Transformers/VendorTransformer.php @@ -36,14 +36,15 @@ class VendorTransformer extends EntityTransformer */ protected $availableIncludes = [ - 'contacts', + 'vendorContacts', 'invoices', + 'expenses', ]; - public function includeContacts(Vendor $vendor) + public function includeVendorContacts(Vendor $vendor) { - $transformer = new ContactTransformer($this->account, $this->serializer); - return $this->includeCollection($vendor->contacts, $transformer, ENTITY_CONTACT); + $transformer = new VendorContactTransformer($this->account, $this->serializer); + return $this->includeCollection($vendor->vendorContacts, $transformer, ENTITY_CONTACT); } public function includeInvoices(Vendor $vendor) @@ -52,6 +53,12 @@ class VendorTransformer extends EntityTransformer return $this->includeCollection($vendor->invoices, $transformer, ENTITY_INVOICE); } + public function includeExpenses(Vendor $vendor) + { + $transformer = new ExpenseTransformer($this->account, $this->serializer); + return $this->includeCollection($vendor->expenses, $transformer, ENTITY_EXPENSE); + } + public function transform(Vendor $vendor) { return [ From aef4658873cbbf061bd78e5d1ba4333eaaf11b62 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 17 Feb 2016 19:10:33 +1100 Subject: [PATCH 015/130] Api work/Bug fixes --- app/Models/Client.php | 4 ++++ app/Models/Invoice.php | 5 +++++ app/Ninja/Transformers/ClientTransformer.php | 8 ++++++++ app/Ninja/Transformers/InvoiceTransformer.php | 10 +++++++++- app/Ninja/Transformers/VendorContactTransformer.php | 1 - 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/Models/Client.php b/app/Models/Client.php index eae0eb1c148f..2167af0ddfc6 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -139,6 +139,10 @@ class Client extends EntityModel return $this->hasMany('App\Models\Credit'); } + public function expenses() + { + return $this->hasMany('App\Models\Expense','client_id','id')->withTrashed(); + } public function addContact($data, $isPrimary = false) { diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index e93c8d3b07f5..626f4db6475d 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -197,6 +197,11 @@ class Invoice extends EntityModel implements BalanceAffecting return $this->hasMany('App\Models\Invitation')->orderBy('invitations.contact_id'); } + public function expenses() + { + return $this->hasMany('App\Models\Expense','invoice_id','id')->withTrashed(); + } + public function markInvitationsSent($notify = false) { foreach ($this->invitations as $invitation) { diff --git a/app/Ninja/Transformers/ClientTransformer.php b/app/Ninja/Transformers/ClientTransformer.php index 83ee7e56238b..f7d786a2ee25 100644 --- a/app/Ninja/Transformers/ClientTransformer.php +++ b/app/Ninja/Transformers/ClientTransformer.php @@ -47,6 +47,7 @@ class ClientTransformer extends EntityTransformer protected $availableIncludes = [ 'invoices', 'credits', + 'expenses', ]; public function includeContacts(Client $client) @@ -67,6 +68,13 @@ class ClientTransformer extends EntityTransformer return $this->includeCollection($client->credits, $transformer, ENTITY_CREDIT); } + public function includeExpenses(Client $client) + { + $transformer = new ExpenseTransformer($this->account, $this->serializer); + return $this->includeCollection($client->expenses, $transformer, ENTITY_EXPENSE); + } + + public function transform(Client $client) { return [ diff --git a/app/Ninja/Transformers/InvoiceTransformer.php b/app/Ninja/Transformers/InvoiceTransformer.php index 464fc5e3fad7..b67635386d8e 100644 --- a/app/Ninja/Transformers/InvoiceTransformer.php +++ b/app/Ninja/Transformers/InvoiceTransformer.php @@ -28,6 +28,7 @@ class InvoiceTransformer extends EntityTransformer 'invitations', 'payments', 'client', + 'expenses', ]; public function includeInvoiceItems(Invoice $invoice) @@ -51,9 +52,16 @@ class InvoiceTransformer extends EntityTransformer public function includeClient(Invoice $invoice) { $transformer = new ClientTransformer($this->account, $this->serializer); - return $this->includeItem($invoice->client, $transformer, 'client'); + return $this->includeItem($invoice->client, $transformer, ENTITY_CLIENT); } + public function includeExpenses(Invoice $invoice) + { + $transformer = new ExpenseTransformer($this->account, $this->serializer); + return $this->includeCollection($invoice->expenses, $transformer, ENTITY_EXPENSE); + } + + public function transform(Invoice $invoice) { return [ diff --git a/app/Ninja/Transformers/VendorContactTransformer.php b/app/Ninja/Transformers/VendorContactTransformer.php index 0166883aba4d..3b75aee53a28 100644 --- a/app/Ninja/Transformers/VendorContactTransformer.php +++ b/app/Ninja/Transformers/VendorContactTransformer.php @@ -17,7 +17,6 @@ class VendorContactTransformer extends EntityTransformer 'archived_at' => $this->getTimestamp($contact->deleted_at), 'is_primary' => (bool) $contact->is_primary, 'phone' => $contact->phone, - 'last_login' => $contact->last_login, 'account_key' => $this->account->account_key, ]; } From 0e2bf3bb888a4cf998ea22a3430d269f712a7b64 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 11:49:20 +0200 Subject: [PATCH 016/130] Focus the search input if the user clicks forward slash --- resources/views/header.blade.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index a007d34328df..5f4f1d1ceaa6 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -351,6 +351,13 @@ }); @endif + // Focus the search input if the user clicks forward slash + $('body').keypress(function(event) { + if (event.which == 47) { + showSearch(); + } + }); + }); From ee516cb327abfba220cc4f9f54f761885ef21929 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 12:12:39 +0200 Subject: [PATCH 017/130] Combined search and history in navbar --- resources/views/header.blade.php | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index 5f4f1d1ceaa6..e2c6b92c38e4 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -259,6 +259,7 @@ } function showSearch() { + $('#search').typeahead('setQuery', ''); $('#search-form').show(); $('#navbar-options').hide(); if (window.hasOwnProperty('searchData')) { @@ -289,7 +290,6 @@ } function hideSearch() { - $('#search').typeahead('setQuery', ''); $('#search-form').hide(); $('#navbar-options').show(); } @@ -331,7 +331,7 @@ showSignUp(); @endif - $('ul.navbar-settings, ul.navbar-history').hover(function () { + $('ul.navbar-settings, ul.navbar-search').hover(function () { if ($('.user-accounts').css('display') == 'block') { $('.user-accounts').dropdown('toggle'); } @@ -403,7 +403,7 @@
@@ -194,6 +204,7 @@ self.amount = ko.observable(); self.exchange_rate = ko.observable(1); self.should_be_invoiced = ko.observable(); + self.convert_currency = ko.observable(false); if (data) { ko.mapping.fromJS(data, {}, this); @@ -230,9 +241,14 @@ }); self.enableExchangeRate = ko.computed(function() { + if (self.convert_currency()) { + return true; + } var expenseCurrencyId = self.expense_currency_id() || self.account_currency_id(); var invoiceCurrencyId = self.invoice_currency_id() || self.account_currency_id(); - return expenseCurrencyId != invoiceCurrencyId; + return expenseCurrencyId != invoiceCurrencyId + || invoiceCurrencyId != self.account_currency_id() + || expenseCurrencyId != self.account_currency_id(); }) }; From a489c2cab84da92cdf83d9216a34ad0e286792a8 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 15:52:16 +0200 Subject: [PATCH 021/130] Made expense currency conversion hidden by default --- resources/views/expenses/edit.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/expenses/edit.blade.php b/resources/views/expenses/edit.blade.php index 13a718919ab6..c2e00ab6af79 100644 --- a/resources/views/expenses/edit.blade.php +++ b/resources/views/expenses/edit.blade.php @@ -59,7 +59,7 @@ ->data_bind('combobox: client_id') ->addGroupClass('client-select') !!} - @if (!$expense || ($expense && !$expense->invoice_id)) + @if (!$expense || ($expense && !$expense->invoice_id && !$expense->client_id)) {!! Former::checkbox('should_be_invoiced') ->text(trans('texts.should_be_invoiced')) ->data_bind('checked: should_be_invoiced() || client_id(), enable: !client_id()') From 611d90811217ef581095155587d1d051e24b5ba8 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 15:55:31 +0200 Subject: [PATCH 022/130] Fixed sorting expenses by status --- app/Ninja/Repositories/ExpenseRepository.php | 1 + app/Services/ExpenseService.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Ninja/Repositories/ExpenseRepository.php b/app/Ninja/Repositories/ExpenseRepository.php index 442df6ef2979..cfd312622ad3 100644 --- a/app/Ninja/Repositories/ExpenseRepository.php +++ b/app/Ninja/Repositories/ExpenseRepository.php @@ -64,6 +64,7 @@ class ExpenseRepository extends BaseRepository ->orWhere('contacts.is_primary', '=', null); }) ->select( + DB::raw('COALESCE(expenses.invoice_id, expenses.should_be_invoiced) expense_status_id'), 'expenses.account_id', 'expenses.amount', 'expenses.deleted_at', diff --git a/app/Services/ExpenseService.php b/app/Services/ExpenseService.php index 491c0e7957d8..e8f4d591d75d 100644 --- a/app/Services/ExpenseService.php +++ b/app/Services/ExpenseService.php @@ -106,7 +106,7 @@ class ExpenseService extends BaseService } ], [ - 'invoice_id', + 'expense_status_id', function ($model) { return self::getStatusLabel($model->invoice_id, $model->should_be_invoiced); } From 34b350184257b64c3fcdf430287c4e517abf0277 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 17:47:46 +0200 Subject: [PATCH 023/130] Working on Travis, merging from #671 --- .travis.yml | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000000..5c303f42917a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,61 @@ +language: php + +sudo: false + +php: + - 5.5 + - 5.6 + - 7.0 + - hhvm + +addons: + hosts: + - ninja.dev + +cache: + directories: + - vendor + - $HOME/.composer/cache + +env: + global: + - COMPOSER_DISCARD_CHANGES=true + - COMPOSER_NO_INTERACTION=1 + - COMPOSER_DISABLE_XDEBUG_WARN=1 + +before_install: + # set GitHub token and update composer + - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; + - composer self-update && composer -V + +install: + # install Composer dependencies + - travis_retry composer update --prefer-dist; + +before_script: + # copy configuration files + - cp tests/_bootstrap.php.default tests/_bootstrap.php + - cp tests/.env.circleci .env + # create the database and user + - mysql -u root -e "create database IF NOT EXISTS ninja;" + - mysql -u root -e "GRANT ALL PRIVILEGES ON ninja.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;" + # migrate and seed the database + - php artisan migrate --no-interaction + - php artisan db:seed --no-interaction # default seed + - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed + # Start webserver on ninja.dev:8000 + - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background + # Start PhantomJS + - phantomjs --webdriver=4444 & # '&' allows to run in background + # Give it some time to start + - sleep 5 + # Make sure the app is up-to-date + - curl -L http://ninja.dev:8000/update + +script: + - php ./vendor/codeception/codeception/codecept run --html --debug + +notifications: + email: + on_success: never + on_failure: change \ No newline at end of file From 25d2af48919a5dacca2489e6aca3f1850f0e9624 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 17:50:01 +0200 Subject: [PATCH 024/130] Working on download PDF route --- app/Http/Controllers/AccountController.php | 8 +++++++- app/Http/Controllers/PublicClientController.php | 15 +++++++++++++++ app/Http/routes.php | 1 + app/Models/Invoice.php | 10 +++++++--- app/Models/User.php | 5 +++++ app/Ninja/Mailers/ContactMailer.php | 4 ++-- 6 files changed, 37 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 56a7d1a82b43..4b12b6802e90 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -958,7 +958,13 @@ class AccountController extends BaseController 'text' => $reason, ]; - $this->userMailer->sendTo(CONTACT_EMAIL, $email, $name, 'Invoice Ninja Feedback [Canceled Account]', 'contact', $data); + $subject = 'Invoice Ninja - Canceled Account'; + + if (Auth::user()->isPaidPro()) { + $subject .= ' [PRO]'; + } + + $this->userMailer->sendTo(CONTACT_EMAIL, $email, $name, $subject, 'contact', $data); } $user = Auth::user(); diff --git a/app/Http/Controllers/PublicClientController.php b/app/Http/Controllers/PublicClientController.php index 834a89beac59..f52e850e5826 100644 --- a/app/Http/Controllers/PublicClientController.php +++ b/app/Http/Controllers/PublicClientController.php @@ -162,6 +162,21 @@ class PublicClientController extends BaseController return $paymentTypes; } + public function download($invitationKey) + { + if (!$invitation = $this->invoiceRepo->findInvoiceByInvitation($invitationKey)) { + return response()->view('error', [ + 'error' => trans('texts.invoice_not_found'), + 'hideHeader' => true, + ]); + } + + $invoice = $invitation->invoice; + $pdfString = $invoice->getPDFString(); + + dd($pdfString); + } + public function dashboard() { if (!$invitation = $this->getInvitation()) { diff --git a/app/Http/routes.php b/app/Http/routes.php index 848d22bcdd05..347060fcb728 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -37,6 +37,7 @@ Route::post('/get_started', 'AccountController@getStarted'); // Client visible pages Route::get('view/{invitation_key}', 'PublicClientController@view'); +Route::get('download/{invitation_key}', 'PublicClientController@download'); Route::get('view', 'HomeController@viewLogo'); Route::get('approve/{invitation_key}', 'QuoteController@approve'); Route::get('payment/{invitation_key}/{payment_type?}', 'PaymentController@show_payment'); diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 626f4db6475d..8c34b40deed1 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -735,6 +735,10 @@ class Invoice extends EntityModel implements BalanceAffecting $link = $invitation->getLink(); $curl = curl_init(); + if (Utils::isNinjaDev()) { + $link = env('TEST_LINK'); + } + $jsonEncodedData = json_encode([ 'url' => "{$link}?phantomjs=true", 'renderType' => 'html', @@ -761,11 +765,11 @@ class Invoice extends EntityModel implements BalanceAffecting $response = curl_exec($curl); curl_close($curl); - $encodedString = strip_tags($response); - $pdfString = Utils::decodePDF($encodedString); + $pdfString = strip_tags($response); if ( ! $pdfString || strlen($pdfString) < 200) { - Utils::logError("PhantomJSCloud - failed to create pdf: {$encodedString}"); + Utils::logError("PhantomJSCloud - failed to create pdf: {$pdfString}"); + return false; } return $pdfString; diff --git a/app/Models/User.php b/app/Models/User.php index f62e4a5846c6..9f66f0d2af8f 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -107,6 +107,11 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon return $this->account->isPro(); } + public function isPaidPro() + { + return $this->isPro() && ! $this->isTrial(); + } + public function isTrial() { return $this->account->isTrial(); diff --git a/app/Ninja/Mailers/ContactMailer.php b/app/Ninja/Mailers/ContactMailer.php index dc513c3e8822..6d588de3439e 100644 --- a/app/Ninja/Mailers/ContactMailer.php +++ b/app/Ninja/Mailers/ContactMailer.php @@ -56,7 +56,7 @@ class ContactMailer extends Mailer $sent = false; if ($account->attatchPDF() && !$pdfString) { - $pdfString = $invoice->getPDFString(); + $pdfString = Utils::decodePDF($invoice->getPDFString()); } foreach ($invoice->invitations as $invitation) { @@ -184,7 +184,7 @@ class ContactMailer extends Mailer ]; if ($account->attatchPDF()) { - $data['pdfString'] = $invoice->getPDFString(); + $data['pdfString'] = Utils::decodePDF($invoice->getPDFString()); $data['pdfFileName'] = $invoice->getFileName(); } From 94ecfbb5a3581f3783510b452a4603e1643b6a4f Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 17:54:17 +0200 Subject: [PATCH 025/130] Updated travis to run composer install --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5c303f42917a..491963400cd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ before_install: install: # install Composer dependencies - - travis_retry composer update --prefer-dist; + - travis_retry composer install --prefer-dist; before_script: # copy configuration files From 1ebea445a9f8e035ff4b5426f3101c9002b39763 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 17:57:49 +0200 Subject: [PATCH 026/130] Updated travis to remove prefer-dist --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 491963400cd9..7656b2a2bc87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ before_install: install: # install Composer dependencies - - travis_retry composer install --prefer-dist; + - travis_retry composer install; before_script: # copy configuration files From e19e888a177273b7149057173bcd8837c7e4d8f9 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 17:59:32 +0200 Subject: [PATCH 027/130] Working on TravisCI --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7656b2a2bc87..4dad1c9c7848 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,9 @@ addons: hosts: - ninja.dev +git: + depth: 200 + cache: directories: - vendor From 8ddd281e83040df400d8ec2319f2e4c724c0b489 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 18:00:07 +0200 Subject: [PATCH 028/130] Working on TravisCI --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4dad1c9c7848..b25531ac63d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,9 @@ sudo: false php: - 5.5 - - 5.6 - - 7.0 - - hhvm +# - 5.6 +# - 7.0 +# - hhvm addons: hosts: From e4b8b85839afdddcf8d438c8325dba90640231c4 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 18:05:14 +0200 Subject: [PATCH 029/130] Working on TravisCI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b25531ac63d4..f366d863a0aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ addons: - ninja.dev git: - depth: 200 + depth: 300 cache: directories: From 66f2df132d4217bd317b3d91c720e91b1f2fdd53 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 18:07:39 +0200 Subject: [PATCH 030/130] Working on TravisCI --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index a338165ea034..76efb8192895 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,8 @@ } ], "require": { - "omnipay/mollie": "dev-master#22956c1a62a9662afa5f5d119723b413770ac525", - "omnipay/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", + //"omnipay/mollie": "dev-master#22956c1a62a9662afa5f5d119723b413770ac525", + //"omnipay/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", "omnipay/gocardless": "dev-master", "omnipay/stripe": "2.3.0", "laravel/framework": "5.0.*", From b5bb8d50118cead006cfd0b427e10b1fd4c7dd16 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 18:10:50 +0200 Subject: [PATCH 031/130] Working on TravisCI - updated composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 76efb8192895..2afad9b0ab7a 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { //"omnipay/mollie": "dev-master#22956c1a62a9662afa5f5d119723b413770ac525", - //"omnipay/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", + //"omnipay/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", "omnipay/gocardless": "dev-master", "omnipay/stripe": "2.3.0", "laravel/framework": "5.0.*", From 922353107ab6abc2de228be9894e9f422a0df484 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 18:32:43 +0200 Subject: [PATCH 032/130] Working on TravisCI - updated composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2afad9b0ab7a..76efb8192895 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { //"omnipay/mollie": "dev-master#22956c1a62a9662afa5f5d119723b413770ac525", - //"omnipay/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", + //"omnipay/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", "omnipay/gocardless": "dev-master", "omnipay/stripe": "2.3.0", "laravel/framework": "5.0.*", From 8b81a40e06cafd23db2e7290d74f741db6f0c68f Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 18:33:22 +0200 Subject: [PATCH 033/130] Working on TravisCI - updated composer.json --- composer.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/composer.json b/composer.json index 76efb8192895..08244551a1af 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,6 @@ } ], "require": { - //"omnipay/mollie": "dev-master#22956c1a62a9662afa5f5d119723b413770ac525", - //"omnipay/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", "omnipay/gocardless": "dev-master", "omnipay/stripe": "2.3.0", "laravel/framework": "5.0.*", From 7e906798de21d0027b820c3a01e6b9555ad194fb Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 18:49:40 +0200 Subject: [PATCH 034/130] Working on TravisCI --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f366d863a0aa..37487b271cdb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,6 @@ addons: hosts: - ninja.dev -git: - depth: 300 - cache: directories: - vendor @@ -33,7 +30,7 @@ before_install: install: # install Composer dependencies - - travis_retry composer install; + - travis_retry composer install --prefer-dist; before_script: # copy configuration files From 96479871bc29299800426fb46bc3ffd2963f18c2 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 19:14:06 +0200 Subject: [PATCH 035/130] Working on TravisCI --- .travis.yml | 1 + app/Http/routes.php | 1 - composer.json | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 37487b271cdb..8cc170fae2cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,7 @@ before_install: install: # install Composer dependencies + - cat composer.json - travis_retry composer install --prefer-dist; before_script: diff --git a/app/Http/routes.php b/app/Http/routes.php index 347060fcb728..566f4aa15ae6 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -1,6 +1,5 @@ Date: Wed, 17 Feb 2016 19:16:29 +0200 Subject: [PATCH 036/130] Working on TravisCI --- composer.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/composer.json b/composer.json index a338165ea034..08244551a1af 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,6 @@ } ], "require": { - "omnipay/mollie": "dev-master#22956c1a62a9662afa5f5d119723b413770ac525", - "omnipay/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", "omnipay/gocardless": "dev-master", "omnipay/stripe": "2.3.0", "laravel/framework": "5.0.*", From e8394574e60d1f31e9e869d8004e6cf394a14b35 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 19:22:42 +0200 Subject: [PATCH 037/130] Working on TravisCI --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8cc170fae2cd..498d692d7b51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,9 @@ cache: - vendor - $HOME/.composer/cache +git: + depth: 150 + env: global: - COMPOSER_DISCARD_CHANGES=true From e11934a3b98679b34d5bdf9ea7fd3cc41f94009b Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 19:42:16 +0200 Subject: [PATCH 038/130] Working on TravisCI --- .travis.yml | 7 ++++--- composer.json | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 498d692d7b51..78c245ed700f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,6 @@ cache: - vendor - $HOME/.composer/cache -git: - depth: 150 - env: global: - COMPOSER_DISCARD_CHANGES=true @@ -33,6 +30,10 @@ before_install: install: # install Composer dependencies + - rm composer.lock + - cat composer.json + - sed '/omnipay/mollie/d' filename.txt + - sed '/omnipay/2checkout/d' filename.txt - cat composer.json - travis_retry composer install --prefer-dist; diff --git a/composer.json b/composer.json index 08244551a1af..a338165ea034 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,8 @@ } ], "require": { + "omnipay/mollie": "dev-master#22956c1a62a9662afa5f5d119723b413770ac525", + "omnipay/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248", "omnipay/gocardless": "dev-master", "omnipay/stripe": "2.3.0", "laravel/framework": "5.0.*", From 908df7f63fdaca0bec13977217af6051ef53719a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 19:46:10 +0200 Subject: [PATCH 039/130] Working on TravisCI --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 78c245ed700f..40249bd75a30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,8 @@ install: # install Composer dependencies - rm composer.lock - cat composer.json - - sed '/omnipay/mollie/d' filename.txt - - sed '/omnipay/2checkout/d' filename.txt + - sed -i '/mollie/d' composer.json + - sed -i '/2checkout/d' composer.json - cat composer.json - travis_retry composer install --prefer-dist; From 0380b951a5c0cd8c1bde09b393347bb80b9ce832 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 20:25:20 +0200 Subject: [PATCH 040/130] Working on TravisCI --- composer.json | 2 +- composer.lock | 184 ++++++++++++++++++++++++++------------------------ 2 files changed, 96 insertions(+), 90 deletions(-) diff --git a/composer.json b/composer.json index a338165ea034..740e501771d0 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "omnipay/bitpay": "dev-master", "guzzlehttp/guzzle": "~6.0", "laravelcollective/html": "~5.0", - "wildbit/laravel-postmark-provider": "dev-master", + "wildbit/laravel-postmark-provider": "2.0", "Dwolla/omnipay-dwolla": "dev-master", "laravel/socialite": "~2.0", "simshaun/recurr": "dev-master", diff --git a/composer.lock b/composer.lock index 28ae475dee18..7157dd51188c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "6e219bb4f5ffaf8423177bd6fccc89f8", - "content-hash": "4778ab164bfb93c4af1bb51c4320ea4c", + "hash": "cfae9eb02e70e68bef3b7a573b771cd1", + "content-hash": "9725ebe501b47a2dd80af2554009e32a", "packages": [ { "name": "agmscode/omnipay-agms", @@ -435,12 +435,12 @@ "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "aa8f772a46c35ecdcb7119f38772ac2ec952a941" + "reference": "4b8ba85b346fc9962521661aa639911535b2bb3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/aa8f772a46c35ecdcb7119f38772ac2ec952a941", - "reference": "aa8f772a46c35ecdcb7119f38772ac2ec952a941", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/4b8ba85b346fc9962521661aa639911535b2bb3f", + "reference": "4b8ba85b346fc9962521661aa639911535b2bb3f", "shasum": "" }, "require": { @@ -490,7 +490,7 @@ "phpstorm", "sublime" ], - "time": "2016-01-22 13:33:15" + "time": "2016-01-28 08:19:58" }, { "name": "cardgate/omnipay-cardgate", @@ -2555,12 +2555,12 @@ "source": { "type": "git", "url": "https://github.com/slampenny/Swaggervel.git", - "reference": "ea47fafde4984278e27a8044a1b1b0bcfd79130c" + "reference": "e026d72cacec8b2db8b2510179d73042f5e87bb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slampenny/Swaggervel/zipball/ea47fafde4984278e27a8044a1b1b0bcfd79130c", - "reference": "ea47fafde4984278e27a8044a1b1b0bcfd79130c", + "url": "https://api.github.com/repos/slampenny/Swaggervel/zipball/e026d72cacec8b2db8b2510179d73042f5e87bb9", + "reference": "e026d72cacec8b2db8b2510179d73042f5e87bb9", "shasum": "" }, "require": { @@ -2592,7 +2592,7 @@ "laravel", "swagger" ], - "time": "2015-08-18 15:33:39" + "time": "2016-01-25 15:38:17" }, { "name": "jsanc623/phpbenchtime", @@ -2786,16 +2786,16 @@ }, { "name": "laravel/framework", - "version": "v5.0.34", + "version": "v5.0.35", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "98dbaafe8e2781f86b1b858f8610be0d7318b153" + "reference": "37151cf533f468e2227605e4b9ac596154f6b92b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/98dbaafe8e2781f86b1b858f8610be0d7318b153", - "reference": "98dbaafe8e2781f86b1b858f8610be0d7318b153", + "url": "https://api.github.com/repos/laravel/framework/zipball/37151cf533f468e2227605e4b9ac596154f6b92b", + "reference": "37151cf533f468e2227605e4b9ac596154f6b92b", "shasum": "" }, "require": { @@ -2908,7 +2908,7 @@ "framework", "laravel" ], - "time": "2015-12-04 23:20:49" + "time": "2016-02-02 14:55:52" }, { "name": "laravel/socialite", @@ -3284,12 +3284,12 @@ "source": { "type": "git", "url": "https://github.com/lokielse/omnipay-alipay.git", - "reference": "f39ce21a5cbfe5c7cd4108d264b398dbd42be05b" + "reference": "0b091a199f1ffce95582f5e11efcf4a8ffd90ec8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lokielse/omnipay-alipay/zipball/f39ce21a5cbfe5c7cd4108d264b398dbd42be05b", - "reference": "f39ce21a5cbfe5c7cd4108d264b398dbd42be05b", + "url": "https://api.github.com/repos/lokielse/omnipay-alipay/zipball/0b091a199f1ffce95582f5e11efcf4a8ffd90ec8", + "reference": "0b091a199f1ffce95582f5e11efcf4a8ffd90ec8", "shasum": "" }, "require": { @@ -3325,7 +3325,7 @@ "payment", "purchase" ], - "time": "2016-01-19 15:08:12" + "time": "2016-01-27 17:06:44" }, { "name": "maatwebsite/excel", @@ -3701,23 +3701,23 @@ }, { "name": "mtdowling/cron-expression", - "version": "v1.0.4", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/mtdowling/cron-expression.git", - "reference": "fd92e883195e5dfa77720b1868cf084b08be4412" + "reference": "c9ee7886f5a12902b225a1a12f36bb45f9ab89e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/fd92e883195e5dfa77720b1868cf084b08be4412", - "reference": "fd92e883195e5dfa77720b1868cf084b08be4412", + "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/c9ee7886f5a12902b225a1a12f36bb45f9ab89e5", + "reference": "c9ee7886f5a12902b225a1a12f36bb45f9ab89e5", "shasum": "" }, "require": { "php": ">=5.3.2" }, "require-dev": { - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "~4.0|~5.0" }, "type": "library", "autoload": { @@ -3741,7 +3741,7 @@ "cron", "schedule" ], - "time": "2015-01-11 23:07:46" + "time": "2016-01-26 21:23:30" }, { "name": "nesbot/carbon", @@ -5279,16 +5279,16 @@ }, { "name": "omnipay/sagepay", - "version": "2.3.0", + "version": "2.3.1", "source": { "type": "git", "url": "https://github.com/thephpleague/omnipay-sagepay.git", - "reference": "4208d23b33b2f8a59176e44ad22d304c461ecb62" + "reference": "ca992b28a0d7ec7dbf218852dab36ec309dee07e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/omnipay-sagepay/zipball/4208d23b33b2f8a59176e44ad22d304c461ecb62", - "reference": "4208d23b33b2f8a59176e44ad22d304c461ecb62", + "url": "https://api.github.com/repos/thephpleague/omnipay-sagepay/zipball/ca992b28a0d7ec7dbf218852dab36ec309dee07e", + "reference": "ca992b28a0d7ec7dbf218852dab36ec309dee07e", "shasum": "" }, "require": { @@ -5334,7 +5334,7 @@ "sage pay", "sagepay" ], - "time": "2016-01-12 12:43:31" + "time": "2016-02-07 13:25:23" }, { "name": "omnipay/securepay", @@ -5509,16 +5509,16 @@ }, { "name": "omnipay/worldpay", - "version": "v2.1.1", + "version": "v2.2", "source": { "type": "git", "url": "https://github.com/thephpleague/omnipay-worldpay.git", - "reference": "5353f02b7f800b93d8aeae606d6df09afa538457" + "reference": "26ead4ca2c6ec45c9a3b3dad0be8880e0b1df083" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/omnipay-worldpay/zipball/5353f02b7f800b93d8aeae606d6df09afa538457", - "reference": "5353f02b7f800b93d8aeae606d6df09afa538457", + "url": "https://api.github.com/repos/thephpleague/omnipay-worldpay/zipball/26ead4ca2c6ec45c9a3b3dad0be8880e0b1df083", + "reference": "26ead4ca2c6ec45c9a3b3dad0be8880e0b1df083", "shasum": "" }, "require": { @@ -5562,20 +5562,20 @@ "payment", "worldpay" ], - "time": "2014-09-17 00:37:18" + "time": "2016-01-28 12:55:58" }, { "name": "paragonie/random_compat", - "version": "1.1.5", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "dd8998b7c846f6909f4e7a5f67fabebfc412a4f7" + "reference": "b0e69d10852716b2ccbdff69c75c477637220790" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/dd8998b7c846f6909f4e7a5f67fabebfc412a4f7", - "reference": "dd8998b7c846f6909f4e7a5f67fabebfc412a4f7", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/b0e69d10852716b2ccbdff69c75c477637220790", + "reference": "b0e69d10852716b2ccbdff69c75c477637220790", "shasum": "" }, "require": { @@ -5610,7 +5610,7 @@ "pseudorandom", "random" ], - "time": "2016-01-06 13:31:20" + "time": "2016-02-06 03:52:05" }, { "name": "patricktalmadge/bootstrapper", @@ -6158,23 +6158,27 @@ }, { "name": "symfony/class-loader", - "version": "v3.0.1", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "6294f616bb9888ba2e13c8bfdcc4d306c1c95da7" + "reference": "92e7cf1af2bc1695daabb4ac972db169606e9030" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/6294f616bb9888ba2e13c8bfdcc4d306c1c95da7", - "reference": "6294f616bb9888ba2e13c8bfdcc4d306c1c95da7", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/92e7cf1af2bc1695daabb4ac972db169606e9030", + "reference": "92e7cf1af2bc1695daabb4ac972db169606e9030", "shasum": "" }, "require": { "php": ">=5.5.9" }, "require-dev": { - "symfony/finder": "~2.8|~3.0" + "symfony/finder": "~2.8|~3.0", + "symfony/polyfill-apcu": "~1.1" + }, + "suggest": { + "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM" }, "type": "library", "extra": { @@ -6206,7 +6210,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2015-12-05 17:45:07" + "time": "2016-02-03 09:33:23" }, { "name": "symfony/console", @@ -6673,16 +6677,16 @@ }, { "name": "symfony/polyfill-php56", - "version": "v1.0.1", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "e2e77609a9e2328eb370fbb0e0d8b2000ebb488f" + "reference": "4d891fff050101a53a4caabb03277284942d1ad9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/e2e77609a9e2328eb370fbb0e0d8b2000ebb488f", - "reference": "e2e77609a9e2328eb370fbb0e0d8b2000ebb488f", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/4d891fff050101a53a4caabb03277284942d1ad9", + "reference": "4d891fff050101a53a4caabb03277284942d1ad9", "shasum": "" }, "require": { @@ -6692,7 +6696,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.1-dev" } }, "autoload": { @@ -6725,20 +6729,20 @@ "portable", "shim" ], - "time": "2015-12-18 15:10:25" + "time": "2016-01-20 09:13:37" }, { "name": "symfony/polyfill-util", - "version": "v1.0.1", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-util.git", - "reference": "4271c55cbc0a77b2641f861b978123e46b3da969" + "reference": "8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/4271c55cbc0a77b2641f861b978123e46b3da969", - "reference": "4271c55cbc0a77b2641f861b978123e46b3da969", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4", + "reference": "8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4", "shasum": "" }, "require": { @@ -6747,7 +6751,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.1-dev" } }, "autoload": { @@ -6777,7 +6781,7 @@ "polyfill", "shim" ], - "time": "2015-11-04 20:28:58" + "time": "2016-01-20 09:13:37" }, { "name": "symfony/process", @@ -7374,7 +7378,7 @@ }, { "name": "wildbit/laravel-postmark-provider", - "version": "dev-master", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/wildbit/laravel-postmark-provider.git", @@ -7448,16 +7452,16 @@ }, { "name": "zircote/swagger-php", - "version": "2.0.5", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/zircote/swagger-php.git", - "reference": "c19af4edcc13c00e82fabeee926335b1fe1d92e9" + "reference": "0dfc289d53bad4a2bd193adc8d4bd058029ab417" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/c19af4edcc13c00e82fabeee926335b1fe1d92e9", - "reference": "c19af4edcc13c00e82fabeee926335b1fe1d92e9", + "url": "https://api.github.com/repos/zircote/swagger-php/zipball/0dfc289d53bad4a2bd193adc8d4bd058029ab417", + "reference": "0dfc289d53bad4a2bd193adc8d4bd058029ab417", "shasum": "" }, "require": { @@ -7466,6 +7470,7 @@ "symfony/finder": "*" }, "require-dev": { + "squizlabs/php_codesniffer": "2.*", "zendframework/zend-form": "*" }, "bin": [ @@ -7504,26 +7509,26 @@ "rest", "service discovery" ], - "time": "2016-01-15 09:39:28" + "time": "2016-02-13 15:39:11" } ], "packages-dev": [ { "name": "codeception/c3", - "version": "2.0.5", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/Codeception/c3.git", - "reference": "b866ca528474ddcf74147531cc4e50b80257a5f8" + "reference": "dc4d39b36d585c2eda58129407e78855ea67b1ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/c3/zipball/b866ca528474ddcf74147531cc4e50b80257a5f8", - "reference": "b866ca528474ddcf74147531cc4e50b80257a5f8", + "url": "https://api.github.com/repos/Codeception/c3/zipball/dc4d39b36d585c2eda58129407e78855ea67b1ca", + "reference": "dc4d39b36d585c2eda58129407e78855ea67b1ca", "shasum": "" }, "require": { - "composer-plugin-api": "1.0.0", + "composer-plugin-api": "^1.0", "php": ">=5.4.0" }, "type": "composer-plugin", @@ -7556,7 +7561,7 @@ "code coverage", "codecoverage" ], - "time": "2015-11-28 10:17:10" + "time": "2016-02-09 23:31:08" }, { "name": "codeception/codeception", @@ -7901,22 +7906,24 @@ }, { "name": "phpspec/prophecy", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" + "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", + "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" + "sebastian/comparator": "~1.1", + "sebastian/recursion-context": "~1.0" }, "require-dev": { "phpspec/phpspec": "~2.0" @@ -7924,7 +7931,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.5.x-dev" } }, "autoload": { @@ -7957,7 +7964,7 @@ "spy", "stub" ], - "time": "2015-08-13 10:07:40" + "time": "2016-02-15 07:46:21" }, { "name": "phpunit/php-code-coverage", @@ -8201,16 +8208,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.21", + "version": "4.8.23", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ea76b17bced0500a28098626b84eda12dbcf119c" + "reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea76b17bced0500a28098626b84eda12dbcf119c", - "reference": "ea76b17bced0500a28098626b84eda12dbcf119c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6e351261f9cd33daf205a131a1ba61c6d33bd483", + "reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483", "shasum": "" }, "require": { @@ -8269,7 +8276,7 @@ "testing", "xunit" ], - "time": "2015-12-12 07:45:58" + "time": "2016-02-11 14:56:33" }, { "name": "phpunit/phpunit-mock-objects", @@ -8813,16 +8820,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.0.1", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25" + "reference": "1289d16209491b584839022f29257ad859b8532d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/49ff736bd5d41f45240cec77b44967d76e0c3d25", - "reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d", + "reference": "1289d16209491b584839022f29257ad859b8532d", "shasum": "" }, "require": { @@ -8834,7 +8841,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.1-dev" } }, "autoload": { @@ -8868,7 +8875,7 @@ "portable", "shim" ], - "time": "2015-11-20 09:19:13" + "time": "2016-01-20 09:13:37" }, { "name": "symfony/yaml", @@ -8935,7 +8942,6 @@ "alfaproject/omnipay-neteller": 20, "alfaproject/omnipay-skrill": 20, "omnipay/bitpay": 20, - "wildbit/laravel-postmark-provider": 20, "dwolla/omnipay-dwolla": 20, "simshaun/recurr": 20, "meebio/omnipay-creditcall": 20, From f5bb3d3f1b1416952ecb8e4eeaaf185e85745be0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 20:37:00 +0200 Subject: [PATCH 041/130] Working on TravisCI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 40249bd75a30..1cd1811007d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,7 @@ install: before_script: # copy configuration files - cp tests/_bootstrap.php.default tests/_bootstrap.php - - cp tests/.env.circleci .env + - cp tests/.env.example .env # create the database and user - mysql -u root -e "create database IF NOT EXISTS ninja;" - mysql -u root -e "GRANT ALL PRIVILEGES ON ninja.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;" From 331b117189a99902dd283a3153d5f476296cad68 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 20:59:24 +0200 Subject: [PATCH 042/130] Fix for #713 --- app/Models/Invoice.php | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 8c34b40deed1..b8d31b97e7dd 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -733,40 +733,18 @@ class Invoice extends EntityModel implements BalanceAffecting $invitation = $this->invitations[0]; $link = $invitation->getLink(); + $key = env('PHANTOMJS_CLOUD_KEY'); $curl = curl_init(); if (Utils::isNinjaDev()) { $link = env('TEST_LINK'); } - $jsonEncodedData = json_encode([ - 'url' => "{$link}?phantomjs=true", - 'renderType' => 'html', - 'outputAsJson' => false, - 'renderSettings' => [ - 'passThroughHeaders' => true, - ], - // 'delayTime' => 1000, - ]); - - $opts = [ - CURLOPT_URL => PHANTOMJS_CLOUD . env('PHANTOMJS_CLOUD_KEY') . '/', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_CUSTOMREQUEST => 'POST', - CURLOPT_POST => 1, - CURLOPT_POSTFIELDS => $jsonEncodedData, - CURLOPT_HTTPHEADER => [ - 'Content-Type: application/json', - 'Content-Length: '.strlen($jsonEncodedData) - ], - ]; - - curl_setopt_array($curl, $opts); - $response = curl_exec($curl); - curl_close($curl); - - $pdfString = strip_tags($response); - + $url = "http://api.phantomjscloud.com/api/browser/v2/{$key}/?request=%7Burl:%22{$link}?phantomjs=true%22,renderType:%22html%22%7D"; + + $pdfString = file_get_contents($url); + $pdfString = strip_tags($pdfString); + if ( ! $pdfString || strlen($pdfString) < 200) { Utils::logError("PhantomJSCloud - failed to create pdf: {$pdfString}"); return false; From cc27e5278ff848176af64da768aab1b1acb716c5 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 21:01:38 +0200 Subject: [PATCH 043/130] Working on TravisCI --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1cd1811007d4..cbb5d85cac24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,6 @@ install: before_script: # copy configuration files - cp tests/_bootstrap.php.default tests/_bootstrap.php - - cp tests/.env.example .env # create the database and user - mysql -u root -e "create database IF NOT EXISTS ninja;" - mysql -u root -e "GRANT ALL PRIVILEGES ON ninja.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;" From ed941fef8983bde4b2cfd04eb0a87de81584c895 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 21:13:55 +0200 Subject: [PATCH 044/130] Enabled downloading PDF through route --- app/Http/Controllers/PublicClientController.php | 8 +++++++- app/Models/Invoice.php | 2 +- app/Ninja/Mailers/ContactMailer.php | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/PublicClientController.php b/app/Http/Controllers/PublicClientController.php index f52e850e5826..9d806061d88c 100644 --- a/app/Http/Controllers/PublicClientController.php +++ b/app/Http/Controllers/PublicClientController.php @@ -174,7 +174,13 @@ class PublicClientController extends BaseController $invoice = $invitation->invoice; $pdfString = $invoice->getPDFString(); - dd($pdfString); + header('Content-Type: application/pdf'); + header('Content-Length: ' . strlen($pdfString)); + header('Content-disposition: attachment; filename="' . $invoice->getFileName() . '"'); + header('Cache-Control: public, must-revalidate, max-age=0'); + header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + + return $pdfString; } public function dashboard() diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index b8d31b97e7dd..4e15934efeb3 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -750,7 +750,7 @@ class Invoice extends EntityModel implements BalanceAffecting return false; } - return $pdfString; + return Utils::decodePDF($pdfString); } } diff --git a/app/Ninja/Mailers/ContactMailer.php b/app/Ninja/Mailers/ContactMailer.php index 6d588de3439e..dc513c3e8822 100644 --- a/app/Ninja/Mailers/ContactMailer.php +++ b/app/Ninja/Mailers/ContactMailer.php @@ -56,7 +56,7 @@ class ContactMailer extends Mailer $sent = false; if ($account->attatchPDF() && !$pdfString) { - $pdfString = Utils::decodePDF($invoice->getPDFString()); + $pdfString = $invoice->getPDFString(); } foreach ($invoice->invitations as $invitation) { @@ -184,7 +184,7 @@ class ContactMailer extends Mailer ]; if ($account->attatchPDF()) { - $data['pdfString'] = Utils::decodePDF($invoice->getPDFString()); + $data['pdfString'] = $invoice->getPDFString(); $data['pdfFileName'] = $invoice->getFileName(); } From f633e311c5325d405a270a235a85d48a2e17d07b Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 21:17:06 +0200 Subject: [PATCH 045/130] Working on TravisCI --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index cbb5d85cac24..da6d5df9b65c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,7 @@ install: before_script: # copy configuration files + - cp .env.example .env - cp tests/_bootstrap.php.default tests/_bootstrap.php # create the database and user - mysql -u root -e "create database IF NOT EXISTS ninja;" From 4defbaaf6486dfa4810e34b7f49b6b407713d19b Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 21:18:06 +0200 Subject: [PATCH 046/130] Working on TravisCI --- .env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 1dc6d99bd419..f1c0d2860057 100644 --- a/.env.example +++ b/.env.example @@ -8,8 +8,8 @@ DB_TYPE=mysql DB_STRICT=false DB_HOST=localhost DB_DATABASE=ninja -DB_USERNAME -DB_PASSWORD +DB_USERNAME=ninja +DB_PASSWORD=ninja MAIL_DRIVER=smtp MAIL_PORT=587 From aaf4005b877acb40259cc48e621304fe58681ea8 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 21:22:53 +0200 Subject: [PATCH 047/130] Working on TravisCI --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index da6d5df9b65c..d28d8f4437a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,13 +49,13 @@ before_script: - php artisan db:seed --no-interaction # default seed - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed # Start webserver on ninja.dev:8000 - - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background + - php artisan serve --host=ninja.dev & # '&' allows to run in background # Start PhantomJS - phantomjs --webdriver=4444 & # '&' allows to run in background # Give it some time to start - sleep 5 # Make sure the app is up-to-date - - curl -L http://ninja.dev:8000/update + - curl -L http://ninja.dev/update script: - php ./vendor/codeception/codeception/codecept run --html --debug From 4e855e5caa5750a4f63926b158899f79fbb69659 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 21:26:52 +0200 Subject: [PATCH 048/130] Working on TravisCI --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d28d8f4437a7..f991cbc26492 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,11 @@ before_install: install: # install Composer dependencies - - rm composer.lock - - cat composer.json + #- rm composer.lock + #- cat composer.json - sed -i '/mollie/d' composer.json - sed -i '/2checkout/d' composer.json - - cat composer.json + #- cat composer.json - travis_retry composer install --prefer-dist; before_script: @@ -49,7 +49,7 @@ before_script: - php artisan db:seed --no-interaction # default seed - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed # Start webserver on ninja.dev:8000 - - php artisan serve --host=ninja.dev & # '&' allows to run in background + - php artisan serve --host=ninja.dev --port=80 & # '&' allows to run in background # Start PhantomJS - phantomjs --webdriver=4444 & # '&' allows to run in background # Give it some time to start From 62805989104d7bde6075e7285a28b8cba958609d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 21:28:36 +0200 Subject: [PATCH 049/130] Working on TravisCI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f991cbc26492..3254aa01cc60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ before_install: install: # install Composer dependencies - #- rm composer.lock + - rm composer.lock #- cat composer.json - sed -i '/mollie/d' composer.json - sed -i '/2checkout/d' composer.json From 7b735b9798b47f0de94645adfee0436464dda96d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 21:33:15 +0200 Subject: [PATCH 050/130] Hide action for main user in datatable --- app/Services/DatatableService.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Services/DatatableService.php b/app/Services/DatatableService.php index 5a1fd279aebb..63fe47005bab 100644 --- a/app/Services/DatatableService.php +++ b/app/Services/DatatableService.php @@ -41,6 +41,7 @@ class DatatableService private function createDropdown($entityType, $table, $actions) { $table->addColumn('dropdown', function ($model) use ($entityType, $actions) { + $hasAction = false; $str = '
'; if (property_exists($model, 'is_deleted') && $model->is_deleted) { @@ -70,6 +71,7 @@ class DatatableService if ($visible($model)) { $str .= "
  • {$value}
  • "; $lastIsDivider = false; + $hasAction = true; } } elseif ( ! $lastIsDivider) { $str .= "
  • "; @@ -77,6 +79,10 @@ class DatatableService } } + if ( ! $hasAction) { + return ''; + } + if ( ! $lastIsDivider) { $str .= "
  • "; } From d651006ca13793e62258f960f06f2c3f73615bd3 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 21:34:29 +0200 Subject: [PATCH 051/130] Working on TravisCI --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3254aa01cc60..267f904747ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,10 +31,9 @@ before_install: install: # install Composer dependencies - rm composer.lock - #- cat composer.json + # these providers require referencing git commit's which cause Travis to fail - sed -i '/mollie/d' composer.json - sed -i '/2checkout/d' composer.json - #- cat composer.json - travis_retry composer install --prefer-dist; before_script: @@ -49,13 +48,13 @@ before_script: - php artisan db:seed --no-interaction # default seed - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed # Start webserver on ninja.dev:8000 - - php artisan serve --host=ninja.dev --port=80 & # '&' allows to run in background + - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS - phantomjs --webdriver=4444 & # '&' allows to run in background # Give it some time to start - sleep 5 # Make sure the app is up-to-date - - curl -L http://ninja.dev/update + - curl -L http://ninja.dev:8000/update script: - php ./vendor/codeception/codeception/codecept run --html --debug From 21e178477c18ac4f7f39b1ffd397641b5a01ef75 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 21:41:14 +0200 Subject: [PATCH 052/130] Working on TravisCI --- codeception.yml | 2 +- tests/acceptance.suite.yml | 4 ++-- tests/functional.suite.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codeception.yml b/codeception.yml index dfbb0d47bbb3..87ecbd1fc806 100644 --- a/codeception.yml +++ b/codeception.yml @@ -19,7 +19,7 @@ extensions: modules: config: Db: - dsn: 'mysql:dbname=ninja;host=localhost;' + dsn: 'mysql:dbname=ninja;host=127.0.0.1;' user: 'ninja' password: 'ninja' dump: tests/_data/dump.sql diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 55d30947381d..0f5d2c3cdcd8 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -8,7 +8,7 @@ class_name: AcceptanceTester modules: enabled: - WebDriver: - url: 'http://ninja.dev/' + url: 'http://ninja.dev:8000/' host: 127.0.0.1 window_size: 1024x768 wait: 5 @@ -17,7 +17,7 @@ modules: unexpectedAlertBehaviour: 'accept' webStorageEnabled: true - Db: - dsn: 'mysql:dbname=ninja;host=localhost;' + dsn: 'mysql:dbname=ninja;host=127.0.0.1;' user: 'ninja' password: 'ninja' dump: tests/_data/dump.sql diff --git a/tests/functional.suite.yml b/tests/functional.suite.yml index 7c84b1000840..b89e2023daba 100644 --- a/tests/functional.suite.yml +++ b/tests/functional.suite.yml @@ -9,7 +9,7 @@ modules: enabled: - \Helper\Functional - PhpBrowser: - url: 'http://ninja.dev' + url: 'http://ninja.dev:8000' curl: CURLOPT_RETURNTRANSFER: true - Laravel5: From 92532c3a636ce2de2636a346a0bf2b9d1c9fd3a2 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 21:47:46 +0200 Subject: [PATCH 053/130] Working on TravisCI --- tests/_bootstrap.php.default | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/_bootstrap.php.default b/tests/_bootstrap.php.default index 193f2f90f10c..cf7248e7f5f2 100644 --- a/tests/_bootstrap.php.default +++ b/tests/_bootstrap.php.default @@ -5,4 +5,5 @@ use Codeception\Util\Fixtures; Fixtures::add('username', 'user@example.com'); Fixtures::add('password', 'password'); -Fixtures::add('gateway_key', ''); \ No newline at end of file +Fixtures::add('gateway_key', ''); +Fixtures::add('api_secret', 'password'); \ No newline at end of file From 168e318a79709882ca8f6603d4f469c9a0be5cf8 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 21:58:50 +0200 Subject: [PATCH 054/130] Working on TravisCI --- tests/_bootstrap.php.default | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/_bootstrap.php.default b/tests/_bootstrap.php.default index cf7248e7f5f2..907d22bf6eb9 100644 --- a/tests/_bootstrap.php.default +++ b/tests/_bootstrap.php.default @@ -2,6 +2,7 @@ // This is global bootstrap for autoloading use Codeception\Util\Fixtures; +Fixtures::add('url', 'http://ninja.dev:8000'); Fixtures::add('username', 'user@example.com'); Fixtures::add('password', 'password'); From 9f6aa99e860408176d3c1fd92b1094cfc3394deb Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 22:02:14 +0200 Subject: [PATCH 055/130] Working on TravisCI --- tests/_bootstrap.php.default | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/_bootstrap.php.default b/tests/_bootstrap.php.default index 907d22bf6eb9..19fc7eba0df7 100644 --- a/tests/_bootstrap.php.default +++ b/tests/_bootstrap.php.default @@ -6,5 +6,6 @@ Fixtures::add('url', 'http://ninja.dev:8000'); Fixtures::add('username', 'user@example.com'); Fixtures::add('password', 'password'); -Fixtures::add('gateway_key', ''); -Fixtures::add('api_secret', 'password'); \ No newline at end of file +Fixtures::add('api_secret', 'password'); +Fixtures::add('secret_key', ''); +Fixtures::add('publishable_key', ''); \ No newline at end of file From f5d008a607a872d80a7249e396ff7053392abdd3 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 22:08:57 +0200 Subject: [PATCH 056/130] Working on TravisCI --- tests/acceptance/APICest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/acceptance/APICest.php b/tests/acceptance/APICest.php index 0260ac75056f..fcd3cc4fb442 100644 --- a/tests/acceptance/APICest.php +++ b/tests/acceptance/APICest.php @@ -117,6 +117,8 @@ class APICest $response = curl_exec($curl); curl_close($curl); + Debug::debug('Response: ' . $response); + return json_decode($response); } } \ No newline at end of file From 19fb2b1c77f3db9061f0c96ca74d255517cf781f Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 22:11:18 +0200 Subject: [PATCH 057/130] Working on TravisCI --- .env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.example b/.env.example index f1c0d2860057..20c977c663e9 100644 --- a/.env.example +++ b/.env.example @@ -23,6 +23,7 @@ MAIL_PASSWORD PHANTOMJS_CLOUD_KEY='a-demo-key-with-low-quota-per-ip-address' LOG=single REQUIRE_HTTPS=false +API_SECRET=password GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET From 203090820cda4e430b3a96125ad216a4ec3e2e18 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 22:17:55 +0200 Subject: [PATCH 058/130] Working on TravisCI --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 267f904747ab..82b5ee71a360 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,6 +40,7 @@ before_script: # copy configuration files - cp .env.example .env - cp tests/_bootstrap.php.default tests/_bootstrap.php + - php artisan key:generate --no-interaction # create the database and user - mysql -u root -e "create database IF NOT EXISTS ninja;" - mysql -u root -e "GRANT ALL PRIVILEGES ON ninja.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;" From 5876f41934a53fe3cdeef8ce0cf28d1ad4f649c0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 22:23:01 +0200 Subject: [PATCH 059/130] Working on TravisCI --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 82b5ee71a360..5b783ffaa443 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,6 +48,7 @@ before_script: - php artisan migrate --no-interaction - php artisan db:seed --no-interaction # default seed - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed + - mysql -u root -e "use ninja;select email from users;" # Start webserver on ninja.dev:8000 - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS From c69b9d3be0033c35dd7b44dab1b444037282677e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 22:32:26 +0200 Subject: [PATCH 060/130] Working on TravisCI --- .travis.yml | 2 +- resources/views/reports/d3.blade.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5b783ffaa443..0eaf689b5085 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,7 @@ before_script: - cp .env.example .env - cp tests/_bootstrap.php.default tests/_bootstrap.php - php artisan key:generate --no-interaction + - sed -i 's/APP_ENV=production/APP_ENV=development/g' .env # create the database and user - mysql -u root -e "create database IF NOT EXISTS ninja;" - mysql -u root -e "GRANT ALL PRIVILEGES ON ninja.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;" @@ -48,7 +49,6 @@ before_script: - php artisan migrate --no-interaction - php artisan db:seed --no-interaction # default seed - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed - - mysql -u root -e "use ninja;select email from users;" # Start webserver on ninja.dev:8000 - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS diff --git a/resources/views/reports/d3.blade.php b/resources/views/reports/d3.blade.php index 6685441321ce..db3f05788c10 100644 --- a/resources/views/reports/d3.blade.php +++ b/resources/views/reports/d3.blade.php @@ -233,7 +233,7 @@ .attr("class", "no-pointer-events") .attr("class", "animate-grow") .attr("d", arc) - .style("fill", function(d, i) { return 'grey'; }); + .style("fill", function(d, i) { return '#2e9e49'; }); d3.selectAll("path.animate-grow") .transition() @@ -245,7 +245,8 @@ .transition() .duration(1000) .style("fill", function(d, i) { - return d.displayAge == -1 ? 'grey' : color(d.displayAge); + //return d.displayAge == -1 ? 'grey' : color(d.displayAge); + return d.displayAge == -1 ? 'grey' : '#FF0000'; }); selection.exit().remove(); From 47b7a00f50561a74dc00a07258c3b64dfc38de19 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 22:42:31 +0200 Subject: [PATCH 061/130] Working on TravisCI --- .travis.yml | 4 ++++ resources/views/reports/d3.blade.php | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0eaf689b5085..d5a8ebc32f1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,6 +61,10 @@ before_script: script: - php ./vendor/codeception/codeception/codecept run --html --debug +after_script: + - cat storage/logs/laravel.log + + notifications: email: on_success: never diff --git a/resources/views/reports/d3.blade.php b/resources/views/reports/d3.blade.php index db3f05788c10..e4e9af2c2495 100644 --- a/resources/views/reports/d3.blade.php +++ b/resources/views/reports/d3.blade.php @@ -126,6 +126,7 @@ //console.log(JSON.stringify(invoices)); //console.log(JSON.stringify(products)); + /* var arc = d3.svg.arc() .innerRadius(function(d) { return d.r - 2 }) .outerRadius(function(d) { return d.r - 8 }) @@ -136,7 +137,18 @@ .outerRadius(function(d) { return d.r - 7 }) .startAngle(0) .endAngle(2 * Math.PI); + */ + var arc = d3.svg.arc() + .innerRadius(function(d) { return d.r }) + .outerRadius(function(d) { return d.r - 6 }) + .startAngle(0); + + var fullArc = d3.svg.arc() + .innerRadius(function(d) { return d.r }) + .outerRadius(function(d) { return d.r - 6 }) + .startAngle(0) + .endAngle(2 * Math.PI); var diameter = 800, format = d3.format(",d"); @@ -245,8 +257,7 @@ .transition() .duration(1000) .style("fill", function(d, i) { - //return d.displayAge == -1 ? 'grey' : color(d.displayAge); - return d.displayAge == -1 ? 'grey' : '#FF0000'; + return d.displayAge == -1 ? 'white' : 'red'; }); selection.exit().remove(); From 4800c18eb166990c96a27261f09724e59a5e33c5 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 22:46:02 +0200 Subject: [PATCH 062/130] Changed dataviz to red/green --- resources/views/reports/d3.blade.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/resources/views/reports/d3.blade.php b/resources/views/reports/d3.blade.php index e4e9af2c2495..b9548fee7c3a 100644 --- a/resources/views/reports/d3.blade.php +++ b/resources/views/reports/d3.blade.php @@ -126,27 +126,14 @@ //console.log(JSON.stringify(invoices)); //console.log(JSON.stringify(products)); - /* - var arc = d3.svg.arc() - .innerRadius(function(d) { return d.r - 2 }) - .outerRadius(function(d) { return d.r - 8 }) - .startAngle(0); - - var fullArc = d3.svg.arc() - .innerRadius(function(d) { return d.r - 3 }) - .outerRadius(function(d) { return d.r - 7 }) - .startAngle(0) - .endAngle(2 * Math.PI); - */ - var arc = d3.svg.arc() .innerRadius(function(d) { return d.r }) - .outerRadius(function(d) { return d.r - 6 }) + .outerRadius(function(d) { return d.r - 5 }) .startAngle(0); var fullArc = d3.svg.arc() .innerRadius(function(d) { return d.r }) - .outerRadius(function(d) { return d.r - 6 }) + .outerRadius(function(d) { return d.r - 5 }) .startAngle(0) .endAngle(2 * Math.PI); From b63f26f10bfc56d16df997fa91bfe097c1d070c5 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 22:49:34 +0200 Subject: [PATCH 063/130] Working on TravisCI --- .travis.yml | 1 + app/Http/Controllers/InvoiceApiController.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d5a8ebc32f1f..4bdcc265fb53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,7 @@ before_script: - cp tests/_bootstrap.php.default tests/_bootstrap.php - php artisan key:generate --no-interaction - sed -i 's/APP_ENV=production/APP_ENV=development/g' .env + - sed -i 's/APP_DEBUG=false/APP_DEBUG=true/g' .env # create the database and user - mysql -u root -e "create database IF NOT EXISTS ninja;" - mysql -u root -e "GRANT ALL PRIVILEGES ON ninja.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;" diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index 8c4344f608b6..2ba39cd77651 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -280,7 +280,7 @@ class InvoiceApiController extends BaseAPIController private function prepareItem($item) { // if only the product key is set we'll load the cost and notes - if ($item['product_key'] && empty($item['cost']) && empty($item['notes'])) { + if (!empty($item['product_key']) && empty($item['cost']) && empty($item['notes'])) { $product = Product::findProductByKey($item['product_key']); if ($product) { if (empty($item['cost'])) { From 5c8b4f4ba394f0b8e13eb18ba0ce46cd0e60fef8 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 17 Feb 2016 22:59:06 +0200 Subject: [PATCH 064/130] Changed dataviz to red/green --- tests/acceptance.suite.yml | 2 +- tests/acceptance/APICest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 0f5d2c3cdcd8..4a152dce6eff 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -8,7 +8,7 @@ class_name: AcceptanceTester modules: enabled: - WebDriver: - url: 'http://ninja.dev:8000/' + url: 'http://ninja.dev:8000' host: 127.0.0.1 window_size: 1024x768 wait: 5 diff --git a/tests/acceptance/APICest.php b/tests/acceptance/APICest.php index fcd3cc4fb442..66d0f74bf72c 100644 --- a/tests/acceptance/APICest.php +++ b/tests/acceptance/APICest.php @@ -117,7 +117,7 @@ class APICest $response = curl_exec($curl); curl_close($curl); - Debug::debug('Response: ' . $response); + //Debug::debug('Response: ' . $response); return json_decode($response); } From 780cbbcee20112a3b0f73bd5c88a9f3c17fff531 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 09:20:53 +0200 Subject: [PATCH 065/130] Changed dataviz to red/green --- tests/_support/AcceptanceTester.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php index fd89ac0d0de0..2bc4e1783f90 100644 --- a/tests/_support/AcceptanceTester.php +++ b/tests/_support/AcceptanceTester.php @@ -29,6 +29,7 @@ class AcceptanceTester extends \Codeception\Actor //if ($I->loadSessionSnapshot('login')) return; $I->amOnPage('/login'); + $I->see('Login'); $I->fillField(['name' => 'email'], Fixtures::get('username')); $I->fillField(['name' => 'password'], Fixtures::get('password')); $I->click('Login'); From 5b024b23a7a31c16e725d35fc0b626bae3f8ccea Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 09:50:11 +0200 Subject: [PATCH 066/130] Changed dataviz to red/green --- .travis.yml | 5 +++++ resources/lang/en/texts.php | 35 ++++++++--------------------------- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4bdcc265fb53..089965095797 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,11 @@ before_install: # set GitHub token and update composer - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; - composer self-update && composer -V + # fix for phantomjs + - mkdir travis-phantomjs + - wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 + - tar -xvf $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs + - export PATH=$PWD/travis-phantomjs:$PATH install: # install Composer dependencies diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 63ac704fe8e1..ace0aba384e8 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -1,8 +1,6 @@ 'Organization', 'name' => 'Name', 'website' => 'Website', @@ -26,7 +24,6 @@ return array( 'industry_id' => 'Industry', 'private_notes' => 'Private Notes', - // invoice 'invoice' => 'Invoice', 'client' => 'Client', 'invoice_date' => 'Invoice Date', @@ -75,7 +72,6 @@ return array( 'enable_invoice_tax' => 'Enable specifying an invoice tax', 'enable_line_item_tax' => 'Enable specifying line item taxes', - // navigation 'dashboard' => 'Dashboard', 'clients' => 'Clients', 'invoices' => 'Invoices', @@ -101,7 +97,6 @@ return array( 'powered_by' => 'Powered by', 'no_items' => 'No items', - // recurring invoices 'recurring_invoices' => 'Recurring Invoices', 'recurring_help' => '

    Automatically send clients the same invoices weekly, bi-monthly, monthly, quarterly or annually.

    Use :MONTH, :QUARTER or :YEAR for dynamic dates. Basic math works as well, for example :MONTH-1.

    @@ -112,7 +107,6 @@ return array(
  • "Retainer payment for :QUARTER+1" => "Retainer payment for Q2"
  • ', - // dashboard 'in_total_revenue' => 'in total revenue', 'billed_client' => 'billed client', 'billed_clients' => 'billed clients', @@ -122,7 +116,6 @@ return array( 'upcoming_invoices' => 'Upcoming Invoices', 'average_invoice' => 'Average Invoice', - // list pages 'archive' => 'Archive', 'delete' => 'Delete', 'archive_client' => 'Archive Client', @@ -159,7 +152,6 @@ return array( 'edit_client' => 'Edit Client', 'edit_invoice' => 'Edit Invoice', - // client view page 'create_invoice' => 'Create Invoice', 'enter_credit' => 'Enter Credit', 'last_logged_in' => 'Last logged in', @@ -172,11 +164,9 @@ return array( 'adjustment' => 'Adjustment', 'are_you_sure' => 'Are you sure?', - // payment pages 'payment_type_id' => 'Payment Type', 'amount' => 'Amount', - // account/company pages 'work_email' => 'Email', 'language_id' => 'Language', 'timezone_id' => 'Timezone', @@ -207,12 +197,10 @@ return array( 'pdf_email_attachment' => 'Attach PDFs', 'custom_css' => 'Custom CSS', - //import CSV data pages 'import_clients' => 'Import Client Data', 'csv_file' => 'CSV file', 'export_clients' => 'Export Client Data', - // application messages 'created_client' => 'Successfully created client', 'created_clients' => 'Successfully created :count client(s)', 'updated_settings' => 'Successfully updated settings', @@ -263,7 +251,6 @@ return array( 'deleted_vendor' => 'Successfully deleted vendor', 'deleted_vendors' => 'Successfully deleted :count vendors', - // Emails 'confirmation_subject' => 'Invoice Ninja Account Confirmation', 'confirmation_header' => 'Account Confirmation', 'confirmation_message' => 'Please access the link below to confirm your account.', @@ -285,14 +272,12 @@ return array( 'reset_password' => 'You can reset your account password by clicking the following button:', 'reset_password_footer' => 'If you did not request this password reset please email our support: '.CONTACT_EMAIL, - // Payment page 'secure_payment' => 'Secure Payment', 'card_number' => 'Card Number', 'expiration_month' => 'Expiration Month', 'expiration_year' => 'Expiration Year', 'cvv' => 'CVV', - // Security alerts 'security' => [ 'too_many_attempts' => 'Too many attempts. Try again in few minutes.', 'wrong_credentials' => 'Incorrect email or password.', @@ -303,10 +288,9 @@ return array( 'wrong_password_reset' => 'Invalid password. Try again', ], - // Pro Plan 'pro_plan' => [ - 'remove_logo' => ':link to remove the Invoice Ninja logo by joining the Pro Plan', - 'remove_logo_link' => 'Click here', + 'remove_logo' => ':link to remove the Invoice Ninja logo by joining the Pro Plan', + 'remove_logo_link' => 'Click here', ], 'logout' => 'Log Out', @@ -340,7 +324,6 @@ return array( 'set_name' => 'Set your company name', 'view_as_recipient' => 'View as recipient', - // product management 'product_library' => 'Product Library', 'product' => 'Product', 'products' => 'Product Library', @@ -366,7 +349,6 @@ return array( 'ninja_email_footer' => 'Use :site to invoice your clients and get paid online for free!', 'go_pro' => 'Go Pro', - // Quotes 'quote' => 'Quote', 'quotes' => 'Quotes', 'quote_number' => 'Quote Number', @@ -582,7 +564,7 @@ return array( 'forgot_password' => 'Forgot your password?', 'email_address' => 'Email address', 'lets_go' => 'Let\'s go', - //'lets_go' => 'Login', + 'password_recovery' => 'Password Recovery', 'send_email' => 'Send email', 'set_password' => 'Set Password', @@ -1010,7 +992,6 @@ return array( 'white_label_custom_css' => ':link for $'.WHITE_LABEL_PRICE.' to enable custom styling and help support our project.', 'white_label_purchase_link' => 'Purchase a white label license', - // Expense / vendor 'expense' => 'Expense', 'expenses' => 'Expenses', 'new_expense' => 'Enter Expense', @@ -1028,7 +1009,6 @@ return array( 'deleted_expenses' => 'Successfully deleted expenses', 'archived_expenses' => 'Successfully archived expenses', - // Expenses 'expense_amount' => 'Expense Amount', 'expense_balance' => 'Expense Balance', 'expense_date' => 'Expense Date', @@ -1054,14 +1034,12 @@ return array( 'expense_error_invoiced' => 'Expense has already been invoiced', 'convert_currency' => 'Convert currency', - // Payment terms 'num_days' => 'Number of days', 'create_payment_term' => 'Create Payment Term', 'edit_payment_terms' => 'Edit Payment Term', 'edit_payment_term' => 'Edit Payment Term', 'archive_payment_term' => 'Archive Payment Term', - // recurring due dates 'recurring_due_dates' => 'Recurring Invoice Due Dates', 'recurring_due_date_help' => '

    Automatically sets a due date for the invoice.

    Invoices on a monthly or yearly cycle set to be due on or before the day they are created will be due the next month. Invoices set to be due on the 29th or 30th in months that don\'t have that day will be due the last day of the month.

    @@ -1090,7 +1068,6 @@ return array( 'friday' => 'Friday', 'saturday' => 'Saturday', - // Fonts 'header_font_id' => 'Header Font', 'body_font_id' => 'Body Font', 'color_font_help' => 'Note: the primary color and fonts are also used in the client portal and custom email designs.', @@ -1153,3 +1130,7 @@ return array( 'convert_currency' => 'Convert currency', ); + +return $LANG; + +?> \ No newline at end of file From d30eefa461f7f43c95dcfffd9f8a5313e20b36e7 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 09:54:18 +0200 Subject: [PATCH 067/130] Working on TravisCI --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 089965095797..6a2ba3858f58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,8 +29,8 @@ before_install: - composer self-update && composer -V # fix for phantomjs - mkdir travis-phantomjs - - wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 - - tar -xvf $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs + - wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-1.9.7-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-1.9.7-ubuntu-12.04.tar.bz2 + - tar -xvf $PWD/travis-phantomjs/phantomjs-1.9.7-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs - export PATH=$PWD/travis-phantomjs:$PATH install: From f0407473a806615a61a620ea7e2ed32c24e7fe68 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 09:58:52 +0200 Subject: [PATCH 068/130] Working on TravisCI --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6a2ba3858f58..ac1cc61372bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,9 +29,9 @@ before_install: - composer self-update && composer -V # fix for phantomjs - mkdir travis-phantomjs - - wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-1.9.7-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-1.9.7-ubuntu-12.04.tar.bz2 - - tar -xvf $PWD/travis-phantomjs/phantomjs-1.9.7-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs - - export PATH=$PWD/travis-phantomjs:$PATH + - wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 + - tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs + - export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH install: # install Composer dependencies From b8417d5d365924d0be8cec607565bcfffac69d96 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 10:02:24 +0200 Subject: [PATCH 069/130] Working on TravisCI --- .travis.yml | 5 ----- tests/acceptance.suite.yml | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac1cc61372bc..4bdcc265fb53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,11 +27,6 @@ before_install: # set GitHub token and update composer - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; - composer self-update && composer -V - # fix for phantomjs - - mkdir travis-phantomjs - - wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 - - tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs - - export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH install: # install Composer dependencies diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 4a152dce6eff..56b0928116f9 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -12,7 +12,7 @@ modules: host: 127.0.0.1 window_size: 1024x768 wait: 5 - browser: phantomjs + browser: firefox capabilities: unexpectedAlertBehaviour: 'accept' webStorageEnabled: true From 078736e9d2392aed0a2e00d69f99fa11a106904f Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 10:06:06 +0200 Subject: [PATCH 070/130] Working on TravisCI --- tests/acceptance.suite.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 56b0928116f9..e49f045e53f9 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -10,6 +10,7 @@ modules: - WebDriver: url: 'http://ninja.dev:8000' host: 127.0.0.1 + http_proxy: direct window_size: 1024x768 wait: 5 browser: firefox From c3ba842273352ba6ec6809d64cf7a981973f4a45 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 10:10:46 +0200 Subject: [PATCH 071/130] Working on TravisCI --- .travis.yml | 4 +++- tests/acceptance.suite.yml | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4bdcc265fb53..5ff07dd0e3db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,7 @@ before_install: # set GitHub token and update composer - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; - composer self-update && composer -V + - sudo apt-get install -y phantomjs screen install: # install Composer dependencies @@ -53,7 +54,8 @@ before_script: # Start webserver on ninja.dev:8000 - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS - - phantomjs --webdriver=4444 & # '&' allows to run in background + #- phantomjs --webdriver=4444 & # '&' allows to run in background + - screen -S server -d -m phantomjs --webdriver=4444 # Give it some time to start - sleep 5 # Make sure the app is up-to-date diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index e49f045e53f9..4a152dce6eff 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -10,10 +10,9 @@ modules: - WebDriver: url: 'http://ninja.dev:8000' host: 127.0.0.1 - http_proxy: direct window_size: 1024x768 wait: 5 - browser: firefox + browser: phantomjs capabilities: unexpectedAlertBehaviour: 'accept' webStorageEnabled: true From c1f260217961ecfc2e35973c71420f17fd8ec72e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 10:12:53 +0200 Subject: [PATCH 072/130] Working on TravisCI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5ff07dd0e3db..297db08db654 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: php -sudo: false +sudo: required php: - 5.5 From f29d7678002a1aac818b409eb3b62616ae8d57df Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 10:25:12 +0200 Subject: [PATCH 073/130] Working on TravisCI --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 297db08db654..a1cbcca8b7b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,14 +52,14 @@ before_script: - php artisan db:seed --no-interaction # default seed - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed # Start webserver on ninja.dev:8000 - - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background + #- php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS #- phantomjs --webdriver=4444 & # '&' allows to run in background - screen -S server -d -m phantomjs --webdriver=4444 # Give it some time to start - sleep 5 # Make sure the app is up-to-date - - curl -L http://ninja.dev:8000/update + #- curl -L http://ninja.dev:8000/update script: - php ./vendor/codeception/codeception/codecept run --html --debug From f8d5993337cf1b03e7201a7be67799ce581a2128 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 10:43:29 +0200 Subject: [PATCH 074/130] Working on TravisCI --- .travis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1cbcca8b7b1..494d94d0a276 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: php -sudo: required +sudo: false php: - 5.5 @@ -27,7 +27,6 @@ before_install: # set GitHub token and update composer - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; - composer self-update && composer -V - - sudo apt-get install -y phantomjs screen install: # install Composer dependencies @@ -52,10 +51,9 @@ before_script: - php artisan db:seed --no-interaction # default seed - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed # Start webserver on ninja.dev:8000 - #- php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background + - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS - #- phantomjs --webdriver=4444 & # '&' allows to run in background - - screen -S server -d -m phantomjs --webdriver=4444 + - phantomjs --webdriver=4444 & # '&' allows to run in background # Give it some time to start - sleep 5 # Make sure the app is up-to-date From 44c638ea54598f6c052cd2376f7f1e92b4718dc2 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 10:50:35 +0200 Subject: [PATCH 075/130] Working on TravisCI --- .travis.yml | 2 -- tests/acceptance.suite.yml | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 494d94d0a276..07aa6d10b7dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,8 +56,6 @@ before_script: - phantomjs --webdriver=4444 & # '&' allows to run in background # Give it some time to start - sleep 5 - # Make sure the app is up-to-date - #- curl -L http://ninja.dev:8000/update script: - php ./vendor/codeception/codeception/codecept run --html --debug diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 4a152dce6eff..a6c8033296cc 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -12,7 +12,8 @@ modules: host: 127.0.0.1 window_size: 1024x768 wait: 5 - browser: phantomjs + browser: firefox + http_proxy: direct capabilities: unexpectedAlertBehaviour: 'accept' webStorageEnabled: true From 2eda30023c8bda291531f3df6f998f8c9c40e766 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 11:03:46 +0200 Subject: [PATCH 076/130] Working on TravisCI --- .travis.yml | 6 +++--- tests/acceptance.suite.yml | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07aa6d10b7dc..360ffb842959 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: php -sudo: false +sudo: true php: - - 5.5 -# - 5.6 +# - 5.5 + - 5.6 # - 7.0 # - hhvm diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index a6c8033296cc..4a152dce6eff 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -12,8 +12,7 @@ modules: host: 127.0.0.1 window_size: 1024x768 wait: 5 - browser: firefox - http_proxy: direct + browser: phantomjs capabilities: unexpectedAlertBehaviour: 'accept' webStorageEnabled: true From 096e11cff57f1458f132569f9fe15914587ad7ff Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 11:13:35 +0200 Subject: [PATCH 077/130] Working on TravisCI --- .travis.yml | 6 +++--- codeception.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 360ffb842959..07aa6d10b7dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: php -sudo: true +sudo: false php: -# - 5.5 - - 5.6 + - 5.5 +# - 5.6 # - 7.0 # - hhvm diff --git a/codeception.yml b/codeception.yml index 87ecbd1fc806..d7a27890f616 100644 --- a/codeception.yml +++ b/codeception.yml @@ -11,8 +11,8 @@ settings: memory_limit: 1024M extensions: enabled: - - Codeception\Extension\RunFailed - - Codeception\Extension\Recorder +# - Codeception\Extension\RunFailed +# - Codeception\Extension\Recorder config: Codeception\Extension\Recorder: delete_successful: false From 50d949cb7eccc3f92e6a57f204018eb093127403 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 11:17:03 +0200 Subject: [PATCH 078/130] Working on TravisCI --- .travis.yml | 1 + codeception.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 07aa6d10b7dc..b77b2df7080e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,7 @@ env: before_install: # set GitHub token and update composer + - phantomjs --version - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; - composer self-update && composer -V diff --git a/codeception.yml b/codeception.yml index d7a27890f616..8349a46e0b7c 100644 --- a/codeception.yml +++ b/codeception.yml @@ -10,7 +10,7 @@ settings: colors: true memory_limit: 1024M extensions: - enabled: +# enabled: # - Codeception\Extension\RunFailed # - Codeception\Extension\Recorder config: From edda5eb2fc076ce313a57b0ea059349f7d9c28a7 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 11:21:23 +0200 Subject: [PATCH 079/130] Working on TravisCI --- .travis.yml | 3 ++- codeception.yml | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index b77b2df7080e..4bdcc265fb53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,6 @@ env: before_install: # set GitHub token and update composer - - phantomjs --version - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; - composer self-update && composer -V @@ -57,6 +56,8 @@ before_script: - phantomjs --webdriver=4444 & # '&' allows to run in background # Give it some time to start - sleep 5 + # Make sure the app is up-to-date + - curl -L http://ninja.dev:8000/update script: - php ./vendor/codeception/codeception/codecept run --html --debug diff --git a/codeception.yml b/codeception.yml index 8349a46e0b7c..87ecbd1fc806 100644 --- a/codeception.yml +++ b/codeception.yml @@ -10,9 +10,9 @@ settings: colors: true memory_limit: 1024M extensions: -# enabled: -# - Codeception\Extension\RunFailed -# - Codeception\Extension\Recorder + enabled: + - Codeception\Extension\RunFailed + - Codeception\Extension\Recorder config: Codeception\Extension\Recorder: delete_successful: false From cbbe56c38fa4ce7f35dc4f87f3883daba61c923a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 11:30:29 +0200 Subject: [PATCH 080/130] Working on TravisCI --- .travis.yml | 2 +- tests/acceptance.suite.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4bdcc265fb53..20a66e5b56c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ before_script: # Start webserver on ninja.dev:8000 - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS - - phantomjs --webdriver=4444 & # '&' allows to run in background + #- phantomjs --webdriver=4444 & # '&' allows to run in background # Give it some time to start - sleep 5 # Make sure the app is up-to-date diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 4a152dce6eff..56b0928116f9 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -12,7 +12,7 @@ modules: host: 127.0.0.1 window_size: 1024x768 wait: 5 - browser: phantomjs + browser: firefox capabilities: unexpectedAlertBehaviour: 'accept' webStorageEnabled: true From 836523bad68fc779d9d130f91c3eb18cccb11da7 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 11:39:09 +0200 Subject: [PATCH 081/130] Working on TravisCI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 20a66e5b56c4..4bdcc265fb53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ before_script: # Start webserver on ninja.dev:8000 - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS - #- phantomjs --webdriver=4444 & # '&' allows to run in background + - phantomjs --webdriver=4444 & # '&' allows to run in background # Give it some time to start - sleep 5 # Make sure the app is up-to-date From 65557fc0bd266ccb0211c01df1a10881690d6489 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 11:49:07 +0200 Subject: [PATCH 082/130] Working on TravisCI --- composer.json | 2 +- composer.lock | 94 +++++++++++++++++++------------------- tests/acceptance.suite.yml | 2 +- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/composer.json b/composer.json index 740e501771d0..68d48cd64803 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "require-dev": { "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1", - "codeception/codeception": "2.1.2", + "codeception/codeception": "*", "codeception/c3": "~2.0", "fzaninotto/faker": "^1.5" }, diff --git a/composer.lock b/composer.lock index 7157dd51188c..59574931678e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "cfae9eb02e70e68bef3b7a573b771cd1", - "content-hash": "9725ebe501b47a2dd80af2554009e32a", + "hash": "fceb9a043eac244cb01d8e8378e6d66a", + "content-hash": "f717dc8e67caa65002f0f0689d4a5478", "packages": [ { "name": "agmscode/omnipay-agms", @@ -6272,25 +6272,25 @@ }, { "name": "symfony/css-selector", - "version": "v2.8.2", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "ac06d8173bd80790536c0a4a634a7d705b91f54f" + "reference": "6605602690578496091ac20ec7a5cbd160d4dff4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/ac06d8173bd80790536c0a4a634a7d705b91f54f", - "reference": "ac06d8173bd80790536c0a4a634a7d705b91f54f", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/6605602690578496091ac20ec7a5cbd160d4dff4", + "reference": "6605602690578496091ac20ec7a5cbd160d4dff4", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -6321,7 +6321,7 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2016-01-03 15:33:41" + "time": "2016-01-27 05:14:46" }, { "name": "symfony/debug", @@ -7565,33 +7565,33 @@ }, { "name": "codeception/codeception", - "version": "2.1.2", + "version": "2.1.6", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "521adbb2ee34e9debdd8508a2c41ab2b5c2f042b" + "reference": "b199941f5e59d1e7fd32d78296c8ab98db873d89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/521adbb2ee34e9debdd8508a2c41ab2b5c2f042b", - "reference": "521adbb2ee34e9debdd8508a2c41ab2b5c2f042b", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/b199941f5e59d1e7fd32d78296c8ab98db873d89", + "reference": "b199941f5e59d1e7fd32d78296c8ab98db873d89", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", "facebook/webdriver": ">=1.0.1", - "guzzlehttp/guzzle": ">=4.0|<7.0", + "guzzlehttp/guzzle": ">=4.1.4 <7.0", "guzzlehttp/psr7": "~1.0", "php": ">=5.4.0", "phpunit/phpunit": "~4.8.0", - "symfony/browser-kit": "~2.4", - "symfony/console": "~2.4", - "symfony/css-selector": "~2.4", - "symfony/dom-crawler": "~2.4,!=2.4.5", - "symfony/event-dispatcher": "~2.4", - "symfony/finder": "~2.4", - "symfony/yaml": "~2.4" + "symfony/browser-kit": ">=2.4|<3.1", + "symfony/console": ">=2.4|<3.1", + "symfony/css-selector": ">=2.4|<3.1", + "symfony/dom-crawler": ">=2.4|<3.1", + "symfony/event-dispatcher": ">=2.4|<3.1", + "symfony/finder": ">=2.4|<3.1", + "symfony/yaml": ">=2.4|<3.1" }, "require-dev": { "codeception/specify": "~0.3", @@ -7641,7 +7641,7 @@ "functional testing", "unit testing" ], - "time": "2015-08-09 13:48:55" + "time": "2016-02-09 22:27:48" }, { "name": "doctrine/instantiator", @@ -8707,25 +8707,25 @@ }, { "name": "symfony/browser-kit", - "version": "v2.8.2", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "a93dffaf763182acad12a4c42c7efc372899891e" + "reference": "dde849a0485b70a24b36f826ed3fb95b904d80c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/a93dffaf763182acad12a4c42c7efc372899891e", - "reference": "a93dffaf763182acad12a4c42c7efc372899891e", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/dde849a0485b70a24b36f826ed3fb95b904d80c3", + "reference": "dde849a0485b70a24b36f826ed3fb95b904d80c3", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0" + "php": ">=5.5.9", + "symfony/dom-crawler": "~2.8|~3.0" }, "require-dev": { - "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0", - "symfony/process": "~2.3.34|~2.7,>=2.7.6|~3.0.0" + "symfony/css-selector": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" }, "suggest": { "symfony/process": "" @@ -8733,7 +8733,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -8760,28 +8760,28 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2016-01-12 17:46:01" + "time": "2016-01-27 11:34:55" }, { "name": "symfony/dom-crawler", - "version": "v2.8.2", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "650d37aacb1fa0dcc24cced483169852b3a0594e" + "reference": "b693a9650aa004576b593ff2e91ae749dc90123d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/650d37aacb1fa0dcc24cced483169852b3a0594e", - "reference": "650d37aacb1fa0dcc24cced483169852b3a0594e", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b693a9650aa004576b593ff2e91ae749dc90123d", + "reference": "b693a9650aa004576b593ff2e91ae749dc90123d", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": ">=5.5.9", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0.0" + "symfony/css-selector": "~2.8|~3.0" }, "suggest": { "symfony/css-selector": "" @@ -8789,7 +8789,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -8816,7 +8816,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2016-01-03 15:33:41" + "time": "2016-01-25 09:56:57" }, { "name": "symfony/polyfill-mbstring", @@ -8879,25 +8879,25 @@ }, { "name": "symfony/yaml", - "version": "v2.8.2", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "34c8a4b51e751e7ea869b8262f883d008a2b81b8" + "reference": "3cf0709d7fe936e97bee9e954382e449003f1d9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/34c8a4b51e751e7ea869b8262f883d008a2b81b8", - "reference": "34c8a4b51e751e7ea869b8262f883d008a2b81b8", + "url": "https://api.github.com/repos/symfony/yaml/zipball/3cf0709d7fe936e97bee9e954382e449003f1d9a", + "reference": "3cf0709d7fe936e97bee9e954382e449003f1d9a", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -8924,7 +8924,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-01-13 10:28:07" + "time": "2016-02-02 13:44:19" } ], "aliases": [], diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 56b0928116f9..4a152dce6eff 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -12,7 +12,7 @@ modules: host: 127.0.0.1 window_size: 1024x768 wait: 5 - browser: firefox + browser: phantomjs capabilities: unexpectedAlertBehaviour: 'accept' webStorageEnabled: true From 869febc1d32bd4fa70d71e5192f2b5a73d0431d5 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 12:02:30 +0200 Subject: [PATCH 083/130] Fix for Date in Expenses #731 --- app/Http/Controllers/ExpenseController.php | 2 +- app/Models/Expense.php | 2 +- resources/views/expenses/edit.blade.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/ExpenseController.php b/app/Http/Controllers/ExpenseController.php index 6f2a6e884a30..5535b863e857 100644 --- a/app/Http/Controllers/ExpenseController.php +++ b/app/Http/Controllers/ExpenseController.php @@ -96,7 +96,7 @@ class ExpenseController extends BaseController { $expense = Expense::scope($publicId)->firstOrFail(); $expense->expense_date = Utils::fromSqlDate($expense->expense_date); - + $actions = []; if ($expense->invoice) { $actions[] = ['url' => URL::to("invoices/{$expense->invoice->public_id}/edit"), 'label' => trans("texts.view_invoice")]; diff --git a/app/Models/Expense.php b/app/Models/Expense.php index 2749607c87e2..2d1b8041d7ee 100644 --- a/app/Models/Expense.php +++ b/app/Models/Expense.php @@ -12,7 +12,7 @@ class Expense extends EntityModel use SoftDeletes; use PresentableTrait; - protected $dates = ['deleted_at','expense_date']; + protected $dates = ['deleted_at']; protected $presenter = 'App\Ninja\Presenters\ExpensePresenter'; protected $fillable = [ diff --git a/resources/views/expenses/edit.blade.php b/resources/views/expenses/edit.blade.php index c2e00ab6af79..589c8d8cda8f 100644 --- a/resources/views/expenses/edit.blade.php +++ b/resources/views/expenses/edit.blade.php @@ -160,7 +160,7 @@ } $vendorSelect.combobox(); - $('#expense_date').datepicker('update', new Date()); + $('#expense_date').datepicker('update', '{{ $expense ? $expense->expense_date : 'new Date()' }}'); $('.expense_date .input-group-addon').click(function() { toggleDatePicker('expense_date'); From f060798721a155760c5c5939c780dc5d95541da0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 12:11:09 +0200 Subject: [PATCH 084/130] Working on TravisCI --- .env.example | 2 +- .travis.yml | 8 ++------ tests/_bootstrap.php.default | 2 +- tests/acceptance.suite.yml | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 20c977c663e9..9061ffc8d13b 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ APP_ENV=production APP_DEBUG=false -APP_URL=http://ninja.dev +APP_URL=http://127.0.0.1 APP_CIPHER=rijndael-128 APP_KEY=SomeRandomString diff --git a/.travis.yml b/.travis.yml index 4bdcc265fb53..77b175fadb26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,6 @@ php: # - 7.0 # - hhvm -addons: - hosts: - - ninja.dev - cache: directories: - vendor @@ -51,13 +47,13 @@ before_script: - php artisan db:seed --no-interaction # default seed - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed # Start webserver on ninja.dev:8000 - - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background + - php artisan serve --port=8000 & # '&' allows to run in background # Start PhantomJS - phantomjs --webdriver=4444 & # '&' allows to run in background # Give it some time to start - sleep 5 # Make sure the app is up-to-date - - curl -L http://ninja.dev:8000/update + - curl -L http://127.0.0.1:8000/update script: - php ./vendor/codeception/codeception/codecept run --html --debug diff --git a/tests/_bootstrap.php.default b/tests/_bootstrap.php.default index 19fc7eba0df7..b27f5f611237 100644 --- a/tests/_bootstrap.php.default +++ b/tests/_bootstrap.php.default @@ -2,7 +2,7 @@ // This is global bootstrap for autoloading use Codeception\Util\Fixtures; -Fixtures::add('url', 'http://ninja.dev:8000'); +Fixtures::add('url', 'http://127.0.0.1:8000'); Fixtures::add('username', 'user@example.com'); Fixtures::add('password', 'password'); diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 4a152dce6eff..8b830869aab3 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -8,7 +8,7 @@ class_name: AcceptanceTester modules: enabled: - WebDriver: - url: 'http://ninja.dev:8000' + url: 'http://127.0.0.1:8000' host: 127.0.0.1 window_size: 1024x768 wait: 5 From d3dce0f3a50e6c323f10b3d22c15e1b21ddf175b Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 12:20:43 +0200 Subject: [PATCH 085/130] Working on TravisCI --- .travis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 77b175fadb26..be95a1a04d70 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,10 @@ php: # - 7.0 # - hhvm +addons: + hosts: + - localhost + cache: directories: - vendor @@ -47,13 +51,13 @@ before_script: - php artisan db:seed --no-interaction # default seed - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed # Start webserver on ninja.dev:8000 - - php artisan serve --port=8000 & # '&' allows to run in background + - php artisan serve --host=localhost --port=8000 & # '&' allows to run in background # Start PhantomJS - phantomjs --webdriver=4444 & # '&' allows to run in background # Give it some time to start - sleep 5 # Make sure the app is up-to-date - - curl -L http://127.0.0.1:8000/update + - curl -L http://localhost:8000/update script: - php ./vendor/codeception/codeception/codecept run --html --debug From c834baa1b8bc58bdd0eea0359cfa71c1a4fb86c6 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 12:26:21 +0200 Subject: [PATCH 086/130] Working on TravisCI --- .env.example | 2 +- .travis.yml | 6 +++--- tests/_bootstrap.php.default | 2 +- tests/acceptance.suite.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 9061ffc8d13b..20c977c663e9 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ APP_ENV=production APP_DEBUG=false -APP_URL=http://127.0.0.1 +APP_URL=http://ninja.dev APP_CIPHER=rijndael-128 APP_KEY=SomeRandomString diff --git a/.travis.yml b/.travis.yml index be95a1a04d70..4bdcc265fb53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ php: addons: hosts: - - localhost + - ninja.dev cache: directories: @@ -51,13 +51,13 @@ before_script: - php artisan db:seed --no-interaction # default seed - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed # Start webserver on ninja.dev:8000 - - php artisan serve --host=localhost --port=8000 & # '&' allows to run in background + - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS - phantomjs --webdriver=4444 & # '&' allows to run in background # Give it some time to start - sleep 5 # Make sure the app is up-to-date - - curl -L http://localhost:8000/update + - curl -L http://ninja.dev:8000/update script: - php ./vendor/codeception/codeception/codecept run --html --debug diff --git a/tests/_bootstrap.php.default b/tests/_bootstrap.php.default index b27f5f611237..19fc7eba0df7 100644 --- a/tests/_bootstrap.php.default +++ b/tests/_bootstrap.php.default @@ -2,7 +2,7 @@ // This is global bootstrap for autoloading use Codeception\Util\Fixtures; -Fixtures::add('url', 'http://127.0.0.1:8000'); +Fixtures::add('url', 'http://ninja.dev:8000'); Fixtures::add('username', 'user@example.com'); Fixtures::add('password', 'password'); diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 8b830869aab3..4a152dce6eff 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -8,7 +8,7 @@ class_name: AcceptanceTester modules: enabled: - WebDriver: - url: 'http://127.0.0.1:8000' + url: 'http://ninja.dev:8000' host: 127.0.0.1 window_size: 1024x768 wait: 5 From 73312502ccba4f635787d2708ccd524175196c7c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 12:29:00 +0200 Subject: [PATCH 087/130] Working on TravisCI --- tests/acceptance.suite.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 4a152dce6eff..34317d145566 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -9,7 +9,6 @@ modules: enabled: - WebDriver: url: 'http://ninja.dev:8000' - host: 127.0.0.1 window_size: 1024x768 wait: 5 browser: phantomjs From a7176a0c628053ed7774d9409d23c17e71364cf3 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 12:37:23 +0200 Subject: [PATCH 088/130] Working on TravisCI --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 4bdcc265fb53..d6fbe7644010 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,6 +63,8 @@ script: - php ./vendor/codeception/codeception/codecept run --html --debug after_script: + - cat /var/log/apache2/access.log + - cat /var/log/apache2/error.log - cat storage/logs/laravel.log From efada670329f32105f834ad014bb8b1d87dd40e0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 12:39:06 +0200 Subject: [PATCH 089/130] Working on TravisCI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d6fbe7644010..f38eaaf24b4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ before_script: # Start webserver on ninja.dev:8000 - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS - - phantomjs --webdriver=4444 & # '&' allows to run in background + - phantomjs --webdriver=4444 --ignore-ssl-errors=true & # '&' allows to run in background # Give it some time to start - sleep 5 # Make sure the app is up-to-date From 6e3b5194e864ffea50a4658986d60d29d0980e89 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 12:53:25 +0200 Subject: [PATCH 090/130] Working on TravisCI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f38eaaf24b4b..211c405a8423 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ before_script: # Start webserver on ninja.dev:8000 - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS - - phantomjs --webdriver=4444 --ignore-ssl-errors=true & # '&' allows to run in background + - phantomjs --webdriver=4444 --ssl-protocol=any & # '&' allows to run in background # Give it some time to start - sleep 5 # Make sure the app is up-to-date From ec6922cca03a23f6fb184fb30cabd1e222d9c459 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 12:56:32 +0200 Subject: [PATCH 091/130] Working on TravisCI --- tests/acceptance.suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 34317d145566..5f3486a3c0be 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -8,7 +8,7 @@ class_name: AcceptanceTester modules: enabled: - WebDriver: - url: 'http://ninja.dev:8000' + url: 'http://ninja.dev:8000/' window_size: 1024x768 wait: 5 browser: phantomjs From 19a4978fe53513f051f36655ad436f0a6c6b10df Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 13:03:06 +0200 Subject: [PATCH 092/130] Working on TravisCI --- .travis.yml | 1 + tests/acceptance.suite.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 211c405a8423..e5f5298c803e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,6 +63,7 @@ script: - php ./vendor/codeception/codeception/codecept run --html --debug after_script: + - cat tests/_output/* - cat /var/log/apache2/access.log - cat /var/log/apache2/error.log - cat storage/logs/laravel.log diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 5f3486a3c0be..34317d145566 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -8,7 +8,7 @@ class_name: AcceptanceTester modules: enabled: - WebDriver: - url: 'http://ninja.dev:8000/' + url: 'http://ninja.dev:8000' window_size: 1024x768 wait: 5 browser: phantomjs From 7764d336f682f4f5b8d77b5a77e57c4862c08bb3 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 13:21:19 +0200 Subject: [PATCH 093/130] Working on TravisCI --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e5f5298c803e..21ab6b6b1268 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,7 @@ before_install: # set GitHub token and update composer - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; - composer self-update && composer -V + - apt-get -y install phantomjs screen install: # install Composer dependencies @@ -53,7 +54,8 @@ before_script: # Start webserver on ninja.dev:8000 - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS - - phantomjs --webdriver=4444 --ssl-protocol=any & # '&' allows to run in background + #- phantomjs --webdriver=4444 & # '&' allows to run in background + - screen -S server -d m phantomjs --webdriver=4444 & # Give it some time to start - sleep 5 # Make sure the app is up-to-date From 983c4305248f8089dadfc7cbaf942b6b416b3f80 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 13:24:14 +0200 Subject: [PATCH 094/130] Working on TravisCI --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 21ab6b6b1268..eabd58f6fab4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: php -sudo: false +sudo: true php: - 5.5 @@ -27,7 +27,7 @@ before_install: # set GitHub token and update composer - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; - composer self-update && composer -V - - apt-get -y install phantomjs screen + - sudo apt-get -y install phantomjs screen install: # install Composer dependencies From f8066492e63cb3bc58d18e08c7dafdb68504d6b2 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 13:36:47 +0200 Subject: [PATCH 095/130] Working on TravisCI --- .travis.yml | 12 +++++------- tests/acceptance.suite.yml | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index eabd58f6fab4..3a0e5caa6210 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: php -sudo: true +sudo: false php: - 5.5 @@ -27,7 +27,6 @@ before_install: # set GitHub token and update composer - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; - composer self-update && composer -V - - sudo apt-get -y install phantomjs screen install: # install Composer dependencies @@ -54,8 +53,7 @@ before_script: # Start webserver on ninja.dev:8000 - php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background # Start PhantomJS - #- phantomjs --webdriver=4444 & # '&' allows to run in background - - screen -S server -d m phantomjs --webdriver=4444 & + - phantomjs --webdriver=4444 & # '&' allows to run in background # Give it some time to start - sleep 5 # Make sure the app is up-to-date @@ -65,9 +63,9 @@ script: - php ./vendor/codeception/codeception/codecept run --html --debug after_script: - - cat tests/_output/* - - cat /var/log/apache2/access.log - - cat /var/log/apache2/error.log + #- cat tests/_output/* + #- cat /var/log/apache2/access.log + #- cat /var/log/apache2/error.log - cat storage/logs/laravel.log diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 34317d145566..05dcbc71eca7 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -8,10 +8,10 @@ class_name: AcceptanceTester modules: enabled: - WebDriver: - url: 'http://ninja.dev:8000' + url: 'http://ninja.dev:8000/' window_size: 1024x768 wait: 5 - browser: phantomjs + browser: firefox capabilities: unexpectedAlertBehaviour: 'accept' webStorageEnabled: true From 40f7004a18e6a8b1348967933b05240e624445ad Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 13:42:07 +0200 Subject: [PATCH 096/130] Working on TravisCI --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3a0e5caa6210..157e2da126fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: php -sudo: false +sudo: true php: - 5.5 @@ -64,8 +64,8 @@ script: after_script: #- cat tests/_output/* - #- cat /var/log/apache2/access.log - #- cat /var/log/apache2/error.log + - cat /var/log/apache2/access.log + - cat /var/log/apache2/error.log - cat storage/logs/laravel.log From 3e7928034477a7ffdbfb29854b514d1fc1af3998 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 14:15:35 +0200 Subject: [PATCH 097/130] Working on TravisCI --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 157e2da126fb..146e8c0e316e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,7 @@ before_script: - sleep 5 # Make sure the app is up-to-date - curl -L http://ninja.dev:8000/update + #- curl -L http://ninja.dev:8000/login script: - php ./vendor/codeception/codeception/codecept run --html --debug From d94b78fe6c5857cfe13ae1b238013e6d95faf133 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 14:34:52 +0200 Subject: [PATCH 098/130] Working on TravisCI --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 146e8c0e316e..bee3bd2a2feb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,7 +61,10 @@ before_script: #- curl -L http://ninja.dev:8000/login script: - - php ./vendor/codeception/codeception/codecept run --html --debug + #- php ./vendor/codeception/codeception/codecept run --html --debug + - php ./vendor/codeception/codeception/codecept run --html --debug acceptance AllPagesCept.php + - php ./vendor/codeception/codeception/codecept run --html --debug acceptance APICest.php + - php ./vendor/codeception/codeception/codecept run --html --debug acceptance CheckBalanceCest.php after_script: #- cat tests/_output/* From dffe4a1b55e75f212c1bc7f5e2312ac9985fdd64 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 14:48:24 +0200 Subject: [PATCH 099/130] Working on TravisCI --- tests/acceptance/CheckBalanceCest.php | 1 - tests/acceptance/ClientCest.php | 1 - tests/acceptance/CreditCest.php | 1 - tests/acceptance/GoProCest.php | 1 - tests/acceptance/InvoiceCest.php | 1 - tests/acceptance/InvoiceDesignCest.php | 1 - tests/acceptance/OnlinePaymentCest.php | 1 - tests/acceptance/PaymentCest.php | 1 - tests/acceptance/TaskCest.php | 1 - tests/acceptance/TaxRatesCest.php | 1 - 10 files changed, 10 deletions(-) diff --git a/tests/acceptance/CheckBalanceCest.php b/tests/acceptance/CheckBalanceCest.php index 6bac648864f9..0ffe27f62a4f 100644 --- a/tests/acceptance/CheckBalanceCest.php +++ b/tests/acceptance/CheckBalanceCest.php @@ -1,7 +1,6 @@ Date: Thu, 18 Feb 2016 14:53:27 +0200 Subject: [PATCH 100/130] Working on TravisCI --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index d9f7f05a2bbc..8803e480ec1b 100644 --- a/readme.md +++ b/readme.md @@ -5,6 +5,7 @@ # Invoice Ninja ### [https://www.invoiceninja.com](https://www.invoiceninja.com) +[![Build Status](https://travis-ci.org/invoiceninja/invoiceninja.svg?branch=develop)](https://travis-ci.org/invoiceninja/invoiceninja) [![Join the chat at https://gitter.im/hillelcoren/invoice-ninja](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hillelcoren/invoice-ninja?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ### Referral Program From 8968ec2f5fe29954e4cd05afc4f6947f5d1d8d27 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 15:05:17 +0200 Subject: [PATCH 101/130] Working on TravisCI --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index bee3bd2a2feb..e178903e869f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,6 +65,15 @@ script: - php ./vendor/codeception/codeception/codecept run --html --debug acceptance AllPagesCept.php - php ./vendor/codeception/codeception/codecept run --html --debug acceptance APICest.php - php ./vendor/codeception/codeception/codecept run --html --debug acceptance CheckBalanceCest.php + - php ./vendor/codeception/codeception/codecept run --html --debug acceptance ClientCest.php + - php ./vendor/codeception/codeception/codecept run --html --debug acceptance CreditCest.php + - php ./vendor/codeception/codeception/codecept run --html --debug acceptance InvoiceCest.php + - php ./vendor/codeception/codeception/codecept run --html --debug acceptance InvoiceDesignCest.php + - php ./vendor/codeception/codeception/codecept run --html --debug acceptance OnlinePaymentCest.php + - php ./vendor/codeception/codeception/codecept run --html --debug acceptance PaymentCest.php + - php ./vendor/codeception/codeception/codecept run --html --debug acceptance TaskCest.php + - php ./vendor/codeception/codeception/codecept run --html --debug acceptance TaxRatesCest.php + #- php ./vendor/codeception/codeception/codecept run --html --debug acceptance GoProCest.php after_script: #- cat tests/_output/* From b7fd805fbabeba293cdd19fd1676ddd7f3ea3b80 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 15:46:21 +0200 Subject: [PATCH 102/130] Increased MySQL wait time --- .travis.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index e178903e869f..10d7092e2391 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ install: - travis_retry composer install --prefer-dist; before_script: + - mysql -e 'SET @@GLOBAL.wait_timeout=28800' # copy configuration files - cp .env.example .env - cp tests/_bootstrap.php.default tests/_bootstrap.php @@ -58,29 +59,24 @@ before_script: - sleep 5 # Make sure the app is up-to-date - curl -L http://ninja.dev:8000/update - #- curl -L http://ninja.dev:8000/login script: #- php ./vendor/codeception/codeception/codecept run --html --debug - - php ./vendor/codeception/codeception/codecept run --html --debug acceptance AllPagesCept.php - - php ./vendor/codeception/codeception/codecept run --html --debug acceptance APICest.php - - php ./vendor/codeception/codeception/codecept run --html --debug acceptance CheckBalanceCest.php - - php ./vendor/codeception/codeception/codecept run --html --debug acceptance ClientCest.php - - php ./vendor/codeception/codeception/codecept run --html --debug acceptance CreditCest.php - - php ./vendor/codeception/codeception/codecept run --html --debug acceptance InvoiceCest.php - - php ./vendor/codeception/codeception/codecept run --html --debug acceptance InvoiceDesignCest.php - - php ./vendor/codeception/codeception/codecept run --html --debug acceptance OnlinePaymentCest.php - - php ./vendor/codeception/codeception/codecept run --html --debug acceptance PaymentCest.php - - php ./vendor/codeception/codeception/codecept run --html --debug acceptance TaskCest.php - - php ./vendor/codeception/codeception/codecept run --html --debug acceptance TaxRatesCest.php - #- php ./vendor/codeception/codeception/codecept run --html --debug acceptance GoProCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance OnlinePaymentCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php + #- php ./vendor/codeception/codeception/codecept run--debug acceptance GoProCest.php after_script: - #- cat tests/_output/* - - cat /var/log/apache2/access.log - - cat /var/log/apache2/error.log - - cat storage/logs/laravel.log - + - cat storage/logs/laravel.log notifications: email: From f797497a8a44cf156bf448f9b0938822500011a0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 15:46:44 +0200 Subject: [PATCH 103/130] Fix for invitations in the API --- app/Http/Controllers/InvoiceApiController.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index 2ba39cd77651..f99e12a4d740 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -20,18 +20,20 @@ use App\Http\Controllers\BaseAPIController; use App\Ninja\Transformers\InvoiceTransformer; use App\Http\Requests\CreateInvoiceRequest; use App\Http\Requests\UpdateInvoiceRequest; +use App\Services\InvoiceService; class InvoiceApiController extends BaseAPIController { protected $invoiceRepo; - public function __construct(InvoiceRepository $invoiceRepo, ClientRepository $clientRepo, PaymentRepository $paymentRepo, Mailer $mailer) + public function __construct(InvoiceService $invoiceService, InvoiceRepository $invoiceRepo, ClientRepository $clientRepo, PaymentRepository $paymentRepo, Mailer $mailer) { parent::__construct(); $this->invoiceRepo = $invoiceRepo; $this->clientRepo = $clientRepo; $this->paymentRepo = $paymentRepo; + $this->invoiceService = $invoiceService; $this->mailer = $mailer; } @@ -187,7 +189,7 @@ class InvoiceApiController extends BaseAPIController $data = self::prepareData($data, $client); $data['client_id'] = $client->id; - $invoice = $this->invoiceRepo->save($data); + $invoice = $this->invoiceService->save($data); $payment = false; // Optionally create payment with invoice @@ -199,14 +201,6 @@ class InvoiceApiController extends BaseAPIController ]); } - if (!isset($data['id'])) { - $invitation = Invitation::createNew(); - $invitation->invoice_id = $invoice->id; - $invitation->contact_id = $client->contacts[0]->id; - $invitation->invitation_key = str_random(RANDOM_KEY_LENGTH); - $invitation->save(); - } - if (isset($data['email_invoice']) && $data['email_invoice']) { if ($payment) { $this->mailer->sendPaymentConfirmation($payment); @@ -387,7 +381,7 @@ class InvoiceApiController extends BaseAPIController $data = $request->input(); $data['public_id'] = $publicId; - $this->invoiceRepo->save($data); + $this->invoiceService->save($data); $invoice = Invoice::scope($publicId)->with('client', 'invoice_items', 'invitations')->firstOrFail(); $transformer = new InvoiceTransformer(\Auth::user()->account, Input::get('serializer')); From fcc1d62d9be96bfc31f962473bc798919f63f32c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 16:59:50 +0200 Subject: [PATCH 104/130] Fixing test payment in Travis --- .travis.yml | 22 +++++++++++----------- tests/_bootstrap.php.default | 4 ++-- tests/acceptance/OnlinePaymentCest.php | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 10d7092e2391..e0595728975f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ install: - travis_retry composer install --prefer-dist; before_script: - - mysql -e 'SET @@GLOBAL.wait_timeout=28800' + - mysql -u root -e 'SET @@GLOBAL.wait_timeout=28800;' # copy configuration files - cp .env.example .env - cp tests/_bootstrap.php.default tests/_bootstrap.php @@ -62,17 +62,17 @@ before_script: script: #- php ./vendor/codeception/codeception/codecept run --html --debug - - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance OnlinePaymentCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php #- php ./vendor/codeception/codeception/codecept run--debug acceptance GoProCest.php after_script: diff --git a/tests/_bootstrap.php.default b/tests/_bootstrap.php.default index 19fc7eba0df7..33ecdcb60782 100644 --- a/tests/_bootstrap.php.default +++ b/tests/_bootstrap.php.default @@ -7,5 +7,5 @@ Fixtures::add('username', 'user@example.com'); Fixtures::add('password', 'password'); Fixtures::add('api_secret', 'password'); -Fixtures::add('secret_key', ''); -Fixtures::add('publishable_key', ''); \ No newline at end of file +Fixtures::add('stripe_secret_key', ''); +Fixtures::add('stripe_publishable_key', ''); \ No newline at end of file diff --git a/tests/acceptance/OnlinePaymentCest.php b/tests/acceptance/OnlinePaymentCest.php index be21ce3a957b..c0dccf6188bd 100644 --- a/tests/acceptance/OnlinePaymentCest.php +++ b/tests/acceptance/OnlinePaymentCest.php @@ -26,7 +26,7 @@ class OnlinePaymentCest $I->amOnPage('/settings/online_payments'); if (strpos($I->grabFromCurrentUrl(), 'create') !== false) { - $I->fillField(['name' =>'23_apiKey'], Fixtures::get('secret_key')); + $I->fillField(['name' =>'23_apiKey'], env('stripe_secret_key') ?: Fixtures::get('stripe_secret_key')); // Fails to load StripeJS causing "ReferenceError: Can't find variable: Stripe" //$I->fillField(['name' =>'publishable_key'], Fixtures::get('publishable_key')); $I->selectOption('#token_billing_type_id', 4); From 5ddef6f12b56c0fbc7848336fbf16556f9144883 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 17:16:14 +0200 Subject: [PATCH 105/130] Fixing test payment in Travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e0595728975f..ada691db9a62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,6 +40,7 @@ before_script: - mysql -u root -e 'SET @@GLOBAL.wait_timeout=28800;' # copy configuration files - cp .env.example .env + - sed -i 's/REQUIRE_HTTPS=false/NINJA_DEV=true/g' .env - cp tests/_bootstrap.php.default tests/_bootstrap.php - php artisan key:generate --no-interaction - sed -i 's/APP_ENV=production/APP_ENV=development/g' .env From 5b743355feffaedd03b011ad7bc4f9c8c13525dd Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 17:35:21 +0200 Subject: [PATCH 106/130] Fixing test payment in Travis --- app/Http/Controllers/AccountGatewayController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/AccountGatewayController.php b/app/Http/Controllers/AccountGatewayController.php index dfbd2b386162..1fbeaa23751b 100644 --- a/app/Http/Controllers/AccountGatewayController.php +++ b/app/Http/Controllers/AccountGatewayController.php @@ -203,7 +203,7 @@ class AccountGatewayController extends BaseController if (Utils::isNinjaDev() && Input::get('23_apiKey') == env('TEST_API_KEY')) { // do nothing - we're unable to acceptance test with StripeJS } else { - $rules['publishable_key'] = 'required'; + //$rules['publishable_key'] = 'required'; } } From 7e6d13750498e7c7d944c9e2c037e16ffb68a3bc Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 19:00:21 +0200 Subject: [PATCH 107/130] Fixing test payment in Travis --- .travis.yml | 2 +- app/Http/Controllers/AccountGatewayController.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ada691db9a62..8f973c811931 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,11 +40,11 @@ before_script: - mysql -u root -e 'SET @@GLOBAL.wait_timeout=28800;' # copy configuration files - cp .env.example .env - - sed -i 's/REQUIRE_HTTPS=false/NINJA_DEV=true/g' .env - cp tests/_bootstrap.php.default tests/_bootstrap.php - php artisan key:generate --no-interaction - sed -i 's/APP_ENV=production/APP_ENV=development/g' .env - sed -i 's/APP_DEBUG=false/APP_DEBUG=true/g' .env + - sed -i 's/REQUIRE_HTTPS=false/NINJA_DEV=true/g' .env # create the database and user - mysql -u root -e "create database IF NOT EXISTS ninja;" - mysql -u root -e "GRANT ALL PRIVILEGES ON ninja.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;" diff --git a/app/Http/Controllers/AccountGatewayController.php b/app/Http/Controllers/AccountGatewayController.php index 1fbeaa23751b..58b831503b78 100644 --- a/app/Http/Controllers/AccountGatewayController.php +++ b/app/Http/Controllers/AccountGatewayController.php @@ -200,10 +200,10 @@ class AccountGatewayController extends BaseController if ($gatewayId == GATEWAY_DWOLLA) { $optional = array_merge($optional, ['key', 'secret']); } elseif ($gatewayId == GATEWAY_STRIPE) { - if (Utils::isNinjaDev() && Input::get('23_apiKey') == env('TEST_API_KEY')) { + if (Utils::isNinjaDev()) { // do nothing - we're unable to acceptance test with StripeJS } else { - //$rules['publishable_key'] = 'required'; + $rules['publishable_key'] = 'required'; } } From 82318ade5cab945c8b81f97c2e5b18a64ef41eed Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 19:03:24 +0200 Subject: [PATCH 108/130] Fixing test payment in Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8f973c811931..81d522bfbb01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,7 +70,7 @@ script: #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance OnlinePaymentCest.php + - php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php From bb817f8afe82775a5ead89bdf6ef51bf0dbf9c66 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 19:14:51 +0200 Subject: [PATCH 109/130] Working on Travis --- .travis.yml | 6 +- resources/lang/en/texts.php | 173 ++++++++---------------------------- 2 files changed, 39 insertions(+), 140 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81d522bfbb01..f39a3a6142bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,9 @@ sudo: true php: - 5.5 -# - 5.6 -# - 7.0 -# - hhvm + - 5.6 + - 7.0 + - hhvm addons: hosts: diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index ace0aba384e8..0c9bfac16536 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -23,7 +23,6 @@ $LANG = array( 'size_id' => 'Company Size', 'industry_id' => 'Industry', 'private_notes' => 'Private Notes', - 'invoice' => 'Invoice', 'client' => 'Client', 'invoice_date' => 'Invoice Date', @@ -47,7 +46,6 @@ $LANG = array( 'invoice_design_id' => 'Design', 'terms' => 'Terms', 'your_invoice' => 'Your Invoice', - 'remove_contact' => 'Remove contact', 'add_contact' => 'Add contact', 'create_new_client' => 'Create new client', @@ -71,7 +69,6 @@ $LANG = array( 'settings' => 'Settings', 'enable_invoice_tax' => 'Enable specifying an invoice tax', 'enable_line_item_tax' => 'Enable specifying line item taxes', - 'dashboard' => 'Dashboard', 'clients' => 'Clients', 'invoices' => 'Invoices', @@ -96,7 +93,6 @@ $LANG = array( 'provide_email' => 'Please provide a valid email address', 'powered_by' => 'Powered by', 'no_items' => 'No items', - 'recurring_invoices' => 'Recurring Invoices', 'recurring_help' => '

    Automatically send clients the same invoices weekly, bi-monthly, monthly, quarterly or annually.

    Use :MONTH, :QUARTER or :YEAR for dynamic dates. Basic math works as well, for example :MONTH-1.

    @@ -106,7 +102,6 @@ $LANG = array(
  • ":YEAR+1 yearly subscription" => "2015 Yearly Subscription"
  • "Retainer payment for :QUARTER+1" => "Retainer payment for Q2"
  • ', - 'in_total_revenue' => 'in total revenue', 'billed_client' => 'billed client', 'billed_clients' => 'billed clients', @@ -115,7 +110,6 @@ $LANG = array( 'invoices_past_due' => 'Invoices Past Due', 'upcoming_invoices' => 'Upcoming Invoices', 'average_invoice' => 'Average Invoice', - 'archive' => 'Archive', 'delete' => 'Delete', 'archive_client' => 'Archive Client', @@ -151,7 +145,6 @@ $LANG = array( 'select' => 'Select', 'edit_client' => 'Edit Client', 'edit_invoice' => 'Edit Invoice', - 'create_invoice' => 'Create Invoice', 'enter_credit' => 'Enter Credit', 'last_logged_in' => 'Last logged in', @@ -163,10 +156,8 @@ $LANG = array( 'message' => 'Message', 'adjustment' => 'Adjustment', 'are_you_sure' => 'Are you sure?', - 'payment_type_id' => 'Payment Type', 'amount' => 'Amount', - 'work_email' => 'Email', 'language_id' => 'Language', 'timezone_id' => 'Timezone', @@ -196,11 +187,9 @@ $LANG = array( 'client_view_styling' => 'Client View Styling', 'pdf_email_attachment' => 'Attach PDFs', 'custom_css' => 'Custom CSS', - 'import_clients' => 'Import Client Data', 'csv_file' => 'CSV file', 'export_clients' => 'Export Client Data', - 'created_client' => 'Successfully created client', 'created_clients' => 'Successfully created :count client(s)', 'updated_settings' => 'Successfully updated settings', @@ -211,14 +200,12 @@ $LANG = array( 'payment_error' => 'There was an error processing your payment. Please try again later.', 'registration_required' => 'Please sign up to email an invoice', 'confirmation_required' => 'Please confirm your email address', - 'updated_client' => 'Successfully updated client', 'created_client' => 'Successfully created client', 'archived_client' => 'Successfully archived client', 'archived_clients' => 'Successfully archived :count clients', 'deleted_client' => 'Successfully deleted client', 'deleted_clients' => 'Successfully deleted :count clients', - 'updated_invoice' => 'Successfully updated invoice', 'created_invoice' => 'Successfully created invoice', 'cloned_invoice' => 'Successfully cloned invoice', @@ -228,7 +215,6 @@ $LANG = array( 'archived_invoices' => 'Successfully archived :count invoices', 'deleted_invoice' => 'Successfully deleted invoice', 'deleted_invoices' => 'Successfully deleted :count invoices', - 'created_payment' => 'Successfully created payment', 'created_payments' => 'Successfully created :count payment(s)', 'archived_payment' => 'Successfully archived payment', @@ -236,21 +222,18 @@ $LANG = array( 'deleted_payment' => 'Successfully deleted payment', 'deleted_payments' => 'Successfully deleted :count payments', 'applied_payment' => 'Successfully applied payment', - 'created_credit' => 'Successfully created credit', 'archived_credit' => 'Successfully archived credit', 'archived_credits' => 'Successfully archived :count credits', 'deleted_credit' => 'Successfully deleted credit', 'deleted_credits' => 'Successfully deleted :count credits', 'imported_file' => 'Successfully imported file', - 'updated_vendor' => 'Successfully updated vendor', 'created_vendor' => 'Successfully created vendor', 'archived_vendor' => 'Successfully archived vendor', 'archived_vendors' => 'Successfully archived :count vendors', 'deleted_vendor' => 'Successfully deleted vendor', 'deleted_vendors' => 'Successfully deleted :count vendors', - 'confirmation_subject' => 'Invoice Ninja Account Confirmation', 'confirmation_header' => 'Account Confirmation', 'confirmation_message' => 'Please access the link below to confirm your account.', @@ -261,7 +244,6 @@ $LANG = array( 'email_salutation' => 'Dear :name,', 'email_signature' => 'Regards,', 'email_from' => 'The Invoice Ninja Team', - 'user_email_footer' => 'To adjust your email notification settings please visit '.SITE_URL.'/settings/notifications', 'invoice_link_message' => 'To view the invoice click the link below:', 'notification_invoice_paid_subject' => 'Invoice :invoice was paid by :client', 'notification_invoice_sent_subject' => 'Invoice :invoice was sent to :client', @@ -270,29 +252,11 @@ $LANG = array( 'notification_invoice_sent' => 'The following client :client was emailed Invoice :invoice for :amount.', 'notification_invoice_viewed' => 'The following client :client viewed Invoice :invoice for :amount.', 'reset_password' => 'You can reset your account password by clicking the following button:', - 'reset_password_footer' => 'If you did not request this password reset please email our support: '.CONTACT_EMAIL, - 'secure_payment' => 'Secure Payment', 'card_number' => 'Card Number', 'expiration_month' => 'Expiration Month', 'expiration_year' => 'Expiration Year', 'cvv' => 'CVV', - - 'security' => [ - 'too_many_attempts' => 'Too many attempts. Try again in few minutes.', - 'wrong_credentials' => 'Incorrect email or password.', - 'confirmation' => 'Your account has been confirmed!', - 'wrong_confirmation' => 'Wrong confirmation code.', - 'password_forgot' => 'The information regarding password reset was sent to your email.', - 'password_reset' => 'Your password has been changed successfully.', - 'wrong_password_reset' => 'Invalid password. Try again', - ], - - 'pro_plan' => [ - 'remove_logo' => ':link to remove the Invoice Ninja logo by joining the Pro Plan', - 'remove_logo_link' => 'Click here', - ], - 'logout' => 'Log Out', 'sign_up_to_save' => 'Sign up to save your work', 'agree_to_terms' => 'I agree to the Invoice Ninja :terms', @@ -303,7 +267,6 @@ $LANG = array( 'success_message' => 'You have successfully registered! Please visit the link in the account confirmation email to verify your email address.', 'erase_data' => 'This will permanently erase your data.', 'password' => 'Password', - 'pro_plan_product' => 'Pro Plan', 'pro_plan_description' => 'One year enrollment in the Invoice Ninja Pro Plan.', 'pro_plan_success' => 'Thanks for choosing Invoice Ninja\'s Pro plan!

     
    @@ -313,7 +276,6 @@ $LANG = array( for a year of Pro-level invoicing.

    Can\'t find the invoice? Need further assistance? We\'re happy to help -- email us at contact@invoiceninja.com', - 'unsaved_changes' => 'You have unsaved changes', 'custom_fields' => 'Custom Fields', 'company_fields' => 'Company Fields', @@ -323,7 +285,6 @@ $LANG = array( 'edit' => 'Edit', 'set_name' => 'Set your company name', 'view_as_recipient' => 'View as recipient', - 'product_library' => 'Product Library', 'product' => 'Product', 'products' => 'Product Library', @@ -338,17 +299,14 @@ $LANG = array( 'created_product' => 'Successfully created product', 'archived_product' => 'Successfully archived product', 'pro_plan_custom_fields' => ':link to enable custom fields by joining the Pro Plan', - 'advanced_settings' => 'Advanced Settings', 'pro_plan_advanced_settings' => ':link to enable the advanced settings by joining the Pro Plan', 'invoice_design' => 'Invoice Design', 'specify_colors' => 'Specify colors', 'specify_colors_label' => 'Select the colors used in the invoice', - 'chart_builder' => 'Chart Builder', 'ninja_email_footer' => 'Use :site to invoice your clients and get paid online for free!', 'go_pro' => 'Go Pro', - 'quote' => 'Quote', 'quotes' => 'Quotes', 'quote_number' => 'Quote Number', @@ -358,7 +316,6 @@ $LANG = array( 'your_quote' => 'Your Quote', 'total' => 'Total', 'clone' => 'Clone', - 'new_quote' => 'New Quote', 'create_quote' => 'Create Quote', 'edit_quote' => 'Edit Quote', @@ -371,7 +328,6 @@ $LANG = array( 'view_invoice' => 'View Invoice', 'view_client' => 'View Client', 'view_quote' => 'View Quote', - 'updated_quote' => 'Successfully updated quote', 'created_quote' => 'Successfully created quote', 'cloned_quote' => 'Successfully cloned quote', @@ -381,7 +337,6 @@ $LANG = array( 'deleted_quote' => 'Successfully deleted quote', 'deleted_quotes' => 'Successfully deleted :count quotes', 'converted_to_invoice' => 'Successfully converted quote to invoice', - 'quote_subject' => 'New quote $quote from :account', 'quote_message' => 'To view your quote for :amount, click the link below.', 'quote_link_message' => 'To view your client quote click the link below:', @@ -389,16 +344,13 @@ $LANG = array( 'notification_quote_viewed_subject' => 'Quote :invoice was viewed by :client', 'notification_quote_sent' => 'The following client :client was emailed Quote :invoice for :amount.', 'notification_quote_viewed' => 'The following client :client viewed Quote :invoice for :amount.', - 'session_expired' => 'Your session has expired.', - 'invoice_fields' => 'Invoice Fields', 'invoice_options' => 'Invoice Options', 'hide_quantity' => 'Hide Quantity', 'hide_quantity_help' => 'If your line items quantities are always 1, then you can declutter invoices by no longer displaying this field.', 'hide_paid_to_date' => 'Hide Paid to Date', 'hide_paid_to_date_help' => 'Only display the "Paid to Date" area on your invoices once a payment has been received.', - 'charge_taxes' => 'Charge taxes', 'user_management' => 'User Management', 'add_user' => 'Add User', @@ -413,21 +365,16 @@ $LANG = array( 'active' => 'Active', 'pending' => 'Pending', 'deleted_user' => 'Successfully deleted user', - 'limit_users' => 'Sorry, this will exceed the limit of '.MAX_NUM_USERS.' users', - 'confirm_email_invoice' => 'Are you sure you want to email this invoice?', 'confirm_email_quote' => 'Are you sure you want to email this quote?', 'confirm_recurring_email_invoice' => 'Are you sure you want this invoice emailed?', - 'cancel_account' => 'Cancel Account', 'cancel_account_message' => 'Warning: This will permanently erase all of your data, there is no undo.', 'go_back' => 'Go Back', - 'data_visualizations' => 'Data Visualizations', 'sample_data' => 'Sample data shown', 'hide' => 'Hide', 'new_version_available' => 'A new version of :releases_link is available. You\'re running v:user_version, the latest is v:latest_version', - 'invoice_settings' => 'Invoice Settings', 'invoice_number_prefix' => 'Invoice Number Prefix', 'invoice_number_counter' => 'Invoice Number Counter', @@ -437,59 +384,48 @@ $LANG = array( 'invoice_issued_to' => 'Invoice issued to', 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix', 'mark_sent' => 'Mark Sent', - 'gateway_help_1' => ':link to sign up for Authorize.net.', 'gateway_help_2' => ':link to sign up for Authorize.net.', 'gateway_help_17' => ':link to get your PayPal API signature.', 'gateway_help_27' => ':link to sign up for TwoCheckout.', - 'more_designs' => 'More designs', 'more_designs_title' => 'Additional Invoice Designs', 'more_designs_cloud_header' => 'Go Pro for more invoice designs', 'more_designs_cloud_text' => '', - 'more_designs_self_host_header' => 'Get 6 more invoice designs for just $'.INVOICE_DESIGNS_PRICE, 'more_designs_self_host_text' => '', 'buy' => 'Buy', 'bought_designs' => 'Successfully added additional invoice designs', 'sent' => 'sent', - 'vat_number' => 'VAT Number', 'timesheets' => 'Timesheets', - 'payment_title' => 'Enter Your Billing Address and Credit Card information', 'payment_cvv' => '*This is the 3-4 digit number onthe back of your card', 'payment_footer1' => '*Billing address must match address associated with credit card.', 'payment_footer2' => '*Please click "PAY NOW" only once - transaction may take up to 1 minute to process.', - 'id_number' => 'ID Number', 'white_label_link' => 'White label', 'white_label_header' => 'White Label', 'bought_white_label' => 'Successfully enabled white label license', 'white_labeled' => 'White labeled', - 'restore' => 'Restore', 'restore_invoice' => 'Restore Invoice', 'restore_quote' => 'Restore Quote', 'restore_client' => 'Restore Client', 'restore_credit' => 'Restore Credit', 'restore_payment' => 'Restore Payment', - 'restored_invoice' => 'Successfully restored invoice', 'restored_quote' => 'Successfully restored quote', 'restored_client' => 'Successfully restored client', 'restored_payment' => 'Successfully restored payment', 'restored_credit' => 'Successfully restored credit', - 'reason_for_canceling' => 'Help us improve our site by telling us why you\'re leaving.', 'discount_percent' => 'Percent', 'discount_amount' => 'Amount', - 'invoice_history' => 'Invoice History', 'quote_history' => 'Quote History', 'current_version' => 'Current version', 'select_versiony' => 'Select version', 'view_history' => 'View History', - 'edit_payment' => 'Edit Payment', 'updated_payment' => 'Successfully updated payment', 'deleted' => 'Deleted', @@ -502,7 +438,6 @@ $LANG = array( 'quote_email' => 'Quote Email', 'reset_all' => 'Reset All', 'approve' => 'Approve', - 'token_billing_type_id' => 'Token Billing', 'token_billing_help' => 'Enables you to store credit cards with your gateway, and charge them at a later date.', 'token_billing_1' => 'Disabled', @@ -515,7 +450,6 @@ $LANG = array( 'edit_payment_details' => 'Edit payment details', 'token_billing' => 'Save card details', 'token_billing_secure' => 'The data is stored securely by :stripe_link', - 'support' => 'Support', 'contact_information' => 'Contact Information', '256_encryption' => '256-Bit Encryption', @@ -525,10 +459,8 @@ $LANG = array( 'order_overview' => 'Order overview', 'match_address' => '*Address must match address associated with credit card.', 'click_once' => '*Please click "PAY NOW" only once - transaction may take up to 1 minute to process.', - 'invoice_footer' => 'Invoice Footer', 'save_as_default_footer' => 'Save as default footer', - 'token_management' => 'Token Management', 'tokens' => 'Tokens', 'add_token' => 'Add Token', @@ -539,7 +471,6 @@ $LANG = array( 'edit_token' => 'Edit Token', 'delete_token' => 'Delete Token', 'token' => 'Token', - 'add_gateway' => 'Add Gateway', 'delete_gateway' => 'Delete Gateway', 'edit_gateway' => 'Edit Gateway', @@ -548,7 +479,6 @@ $LANG = array( 'deleted_gateway' => 'Successfully deleted gateway', 'pay_with_paypal' => 'PayPal', 'pay_with_card' => 'Credit Card', - 'change_password' => 'Change password', 'current_password' => 'Current password', 'new_password' => 'New password', @@ -556,7 +486,6 @@ $LANG = 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', 'account_login' => 'Account Login', @@ -564,18 +493,15 @@ $LANG = array( 'forgot_password' => 'Forgot your password?', 'email_address' => 'Email address', 'lets_go' => 'Let\'s go', - 'password_recovery' => 'Password Recovery', 'send_email' => 'Send email', 'set_password' => 'Set Password', 'converted' => 'Converted', - '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', - 'gateway_help_42' => ':link to sign up for BitPay.
    Note: use a Legacy API Key, not an API token.', 'payment_type_credit_card' => 'Credit Card', 'payment_type_paypal' => 'PayPal', @@ -583,7 +509,6 @@ $LANG = array( 'knowledge_base' => 'Knowledge Base', 'partial' => 'Partial', 'partial_remaining' => ':partial of :balance', - 'more_fields' => 'More Fields', 'less_fields' => 'Less Fields', 'client_name' => 'Client Name', @@ -594,7 +519,6 @@ $LANG = array( 'view_documentation' => 'View Documentation', 'app_title' => 'Free Open-Source Online Invoicing', 'app_description' => 'Invoice Ninja is a free, open-source solution for invoicing and billing customers. With Invoice Ninja, you can easily build and send beautiful invoices from any device that has access to the web. Your clients can print your invoices, download them as pdf files, and even pay you online from within the system.', - 'rows' => 'rows', 'www' => 'www', 'logo' => 'Logo', @@ -614,7 +538,6 @@ $LANG = array( 'zapier' => 'Zapier', 'recurring' => 'Recurring', 'last_invoice_sent' => 'Last invoice sent :date', - 'processed_updates' => 'Successfully completed update', 'tasks' => 'Tasks', 'new_task' => 'New Task', @@ -660,12 +583,10 @@ $LANG = array( 'invoice_labels' => 'Invoice Labels', 'prefix' => 'Prefix', 'counter' => 'Counter', - 'payment_type_dwolla' => 'Dwolla', 'gateway_help_43' => ':link to sign up for Dwolla', 'partial_value' => 'Must be greater than zero and less than the total', 'more_actions' => 'More Actions', - 'pro_plan_title' => 'NINJA PRO', 'pro_plan_call_to_action' => 'Upgrade Now!', 'pro_plan_feature1' => 'Create Unlimited Clients', @@ -676,14 +597,12 @@ $LANG = array( 'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices', 'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering', 'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails', - 'resume' => 'Resume', 'break_duration' => 'Break', 'edit_details' => 'Edit Details', 'work' => 'Work', 'timezone_unset' => 'Please :link to set your timezone', 'click_here' => 'click here', - 'email_receipt' => 'Email payment receipt to the client', 'created_payment_emailed_client' => 'Successfully created payment and emailed client', 'add_company' => 'Add Company', @@ -693,10 +612,8 @@ $LANG = array( 'unlinked_account' => 'Successfully unlinked accounts', 'login' => 'Login', 'or' => 'or', - 'email_error' => 'There was a problem sending the email', 'confirm_recurring_timing' => 'Note: emails are sent at the start of the hour.', - 'old_browser' => 'Please use a newer browser', 'payment_terms_help' => 'Sets the default invoice due date', 'unlink_account' => 'Unlink Account', 'unlink' => 'Unlink', @@ -717,7 +634,6 @@ $LANG = array( 'primary_color' => 'Primary Color', 'secondary_color' => 'Secondary Color', 'customize_design' => 'Customize Design', - 'content' => 'Content', 'styles' => 'Styles', 'defaults' => 'Defaults', @@ -731,7 +647,6 @@ $LANG = array( 'outstanding' => 'Outstanding', 'manage_companies' => 'Manage Companies', 'total_revenue' => 'Total Revenue', - 'current_user' => 'Current User', 'new_recurring_invoice' => 'New Recurring Invoice', 'recurring_invoice' => 'Recurring Invoice', @@ -743,7 +658,6 @@ $LANG = array(

    You can access any invoice field by adding Value to the end. For example $invoiceNumberValue displays the invoice number.

    To access a child property using dot notation. For example to show the client name you could use $client.nameValue.

    If you need help figuring something out post a question to our support forum.

    ', - 'invoice_due_date' => 'Due Date', 'quote_due_date' => 'Valid Until', 'valid_until' => 'Valid Until', @@ -756,15 +670,12 @@ $LANG = array( 'status_partial' => 'Partial', 'status_paid' => 'Paid', 'show_line_item_tax' => 'Display line item taxes inline', - 'iframe_url' => 'Website', 'iframe_url_help1' => 'Copy the following code to a page on your site.', 'iframe_url_help2' => 'You can test the feature by clicking \'View as recipient\' for an invoice.', - 'auto_bill' => 'Auto Bill', 'military_time' => '24 Hour Time', 'last_sent' => 'Last Sent', - 'reminder_emails' => 'Reminder Emails', 'templates_and_reminders' => 'Templates & Reminders', 'subject' => 'Subject', @@ -776,15 +687,12 @@ $LANG = array( 'reminder_subject' => 'Reminder: Invoice :invoice from :account', 'reset' => 'Reset', 'invoice_not_found' => 'The requested invoice is not available', - 'referral_program' => 'Referral Program', 'referral_code' => 'Referral URL', 'last_sent_on' => 'Sent Last: :date', - 'page_expire' => 'This page will expire soon, :click_here to keep working', 'upcoming_quotes' => 'Upcoming Quotes', 'expired_quotes' => 'Expired Quotes', - 'sign_up_using' => 'Sign up using', 'invalid_credentials' => 'These credentials do not match our records', 'show_all_options' => 'Show all options', @@ -793,18 +701,10 @@ $LANG = array( 'disable' => 'Disable', 'invoice_quote_number' => 'Invoice and Quote Numbers', 'invoice_charges' => 'Invoice Charges', - - 'invitation_status' => [ - 'sent' => 'Email Sent', - 'opened' => 'Email Openend', - 'viewed' => 'Invoice Viewed', - ], - 'notification_invoice_bounced' => 'We were unable to deliver Invoice :invoice to :contact.', 'notification_invoice_bounced_subject' => 'Unable to deliver Invoice :invoice', 'notification_quote_bounced' => 'We were unable to deliver Quote :invoice to :contact.', 'notification_quote_bounced_subject' => 'Unable to deliver Quote :invoice', - 'custom_invoice_link' => 'Custom Invoice Link', 'total_invoiced' => 'Total Invoiced', 'open_balance' => 'Open Balance', @@ -812,15 +712,12 @@ $LANG = array( 'basic_settings' => 'Basic Settings', 'pro' => 'Pro', 'gateways' => 'Payment Gateways', - 'next_send_on' => 'Send Next: :date', 'no_longer_running' => 'This invoice is not scheduled to run', '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', - 'enable_with_stripe' => 'Enable | Requires Stripe', 'tax_settings' => 'Tax Settings', 'create_tax_rate' => 'Add Tax Rate', @@ -841,7 +738,6 @@ $LANG = array( 'invoice_counter' => 'Invoice Counter', 'quote_counter' => 'Quote Counter', 'type' => 'Type', - 'activity_1' => ':user created client :client', 'activity_2' => ':user archived client :client', 'activity_3' => ':user deleted client :client', @@ -879,7 +775,6 @@ $LANG = array( 'activity_35' => ':user created :vendor', 'activity_36' => ':user created :vendor', 'activity_37' => ':user created :vendor', - 'payment' => 'Payment', 'system' => 'System', 'signature' => 'Email Signature', @@ -890,7 +785,6 @@ $LANG = array( 'default_invoice_footer' => 'Default Invoice Footer', 'quote_footer' => 'Quote Footer', 'free' => 'Free', - 'quote_is_approved' => 'This quote is approved', 'apply_credit' => 'Apply Credit', 'system_settings' => 'System Settings', @@ -908,7 +802,6 @@ $LANG = array( 'restored_recurring_invoice' => 'Successfully restored recurring invoice', 'archived' => 'Archived', 'untitled_account' => 'Untitled Company', - 'before' => 'Before', 'after' => 'After', 'reset_terms_help' => 'Reset to the default account terms', @@ -917,7 +810,6 @@ $LANG = array( 'user' => 'User', 'country' => 'Country', 'include' => 'Include', - 'logo_too_large' => 'Your logo is :size, for better PDF performance we suggest uploading an image file less than 200KB', 'import_freshbooks' => 'Import From FreshBooks', 'import_data' => 'Import Data', @@ -928,16 +820,6 @@ $LANG = array( 'task_file' => 'Task File', 'no_mapper' => 'No valid mapping for file', 'invalid_csv_header' => 'Invalid CSV Header', - - 'email_errors' => [ - 'inactive_client' => 'Emails can not be sent to inactive clients', - 'inactive_contact' => 'Emails can not be sent to inactive contacts', - 'inactive_invoice' => 'Emails can not be sent to inactive invoices', - 'user_unregistered' => 'Please register your account to send emails', - 'user_unconfirmed' => 'Please confirm your account to send emails', - 'invalid_contact_email' => 'Invalid contact email', - ], - 'client_portal' => 'Client Portal', 'admin' => 'Admin', 'disabled' => 'Disabled', @@ -946,11 +828,9 @@ $LANG = array( 'invoice_will_create' => 'client will be created', 'invoices_will_create' => 'invoices will be created', 'failed_to_import' => 'The following records failed to import', - 'publishable_key' => 'Publishable Key', 'secret_key' => 'Secret Key', 'missing_publishable_key' => 'Set your Stripe publishable key for an improved checkout process', - 'email_design' => 'Email Design', 'due_by' => 'Due by :date', 'enable_email_markup' => 'Enable Markup', @@ -962,7 +842,6 @@ $LANG = array( 'plain' => 'Plain', 'light' => 'Light', 'dark' => 'Dark', - 'industry_help' => 'Used to provide comparisons against the averages of companies of similar size and industry.', 'subdomain_help' => 'Customize the invoice link subdomain or display the invoice on your own website.', 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', @@ -971,7 +850,6 @@ $LANG = array( 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', - 'token_expired' => 'Validation token was expired. Please try again.', 'invoice_link' => 'Invoice Link', 'button_confirmation_message' => 'Click to confirm your email address.', @@ -980,7 +858,6 @@ $LANG = array( 'created_invoices' => 'Successfully created :count invoice(s)', 'next_invoice_number' => 'The next invoice number is :number.', 'next_quote_number' => 'The next quote number is :number.', - 'days_before' => 'days before', 'days_after' => 'days after', 'field_due_date' => 'due date', @@ -988,10 +865,7 @@ $LANG = array( 'schedule' => 'Schedule', 'email_designs' => 'Email Designs', 'assigned_when_sent' => 'Assigned when sent', - - 'white_label_custom_css' => ':link for $'.WHITE_LABEL_PRICE.' to enable custom styling and help support our project.', 'white_label_purchase_link' => 'Purchase a white label license', - 'expense' => 'Expense', 'expenses' => 'Expenses', 'new_expense' => 'Enter Expense', @@ -1008,7 +882,6 @@ $LANG = array( 'archived_expense' => 'Successfully archived expense', 'deleted_expenses' => 'Successfully deleted expenses', 'archived_expenses' => 'Successfully archived expenses', - 'expense_amount' => 'Expense Amount', 'expense_balance' => 'Expense Balance', 'expense_date' => 'Expense Date', @@ -1033,13 +906,11 @@ $LANG = array( 'expense_error_multiple_clients' => 'The expenses can\'t belong to different clients', 'expense_error_invoiced' => 'Expense has already been invoiced', 'convert_currency' => 'Convert currency', - 'num_days' => 'Number of days', 'create_payment_term' => 'Create Payment Term', 'edit_payment_terms' => 'Edit Payment Term', 'edit_payment_term' => 'Edit Payment Term', 'archive_payment_term' => 'Archive Payment Term', - 'recurring_due_dates' => 'Recurring Invoice Due Dates', 'recurring_due_date_help' => '

    Automatically sets a due date for the invoice.

    Invoices on a monthly or yearly cycle set to be due on or before the day they are created will be due the next month. Invoices set to be due on the 29th or 30th in months that don\'t have that day will be due the last day of the month.

    @@ -1067,14 +938,11 @@ $LANG = array( 'thursday' => 'Thursday', 'friday' => 'Friday', 'saturday' => 'Saturday', - 'header_font_id' => 'Header Font', 'body_font_id' => 'Body Font', 'color_font_help' => 'Note: the primary color and fonts are also used in the client portal and custom email designs.', - 'live_preview' => 'Live Preview', 'invalid_mail_config' => 'Unable to send email, please check that the mail settings are correct.', - 'invoice_message_button' => 'To view your invoice for :amount, click the button below.', 'quote_message_button' => 'To view your quote for :amount, click the button below.', 'payment_message_button' => 'Thank you for your payment of :amount.', @@ -1091,7 +959,6 @@ $LANG = array( 'archived_bank_account' => 'Successfully archived bank account', 'created_bank_account' => 'Successfully created bank account', 'validate_bank_account' => 'Validate Bank Account', - 'bank_accounts_help' => 'Connect a bank account to automatically import expenses and create vendors. Supports American Express and 400+ US banks.', 'bank_password_help' => 'Note: your password is transmitted securely and never stored on our servers.', 'bank_password_warning' => 'Warning: your password may be transmitted in plain text, consider enabling HTTPS.', 'username' => 'Username', @@ -1105,7 +972,6 @@ $LANG = array( 'validate' => 'Validate', 'info' => 'Info', 'imported_expenses' => 'Successfully created :count_vendors vendor(s) and :count_expenses expense(s)', - 'iframe_url_help3' => 'Note: if you plan on accepting credit cards details we strongly recommend enabling HTTPS on your site.', 'expense_error_multiple_currencies' => 'The expenses can\'t have different currencies.', 'expense_error_mismatch_currencies' => 'The client\'s currency does not match the expense currency.', @@ -1126,11 +992,44 @@ $LANG = array( 'trial_call_to_action' => 'Start Free Trial', 'trial_success' => 'Successfully enabled two week free pro plan trial', 'overdue' => 'Overdue', - 'white_label_text' => 'Purchase a ONE YEAR white label license for $'.WHITE_LABEL_PRICE.' to remove the Invoice Ninja branding from the client portal and help support our project.', - 'convert_currency' => 'Convert currency', + + 'white_label_text' => 'Purchase a ONE YEAR white label license for $'.WHITE_LABEL_PRICE.' to remove the Invoice Ninja branding from the client portal and help support our project.', + 'user_email_footer' => 'To adjust your email notification settings please visit '.SITE_URL.'/settings/notifications', + 'reset_password_footer' => 'If you did not request this password reset please email our support: '.CONTACT_EMAIL, + 'limit_users' => 'Sorry, this will exceed the limit of '.MAX_NUM_USERS.' users', + 'more_designs_self_host_header' => 'Get 6 more invoice designs for just $'.INVOICE_DESIGNS_PRICE, + 'old_browser' => 'Please use a newer browser', + 'white_label_custom_css' => ':link for $'.WHITE_LABEL_PRICE.' to enable custom styling and help support our project.', + 'bank_accounts_help' => 'Connect a bank account to automatically import expenses and create vendors. Supports American Express and 400+ US banks.', + 'security' => [ + 'too_many_attempts' => 'Too many attempts. Try again in few minutes.', + 'wrong_credentials' => 'Incorrect email or password.', + 'confirmation' => 'Your account has been confirmed!', + 'wrong_confirmation' => 'Wrong confirmation code.', + 'password_forgot' => 'The information regarding password reset was sent to your email.', + 'password_reset' => 'Your password has been changed successfully.', + 'wrong_password_reset' => 'Invalid password. Try again', + ], + 'pro_plan' => [ + 'remove_logo' => ':link to remove the Invoice Ninja logo by joining the Pro Plan', + 'remove_logo_link' => 'Click here', + ], + 'invitation_status' => [ + 'sent' => 'Email Sent', + 'opened' => 'Email Openend', + 'viewed' => 'Invoice Viewed', + ], + 'email_errors' => [ + 'inactive_client' => 'Emails can not be sent to inactive clients', + 'inactive_contact' => 'Emails can not be sent to inactive contacts', + 'inactive_invoice' => 'Emails can not be sent to inactive invoices', + 'user_unregistered' => 'Please register your account to send emails', + 'user_unconfirmed' => 'Please confirm your account to send emails', + 'invalid_contact_email' => 'Invalid contact email', + ], ); return $LANG; -?> \ No newline at end of file +?>. \ No newline at end of file From 06fa2e5dc48b3e83602f9bac2844f93f02ebd3fd Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 19:31:22 +0200 Subject: [PATCH 110/130] Working on Travis --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f39a3a6142bd..81d522bfbb01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,9 @@ sudo: true php: - 5.5 - - 5.6 - - 7.0 - - hhvm +# - 5.6 +# - 7.0 +# - hhvm addons: hosts: From 6b64910c9daddd87ffa89ee6ea0e1bed745ea6ec Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 20:14:48 +0200 Subject: [PATCH 111/130] Prevent reloading page when showing/hiding archived --- app/Http/Controllers/AccountController.php | 8 +------- resources/views/accounts/api_tokens.blade.php | 8 ++++++-- resources/views/accounts/user_management.blade.php | 6 +++++- resources/views/datatable.blade.php | 6 +++++- resources/views/list.blade.php | 6 +++++- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 4b12b6802e90..6c0f59a3ba91 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -117,13 +117,7 @@ class AccountController extends BaseController { Session::put("show_trash:{$entityType}", $visible == 'true'); - if ($entityType == 'user') { - return Redirect::to('settings/'.ACCOUNT_USER_MANAGEMENT); - } elseif ($entityType == 'token') { - return Redirect::to('settings/'.ACCOUNT_API_TOKENS); - } else { - return Redirect::to("{$entityType}s"); - } + return RESULT_SUCCESS; } public function getSearchData() diff --git a/resources/views/accounts/api_tokens.blade.php b/resources/views/accounts/api_tokens.blade.php index efbd41e283e1..4612b1cbfedd 100644 --- a/resources/views/accounts/api_tokens.blade.php +++ b/resources/views/accounts/api_tokens.blade.php @@ -42,9 +42,13 @@ function setTrashVisible() { var checked = $('#trashed').is(':checked'); - window.location = '{!! URL::to('view_archive/token') !!}' + (checked ? '/true' : '/false'); + var url = '{{ URL::to('view_archive/token') }}' + (checked ? '/true' : '/false'); + + $.get(url, function(data) { + refreshDatatable(); + }) } - + @stop diff --git a/resources/views/accounts/user_management.blade.php b/resources/views/accounts/user_management.blade.php index 0fc17a7a3fa4..a7f70f925b7a 100644 --- a/resources/views/accounts/user_management.blade.php +++ b/resources/views/accounts/user_management.blade.php @@ -39,7 +39,11 @@ function setTrashVisible() { var checked = $('#trashed').is(':checked'); - window.location = '{!! URL::to('view_archive/user') !!}' + (checked ? '/true' : '/false'); + var url = '{{ URL::to('view_archive/user') }}' + (checked ? '/true' : '/false'); + + $.get(url, function(data) { + refreshDatatable(); + }) } diff --git a/resources/views/datatable.blade.php b/resources/views/datatable.blade.php index 2d0b78d9faa4..4c73a7d24875 100644 --- a/resources/views/datatable.blade.php +++ b/resources/views/datatable.blade.php @@ -42,8 +42,12 @@ }); @endif + function refreshDatatable() { + window.dataTable.api().ajax.reload(); + } + function load_{{ $class }}() { - jQuery('.{{ $class }}').dataTable({ + window.dataTable = jQuery('.{{ $class }}').dataTable({ "fnRowCallback": function(row, data) { if (data[0].indexOf('ENTITY_DELETED') > 0) { $(row).addClass('entityDeleted'); diff --git a/resources/views/list.blade.php b/resources/views/list.blade.php index 93aebcebb262..6e567bf3de75 100644 --- a/resources/views/list.blade.php +++ b/resources/views/list.blade.php @@ -101,7 +101,11 @@ function setTrashVisible() { var checked = $('#trashed').is(':checked'); - window.location = '{{ URL::to('view_archive/' . $entityType) }}' + (checked ? '/true' : '/false'); + var url = '{{ URL::to('view_archive/' . $entityType) }}' + (checked ? '/true' : '/false'); + + $.get(url, function(data) { + refreshDatatable(); + }) } $(function() { From 4973246aedec2b6a08a68d02f11851de1b7be99e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 20:46:28 +0200 Subject: [PATCH 112/130] Working on Travis --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 81d522bfbb01..5c8eeb309278 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ install: - travis_retry composer install --prefer-dist; before_script: + # prevent MySQL went away error - mysql -u root -e 'SET @@GLOBAL.wait_timeout=28800;' # copy configuration files - cp .env.example .env @@ -45,6 +46,7 @@ before_script: - sed -i 's/APP_ENV=production/APP_ENV=development/g' .env - sed -i 's/APP_DEBUG=false/APP_DEBUG=true/g' .env - sed -i 's/REQUIRE_HTTPS=false/NINJA_DEV=true/g' .env + - cat .env # create the database and user - mysql -u root -e "create database IF NOT EXISTS ninja;" - mysql -u root -e "GRANT ALL PRIVILEGES ON ninja.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;" From fed9078c42c4c80d77c2be56415f4eec3c31660e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 23:05:30 +0200 Subject: [PATCH 113/130] Travis... --- .travis.yml | 1 - app/Libraries/Utils.php | 4 ++-- tests/acceptance/OnlinePaymentCest.php | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5c8eeb309278..d13457af1a40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,6 @@ before_script: - sed -i 's/APP_ENV=production/APP_ENV=development/g' .env - sed -i 's/APP_DEBUG=false/APP_DEBUG=true/g' .env - sed -i 's/REQUIRE_HTTPS=false/NINJA_DEV=true/g' .env - - cat .env # create the database and user - mysql -u root -e "create database IF NOT EXISTS ninja;" - mysql -u root -e "GRANT ALL PRIVILEGES ON ninja.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;" diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index 53a586f804be..340cfdfeba48 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -62,12 +62,12 @@ class Utils return true; } - return isset($_ENV['NINJA_PROD']) && $_ENV['NINJA_PROD'] == 'true'; + return env('NINJA_PROD') == 'true'; } public static function isNinjaDev() { - return isset($_ENV['NINJA_DEV']) && $_ENV['NINJA_DEV'] == 'true'; + return env('NINJA_DEV') == 'true'; } public static function requireHTTPS() diff --git a/tests/acceptance/OnlinePaymentCest.php b/tests/acceptance/OnlinePaymentCest.php index c0dccf6188bd..ad4b15517579 100644 --- a/tests/acceptance/OnlinePaymentCest.php +++ b/tests/acceptance/OnlinePaymentCest.php @@ -28,7 +28,7 @@ class OnlinePaymentCest if (strpos($I->grabFromCurrentUrl(), 'create') !== false) { $I->fillField(['name' =>'23_apiKey'], env('stripe_secret_key') ?: Fixtures::get('stripe_secret_key')); // Fails to load StripeJS causing "ReferenceError: Can't find variable: Stripe" - //$I->fillField(['name' =>'publishable_key'], Fixtures::get('publishable_key')); + //$I->fillField(['name' =>'stripe_publishable_key'], env('stripe_secret_key') ?: Fixtures::get('stripe_publishable_key')); $I->selectOption('#token_billing_type_id', 4); $I->click('Save'); $I->see('Successfully created gateway'); From 1caf32a00ccb1b12359e1539642de69b143e7c6f Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Feb 2016 23:27:44 +0200 Subject: [PATCH 114/130] Enabled remaining tests --- .travis.yml | 20 ++++++++++---------- app/Http/routes.php | 5 ++--- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index d13457af1a40..94a69dc7696b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,17 +64,17 @@ before_script: script: #- php ./vendor/codeception/codeception/codecept run --html --debug - #- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php - php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php #- php ./vendor/codeception/codeception/codecept run--debug acceptance GoProCest.php after_script: diff --git a/app/Http/routes.php b/app/Http/routes.php index 566f4aa15ae6..11518a589d0b 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -188,9 +188,6 @@ Route::group(['middleware' => 'auth'], function() { Route::get('api/payments/{client_id?}', array('as'=>'api.payments', 'uses'=>'PaymentController@getDatatable')); Route::post('payments/bulk', 'PaymentController@bulk'); - Route::get('credits/{id}/edit', function() { - return View::make('header'); - }); Route::resource('credits', 'CreditController'); Route::get('credits/create/{client_id?}/{invoice_id?}', 'CreditController@create'); Route::get('api/credits/{client_id?}', array('as'=>'api.credits', 'uses'=>'CreditController@getDatatable')); @@ -246,6 +243,7 @@ Route::group(['middleware' => 'api', 'prefix' => 'api/v1'], function() }); // Redirects for legacy links +/* Route::get('/rocksteady', function() { return Redirect::to(NINJA_WEB_URL, 301); }); @@ -273,6 +271,7 @@ Route::get('/compare-online-invoicing{sites?}', function() { Route::get('/forgot_password', function() { return Redirect::to(NINJA_APP_URL.'/forgot', 301); }); +*/ if (!defined('CONTACT_EMAIL')) { define('CONTACT_EMAIL', Config::get('mail.from.address')); From 1cb199f491818122d63a598667ff58373460f875 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 19 Feb 2016 08:42:46 +0200 Subject: [PATCH 115/130] Working on taxes test --- .travis.yml | 20 ++++++++++---------- tests/acceptance/TaxRatesCest.php | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 94a69dc7696b..9393fa105863 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,16 +64,16 @@ before_script: script: #- php ./vendor/codeception/codeception/codecept run --html --debug - - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php - - php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php + #- php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php #- php ./vendor/codeception/codeception/codecept run--debug acceptance GoProCest.php diff --git a/tests/acceptance/TaxRatesCest.php b/tests/acceptance/TaxRatesCest.php index 8abcf444dad3..06ec37575746 100644 --- a/tests/acceptance/TaxRatesCest.php +++ b/tests/acceptance/TaxRatesCest.php @@ -74,6 +74,7 @@ class TaxRatesCest // check total is right before saving $I->see("\${$total}"); $I->click('Save'); + $I->wait(1); $I->see($clientEmail); // check total is right after saving From c57d32189cf66be8bf6086a404e3dc67ef4ca78e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 19 Feb 2016 08:43:26 +0200 Subject: [PATCH 116/130] Working on taxes test --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9393fa105863..a13f714b21cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,6 +78,7 @@ script: #- php ./vendor/codeception/codeception/codecept run--debug acceptance GoProCest.php after_script: + - cat tests/_output/* - cat storage/logs/laravel.log notifications: From e870849289429f3c5337786c0ff4795c4e773354 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 19 Feb 2016 09:03:19 +0200 Subject: [PATCH 117/130] Working on taxes test --- .travis.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index a13f714b21cf..94a69dc7696b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,21 +64,20 @@ before_script: script: #- php ./vendor/codeception/codeception/codecept run --html --debug - #- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php - #- php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php + - php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php #- php ./vendor/codeception/codeception/codecept run--debug acceptance GoProCest.php after_script: - - cat tests/_output/* - cat storage/logs/laravel.log notifications: From b4c03e5cf87a98fcb87dfb53ed2950593b416e56 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 19 Feb 2016 10:56:48 +0200 Subject: [PATCH 118/130] Prevent product without product key --- .travis.yml | 27 ++++++++++---------- app/Ninja/Repositories/InvoiceRepository.php | 3 +-- readme.md | 10 +++----- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 94a69dc7696b..864e94927cf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,19 +63,20 @@ before_script: - curl -L http://ninja.dev:8000/update script: - #- php ./vendor/codeception/codeception/codecept run --html --debug - - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php - - php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php - #- php ./vendor/codeception/codeception/codecept run--debug acceptance GoProCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php + #- php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php + + - sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env + - php ./vendor/codeception/codeception/codecept run--debug acceptance GoProCest.php after_script: - cat storage/logs/laravel.log diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index 47cbf82bbad0..3c4072122d1f 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -418,8 +418,7 @@ class InvoiceRepository extends BaseRepository $expense->save(); } - if ($item['product_key']) { - $productKey = trim($item['product_key']); + if ($productKey = trim($item['product_key'])) { if (\Auth::user()->account->update_products && ! strtotime($productKey)) { $product = Product::findProductByKey($productKey); if (!$product) { diff --git a/readme.md b/readme.md index 8803e480ec1b..2fb4998ffd5e 100644 --- a/readme.md +++ b/readme.md @@ -8,13 +8,9 @@ [![Build Status](https://travis-ci.org/invoiceninja/invoiceninja.svg?branch=develop)](https://travis-ci.org/invoiceninja/invoiceninja) [![Join the chat at https://gitter.im/hillelcoren/invoice-ninja](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hillelcoren/invoice-ninja?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -### Referral Program -* $100 per signup paid over 3 years - [Learn more](https://www.invoiceninja.com/referral-program/) - -### Reseller Program -There are two options: -* 10% of revenue -* $1,000 for a site limited to 1,000 users +### Affiliates Programs +* Referral: $100 per signup paid over 3 years - [Learn more](https://www.invoiceninja.com/referral-program/) +* Reseller: 10% of revenue ### Installation Options * [Self-Host Zip](https://www.invoiceninja.com/knowledgebase/self-host/) - Free From e5253e34336d2ecc2ab0548a9eed598434df0ba1 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 19 Feb 2016 11:04:41 +0200 Subject: [PATCH 119/130] Prevent product without product key --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 864e94927cf7..e1605ba964f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,7 +76,7 @@ script: #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php - sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env - - php ./vendor/codeception/codeception/codecept run--debug acceptance GoProCest.php + - php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php after_script: - cat storage/logs/laravel.log From 1529b5923574bc7f36c7d67360dad62fcfa3a88f Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 19 Feb 2016 11:15:35 +0200 Subject: [PATCH 120/130] Prevent product without product key --- app/Libraries/Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index 340cfdfeba48..027f512a47df 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -72,7 +72,7 @@ class Utils public static function requireHTTPS() { - if (Request::root() === 'http://ninja.dev') { + if (Request::root() === 'http://ninja.dev:8000') { return false; } From dd9805e5b43bfa9400741b7d98e5847c1a3243ff Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 19 Feb 2016 11:41:03 +0200 Subject: [PATCH 121/130] Refined search hot key --- resources/views/header.blade.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index e2c6b92c38e4..7cadbb7a6a45 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -260,8 +260,9 @@ function showSearch() { $('#search').typeahead('setQuery', ''); - $('#search-form').show(); $('#navbar-options').hide(); + $('#search-form').show(); + if (window.hasOwnProperty('searchData')) { $('#search').focus(); } else { @@ -299,7 +300,7 @@ $(".alert-hide").fadeOut(); }, 3000); - $('#search').blur(function(){ + $('#search').blur(function(event){ hideSearch(); }); @@ -354,6 +355,7 @@ // Focus the search input if the user clicks forward slash $('body').keypress(function(event) { if (event.which == 47) { + event.preventDefault(); showSearch(); } }); From dc1924dcdd1be64222526e70fd5b2bc006e4a648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gonz=C3=A1lez?= Date: Sat, 20 Feb 2016 12:09:56 +0100 Subject: [PATCH 122/130] added helper for RewriteBase --- public/.htaccess | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/.htaccess b/public/.htaccess index 77827ae70510..c9a6c555964e 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -12,4 +12,8 @@ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] + + # In case of running InvoiceNinja in a Subdomain like invoiceninja.example.com, + # you have to enablel the following line: + # RewriteBase / From dbd176a49d1cb5fd6044232a1f31fb783a375c4a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 21 Feb 2016 11:57:54 +0200 Subject: [PATCH 123/130] Working on go pro test in Travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e1605ba964f9..c13db455de8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,6 +79,7 @@ script: - php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php after_script: + - mysql -u root -e 'select * from account_gateways;' - cat storage/logs/laravel.log notifications: From bddebfaee612f67fed1fb6fcd478a9466f026115 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 21 Feb 2016 12:15:27 +0200 Subject: [PATCH 124/130] Working on go pro test in Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c13db455de8b..42774698ca11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,7 +79,7 @@ script: - php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php after_script: - - mysql -u root -e 'select * from account_gateways;' + - mysql -u root -e 'select * from account_gateways;' ninja - cat storage/logs/laravel.log notifications: From f557c4fc50320346a67ac736251906bfe2d9929c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 21 Feb 2016 12:28:41 +0200 Subject: [PATCH 125/130] Adding Travis debug --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 42774698ca11..8b21075524b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,7 +79,12 @@ script: - php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php after_script: + - cat .env + - mysql -u root -e 'select * from accounts;' ninja - mysql -u root -e 'select * from account_gateways;' ninja + - mysql -u root -e 'select * from clients;' ninja + - mysql -u root -e 'select * from invoices;' ninja + - mysql -u root -e 'select * from invoice_items;' ninja - cat storage/logs/laravel.log notifications: From 7da1a377715231da51db0798b1303cb7d3cd40ba Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 21 Feb 2016 15:26:27 +0200 Subject: [PATCH 126/130] Added Romanina New Leu --- .travis.yml | 6 +++--- app/Console/Kernel.php | 1 + database/seeds/PaymentLibrariesSeeder.php | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b21075524b9..c7dd08d994c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ before_script: - curl -L http://ninja.dev:8000/update script: - #- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php @@ -75,8 +75,8 @@ script: #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php - - sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env - - php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php + #- sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env + #- php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php after_script: - cat .env diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index e281afb926d4..bd2720afa96f 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -18,6 +18,7 @@ class Kernel extends ConsoleKernel 'App\Console\Commands\SendRenewalInvoices', 'App\Console\Commands\SendReminders', 'App\Console\Commands\TestOFX', + 'App\Console\Commands\GenerateResources', ]; /** diff --git a/database/seeds/PaymentLibrariesSeeder.php b/database/seeds/PaymentLibrariesSeeder.php index 58015b073206..d4d01c76fd92 100644 --- a/database/seeds/PaymentLibrariesSeeder.php +++ b/database/seeds/PaymentLibrariesSeeder.php @@ -126,6 +126,7 @@ class PaymentLibrariesSeeder extends Seeder ['name' => 'Bulgarian Lev', 'code' => 'BGN', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.'], ['name' => 'Aruban Florin', 'code' => 'AWG', 'symbol' => 'Afl. ', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.'], ['name' => 'Turkish Lira', 'code' => 'TRY', 'symbol' => 'TL ', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], + ['name' => 'Romanian New Leu', 'code' => 'RON', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ]; foreach ($currencies as $currency) { From 881dd10e2c857b43efa0b6b2f8b7726c1505e9f8 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 22 Feb 2016 10:30:14 +0200 Subject: [PATCH 127/130] Added file --- app/Console/Commands/GenerateResources.php | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 app/Console/Commands/GenerateResources.php diff --git a/app/Console/Commands/GenerateResources.php b/app/Console/Commands/GenerateResources.php new file mode 100644 index 000000000000..a1dc404f79bb --- /dev/null +++ b/app/Console/Commands/GenerateResources.php @@ -0,0 +1,68 @@ + $value) { + if (is_array($value)) { + echo $key; + } else { + echo "$key => $value\n"; + } + } + } + + protected function getArguments() + { + return array( + //array('example', InputArgument::REQUIRED, 'An example argument.'), + ); + } + + protected function getOptions() + { + return array( + //array('example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null), + ); + } +} From 9f2e82323d5d5e7fce01a46f0998ae886cb0f9e1 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 22 Feb 2016 12:26:26 +0200 Subject: [PATCH 128/130] Fixed invalid payment if auto-billing with invalid token --- app/Services/PaymentService.php | 11 +++++++---- resources/views/clients/show.blade.php | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php index 78e6a031c1f7..66e94e43dced 100644 --- a/app/Services/PaymentService.php +++ b/app/Services/PaymentService.php @@ -273,10 +273,13 @@ class PaymentService extends BaseService // submit purchase/get response $response = $gateway->purchase($details)->send(); - $ref = $response->getTransactionReference(); - - // create payment record - return $this->createPayment($invitation, $accountGateway, $ref); + + if ($response->isSuccessful()) { + $ref = $response->getTransactionReference(); + return $this->createPayment($invitation, $accountGateway, $ref); + } else { + return false; + } } public function getDatatable($clientPublicId, $search) diff --git a/resources/views/clients/show.blade.php b/resources/views/clients/show.blade.php index e4209fdd39ee..c29fffe1df4a 100644 --- a/resources/views/clients/show.blade.php +++ b/resources/views/clients/show.blade.php @@ -22,7 +22,7 @@ @section('content')
    -
    +
    {{ $client->getDisplayName() }} @if ($client->trashed()) @@ -30,7 +30,7 @@ @endif
    -
    +
    {!! Former::open('clients/bulk')->addClass('mainForm') !!}
    From dfd07f1df06c9abd406e7ff066d6b086be466b08 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 22 Feb 2016 15:17:28 +0200 Subject: [PATCH 129/130] Updated readme --- readme.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index 2fb4998ffd5e..1addcb2fd9d1 100644 --- a/readme.md +++ b/readme.md @@ -9,8 +9,8 @@ [![Join the chat at https://gitter.im/hillelcoren/invoice-ninja](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hillelcoren/invoice-ninja?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ### Affiliates Programs -* Referral: $100 per signup paid over 3 years - [Learn more](https://www.invoiceninja.com/referral-program/) -* Reseller: 10% of revenue +* Referral program (we pay you): $100 per signup paid over 3 years - [Learn more](https://www.invoiceninja.com/referral-program/) +* White-label reseller (you pay us): 10% of revenue with a $100 sign up fee ### Installation Options * [Self-Host Zip](https://www.invoiceninja.com/knowledgebase/self-host/) - Free @@ -23,6 +23,10 @@ * MCrypt PHP Extension * MySQL +### Recommended Providers +* [Stripe](https://stripe.com/) +* [Postmark](https://postmarkapp.com/) + ### Features * Built using Laravel 5 * Live PDF generation using [pdfmake](http://pdfmake.org/) @@ -38,10 +42,6 @@ * Custom email templates * [D3.js](http://d3js.org/) visualizations -### Recommended Providers -* [Stripe](https://stripe.com/) -* [Postmark](https://postmarkapp.com/) - ### Documentation * [Ubuntu and Apache](http://blog.technerdservices.com/index.php/2015/04/techpop-how-to-install-invoice-ninja-on-ubuntu-14-04/) * [Debian and Nginx](https://www.rosehosting.com/blog/install-invoice-ninja-on-a-debian-7-vps/) From d79ff8e984f3d6a9951b756f66b4e068753f5ea1 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 22 Feb 2016 15:18:04 +0200 Subject: [PATCH 130/130] Bumped version number to 2.5.0.3 --- app/Http/routes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/routes.php b/app/Http/routes.php index 11518a589d0b..f7bed59f6879 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -509,7 +509,7 @@ if (!defined('CONTACT_EMAIL')) { define('NINJA_GATEWAY_CONFIG', 'NINJA_GATEWAY_CONFIG'); define('NINJA_WEB_URL', 'https://www.invoiceninja.com'); define('NINJA_APP_URL', 'https://app.invoiceninja.com'); - define('NINJA_VERSION', '2.5.0.2'); + define('NINJA_VERSION', '2.5.0.3'); define('NINJA_DATE', '2000-01-01'); define('SOCIAL_LINK_FACEBOOK', 'https://www.facebook.com/invoiceninja');