@ -4,14 +4,12 @@ import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException ;
import com.liferay.portal.kernel.exception.SystemException ;
import com.liferay.portal.kernel.log.Log ;
import com.liferay.portal.kernel.log.Log ;
import com.liferay.portal.kernel.log.LogFactoryUtil ;
import com.liferay.portal.kernel.log.LogFactoryUtil ;
import com.liferay.portal.kernel.search.Indexer ;
import com.liferay.portal.kernel.search.IndexerRegistryUtil ;
import com.liferay.portal.kernel.search.SearchException ;
import com.liferay.portal.kernel.servlet.SessionErrors ;
import com.liferay.portal.kernel.servlet.SessionErrors ;
import com.liferay.portal.kernel.util.ParamUtil ;
import com.liferay.portal.kernel.util.ParamUtil ;
import com.liferay.portal.kernel.util.Validator ;
import com.liferay.portal.kernel.util.Validator ;
import com.liferay.portal.kernel.util.WebKeys ;
import com.liferay.portal.kernel.util.WebKeys ;
import com.liferay.portal.kernel.workflow.WorkflowConstants ;
import com.liferay.portal.kernel.workflow.WorkflowConstants ;
import com.liferay.portal.kernel.workflow.WorkflowTask ;
import com.liferay.portal.service.UserLocalServiceUtil ;
import com.liferay.portal.service.UserLocalServiceUtil ;
import com.liferay.portal.theme.ThemeDisplay ;
import com.liferay.portal.theme.ThemeDisplay ;
import com.liferay.portal.util.PortalUtil ;
import com.liferay.portal.util.PortalUtil ;
@ -26,6 +24,7 @@ import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil ;
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil ;
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil ;
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil ;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil ;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil ;
import it.tref.liferay.portos.bo.util.WorkflowUtil ;
import java.util.List ;
import java.util.List ;
@ -120,6 +119,26 @@ public class AdvancedOperationPortlet extends MVCPortlet {
actionResponse . setRenderParameter ( "intPraticaId" , String . valueOf ( intPraticaId ) ) ;
actionResponse . setRenderParameter ( "intPraticaId" , String . valueOf ( intPraticaId ) ) ;
}
}
public void cambiaIstruttore ( ActionRequest actionRequest , ActionResponse actionResponse ) throws Exception {
ThemeDisplay themeDisplay = ( ThemeDisplay ) actionRequest . getAttribute ( WebKeys . THEME_DISPLAY ) ;
long intPraticaId = ParamUtil . getLong ( actionRequest , "intPraticaId" , - 1L ) ;
long istruttoreId = ParamUtil . getLong ( actionRequest , "istruttoreId" , - 1L ) ;
IntPratica intPratica = IntPraticaLocalServiceUtil . fetchIntPratica ( intPraticaId ) ;
WorkflowTask lastTask = AdvancedOperationUtil . getLastTask ( intPratica ) ;
if ( lastTask ! = null & & lastTask . getName ( ) . equalsIgnoreCase ( "Esito" ) ) {
List < ControlloPratica > controlloPraticas = ControlloPraticaLocalServiceUtil . findByIntPratica ( intPratica . getIntPraticaId ( ) ) ;
if ( ! controlloPraticas . isEmpty ( ) ) {
for ( ControlloPratica controlloPratica : controlloPraticas ) {
if ( controlloPratica . getStatus ( ) = = WorkflowConstants . STATUS_PENDING ) {
WorkflowUtil . assegnaUltimoTask ( intPratica . getCompanyId ( ) , intPratica . getGroupId ( ) ,
istruttoreId , themeDisplay . getUserId ( ) , controlloPratica ) ;
}
}
}
}
actionResponse . setRenderParameter ( "intPraticaId" , String . valueOf ( intPraticaId ) ) ;
}
public void fixUO ( ActionRequest actionRequest , ActionResponse actionResponse ) throws Exception {
public void fixUO ( ActionRequest actionRequest , ActionResponse actionResponse ) throws Exception {
Privati . checkIfUserIsCompanyAdmin ( actionRequest ) ;
Privati . checkIfUserIsCompanyAdmin ( actionRequest ) ;