diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-p7m-preview-hook/docroot/WEB-INF/src/it/mwg/sicilia/preview/SiciliaP7MProcessor.java b/liferay-plugins-sdk-6.2/hooks/sicilia-p7m-preview-hook/docroot/WEB-INF/src/it/mwg/sicilia/preview/SiciliaP7MProcessor.java index a7318aca..207b1989 100644 --- a/liferay-plugins-sdk-6.2/hooks/sicilia-p7m-preview-hook/docroot/WEB-INF/src/it/mwg/sicilia/preview/SiciliaP7MProcessor.java +++ b/liferay-plugins-sdk-6.2/hooks/sicilia-p7m-preview-hook/docroot/WEB-INF/src/it/mwg/sicilia/preview/SiciliaP7MProcessor.java @@ -22,7 +22,6 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.lang.time.StopWatch; import org.apache.pdfbox.pdmodel.PDDocument; -import com.liferay.portal.kernel.configuration.Filter; import com.liferay.portal.kernel.image.GhostscriptUtil; import com.liferay.portal.kernel.lar.PortletDataContext; import com.liferay.portal.kernel.log.Log; @@ -48,7 +47,6 @@ import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.xml.Element; import com.liferay.portal.log.Log4jLogFactoryImpl; import com.liferay.portal.repository.liferayrepository.model.LiferayFileVersion; -import com.liferay.portal.util.PrefsPropsUtil; import com.liferay.portal.util.PropsUtil; import com.liferay.portal.util.PropsValues; import com.liferay.portlet.documentlibrary.NoSuchFileEntryException; @@ -80,18 +78,6 @@ public class SiciliaP7MProcessor extends DLPreviewableProcessor implements PDFPr @Override public void generateImages(FileVersion sourceFileVersion, FileVersion destinationFileVersion) throws Exception { -// if (Validator.isNotNull(PropsUtil.get("mwg.test.display"))) { -// FileEntry entry = destinationFileVersion.getFileEntry(); -// try { -// DLFileEntryLocalServiceUtil.getFile(entry.getUserId(), entry.getFileEntryId(), entry.getVersion(), -// false); -// } catch (NoSuchFileException e) { -// String[] parts = StringUtil.split(e.getMessage(), File.separatorChar); -// String file = parts[parts.length - 3] + File.separatorChar + parts[parts.length - 2]; -// ProcessUtil.execute(ProcessUtil.LOGGING_OUTPUT_PROCESSOR, "sismicasync", file); -// return; -// } -// } _generateImages(sourceFileVersion, destinationFileVersion); } @@ -295,13 +281,6 @@ public class SiciliaP7MProcessor extends DLPreviewableProcessor implements PDFPr InputStream inputStream = null; try { - String globalSearchPath = PrefsPropsUtil.getPreferences(true).getValue( - PropsKeys.IMAGEMAGICK_GLOBAL_SEARCH_PATH, null); - _log.info("G1 " + globalSearchPath); - if (Validator.isNull(globalSearchPath)) { - globalSearchPath = PropsUtil.get(PropsKeys.IMAGEMAGICK_GLOBAL_SEARCH_PATH, new Filter("unix")); - } - _log.info("G2 " + globalSearchPath); if (sourceFileVersion != null) { copy(sourceFileVersion, destinationFileVersion); return; @@ -338,8 +317,6 @@ public class SiciliaP7MProcessor extends DLPreviewableProcessor implements PDFPr } } catch (NoSuchFileEntryException nsfee) { // Ignore - } catch (Exception e) { - e.printStackTrace(); } finally { StreamUtil.cleanUp(inputStream); _fileVersionIds.remove(destinationFileVersion.getFileVersionId()); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PagamentiCommonUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PagamentiCommonUtil.java index 28a01f1c..660046c3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PagamentiCommonUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PagamentiCommonUtil.java @@ -33,7 +33,7 @@ public abstract class PagamentiCommonUtil { private static Log _log = LogFactoryUtil.getLog(PagamentiCommonUtil.class); @SuppressWarnings("serial") - private static final Map numeroBolliIntegrazioneMap = new HashMap(7) { + private static final Map NUMERO_BOLLI_INTEGRAZIONE = new HashMap(7) { { put(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE, 0); put(TipoIntegrazioneUtil.FINE_LAVORI_PARZIALE, 2); @@ -93,7 +93,9 @@ public abstract class PagamentiCommonUtil { if (normEsenteBollo) { return new BigDecimal("0.00"); } - } catch (PortalException e) {} + } catch (PortalException e) { + // Ignore + } int numeroBolli = getNumeroBolli(tipoIntegrazione); BigDecimal importoBolliBigDecimal = new BigDecimal(ConfigurazioneLocalServiceUtil.findByC_ChiaveString( companyId, ConfigurazioneConstants.IMPORTO_BOLLO)); @@ -111,7 +113,7 @@ public abstract class PagamentiCommonUtil { private static Integer getNumeroBolliByTipoIntegrazione(String tipoIntegrazione) { - return numeroBolliIntegrazioneMap.get(tipoIntegrazione); + return NUMERO_BOLLI_INTEGRAZIONE.get(tipoIntegrazione); } public static boolean existsSpeseIstruttoria(String tipoIntegrazione) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties index 9bc8522a..0beb06b9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties @@ -1003,7 +1003,9 @@ fl-parziale-not-possibile = Fine Lavori Parziale non possibile no-varianti-integrazioni = Nessuna Variante o Integrazione presentata al momento no-fine-lavori-parziali = Nessuna Fine Lavori Parziale presentata al momento fl-attestazione = Si chiede il rilascio dell’attestazione di deposito degli atti -fl-attestazione-note = Il rilascio dell’attestazione non deve essere richiesto per interventi e nuove costruzioni con struttura diversa da cemento armato e acciaio che richiedono il deposito del collaudo +fl-attestazione-note = Il rilascio dell’attestazione non deve essere richiesto per interventi e nuove costruzioni con \ + struttura diversa da cemento armato e acciaio che richiedono il deposito del collaudo.
Ove non è richiesta \ + l’attestazione di deposito del fine lavori inserire una dichiarazione ai sensi del DPR 445 del 2020. ## Collaudo ## col = Collaudo diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java index d6123c93..c3bc73c4 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java @@ -64,6 +64,7 @@ import com.liferay.portal.kernel.cache.CacheRegistryUtil; import com.liferay.portal.kernel.cache.MultiVMPoolUtil; import com.liferay.portal.kernel.cache.SingleVMPoolUtil; import com.liferay.portal.kernel.dao.jdbc.DataAccess; +import com.liferay.portal.kernel.dao.orm.QueryUtil; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.log.Log; @@ -164,6 +165,9 @@ public class ManutenzioneDatabase { ZoneSismicheUtil zone = new ZoneSismicheUtil(serviceContext); esitoLog(esito, zone.aggiornaComuni(companyId)); } + if (mode.contains("!Riduzione!")) { + esitoLog(esito, riduzione(companyId, mode.substring(11))); + } if (mode.contains("!Pulisci!")) { if (mode.contains("!DocumentLibrary!")) { esitoLog(esito, puliziaDocumentLibrary(companyId)); @@ -180,9 +184,9 @@ public class ManutenzioneDatabase { esitoLog(esito, svuotaIntPraticaDettPratica()); } if (mode.contains("!User!")) { - esitoLog(esito, svuotaUser(companyId)); + esito.addAll(svuotaUser(companyId)); } - esitoLog(esito, svuotaDatabase(companyId)); + esito.addAll(svuotaDatabase(companyId)); if (mode.contains("!Reset!")) { ConfigurazioneLocalServiceUtil.storeConfig(Constants.NUMERO_PROGETTO_KEY_DB, "1", serviceContext); } @@ -195,7 +199,30 @@ public class ManutenzioneDatabase { return esito; } + private static List riduzione(long companyId, String rimaste) throws SystemException, PortalException { + + // !Riduzione!107043,107023,106983,106793,104938,77853 + List esito = new ArrayList<>(); + try { + Connection connection = DataAccess.getUpgradeOptimizedConnection(); + Statement s = connection.createStatement(); + String condizione = "numeroprogetto IN ('" + StringUtil.merge(StringUtil.split(rimaste, ','), "','") + "')"; + String sql = "DELETE FROM portos_bo_intpratica WHERE NOT " + condizione; + int i = s.executeUpdate(sql); + esitoLog(esito, "Cancellate " + i + " IntPratica"); + sql = "DELETE FROM portos_bo_dettpratica WHERE intpraticaid NOT IN (" + + "SELECT intpraticaid FROM portos_bo_intpratica WHERE " + condizione + ')'; + i = s.executeUpdate(sql); + esitoLog(esito, "Cancellate " + i + " DettPratica"); + } catch (SQLException e) { + e.printStackTrace(); + } + esito.addAll(svuotaDatabase(companyId)); + return esito; + } + private static void clearCache() { + try { SingleVMPoolUtil.clear(); MultiVMPoolUtil.clear(); @@ -209,7 +236,7 @@ public class ManutenzioneDatabase { List esito = new ArrayList<>(); esitoLog(esito, svuotaDettPratica()); esitoLog(esito, svuotaAllegatoManuale()); - esitoLog(esito, svuotaAssetEntry(companyId)); + // esitoLog(esito, svuotaAssetEntry(companyId)); esitoLog(esito, svuotaAsseverazione()); esitoLog(esito, svuotaAvviso(companyId)); esitoLog(esito, svuotaCollaudo()); @@ -223,28 +250,29 @@ public class ManutenzioneDatabase { esitoLog(esito, svuotaFineLavori()); esitoLog(esito, svuotaGroup(companyId)); esitoLog(esito, svuotaHistoryWorkflowAction()); - esitoLog(esito, svuotaMBDiscussion(companyId)); - esitoLog(esito, svuotaMBMessage(companyId)); - esitoLog(esito, svuotaMBThread()); + // esitoLog(esito, svuotaMBDiscussion(companyId)); + // esitoLog(esito, svuotaMBMessage(companyId)); + // esitoLog(esito, svuotaMBThread()); esitoLog(esito, svuotaPagamento(companyId)); esitoLog(esito, svuotaParereGeologo()); esitoLog(esito, svuotaRatingsEntry()); esitoLog(esito, svuotaRatingsStats(companyId)); - esitoLog(esito, svuotaResourcePermission(companyId)); + // esitoLog(esito, svuotaResourcePermission(companyId)); esitoLog(esito, svuotaSoggetto()); esitoLog(esito, svuotaSorteggio()); esitoLog(esito, svuotaStoricoSoggettoPratica()); esitoLog(esito, svuotaSyncDLObject()); esitoLog(esito, svuotaSystemEvent(companyId)); esitoLog(esito, svuotaTempistica()); + esito.addAll(svuotaUser(companyId)); esitoLog(esito, svuotaWorkflowInstance()); return esito; } private static List puliziaDocumentLibrary(long companyId) { + List esito = new ArrayList<>(); Set parentFolderNames = new HashSet<>(); - try { long allegatiFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); @@ -254,7 +282,6 @@ public class ManutenzioneDatabase { List folders; do { folders = DLFolderLocalServiceUtil.getDLFolders(start, start + SLICE); - int rimossi = 0; totali += folders.size(); for (DLFolder folder : folders) { DLFolder parent = folder.getParentFolder(); @@ -279,7 +306,6 @@ public class ManutenzioneDatabase { _log.info("Cancello la cartella " + folder.getName()); DLAppLocalServiceUtil.deleteFolder(folder.getFolderId()); cancellati++; - rimossi++; } } else { _log.info("Mantengo la cartella " + folder.getName()); @@ -294,14 +320,13 @@ public class ManutenzioneDatabase { _log.info("Cancello la cartella " + folder.getName()); DLAppLocalServiceUtil.deleteFolder(folder.getFolderId()); cancellati++; - rimossi++; } } else { _log.info("Non allegato " + folder.getName() + " in " + parent.getName()); } } } - start += folders.size() - rimossi; + start += folders.size(); } while (folders.size() > 0); esitoLog(esito, "Analizzate " + totali + " cartelle, cancellate " + cancellati); } catch (PortalException | SystemException e) { @@ -314,6 +339,7 @@ public class ManutenzioneDatabase { } private static List avvisiFileEntries() throws SystemException { + List result = new ArrayList<>(); int start = 0; List avvisi = null; @@ -330,13 +356,13 @@ public class ManutenzioneDatabase { } private static String puliziaAllegati(long companyId, long folderId) throws SystemException, PortalException { + List avvisiFileEntries = avvisiFileEntries(); long repositoryId = DLAppLocalServiceUtil.getFolder(folderId).getRepositoryId(); int start = 0; int cancellati = 0; List fileEntries = null; do { - int rimossi = 0; fileEntries = DLAppServiceUtil.getFileEntries(repositoryId, folderId, start, start + SLICE); for (FileEntry fileEntry : fileEntries) { String[] parti = StringUtil.split(fileEntry.getTitle().replaceAll("\\.p7m$", StringPool.BLANK), '_'); @@ -366,7 +392,6 @@ public class ManutenzioneDatabase { if (!esiste(DETTPRATICA_CLASS_NAME, id1)) { DLAppLocalServiceUtil.deleteFileEntry(fileEntry.getFileEntryId()); cancellati++; - rimossi++; } break; case "AI_B": @@ -377,7 +402,6 @@ public class ManutenzioneDatabase { if (!avvisiFileEntries.contains(fileEntry.getFileEntryId())) { DLAppLocalServiceUtil.deleteFileEntry(fileEntry.getFileEntryId()); cancellati++; - rimossi++; } break; default: @@ -389,17 +413,17 @@ public class ManutenzioneDatabase { _log.info("Nome sconosciuto " + fileEntry.getTitle()); } } - start += SLICE - rimossi; + start += SLICE; } while (fileEntries.size() > 0); return "Cancellati " + cancellati + " File orfani"; } private static String svuotaAllegatoManuale() throws SystemException { + int start = 0; int cancellati = 0; List allegatiManuali = null; do { - int rimossi = 0; allegatiManuali = AllegatoManualeLocalServiceUtil.getAllegatoManuales(start, start + SLICE); for (AllegatoManuale allegatoManuale : allegatiManuali) { if (!esiste(INTPRATICA_CLASS_NAME, allegatoManuale.getIntPraticaId()) @@ -408,20 +432,19 @@ public class ManutenzioneDatabase { deleteFileEntry(allegatoManuale.getFileEntryId()); AllegatoManualeLocalServiceUtil.deleteAllegatoManuale(allegatoManuale); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (allegatiManuali.size() > 0); return "Cancellati " + cancellati + " AllegatoManuale"; } private static String svuotaAssetEntry(long companyId) throws SystemException { + int start = 0; int cancellati = 0; List assetEntries = null; do { - int rimossi = 0; assetEntries = AssetEntryLocalServiceUtil.getAssetEntries(start, start + SLICE); for (AssetEntry assetEntry : assetEntries) { String className = assetEntry.getClassName(); @@ -431,20 +454,19 @@ public class ManutenzioneDatabase { if (!esiste(className, assetEntry.getClassPK(), companyId)) { AssetEntryLocalServiceUtil.deleteAssetEntry(assetEntry); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (assetEntries.size() > 0); return "Cancellati " + cancellati + " AssetEntry"; } private static String svuotaAsseverazione() throws SystemException { + int start = 0; int cancellati = 0; List asseverazioni = null; do { - int rimossi = 0; asseverazioni = AsseverazioneLocalServiceUtil.getAsseveraziones(start, start + SLICE); for (Asseverazione asseverazione : asseverazioni) { if (!esiste(INTPRATICA_CLASS_NAME, asseverazione.getIntPraticaId()) @@ -452,20 +474,19 @@ public class ManutenzioneDatabase { deleteFileEntry(asseverazione.getFileEntryId()); AsseverazioneLocalServiceUtil.deleteAsseverazione(asseverazione); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (asseverazioni.size() > 0); return "Cancellati " + cancellati + " Asseverazione"; } private static String svuotaAvviso(long companyId) throws SystemException { + int start = 0; int cancellati = 0; List avvisi = null; do { - int rimossi = 0; avvisi = AvvisoLocalServiceUtil.getAvvisos(start, start + SLICE); for (Avviso avviso : avvisi) { if (!esiste(avviso.getClassName(), avviso.getClassPk(), companyId) @@ -475,117 +496,111 @@ public class ManutenzioneDatabase { deleteFileEntry(avviso.getFileEntryIdProtocollo()); AvvisoLocalServiceUtil.deleteAvviso(avviso); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (avvisi.size() > 0); return "Cancellati " + cancellati + " Avviso"; } private static String svuotaCollaudo() throws SystemException, PortalException { + int start = 0; int cancellati = 0; List collaudi = null; do { - int rimossi = 0; collaudi = CollaudoLocalServiceUtil.getCollaudos(start, start + SLICE); for (Collaudo collaudo : collaudi) { if (!esiste(INTPRATICA_CLASS_NAME, collaudo.getIntPraticaId())) { CollaudoLocalServiceUtil.deleteCollaudo(collaudo); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (collaudi.size() > 0); return "Cancellati " + cancellati + " Collaudo"; } private static String svuotaContact(long companyId) throws SystemException, PortalException { + int start = 0; int cancellati = 0; List contacts = null; do { - int rimossi = 0; contacts = ContactLocalServiceUtil.getContacts(start, start + SLICE); for (Contact contact : contacts) { if (!esiste(contact.getClassName(), contact.getClassPK(), companyId)) { ContactLocalServiceUtil.deleteContact(contact); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (contacts.size() > 0); return "Cancellati " + cancellati + " Contact"; } private static String svuotaControlloPratica() throws SystemException, PortalException { + int start = 0; int cancellati = 0; List controlliPratiche = null; do { - int rimossi = 0; controlliPratiche = ControlloPraticaLocalServiceUtil.getControlloPraticas(start, start + SLICE); for (ControlloPratica controlloPratica : controlliPratiche) { if (!esiste(INTPRATICA_CLASS_NAME, controlloPratica.getIntPraticaId()) || !esiste(DETTPRATICA_CLASS_NAME, controlloPratica.getDettPraticaId())) { ControlloPraticaLocalServiceUtil.deleteControlloPratica(controlloPratica); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (controlliPratiche.size() > 0); return "Cancellati " + cancellati + " ControlloPratica"; } private static String svuotaDelega() throws SystemException, PortalException { + int start = 0; int cancellati = 0; List deleghe = null; do { - int rimossi = 0; deleghe = DelegaLocalServiceUtil.getDelegas(start, start + SLICE); for (Delega delega : deleghe) { if (!esiste(INTPRATICA_CLASS_NAME, delega.getIntPraticaId()) || !esiste(DETTPRATICA_CLASS_NAME, delega.getDettPraticaId())) { DelegaLocalServiceUtil.deleteDelega(delega); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (deleghe.size() > 0); return "Cancellati " + cancellati + " Delega"; } private static String svuotaDettPratica() throws SystemException, PortalException { + int start = 0; int cancellati = 0; List dettPratiche = null; do { - int rimossi = 0; dettPratiche = DettPraticaLocalServiceUtil.getDettPraticas(start, start + SLICE); for (DettPratica dettPratica : dettPratiche) { if (!esiste(INTPRATICA_CLASS_NAME, dettPratica.getIntPraticaId())) { DettPraticaLocalServiceUtil.deleteDettPratica(dettPratica); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (dettPratiche.size() > 0); return "Cancellati " + cancellati + " DettPratica"; } private static String svuotaDocAggiuntiva() throws SystemException, PortalException { + int start = 0; int cancellati = 0; List docAggiuntive = null; do { - int rimossi = 0; docAggiuntive = DocAggiuntivaLocalServiceUtil.getDocAggiuntivas(start, start + SLICE); for (DocAggiuntiva docAggiuntiva : docAggiuntive) { if (!esiste(INTPRATICA_CLASS_NAME, docAggiuntiva.getIntPraticaId()) @@ -593,20 +608,19 @@ public class ManutenzioneDatabase { deleteFileEntry(docAggiuntiva.getFileEntryId()); DocAggiuntivaLocalServiceUtil.deleteDocAggiuntiva(docAggiuntiva); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (docAggiuntive.size() > 0); return "Cancellati " + cancellati + " DocAggiuntiva"; } private static String svuotaDocPratica(long companyId) throws SystemException, PortalException { + int start = 0; int cancellati = 0; List docPratiche = null; do { - int rimossi = 0; docPratiche = DocPraticaLocalServiceUtil.getDocPraticas(start, start + SLICE); for (DocPratica docPratica : docPratiche) { if (!esiste(docPratica.getClassName(), docPratica.getClassPk(), companyId) @@ -614,74 +628,71 @@ public class ManutenzioneDatabase { deleteFileEntry(docPratica.getDlFileEntryId()); DocPraticaLocalServiceUtil.deleteDocPratica(docPratica); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (docPratiche.size() > 0); return "Cancellati " + cancellati + " DocPratica"; } private static String svuotaEmail(long companyId) throws SystemException, PortalException { + int start = 0; int cancellati = 0; List emails = null; do { - int rimossi = 0; emails = EmailLocalServiceUtil.getEmails(start, start + SLICE); for (Email email : emails) { if (!esiste(email.getClassName(), email.getClassPK(), companyId)) { EmailLocalServiceUtil.deleteEmail(email); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (emails.size() > 0); return "Cancellati " + cancellati + " Email"; } private static String svuotaEmailAttachment() throws SystemException, PortalException { + int start = 0; int cancellati = 0; List emailAttachments = null; do { - int rimossi = 0; emailAttachments = EmailAttachmentLocalServiceUtil.getEmailAttachments(start, start + SLICE); for (EmailAttachment emailAttachment : emailAttachments) { if (!esiste(EMAIL_CLASS_NAME, emailAttachment.getEmailId())) { deleteFileEntry(emailAttachment.getFileEntryId()); EmailAttachmentLocalServiceUtil.deleteEmailAttachment(emailAttachment); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (emailAttachments.size() > 0); return "Cancellati " + cancellati + " EmailAttachment"; } private static String svuotaFineLavori() throws SystemException, PortalException { + int start = 0; int cancellati = 0; List finiLavori = null; do { - int rimossi = 0; finiLavori = FineLavoriLocalServiceUtil.getFineLavoris(start, start + SLICE); for (FineLavori fineLavori : finiLavori) { if (!esiste(INTPRATICA_CLASS_NAME, fineLavori.getIntPraticaId())) { FineLavoriLocalServiceUtil.deleteFineLavori(fineLavori); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (finiLavori.size() > 0); return "Cancellati " + cancellati + " FineLavori"; } // Troncare le tabelle è l'unico modo possibile private static String svuotaIntPraticaDettPratica() { + int i = 0; int d = 0; try { @@ -689,56 +700,56 @@ public class ManutenzioneDatabase { Statement s = connection.createStatement(); i = s.executeUpdate("DELETE FROM portos_bo_intpratica"); d = s.executeUpdate("DELETE FROM portos_bo_dettpratica"); - } catch (SQLException e) {} + } catch (SQLException e) { + e.printStackTrace(); + } clearCache(); return "Cancellati " + i + " IntPratica, " + d + " DettPratica"; } private static String svuotaGroup(long companyId) throws SystemException, PortalException { + int start = 0; int cancellati = 0; List groups = null; do { - int rimossi = 0; groups = GroupLocalServiceUtil.getGroups(start, start + SLICE); for (Group group : groups) { if (!esiste(group.getClassName(), group.getClassPK(), companyId)) { GroupLocalServiceUtil.deleteGroup(group); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (groups.size() > 0); return "Cancellati " + cancellati + " Group"; } private static String svuotaHistoryWorkflowAction() throws SystemException { + int start = 0; int cancellati = 0; List actions = null; do { - int rimossi = 0; actions = HistoryWorkflowActionLocalServiceUtil.getHistoryWorkflowActions(start, start + SLICE); for (HistoryWorkflowAction action : actions) { if (!esiste(INTPRATICA_CLASS_NAME, action.getIntPraticaId()) || !esiste(DETTPRATICA_CLASS_NAME, action.getDettPraticaId())) { HistoryWorkflowActionLocalServiceUtil.deleteHistoryWorkflowAction(action); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (actions.size() > 0); return "Cancellati " + cancellati + " HistoryWorkflowAction"; } private static String svuotaMBDiscussion(long companyId) throws SystemException { + int start = 0; int cancellati = 0; List mbDiscussions = null; do { - int rimossi = 0; mbDiscussions = MBDiscussionLocalServiceUtil.getMBDiscussions(start, start + SLICE); for (MBDiscussion mbDiscussion : mbDiscussions) { if (!esiste(mbDiscussion.getClassName(), mbDiscussion.getClassPK(), companyId) @@ -746,20 +757,19 @@ public class ManutenzioneDatabase { || !esiste(GROUP_CLASS_NAME, mbDiscussion.getGroupId())) { MBDiscussionLocalServiceUtil.deleteMBDiscussion(mbDiscussion); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (mbDiscussions.size() > 0); return "Cancellati " + cancellati + " MBDiscussion"; } private static String svuotaMBMessage(long companyId) throws SystemException { + int start = 0; int cancellati = 0; List mbMessages = null; do { - int rimossi = 0; mbMessages = MBMessageLocalServiceUtil.getMBMessages(start, start + SLICE); for (MBMessage mbMessage : mbMessages) { if (!esiste(mbMessage.getClassName(), mbMessage.getClassPK(), companyId) @@ -767,40 +777,38 @@ public class ManutenzioneDatabase { || !esiste(GROUP_CLASS_NAME, mbMessage.getGroupId())) { MBMessageLocalServiceUtil.deleteMBMessage(mbMessage); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (mbMessages.size() > 0); return "Cancellati " + cancellati + " MBMessage"; } private static String svuotaMBThread() throws SystemException { + int start = 0; int cancellati = 0; List mbThreads = null; do { - int rimossi = 0; mbThreads = MBThreadLocalServiceUtil.getMBThreads(start, start + SLICE); for (MBThread mbThread : mbThreads) { if (!esiste(MBMESSAGE_CLASS_NAME, mbThread.getRootMessageId()) || !esiste(GROUP_CLASS_NAME, mbThread.getGroupId())) { MBThreadLocalServiceUtil.deleteMBThread(mbThread); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (mbThreads.size() > 0); return "Cancellati " + cancellati + " MBThread"; } private static String svuotaPagamento(long companyId) throws SystemException, PortalException { + int start = 0; int cancellati = 0; List pagamenti = null; do { - int rimossi = 0; pagamenti = PagamentoLocalServiceUtil.getPagamentos(start, start + SLICE); for (Pagamento pagamento : pagamenti) { if (!esiste(pagamento.getClassName(), pagamento.getClassPk(), companyId) @@ -808,20 +816,19 @@ public class ManutenzioneDatabase { deleteFileEntry(pagamento.getFileEntryId()); PagamentoLocalServiceUtil.deletePagamento(pagamento); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (pagamenti.size() > 0); return "Cancellati " + cancellati + " Pagamento"; } private static String svuotaParereGeologo() throws SystemException { + int start = 0; int cancellati = 0; List pareriGeologo = null; do { - int rimossi = 0; pareriGeologo = ParereGeologoLocalServiceUtil.getParereGeologos(start, start + SLICE); for (ParereGeologo parereGeologo : pareriGeologo) { if (!esiste(INTPRATICA_CLASS_NAME, parereGeologo.getIntPraticaId()) @@ -829,58 +836,55 @@ public class ManutenzioneDatabase { deleteFileEntry(parereGeologo.getFileEntryId()); ParereGeologoLocalServiceUtil.deleteParereGeologo(parereGeologo); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (pareriGeologo.size() > 0); return "Cancellati " + cancellati + " ParereGeologo"; } private static String svuotaRatingsEntry() throws SystemException { + int start = 0; int cancellati = 0; List entries = null; do { - int rimossi = 0; entries = RatingsEntryLocalServiceUtil.getRatingsEntries(start, start + SLICE); for (RatingsEntry entry : entries) { if (!esiste(entry.getClassName(), entry.getClassPK())) { RatingsEntryLocalServiceUtil.deleteRatingsEntry(entry); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (entries.size() > 0); return "Cancellati " + cancellati + " RatingsEntry"; } private static String svuotaRatingsStats(long companyId) throws SystemException { + int start = 0; int cancellati = 0; List ratingsStatses = null; do { - int rimossi = 0; ratingsStatses = RatingsStatsLocalServiceUtil.getRatingsStatses(start, start + SLICE); for (RatingsStats ratingsStats : ratingsStatses) { if (!esiste(ratingsStats.getClassName(), ratingsStats.getClassPK(), companyId)) { RatingsStatsLocalServiceUtil.deleteRatingsStats(ratingsStats); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (ratingsStatses.size() > 0); return "Cancellati " + cancellati + " RatingsStats"; } private static String svuotaResourcePermission(long companyId) throws SystemException { + int start = 0; int cancellati = 0; List resourcePermissions = null; do { - int rimossi = 0; resourcePermissions = ResourcePermissionLocalServiceUtil.getResourcePermissions(start, start + SLICE); for (ResourcePermission resourcePermission : resourcePermissions) { long classPK = 0; @@ -896,24 +900,23 @@ public class ManutenzioneDatabase { if (!esiste(resourcePermission.getName(), classPK)) { ResourcePermissionLocalServiceUtil.deleteResourcePermission(resourcePermission); cancellati++; - rimossi++; } break; } } } - start += SLICE - rimossi; + start += SLICE; } while (resourcePermissions.size() > 0); return "Cancellati " + cancellati + " ResourcePermission"; } private static String svuotaSoggetto() throws SystemException, PortalException { + int start = 0; int cancellati = 0; int docPraticaCancellati = 0; List soggetti = null; do { - int rimossi = 0; soggetti = SoggettoLocalServiceUtil.getSoggettos(start, start + SLICE); for (Soggetto soggetto : soggetti) { if (!esiste(INTPRATICA_CLASS_NAME, soggetto.getIntPraticaId()) @@ -929,79 +932,75 @@ public class ManutenzioneDatabase { } SoggettoLocalServiceUtil.deleteSoggetto(soggetto); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (soggetti.size() > 0); return "Cancellati " + cancellati + " Soggetto, " + docPraticaCancellati + " DocPratica"; } private static String svuotaSorteggio() throws SystemException { + int start = 0; int cancellati = 0; List sorteggi = null; do { - int rimossi = 0; sorteggi = SorteggioLocalServiceUtil.getSorteggios(start, start + SLICE); for (Sorteggio sorteggio : sorteggi) { if (!esiste(INTPRATICA_CLASS_NAME, sorteggio.getIntPraticaId()) || !esiste(DETTPRATICA_CLASS_NAME, sorteggio.getDettPraticaId())) { SorteggioLocalServiceUtil.deleteSorteggio(sorteggio); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (sorteggi.size() > 0); return "Cancellati " + cancellati + " Sorteggio"; } private static String svuotaStoricoSoggettoPratica() throws SystemException { + int start = 0; int cancellati = 0; List storicoSoggettiPratiche = null; do { - int rimossi = 0; storicoSoggettiPratiche = StoricoSoggettoPraticaLocalServiceUtil.getStoricoSoggettoPraticas(start, start + SLICE); for (StoricoSoggettoPratica storicoSoggettoPratica : storicoSoggettiPratiche) { if (!esiste(INTPRATICA_CLASS_NAME, storicoSoggettoPratica.getIntPraticaId())) { StoricoSoggettoPraticaLocalServiceUtil.deleteStoricoSoggettoPratica(storicoSoggettoPratica); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (storicoSoggettiPratiche.size() > 0); return "Cancellati " + cancellati + " StoricoSoggettoPratica"; } private static String svuotaSystemEvent(long companyId) throws SystemException { + int start = 0; int cancellati = 0; List systemEvents = null; do { - int rimossi = 0; systemEvents = SystemEventLocalServiceUtil.getSystemEvents(start, start + SLICE); for (SystemEvent systemEvent : systemEvents) { if (!esiste(systemEvent.getClassName(), systemEvent.getClassPK(), companyId)) { SystemEventLocalServiceUtil.deleteSystemEvent(systemEvent); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (systemEvents.size() > 0); return "Cancellati " + cancellati + " SystemEvent"; } private static String svuotaSyncDLObject() throws SystemException { + int start = 0; int cancellati = 0; List syncDLObjects = null; do { - int rimossi = 0; syncDLObjects = SyncDLObjectLocalServiceUtil.getSyncDLObjects(start, start + SLICE); for (SyncDLObject syncDLObject : syncDLObjects) { String className = null; @@ -1016,58 +1015,72 @@ public class ManutenzioneDatabase { if (!esiste(className, syncDLObject.getTypePK())) { SyncDLObjectLocalServiceUtil.deleteSyncDLObject(syncDLObject); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (syncDLObjects.size() > 0); return "Cancellati " + cancellati + " SyncDLObject"; } private static String svuotaTempistica() throws SystemException, PortalException { + int start = 0; int cancellati = 0; List tempistiche = null; do { - int rimossi = 0; tempistiche = TempisticaLocalServiceUtil.getTempisticas(start, start + SLICE); for (Tempistica tempistica : tempistiche) { if (!esiste(INTPRATICA_CLASS_NAME, tempistica.getIntPraticaId()) || !esiste(DETTPRATICA_CLASS_NAME, tempistica.getDettPraticaId())) { TempisticaLocalServiceUtil.deleteTempistica(tempistica); cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (tempistiche.size() > 0); return "Cancellati " + cancellati + " Tempistica"; } - private static String svuotaUser(long companyId) throws SystemException, PortalException { + private static List svuotaUser(long companyId) throws SystemException, PortalException { + + List esito = new ArrayList<>(); int start = 0; int cancellati = 0; List users = null; Role adminRole = RoleLocalServiceUtil.getRole(companyId, RoleConstants.ADMINISTRATOR); + Set soggetti = new HashSet<>(); + for (Soggetto soggetto : SoggettoLocalServiceUtil.getSoggettos(QueryUtil.ALL_POS, QueryUtil.ALL_POS)) { + soggetti.add(soggetto.getCodiceFiscaleDelegato().toLowerCase()); + soggetti.add(soggetto.getCodiceFiscale().toLowerCase()); + } + for (IntPratica pratica : IntPraticaLocalServiceUtil.getIntPraticas(QueryUtil.ALL_POS, QueryUtil.ALL_POS)) { + soggetti.add(pratica.getUserName().toLowerCase()); + } do { - int rimossi = 0; users = UserLocalServiceUtil.getUsers(start, start + SLICE); for (User user : users) { - if (user.getRoles().contains(adminRole)) { - _log.info("Non cancello utente " + user.getFullName()); + if (soggetti.contains(user.getScreenName().toLowerCase()) || user.getRoles().contains(adminRole) + || (user.getOrganizationIds().length > 0) || user.getDefaultUser()) {} else { + try { + UserLocalServiceUtil.deleteUser(user); + } catch (Exception e) { + esitoLog(esito, "Errore utente " + user.getFullName() + ": " + e.getMessage()); + } + cancellati++; } } - start += SLICE - rimossi; + start += SLICE; } while (users.size() > 0); - return "Cancellati " + cancellati + " User"; + esitoLog(esito, "Cancellati " + cancellati + " User"); + return esito; } private static String svuotaWorkflowInstance() throws SystemException, PortalException { + int start = 0; int cancellati = 0; List links = null; do { - int rimossi = 0; links = WorkflowInstanceLinkLocalServiceUtil.getWorkflowInstanceLinks(start, start + SLICE); for (WorkflowInstanceLink link : links) { if (!esiste(link.getClassName(), link.getClassPK())) { @@ -1084,19 +1097,20 @@ public class ManutenzioneDatabase { instance.getWorkflowInstanceId()); } cancellati++; - rimossi++; } } - start += SLICE - rimossi; + start += SLICE; } while (links.size() > 0); return "Cancellati " + cancellati + " WorkflowInstance"; } private static boolean esiste(String className, long classPK) throws SystemException { + return esiste(className, classPK, 0); } private static boolean esiste(String className, long classPK, long companyId) throws SystemException { + if (0 != classPK && Validator.isNotNull(className)) { try { if (ALLEGATOMANUALE_CLASS_NAME.equals(className)) { @@ -1193,7 +1207,7 @@ public class ManutenzioneDatabase { WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, classPK); } } else { - if (className.contains(".")) { + if (className.contains(StringPool.PERIOD)) { switch (className) { case "com.liferay.portlet.blogs": case "com.liferay.portlet.documentlibrary": @@ -1216,6 +1230,7 @@ public class ManutenzioneDatabase { } private static void deleteFileEntry(long fileEntryId) throws SystemException { + try { DLAppLocalServiceUtil.deleteFileEntry(fileEntryId); } catch (PortalException e) {} @@ -1229,6 +1244,7 @@ public class ManutenzioneDatabase { } private static void esitoLog(List esito, String msg) { + _log.info(msg); esito.add(msg); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SorteggioPraticaUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SorteggioPraticaUtil.java index e37ebcb3..c3fceb8c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SorteggioPraticaUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SorteggioPraticaUtil.java @@ -79,12 +79,23 @@ public class SorteggioPraticaUtil { */ public static List sorteggio(long companyId, Date dtSorteggio) throws PortalException, SystemException { + return sorteggio(companyId, dtSorteggio, null); + } + + public static List sorteggio(long companyId, Date dtSorteggio, Date dtRange) throws PortalException, + SystemException { + List esito = new ArrayList<>(); if (lock.tryLock()) { SimpleDateFormat sdf = new SimpleDateFormat(DATE_TIME_FORMAT); esito.add("Sorteggio iniziato in data " + sdf.format(dtSorteggio) + ".

"); + if (null == dtRange) { + dtRange = dtSorteggio; + } else { + esito.add("Le pratiche sono selezionate con data di riferimento " + sdf.format(dtRange) + ".
"); + } Map> sorteggiabili = IntPraticaLocalServiceUtil.findSorteggiabiliNew(companyId, - dtSorteggio); + dtRange); int numeroSorteggiabili = 0; for (Map.Entry> s : sorteggiabili.entrySet()) { numeroSorteggiabili += s.getValue().size(); @@ -152,6 +163,8 @@ public class SorteggioPraticaUtil { ConfigurazioneLocalServiceUtil.storeConfig(ConfigurazioneConstants.DATE_ULTIMO_SORTEGGIO, sdf.format(dtSorteggio), serviceContext); lock.unlock(); + } else { + esito.add("Sorteggio già in corso."); } return esito; } @@ -264,15 +277,14 @@ public class SorteggioPraticaUtil { } } - public static FileEntry getFileEntrySorteggio(long companyId, long groupId, Date dtSorteggio) - throws PortalException, SystemException { + public static FileEntry getFileEntrySorteggio(long companyId, Date dtSorteggio) throws PortalException, + SystemException { Company company = CompanyLocalServiceUtil.getCompany(companyId); - Folder folder = DLAppLocalServiceUtil.getFolder(company.getGroupId(), - DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, FOLDER_SORTEGGIO); - String fileName = reportFileName(companyId, dtSorteggio); - FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(groupId, folder.getFolderId(), fileName); - return fileEntry; + Calendar calSorteggio = DateUtils.toCalendar(dtSorteggio); + String anno = String.valueOf(calSorteggio.get(Calendar.YEAR)); + int settimana = calSorteggio.get(Calendar.WEEK_OF_YEAR); + return getFileEntrySorteggio(companyId, company.getGroupId(), settimana, anno); } public static FileEntry getFileEntrySorteggio(long companyId, long groupId, int settimana, String anno) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneFirmePortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneFirmePortlet.java index edf2760f..210d9e9c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneFirmePortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneFirmePortlet.java @@ -81,11 +81,11 @@ public class GestioneFirmePortlet extends MVCPortlet { public void simulaFirma(ActionRequest request, ActionResponse response) throws Exception { ServiceContext serviceContext = ServiceContextFactory.getInstance(request); - if (ConfigurazioneLocalServiceUtil.isDeveloper(serviceContext.getUserId())) { + if (ConfigurazioneLocalServiceUtil.isProduction()) { + throw new PortletException("Firma simulata non permessa"); + } else { long avvisoId = ParamUtil.getLong(request, "avvisoId"); AvvisoLocalServiceUtil.simulaFirma(avvisoId, serviceContext); - } else { - throw new PortletException("Firma simulata non permessa"); } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java index f033415d..630055b7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java @@ -7,6 +7,7 @@ import it.mwg.sismica.bo.util.SorteggioPraticaUtil; import it.tref.liferay.portos.bo.service.ConfigurazioneServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -33,7 +34,7 @@ public class SismicaAdministrationPortlet extends MVCPortlet { private static final Log _log = LogFactoryUtil.getLog(SismicaAdministrationPortlet.class); - public void mostraConfigurazione(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException { + public void mostraConfigurazione(ActionRequest request, ActionResponse response) throws SystemException { List esito = new ArrayList(); esito.add("

Env

"); @@ -44,108 +45,114 @@ public class SismicaAdministrationPortlet extends MVCPortlet { for (Map.Entry entry : System.getProperties().entrySet()) { esito.add(entry.getKey() + StringPool.EQUAL + entry.getValue()); } - actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); + response.setRenderParameter("esito", esito.toArray(new String[esito.size()])); } - public void generaDocumenti(ActionRequest actionRequest, ActionResponse actionResponse) { + public void generaDocumenti(ActionRequest request, ActionResponse response) { List esito = new ArrayList<>(); - actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); + response.setRenderParameter("esito", esito.toArray(new String[esito.size()])); } - public void sostituisciDL(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { - AllegatiUtil.sostituisciDL(actionRequest, actionResponse); + public void sostituisciDL(ActionRequest request, ActionResponse response) throws Exception { + AllegatiUtil.sostituisciDL(request, response); } - public void resetFirme(ActionRequest actionRequest, ActionResponse actionResponse) { + public void resetFirme(ActionRequest request, ActionResponse response) { - ThemeDisplay td = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); - String numeroProgetto = ParamUtil.getString(actionRequest, "numeroProgetto"); + ThemeDisplay td = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); + String numeroProgetto = ParamUtil.getString(request, "numeroProgetto"); List esito = new ArrayList<>(); try { esito = SismicaUtil.resetFirme(td.getCompanyId(), numeroProgetto); } catch (SystemException | PortalException e) { esito.add("Errore durante l'invio " + e.getMessage()); } - actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); + response.setRenderParameter("esito", esito.toArray(new String[esito.size()])); } - public void trasformaFLC(ActionRequest actionRequest, ActionResponse actionResponse) { + public void trasformaFLC(ActionRequest request, ActionResponse response) { - ThemeDisplay td = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); - String numeroPratica = ParamUtil.getString(actionRequest, "numeroPratica"); - String tipoDaRiaprire = ParamUtil.getString(actionRequest, "tipoDaRiaprire"); + ThemeDisplay td = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); + String numeroPratica = ParamUtil.getString(request, "numeroPratica"); + String tipoDaRiaprire = ParamUtil.getString(request, "tipoDaRiaprire"); List esito = new ArrayList<>(); try { esito = SismicaUtil.trasformaFLC(td.getCompanyId(), numeroPratica, tipoDaRiaprire); } catch (SystemException | PortalException e) { esito.add("Errore durante la trasformazione della pratica " + e.getMessage()); } - actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); + response.setRenderParameter("esito", esito.toArray(new String[esito.size()])); } - public void reIndexFasciolo(ActionRequest actionRequest, ActionResponse actionResponse) throws PortalException, - SystemException { + public void reIndexFasciolo(ActionRequest request, ActionResponse response) throws PortalException, SystemException { - ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); + ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); - long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId"); + long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); if (Validator.isNotNull(intPraticaId)) { IntPraticaLocalServiceUtil.reIndexFasciolo(intPraticaId, themeDisplay.getCompanyId()); } - String numeroProgetto = ParamUtil.getString(actionRequest, "numeroProgetto"); + String numeroProgetto = ParamUtil.getString(request, "numeroProgetto"); if (Validator.isNotNull(numeroProgetto)) { IntPraticaLocalServiceUtil.reIndexFasciolo(numeroProgetto, themeDisplay.getCompanyId()); } } - public void reIndexFascicoli(ActionRequest actionRequest, ActionResponse actionResponse) { + public void reIndexFascicoli(ActionRequest request, ActionResponse response) { - ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); + ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); List esito = null; esito = SismicaUtil.reIndexFascicoli(themeDisplay.getCompanyId()); - if (esito != null) - actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); + if (esito != null) { + response.setRenderParameter("esito", esito.toArray(new String[esito.size()])); + } } - public void lanciaSorteggio(ActionRequest actionRequest, ActionResponse actionResponse) { + public void lanciaSorteggio(ActionRequest request, ActionResponse response) throws ParseException { - ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); + ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); List esito = null; _log.info("Sorteggio lanciato manualmente"); try { - esito = SorteggioPraticaUtil.sorteggio(themeDisplay.getCompanyId(), new Date()); + Date dtRange = null; + String dtRangeStr = ParamUtil.getString(request, "dtRange"); + if (Validator.isNotNull(dtRangeStr)) { + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + dtRange = sdf.parse(dtRangeStr); + } + esito = SorteggioPraticaUtil.sorteggio(themeDisplay.getCompanyId(), new Date(), dtRange); } catch (PortalException | SystemException e) { _log.error("error", e); } - - if (esito != null) - actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); + if (esito != null) { + response.setRenderParameter("esito", esito.toArray(new String[esito.size()])); + } } - public void manutenzioneDatabase(ActionRequest actionRequest, ActionResponse actionResponse) - throws PortalException, SystemException { + public void manutenzioneDatabase(ActionRequest request, ActionResponse response) throws PortalException, + SystemException { - String mode = ParamUtil.getString(actionRequest, "mode"); - ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); + String mode = ParamUtil.getString(request, "mode"); + ServiceContext serviceContext = ServiceContextFactory.getInstance(request); List esito = ManutenzioneDatabase.pulisci(serviceContext, mode); - actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); + response.setRenderParameter("esito", esito.toArray(new String[esito.size()])); } - public void inviaAvviso(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException { + public void inviaAvviso(ActionRequest request, ActionResponse response) throws SystemException { - SismicaUtil.inviaAvviso(actionRequest, actionResponse); + SismicaUtil.inviaAvviso(request, response); } - public void salvaDataProssimoSorteggio(ActionRequest actionRequest, ActionResponse actionResponse) - throws PortalException, SystemException { + public void salvaDataProssimoSorteggio(ActionRequest request, ActionResponse response) throws PortalException, + SystemException { - ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); + ServiceContext serviceContext = ServiceContextFactory.getInstance(request); serviceContext.setScopeGroupId(-1L); serviceContext.setCompanyId(serviceContext.getCompanyId()); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); - Date dataProssimoSorteggio = ParamUtil.getDate(actionRequest, "dataProssimoSorteggio", sdf); + Date dataProssimoSorteggio = ParamUtil.getDate(request, "dataProssimoSorteggio", sdf); ConfigurazioneServiceUtil.storeConfig("conf.geniocivile.sorteggio.data.prossimo.sorteggio", sdf.format(dataProssimoSorteggio), serviceContext); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java index 68bac8fd..af0b51c0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java @@ -146,14 +146,12 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { if (className.equals(DettPratica.class.getName())) { DettPratica dettPratica = dettPraticaLocalService.getDettPratica(classPk); varianteNonSostanziale = dettPratica.getTipoIntegrazione().equals(TipoIntegrazioneUtil.VARIANTE) - && !dettPratica.getVarianteSostanziale(); + && !dettPratica.getVarianteSostanziale() && !stato.equalsIgnoreCase(StatoPraticaConstants.INTEGRAZIONE); } String statoPraticaCode = varianteNonSostanziale ? "DPVNS" : PraticaUtil.getStatoPraticaCode(stato, intPratica); String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(statoPraticaCode); long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), propertiesTemplate); - _log.info("debugAvviso: " + propertiesTemplate + " (" + statoPraticaCode + ")" - + (varianteNonSostanziale ? " non sostanziale" : StringPool.BLANK)); return addAvviso(intPraticaId, StringPool.BLANK, new Date(), tipoAvviso, stato, fileEntryIdTemplate, classPk, className, userCodiceFiscalePrimaFirma, jsonParameters, controlloPraticaId, serviceContext); } @@ -1111,7 +1109,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { @Override public Avviso simulaFirma(long avvisoId, ServiceContext serviceContext) throws Exception { - if (configurazioneLocalService.isDeveloper(serviceContext.getUserId())) { + if (configurazioneLocalService.isProduction()) { + throw new PortalException("Firma simulata non permessa"); + } else { Avviso avviso = fetchAvviso(avvisoId); avviso.setFileEntryIdInvio(avviso.getFileEntryIdBase()); avviso = updateAvviso(avviso); @@ -1120,8 +1120,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { avviso = updateAvvisoProtocollo(avviso.getAvvisoId(), protocollo); } return avviso; - } else { - throw new PortalException("Firma simulata non permessa"); } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java index e9cee58f..8b1de8f7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java @@ -500,7 +500,7 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { User newUser = userLocalService.getUser(soggettoId); // sostituisci int pratica intPratica.setUserId(soggettoId); - intPratica.setUserName(newUser.getFullName()); + intPratica.setUserName(newUser.getScreenName()); DettPratica dettPratica = dettPraticaLocalService.getLastCompletedByIntPratica(intPraticaId); dettPratica.setCodiceFiscaleDelegatoCommittente(newUser.getScreenName()); dettPraticaLocalService.updateDettPratica(dettPratica); @@ -948,7 +948,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { } String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get( StatoPraticaConstants.ANNULLA_ISTANZA); - _log.info("debugAvviso: " + propertiesTemplate); long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), propertiesTemplate); avvisoLocalService.addAvviso(intPraticaId, StringPool.BLANK, new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO, @@ -974,7 +973,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { serviceContext.setCompanyId(controlloPratica.getCompanyId()); String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get( StatoPraticaConstants.CAMBIO_ISTRUTTORE); - _log.info("debugAvviso: " + propertiesTemplate); long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), propertiesTemplate); avvisoLocalService.addAvviso(intPraticaId, StringPool.BLANK, new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO, @@ -1067,7 +1065,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { territorio.getCodiceProvincia()); String tipoDocumento = "DOM"; String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(tipoDocumento); - _log.info("debugAvviso: " + propertiesTemplate); long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(intPratica.getCompanyId(), propertiesTemplate); String propertiesFolder = AvvisoUtil.getAllTipoDocumentoFolderProps().get(tipoDocumento); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_actions.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_actions.jsp index c22dad21..b16dfe53 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_actions.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_actions.jsp @@ -48,7 +48,7 @@ -"> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp index 2bbb1407..9975a52f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp @@ -57,6 +57,9 @@ String dataSorteggio = ConfigurazioneLocalServiceUtil.findByC_ChiaveString(compa <%= dataSorteggio %>. Si è sicuri di volerlo lanciare? +
+ +
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sorteggio/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sorteggio/view.jsp index 4be59c31..80c26f22 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sorteggio/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sorteggio/view.jsp @@ -1,67 +1,45 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> - -<%@page import="it.tref.liferay.portos.bo.util.Constants"%> -<%@page import="it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants"%> -<%@page import="com.liferay.portlet.PortletURLUtil"%> -<%@page import="javax.portlet.PortletURL"%> -<%@page import="it.mwg.sismica.bo.util.SorteggioPraticaUtil"%> -<%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%> -<%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%> <%@page import="com.liferay.portal.kernel.exception.PortalException"%> - -<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> -<%@page import="org.apache.commons.lang.StringUtils"%> -<%@page import="com.liferay.portal.kernel.util.StringPool"%> -<%@page import="java.util.Calendar"%> -<%@page import="org.apache.commons.lang.time.DateUtils"%> -<%@page import="java.text.SimpleDateFormat"%> - +<%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%> <%@page import="com.liferay.portal.kernel.util.CalendarUtil"%> - -<%@page import="com.liferay.portal.kernel.util.HttpUtil"%> +<%@page import="com.liferay.portal.kernel.util.StringPool"%> <%@page import="com.liferay.portal.kernel.util.Validator"%> +<%@page import="com.liferay.portlet.PortletURLUtil"%> +<%@page import="it.mwg.sismica.bo.util.SorteggioPraticaUtil"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants"%> <%@page import="java.text.DateFormat"%> +<%@page import="java.text.SimpleDateFormat"%> +<%@page import="java.util.Calendar"%> <%@page import="java.util.Date"%> -<%@page import="com.liferay.portal.kernel.util.FastDateFormatFactoryUtil"%> - - +<%@page import="javax.portlet.PortletURL"%> +<%@page import="org.apache.commons.lang.time.DateUtils"%> <%@include file="/html/sorteggio/init.jsp" %> - <% long companyId = company.getCompanyId(); long groupId = themeDisplay.getScopeGroupId(); - -String dataUltimoSorteggioString = ConfigurazioneLocalServiceUtil.findByC_ChiaveString( - companyId, ConfigurazioneConstants.DATE_ULTIMO_SORTEGGIO); - +String dataUltimoSorteggioString = ConfigurazioneLocalServiceUtil.findByC_ChiaveString(companyId, + ConfigurazioneConstants.DATE_ULTIMO_SORTEGGIO); Date dtUltimoSorteggio = null; if (Validator.isNotNull(dataUltimoSorteggioString)) { Date now = DateUtils.truncate(new Date(), Calendar.DATE); - dtUltimoSorteggio = DateUtils.truncate( - new SimpleDateFormat(SorteggioPraticaUtil.DATE_TIME_FORMAT).parse( - dataUltimoSorteggioString), Calendar.DATE); + dtUltimoSorteggio = DateUtils.truncate(new SimpleDateFormat(SorteggioPraticaUtil.DATE_TIME_FORMAT).parse( + dataUltimoSorteggioString), Calendar.DATE); } - DateFormat formatDtSorteggio = DateFormat.getDateInstance(DateFormat.FULL, locale); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdfSorteggio = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); - Date dtProssimoSorteggio = null; -String dataProssimoSorteggio = - ConfigurazioneServiceUtil.findByC_ChiaveString(company.getCompanyId(), "conf.geniocivile.sorteggio.data.prossimo.sorteggio"); - +String dataProssimoSorteggio = ConfigurazioneServiceUtil.findByC_ChiaveString(companyId, + "conf.geniocivile.sorteggio.data.prossimo.sorteggio"); if(dataProssimoSorteggio != null && !dataProssimoSorteggio.equals("")){ dtProssimoSorteggio = DateUtils.truncate(sdf.parse(dataProssimoSorteggio), Calendar.DATE); } - String homeURL = ParamUtil.getString(renderRequest, "homeURL"); if (Validator.isNull(homeURL)) { homeURL = PortletURLUtil.getCurrent(renderRequest, renderResponse).toString(); } - boolean search = ParamUtil.getBoolean(renderRequest, "search"); boolean detailSorteggio = ParamUtil.getBoolean(renderRequest, "detailSorteggio"); - String anno = ParamUtil.getString(renderRequest, "anno"); String mese = ParamUtil.getString(renderRequest, "mese"); int settimana = ParamUtil.getInteger(renderRequest, "settimana"); @@ -70,336 +48,247 @@ String committente = ParamUtil.getString(renderRequest, "committente"); String tecnico = ParamUtil.getString(renderRequest, "tecnico"); String pratica = ParamUtil.getString(renderRequest, "pratica"); String numeroEstrazione = ParamUtil.getString(renderRequest, "numeroEstrazione"); -//Task 31433 String provincia = ParamUtil.getString(renderRequest, "provincia"); - String[] mesi = CalendarUtil.getMonths(locale); - boolean isPublicLayout = layout.isPublicLayout(); -%> - +%> - - + + - - - - + -
- - - - - -
-
- - + + + +
+
+ + function (val, fieldNode, ruleValue) { if(val != "") { - var regex = '^[0-9]{4}$'; - var regexObj = new RegExp (regex); - var result = regexObj.test(val); - return result; + var regex = '^[0-9]{4}$'; + var regexObj = new RegExp (regex); + var result = regexObj.test(val); + return result; } return true; } - - - - - - + + + + + function (val, fieldNode, ruleValue) { if(val != "") { - var regex = /^\d+$/; - var regexObj = new RegExp (regex); - var result = regexObj.test(val); - return result; + var regex = /^\d+$/; + var regexObj = new RegExp (regex); + var result = regexObj.test(val); + return result; } return true; } - - - -
-
- - - - - - - - - - - - - - - - - " /> -
-
- - - - - - - + + + +
+
+ + - + + + + + + + + + + + + + + " /> +
+
+ + + + + function (val, fieldNode, ruleValue) { if(val != "") { - var regex = /^\d+$/; - var regexObj = new RegExp (regex); - var result = regexObj.test(val); - return result; + var regex = /^\d+$/; + var regexObj = new RegExp (regex); + var result = regexObj.test(val); + return result; } return true; } - - + + + +
+ +
+ + +
- -
- - +
+
+
- -
-
-
-
-
- - - - -

- - - - <%=formatDtSorteggio.format(dtProssimoSorteggio) %> - -

- - - - - - - -

-
- -
-
- - <% - try { - - FileEntry fileEntry = SorteggioPraticaUtil.getFileEntrySorteggio(companyId, - themeDisplay.getScopeGroupId(), settimana, anno); - - %> - - - - - - - - - - - <% - } catch(PortalException e) { - } - %> - + + + + +

+
+
+
+ <% + try { + FileEntry fileEntry = SorteggioPraticaUtil.getFileEntrySorteggio(companyId, + themeDisplay.getScopeGroupId(), settimana, anno); + %> + + + + + + + <% + } catch(PortalException e) {} + %> +
-
- - <% - PortletURL searchURL = renderResponse.createRenderURL(); - searchURL.setParameter("homeURL", homeURL); - searchURL.setParameter("search", String.valueOf(search)); - searchURL.setParameter("detailSorteggio", String.valueOf(detailSorteggio)); - searchURL.setParameter("anno", anno); - searchURL.setParameter("mese", mese); - searchURL.setParameter("settimana", String.valueOf(settimana)); - searchURL.setParameter("comune", comune); - searchURL.setParameter("committente", committente); - searchURL.setParameter("tecnico", tecnico); - searchURL.setParameter("pratica", pratica); - searchURL.setParameter("numeroEstrazione", numeroEstrazione); - //Task 31433 - searchURL.setParameter("provincia", provincia); - %> - - - - <% - Long numeroEstrazioneNumber = Validator.isNotNull(numeroEstrazione) ? - Long.parseLong(numeroEstrazione) : null; + PortletURL searchURL = renderResponse.createRenderURL(); + searchURL.setParameter("homeURL", homeURL); + searchURL.setParameter("search", String.valueOf(search)); + searchURL.setParameter("detailSorteggio", String.valueOf(detailSorteggio)); + searchURL.setParameter("anno", anno); + searchURL.setParameter("mese", mese); + searchURL.setParameter("settimana", String.valueOf(settimana)); + searchURL.setParameter("comune", comune); + searchURL.setParameter("committente", committente); + searchURL.setParameter("tecnico", tecnico); + searchURL.setParameter("pratica", pratica); + searchURL.setParameter("numeroEstrazione", numeroEstrazione); + searchURL.setParameter("provincia", provincia); %> - - - - - - - - - Sorteggio non valido ed annullato per doppia esecuzione\" - : \"\")%>" /> - - - - - " /> - - <% - String tecnicoSorteggio = StringPool.BLANK; - - //if (sorteggio.isEsterna()) { - // tecnicoSorteggio = SorteggioLocalServiceUtil.getTecnicoSorteggioPraticaEsterna( - // sorteggio.getPraticaEsternaId()); - //} else { - tecnicoSorteggio = sorteggio.getTecnico(); - //} - %> - - - - - - + + <% + Long numeroEstrazioneNumber = Validator.isNull(numeroEstrazione) ? + null : Long.parseLong(numeroEstrazione); + %> + + + + Sorteggio non valido ed annullato per doppia esecuzione\" + : \"\") %>" /> + + + + + " /> + <% + String tecnicoSorteggio = sorteggio.getTecnico(); + %> + + + <% try { - FileEntry fileEntry = SorteggioPraticaUtil.getFileEntrySorteggio(themeDisplay.getCompanyId(), - sorteggio.getGroupId(), sorteggio.getDtSorteggio()); + FileEntry fileEntry = SorteggioPraticaUtil.getFileEntrySorteggio(companyId, + themeDisplay.getScopeGroupId(), settimana, anno); %> - - - - - - + + + + <% - } catch(PortalException e) { - } + } catch(PortalException e) {} %> - - - - - - - - - - - - - - - - - <% + + + + + + + + + + <% Long numeroPratiche = (Long) sorteggio[0]; String annoSorteggio = (String) sorteggio[1]; - /* String meseSorteggio = mesi[(Integer.parseInt((String) sorteggio[2])-1)]; */ String meseSorteggio = (String) sorteggio[2]; - String settimanaSorteggio = (String.valueOf((Integer) sorteggio[3])); - + String settimanaSorteggio = (String.valueOf((Integer) sorteggio[3])); PortletURL buttonURL = renderResponse.createRenderURL(); buttonURL.setParameter("homeURL", homeURL); - buttonURL.setParameter("detailSorteggio", String.valueOf(true)); + buttonURL.setParameter("detailSorteggio", StringPool.TRUE); buttonURL.setParameter("anno", annoSorteggio); buttonURL.setParameter("mese", meseSorteggio); buttonURL.setParameter("settimana", settimanaSorteggio); - if (annoSorteggio.equals("2020") && settimanaSorteggio.equals("24")) { settimanaSorteggio = "22-23-24"; } - %> - - - - - - - - - - - - - - - - - - + %> + + + + + + + + + + + + +
\ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp index 75fa3aaa..008d6b0f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp @@ -1,13 +1,10 @@ -<%@page import="it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="java.util.Map"%> <%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%> <%@page import="it.tref.liferay.portos.bo.util.AzioniPraticheUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> -<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.util.SoggettiUtil"%> -<%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%> <%@page import="it.tref.liferay.portos.bo.model.Soggetto"%> <%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%> <%@page import="java.util.regex.Pattern"%> @@ -17,6 +14,7 @@ <%@page import="it.tref.liferay.portos.bo.model.Provincia"%> <%@page import="it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.ComuneLocalService"%> +<%@page import="it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.model.Territorio"%> <%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.model.IntPratica"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fine-lavori_calcolo.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fine-lavori_calcolo.jsp index 5db9aebf..dcbd6899 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fine-lavori_calcolo.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fine-lavori_calcolo.jsp @@ -13,8 +13,8 @@ <%@page import="java.text.NumberFormat"%> <%@ include file="/html/fascicolofe/init.jsp" %> <% -long intPraticaId = ParamUtil.getLong(request, "intPraticaId", 0L); -long fineLavoriId = ParamUtil.getLong(request, "fineLavoriId", 0L); +long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); +long fineLavoriId = ParamUtil.getLong(request, "fineLavoriId"); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(fineLavoriId); if (fineLavori == null) { @@ -314,7 +314,7 @@ String currentCompleteUrl = PortalUtil.getCurrentCompleteURL(request); importoSpese = new BigDecimal(pagamentoSpese.getImporto()); } else { importoSpese = fineLavori.isNormEsenteSpese() ? new BigDecimal("0.00") - : new BigDecimal("25.00"); + : new BigDecimal("10.00"); } %> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="com.liferay.portal.kernel.util.HttpUtil"%> -<%@page import="com.liferay.portal.kernel.util.KeyValuePair"%> -<%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%> <%@page import="com.liferay.portal.model.User"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> @@ -19,15 +17,11 @@ <%@page import="it.tref.liferay.portos.bo.shared.util.FirmeUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeDetail"%> <%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> -<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> -<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%> <%@page import="it.tref.liferay.portos.bo.util.AzioniPraticheUtil"%> <%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%> <%@page import="it.tref.liferay.portos.bo.util.SoggettiUtil"%> <%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%> -<%@page import="java.text.DateFormat"%> -<%@page import="java.util.ArrayList"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.Map"%> <%@include file="/html/soggettipratica/init.jsp"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/mailmanager/service/persistence/EmailAttachmentPersistence.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/mailmanager/service/persistence/EmailAttachmentPersistence.java index 28d02bce..95c932ac 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/mailmanager/service/persistence/EmailAttachmentPersistence.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/mailmanager/service/persistence/EmailAttachmentPersistence.java @@ -151,7 +151,8 @@ public interface EmailAttachmentPersistence extends BasePersistence { @Override - public void onBeforeRemove(DLFileEntry model) throws ModelListenerException { - - try { - EmailAttachment emailAttachment = EmailAttachmentLocalServiceUtil - .fetchByFileEntryId(model.getFileEntryId()); - if (emailAttachment != null) { - throw new ModelListenerException(); - } - } catch (SystemException e) { - throw new ModelListenerException(e); - } - } + public void onBeforeRemove(DLFileEntry model) throws ModelListenerException {} } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/service.properties index 47557ea5..6dc4045d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=portos_Mail - build.number=88 - build.date=1642599560068 + build.number=90 + build.date=1663310360846 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/shared/tref-mapit-shared/.project b/liferay-plugins-sdk-6.2/shared/tref-mapit-shared/.project deleted file mode 100644 index 3e309bb0..00000000 --- a/liferay-plugins-sdk-6.2/shared/tref-mapit-shared/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - tref-mapit-shared - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/liferay-plugins-sdk-6.2/shared/tref-mapit-shared/bin/.project b/liferay-plugins-sdk-6.2/shared/tref-mapit-shared/bin/.project deleted file mode 100644 index 3e309bb0..00000000 --- a/liferay-plugins-sdk-6.2/shared/tref-mapit-shared/bin/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - tref-mapit-shared - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/liferay-plugins-sdk-6.2/themes/portos-private-fe-theme/docroot/_diffs/templates/header.ftl b/liferay-plugins-sdk-6.2/themes/portos-private-fe-theme/docroot/_diffs/templates/header.ftl index 47789e66..12113ba2 100644 --- a/liferay-plugins-sdk-6.2/themes/portos-private-fe-theme/docroot/_diffs/templates/header.ftl +++ b/liferay-plugins-sdk-6.2/themes/portos-private-fe-theme/docroot/_diffs/templates/header.ftl @@ -1,7 +1,7 @@