fork download
  1. <!DOCTYPE html>
  2. <html xmlns="http://w...content-available-to-author-only...3.org/1999/xhtml"
  3. xmlns:h="http://x...content-available-to-author-only...p.org/jsf/html"
  4. xmlns:p="http://p...content-available-to-author-only...s.org/ui"
  5. xmlns:f="http://x...content-available-to-author-only...p.org/jsf/core"
  6. xmlns:ui="http://x...content-available-to-author-only...p.org/jsf/facelets">
  7.  
  8. <h:head>
  9. <title>Gerenciamento de Requisições</title>
  10. <h:outputStylesheet name="styles.css"/>
  11. </h:head>
  12.  
  13. <h:body>
  14. <ui:composition template="/WEB-INF/templates/main.xhtml">
  15. <ui:define name="content">
  16. <h1>Gerenciamento de Requisições</h1>
  17. <h:form id="RMForm">
  18.  
  19. <p:dataTable var="row" value="#{RequestsManagement.requests}" id="rmTable"
  20. scrollable="true" scrollHeight="400" widgetVar="rmDataTable">
  21.  
  22. <p:column headerText="#{i18n['general.actions']}" exportable="false"
  23. style="text-align: center; width: #{RequestsManagement.getColWidth('ACTIONS')}px;"
  24. visible="#{RequestsManagement.getColVis('ACTIONS')}">
  25.  
  26. <!-- Cancelar Requisição -->
  27. <p:commandLink id="rmCancel" actionListener="#{RequestsManagement.requestCancel}"
  28. styleClass="icon-size blockUiButton"
  29. disabled="#{RequestsManagement.disableCancel(row.status, row.centralUid, row.startdate, row.id, row.idUnge, row.requestType)}">
  30. <p:tooltip for="rmCancel" value="#{i18n['rm.datatable.cancel']}" position="left"/>
  31. <em class="far fa-window-close" style="color: Red;" />
  32. <f:param name="rmId" value="#{row.id}" />
  33. </p:commandLink>
  34.  
  35. <!-- Editar Requisição -->
  36. <p:commandLink id="rmEdit" actionListener="#{RequestsManagement.requestEditRM}"
  37. styleClass="icon-size blockUiButton"
  38. disabled="#{RequestsManagement.disableEdition(row.status, row.centralUid, row.id, row.requestType, row.enddate)}">
  39. <p:tooltip for="rmEdit" value="#{i18n['rm.datatable.edit']}" position="left"/>
  40. <em class="fa fa-edit" style="color: DodgerBlue;" />
  41. <f:param name="rmId" value="#{row.id}" />
  42. <f:param name="rmRequestType" value="#{row.requestType}" />
  43. <f:param name="pageFrom" value="#{view.viewId}" />
  44. </p:commandLink>
  45.  
  46. <!-- Visualizar Detalhes -->
  47. <p:commandLink id="rmDetail" actionListener="#{RequestsManagement.requestViewRM}"
  48. styleClass="icon-size blockUiButton"
  49. disabled="#{RequestsManagement.disableVisualization(row.centralUid)}">
  50. <p:tooltip for="rmDetail" value="#{i18n['rm.datatable.show']}" position="left"/>
  51. <em class="fa fa-search" style="color: DodgerBlue;" />
  52. <f:param name="rmId" value="#{row.id}" />
  53. <f:param name="rmRequestType" value="#{row.requestType}" />
  54. <f:param name="pageFrom" value="#{view.viewId}" />
  55. </p:commandLink>
  56. </p:column>
  57.  
  58. <f:facet name="footer">
  59. <div style="text-align: right;">
  60. <p:spacer width="10" />
  61. </div>
  62. </f:facet>
  63. </p:dataTable>
  64.  
  65. <script>
  66. $(DATATABLE_SCROLLABLE_BODY).on('scroll', buildPositionLabel);
  67. </script>
  68.  
  69. <p:commandButton style="display:none;" id="triggerUpdateLabel" update="RMForm:rmTable:disclaimerLabel" />
  70. <p:commandButton style="display:none;" id="updAllPage" update="RMForm loadedByScroll accordion:searchRMList" onclick="saveScrollPos();" oncomplete="refreshDone();" />
  71. <p:commandButton style="display:none;" id="updTable" update="RMForm" onclick="saveScrollPos();" oncomplete="refreshDone();" />
  72.  
  73. <!-- Diálogo de Confirmação -->
  74. <p:confirmDialog global="true" showEffect="fade" hideEffect="fade" responsive="true" width="350">
  75. <div class="grid-buttons">
  76. <p:commandButton value="#{i18n['rm.confirmdialog.no']}" type="button" styleClass="ui-confirmdialog-no"/>
  77. <p:commandButton value="#{i18n['rm.confirmdialog.yes']}" type="button" styleClass="ui-confirmdialog-yes" />
  78. </div>
  79. </p:confirmDialog>
  80.  
  81. <!-- Atualiza a página automaticamente a cada 30 segundos -->
  82. <p:poll interval="30" listener="#{RequestsManagement.pollRefresh}" />
  83. </h:form>
  84.  
  85. <h:inputHidden id="loadedByScroll" value="#{RequestsManagement.loadingByScroll}" />
  86.  
  87. <!-- Formulário de Confirmação de Cancelamento -->
  88. <h:form id="confirmCancelForm">
  89. <p:dialog header="#{i18n['rm.confirmdialog.header.confirmation']}" resizable="false" widgetVar="confirmCancelDlg" width="350">
  90. <p:outputLabel value="#{i18n['rm.confirmdialog.cancelation.restriction']}" />
  91. <br /><br />
  92. <div class="grid-buttons">
  93. <p:commandButton value="#{i18n['rm.confirmdialog.no']}" type="button" styleClass="blockUiButton"
  94. onclick="PF('confirmCancelDlg').hide();" />
  95. <p:commandButton value="#{i18n['rm.confirmdialog.yes']}" type="submit" styleClass="blockUiButton"
  96. action="#{RequestsManagement.confirmCancel()}" id="submitCancel"
  97. oncomplete="PF('confirmCancelDlg').hide();"/>
  98. </div>
  99. </p:dialog>
  100. </h:form>
  101. </ui:define>
  102. </ui:composition>
  103. </h:body>
  104. </html>
  105.  
Success #stdin #stdout 0.02s 26092KB
stdin
Standard input is empty
stdout
<!DOCTYPE html>
<html xmlns="http://w...content-available-to-author-only...3.org/1999/xhtml"
      xmlns:h="http://x...content-available-to-author-only...p.org/jsf/html"
      xmlns:p="http://p...content-available-to-author-only...s.org/ui"
      xmlns:f="http://x...content-available-to-author-only...p.org/jsf/core"
      xmlns:ui="http://x...content-available-to-author-only...p.org/jsf/facelets">

<h:head>
    <title>Gerenciamento de Requisições</title>
    <h:outputStylesheet name="styles.css"/>
</h:head>

<h:body>
    <ui:composition template="/WEB-INF/templates/main.xhtml">
        <ui:define name="content">
            <h1>Gerenciamento de Requisições</h1>
            <h:form id="RMForm">

                <p:dataTable var="row" value="#{RequestsManagement.requests}" id="rmTable" 
                             scrollable="true" scrollHeight="400" widgetVar="rmDataTable">
                    
                    <p:column headerText="#{i18n['general.actions']}" exportable="false"
                              style="text-align: center; width: #{RequestsManagement.getColWidth('ACTIONS')}px;"
                              visible="#{RequestsManagement.getColVis('ACTIONS')}">
                        
                        <!-- Cancelar Requisição -->
                        <p:commandLink id="rmCancel" actionListener="#{RequestsManagement.requestCancel}"
                                       styleClass="icon-size blockUiButton"
                                       disabled="#{RequestsManagement.disableCancel(row.status, row.centralUid, row.startdate, row.id, row.idUnge, row.requestType)}">
                            <p:tooltip for="rmCancel" value="#{i18n['rm.datatable.cancel']}" position="left"/>
                            <em class="far fa-window-close" style="color: Red;" />
                            <f:param name="rmId" value="#{row.id}" />
                        </p:commandLink>

                        <!-- Editar Requisição -->
                        <p:commandLink id="rmEdit" actionListener="#{RequestsManagement.requestEditRM}"
                                       styleClass="icon-size blockUiButton"
                                       disabled="#{RequestsManagement.disableEdition(row.status, row.centralUid, row.id, row.requestType, row.enddate)}">
                            <p:tooltip for="rmEdit" value="#{i18n['rm.datatable.edit']}" position="left"/>
                            <em class="fa fa-edit" style="color: DodgerBlue;" />
                            <f:param name="rmId" value="#{row.id}" />
                            <f:param name="rmRequestType" value="#{row.requestType}" />
                            <f:param name="pageFrom" value="#{view.viewId}" />
                        </p:commandLink>

                        <!-- Visualizar Detalhes -->
                        <p:commandLink id="rmDetail" actionListener="#{RequestsManagement.requestViewRM}"
                                       styleClass="icon-size blockUiButton"
                                       disabled="#{RequestsManagement.disableVisualization(row.centralUid)}">
                            <p:tooltip for="rmDetail" value="#{i18n['rm.datatable.show']}" position="left"/>
                            <em class="fa fa-search" style="color: DodgerBlue;" />
                            <f:param name="rmId" value="#{row.id}" />
                            <f:param name="rmRequestType" value="#{row.requestType}" />
                            <f:param name="pageFrom" value="#{view.viewId}" />
                        </p:commandLink>
                    </p:column>

                    <f:facet name="footer">
                        <div style="text-align: right;">
                            <p:spacer width="10" />
                        </div>
                    </f:facet>
                </p:dataTable>

                <script>
                    $(DATATABLE_SCROLLABLE_BODY).on('scroll', buildPositionLabel);
                </script>

                <p:commandButton style="display:none;" id="triggerUpdateLabel" update="RMForm:rmTable:disclaimerLabel" />
                <p:commandButton style="display:none;" id="updAllPage" update="RMForm loadedByScroll accordion:searchRMList" onclick="saveScrollPos();" oncomplete="refreshDone();" />
                <p:commandButton style="display:none;" id="updTable" update="RMForm" onclick="saveScrollPos();" oncomplete="refreshDone();" />

                <!-- Diálogo de Confirmação -->
                <p:confirmDialog global="true" showEffect="fade" hideEffect="fade" responsive="true" width="350">
                    <div class="grid-buttons">
                        <p:commandButton value="#{i18n['rm.confirmdialog.no']}" type="button" styleClass="ui-confirmdialog-no"/>
                        <p:commandButton value="#{i18n['rm.confirmdialog.yes']}" type="button" styleClass="ui-confirmdialog-yes" />
                    </div>
                </p:confirmDialog>

                <!-- Atualiza a página automaticamente a cada 30 segundos -->
                <p:poll interval="30" listener="#{RequestsManagement.pollRefresh}" />
            </h:form>

            <h:inputHidden id="loadedByScroll" value="#{RequestsManagement.loadingByScroll}" />
            
            <!-- Formulário de Confirmação de Cancelamento -->
            <h:form id="confirmCancelForm">
                <p:dialog header="#{i18n['rm.confirmdialog.header.confirmation']}" resizable="false" widgetVar="confirmCancelDlg" width="350">
                    <p:outputLabel value="#{i18n['rm.confirmdialog.cancelation.restriction']}" />
                    <br /><br />
                    <div class="grid-buttons">
                        <p:commandButton value="#{i18n['rm.confirmdialog.no']}" type="button" styleClass="blockUiButton" 
                                         onclick="PF('confirmCancelDlg').hide();" />
                        <p:commandButton value="#{i18n['rm.confirmdialog.yes']}" type="submit" styleClass="blockUiButton"
                                         action="#{RequestsManagement.confirmCancel()}" id="submitCancel" 
                                         oncomplete="PF('confirmCancelDlg').hide();"/>
                    </div>
                </p:dialog>
            </h:form>
        </ui:define>
    </ui:composition>
</h:body>
</html>