Fork me on GitHub

Résultats CPD

Le document suivant contient les résultats de l'inspection CPD CPD 5.5.1.

Duplicatas

Fichier Ligne
fr/paris/lutece/plugins/appointment/web/AppointmentApp.java 659
fr/paris/lutece/plugins/appointment/web/AppointmentJspBean.java 1153
            Slot slot = null;
            // If nIdSlot == 0, the slot has not been created yet
            if ( nIdSlot == 0 )
            {
                // Need to get all the informations to create the slot
                LocalDateTime startingDateTime = LocalDateTime.parse( request.getParameter( PARAMETER_STARTING_DATE_TIME ) );
                LocalDateTime endingDateTime = LocalDateTime.parse( request.getParameter( PARAMETER_ENDING_DATE_TIME ) );
                // Need to check if the slot has not been already created
                HashMap<LocalDateTime, Slot> slotInDbMap = SlotService.buildMapSlotsByIdFormAndDateRangeWithDateForKey( nIdForm, startingDateTime,
                        endingDateTime );
                if ( !slotInDbMap.isEmpty( ) )
                {
                    slot = slotInDbMap.get( startingDateTime );
                }
                else
                {
                    boolean bIsOpen = Boolean.parseBoolean( request.getParameter( PARAMETER_IS_OPEN ) );
                    boolean bIsSpecific = Boolean.parseBoolean( request.getParameter( PARAMETER_IS_SPECIFIC ) );
                    int nMaxCapacity = Integer.parseInt( request.getParameter( PARAMETER_MAX_CAPACITY ) );
                    slot = SlotService.buildSlot( nIdForm, new Period( startingDateTime, endingDateTime ), nMaxCapacity, nMaxCapacity, nMaxCapacity, 0,
                            bIsOpen, bIsSpecific );
                    slot = SlotService.saveSlot( slot );
                }
            }
            else
            {
                slot = SlotService.findSlotById( nIdSlot );
            }
Fichier Ligne
fr/paris/lutece/plugins/appointment/web/AppointmentApp.java 661
fr/paris/lutece/plugins/appointment/web/AppointmentJspBean.java 919
fr/paris/lutece/plugins/appointment/web/AppointmentJspBean.java 1155
            if ( nIdSlot == 0 )
            {
                // Need to get all the informations to create the slot
                LocalDateTime startingDateTime = LocalDateTime.parse( request.getParameter( PARAMETER_STARTING_DATE_TIME ) );
                LocalDateTime endingDateTime = LocalDateTime.parse( request.getParameter( PARAMETER_ENDING_DATE_TIME ) );
                // Need to check if the slot has not been already created
                HashMap<LocalDateTime, Slot> slotInDbMap = SlotService.buildMapSlotsByIdFormAndDateRangeWithDateForKey( nIdForm, startingDateTime,
                        endingDateTime );
                if ( !slotInDbMap.isEmpty( ) )
                {
                    slot = slotInDbMap.get( startingDateTime );
                }
                else
                {
                    boolean bIsOpen = Boolean.parseBoolean( request.getParameter( PARAMETER_IS_OPEN ) );
                    boolean bIsSpecific = Boolean.parseBoolean( request.getParameter( PARAMETER_IS_SPECIFIC ) );
                    int nMaxCapacity = Integer.parseInt( request.getParameter( PARAMETER_MAX_CAPACITY ) );
                    slot = SlotService.buildSlot( nIdForm, new Period( startingDateTime, endingDateTime ), nMaxCapacity, nMaxCapacity, nMaxCapacity, 0,
                            bIsOpen, bIsSpecific );
                    slot = SlotService.saveSlot( slot );
                }
            }
            else
            {
                slot = SlotService.findSlotById( nIdSlot );
            }
Fichier Ligne
fr/paris/lutece/plugins/appointment/web/AppointmentJspBean.java 572
fr/paris/lutece/plugins/appointment/web/AppointmentJspBean.java 765
        model.put( MARK_LIST_STATUS, getListStatus( ) );
        model.put( MARK_RIGHT_CREATE,
                RBACService.isAuthorized( AppointmentFormDTO.RESOURCE_TYPE, strIdForm, AppointmentResourceIdService.PERMISSION_CREATE_APPOINTMENT, user ) );
        model.put( MARK_RIGHT_MODIFY,
                RBACService.isAuthorized( AppointmentFormDTO.RESOURCE_TYPE, strIdForm, AppointmentResourceIdService.PERMISSION_MODIFY_APPOINTMENT, user ) );
        model.put( MARK_RIGHT_DELETE,
                RBACService.isAuthorized( AppointmentFormDTO.RESOURCE_TYPE, strIdForm, AppointmentResourceIdService.PERMISSION_DELETE_APPOINTMENT, user ) );
        model.put( MARK_RIGHT_VIEW,
                RBACService.isAuthorized( AppointmentFormDTO.RESOURCE_TYPE, strIdForm, AppointmentResourceIdService.PERMISSION_VIEW_APPOINTMENT, user ) );
        model.put( MARK_RIGHT_CHANGE_STATUS,
                RBACService.isAuthorized( AppointmentFormDTO.RESOURCE_TYPE, strIdForm, AppointmentResourceIdService.PERMISSION_CHANGE_APPOINTMENT_STATUS, user ) );
        model.put( MARK_RIGHT_CHANGE_DATE,
                RBACService.isAuthorized( AppointmentFormDTO.RESOURCE_TYPE, strIdForm, AppointmentResourceIdService.PERMISSION_CHANGE_APPOINTMENT_DATE, user ) );
Fichier Ligne
fr/paris/lutece/plugins/appointment/business/appointment/AppointmentDAO.java 367
fr/paris/lutece/plugins/appointment/business/appointment/AppointmentDAO.java 390
    private Appointment buildAppointment( DAOUtil daoUtil )
    {
        int nIndex = 1;
        Appointment appointment = new Appointment( );
        appointment.setIdAppointment( daoUtil.getInt( nIndex++ ) );
        appointment.setReference( daoUtil.getString( nIndex++ ) );
        appointment.setNbPlaces( daoUtil.getInt( nIndex++ ) );
        appointment.setIsCancelled( daoUtil.getBoolean( nIndex++ ) );
        appointment.setIdActionCancelled( daoUtil.getInt( nIndex++ ) );
        appointment.setNotification( daoUtil.getInt( nIndex++ ) );
        appointment.setIdAdminUser( daoUtil.getInt( nIndex++ ) );
        appointment.setIdUser( daoUtil.getInt( nIndex++ ) );
        appointment.setIdSlot( daoUtil.getInt( nIndex ) );
Fichier Ligne
fr/paris/lutece/plugins/appointment/web/AppointmentApp.java 826
fr/paris/lutece/plugins/appointment/web/AppointmentJspBean.java 1080
            Date dateDemontage = null;
            try
            {
                // montage
                String heureMontage = responseMontage.getToStringValueResponse( ).replaceAll("(?i)h", "");
                if ( heureMontage != null && heureMontage.length() == 3 )
                {
                    heureMontage = "0" + heureMontage;
                }
                dateMontage = sdf.parse( heureMontage );
                // demontage
                String heureDemontage = responseDemontage.getToStringValueResponse( ).replaceAll("(?i)h", "");
                if ( heureDemontage != null && heureDemontage.length() == 3 )
                {
                    heureDemontage = "0" + heureDemontage;
                }
                dateDemontage = sdf.parse( heureDemontage );
            } catch ( ParseException e )
            {
                AppLogService.error( "Parsing error", e );
            }

            if ( dateMontage != null && dateDemontage != null )