diff --git a/CHANGELOG.md b/CHANGELOG.md index 51eae3ffa..3ed7ad319 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -108,6 +108,7 @@ - [TODO DEPLOY] add the `MAX_IMPORT_SIZE` environment variable (see [doc/environment.md](doc/environment.md#MAX_IMPORT_SIZE) for configuration details) - [TODO DEPLOY] add the `FABLAB_WITHOUT_INVOICES` environment variable (see [doc/environment.md](doc/environment.md#FABLAB_WITHOUT_INVOICES) for configuration details) - [TODO DEPLOY] add the `SMTP_TLS` environment variable (see [doc/environment.md](doc/environment.md#SMTP_TLS) for configuration details) +- [TODO DEPLOY] add the `FABLAB_WITHOUT_WALLET` environment variable (see [doc/environment.md](doc/environment.md#FABLAB_WITHOUT_WALLET) for configuration details) - [TODO DEPLOY] **IMPORTANT** Please read [postgres_upgrade.md](doc/postgres_upgrade.md) for instructions on upgrading PostgreSQL. ## v4.1.1 2019 September 20 @@ -141,7 +142,7 @@ ## v4.0.4 2019 August 14 - Fix a bug: #140 VAT rate is erroneous in invoices. - Note: this bug was introduced in v4.0.3 and requires (if you are on v4.0.3) to regenerate the invoices since August 1st (if + Note: this bug was introduced in v4.0.3 and requires (if you are on v4.0.3) to regenerate the invoices since August 1st (if - [TODO DEPLOY] `rake fablab:maintenance:regenerate_invoices[2019,8]` ## v4.0.3 2019 August 01 @@ -185,7 +186,7 @@ - Refactored user's profile to keep invoicing data after an user was deleted - Refactored user's profile to keep statistical data after an user was deleted - Ability to delete an user (fixes #129 and #120) -- Ask user acceptance before deposing analytics cookies +- Ask user acceptance before deposing analytics cookies - Fix a bug: (spanish) some translations are not loaded correctly - Fix a bug: some users may not appear in the admin's general listing - Fix a bug: Availabilities export report an erroneous number of reservations for machine availabilities (#131) @@ -382,8 +383,8 @@ - Fix a security issue: sprockets < 2.12.5 has a security vulnerability as described in [CVE-2018-3760](https://nvd.nist.gov/vuln/detail/CVE-2018-3760) - Ensure elasticSearch indices are started with green status on new installations - Refactored User.to_json to remove code duplication -- Fixed syntax and typos in README -- [TODO DEPLOY] **IMPORTANT** Please read [elastic_upgrade.md](doc/elastic_upgrade.md) for instructions on upgrading ElasticSearch. +- Fixed syntax and typos in README +- [TODO DEPLOY] **IMPORTANT** Please read [elastic_upgrade.md](doc/elastic_upgrade.md) for instructions on upgrading ElasticSearch. - [TODO DEPLOY] `rake fablab:fix:categories_slugs` - [TODO DEPLOY] -> (only dev) `bundle install` - [TODO DEPLOY] `rake db:seed` @@ -396,7 +397,7 @@ - Set Stripe API version, all fab-managers has to use this version because codebase relies on it - Fix a security issue: OmniAuth < 1.3.2 has a security vulnerability described in [CVE-2017-18076](https://nvd.nist.gov/vuln/detail/CVE-2017-18076) - Fix a security issue: rack-protection < 1.5.5 has a security vulnerability described in [CVE-2018-1000119](https://nvd.nist.gov/vuln/detail/CVE-2018-1000119) -- Fix a security issue: http gem < 0.7.3 has a security vulnerability described in [CVE-2015-1828](https://nvd.nist.gov/vuln/detail/CVE-2015-1828), updates twitter gem as a dependency +- Fix a security issue: http gem < 0.7.3 has a security vulnerability described in [CVE-2015-1828](https://nvd.nist.gov/vuln/detail/CVE-2015-1828), updates twitter gem as a dependency ## v2.6.3 2018 January 2 @@ -452,12 +453,12 @@ ## v2.5.13 2017 September 11 -- Fix a bug: ActiveRecord::RecordNotFound when running rake task fix:recursive_events_over_DST with recursive events which the initial event was deleted +- Fix a bug: ActiveRecord::RecordNotFound when running rake task fix:recursive_events_over_DST with recursive events which the initial event was deleted ## v2.5.12 2017 September 11 - Fix a bug: Long words overflow from homepage's events blocks -- Fix a bug: ActiveRecord::RecordNotFound when running rake task fix:recursive_events_over_DST with non-recursive events +- Fix a bug: ActiveRecord::RecordNotFound when running rake task fix:recursive_events_over_DST with non-recursive events ## v2.5.11 2017 September 7 diff --git a/app/assets/javascripts/app.js b/app/assets/javascripts/app.js index 7cf00c581..94cd11658 100644 --- a/app/assets/javascripts/app.js +++ b/app/assets/javascripts/app.js @@ -94,6 +94,8 @@ angular.module('application', ['ngCookies', 'ngResource', 'ngSanitize', 'ui.rout $rootScope.slotDuration = Fablab.slotDuration; // Global config: if true, user must confirm his email to sign in $rootScope.userConfirmationNeededToSignIn = Fablab.userConfirmationNeededToSignIn; + // Global config: if true, wallet will be disable + $rootScope.fablabWithoutWallet = Fablab.fablabWithoutWallet; // Global function to allow the user to navigate to the previous screen (ie. $state). // If no previous $state were recorded, navigate to the home page diff --git a/app/assets/templates/admin/members/edit.html.erb b/app/assets/templates/admin/members/edit.html.erb index 25fb2add6..3897f6f43 100644 --- a/app/assets/templates/admin/members/edit.html.erb +++ b/app/assets/templates/admin/members/edit.html.erb @@ -224,7 +224,7 @@ - +
'"> diff --git a/app/assets/templates/dashboard/nav.html.erb b/app/assets/templates/dashboard/nav.html.erb index 2bbca9d6b..b839c47f4 100644 --- a/app/assets/templates/dashboard/nav.html.erb +++ b/app/assets/templates/dashboard/nav.html.erb @@ -16,7 +16,7 @@
  • {{ 'app.public.common.my_trainings' }}
  • {{ 'app.public.common.my_events' }}
  • {{ 'app.public.common.my_invoices' }}
  • -
  • {{ 'app.public.common.my_wallet' }}
  • +
  • {{ 'app.public.common.my_wallet' }}
  • diff --git a/app/assets/templates/shared/header.html.erb b/app/assets/templates/shared/header.html.erb index 768668a4f..fbf6bc02c 100644 --- a/app/assets/templates/shared/header.html.erb +++ b/app/assets/templates/shared/header.html.erb @@ -39,7 +39,7 @@
  • {{ 'app.public.common.my_trainings' }}
  • {{ 'app.public.common.my_events' }}
  • {{ 'app.public.common.my_invoices' }}
  • -
  • {{ 'app.public.common.my_wallet' }}
  • +
  • {{ 'app.public.common.my_wallet' }}
  • {{ 'app.public.common.sign_out' | translate }}
  • diff --git a/app/controllers/api/wallet_controller.rb b/app/controllers/api/wallet_controller.rb index d573497bb..5842ece51 100644 --- a/app/controllers/api/wallet_controller.rb +++ b/app/controllers/api/wallet_controller.rb @@ -18,6 +18,8 @@ class API::WalletController < API::ApiController end def credit + return head 422 if Rails.application.secrets.fablab_without_wallet == 'true' + @wallet = Wallet.find(credit_params[:id]) authorize @wallet service = WalletService.new(user: current_user, wallet: @wallet) diff --git a/app/views/application/index.html.erb b/app/views/application/index.html.erb index b11337511..cb7e000f6 100644 --- a/app/views/application/index.html.erb +++ b/app/views/application/index.html.erb @@ -28,6 +28,7 @@ Fablab.withoutOnlinePayment = ('<%= Rails.application.secrets.fablab_without_online_payments %>' === 'true'); Fablab.withoutInvoices = ('<%= Rails.application.secrets.fablab_without_invoices %>' === 'true'); Fablab.phoneRequired = ('<%= Rails.application.secrets.phone_required %>' === 'true'); + Fablab.fablabWithoutWallet = ('<%= Rails.application.secrets.fablab_without_wallet %>' === 'true'); Fablab.eventsInCalendar = ('<%= Rails.application.secrets.events_in_calendar %>' === 'true'); Fablab.slotDuration = parseInt("<%= ApplicationHelper::SLOT_DURATION %>", 10); Fablab.disqusShortname = "<%= Rails.application.secrets.disqus_shortname %>"; diff --git a/config/application.yml.default b/config/application.yml.default index 790a7ee6d..42b160fc2 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -21,6 +21,7 @@ FABLAB_WITHOUT_SPACES: 'true' FABLAB_WITHOUT_ONLINE_PAYMENT: 'false' FABLAB_WITHOUT_INVOICES: 'false' PHONE_REQUIRED: 'true' +FABLAB_WITHOUT_WALLET: 'false' USER_CONFIRMATION_NEEDED_TO_SIGN_IN: 'false' diff --git a/config/secrets.yml b/config/secrets.yml index cafc95b44..8bd110541 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -21,6 +21,7 @@ development: fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %> fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %> phone_required: <%= ENV["PHONE_REQUIRED"] %> + fablab_without_wallet: <%= ENV["FABLAB_WITHOUT_WALLET"] %> user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %> events_in_calendar: <%= ENV["EVENTS_IN_CALENDAR"] %> slot_duration: <%= ENV["SLOT_DURATION"] %> @@ -67,6 +68,7 @@ test: fablab_without_online_payments: false fablab_without_invoices: false phone_required: true + fablab_without_wallet: false user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %> events_in_calendar: false slot_duration: 60 @@ -113,6 +115,7 @@ staging: fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %> fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %> phone_required: <%= ENV["PHONE_REQUIRED"] %> + fablab_without_wallet: <%= ENV["FABLAB_WITHOUT_WALLET"] %> user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %> events_in_calendar: <%= ENV["EVENTS_IN_CALENDAR"] %> slot_duration: <%= ENV["SLOT_DURATION"] %> @@ -171,6 +174,7 @@ production: fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %> fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %> phone_required: <%= ENV["PHONE_REQUIRED"] %> + fablab_without_wallet: <%= ENV["FABLAB_WITHOUT_WALLET"] %> user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %> events_in_calendar: <%= ENV["EVENTS_IN_CALENDAR"] %> slot_duration: <%= ENV["SLOT_DURATION"] %> diff --git a/doc/environment.md b/doc/environment.md index 0e44f11bd..5817ea8cf 100644 --- a/doc/environment.md +++ b/doc/environment.md @@ -102,6 +102,13 @@ Valid stripe API keys are still required, even if you don't require online payme If set to 'true', the invoices will be disabled. This is useful if you have your own invoicing system and you want to prevent Fab-manager from generating and sending invoices to members. **Very important**: if you disable invoices, you still have to configure VAT in the interface to prevent errors in accounting and prices. + + + FABLAB_WITHOUT_WALLET + +If set to 'true', the wallet will be disabled. +This is useful if you won't use wallet system +**Very important**: if you disable invoices, you still have to configure VAT in the interface to prevent errors in accounting and prices. PHONE_REQUIRED diff --git a/setup/env.example b/setup/env.example index 7591de428..6cd7f9ee7 100644 --- a/setup/env.example +++ b/setup/env.example @@ -14,6 +14,7 @@ FABLAB_WITHOUT_SPACES=true FABLAB_WITHOUT_ONLINE_PAYMENT=true FABLAB_WITHOUT_INVOICES=false PHONE_REQUIRED=false +FABLAB_WITHOUT_WALLET=false EVENTS_IN_CALENDAR=false SLOT_DURATION=60