Mattia Gosetto 4 anni fa
parent
commit
65f4651e9f
  1. 134
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/submit_form_window.jsp
  2. 9
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/pagamenti/view.jsp
  3. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/pagamenti/view_panel_form_bollettino.jsp

134
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/submit_form_window.jsp

@ -0,0 +1,134 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/init.jsp"%>
<%
String formName = ParamUtil.getString(request, "formName", "fm");
String titolo = ParamUtil.getString(request, "titolo", "Invio");
String buttonId = ParamUtil.getString(request, "buttonId", "sumbit-button");
String buttonConferma = ParamUtil.getString(request, "buttonConferma", "Modifica");
String buttonAnnulla = ParamUtil.getString(request, "buttonAnnulla", "Annulla");
String width = ParamUtil.getString(request, "width", "700");
String height = ParamUtil.getString(request, "height");
String contentDiv = ParamUtil.getString(request, "contentDiv", "saveAndCloseDiv");
boolean buttonBar = ParamUtil.getBoolean(request, "buttonBar", true);
String randomId = StringUtil.randomId();
String onClick = ParamUtil.getString(request, "onClick");
boolean externalForm = ParamUtil.getBoolean(request, "externalForm", false);
boolean okVisible = ParamUtil.getBoolean(request, "okVisible", true);
%>
<aui:input name='<%= "confirmClose_" + randomId %>' type="hidden" value="false" />
<div id='<%=renderResponse.getNamespace() + "saveAndCloseModal_" + randomId %>' class="confirmModal"></div>
<div class='customAlert'>
<p class='message'></p>
<input type='button' class='confirmButton' value='CHIUDI'>
</div>
<liferay-portlet:resourceURL var="resourceURL" id="controllaExtraInfo" copyCurrentRenderParameters="false" />
<aui:script >
AUI().ready('aui-modal', 'aui-io-request', 'aui-form-validator', function(A) {
var modal = new A.Modal({
bodyContent: A.one('#<portlet:namespace /><%=contentDiv%>'),
width: <%= width %>,
<%
if (!height.equals(StringPool.BLANK)) {
%>
height: <%= height %>,
<%
}
%>
centered: true,
destroyOnHide: false,
headerContent: '<h3 class="text-center"><%= titolo %></h3>',
modal: true,
render: '#<portlet:namespace />saveAndCloseModal_<%= randomId %>',
visible: false,
close: false,
}).render();
<%
if (buttonBar) {
%>
modal.addToolbar(
[
{
label: '<%= buttonAnnulla %>',
on: {
click: function() {
modal.hide();
}
}
},
<%
if (okVisible) {
%>
{
label: '<%= buttonConferma %>',
cssClass: 'btn-primary',
on: {
click: function() {
<%
if (Validator.isNotNull(onClick)) {
out.print(onClick);
} else {
%>
submitForm(document.<portlet:namespace /><%= formName %>);
var formValidator = Liferay.Form.get('<portlet:namespace /><%= formName %>')
.formValidator;
<%
if (externalForm) {
%>
if (!formValidator.hasErrors()) {
A.one('#<portlet:namespace />confirmClose_<%= randomId %>')
.set('value', 'true');
} else {
alert("Attenzione!\nCampi richiesti non compilati correttamente");
}
modal.hide();
<%
} else {
%>
if (!formValidator.hasErrors()) {
modal.hide();
A.one('#<portlet:namespace />confirmClose_<%= randomId %>')
.set('value', 'true');
}
<%
}
%>
<%
}
%>
}
}
}
<%
}
%>
]
);
<%
}
%>
A.one('#<portlet:namespace /><%= buttonId %>').on('click', function() {
A.one('#<portlet:namespace /><%=contentDiv%>').show();
modal.show();
});
window.alert = function(msg) {
$('.message').text(msg);
$('.customAlert').css('animation', 'fadeIn 0.3s linear');
$('.customAlert').css('display', 'inline');
setTimeout(function() {
$('.customAlert').css('animation', 'none');
}, 100);
};
$(function(){
$('.confirmButton').click(function(){
$('.customAlert').css('animation', 'fadeOut 0.3s linear');
setTimeout(function(){
$('.customAlert').css('animation', 'none');
$('.customAlert').css('display', 'none');
}, 100);
});
});
});
</aui:script>

9
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/pagamenti/view.jsp

@ -88,6 +88,7 @@
<% <%
String buttonFormId = "pagamentoFormButton_"+index; String buttonFormId = "pagamentoFormButton_"+index;
String contentFormId = "pagamentoFormContent_"+index; String contentFormId = "pagamentoFormContent_"+index;
String formNameBollettino = "fmPagamenti_"+index;
%> %>
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" > <liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" >
<liferay-ui:icon <liferay-ui:icon
@ -102,13 +103,16 @@
<liferay-util:include page="/html/pagamenti/view_panel_form_bollettino.jsp" servletContext='<%= application %>'> <liferay-util:include page="/html/pagamenti/view_panel_form_bollettino.jsp" servletContext='<%= application %>'>
<liferay-util:param name="idPagamento" value="<%= String.valueOf(pagamento.getPagamentoId()) %>"></liferay-util:param> <liferay-util:param name="idPagamento" value="<%= String.valueOf(pagamento.getPagamentoId()) %>"></liferay-util:param>
<liferay-util:param name="dettPraticaId" value="<%= String.valueOf(pagamento.getClassPk()) %>"></liferay-util:param> <liferay-util:param name="dettPraticaId" value="<%= String.valueOf(pagamento.getClassPk()) %>"></liferay-util:param>
<liferay-util:param name="formName" value="<%= formNameBollettino %>"></liferay-util:param>
</liferay-util:include> </liferay-util:include>
</div> </div>
<liferay-util:include page="/html/common/confirm_window.jsp" servletContext="<%= application %>" > <liferay-util:include page="/html/common/submit_form_window.jsp" servletContext="<%= application %>" >
<liferay-util:param name="titolo" value="Dettaglio Pagamento"></liferay-util:param> <liferay-util:param name="titolo" value="Modifica Pagamento"></liferay-util:param>
<liferay-util:param name="buttonId" value="<%=buttonFormId%>"></liferay-util:param> <liferay-util:param name="buttonId" value="<%=buttonFormId%>"></liferay-util:param>
<liferay-util:param name="contentDiv" value="<%=contentFormId%>"></liferay-util:param> <liferay-util:param name="contentDiv" value="<%=contentFormId%>"></liferay-util:param>
<liferay-util:param name="width" value="750"></liferay-util:param> <liferay-util:param name="width" value="750"></liferay-util:param>
<liferay-util:param name="formName" value="<%= formNameBollettino %>"></liferay-util:param>
<liferay-util:param name="buttonBar" value="true"></liferay-util:param>
</liferay-util:include> </liferay-util:include>
</c:if> </c:if>
@ -155,6 +159,7 @@
<liferay-util:param name="width" value="750"></liferay-util:param> <liferay-util:param name="width" value="750"></liferay-util:param>
</liferay-util:include> </liferay-util:include>
</c:if> </c:if>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>

6
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/pagamenti/view_panel_form_bollettino.jsp

@ -13,6 +13,7 @@
<% <%
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId",0l); long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId",0l);
long idPagamento = ParamUtil.getLong(request, "idPagamento", 0l); long idPagamento = ParamUtil.getLong(request, "idPagamento", 0l);
String formName = ParamUtil.getString(request, "formName", "fm");
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId);
Pagamento objPagamento = PagamentoLocalServiceUtil.fetchPagamento(idPagamento); Pagamento objPagamento = PagamentoLocalServiceUtil.fetchPagamento(idPagamento);
@ -21,7 +22,7 @@
String portletNamespace = renderResponse.getNamespace(); String portletNamespace = renderResponse.getNamespace();
String redirect = currentURL+"#"+portletNamespace+"tab="+portletNamespace+"page_pagamenti"; String redirect = currentURL+"#"+portletNamespace+"tab="+portletNamespace+"page_pagamenti";
%> %>
<c:if test="<%= Validator.isNotNull(objPagamento) %>"> <c:if test="<%= Validator.isNotNull(objPagamento) %>">
@ -33,10 +34,9 @@
<liferay-portlet:param name="mvcPath" value="/html/pagamenti/view_panel_form_bollettino.jsp"/> <liferay-portlet:param name="mvcPath" value="/html/pagamenti/view_panel_form_bollettino.jsp"/>
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<aui:form name="fm4-pagamenti" method="post" action="<%= setBollettinoImpostaURL %>"> <aui:form name="<%= formName %>" method="post" action="<%= setBollettinoImpostaURL %>">
<aui:input name="numeroBollettino" type="text" <aui:input name="numeroBollettino" type="text"
label="label-codice-bollettino" value="<%= objPagamento.getNumeroBollettino() %>"/> label="label-codice-bollettino" value="<%= objPagamento.getNumeroBollettino() %>"/>
<aui:button type="submit" value="Salva" cssClass="btn btn-primary"/>
</aui:form> </aui:form>
</div> </div>
</c:if> </c:if>
Caricamento…
Annulla
Salva