mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
export space statistics
This commit is contained in:
parent
05bf899393
commit
cf9181770b
@ -1,6 +1,6 @@
|
|||||||
class StatisticPolicy < ApplicationPolicy
|
class StatisticPolicy < ApplicationPolicy
|
||||||
%w(index account event machine project subscription training user space scroll export_subscription export_machine
|
%w(index account event machine project subscription training user space scroll export_subscription export_machine
|
||||||
export_training export_event export_account export_project export_global).each do |action|
|
export_training export_event export_account export_project export_space export_global).each do |action|
|
||||||
define_method "#{action}?" do
|
define_method "#{action}?" do
|
||||||
user.is_admin?
|
user.is_admin?
|
||||||
end
|
end
|
||||||
|
@ -40,7 +40,7 @@ class StatisticsExportService
|
|||||||
File.open(export.file,"w+b") {|f| f.puts content }
|
File.open(export.file,"w+b") {|f| f.puts content }
|
||||||
end
|
end
|
||||||
|
|
||||||
%w(account event machine project subscription training).each do |path|
|
%w(account event machine project subscription training space).each do |path|
|
||||||
class_eval %{
|
class_eval %{
|
||||||
def export_#{path}(export)
|
def export_#{path}(export)
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ class StatisticsExportWorker
|
|||||||
service = StatisticsExportService.new
|
service = StatisticsExportService.new
|
||||||
method_name = "export_#{export.export_type}"
|
method_name = "export_#{export.export_type}"
|
||||||
|
|
||||||
if %w(account event machine project subscription training global).include?(export.export_type) and service.respond_to?(method_name)
|
if %w(account event machine project subscription training space global).include?(export.export_type) and service.respond_to?(method_name)
|
||||||
service.public_send(method_name, export)
|
service.public_send(method_name, export)
|
||||||
|
|
||||||
NotificationCenter.call type: :notify_admin_export_complete,
|
NotificationCenter.call type: :notify_admin_export_complete,
|
||||||
|
@ -275,6 +275,7 @@ en:
|
|||||||
statistics_project: "of statistics about projects"
|
statistics_project: "of statistics about projects"
|
||||||
statistics_subscription: "of subscription statistics"
|
statistics_subscription: "of subscription statistics"
|
||||||
statistics_training: "of statistics about trainings"
|
statistics_training: "of statistics about trainings"
|
||||||
|
statistics_space: "of statistics about spaces"
|
||||||
users_members: "of the members' list"
|
users_members: "of the members' list"
|
||||||
users_subscriptions: "of the subscriptions' list"
|
users_subscriptions: "of the subscriptions' list"
|
||||||
users_reservations: "of the reservations' list"
|
users_reservations: "of the reservations' list"
|
||||||
|
@ -275,6 +275,7 @@ fr:
|
|||||||
statistics_project: "des statistiques sur les projets"
|
statistics_project: "des statistiques sur les projets"
|
||||||
statistics_subscription: "des statistiques d'abonnements"
|
statistics_subscription: "des statistiques d'abonnements"
|
||||||
statistics_training: "des statistiques sur les formations"
|
statistics_training: "des statistiques sur les formations"
|
||||||
|
statistics_space: "des statistiques sur les espaces"
|
||||||
users_members: "de la liste des membres"
|
users_members: "de la liste des membres"
|
||||||
users_subscriptions: "de la liste des abonnements"
|
users_subscriptions: "de la liste des abonnements"
|
||||||
users_reservations: "de la liste des réservations"
|
users_reservations: "de la liste des réservations"
|
||||||
|
@ -268,6 +268,7 @@ en:
|
|||||||
statistics_project: "of statistics about projects"
|
statistics_project: "of statistics about projects"
|
||||||
statistics_subscription: "of subscription statistics"
|
statistics_subscription: "of subscription statistics"
|
||||||
statistics_training: "of statistics about trainings"
|
statistics_training: "of statistics about trainings"
|
||||||
|
statistics_space: "of statistics about spaces"
|
||||||
users_members: "of the members' list"
|
users_members: "of the members' list"
|
||||||
users_subscriptions: "of the subscriptions' list"
|
users_subscriptions: "of the subscriptions' list"
|
||||||
users_reservations: "of the reservations' list"
|
users_reservations: "of the reservations' list"
|
||||||
|
@ -268,6 +268,7 @@ fr:
|
|||||||
statistics_project: "des statistiques sur les projets"
|
statistics_project: "des statistiques sur les projets"
|
||||||
statistics_subscription: "des statistiques d'abonnements"
|
statistics_subscription: "des statistiques d'abonnements"
|
||||||
statistics_training: "des statistiques sur les formations"
|
statistics_training: "des statistiques sur les formations"
|
||||||
|
statistics_space: "des statistiques sur les espaces"
|
||||||
users_members: "de la liste des membres"
|
users_members: "de la liste des membres"
|
||||||
users_subscriptions: "de la liste des abonnements"
|
users_subscriptions: "de la liste des abonnements"
|
||||||
users_reservations: "de la liste des réservations"
|
users_reservations: "de la liste des réservations"
|
||||||
|
Loading…
Reference in New Issue
Block a user