diff --git a/.travis.yml b/.travis.yml index 8005afdb8..9da900cd7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,12 @@ language: php -sudo: false +sudo: true php: - 5.5 -<<<<<<< HEAD - - 5.6 - - 7.0 - - hhvm -======= # - 5.6 # - 7.0 # - hhvm ->>>>>>> upstream/develop addons: hosts: @@ -51,12 +45,18 @@ before_script: - 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 - 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 +<<<<<<< HEAD +>>>>>>> upstream/develop +======= + - sed -i 's/REQUIRE_HTTPS=false/NINJA_DEV=true/g' .env >>>>>>> upstream/develop # create the database and user - mysql -u root -e "create database IF NOT EXISTS ninja;" @@ -75,13 +75,24 @@ before_script: - curl -L http://ninja.dev:8000/update script: - - php ./vendor/codeception/codeception/codecept run --html --debug + #- 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 <<<<<<< HEAD ======= after_script: - - cat storage/logs/laravel.log - + - cat storage/logs/laravel.log >>>>>>> upstream/develop notifications: diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 4b12b6802..6c0f59a3b 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/app/Http/Controllers/AccountGatewayController.php b/app/Http/Controllers/AccountGatewayController.php index dfbd2b386..58b831503 100644 --- a/app/Http/Controllers/AccountGatewayController.php +++ b/app/Http/Controllers/AccountGatewayController.php @@ -200,7 +200,7 @@ 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'; diff --git a/app/Http/Controllers/ExpenseController.php b/app/Http/Controllers/ExpenseController.php index 6f2a6e884..5535b863e 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/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index 2ba39cd77..f99e12a4d 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')); diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index 53a586f80..340cfdfeb 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/app/Models/Expense.php b/app/Models/Expense.php index 2749607c8..2d1b8041d 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/composer.json b/composer.json index 740e50177..68d48cd64 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 7157dd511..595749316 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/readme.md b/readme.md index d9f7f05a2..8803e480e 100644 --- a/readme.md +++ b/readme.md @@ -5,6 +5,7 @@ # Invoice Ninja ### [https://www.invoiceninja.com](https://www.invoiceninja.com) +[](https://travis-ci.org/invoiceninja/invoiceninja) [](https://gitter.im/hillelcoren/invoice-ninja?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ### Referral Program diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 63ac704fe..0c9bfac16 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -1,8 +1,6 @@ 'Organization', 'name' => 'Name', 'website' => 'Website', @@ -25,8 +23,6 @@ return array( 'size_id' => 'Company Size', 'industry_id' => 'Industry', 'private_notes' => 'Private Notes', - - // invoice 'invoice' => 'Invoice', 'client' => 'Client', 'invoice_date' => 'Invoice Date', @@ -50,7 +46,6 @@ return 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', @@ -74,8 +69,6 @@ return array( 'settings' => 'Settings', 'enable_invoice_tax' => 'Enable specifying an invoice tax', 'enable_line_item_tax' => 'Enable specifying line item taxes', - - // navigation 'dashboard' => 'Dashboard', 'clients' => 'Clients', 'invoices' => 'Invoices', @@ -100,8 +93,6 @@ return array( 'provide_email' => 'Please provide a valid email address', '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.
@@ -111,8 +102,6 @@ return 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', @@ -774,15 +670,12 @@ return 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', @@ -794,15 +687,12 @@ return 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', @@ -811,18 +701,10 @@ return 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', @@ -830,15 +712,12 @@ return 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', @@ -859,7 +738,6 @@ return 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', @@ -897,7 +775,6 @@ return array( 'activity_35' => ':user created :vendor', 'activity_36' => ':user created :vendor', 'activity_37' => ':user created :vendor', - 'payment' => 'Payment', 'system' => 'System', 'signature' => 'Email Signature', @@ -908,7 +785,6 @@ return 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', @@ -926,7 +802,6 @@ return 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', @@ -935,7 +810,6 @@ return 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', @@ -946,16 +820,6 @@ return 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', @@ -964,11 +828,9 @@ return 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', @@ -980,7 +842,6 @@ return 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.', @@ -989,7 +850,6 @@ return 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.', @@ -998,7 +858,6 @@ return 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', @@ -1006,11 +865,7 @@ return 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 / vendor 'expense' => 'Expense', 'expenses' => 'Expenses', 'new_expense' => 'Enter Expense', @@ -1027,8 +882,6 @@ return array( 'archived_expense' => 'Successfully archived expense', 'deleted_expenses' => 'Successfully deleted expenses', 'archived_expenses' => 'Successfully archived expenses', - - // Expenses 'expense_amount' => 'Expense Amount', 'expense_balance' => 'Expense Balance', 'expense_date' => 'Expense Date', @@ -1053,15 +906,11 @@ return 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', - - // 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.
@@ -1089,15 +938,11 @@ return array( 'thursday' => 'Thursday', '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.', - '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.', @@ -1114,7 +959,6 @@ return 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', @@ -1128,7 +972,6 @@ return 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.', @@ -1149,7 +992,44 @@ return 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 diff --git a/resources/views/accounts/api_tokens.blade.php b/resources/views/accounts/api_tokens.blade.php index efbd41e28..4612b1cbf 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 0fc17a7a3..a7f70f925 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 2d0b78d9f..4c73a7d24 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/expenses/edit.blade.php b/resources/views/expenses/edit.blade.php index c2e00ab6a..589c8d8cd 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'); diff --git a/resources/views/list.blade.php b/resources/views/list.blade.php index 93aebcebb..6e567bf3d 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() { diff --git a/tests/_bootstrap.php.default b/tests/_bootstrap.php.default index 19fc7eba0..33ecdcb60 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/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php index fd89ac0d0..2bc4e1783 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'); diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 4a152dce6..05dcbc71e 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -8,11 +8,10 @@ class_name: AcceptanceTester modules: enabled: - WebDriver: - url: 'http://ninja.dev:8000' - host: 127.0.0.1 + url: 'http://ninja.dev:8000/' window_size: 1024x768 wait: 5 - browser: phantomjs + browser: firefox capabilities: unexpectedAlertBehaviour: 'accept' webStorageEnabled: true diff --git a/tests/acceptance/CheckBalanceCest.php b/tests/acceptance/CheckBalanceCest.php index 6bac64886..0ffe27f62 100644 --- a/tests/acceptance/CheckBalanceCest.php +++ b/tests/acceptance/CheckBalanceCest.php @@ -1,7 +1,6 @@ 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->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'); diff --git a/tests/acceptance/PaymentCest.php b/tests/acceptance/PaymentCest.php index 2808c7c8d..6275babbb 100644 --- a/tests/acceptance/PaymentCest.php +++ b/tests/acceptance/PaymentCest.php @@ -1,6 +1,5 @@