|
|
|
@ -50,8 +50,8 @@
|
|
|
|
|
</div> |
|
|
|
|
<liferay-portlet:resourceURL id="province" var="getProvinceURL" /> |
|
|
|
|
<liferay-portlet:resourceURL id="comuni" var="getComuniURL" /> |
|
|
|
|
<liferay-portlet:resourceURL id="comuniOspedaliera" var="getComuniOspedalieraURL" /> |
|
|
|
|
<liferay-portlet:resourceURL id="zoneFasce" var="getZoneFasceURL" /> |
|
|
|
|
<liferay-portlet:resourceURL id="ospedalieraEnabled" var="isOspedalieraEnabledURL" /> |
|
|
|
|
<aui:script use="aui-io-request,liferay-dynamic-select,aui-form-validator"> |
|
|
|
|
var defaultFormValidator = A.config.FormValidator; |
|
|
|
|
var procedure = {}; |
|
|
|
@ -113,12 +113,8 @@
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
var getComuni = function(callback, provinciaId) { |
|
|
|
|
var requestURL = '<%= getComuniURL %>'; |
|
|
|
|
if(isPraticaOspedaliera){ |
|
|
|
|
requestURL = '<%= getComuniOspedalieraURL %>'; |
|
|
|
|
} |
|
|
|
|
A.io.request( |
|
|
|
|
requestURL, |
|
|
|
|
'<%= getComuniURL %>', |
|
|
|
|
{ |
|
|
|
|
data: { |
|
|
|
|
<portlet:namespace />provinciaId: provinciaId |
|
|
|
@ -157,6 +153,39 @@
|
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
var evalAddOspedaliRadio = function() { |
|
|
|
|
var comuneId = $('.add-new-project__comune select').val(); |
|
|
|
|
|
|
|
|
|
A.io.request( |
|
|
|
|
'<%= isOspedalieraEnabledURL %>', |
|
|
|
|
{ |
|
|
|
|
data: { |
|
|
|
|
<portlet:namespace />comuneId: comuneId |
|
|
|
|
}, |
|
|
|
|
dataType: 'json', |
|
|
|
|
on: { |
|
|
|
|
success: function() { |
|
|
|
|
var rd = this.get('responseData'); |
|
|
|
|
var ospedalieraRadio = $('.add-new-project__procedura input[value="<%= Constants.PROCEDURA_H %>"]'); |
|
|
|
|
var ospedalieraId = ospedalieraRadio.attr("id"); |
|
|
|
|
var ospedalieraLabel = ospedalieraRadio.closest('label[for="' + ospedalieraId + '"]'); |
|
|
|
|
if(!rd.ospedalieraEnabled){ |
|
|
|
|
ospedalieraRadio.prop('disabled', 'disabled').prop('checked', false); |
|
|
|
|
if(!ospedalieraLabel.hasClass('hidden')){ |
|
|
|
|
ospedalieraLabel.addClass('hidden'); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
ospedalieraRadio.prop('disabled', false).removeClass('disabled'); |
|
|
|
|
if(ospedalieraLabel.hasClass('hidden')){ |
|
|
|
|
ospedalieraLabel.removeClass('hidden'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
new Liferay.DynamicSelect([ |
|
|
|
|
{ |
|
|
|
|
select: '<portlet:namespace />provincia', |
|
|
|
@ -213,6 +242,7 @@
|
|
|
|
|
$('.add-new-project__procedura div').removeClass('success'); |
|
|
|
|
}else if(val !== 0) { |
|
|
|
|
$('.add-new-project__procedura input').prop('disabled', false).removeClass('disabled').parent().css('display', 'block'); |
|
|
|
|
evalAddOspedaliRadio(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
</aui:script> |