1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

Merge remote-tracking branch 'origin/disable_wallet_option' into dev

This commit is contained in:
Sylvain 2020-03-02 15:47:14 +01:00
commit 11ccaa73b6
11 changed files with 29 additions and 9 deletions

View File

@ -121,6 +121,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 `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 `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 `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. - [TODO DEPLOY] **IMPORTANT** Please read [postgres_upgrade.md](doc/postgres_upgrade.md) for instructions on upgrading PostgreSQL.
## v4.1.1 2019 September 20 ## v4.1.1 2019 September 20

View File

@ -97,6 +97,8 @@ angular.module('application', ['ngCookies', 'ngResource', 'ngSanitize', 'ui.rout
$rootScope.slotDuration = Fablab.slotDuration; $rootScope.slotDuration = Fablab.slotDuration;
// Global config: if true, user must confirm his email to sign in // Global config: if true, user must confirm his email to sign in
$rootScope.userConfirmationNeededToSignIn = Fablab.userConfirmationNeededToSignIn; $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). // 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 // If no previous $state were recorded, navigate to the home page

View File

@ -224,7 +224,7 @@
</div> </div>
</uib-tab> </uib-tab>
<uib-tab heading="{{ 'app.admin.members_edit.wallet' | translate }}"> <uib-tab heading="{{ 'app.admin.members_edit.wallet' | translate }}" ng-hide="fablabWithoutWallet">
<div class="col-md-12 m m-t-lg"> <div class="col-md-12 m m-t-lg">
<ng-include src="'<%= asset_path "wallet/show.html" %>'"></ng-include> <ng-include src="'<%= asset_path "wallet/show.html" %>'"></ng-include>

View File

@ -16,7 +16,7 @@
<li ui-sref-active="active"><a class="text-black" href="#" ui-sref="app.logged.dashboard.trainings" translate>{{ 'app.public.common.my_trainings' }}</a></li> <li ui-sref-active="active"><a class="text-black" href="#" ui-sref="app.logged.dashboard.trainings" translate>{{ 'app.public.common.my_trainings' }}</a></li>
<li ui-sref-active="active"><a class="text-black" href="#" ui-sref="app.logged.dashboard.events" translate>{{ 'app.public.common.my_events' }}</a></li> <li ui-sref-active="active"><a class="text-black" href="#" ui-sref="app.logged.dashboard.events" translate>{{ 'app.public.common.my_events' }}</a></li>
<li ui-sref-active="active" ng-hide="fablabWithoutInvoices"><a class="text-black" href="#" ui-sref="app.logged.dashboard.invoices" translate>{{ 'app.public.common.my_invoices' }}</a></li> <li ui-sref-active="active" ng-hide="fablabWithoutInvoices"><a class="text-black" href="#" ui-sref="app.logged.dashboard.invoices" translate>{{ 'app.public.common.my_invoices' }}</a></li>
<li ui-sref-active="active"><a class="text-black" href="#" ui-sref="app.logged.dashboard.wallet" translate>{{ 'app.public.common.my_wallet' }}</a></li> <li ng-hide="fablabWithoutWallet" ui-sref-active="active"><a class="text-black" href="#" ui-sref="app.logged.dashboard.wallet" translate>{{ 'app.public.common.my_wallet' }}</a></li>
</ul> </ul>
</section> </section>
</div> </div>

View File

@ -39,6 +39,7 @@
<li><a ui-sref="app.logged.dashboard.trainings" translate>{{ 'app.public.common.my_trainings' }}</a></li> <li><a ui-sref="app.logged.dashboard.trainings" translate>{{ 'app.public.common.my_trainings' }}</a></li>
<li><a ui-sref="app.logged.dashboard.events" translate>{{ 'app.public.common.my_events' }}</a></li> <li><a ui-sref="app.logged.dashboard.events" translate>{{ 'app.public.common.my_events' }}</a></li>
<li><a ui-sref="app.logged.dashboard.invoices" ng-hide="fablabWithoutInvoices" translate>{{ 'app.public.common.my_invoices' }}</a></li> <li><a ui-sref="app.logged.dashboard.invoices" ng-hide="fablabWithoutInvoices" translate>{{ 'app.public.common.my_invoices' }}</a></li>
<li ng-hide="fablabWithoutWallet"><a ui-sref="app.logged.dashboard.wallet" translate>{{ 'app.public.common.my_wallet' }}</a></li>
<li><a ui-sref="app.logged.dashboard.wallet" translate>{{ 'app.public.common.my_wallet' }}</a></li> <li><a ui-sref="app.logged.dashboard.wallet" translate>{{ 'app.public.common.my_wallet' }}</a></li>
<li class="divider" ng-if="currentUser.role === 'admin'"></li> <li class="divider" ng-if="currentUser.role === 'admin'"></li>
<li><a class="text-black pointer" ng-click="help($event)" ng-if="currentUser.role === 'admin'"><i class="fa fa-question-circle"></i> <span translate>{{ 'app.public.common.help' }}</span> </a></li> <li><a class="text-black pointer" ng-click="help($event)" ng-if="currentUser.role === 'admin'"><i class="fa fa-question-circle"></i> <span translate>{{ 'app.public.common.help' }}</span> </a></li>

View File

@ -18,6 +18,8 @@ class API::WalletController < API::ApiController
end end
def credit def credit
return head 422 if Rails.application.secrets.fablab_without_wallet == 'true'
@wallet = Wallet.find(credit_params[:id]) @wallet = Wallet.find(credit_params[:id])
authorize @wallet authorize @wallet
service = WalletService.new(user: current_user, wallet: @wallet) service = WalletService.new(user: current_user, wallet: @wallet)

View File

@ -28,6 +28,7 @@
Fablab.withoutOnlinePayment = ('<%= Rails.application.secrets.fablab_without_online_payments %>' === 'true'); Fablab.withoutOnlinePayment = ('<%= Rails.application.secrets.fablab_without_online_payments %>' === 'true');
Fablab.withoutInvoices = ('<%= Rails.application.secrets.fablab_without_invoices %>' === 'true'); Fablab.withoutInvoices = ('<%= Rails.application.secrets.fablab_without_invoices %>' === 'true');
Fablab.phoneRequired = ('<%= Rails.application.secrets.phone_required %>' === '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.eventsInCalendar = ('<%= Rails.application.secrets.events_in_calendar %>' === 'true');
Fablab.slotDuration = parseInt("<%= ApplicationHelper::SLOT_DURATION %>", 10); Fablab.slotDuration = parseInt("<%= ApplicationHelper::SLOT_DURATION %>", 10);
Fablab.featureTourDisplay = "<%= Rails.application.secrets.feature_tour_display %>"; Fablab.featureTourDisplay = "<%= Rails.application.secrets.feature_tour_display %>";

View File

@ -21,6 +21,7 @@ FABLAB_WITHOUT_SPACES: 'true'
FABLAB_WITHOUT_ONLINE_PAYMENT: 'false' FABLAB_WITHOUT_ONLINE_PAYMENT: 'false'
FABLAB_WITHOUT_INVOICES: 'false' FABLAB_WITHOUT_INVOICES: 'false'
PHONE_REQUIRED: 'true' PHONE_REQUIRED: 'true'
FABLAB_WITHOUT_WALLET: 'false'
USER_CONFIRMATION_NEEDED_TO_SIGN_IN: 'false' USER_CONFIRMATION_NEEDED_TO_SIGN_IN: 'false'

View File

@ -21,6 +21,7 @@ development:
fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %> fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %>
fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %> fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %>
phone_required: <%= ENV["PHONE_REQUIRED"] %> 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"] %> user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %>
events_in_calendar: <%= ENV["EVENTS_IN_CALENDAR"] %> events_in_calendar: <%= ENV["EVENTS_IN_CALENDAR"] %>
slot_duration: <%= ENV["SLOT_DURATION"] %> slot_duration: <%= ENV["SLOT_DURATION"] %>
@ -68,6 +69,7 @@ test:
fablab_without_online_payments: false fablab_without_online_payments: false
fablab_without_invoices: false fablab_without_invoices: false
phone_required: true phone_required: true
fablab_without_wallet: false
user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %> user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %>
events_in_calendar: false events_in_calendar: false
slot_duration: 60 slot_duration: 60
@ -115,6 +117,7 @@ staging:
fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %> fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %>
fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %> fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %>
phone_required: <%= ENV["PHONE_REQUIRED"] %> 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"] %> user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %>
events_in_calendar: <%= ENV["EVENTS_IN_CALENDAR"] %> events_in_calendar: <%= ENV["EVENTS_IN_CALENDAR"] %>
slot_duration: <%= ENV["SLOT_DURATION"] %> slot_duration: <%= ENV["SLOT_DURATION"] %>
@ -174,6 +177,7 @@ production:
fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %> fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %>
fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %> fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %>
phone_required: <%= ENV["PHONE_REQUIRED"] %> 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"] %> user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %>
events_in_calendar: <%= ENV["EVENTS_IN_CALENDAR"] %> events_in_calendar: <%= ENV["EVENTS_IN_CALENDAR"] %>
slot_duration: <%= ENV["SLOT_DURATION"] %> slot_duration: <%= ENV["SLOT_DURATION"] %>

View File

@ -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. 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. 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. **Very important**: if you disable invoices, you still have to configure VAT in the interface to prevent errors in accounting and prices.
<a name="FABLAB_WITHOUT_WALLET"></a>
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.
<a name="PHONE_REQUIRED"></a> <a name="PHONE_REQUIRED"></a>
PHONE_REQUIRED PHONE_REQUIRED

View File

@ -14,6 +14,7 @@ FABLAB_WITHOUT_SPACES=true
FABLAB_WITHOUT_ONLINE_PAYMENT=true FABLAB_WITHOUT_ONLINE_PAYMENT=true
FABLAB_WITHOUT_INVOICES=false FABLAB_WITHOUT_INVOICES=false
PHONE_REQUIRED=false PHONE_REQUIRED=false
FABLAB_WITHOUT_WALLET=false
EVENTS_IN_CALENDAR=false EVENTS_IN_CALENDAR=false
SLOT_DURATION=60 SLOT_DURATION=60