Merge branch 'develop' into france_connect

# Conflicts:
#	db/schema.rb
This commit is contained in:
Xavier J 2015-10-08 16:54:21 +02:00
commit 285d7c6fa0
24 changed files with 415 additions and 361 deletions

View file

@ -155,13 +155,13 @@ function onDocumentReady() { if (typeof L != 'undefined' && typeof L.drawLocal !
}
});**/
});
map.spin(true);
$.ajax({
url: 'http://apicarto.coremaps.com/zoneville/api/beta/qp/mapservice',
datatype: 'json',
jsonCallback: 'getJson',
success: loadGeoJson
});
//map.spin(true);
//$.ajax({
// url: 'http://apicarto.coremaps.com/zoneville/api/beta/qp/mapservice',
// datatype: 'json',
// jsonCallback: 'getJson',
// success: loadGeoJson
//});
window.geom_inter = {index: []};
function style(feature) {

View file

@ -4,7 +4,7 @@ function get_position(){
var position;
$.ajax({
url: '/dossiers/'+dossier_id+'/carte/position',
url: '/users/dossiers/'+dossier_id+'/carte/position',
dataType: 'json',
async: false
}).done(function (data) {

View file

@ -1,15 +1,16 @@
class CarteController < ApplicationController
class Users::CarteController < ApplicationController
include DossierConcern
def show
@dossier = current_dossier
rescue ActiveRecord::RecordNotFound
redirect_to url_for(controller: :siret, action: :error_dossier)
redirect_to url_for(controller: :dossiers, action: :index)
end
def save_ref_api_carto
dossier = current_dossier
if dossier.ref_dossier_carto.blank?
if dossier.draft?
dossier.update_attributes(ref_dossier_carto: params[:ref_dossier])
redirect_to url_for(controller: :description, action: :show, dossier_id: params[:dossier_id])
else

View file

@ -38,16 +38,18 @@ class Users::DescriptionController < ApplicationController
end
end
if params[:back_url] == 'recapitulatif'
commentaire = Commentaire.create
commentaire.email = 'Modification détails'
commentaire.body = 'Les informations détaillées de la demande ont été modifiées. Merci de le prendre en compte.'
commentaire.dossier = @dossier
commentaire.save
end
if !@dossier.draft?
commentaire = Commentaire.create
commentaire.email = 'Modification détails'
commentaire.body = 'Les informations détaillées de la demande ont été modifiées. Merci de le prendre en compte.'
commentaire.dossier = @dossier
commentaire.save
else
@dossier.proposed!
end
flash.notice = 'Félicitation, votre demande a bien été enregistrée.'
redirect_to url_for(controller: :recapitulatif, action: :show, dossier_id: @dossier.id)
flash.notice = 'Félicitation, votre demande a bien été enregistrée.'
redirect_to url_for(controller: :recapitulatif, action: :show, dossier_id: @dossier.id)
end

View file

@ -46,7 +46,12 @@ class Users::DossiersController < UsersController
@dossier = Dossier.find(params[:id])
if checked_autorisation_donnees?
@dossier.update_attributes(update_params)
redirect_to url_for(controller: :description, action: :show, dossier_id: @dossier.id)
if @dossier.procedure.use_api_carto
redirect_to url_for(controller: :carte, action: :show, dossier_id: @dossier.id)
else
redirect_to url_for(controller: :description, action: :show, dossier_id: @dossier.id)
end
else
@etablissement = @dossier.etablissement
@entreprise = @dossier.entreprise.decorate

View file

@ -7,14 +7,13 @@
.content
#map_qp{style: 'height:600px; width: 100%;'}
= form_tag(url_for({controller: :carte, action: :save_ref_api_carto}), class: 'form-inline', method: 'POST') do
= form_tag(url_for({controller: :carte, action: :save_ref_api_carto, dossier_id: @dossier.id}), class: 'form-inline', method: 'POST') do
%br
%input{type: 'hidden', value: '', name: 'ref_dossier', id: 'ref_dossier'}
%input{type: 'hidden', value: request.parameters[:back_url], name: 'back_url', id: 'back_url'}
-if request.parameters[:back_url] == 'recapitulatif'
=render partial: '/layouts/modifications_terminees'
-else
-if @dossier.draft?
=render partial: '/layouts/etape_suivante'
-else
=render partial: '/layouts/modifications_terminees'
=render partial: 'carte_sources_JS'

View file

@ -3,8 +3,6 @@
%br
= form_tag(url_for({controller: :description, action: :create, dossier_id: @dossier.id}), class: 'form-inline', method: 'POST', multipart: true) do
%input{type: 'hidden', value: request.parameters[:back_url], name: 'back_url', id: 'back_url'}
%div
.row
@ -80,10 +78,10 @@
%div{style: 'text-align:right'}
%h6 Tous les champs portant un * sont obligatoires.
-if request.parameters[:back_url] == 'recapitulatif'
-if !@dossier.draft?
=render partial: '/layouts/modifications_terminees'
-else
= submit_tag 'Terminer la procédure', id: 'suivant', class: %w(btn btn btn-success), style: 'float:right', data: { disable_with: 'Terminé la procédure', submit: true}
= submit_tag 'Soumettre mon dossier', id: 'suivant', class: %w(btn btn btn-success), style: 'float:right', data: { disable_with: 'Soumettre votre dossier', submit: true}
%br
%br