commit
a74ac79489
214 changed files with 1516 additions and 661 deletions
1059
.rubocop.yml
Normal file
1059
.rubocop.yml
Normal file
File diff suppressed because it is too large
Load diff
|
@ -417,6 +417,7 @@ GEM
|
||||||
openstack (3.3.7)
|
openstack (3.3.7)
|
||||||
json
|
json
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
|
parallel (1.11.2)
|
||||||
parser (2.4.0.0)
|
parser (2.4.0.0)
|
||||||
ast (~> 2.2)
|
ast (~> 2.2)
|
||||||
pg (0.19.0)
|
pg (0.19.0)
|
||||||
|
@ -471,7 +472,8 @@ GEM
|
||||||
method_source
|
method_source
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
rainbow (2.2.1)
|
rainbow (2.2.2)
|
||||||
|
rake
|
||||||
raindrops (0.17.0)
|
raindrops (0.17.0)
|
||||||
rake (12.0.0)
|
rake (12.0.0)
|
||||||
rb-fsevent (0.9.8)
|
rb-fsevent (0.9.8)
|
||||||
|
@ -522,7 +524,8 @@ GEM
|
||||||
rspec-mocks (~> 3.5.0)
|
rspec-mocks (~> 3.5.0)
|
||||||
rspec-support (~> 3.5.0)
|
rspec-support (~> 3.5.0)
|
||||||
rspec-support (3.5.0)
|
rspec-support (3.5.0)
|
||||||
rubocop (0.48.1)
|
rubocop (0.49.1)
|
||||||
|
parallel (~> 1.10)
|
||||||
parser (>= 2.3.3.1, < 3.0)
|
parser (>= 2.3.3.1, < 3.0)
|
||||||
powerpack (~> 0.1)
|
powerpack (~> 0.1)
|
||||||
rainbow (>= 1.99.1, < 3.0)
|
rainbow (>= 1.99.1, < 3.0)
|
||||||
|
@ -618,7 +621,7 @@ GEM
|
||||||
unf (0.1.4)
|
unf (0.1.4)
|
||||||
unf_ext
|
unf_ext
|
||||||
unf_ext (0.0.7.2)
|
unf_ext (0.0.7.2)
|
||||||
unicode-display_width (1.1.3)
|
unicode-display_width (1.2.1)
|
||||||
unicode_utils (1.4.0)
|
unicode_utils (1.4.0)
|
||||||
unicorn (5.2.0)
|
unicorn (5.2.0)
|
||||||
kgio (~> 2.6)
|
kgio (~> 2.6)
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
# * zeus: 'zeus rspec' (requires the server to be started separetly)
|
# * zeus: 'zeus rspec' (requires the server to be started separetly)
|
||||||
# * 'just' rspec: 'rspec'
|
# * 'just' rspec: 'rspec'
|
||||||
|
|
||||||
|
|
||||||
guard 'livereload' do
|
guard 'livereload' do
|
||||||
extensions = {
|
extensions = {
|
||||||
css: :css,
|
css: :css,
|
||||||
|
|
2
Rakefile
2
Rakefile
|
@ -19,7 +19,6 @@ task :deploy_ha do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
task :deploy_old do
|
task :deploy_old do
|
||||||
domains = %w(37.187.154.237 37.187.249.111)
|
domains = %w(37.187.154.237 37.187.249.111)
|
||||||
domains.each do |domain|
|
domains.each do |domain|
|
||||||
|
@ -27,7 +26,6 @@ task :deploy_old do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
task :deploy_test do
|
task :deploy_test do
|
||||||
domains = %w(192.168.0.116)
|
domains = %w(192.168.0.116)
|
||||||
branch = 'clamav'
|
branch = 'clamav'
|
||||||
|
|
|
@ -7,17 +7,17 @@ class Admin::AccompagnateursController < AdminController
|
||||||
def show
|
def show
|
||||||
assign_scope = @procedure.gestionnaires
|
assign_scope = @procedure.gestionnaires
|
||||||
@accompagnateurs_assign = smart_listing_create :accompagnateurs_assign,
|
@accompagnateurs_assign = smart_listing_create :accompagnateurs_assign,
|
||||||
assign_scope,
|
assign_scope,
|
||||||
partial: "admin/accompagnateurs/list_assign",
|
partial: "admin/accompagnateurs/list_assign",
|
||||||
array: true
|
array: true
|
||||||
|
|
||||||
not_assign_scope = current_administrateur.gestionnaires.where.not(id: assign_scope.ids)
|
not_assign_scope = current_administrateur.gestionnaires.where.not(id: assign_scope.ids)
|
||||||
not_assign_scope = not_assign_scope.where("email LIKE '%#{params[:filter]}%'") if params[:filter]
|
not_assign_scope = not_assign_scope.where("email LIKE '%#{params[:filter]}%'") if params[:filter]
|
||||||
|
|
||||||
@accompagnateurs_not_assign = smart_listing_create :accompagnateurs_not_assign,
|
@accompagnateurs_not_assign = smart_listing_create :accompagnateurs_not_assign,
|
||||||
not_assign_scope,
|
not_assign_scope,
|
||||||
partial: "admin/accompagnateurs/list_not_assign",
|
partial: "admin/accompagnateurs/list_not_assign",
|
||||||
array: true
|
array: true
|
||||||
|
|
||||||
@gestionnaire ||= Gestionnaire.new
|
@gestionnaire ||= Gestionnaire.new
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,13 +4,13 @@ class Admin::GestionnairesController < AdminController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@gestionnaires = smart_listing_create :gestionnaires,
|
@gestionnaires = smart_listing_create :gestionnaires,
|
||||||
current_administrateur.gestionnaires,
|
current_administrateur.gestionnaires,
|
||||||
partial: "admin/gestionnaires/list",
|
partial: "admin/gestionnaires/list",
|
||||||
array: true
|
array: true
|
||||||
|
|
||||||
@gestionnaire ||= Gestionnaire.new
|
@gestionnaire ||= Gestionnaire.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@gestionnaire = Gestionnaire.find_by_email(params[:gestionnaire][:email])
|
@gestionnaire = Gestionnaire.find_by_email(params[:gestionnaire][:email])
|
||||||
procedure_id = params[:procedure_id]
|
procedure_id = params[:procedure_id]
|
||||||
|
|
|
@ -6,18 +6,18 @@ class Admin::ProceduresController < AdminController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@procedures = smart_listing_create :procedures,
|
@procedures = smart_listing_create :procedures,
|
||||||
current_administrateur.procedures.where(published: true, archived: false).order(created_at: :desc),
|
current_administrateur.procedures.where(published: true, archived: false).order(created_at: :desc),
|
||||||
partial: "admin/procedures/list",
|
partial: "admin/procedures/list",
|
||||||
array: true
|
array: true
|
||||||
|
|
||||||
active_class
|
active_class
|
||||||
end
|
end
|
||||||
|
|
||||||
def archived
|
def archived
|
||||||
@procedures = smart_listing_create :procedures,
|
@procedures = smart_listing_create :procedures,
|
||||||
current_administrateur.procedures.where(archived: true).order(created_at: :desc),
|
current_administrateur.procedures.where(archived: true).order(created_at: :desc),
|
||||||
partial: "admin/procedures/list",
|
partial: "admin/procedures/list",
|
||||||
array: true
|
array: true
|
||||||
|
|
||||||
archived_class
|
archived_class
|
||||||
|
|
||||||
|
@ -26,9 +26,9 @@ class Admin::ProceduresController < AdminController
|
||||||
|
|
||||||
def draft
|
def draft
|
||||||
@procedures = smart_listing_create :procedures,
|
@procedures = smart_listing_create :procedures,
|
||||||
current_administrateur.procedures.where(published: false, archived: false).order(created_at: :desc),
|
current_administrateur.procedures.where(published: false, archived: false).order(created_at: :desc),
|
||||||
partial: "admin/procedures/list",
|
partial: "admin/procedures/list",
|
||||||
array: true
|
array: true
|
||||||
|
|
||||||
draft_class
|
draft_class
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ class Admin::ProceduresController < AdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
|
|
@ -8,11 +8,9 @@ class AdministrationsController < ApplicationController
|
||||||
@admin = Administrateur.new
|
@admin = Administrateur.new
|
||||||
|
|
||||||
@admins = smart_listing_create :admins,
|
@admins = smart_listing_create :admins,
|
||||||
Administrateur.all.order(:email),
|
Administrateur.all.order(:email),
|
||||||
partial: "administrations/list",
|
partial: "administrations/list",
|
||||||
array: true
|
array: true
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
|
@ -13,5 +13,4 @@ class API::V1::ProceduresController < APIController
|
||||||
Rails.logger.error(e.message)
|
Rails.logger.error(e.message)
|
||||||
render json: {}, status: 404
|
render json: {}, status: 404
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class Backoffice::AvisController < ApplicationController
|
class Backoffice::AvisController < ApplicationController
|
||||||
|
|
||||||
before_action :authenticate_gestionnaire!, except: [:sign_up, :create_gestionnaire]
|
before_action :authenticate_gestionnaire!, except: [:sign_up, :create_gestionnaire]
|
||||||
before_action :redirect_if_no_sign_up_needed, only: [:sign_up]
|
before_action :redirect_if_no_sign_up_needed, only: [:sign_up]
|
||||||
before_action :check_avis_exists_and_email_belongs_to_avis, only: [:sign_up, :create_gestionnaire]
|
before_action :check_avis_exists_and_email_belongs_to_avis, only: [:sign_up, :create_gestionnaire]
|
||||||
|
|
|
@ -21,5 +21,4 @@ class Backoffice::Dossiers::ProcedureController < Backoffice::DossiersListContro
|
||||||
def retrieve_procedure
|
def retrieve_procedure
|
||||||
current_gestionnaire.procedures.find params[:id]
|
current_gestionnaire.procedures.find params[:id]
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -79,17 +79,17 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
|
||||||
end
|
end
|
||||||
|
|
||||||
smart_listing_create :search,
|
smart_listing_create :search,
|
||||||
@dossiers,
|
@dossiers,
|
||||||
partial: "backoffice/dossiers/list",
|
partial: "backoffice/dossiers/list",
|
||||||
array: true,
|
array: true,
|
||||||
default_sort: dossiers_list_facade.service.default_sort
|
default_sort: dossiers_list_facade.service.default_sort
|
||||||
|
|
||||||
rescue RuntimeError
|
rescue RuntimeError
|
||||||
smart_listing_create :search,
|
smart_listing_create :search,
|
||||||
[],
|
[],
|
||||||
partial: "backoffice/dossiers/list",
|
partial: "backoffice/dossiers/list",
|
||||||
array: true,
|
array: true,
|
||||||
default_sort: dossiers_list_facade.service.default_sort
|
default_sort: dossiers_list_facade.service.default_sort
|
||||||
end
|
end
|
||||||
|
|
||||||
def receive
|
def receive
|
||||||
|
@ -172,7 +172,6 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
|
||||||
redirect_to backoffice_dossiers_path
|
redirect_to backoffice_dossiers_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def unarchive
|
def unarchive
|
||||||
@dossier = Dossier.find(params[:id])
|
@dossier = Dossier.find(params[:id])
|
||||||
if @dossier.archived
|
if @dossier.archived
|
||||||
|
|
|
@ -31,7 +31,6 @@ class Backoffice::DossiersListController < ApplicationController
|
||||||
dossiers_list_facade liste
|
dossiers_list_facade liste
|
||||||
service = dossiers_list_facade.service
|
service = dossiers_list_facade.service
|
||||||
|
|
||||||
|
|
||||||
if param_page.nil?
|
if param_page.nil?
|
||||||
params[:dossiers_smart_listing] = {page: dossiers_list_facade.service.default_page}
|
params[:dossiers_smart_listing] = {page: dossiers_list_facade.service.default_page}
|
||||||
end
|
end
|
||||||
|
@ -48,10 +47,10 @@ class Backoffice::DossiersListController < ApplicationController
|
||||||
|
|
||||||
def default_smart_listing_create name, collection
|
def default_smart_listing_create name, collection
|
||||||
smart_listing_create name,
|
smart_listing_create name,
|
||||||
collection,
|
collection,
|
||||||
partial: 'backoffice/dossiers/list',
|
partial: 'backoffice/dossiers/list',
|
||||||
array: true,
|
array: true,
|
||||||
default_sort: dossiers_list_facade.service.default_sort
|
default_sort: dossiers_list_facade.service.default_sort
|
||||||
end
|
end
|
||||||
|
|
||||||
def param_smart_listing
|
def param_smart_listing
|
||||||
|
|
|
@ -15,14 +15,14 @@ class BackofficeController < ApplicationController
|
||||||
def invitations
|
def invitations
|
||||||
pending_avis = current_gestionnaire.avis.without_answer.includes(dossier: [:procedure]).by_latest
|
pending_avis = current_gestionnaire.avis.without_answer.includes(dossier: [:procedure]).by_latest
|
||||||
@pending_avis = smart_listing_create :pending_avis,
|
@pending_avis = smart_listing_create :pending_avis,
|
||||||
pending_avis,
|
pending_avis,
|
||||||
partial: 'backoffice/dossiers/list_invitations',
|
partial: 'backoffice/dossiers/list_invitations',
|
||||||
array: true
|
array: true
|
||||||
|
|
||||||
avis_with_answer = current_gestionnaire.avis.with_answer.includes(dossier: [:procedure]).by_latest
|
avis_with_answer = current_gestionnaire.avis.with_answer.includes(dossier: [:procedure]).by_latest
|
||||||
@avis_with_answer = smart_listing_create :avis_with_answer,
|
@avis_with_answer = smart_listing_create :avis_with_answer,
|
||||||
avis_with_answer,
|
avis_with_answer,
|
||||||
partial: 'backoffice/dossiers/list_invitations',
|
partial: 'backoffice/dossiers/list_invitations',
|
||||||
array: true
|
array: true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class CguController < ApplicationController
|
class CguController < ApplicationController
|
||||||
def index
|
def index
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
class CommentairesController < ApplicationController
|
class CommentairesController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@facade = DossierFacades.new(
|
@facade = DossierFacades.new(
|
||||||
params[:dossier_id],
|
params[:dossier_id],
|
||||||
(current_gestionnaire || current_user).email,
|
(current_gestionnaire || current_user).email,
|
||||||
params[:champs_id]
|
params[:champs_id]
|
||||||
)
|
)
|
||||||
render layout: false
|
render layout: false
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
|
|
|
@ -6,8 +6,8 @@ class DemoController < ApplicationController
|
||||||
return redirect_to root_path if Rails.env.production?
|
return redirect_to root_path if Rails.env.production?
|
||||||
|
|
||||||
smart_listing_create :procedures,
|
smart_listing_create :procedures,
|
||||||
Procedure.where(archived: false, published: true).order("id DESC"),
|
Procedure.where(archived: false, published: true).order("id DESC"),
|
||||||
partial: "demo/list",
|
partial: "demo/list",
|
||||||
array: true
|
array: true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -61,7 +61,7 @@ class StatsController < ApplicationController
|
||||||
count_per_administrateur = procedures.group(:administrateur_id).count.values
|
count_per_administrateur = procedures.group(:administrateur_id).count.values
|
||||||
{
|
{
|
||||||
'Une procédure' => count_per_administrateur.select { |count| count == 1 }.count,
|
'Une procédure' => count_per_administrateur.select { |count| count == 1 }.count,
|
||||||
'Entre deux et cinq procédures' => count_per_administrateur.select { |count| 2 <= count && count <= 5 }.count,
|
'Entre deux et cinq procédures' => count_per_administrateur.select { |count| 2 <= count && count <= 5 }.count,
|
||||||
'Plus de cinq procédures' => count_per_administrateur.select { |count| 5 < count }.count
|
'Plus de cinq procédures' => count_per_administrateur.select { |count| 5 < count }.count
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class Users::Dossiers::AddSiretController < ApplicationController
|
class Users::Dossiers::AddSiretController < ApplicationController
|
||||||
def show
|
def show
|
||||||
@facade = DossierFacades.new params[:dossier_id], current_user.email
|
@facade = DossierFacades.new params[:dossier_id], current_user.email
|
||||||
|
|
||||||
raise ActiveRecord::RecordNotFound unless @facade.procedure.individual_with_siret?
|
raise ActiveRecord::RecordNotFound unless @facade.procedure.individual_with_siret?
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,9 @@ class Users::DossiersController < UsersController
|
||||||
end
|
end
|
||||||
|
|
||||||
@dossiers = smart_listing_create :dossiers,
|
@dossiers = smart_listing_create :dossiers,
|
||||||
@dossiers_filtered,
|
@dossiers_filtered,
|
||||||
partial: "users/dossiers/list",
|
partial: "users/dossiers/list",
|
||||||
array: true
|
array: true
|
||||||
end
|
end
|
||||||
|
|
||||||
def commencer
|
def commencer
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class Users::RegistrationsController < Devise::RegistrationsController
|
class Users::RegistrationsController < Devise::RegistrationsController
|
||||||
# before_action :configure_sign_up_params, only: [:create]
|
# before_action :configure_sign_up_params, only: [:create]
|
||||||
# before_action :configure_account_update_params, only: [:update]
|
# before_action :configure_account_update_params, only: [:update]
|
||||||
|
|
||||||
def after_sign_up_path_for(resource_or_scope)
|
def after_sign_up_path_for(resource_or_scope)
|
||||||
WelcomeMailer.welcome_email(resource_or_scope).deliver_now!
|
WelcomeMailer.welcome_email(resource_or_scope).deliver_now!
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class Users::SessionsController < Sessions::SessionsController
|
class Users::SessionsController < Sessions::SessionsController
|
||||||
# before_action :configure_sign_in_params, only: [:create]
|
# before_action :configure_sign_in_params, only: [:create]
|
||||||
|
|
||||||
def demo
|
def demo
|
||||||
return redirect_to root_path if Rails.env.production?
|
return redirect_to root_path if Rails.env.production?
|
||||||
|
@ -8,7 +8,7 @@ class Users::SessionsController < Sessions::SessionsController
|
||||||
render 'new'
|
render 'new'
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /resource/sign_in
|
# GET /resource/sign_in
|
||||||
def new
|
def new
|
||||||
unless user_return_to_procedure_id.nil? # WTF ?
|
unless user_return_to_procedure_id.nil? # WTF ?
|
||||||
@dossier = Dossier.new(procedure: Procedure.active(user_return_to_procedure_id))
|
@dossier = Dossier.new(procedure: Procedure.active(user_return_to_procedure_id))
|
||||||
|
@ -19,7 +19,7 @@ class Users::SessionsController < Sessions::SessionsController
|
||||||
error_procedure
|
error_procedure
|
||||||
end
|
end
|
||||||
|
|
||||||
#POST /resource/sign_in
|
#POST /resource/sign_in
|
||||||
def create
|
def create
|
||||||
remember_me = params[:user][:remember_me] == '1'
|
remember_me = params[:user][:remember_me] == '1'
|
||||||
try_to_authenticate(User, remember_me)
|
try_to_authenticate(User, remember_me)
|
||||||
|
@ -44,7 +44,7 @@ class Users::SessionsController < Sessions::SessionsController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# DELETE /resource/sign_out
|
# DELETE /resource/sign_out
|
||||||
def destroy
|
def destroy
|
||||||
sign_out :gestionnaire if gestionnaire_signed_in?
|
sign_out :gestionnaire if gestionnaire_signed_in?
|
||||||
sign_out :administrateur if administrateur_signed_in?
|
sign_out :administrateur if administrateur_signed_in?
|
||||||
|
|
|
@ -17,8 +17,8 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
def authorized_routes? controller
|
def authorized_routes? controller
|
||||||
redirect_to_root_path 'Le status de votre dossier n\'autorise pas cette URL' unless UserRoutesAuthorizationService.authorized_route?(
|
redirect_to_root_path 'Le status de votre dossier n\'autorise pas cette URL' unless UserRoutesAuthorizationService.authorized_route?(
|
||||||
controller,
|
controller,
|
||||||
current_user_dossier)
|
current_user_dossier)
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
redirect_to_root_path 'Vous n’avez pas accès à ce dossier.'
|
redirect_to_root_path 'Vous n’avez pas accès à ce dossier.'
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
class DossiersDecorator < Draper::CollectionDecorator
|
class DossiersDecorator < Draper::CollectionDecorator
|
||||||
delegate :current_page, :per_page, :offset, :total_entries, :total_pages
|
delegate :current_page, :per_page, :offset, :total_entries, :total_pages
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
class EtablissementDecorator < Draper::Decorator
|
class EtablissementDecorator < Draper::Decorator
|
||||||
delegate_all
|
delegate_all
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class ProcedureDecorator < Draper::Decorator
|
class ProcedureDecorator < Draper::Decorator
|
||||||
|
|
||||||
delegate_all
|
delegate_all
|
||||||
|
|
||||||
def lien
|
def lien
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
class ProceduresDecorator < Draper::CollectionDecorator
|
class ProceduresDecorator < Draper::CollectionDecorator
|
||||||
delegate :current_page, :per_page, :offset, :total_entries, :total_pages
|
delegate :current_page, :per_page, :offset, :total_entries, :total_pages
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class TypeDeChampDecorator < Draper::Decorator
|
class TypeDeChampDecorator < Draper::Decorator
|
||||||
|
|
||||||
delegate_all
|
delegate_all
|
||||||
|
|
||||||
def button_up params
|
def button_up params
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
class TypeDeChampPrivateDecorator < TypeDeChampDecorator
|
class TypeDeChampPrivateDecorator < TypeDeChampDecorator
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class DossierFacades
|
class DossierFacades
|
||||||
|
|
||||||
#TODO rechercher en fonction de la personne/email
|
#TODO rechercher en fonction de la personne/email
|
||||||
def initialize(dossier_id, email, champ_id = nil)
|
def initialize(dossier_id, email, champ_id = nil)
|
||||||
@dossier = Dossier.find(dossier_id)
|
@dossier = Dossier.find(dossier_id)
|
||||||
|
|
|
@ -80,5 +80,4 @@ class DossiersListFacades
|
||||||
def base_url liste
|
def base_url liste
|
||||||
@procedure.nil? ? backoffice_dossiers_path(liste: liste) : backoffice_dossiers_procedure_path(id: @procedure.id, liste: liste)
|
@procedure.nil? ? backoffice_dossiers_path(liste: liste) : backoffice_dossiers_procedure_path(id: @procedure.id, liste: liste)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class InviteDossierFacades < DossierFacades
|
class InviteDossierFacades < DossierFacades
|
||||||
|
|
||||||
#TODO rechercher en fonction de la personne/email
|
#TODO rechercher en fonction de la personne/email
|
||||||
def initialize id, email
|
def initialize id, email
|
||||||
@dossier = Invite.where(email: email, id: id).first!.dossier
|
@dossier = Invite.where(email: email, id: id).first!.dossier
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
module Carto
|
module Carto
|
||||||
module GeoAPI
|
module GeoAPI
|
||||||
class Driver
|
class Driver
|
||||||
|
|
||||||
def self.regions
|
def self.regions
|
||||||
call regions_url
|
call regions_url
|
||||||
end
|
end
|
||||||
|
@ -29,7 +28,6 @@ module Carto
|
||||||
rescue RestClient::ServiceUnavailable
|
rescue RestClient::ServiceUnavailable
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,8 +18,8 @@ class CARTO::SGMAP::API
|
||||||
verify_ssl_mode = OpenSSL::SSL::VERIFY_NONE
|
verify_ssl_mode = OpenSSL::SSL::VERIFY_NONE
|
||||||
|
|
||||||
RestClient::Resource.new(
|
RestClient::Resource.new(
|
||||||
url,
|
url,
|
||||||
verify_ssl: verify_ssl_mode,
|
verify_ssl: verify_ssl_mode,
|
||||||
).post params[:geojson], content_type: 'application/json'
|
).post params[:geojson], content_type: 'application/json'
|
||||||
|
|
||||||
rescue RestClient::InternalServerError
|
rescue RestClient::InternalServerError
|
||||||
|
|
|
@ -12,7 +12,6 @@ class SIADE::RNAAdapter
|
||||||
|
|
||||||
data_source[:association].each do |k, v|
|
data_source[:association].each do |k, v|
|
||||||
params[k] = v if attr_to_fetch.include?(k)
|
params[k] = v if attr_to_fetch.include?(k)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
params[:association_id] = params[:id]
|
params[:association_id] = params[:id]
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
class AvisMailer < ApplicationMailer
|
class AvisMailer < ApplicationMailer
|
||||||
|
|
||||||
def avis_invitation(avis)
|
def avis_invitation(avis)
|
||||||
@avis = avis
|
@avis = avis
|
||||||
email = @avis.gestionnaire.try(:email) || @avis.email
|
email = @avis.gestionnaire.try(:email) || @avis.email
|
||||||
mail(to: email, subject: "Donnez votre avis sur le dossier nº #{@avis.dossier.id} (#{@avis.dossier.procedure.libelle})")
|
mail(to: email, subject: "Donnez votre avis sur le dossier nº #{@avis.dossier.id} (#{@avis.dossier.procedure.libelle})")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class GestionnaireMailer < ApplicationMailer
|
class GestionnaireMailer < ApplicationMailer
|
||||||
|
|
||||||
def new_gestionnaire email, password
|
def new_gestionnaire email, password
|
||||||
send_mail email, password, "Vous avez été nommé accompagnateur sur la plateforme TPS"
|
send_mail email, password, "Vous avez été nommé accompagnateur sur la plateforme TPS"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class InviteMailer < ApplicationMailer
|
class InviteMailer < ApplicationMailer
|
||||||
|
|
||||||
def invite_user invite
|
def invite_user invite
|
||||||
vars_mailer invite
|
vars_mailer invite
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
class NewAdminMailer < ApplicationMailer
|
class NewAdminMailer < ApplicationMailer
|
||||||
def new_admin_email admin, password
|
def new_admin_email admin, password
|
||||||
|
|
||||||
@admin = admin
|
@admin = admin
|
||||||
@password = password
|
@password = password
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
class WelcomeMailer < ApplicationMailer
|
class WelcomeMailer < ApplicationMailer
|
||||||
def welcome_email user
|
def welcome_email user
|
||||||
|
|
||||||
@user = user
|
@user = user
|
||||||
|
|
||||||
mail(to: user.email,
|
mail(to: user.email,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class Administrateur < ActiveRecord::Base
|
class Administrateur < ActiveRecord::Base
|
||||||
devise :database_authenticatable, :registerable,
|
devise :database_authenticatable, :registerable,
|
||||||
:recoverable, :rememberable, :trackable, :validatable
|
:recoverable, :rememberable, :trackable, :validatable
|
||||||
|
|
||||||
has_and_belongs_to_many :gestionnaires
|
has_and_belongs_to_many :gestionnaires
|
||||||
has_many :procedures
|
has_many :procedures
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
class ChampPrivate < Champ
|
class ChampPrivate < Champ
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
class ChampPublic < Champ
|
class ChampPublic < Champ
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,5 +15,4 @@ module CredentialsSyncableConcern
|
||||||
def force_sync_credentials
|
def force_sync_credentials
|
||||||
SyncCredentialsService.new(self.class, email_was, email, encrypted_password).change_credentials!
|
SyncCredentialsService.new(self.class, email_was, email, encrypted_password).change_credentials!
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class Gestionnaire < ActiveRecord::Base
|
class Gestionnaire < ActiveRecord::Base
|
||||||
devise :database_authenticatable, :registerable,
|
devise :database_authenticatable, :registerable,
|
||||||
:recoverable, :rememberable, :trackable, :validatable
|
:recoverable, :rememberable, :trackable, :validatable
|
||||||
|
|
||||||
has_and_belongs_to_many :administrateurs
|
has_and_belongs_to_many :administrateurs
|
||||||
|
|
||||||
|
@ -52,10 +52,8 @@ class Gestionnaire < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_default_preferences_list_dossier procedure_id=nil
|
def build_default_preferences_list_dossier procedure_id=nil
|
||||||
|
|
||||||
PreferenceListDossier.available_columns_for(procedure_id).each do |table|
|
PreferenceListDossier.available_columns_for(procedure_id).each do |table|
|
||||||
table.second.each do |column|
|
table.second.each do |column|
|
||||||
|
|
||||||
if valid_couple_table_attr? table.first, column.first
|
if valid_couple_table_attr? table.first, column.first
|
||||||
PreferenceListDossier.create(
|
PreferenceListDossier.create(
|
||||||
libelle: column.second[:libelle],
|
libelle: column.second[:libelle],
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class Invite < ActiveRecord::Base
|
class Invite < ActiveRecord::Base
|
||||||
|
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
class InviteGestionnaire < Invite
|
class InviteGestionnaire < Invite
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
class InviteUser < Invite
|
class InviteUser < Invite
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,7 +33,7 @@ class PieceJustificative < ActiveRecord::Base
|
||||||
(RemoteDownloader.new content.filename).url
|
(RemoteDownloader.new content.filename).url
|
||||||
else
|
else
|
||||||
(LocalDownloader.new content.path,
|
(LocalDownloader.new content.path,
|
||||||
(type_de_piece_justificative.nil? ? content.original_filename : type_de_piece_justificative.libelle)).url
|
(type_de_piece_justificative.nil? ? content.original_filename : type_de_piece_justificative.libelle)).url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -88,7 +88,8 @@ class Procedure < ActiveRecord::Base
|
||||||
|
|
||||||
def clone
|
def clone
|
||||||
procedure = self.deep_clone(include:
|
procedure = self.deep_clone(include:
|
||||||
[:types_de_piece_justificative,
|
[
|
||||||
|
:types_de_piece_justificative,
|
||||||
:types_de_champ,
|
:types_de_champ,
|
||||||
:types_de_champ_private,
|
:types_de_champ_private,
|
||||||
:module_api_carto,
|
:module_api_carto,
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
class TypeDeChampPrivate < TypeDeChamp
|
class TypeDeChampPrivate < TypeDeChamp
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
class TypeDeChampPublic < TypeDeChamp
|
class TypeDeChampPublic < TypeDeChamp
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ class User < ActiveRecord::Base
|
||||||
# Include default devise modules. Others available are:
|
# Include default devise modules. Others available are:
|
||||||
# :confirmable, :lockable, :timeoutable and :omniauthable
|
# :confirmable, :lockable, :timeoutable and :omniauthable
|
||||||
devise :database_authenticatable, :registerable,
|
devise :database_authenticatable, :registerable,
|
||||||
:recoverable, :rememberable, :trackable, :validatable
|
:recoverable, :rememberable, :trackable, :validatable
|
||||||
|
|
||||||
has_many :dossiers, dependent: :destroy
|
has_many :dossiers, dependent: :destroy
|
||||||
has_many :invites, dependent: :destroy
|
has_many :invites, dependent: :destroy
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class CerfaSerializer < ActiveModel::Serializer
|
class CerfaSerializer < ActiveModel::Serializer
|
||||||
attributes :created_at,
|
attributes :created_at,
|
||||||
:content_url
|
:content_url
|
||||||
|
|
||||||
has_one :user
|
has_one :user
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class CommentaireSerializer < ActiveModel::Serializer
|
class CommentaireSerializer < ActiveModel::Serializer
|
||||||
attributes :email,
|
attributes :email,
|
||||||
:body,
|
:body,
|
||||||
:created_at
|
:created_at
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
class DossierSerializer < ActiveModel::Serializer
|
class DossierSerializer < ActiveModel::Serializer
|
||||||
attributes :id,
|
attributes :id,
|
||||||
:created_at,
|
:created_at,
|
||||||
:updated_at,
|
:updated_at,
|
||||||
:archived,
|
:archived,
|
||||||
:mandataire_social,
|
:mandataire_social,
|
||||||
:state,
|
:state,
|
||||||
:simplified_state,
|
:simplified_state,
|
||||||
:initiated_at,
|
:initiated_at,
|
||||||
:received_at,
|
:received_at,
|
||||||
:processed_at,
|
:processed_at,
|
||||||
:accompagnateurs,
|
:accompagnateurs,
|
||||||
:invites
|
:invites
|
||||||
|
|
||||||
has_one :entreprise
|
has_one :entreprise
|
||||||
has_one :etablissement
|
has_one :etablissement
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
class DossierTableExportSerializer < ActiveModel::Serializer
|
class DossierTableExportSerializer < ActiveModel::Serializer
|
||||||
attributes :id,
|
attributes :id,
|
||||||
:created_at,
|
:created_at,
|
||||||
:updated_at,
|
:updated_at,
|
||||||
:archived,
|
:archived,
|
||||||
:mandataire_social,
|
:mandataire_social,
|
||||||
:state,
|
:state,
|
||||||
:initiated_at,
|
:initiated_at,
|
||||||
:received_at,
|
:received_at,
|
||||||
:processed_at
|
:processed_at
|
||||||
|
|
||||||
attribute :emails_accompagnateurs
|
attribute :emails_accompagnateurs
|
||||||
|
|
||||||
attributes :individual_gender,
|
attributes :individual_gender,
|
||||||
:individual_prenom,
|
:individual_prenom,
|
||||||
:individual_nom,
|
:individual_nom,
|
||||||
:individual_birthdate
|
:individual_birthdate
|
||||||
|
|
||||||
def individual_prenom
|
def individual_prenom
|
||||||
object.individual.try(:prenom)
|
object.individual.try(:prenom)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class DossiersSerializer < ActiveModel::Serializer
|
class DossiersSerializer < ActiveModel::Serializer
|
||||||
attributes :id,
|
attributes :id,
|
||||||
:updated_at
|
:updated_at
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
class EntrepriseSerializer < ActiveModel::Serializer
|
class EntrepriseSerializer < ActiveModel::Serializer
|
||||||
attributes :siren,
|
attributes :siren,
|
||||||
:capital_social,
|
:capital_social,
|
||||||
:numero_tva_intracommunautaire,
|
:numero_tva_intracommunautaire,
|
||||||
:forme_juridique,
|
:forme_juridique,
|
||||||
:forme_juridique_code,
|
:forme_juridique_code,
|
||||||
:nom_commercial,
|
:nom_commercial,
|
||||||
:raison_sociale,
|
:raison_sociale,
|
||||||
:siret_siege_social,
|
:siret_siege_social,
|
||||||
:code_effectif_entreprise,
|
:code_effectif_entreprise,
|
||||||
:date_creation,
|
:date_creation,
|
||||||
:nom,
|
:nom,
|
||||||
:prenom
|
:prenom
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
class EtablissementSerializer < ActiveModel::Serializer
|
class EtablissementSerializer < ActiveModel::Serializer
|
||||||
attributes :siret,
|
attributes :siret,
|
||||||
:siege_social,
|
:siege_social,
|
||||||
:naf,
|
:naf,
|
||||||
:libelle_naf,
|
:libelle_naf,
|
||||||
:adresse,
|
:adresse,
|
||||||
:numero_voie,
|
:numero_voie,
|
||||||
:type_voie,
|
:type_voie,
|
||||||
:nom_voie,
|
:nom_voie,
|
||||||
:complement_adresse,
|
:complement_adresse,
|
||||||
:code_postal,
|
:code_postal,
|
||||||
:localite,
|
:localite,
|
||||||
:code_insee_localite
|
:code_insee_localite
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
class ModuleApiCartoSerializer < ActiveModel::Serializer
|
class ModuleApiCartoSerializer < ActiveModel::Serializer
|
||||||
attributes :use_api_carto,
|
attributes :use_api_carto,
|
||||||
:quartiers_prioritaires,
|
:quartiers_prioritaires,
|
||||||
:cadastre
|
:cadastre
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class PieceJustificativeSerializer < ActiveModel::Serializer
|
class PieceJustificativeSerializer < ActiveModel::Serializer
|
||||||
attributes :created_at,
|
attributes :created_at,
|
||||||
:type_de_piece_justificative_id,
|
:type_de_piece_justificative_id,
|
||||||
:content_url
|
:content_url
|
||||||
|
|
||||||
has_one :user
|
has_one :user
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,13 +3,12 @@ class ProcedureSerializer < ActiveModel::Serializer
|
||||||
attribute :lien_demarche, key: :link
|
attribute :lien_demarche, key: :link
|
||||||
|
|
||||||
attributes :id,
|
attributes :id,
|
||||||
:description,
|
:description,
|
||||||
:organisation,
|
:organisation,
|
||||||
:direction,
|
:direction,
|
||||||
:archived,
|
:archived,
|
||||||
:geographic_information,
|
:geographic_information,
|
||||||
:total_dossier
|
:total_dossier
|
||||||
|
|
||||||
|
|
||||||
has_one :geographic_information, serializer: ModuleApiCartoSerializer
|
has_one :geographic_information, serializer: ModuleApiCartoSerializer
|
||||||
has_many :types_de_champ, serializer: TypeDeChampSerializer
|
has_many :types_de_champ, serializer: TypeDeChampSerializer
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class TypeDeChampSerializer < ActiveModel::Serializer
|
class TypeDeChampSerializer < ActiveModel::Serializer
|
||||||
attributes :id,
|
attributes :id,
|
||||||
:libelle,
|
:libelle,
|
||||||
:type_champ,
|
:type_champ,
|
||||||
:order_place,
|
:order_place,
|
||||||
:description
|
:description
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class TypeDePieceJustificativeSerializer < ActiveModel::Serializer
|
class TypeDePieceJustificativeSerializer < ActiveModel::Serializer
|
||||||
attributes :id,
|
attributes :id,
|
||||||
:libelle,
|
:libelle,
|
||||||
:description,
|
:description,
|
||||||
:order_place,
|
:order_place,
|
||||||
:lien_demarche
|
:lien_demarche
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class BrowserService
|
class BrowserService
|
||||||
|
|
||||||
def self.get_browser request
|
def self.get_browser request
|
||||||
BROWSER.value = Browser.new(request.user_agent)
|
BROWSER.value = Browser.new(request.user_agent)
|
||||||
end
|
end
|
||||||
|
@ -15,5 +14,4 @@ class BrowserService
|
||||||
|
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
class ClamavService
|
class ClamavService
|
||||||
def self.safe_file? path_file
|
def self.safe_file? path_file
|
||||||
|
|
||||||
if Rails.env == 'development'
|
if Rails.env == 'development'
|
||||||
return CLAMAV[:response] if CLAMAV[:mock?]
|
return CLAMAV[:response] if CLAMAV[:mock?]
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class DossierService
|
class DossierService
|
||||||
|
|
||||||
def initialize dossier, siret, france_connect_information
|
def initialize dossier, siret, france_connect_information
|
||||||
@dossier = dossier
|
@dossier = dossier
|
||||||
@siret = siret
|
@siret = siret
|
||||||
|
@ -34,7 +33,6 @@ class DossierService
|
||||||
@dossier
|
@dossier
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def self.siren siret
|
def self.siren siret
|
||||||
siret[0..8]
|
siret[0..8]
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,6 @@ class DossiersListGestionnaireService
|
||||||
'termine' => termine,
|
'termine' => termine,
|
||||||
'archive' => archive,
|
'archive' => archive,
|
||||||
'all_state' => all_state}[@liste]
|
'all_state' => all_state}[@liste]
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.dossiers_liste_libelle
|
def self.dossiers_liste_libelle
|
||||||
|
@ -186,5 +185,4 @@ class DossiersListGestionnaireService
|
||||||
def current_preference_smart_listing_page
|
def current_preference_smart_listing_page
|
||||||
@current_devise_profil.preference_smart_listing_page
|
@current_devise_profil.preference_smart_listing_page
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class FranceConnectSaltService
|
class FranceConnectSaltService
|
||||||
|
|
||||||
attr_reader :model
|
attr_reader :model
|
||||||
|
|
||||||
def initialize france_connect_information
|
def initialize france_connect_information
|
||||||
|
|
|
@ -11,7 +11,6 @@ class GeojsonService
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.to_json_polygon_for_cadastre coordinates
|
def self.to_json_polygon_for_cadastre coordinates
|
||||||
|
|
||||||
polygon = {
|
polygon = {
|
||||||
geom: {
|
geom: {
|
||||||
type: "Feature",
|
type: "Feature",
|
||||||
|
|
|
@ -26,12 +26,14 @@ class ModuleApiCartoService
|
||||||
def self.generate_qp coordinates
|
def self.generate_qp coordinates
|
||||||
coordinates.inject({}) { |acc, coordinate|
|
coordinates.inject({}) { |acc, coordinate|
|
||||||
acc.merge CARTO::SGMAP::QuartiersPrioritaires::Adapter.new(
|
acc.merge CARTO::SGMAP::QuartiersPrioritaires::Adapter.new(
|
||||||
coordinate.map { |element| [element['lng'], element['lat']] }).to_params }
|
coordinate.map { |element| [element['lng'], element['lat']] }).to_params
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.generate_cadastre coordinates
|
def self.generate_cadastre coordinates
|
||||||
(coordinates.inject([]) { |acc, coordinate|
|
(coordinates.inject([]) { |acc, coordinate|
|
||||||
acc << CARTO::SGMAP::Cadastre::Adapter.new(
|
acc << CARTO::SGMAP::Cadastre::Adapter.new(
|
||||||
coordinate.map { |element| [element['lng'], element['lat']] }).to_params }).flatten
|
coordinate.map { |element| [element['lng'], element['lat']] }).to_params
|
||||||
|
}).flatten
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class NotificationService
|
class NotificationService
|
||||||
|
|
||||||
def initialize type_notif, dossier_id, attribut_change=''
|
def initialize type_notif, dossier_id, attribut_change=''
|
||||||
@type_notif = type_notif
|
@type_notif = type_notif
|
||||||
@dossier_id = dossier_id
|
@dossier_id = dossier_id
|
||||||
|
@ -25,20 +24,20 @@ class NotificationService
|
||||||
|
|
||||||
def text_for_notif attribut=''
|
def text_for_notif attribut=''
|
||||||
case @type_notif
|
case @type_notif
|
||||||
when 'commentaire'
|
when 'commentaire'
|
||||||
"#{notification.liste.size + 1} nouveau(x) commentaire(s) déposé(s)."
|
"#{notification.liste.size + 1} nouveau(x) commentaire(s) déposé(s)."
|
||||||
when 'cerfa'
|
when 'cerfa'
|
||||||
"Un nouveau formulaire a été déposé."
|
"Un nouveau formulaire a été déposé."
|
||||||
when 'piece_justificative'
|
when 'piece_justificative'
|
||||||
attribut
|
attribut
|
||||||
when 'champs'
|
when 'champs'
|
||||||
attribut
|
attribut
|
||||||
when 'submitted'
|
when 'submitted'
|
||||||
"Le dossier nº #{@dossier_id} a été déposé."
|
"Le dossier nº #{@dossier_id} a été déposé."
|
||||||
when 'avis'
|
when 'avis'
|
||||||
'Un nouvel avis a été rendu'
|
'Un nouvel avis a été rendu'
|
||||||
else
|
else
|
||||||
'Notification par défaut'
|
'Notification par défaut'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class RenderPartialService
|
class RenderPartialService
|
||||||
|
|
||||||
attr_accessor :controller, :method
|
attr_accessor :controller, :method
|
||||||
|
|
||||||
def initialize controller, method
|
def initialize controller, method
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class SyncCredentialsService
|
class SyncCredentialsService
|
||||||
|
|
||||||
def initialize klass, email_was, email, encrypted_password
|
def initialize klass, email_was, email, encrypted_password
|
||||||
@klass = klass
|
@klass = klass
|
||||||
@email_was = email_was
|
@email_was = email_was
|
||||||
|
|
|
@ -7,7 +7,6 @@ class TypesDeChampService
|
||||||
.permit("#{attributes}" => [:libelle, :description, :order_place, :type_champ, :id, :mandatory, :type,
|
.permit("#{attributes}" => [:libelle, :description, :order_place, :type_champ, :id, :mandatory, :type,
|
||||||
drop_down_list_attributes: [:value, :id]])
|
drop_down_list_attributes: [:value, :id]])
|
||||||
|
|
||||||
|
|
||||||
parameters[attributes].each do |param_first, param_second|
|
parameters[attributes].each do |param_first, param_second|
|
||||||
if param_second[:libelle].empty?
|
if param_second[:libelle].empty?
|
||||||
parameters[attributes].delete(param_first.to_s)
|
parameters[attributes].delete(param_first.to_s)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class UserRoutesAuthorizationService
|
class UserRoutesAuthorizationService
|
||||||
|
|
||||||
def self.authorized_route? controller, dossier
|
def self.authorized_route? controller, dossier
|
||||||
auth = controller.route_authorization
|
auth = controller.route_authorization
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class CerfaUploader < BaseUploader
|
class CerfaUploader < BaseUploader
|
||||||
before :cache, :set_original_filename
|
before :cache, :set_original_filename
|
||||||
|
|
||||||
# Choose what kind of storage to use for this uploader:
|
# Choose what kind of storage to use for this uploader:
|
||||||
if Features.remote_storage
|
if Features.remote_storage
|
||||||
storage :fog
|
storage :fog
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
|
|
||||||
class ProcedureLogoUploader < BaseUploader
|
class ProcedureLogoUploader < BaseUploader
|
||||||
|
|
||||||
def root
|
def root
|
||||||
File.join(Rails.root, "public")
|
File.join(Rails.root, "public")
|
||||||
end
|
end
|
||||||
|
@ -47,5 +46,4 @@ class ProcedureLogoUploader < BaseUploader
|
||||||
def generate_secure_token
|
def generate_secure_token
|
||||||
SecureRandom.uuid
|
SecureRandom.uuid
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class EmailFormatValidator < ActiveModel::Validator
|
class EmailFormatValidator < ActiveModel::Validator
|
||||||
|
|
||||||
def email_regex
|
def email_regex
|
||||||
/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
|
/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class ProcedurePathFormatValidator < ActiveModel::Validator
|
class ProcedurePathFormatValidator < ActiveModel::Validator
|
||||||
|
|
||||||
def path_regex
|
def path_regex
|
||||||
/^[a-z0-9_]{3,30}$/
|
/^[a-z0-9_]{3,30}$/
|
||||||
end
|
end
|
||||||
|
@ -8,5 +7,4 @@ class ProcedurePathFormatValidator < ActiveModel::Validator
|
||||||
return false if record.path.blank?
|
return false if record.path.blank?
|
||||||
record.errors[:path] << "Path invalide" unless path_regex.match(record.path)
|
record.errors[:path] << "Path invalide" unless path_regex.match(record.path)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,6 +9,7 @@ class SiretFormatValidator < ActiveModel::EachValidator
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def luhn_checksum(value)
|
def luhn_checksum(value)
|
||||||
accum = 0
|
accum = 0
|
||||||
value.reverse.each_char.map(&:to_i).each_with_index do |digit, index|
|
value.reverse.each_char.map(&:to_i).each_with_index do |digit, index|
|
||||||
|
|
|
@ -15,7 +15,6 @@ raise "Bad to=#{+ENV['to']}" unless ["staging", "production"].include?(ENV['to']
|
||||||
|
|
||||||
raise "missing domain, run with 'rake deploy domain=37.187.154.237'" if ENV['domain'].nil?
|
raise "missing domain, run with 'rake deploy domain=37.187.154.237'" if ENV['domain'].nil?
|
||||||
|
|
||||||
|
|
||||||
# set :domain, '5.135.190.60'
|
# set :domain, '5.135.190.60'
|
||||||
set :domain, ENV['domain']
|
set :domain, ENV['domain']
|
||||||
set :repository, 'https://github.com/sgmap/tps.git'
|
set :repository, 'https://github.com/sgmap/tps.git'
|
||||||
|
@ -72,7 +71,6 @@ set :shared_paths, [
|
||||||
'app/views/cgu/index.html.haml'
|
'app/views/cgu/index.html.haml'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
set :rbenv_path, "/usr/local/rbenv/bin/rbenv"
|
set :rbenv_path, "/usr/local/rbenv/bin/rbenv"
|
||||||
|
|
||||||
# Optional settings:
|
# Optional settings:
|
||||||
|
|
|
@ -14,5 +14,4 @@ Apipie.configure do |config|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,75 +1,75 @@
|
||||||
SmartListing.configure do |config|
|
SmartListing.configure do |config|
|
||||||
config.global_options({
|
config.global_options({
|
||||||
#:param_names => { # param names
|
# :param_names => { # param names
|
||||||
#:page => :page,
|
# :page => :page,
|
||||||
#:per_page => :per_page,
|
# :per_page => :per_page,
|
||||||
#:sort => :sort,
|
# :sort => :sort,
|
||||||
#},
|
# },
|
||||||
#:array => false, # controls whether smart list should be using arrays or AR collections
|
# :array => false, # controls whether smart list should be using arrays or AR collections
|
||||||
#:max_count => nil, # limit number of rows
|
# :max_count => nil, # limit number of rows
|
||||||
#:unlimited_per_page => false, # allow infinite page size
|
# :unlimited_per_page => false, # allow infinite page size
|
||||||
#:paginate => true, # allow pagination
|
# :paginate => true, # allow pagination
|
||||||
#:memorize_per_page => false, # save per page settings in the cookie
|
# :memorize_per_page => false, # save per page settings in the cookie
|
||||||
:page_sizes => [10, 20, 50, 100], # set available page sizes array
|
:page_sizes => [10, 20, 50, 100], # set available page sizes array
|
||||||
#:kaminari_options => {:theme => "smart_listing"}, # Kaminari's paginate helper options
|
# :kaminari_options => {:theme => "smart_listing"}, # Kaminari's paginate helper options
|
||||||
})
|
})
|
||||||
|
|
||||||
config.constants :classes, {
|
config.constants :classes, {
|
||||||
#:main => "smart-listing",
|
#:main => "smart-listing",
|
||||||
#:editable => "editable",
|
#:editable => "editable",
|
||||||
#:content => "content",
|
#:content => "content",
|
||||||
#:loading => "loading",
|
#:loading => "loading",
|
||||||
#:status => "smart-listing-status",
|
#:status => "smart-listing-status",
|
||||||
#:item_actions => "actions",
|
#:item_actions => "actions",
|
||||||
#:new_item_placeholder => "new-item-placeholder",
|
#:new_item_placeholder => "new-item-placeholder",
|
||||||
#:new_item_action => "new-item-action",
|
#:new_item_action => "new-item-action",
|
||||||
#:new_item_button => "btn",
|
#:new_item_button => "btn",
|
||||||
#:hidden => "hidden",
|
#:hidden => "hidden",
|
||||||
#:autoselect => "autoselect",
|
#:autoselect => "autoselect",
|
||||||
#:callback => "callback",
|
#:callback => "callback",
|
||||||
#:pagination_per_page => "pagination-per-page text-center",
|
#:pagination_per_page => "pagination-per-page text-center",
|
||||||
#:pagination_count => "count",
|
#:pagination_count => "count",
|
||||||
#:inline_editing => "info",
|
#:inline_editing => "info",
|
||||||
#:no_records => "no-records",
|
#:no_records => "no-records",
|
||||||
#:limit => "smart-listing-limit",
|
#:limit => "smart-listing-limit",
|
||||||
#:limit_alert => "smart-listing-limit-alert",
|
#:limit_alert => "smart-listing-limit-alert",
|
||||||
#:controls => "smart-listing-controls",
|
#:controls => "smart-listing-controls",
|
||||||
#:controls_reset => "reset",
|
#:controls_reset => "reset",
|
||||||
#:filtering => "filter",
|
#:filtering => "filter",
|
||||||
#:filtering_search => "glyphicon-search",
|
#:filtering_search => "glyphicon-search",
|
||||||
#:filtering_cancel => "glyphicon-remove",
|
#:filtering_cancel => "glyphicon-remove",
|
||||||
#:filtering_disabled => "disabled",
|
#:filtering_disabled => "disabled",
|
||||||
#:sortable => "sortable",
|
#:sortable => "sortable",
|
||||||
#:icon_new => "glyphicon glyphicon-plus",
|
#:icon_new => "glyphicon glyphicon-plus",
|
||||||
#:icon_edit => "glyphicon glyphicon-pencil",
|
#:icon_edit => "glyphicon glyphicon-pencil",
|
||||||
#:icon_trash => "glyphicon glyphicon-trash",
|
#:icon_trash => "glyphicon glyphicon-trash",
|
||||||
#:icon_inactive => "glyphicon glyphicon-circle",
|
#:icon_inactive => "glyphicon glyphicon-circle",
|
||||||
#:icon_show => "glyphicon glyphicon-share-alt",
|
#:icon_show => "glyphicon glyphicon-share-alt",
|
||||||
#:icon_sort_none => "glyphicon glyphicon-resize-vertical",
|
#:icon_sort_none => "glyphicon glyphicon-resize-vertical",
|
||||||
#:icon_sort_up => "glyphicon glyphicon-chevron-up",
|
#:icon_sort_up => "glyphicon glyphicon-chevron-up",
|
||||||
#:icon_sort_down => "glyphicon glyphicon-chevron-down",
|
#:icon_sort_down => "glyphicon glyphicon-chevron-down",
|
||||||
}
|
}
|
||||||
|
|
||||||
config.constants :data_attributes, {
|
config.constants :data_attributes, {
|
||||||
#:main => "smart-listing",
|
# :main => "smart-listing",
|
||||||
#:confirmation => "confirmation",
|
# :confirmation => "confirmation",
|
||||||
#:id => "id",
|
# :id => "id",
|
||||||
#:href => "href",
|
# :href => "href",
|
||||||
#:callback_href => "callback-href",
|
# :callback_href => "callback-href",
|
||||||
#:max_count => "max-count",
|
# :max_count => "max-count",
|
||||||
#:inline_edit_backup => "smart-listing-edit-backup",
|
# :inline_edit_backup => "smart-listing-edit-backup",
|
||||||
#:params => "params",
|
# :params => "params",
|
||||||
#:observed => "observed",
|
# :observed => "observed",
|
||||||
#:href => "href",
|
# :href => "href",
|
||||||
#:autoshow => "autoshow",
|
# :autoshow => "autoshow",
|
||||||
#:popover => "slpopover",
|
# :popover => "slpopover",
|
||||||
}
|
}
|
||||||
|
|
||||||
config.constants :selectors, {
|
config.constants :selectors, {
|
||||||
#:item_action_destroy => "a.destroy",
|
# :item_action_destroy => "a.destroy",
|
||||||
#:edit_cancel => "button.cancel",
|
# :edit_cancel => "button.cancel",
|
||||||
#:row => "tr",
|
# :row => "tr",
|
||||||
#:head => "thead",
|
# :head => "thead",
|
||||||
#:filtering_icon => "i"
|
# :filtering_icon => "i"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
require "unicode_utils/upcase"
|
require "unicode_utils/upcase"
|
||||||
|
|
||||||
class String
|
class String
|
||||||
|
|
||||||
def upcase
|
def upcase
|
||||||
UnicodeUtils.upcase(self)
|
UnicodeUtils.upcase(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
|
|
||||||
get "/ping" => "ping#index", :constraints => {:ip => /127.0.0.1/}
|
get "/ping" => "ping#index", :constraints => {:ip => /127.0.0.1/}
|
||||||
|
|
||||||
devise_for :administrations, skip: [:password, :registrations]
|
devise_for :administrations, skip: [:password, :registrations]
|
||||||
|
@ -144,7 +143,6 @@ Rails.application.routes.draw do
|
||||||
resource :accompagnateurs, only: [:show, :update]
|
resource :accompagnateurs, only: [:show, :update]
|
||||||
|
|
||||||
resource :previsualisation, only: [:show]
|
resource :previsualisation, only: [:show]
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :accompagnateurs do
|
namespace :accompagnateurs do
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
|
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
|
||||||
# documentation.
|
# documentation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Use at least one worker per core if you're on a dedicated server,
|
# Use at least one worker per core if you're on a dedicated server,
|
||||||
# more will usually help for _short_ waits on databases/caches.
|
# more will usually help for _short_ waits on databases/caches.
|
||||||
worker_processes 2
|
worker_processes 2
|
||||||
|
@ -52,7 +50,6 @@ check_client_connection false
|
||||||
# local variable to guard against running a hook multiple times
|
# local variable to guard against running a hook multiple times
|
||||||
run_once = true
|
run_once = true
|
||||||
|
|
||||||
|
|
||||||
before_fork do |server, worker|
|
before_fork do |server, worker|
|
||||||
# the following is highly recomended for Rails + "preload_app true"
|
# the following is highly recomended for Rails + "preload_app true"
|
||||||
# as there's no need for the master process to hold a connection
|
# as there's no need for the master process to hold a connection
|
||||||
|
|
|
@ -13,7 +13,6 @@ class CreateEntreprise < ActiveRecord::Migration
|
||||||
t.integer :date_creation
|
t.integer :date_creation
|
||||||
t.string :nom
|
t.string :nom
|
||||||
t.string :prenom
|
t.string :prenom
|
||||||
|
|
||||||
end
|
end
|
||||||
add_reference :entreprises, :dossier, references: :dossiers
|
add_reference :entreprises, :dossier, references: :dossiers
|
||||||
end
|
end
|
||||||
|
|
|
@ -30,7 +30,6 @@ class DeviseCreateUsers < ActiveRecord::Migration
|
||||||
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||||
# t.datetime :locked_at
|
# t.datetime :locked_at
|
||||||
|
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ class DeviseCreatePros < ActiveRecord::Migration
|
||||||
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||||
# t.datetime :locked_at
|
# t.datetime :locked_at
|
||||||
|
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ class DeviseCreateGestionnaires < ActiveRecord::Migration
|
||||||
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||||
# t.datetime :locked_at
|
# t.datetime :locked_at
|
||||||
|
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ class CreateUsers < ActiveRecord::Migration
|
||||||
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||||
# t.datetime :locked_at
|
# t.datetime :locked_at
|
||||||
|
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ class DeviseCreateAdministrateurs < ActiveRecord::Migration
|
||||||
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||||
# t.datetime :locked_at
|
# t.datetime :locked_at
|
||||||
|
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
class ChangeStateConfirmedToValidated < ActiveRecord::Migration
|
class ChangeStateConfirmedToValidated < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
Dossier.where(state: 'confirmed').update_all(state: 'validated')
|
Dossier.where(state: 'confirmed').update_all(state: 'validated')
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,6 +7,5 @@ class DeleteAttributsToDossier < ActiveRecord::Migration
|
||||||
|
|
||||||
remove_column :dossiers, :position_lon
|
remove_column :dossiers, :position_lon
|
||||||
remove_column :dossiers, :ref_dossier_carto
|
remove_column :dossiers, :ref_dossier_carto
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
class UpdateModuleAPICarto < ActiveRecord::Migration
|
class UpdateModuleAPICarto < ActiveRecord::Migration
|
||||||
|
|
||||||
class Procedure < ActiveRecord::Base
|
class Procedure < ActiveRecord::Base
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class ModuleAPICarto < ActiveRecord::Base
|
class ModuleAPICarto < ActiveRecord::Base
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def up
|
def up
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
class CreateFranceConnectInformation < ActiveRecord::Migration
|
class CreateFranceConnectInformation < ActiveRecord::Migration
|
||||||
|
|
||||||
class User < ActiveRecord::Base
|
class User < ActiveRecord::Base
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class FranceConnectInformation < ActiveRecord::Base
|
class FranceConnectInformation < ActiveRecord::Base
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def up
|
def up
|
||||||
|
@ -38,7 +35,6 @@ class CreateFranceConnectInformation < ActiveRecord::Migration
|
||||||
remove_column :users, :france_connect_particulier_id
|
remove_column :users, :france_connect_particulier_id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def down
|
def down
|
||||||
add_column :users, :gender, :string
|
add_column :users, :gender, :string
|
||||||
add_column :users, :given_name, :string
|
add_column :users, :given_name, :string
|
||||||
|
|
|
@ -30,7 +30,6 @@ class DeviseCreateAdministrations < ActiveRecord::Migration
|
||||||
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||||
# t.datetime :locked_at
|
# t.datetime :locked_at
|
||||||
|
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ class PieceJustificativeHaveUser < ActiveRecord::Migration
|
||||||
end
|
end
|
||||||
|
|
||||||
class User < ActiveRecord::Base
|
class User < ActiveRecord::Base
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def change
|
def change
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue