git-svn-id: https://msi/svn/firstRepo/WebClient/branches/NewRelease@43 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -5,6 +5,7 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
|
||||
//initialize template
|
||||
template:_.template(settingsViewTemplate),
|
||||
_flagSave: false,
|
||||
|
||||
initialize: function () {
|
||||
var self = this;
|
||||
@@ -18,6 +19,12 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
},
|
||||
|
||||
saveBtn:function(e){
|
||||
var self = this;
|
||||
|
||||
if(self._flagSave)
|
||||
return;
|
||||
|
||||
self._flagSave = true;
|
||||
e.preventDefault();
|
||||
Profile.data.risRic = this.$el.find('#nResult').val();
|
||||
Profile.data.tema = this.$el.find('#theme').val();
|
||||
@@ -33,6 +40,26 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
Profile.data.dataSpacc.tipopm = this.$el.find('#tPM').val();
|
||||
Profile.data.dataSpacc.privacy = this.$el.find('#privacyChk').prop('checked')?"1":"0";
|
||||
|
||||
if(Profile.data.email === "" ||
|
||||
Profile.data.dataSpacc.provincia === "" ||
|
||||
Profile.data.dataSpacc.comune === "" ||
|
||||
Profile.data.dataSpacc.cap === "" ||
|
||||
Profile.data.dataSpacc.tipopm === "")
|
||||
{
|
||||
this.$el.find('#messaggio').html("<center><h1>ATTENZIONE</h1> devono essere settate tutte i campi</center>");
|
||||
this.$el.find('#popupDialog').popup("open");
|
||||
self._flagSave = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if(Profile.data.dataSpacc.privacy==="0")
|
||||
{
|
||||
this.$el.find('#messaggio').html("<center><h1>ATTENZIONE</h1> per proseguire si DEVE accettare l'informativa privacy</center>");
|
||||
this.$el.find('#popupDialog').popup("open");
|
||||
self._flagSave = false;
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "http://maps.google.com/maps/api/geocode/json?address=" +
|
||||
Profile.data.dataSpacc.comune + "+" +
|
||||
@@ -40,14 +67,23 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
Profile.data.dataSpacc.provincia + "+italia&sensor=false",
|
||||
Type: "GET"
|
||||
}).then(function ( response ) {
|
||||
|
||||
if(response.results.length == 1)
|
||||
{
|
||||
Profile.data.dataSpacc.lat = response.results[0].geometry.location.lat;
|
||||
Profile.data.dataSpacc.long = response.results[0].geometry.location.lng;
|
||||
Profile.updateProfile(function(){
|
||||
self._flagSave = false;
|
||||
Backbone.history.loadUrl(Backbone.history.getFragment());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Profile.updateProfile(function(){
|
||||
Backbone.history.loadUrl();
|
||||
self._flagSave = false;
|
||||
Backbone.history.loadUrl(Backbone.history.getFragment());
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
<select name="tPM" id="tPM">
|
||||
<option value="1" selected="true">Solida</option>
|
||||
<option value="2">Liquida/Licoli</option>
|
||||
<option value="3">Entrambe</option>
|
||||
</select>
|
||||
<label>Infomativa privacy, AUTORIZZAZIONE DATI PERSONALI
|
||||
ai sensi e per gli effetti degli artt. 13 e 23 del D.Lgs. n. 196/2003, acconsento al trattamento e alla pubblicazione dei dati personali forniti a seguito della
|
||||
@@ -165,4 +166,16 @@ segnalazione inoltrata.</label>
|
||||
Impostazione di sincronizzazione
|
||||
<a id="syncBtn" href="#syncView" button="true" class="ui-link ui-btn ui-icon-custom ui-btn-icon-left">Sincronizzazione</a>
|
||||
</div>
|
||||
</div>
|
||||
<div data-role="popup" id="popupDialog">
|
||||
<div data-role="header">
|
||||
<h1>Avvertimento</h1>
|
||||
</div>
|
||||
<div role="main" class="ui-content">
|
||||
<p id="messaggio" style="text-align: center;font-style: italic;">
|
||||
</p>
|
||||
<p style="text-align: center;">
|
||||
<a href="" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-icon-check" data-rel="back">Ok</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user