diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index df168b7c1..9b58e571d 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -250,7 +250,11 @@ class ApplicationController < ActionController::Base
email: current_administrateur&.email,
DS_SIGN_IN_COUNT: current_administrateur&.sign_in_count,
DS_CREATED_AT: current_administrateur&.created_at,
- DS_ID: current_administrateur&.id
+ DS_ID: current_administrateur&.id,
+ DS_NB_DEMARCHES_BROUILLONS: current_administrateur&.procedures&.brouillons&.count,
+ DS_NB_DEMARCHES_ACTIVES: current_administrateur&.procedures&.publiees&.count,
+ DS_NB_DEMARCHES_ARCHIVES: current_administrateur&.procedures&.archivees&.count
+
}
}
end
diff --git a/app/controllers/manager/dossiers_controller.rb b/app/controllers/manager/dossiers_controller.rb
index 74170f17f..31867443f 100644
--- a/app/controllers/manager/dossiers_controller.rb
+++ b/app/controllers/manager/dossiers_controller.rb
@@ -22,9 +22,8 @@ module Manager
def hide
dossier = Dossier.find(params[:id])
- deleted_dossier = dossier.hide!(current_administration)
+ dossier.hide!(current_administration)
- DossierMailer.notify_deletion_to_user(deleted_dossier, dossier.user.email).deliver_later
logger.info("Le dossier #{dossier.id} est supprimé par #{current_administration.email}")
flash[:notice] = "Le dossier #{dossier.id} est supprimé"
diff --git a/app/javascript/shared/track/crisp.js b/app/javascript/shared/track/crisp.js
index a016a1ab2..55819e034 100644
--- a/app/javascript/shared/track/crisp.js
+++ b/app/javascript/shared/track/crisp.js
@@ -21,6 +21,12 @@ if (enabled) {
[
['DS_ID', administrateur.email],
['DS_SIGN_IN_COUNT', administrateur.DS_SIGN_IN_COUNT],
+ [
+ 'DS_NB_DEMARCHES_BROUILLONS',
+ administrateur.DS_NB_DEMARCHES_BROUILLONS
+ ],
+ ['DS_NB_DEMARCHES_ACTIVES', administrateur.DS_NB_DEMARCHES_ACTIVES],
+ ['DS_NB_DEMARCHES_ARCHIVES', administrateur.DS_NB_DEMARCHES_ARCHIVES],
[
'URL_MANAGER',
'https://www.demarches-simplifiees.fr/manager/administrateurs/' +
@@ -29,4 +35,9 @@ if (enabled) {
]
]
]);
+ window.$crisp.push([
+ 'set',
+ 'session:event',
+ [[['PAGE_VIEW', { URL: window.location.pathname }]]]
+ ]);
}
diff --git a/app/models/dossier.rb b/app/models/dossier.rb
index 28f4dbee4..81c426824 100644
--- a/app/models/dossier.rb
+++ b/app/models/dossier.rb
@@ -412,7 +412,8 @@ class Dossier < ApplicationRecord
def hide!(administration)
update(hidden_at: Time.zone.now)
- DeletedDossier.create_from_dossier(self)
+ deleted_dossier = DeletedDossier.create_from_dossier(self)
+ DossierMailer.notify_deletion_to_user(deleted_dossier, user.email).deliver_later
log_dossier_operation(administration, :supprimer, self)
end
diff --git a/app/models/procedure.rb b/app/models/procedure.rb
index cad0028c2..dcddab930 100644
--- a/app/models/procedure.rb
+++ b/app/models/procedure.rb
@@ -3,8 +3,6 @@ require Rails.root.join('lib', 'percentile')
class Procedure < ApplicationRecord
MAX_DUREE_CONSERVATION = 36
- self.ignored_columns = [:individual_with_siret, :expects_multiple_submissions]
-
has_many :types_de_piece_justificative, -> { ordered }, inverse_of: :procedure, dependent: :destroy
has_many :types_de_champ, -> { root.public_only.ordered }, inverse_of: :procedure, dependent: :destroy
has_many :types_de_champ_private, -> { root.private_only.ordered }, class_name: 'TypeDeChamp', inverse_of: :procedure, dependent: :destroy
diff --git a/app/views/admin/procedures/new.html.haml b/app/views/admin/procedures/new.html.haml
index ccfde2a2f..a61ff161f 100644
--- a/app/views/admin/procedures/new.html.haml
+++ b/app/views/admin/procedures/new.html.haml
@@ -5,5 +5,5 @@
#procedure_new.section.section-label
= form_for @procedure, url: { controller: 'admin/procedures', action: :create }, multipart: true do |f|
= render partial: 'informations', locals: { f: f }
- .text-right
- = f.button 'Valider', class: 'btn btn-info', id: 'save-procedure'
+ .text-center
+ = f.button 'Valider', class: 'btn btn-info btn-lg btn-block', id: 'save-procedure'
diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml
index 6d4fa787f..1bf5272eb 100644
--- a/app/views/layouts/_navbar.html.haml
+++ b/app/views/layouts/_navbar.html.haml
@@ -10,7 +10,7 @@
#navbar-body
.row
%div{ style: "vertical-align: middle;float:left;position:absolute;line-height: 60px;z-index:2;" }
- 👉 Besoin d'aide? Contactez-nous par chat, email ou prenez rendez-vous avec nous.
+ 👉Besoin d'aide? Contactez-nous par chat, email ou prenez RDV
-# BEST WTF EVER
-# this begin rescue hides potentials bugs by displaying another navbar
- begin
diff --git a/db/migrate/20190711135401_remove_expects_multiple_submissions_from_procedure.rb b/db/migrate/20190711135401_remove_expects_multiple_submissions_from_procedure.rb
new file mode 100644
index 000000000..9327f6eec
--- /dev/null
+++ b/db/migrate/20190711135401_remove_expects_multiple_submissions_from_procedure.rb
@@ -0,0 +1,5 @@
+class RemoveExpectsMultipleSubmissionsFromProcedure < ActiveRecord::Migration[5.2]
+ def change
+ remove_column :procedures, :expects_multiple_submissions, :boolean, default: false, null: false
+ end
+end
diff --git a/db/migrate/20190711135457_remove_individual_with_siret_from_procedure.rb b/db/migrate/20190711135457_remove_individual_with_siret_from_procedure.rb
new file mode 100644
index 000000000..cf6ab32e7
--- /dev/null
+++ b/db/migrate/20190711135457_remove_individual_with_siret_from_procedure.rb
@@ -0,0 +1,5 @@
+class RemoveIndividualWithSiretFromProcedure < ActiveRecord::Migration[5.2]
+ def change
+ remove_column :procedures, :individual_with_siret, :boolean, default: false
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e2a264bc4..70076f057 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2019_07_04_144304) do
+ActiveRecord::Schema.define(version: 2019_07_11_135457) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -481,7 +481,6 @@ ActiveRecord::Schema.define(version: 2019_07_04_144304) do
t.string "lien_site_web"
t.string "lien_notice"
t.boolean "for_individual", default: false
- t.boolean "individual_with_siret", default: false
t.date "auto_archive_on"
t.datetime "published_at"
t.datetime "hidden_at"
@@ -500,7 +499,6 @@ ActiveRecord::Schema.define(version: 2019_07_04_144304) do
t.boolean "juridique_required", default: true
t.boolean "durees_conservation_required", default: true
t.string "path"
- t.boolean "expects_multiple_submissions", default: false, null: false
t.string "declarative_with_state"
t.index ["declarative_with_state"], name: "index_procedures_on_declarative_with_state"
t.index ["hidden_at"], name: "index_procedures_on_hidden_at"