Menu

How to manage new types of Tickets in Portal

2018-12-19
2020-04-15
1 2 > >> (Page 1 of 2)
  • Rafael AINCIART

    Rafael AINCIART - 2018-12-19

    Hi,

    I'm still having question about the way of customizing the Portal for managing new types of Tickets.

    What I want to do :
    In my company, we need to manage different type of Tickets. So I created subclass A, B and C of Ticket's class.
    Each Service / Sub Category of Service is linked to one of theses classes.

    What I done :
    1. I redefined the class ServiceSubcategory to modify the request_type field :

    <class id="ServiceSubcategory" _delta="merge">
                <fields>
                    <field id="request_type" xsi:type="AttributeEnum" _delta="redefine">
                        <values>
                            <value id="A">A</value>
                            <value id="B">B</value>
                            <value id="C">C</value>
                        </values>
                        <sql>request_type</sql>
                        <default_value/>
                        <is_null_allowed>false</is_null_allowed>
                        <display_style>list</display_style>
                    </field>
                </fields>
            </class>
    
    1. I redefined the method Ticket::CreateFromServiceSubcategory() in Ticket class to link the new request to the right class :
    <class id="Ticket" _delta="merge">
                <methods>
                    <method id="CreateFromServiceSubcategory" _delta="define">
                        <comment>
                            /**
                            * Instanciate an object of the relevant class, depending on the request type
                            * @return DBObject
                            */
                        </comment>
                        <static>true</static>
                        <access>public</access>
                        <type>Factory</type>
                        <code>
                            <![CDATA[
                                static public function CreateFromServiceSubcategory($oServiceSubcategory) {
                                    $sType = $oServiceSubcategory->Get('request_type');
                                    switch ($sType) {
                                        case 'A':
                                            $oRet = new A();
                                            break;
                                        case 'B':
                                            $oRet = new B();
                                            break;
                                        case 'C':
                                            $oRet = new C();
                                            break;
                                        default:
                                            throw new Exception('Impossible de créer un ticket concernant le service '.$oServiceSubcategory->Get('friendlyname').' de type '.$sType.': Type inconnu');
                                    }
                                    return $oRet;
                                }
                            ]]>
                        </code>
                    </method>
                </methods>
            </class>
    

    When I try to create a new Ticket in Portal : I select a Service / Subcategory of Service (linked to A subclass of Ticket), I fill the form and I have the following error message :

    Object not following integrity rules: issues = Unexpected value for attribute 'request_type': Value not allowed [informatique], class = UserRequest, id =

    Where have I made a mistake?

    Thanks for your help !

    Regards,

    Rafael.

     

    Last edit: Rafael AINCIART 2018-12-20
  • Rafael AINCIART

    Rafael AINCIART - 2018-12-19

    Sorry, I complete my message. I also modified the scopes of Ticket :

    <module_designs>
            <module_design id="itop-portal" xsi:type="portal" _delta="merge">
                <classes>
                    <class id="Ticket" _delta="merge">
                        <scopes>
                            <scope id="all" _delta="redefine">
                                <oql_view><![CDATA[SELECT Ticket AS T WHERE T.caller_id = :current_contact_id AND T.finalclass IN ('A', 'B', 'C')]]></oql_view>
                                <oql_edit><![CDATA[SELECT Ticket AS T]]></oql_edit>
                            </scope>
                            <scope id="portal-power-user" _delta="redefine">
                                <oql_view><![CDATA[SELECT Ticket AS T WHERE T.org_id = :current_contact->org_id AND T.finalclass IN ('A', 'B', 'C')]]></oql_view>
                                <oql_edit><![CDATA[SELECT Ticket AS T]]></oql_edit>
                                <allowed_profiles>
                                    <allowed_profile id="Portal power user"/>
                                </allowed_profiles>
                            </scope>
                        </scopes>
                    </class>
                </classes>
            </module_design>
        </module_designs>
    
     
  • Rafael AINCIART

    Rafael AINCIART - 2018-12-20

    Any idea about my issue ?
    - I created new classes as childs of Ticket class
    - I redefined the class ServiceSubcategory to modify the request_type field
    - I overload the method Ticket::CreateFromServiceSubcategory() in Ticket class to link the new request to the right class
    - I modify the scopes in Portal to allow the new class instead of UserRequest and Incident

    But a new request still point to UserRequest type...

    Something must be missing.

    Rafael.

     
  • Guillaume Lajarige

    Hi Rafael,

    • Overloading of method seems fine.
    • Redefinition of request_type values seems fine.
    • Redefinition of portal's scope seems fine.

    Can you share with us the compiled portal definition? (Located under /env-production/core/module_designs/itop-portal.xml)

     
  • Rafael AINCIART

    Rafael AINCIART - 2018-12-21

    Hi Guillaume,

    With great pleasure ! Thanks to help me :)

     
  • Guillaume Lajarige

    Great, so I think the problem is in your services brick. It defines that all created objects will be UserRequest. See line 130:

    <class>UserRequest</class>
    

    You need to change this so your PHP method is called. Replace the line above by:

    <factory_method><![CDATA[\Ticket::CreateFromServiceSubcategory]]></factory_method>
    

    Mind the backslash before the class and the omission of parenthesis at the end

    You can find an example of this in the datamodels/2.x/itop-full-itil/datamodel.itop-full-itil.xml file. FYI, if you had choosen the ITIL Request management and ITIL Change management options during the setup, this would already be done.

    Hope it helps!

     
  • Rafael AINCIART

    Rafael AINCIART - 2018-12-21

    Ok Guillaume ! I test it now and I give you my feedback !

     
  • Rafael AINCIART

    Rafael AINCIART - 2019-01-21

    Hi Guillaume !

    It is several weeks now since I try to customize itop Portal to manage new types of Tickets but I don't understand why it's not working...
    1. I created new classes as childs of Ticket class
    2. I redefined the class ServiceSubcategory to modify the request_type field
    3. I overload the method Ticket::CreateFromServiceSubcategory() in Ticket class to link the new request to the right class
    4. I modify the scopes in Portal to allow the new class instead of UserRequest and Incident
    5. I give the appropriates rights on the new classes for the Portal users

    When I execute the Portal and try to create a new Ticket (with one of the new type), the form appears but it's impossible to submit it. No error message, nothing happend. It is as if the javacript code to execute the ajax request is missing.
    I have installed a new instance of itop with the full itil management (but without change management) but the result is still the same.

    In debug mode (netbeans-xdebug), I have no error : the CreateFromServiceSubcategory($oServiceSubcategory) function is called and a new class is created. But impossible to save the form.
    In CreateFromServiceSubcategory(), I have set the request_type property to the correct value :

    static public function CreateFromServiceSubcategory($oServiceSubcategory) {
        $sType = $oServiceSubcategory->Get('request_type');
        switch ($sType) {
            case 'A':
                $oRet = new A();
                $oRet->Set('request_type', $sType);
                break;
            case 'B':
                $oRet = new B();
                $oRet->Set('request_type', $sType);
                break;
            case 'C':
                $oRet = new C();
                $oRet->Set('request_type', $sType);
                break;
            default:
                throw new Exception('Impossible de créer un ticket concernant le service '.$oServiceSubcategory->Get('friendlyname').' de type '.$sType.': unknown class');
        }
        return $oRet;
    }
    

    print_r($oRet, true) give the folowing result :
    [With A a sub-class of Ticket and a copy of UserRequest]

    A Object
    (
        [m_iFormId:protected] => 
        [aFieldsMap:protected] => 
        [bAllowWrite:protected] => 
        [m_datCreated:protected] => 
        [m_datUpdated:protected] => 
        [m_bIsInDB:protected] => 
        [m_iKey:protected] => -1
        [m_aCurrValues:DBObject:private] => Array
            (
                [operational_status] => ongoing
                [ref] => 
                [org_id] => 0
                [org_name] => 
                [caller_id] => 0
                [caller_name] => 
                [team_id] => 0
                [team_name] => 
                [agent_id] => 0
                [agent_name] => 
                [title] => 
                [description] => 
                [start_date] => 
                [end_date] => 
                [last_update] => 
                [close_date] => 
                [private_log] => ormCaseLog Object
                    (
                        [m_sLog:protected] => 
                        [m_aIndex:protected] => Array
                            (
                            )
    
                        [m_bModified:protected] => 
                    )
    
                [contacts_list] => ormLinkSet Object
                    (
                        [sHostClass:protected] => A
                        [sAttCode:protected] => contacts_list
                        [sClass:protected] => lnkContactToTicket
                        [oOriginalSet:protected] => DBObjectSet Object
                            (
                                [m_aAddedIds:protected] => Array
                                    (
                                    )
    
                                [m_aAddedObjects:protected] => Array
                                    (
                                    )
    
                                [m_aArgs:protected] => Array
                                    (
                                    )
    
                                [m_aAttToLoad:protected] => 
                                [m_aOrderBy:protected] => Array
                                    (
                                    )
    
                                [m_bLoaded] => 
                                [m_iNumTotalDBRows:protected] => 
                                [m_iNumLoadedDBRows:protected] => 0
                                [m_iCurrRow:protected] => 0
                                [m_oFilter:protected] => DBObjectSearch Object
                                    (
                                        [m_aClasses:DBObjectSearch:private] => Array
                                            (
                                                [lnkContactToTicket] => lnkContactToTicket
                                                [Ticket] => Ticket
                                            )
    
                                        [m_aSelectedClasses:DBObjectSearch:private] => Array
                                            (
                                                [lnkContactToTicket] => lnkContactToTicket
                                            )
    
                                        [m_oSearchCondition:DBObjectSearch:private] => BinaryExpression Object
                                            (
                                                [m_oLeftExpr:protected] => FieldExpression Object
                                                    (
                                                        [m_sParent:protected] => Ticket
                                                        [m_sName:protected] => id
                                                        [m_value:protected] => Ticket.id
                                                    )
    
                                                [m_oRightExpr:protected] => VariableExpression Object
                                                    (
                                                        [m_sName:protected] => id
                                                        [m_value:protected] => id
                                                    )
    
                                                [m_sOperator:protected] => =
                                            )
    
                                        [m_aParams:DBObjectSearch:private] => Array
                                            (
                                                [id] => -1
                                            )
    
                                        [m_aPointingTo:DBObjectSearch:private] => Array
                                            (
                                                [ticket_id] => Array
                                                    (
                                                        [0] => Array
                                                            (
                                                                [0] => DBObjectSearch Object
                                                                    (
                                                                        [m_aClasses:DBObjectSearch:private] => Array
                                                                            (
                                                                                [Ticket] => Ticket
                                                                            )
    
                                                                        [m_aSelectedClasses:DBObjectSearch:private] => Array
                                                                            (
                                                                                [Ticket] => Ticket
                                                                            )
    
                                                                        [m_oSearchCondition:DBObjectSearch:private] => BinaryExpression Object
                                                                            (
                                                                                [m_oLeftExpr:protected] => FieldExpression Object
                                                                                    (
                                                                                        [m_sParent:protected] => Ticket
                                                                                        [m_sName:protected] => id
                                                                                        [m_value:protected] => Ticket.id
                                                                                    )
    
                                                                                [m_oRightExpr:protected] => VariableExpression Object
                                                                                    (
                                                                                        [m_sName:protected] => id
                                                                                        [m_value:protected] => id
                                                                                    )
    
                                                                                [m_sOperator:protected] => =
                                                                            )
    
                                                                        [m_aParams:DBObjectSearch:private] => Array
                                                                            (
                                                                                [id] => -1
                                                                            )
    
                                                                        [m_aPointingTo:DBObjectSearch:private] => Array
                                                                            (
                                                                            )
    
                                                                        [m_aReferencedBy:DBObjectSearch:private] => Array
                                                                            (
                                                                            )
    
                                                                        [m_bAllowAllData:protected] => 
                                                                        [m_bDataFiltered:protected] => 
                                                                        [m_bNoContextParameters:protected] => 
                                                                        [m_aModifierProperties:protected] => Array
                                                                            (
                                                                            )
    
                                                                        [m_bArchiveMode:protected] => 
                                                                        [m_bShowObsoleteData:protected] => 1
                                                                    )
    
                                                            )
    
                                                    )
    
                                            )
    
                                        [m_aReferencedBy:DBObjectSearch:private] => Array
                                            (
                                            )
    
                                        [m_bAllowAllData:protected] => 
                                        [m_bDataFiltered:protected] => 
                                        [m_bNoContextParameters:protected] => 
                                        [m_aModifierProperties:protected] => Array
                                            (
                                            )
    
                                        [m_bArchiveMode:protected] => 
                                        [m_bShowObsoleteData:protected] => 1
                                    )
    
                                [m_oSQLResult:protected] => 
                                [m_bSort:protected] => 1
                                [m_aExtendedDataSpec] => 
                                [m_iLimitCount] => 0
                                [m_iLimitStart] => 0
                            )
    
                        [aOriginalObjects:protected] => 
                        [bHasDelta:protected] => 
                        [aPreserved:protected] => Array
                            (
                            )
    
                        [aAdded:protected] => Array
                            (
                            )
    
                        [aModified:protected] => Array
                            (
                            )
    
                        [aRemoved:protected] => Array
                            (
                            )
    
                        [iCursor:protected] => 0
                    )
    
                [functionalcis_list] => ormLinkSet Object
                    (
                        [sHostClass:protected] => A
                        [sAttCode:protected] => functionalcis_list
                        [sClass:protected] => lnkFunctionalCIToTicket
                        [oOriginalSet:protected] => DBObjectSet Object
                            (
                                [m_aAddedIds:protected] => Array
                                    (
                                    )
    
                                [m_aAddedObjects:protected] => Array
                                    (
                                    )
    
                                [m_aArgs:protected] => Array
                                    (
                                    )
    
                                [m_aAttToLoad:protected] => 
                                [m_aOrderBy:protected] => Array
                                    (
                                    )
    
                                [m_bLoaded] => 
                                [m_iNumTotalDBRows:protected] => 
                                [m_iNumLoadedDBRows:protected] => 0
                                [m_iCurrRow:protected] => 0
                                [m_oFilter:protected] => DBObjectSearch Object
                                    (
                                        [m_aClasses:DBObjectSearch:private] => Array
                                            (
                                                [lnkFunctionalCIToTicket] => lnkFunctionalCIToTicket
                                                [Ticket] => Ticket
                                            )
    
                                        [m_aSelectedClasses:DBObjectSearch:private] => Array
                                            (
                                                [lnkFunctionalCIToTicket] => lnkFunctionalCIToTicket
                                            )
    
                                        [m_oSearchCondition:DBObjectSearch:private] => BinaryExpression Object
                                            (
                                                [m_oLeftExpr:protected] => FieldExpression Object
                                                    (
                                                        [m_sParent:protected] => Ticket
                                                        [m_sName:protected] => id
                                                        [m_value:protected] => Ticket.id
                                                    )
    
                                                [m_oRightExpr:protected] => VariableExpression Object
                                                    (
                                                        [m_sName:protected] => id
                                                        [m_value:protected] => id
                                                    )
    
                                                [m_sOperator:protected] => =
                                            )
    
                                        [m_aParams:DBObjectSearch:private] => Array
                                            (
                                                [id] => -1
                                            )
    
                                        [m_aPointingTo:DBObjectSearch:private] => Array
                                            (
                                                [ticket_id] => Array
                                                    (
                                                        [0] => Array
                                                            (
                                                                [0] => DBObjectSearch Object
                                                                    (
                                                                        [m_aClasses:DBObjectSearch:private] => Array
                                                                            (
                                                                                [Ticket] => Ticket
                                                                            )
    
                                                                        [m_aSelectedClasses:DBObjectSearch:private] => Array
                                                                            (
                                                                                [Ticket] => Ticket
                                                                            )
    
                                                                        [m_oSearchCondition:DBObjectSearch:private] => BinaryExpression Object
                                                                            (
                                                                                [m_oLeftExpr:protected] => FieldExpression Object
                                                                                    (
                                                                                        [m_sParent:protected] => Ticket
                                                                                        [m_sName:protected] => id
                                                                                        [m_value:protected] => Ticket.id
                                                                                    )
    
                                                                                [m_oRightExpr:protected] => VariableExpression Object
                                                                                    (
                                                                                        [m_sName:protected] => id
                                                                                        [m_value:protected] => id
                                                                                    )
    
                                                                                [m_sOperator:protected] => =
                                                                            )
    
                                                                        [m_aParams:DBObjectSearch:private] => Array
                                                                            (
                                                                                [id] => -1
                                                                            )
    
                                                                        [m_aPointingTo:DBObjectSearch:private] => Array
                                                                            (
                                                                            )
    
                                                                        [m_aReferencedBy:DBObjectSearch:private] => Array
                                                                            (
                                                                            )
    
                                                                        [m_bAllowAllData:protected] => 
                                                                        [m_bDataFiltered:protected] => 
                                                                        [m_bNoContextParameters:protected] => 
                                                                        [m_aModifierProperties:protected] => Array
                                                                            (
                                                                            )
    
                                                                        [m_bArchiveMode:protected] => 
                                                                        [m_bShowObsoleteData:protected] => 1
                                                                    )
    
                                                            )
    
                                                    )
    
                                            )
    
                                        [m_aReferencedBy:DBObjectSearch:private] => Array
                                            (
                                            )
    
                                        [m_bAllowAllData:protected] => 
                                        [m_bDataFiltered:protected] => 
                                        [m_bNoContextParameters:protected] => 
                                        [m_aModifierProperties:protected] => Array
                                            (
                                            )
    
                                        [m_bArchiveMode:protected] => 
                                        [m_bShowObsoleteData:protected] => 1
                                    )
    
                                [m_oSQLResult:protected] => 
                                [m_bSort:protected] => 1
                                [m_aExtendedDataSpec] => 
                                [m_iLimitCount] => 0
                                [m_iLimitStart] => 0
                            )
    
                        [aOriginalObjects:protected] => 
                        [bHasDelta:protected] => 
                        [aPreserved:protected] => Array
                            (
                            )
    
                        [aAdded:protected] => Array
                            (
                            )
    
                        [aModified:protected] => Array
                            (
                            )
    
                        [aRemoved:protected] => Array
                            (
                            )
    
                        [iCursor:protected] => 0
                    )
    
                [workorders_list] => ormLinkSet Object
                    (
                        [sHostClass:protected] => A
                        [sAttCode:protected] => workorders_list
                        [sClass:protected] => WorkOrder
                        [oOriginalSet:protected] => DBObjectSet Object
                            (
                                [m_aAddedIds:protected] => Array
                                    (
                                    )
    
                                [m_aAddedObjects:protected] => Array
                                    (
                                    )
    
                                [m_aArgs:protected] => Array
                                    (
                                    )
    
                                [m_aAttToLoad:protected] => 
                                [m_aOrderBy:protected] => Array
                                    (
                                    )
    
                                [m_bLoaded] => 
                                [m_iNumTotalDBRows:protected] => 
                                [m_iNumLoadedDBRows:protected] => 0
                                [m_iCurrRow:protected] => 0
                                [m_oFilter:protected] => DBObjectSearch Object
                                    (
                                        [m_aClasses:DBObjectSearch:private] => Array
                                            (
                                                [WorkOrder] => WorkOrder
                                                [Ticket] => Ticket
                                            )
    
                                        [m_aSelectedClasses:DBObjectSearch:private] => Array
                                            (
                                                [WorkOrder] => WorkOrder
                                            )
    
                                        [m_oSearchCondition:DBObjectSearch:private] => BinaryExpression Object
                                            (
                                                [m_oLeftExpr:protected] => FieldExpression Object
                                                    (
                                                        [m_sParent:protected] => Ticket
                                                        [m_sName:protected] => id
                                                        [m_value:protected] => Ticket.id
                                                    )
    
                                                [m_oRightExpr:protected] => VariableExpression Object
                                                    (
                                                        [m_sName:protected] => id
                                                        [m_value:protected] => id
                                                    )
    
                                                [m_sOperator:protected] => =
                                            )
    
                                        [m_aParams:DBObjectSearch:private] => Array
                                            (
                                                [id] => -1
                                            )
    
                                        [m_aPointingTo:DBObjectSearch:private] => Array
                                            (
                                                [ticket_id] => Array
                                                    (
                                                        [0] => Array
                                                            (
                                                                [0] => DBObjectSearch Object
                                                                    (
                                                                        [m_aClasses:DBObjectSearch:private] => Array
                                                                            (
                                                                                [Ticket] => Ticket
                                                                            )
    
                                                                        [m_aSelectedClasses:DBObjectSearch:private] => Array
                                                                            (
                                                                                [Ticket] => Ticket
                                                                            )
    
                                                                        [m_oSearchCondition:DBObjectSearch:private] => BinaryExpression Object
                                                                            (
                                                                                [m_oLeftExpr:protected] => FieldExpression Object
                                                                                    (
                                                                                        [m_sParent:protected] => Ticket
                                                                                        [m_sName:protected] => id
                                                                                        [m_value:protected] => Ticket.id
                                                                                    )
    
                                                                                [m_oRightExpr:protected] => VariableExpression Object
                                                                                    (
                                                                                        [m_sName:protected] => id
                                                                                        [m_value:protected] => id
                                                                                    )
    
                                                                                [m_sOperator:protected] => =
                                                                            )
    
                                                                        [m_aParams:DBObjectSearch:private] => Array
                                                                            (
                                                                                [id] => -1
                                                                            )
    
                                                                        [m_aPointingTo:DBObjectSearch:private] => Array
                                                                            (
                                                                            )
    
                                                                        [m_aReferencedBy:DBObjectSearch:private] => Array
                                                                            (
                                                                            )
    
                                                                        [m_bAllowAllData:protected] => 
                                                                        [m_bDataFiltered:protected] => 
                                                                        [m_bNoContextParameters:protected] => 
                                                                        [m_aModifierProperties:protected] => Array
                                                                            (
                                                                            )
    
                                                                        [m_bArchiveMode:protected] => 
                                                                        [m_bShowObsoleteData:protected] => 1
                                                                    )
    
                                                            )
    
                                                    )
    
                                            )
    
                                        [m_aReferencedBy:DBObjectSearch:private] => Array
                                            (
                                            )
    
                                        [m_bAllowAllData:protected] => 
                                        [m_bDataFiltered:protected] => 
                                        [m_bNoContextParameters:protected] => 
                                        [m_aModifierProperties:protected] => Array
                                            (
                                            )
    
                                        [m_bArchiveMode:protected] => 
                                        [m_bShowObsoleteData:protected] => 1
                                    )
    
                                [m_oSQLResult:protected] => 
                                [m_bSort:protected] => 1
                                [m_aExtendedDataSpec] => 
                                [m_iLimitCount] => 0
                                [m_iLimitStart] => 0
                            )
    
                        [aOriginalObjects:protected] => 
                        [bHasDelta:protected] => 
                        [aPreserved:protected] => Array
                            (
                            )
    
                        [aAdded:protected] => Array
                            (
                            )
    
                        [aModified:protected] => Array
                            (
                            )
    
                        [aRemoved:protected] => Array
                            (
                            )
    
                        [iCursor:protected] => 0
                    )
    
                [status] => new
                [request_type] => A
                [impact] => 1
                [priority] => 4
                [urgency] => 4
                [origin] => phone
                [approver_id] => 0
                [approver_email] => 
                [service_id] => 0
                [service_name] => 
                [servicesubcategory_id] => 0
                [servicesubcategory_name] => 
                [escalation_flag] => no
                [escalation_reason] => 
                [assignment_date] => 
                [resolution_date] => 
                [last_pending_date] => 
                [cumulatedpending] => ormStopWatch Object
                    (
                        [iTimeSpent:protected] => 0
                        [iStarted:protected] => 
                        [iLastStart:protected] => 
                        [iStopped:protected] => 
                        [aThresholds:protected] => Array
                            (
                            )
    
                    )
    
                [tto] => ormStopWatch Object
                    (
                        [iTimeSpent:protected] => 0
                        [iStarted:protected] => 
                        [iLastStart:protected] => 
                        [iStopped:protected] => 
                        [aThresholds:protected] => Array
                            (
                                [75] => Array
                                    (
                                        [deadline] => 
                                        [triggered] => 
                                        [overrun] => 
                                        [highlight] => 
                                    )
    
                                [100] => Array
                                    (
                                        [deadline] => 
                                        [triggered] => 
                                        [overrun] => 
                                        [highlight] => 
                                    )
    
                            )
    
                    )
    
                [ttr] => ormStopWatch Object
                    (
                        [iTimeSpent:protected] => 0
                        [iStarted:protected] => 
                        [iLastStart:protected] => 
                        [iStopped:protected] => 
                        [aThresholds:protected] => Array
                            (
                                [75] => Array
                                    (
                                        [deadline] => 
                                        [triggered] => 
                                        [overrun] => 
                                        [highlight] => 
                                    )
    
                                [100] => Array
                                    (
                                        [deadline] => 
                                        [triggered] => 
                                        [overrun] => 
                                        [highlight] => 
                                    )
    
                            )
    
                    )
    
                [tto_escalation_deadline] => 
                [sla_tto_passed] => 
                [sla_tto_over] => 
                [ttr_escalation_deadline] => 
                [sla_ttr_passed] => 
                [sla_ttr_over] => 
                [time_spent] => 
                [resolution_code] => assistance
                [solution] => 
                [pending_reason] => 
                [parent_request_id] => 0
                [parent_request_ref] => 
                [related_request_list] => ormLinkSet Object
                    (
                        [sHostClass:protected] => A
                        [sAttCode:protected] => related_request_list
                        [sClass:protected] => UserRequest
                        [oOriginalSet:protected] => DBObjectSet Object
                            (
                                [m_aAddedIds:protected] => Array
                                    (
                                    )
    
                                [m_aAddedObjects:protected] => Array
                                    (
                                    )
    
                                [m_aArgs:protected] => Array
                                    (
                                    )
    
                                [m_aAttToLoad:protected] => 
                                [m_aOrderBy:protected] => Array
                                    (
                                    )
    
                                [m_bLoaded] => 
                                [m_iNumTotalDBRows:protected] => 
                                [m_iNumLoadedDBRows:protected] => 0
                                [m_iCurrRow:protected] => 0
                                [m_oFilter:protected] => DBObjectSearch Object
                                    (
                                        [m_aClasses:DBObjectSearch:private] => Array
                                            (
                                                [UserRequest] => UserRequest
                                                [UserRequest1] => UserRequest
                                            )
    
                                        [m_aSelectedClasses:DBObjectSearch:private] => Array
                                            (
                                                [UserRequest] => UserRequest
                                            )
    
                                        [m_oSearchCondition:DBObjectSearch:private] => BinaryExpression Object
                                            (
                                                [m_oLeftExpr:protected] => FieldExpression Object
                                                    (
                                                        [m_sParent:protected] => UserRequest1
                                                        [m_sName:protected] => id
                                                        [m_value:protected] => UserRequest1.id
                                                    )
    
                                                [m_oRightExpr:protected] => VariableExpression Object
                                                    (
                                                        [m_sName:protected] => id
                                                        [m_value:protected] => id
                                                    )
    
                                                [m_sOperator:protected] => =
                                            )
    
                                        [m_aParams:DBObjectSearch:private] => Array
                                            (
                                                [id] => -1
                                            )
    
                                        [m_aPointingTo:DBObjectSearch:private] => Array
                                            (
                                                [parent_request_id] => Array
                                                    (
                                                        [0] => Array
                                                            (
                                                                [0] => DBObjectSearch Object
                                                                    (
                                                                        [m_aClasses:DBObjectSearch:private] => Array
                                                                            (
                                                                                [UserRequest1] => UserRequest
                                                                            )
    
                                                                        [m_aSelectedClasses:DBObjectSearch:private] => Array
                                                                            (
                                                                                [UserRequest1] => UserRequest
                                                                            )
    
                                                                        [m_oSearchCondition:DBObjectSearch:private] => BinaryExpression Object
                                                                            (
                                                                                [m_oLeftExpr:protected] => FieldExpression Object
                                                                                    (
                                                                                        [m_sParent:protected] => UserRequest
                                                                                        [m_sName:protected] => id
                                                                                        [m_value:protected] => UserRequest.id
                                                                                    )
    
                                                                                [m_oRightExpr:protected] => VariableExpression Object
                                                                                    (
                                                                                        [m_sName:protected] => id
                                                                                        [m_value:protected] => id
                                                                                    )
    
                                                                                [m_sOperator:protected] => =
                                                                            )
    
                                                                        [m_aParams:DBObjectSearch:private] => Array
                                                                            (
                                                                                [id] => -1
                                                                            )
    
                                                                        [m_aPointingTo:DBObjectSearch:private] => Array
                                                                            (
                                                                            )
    
                                                                        [m_aReferencedBy:DBObjectSearch:private] => Array
                                                                            (
                                                                            )
    
                                                                        [m_bAllowAllData:protected] => 
                                                                        [m_bDataFiltered:protected] => 
                                                                        [m_bNoContextParameters:protected] => 
                                                                        [m_aModifierProperties:protected] => Array
                                                                            (
                                                                            )
    
                                                                        [m_bArchiveMode:protected] => 
                                                                        [m_bShowObsoleteData:protected] => 1
                                                                    )
    
                                                            )
    
                                                    )
    
                                            )
    
                                        [m_aReferencedBy:DBObjectSearch:private] => Array
                                            (
                                            )
    
                                        [m_bAllowAllData:protected] => 
                                        [m_bDataFiltered:protected] => 
                                        [m_bNoContextParameters:protected] => 
                                        [m_aModifierProperties:protected] => Array
                                            (
                                            )
    
                                        [m_bArchiveMode:protected] => 
                                        [m_bShowObsoleteData:protected] => 1
                                    )
    
                                [m_oSQLResult:protected] => 
                                [m_bSort:protected] => 1
                                [m_aExtendedDataSpec] => 
                                [m_iLimitCount] => 0
                                [m_iLimitStart] => 0
                            )
    
                        [aOriginalObjects:protected] => 
                        [bHasDelta:protected] => 
                        [aPreserved:protected] => Array
                            (
                            )
    
                        [aAdded:protected] => Array
                            (
                            )
    
                        [aModified:protected] => Array
                            (
                            )
    
                        [aRemoved:protected] => Array
                            (
                            )
    
                        [iCursor:protected] => 0
                    )
    
                [public_log] => ormCaseLog Object
                    (
                        [m_sLog:protected] => 
                        [m_aIndex:protected] => Array
                            (
                            )
    
                        [m_bModified:protected] => 
                    )
    
                [user_satisfaction] => 1
                [user_comment] => 
                [finalclass] => A
                [friendlyname] => 
                [org_id_friendlyname] => 
                [org_id_obsolescence_flag] => 
                [caller_id_friendlyname] => 
                [caller_id_obsolescence_flag] => 
                [team_id_friendlyname] => 
                [team_id_obsolescence_flag] => 
                [agent_id_friendlyname] => 
                [agent_id_obsolescence_flag] => 
                [approver_id_friendlyname] => 
                [approver_id_obsolescence_flag] => 
                [service_id_friendlyname] => 
                [servicesubcategory_id_friendlyname] => 
                [parent_request_id_friendlyname] => 
            )
    
        [m_aOrigValues:protected] => Array
            (
                [operational_status] => 
                [ref] => 
                [org_id] => 
                [org_name] => 
                [caller_id] => 
                [caller_name] => 
                [team_id] => 
                [team_name] => 
                [agent_id] => 
                [agent_name] => 
                [title] => 
                [description] => 
                [start_date] => 
                [end_date] => 
                [last_update] => 
                [close_date] => 
                [private_log] => 
                [contacts_list] => 
                [functionalcis_list] => 
                [workorders_list] => 
                [status] => 
                [request_type] => 
                [impact] => 
                [priority] => 
                [urgency] => 
                [origin] => 
                [approver_id] => 
                [approver_email] => 
                [service_id] => 
                [service_name] => 
                [servicesubcategory_id] => 
                [servicesubcategory_name] => 
                [escalation_flag] => 
                [escalation_reason] => 
                [assignment_date] => 
                [resolution_date] => 
                [last_pending_date] => 
                [cumulatedpending] => 
                [tto] => 
                [ttr] => 
                [tto_escalation_deadline] => 
                [sla_tto_passed] => 
                [sla_tto_over] => 
                [ttr_escalation_deadline] => 
                [sla_ttr_passed] => 
                [sla_ttr_over] => 
                [time_spent] => 
                [resolution_code] => 
                [solution] => 
                [pending_reason] => 
                [parent_request_id] => 
                [parent_request_ref] => 
                [related_request_list] => 
                [public_log] => 
                [user_satisfaction] => 
                [user_comment] => 
                [finalclass] => 
                [friendlyname] => 
                [org_id_friendlyname] => 
                [org_id_obsolescence_flag] => 
                [caller_id_friendlyname] => 
                [caller_id_obsolescence_flag] => 
                [team_id_friendlyname] => 
                [team_id_obsolescence_flag] => 
                [agent_id_friendlyname] => 
                [agent_id_obsolescence_flag] => 
                [approver_id_friendlyname] => 
                [approver_id_obsolescence_flag] => 
                [service_id_friendlyname] => 
                [servicesubcategory_id_friendlyname] => 
                [parent_request_id_friendlyname] => 
            )
    
        [m_aExtendedData:protected] => 
        [m_bDirty:DBObject:private] => 1
        [m_bCheckStatus:DBObject:private] => 
        [m_bSecurityIssue:protected] => 
        [m_aCheckIssues:protected] => 
        [m_aDeleteIssues:protected] => 
        [m_bFullyLoaded:DBObject:private] => 
        [m_aLoadedAtt:DBObject:private] => Array
            (
                [operational_status] => 1
                [ref] => 1
                [org_id] => 1
                [caller_id] => 1
                [team_id] => 1
                [agent_id] => 1
                [title] => 1
                [description] => 1
                [start_date] => 1
                [end_date] => 1
                [last_update] => 1
                [close_date] => 1
                [private_log] => 1
                [contacts_list] => 1
                [functionalcis_list] => 1
                [workorders_list] => 1
                [status] => 1
                [request_type] => 1
                [impact] => 1
                [priority] => 1
                [urgency] => 1
                [origin] => 1
                [approver_id] => 1
                [service_id] => 1
                [servicesubcategory_id] => 1
                [escalation_flag] => 1
                [escalation_reason] => 1
                [assignment_date] => 1
                [resolution_date] => 1
                [last_pending_date] => 1
                [cumulatedpending] => 1
                [tto] => 1
                [ttr] => 1
                [tto_escalation_deadline] => 1
                [sla_tto_passed] => 1
                [sla_tto_over] => 1
                [ttr_escalation_deadline] => 1
                [sla_ttr_passed] => 1
                [sla_ttr_over] => 1
                [time_spent] => 1
                [resolution_code] => 1
                [solution] => 1
                [pending_reason] => 1
                [parent_request_id] => 1
                [related_request_list] => 1
                [public_log] => 1
                [user_satisfaction] => 1
                [user_comment] => 1
                [finalclass] => 1
            )
    
        [m_aTouchedAtt:protected] => Array
            (
                [request_type] => 1
            )
    
        [m_aModifiedAtt:protected] => Array
            (
            )
    
        [m_aSynchroData:protected] => 
        [m_sHighlightCode:protected] => 
        [m_aCallbacks:protected] => Array
            (
            )
    )
    

    I have no idea about how to continue my investigation.

    Thank you to help me.

    Regards,

    Rafael.

     

    Last edit: Rafael AINCIART 2019-01-21
  • Pierre Goiffon

    Pierre Goiffon - 2019-01-22

    Hello,
    What do you mean by '"the form appears but it's impossible to submit it" ?
    Are the buttons present at the end of the form dialog ?
    If yes, do you see any JS error in your browser console ?

     
  • Rafael AINCIART

    Rafael AINCIART - 2019-01-23

    Hi Pierre !

    The modal window of the form is normally loaded and, in the code, the corresponding object is created.
    I can see the buttons to save the new Ticket in the bottom of the form.
    The only problem is that I can't save the form : there is no result when I click on the "Apply" button (but it works on the "Cancel" one).
    I have no error message (even if I add the debug=true in the url).
    I use the chrome console to inspect the client side code but I don't see what can be wrong...
    The error messages I can see :
    * GET http://prh2.localhost/env-production/fonts/glyphicons-halflings-regular.woff2 net::ERR_ABORTED 404 (Not Found)
    * GET http://prh2.localhost/env-production/fonts/glyphicons-halflings-regular.woff net::ERR_ABORTED 404 (Not Found)

    The script executed by the button :

    $(document).ready(function(){
            // Form field set declaration
            var oFieldSet_objectformticketcreate5c48332d11a57 = $('#objectform-ticket-create-5c48332d11a57 > .form_fields').field_set({"fields_impacts":{"org_id":["service_id"],"service_id":["servicesubcategory_id"],"request_type":["servicesubcategory_id"]},"form_path":"objectform-ticket-create-5c48332d11a57","fields_list":{"service_id":{"id":"service_id","html":"<div class=\"form-group form_group_small \"><div class=\"form_field_label\"><label for=\"field_service_id_5c48332d2d9cb\" class=\"control-label\">service id<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><div class=\"row\"><div class=\"col-xs-12 col-sm-12 col-md-12\"><select id=\"field_service_id_5c48332d2d9cb\" name=\"service_id\" class=\"form-control\"><option value=\"\">-- choisir une valeur --<\/option><option value=\"1\"  >Analytique<\/option><option value=\"2\"  >Appli Web<\/option><option value=\"3\"  >Conseil l&eacute;gal<\/option><option value=\"4\"  >Droits utilisateurs<\/option><option value=\"5\"  >Fichier de contr&ocirc;le<\/option><option value=\"6\"  >Installations<\/option><option value=\"7\" selected >Utilisateurs<\/option><\/select><\/div><div class=\"col-xs-0 col-sm-0 col-md-0 text-right\"><\/div><\/div><\/div><\/div>","js_inline":" \t\t\t\t\t\t$(\"#field_service_id_5c48332d2d9cb\").off(\"change keyup\").on(\"change keyup\", function(){\n\t\t\t\t\t\t\tvar me = this;\n\n\t\t\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\t\t\tid: $(me).attr(\"id\"),\n\t\t\t\t\t\t\t\tname: $(me).closest(\".form_field\").attr(\"data-field-id\"),\n\t\t\t\t\t\t\t\tvalue: $(me).val()\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$(\"[data-field-id='service_id'][data-form-path='objectform-ticket-create-5c48332d11a57']\").portal_form_field({\n\t\t\t\t\t\t\t'validators': []\n\t\t\t\t\t\t});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"servicesubcategory_id":{"id":"servicesubcategory_id","html":"<div class=\"form-group form_group_small \"><div class=\"form_field_label\"><label for=\"field_servicesubcategory_id_5c48332d3d6cc\" class=\"control-label\">servicesubcategory id<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><div class=\"row\"><div class=\"col-xs-12 col-sm-12 col-md-12\"><select id=\"field_servicesubcategory_id_5c48332d3d6cc\" name=\"servicesubcategory_id\" class=\"form-control\"><option value=\"\">-- choisir une valeur --<\/option><option value=\"5\" selected >Cr&eacute;ation<\/option><option value=\"11\"  >Modification<\/option><option value=\"15\"  >Suppression<\/option><\/select><\/div><div class=\"col-xs-0 col-sm-0 col-md-0 text-right\"><\/div><\/div><\/div><\/div>","js_inline":" \t\t\t\t\t\t$(\"#field_servicesubcategory_id_5c48332d3d6cc\").off(\"change keyup\").on(\"change keyup\", function(){\n\t\t\t\t\t\t\tvar me = this;\n\n\t\t\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\t\t\tid: $(me).attr(\"id\"),\n\t\t\t\t\t\t\t\tname: $(me).closest(\".form_field\").attr(\"data-field-id\"),\n\t\t\t\t\t\t\t\tvalue: $(me).val()\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$(\"[data-field-id='servicesubcategory_id'][data-form-path='objectform-ticket-create-5c48332d11a57']\").portal_form_field({\n\t\t\t\t\t\t\t'validators': []\n\t\t\t\t\t\t});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"impact":{"id":"impact","html":"<div class=\"form-group form_group_small form_mandatory\"><div class=\"form_field_label\"><label for=\"field_impact_5c48332d46eb4\" class=\"control-label\">impact<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><select id=\"field_impact_5c48332d46eb4\" name=\"impact\"  class=\"form-control\"><option value=\"\"  >-- choisir une valeur --<\/option><option value=\"1\" selected >1<\/option><option value=\"2\"  >2<\/option><option value=\"3\"  >3<\/option><\/select><\/div><\/div>","js_inline":"                         \t\t\t\t\t$(\"#field_impact_5c48332d46eb4\").off(\"change keyup\").on(\"change keyup\", function(){\n\t\t\t\t\t\tvar me = this;\n\n\t\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\t\tid: $(me).attr(\"id\"),\n\t\t\t\t\t\t\tname: $(me).closest(\".form_field\").attr(\"data-field-id\"),\n\t\t\t\t\t\t\tvalue: $(me).val()\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n    \t\t\t\t\t$(\"[data-field-id='impact'][data-form-path='objectform-ticket-create-5c48332d11a57']\").portal_form_field({\"validators\":{\"mandatory\":{\"reg_exp\":\".*\\\\S.*\",\"message\":\"Veuillez remplir ce champ\"}}});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"urgency":{"id":"urgency","html":"<div class=\"form-group form_group_small form_mandatory\"><div class=\"form_field_label\"><label for=\"field_urgency_5c48332d49117\" class=\"control-label\">urgency<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><select id=\"field_urgency_5c48332d49117\" name=\"urgency\"  class=\"form-control\"><option value=\"\"  >-- choisir une valeur --<\/option><option value=\"1\"  >1<\/option><option value=\"2\"  >2<\/option><option value=\"3\"  >3<\/option><option value=\"4\" selected >4<\/option><\/select><\/div><\/div>","js_inline":"                         \t\t\t\t\t$(\"#field_urgency_5c48332d49117\").off(\"change keyup\").on(\"change keyup\", function(){\n\t\t\t\t\t\tvar me = this;\n\n\t\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\t\tid: $(me).attr(\"id\"),\n\t\t\t\t\t\t\tname: $(me).closest(\".form_field\").attr(\"data-field-id\"),\n\t\t\t\t\t\t\tvalue: $(me).val()\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n    \t\t\t\t\t$(\"[data-field-id='urgency'][data-form-path='objectform-ticket-create-5c48332d11a57']\").portal_form_field({\"validators\":{\"mandatory\":{\"reg_exp\":\".*\\\\S.*\",\"message\":\"Veuillez remplir ce champ\"}}});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"title":{"id":"title","html":"<div class=\"form-group form_group_small form_mandatory\"><div class=\"form_field_label\"><label for=\"field_title_5c48332d4ba4d\" class=\"control-label\">Titre<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><input type=\"text\" id=\"field_title_5c48332d4ba4d\" name=\"title\" value=\"\" class=\"form-control\" maxlength=\"255\" \/><\/div><\/div>","js_inline":"                         \t\t\t\t\t$(\"#field_title_5c48332d4ba4d\").off(\"change keyup\").on(\"change keyup\", function(){\n\t\t\t\t\t\tvar me = this;\n\n\t\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\t\tid: $(me).attr(\"id\"),\n\t\t\t\t\t\t\tname: $(me).closest(\".form_field\").attr(\"data-field-id\"),\n\t\t\t\t\t\t\tvalue: $(me).val()\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n    \t\t\t\t\t$(\"[data-field-id='title'][data-form-path='objectform-ticket-create-5c48332d11a57']\").portal_form_field({\"validators\":{\"mandatory\":{\"reg_exp\":\".*\\\\S.*\",\"message\":\"Veuillez remplir ce champ\"}}});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"description":{"id":"description","html":"<div class=\"form-group form_mandatory\"><div class=\"form_field_label\"><label for=\"field_description_5c48332d4cbd0\" class=\"control-label\">Description<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><div><textarea id=\"field_description_5c48332d4cbd0\" name=\"description\" class=\"form-control\" rows=\"8\"><\/textarea><\/div><\/div><\/div>","js_inline":" \t\t\t\t\t\t\t$('#field_description_5c48332d4cbd0').addClass('htmlEditor');\n\t\t\t\t\t\t\t$('#field_description_5c48332d4cbd0').ckeditor(function(){}, {language: 'fr fr', contentsLanguage: 'fr fr'});\n\t\t\/\/ Hook the file upload of all CKEditor instances\n\t\t$('.htmlEditor').each(function() {\n\t\t\tvar oEditor = $(this).ckeditorGet();\n\t\t\toEditor.config.extraPlugins = 'font,uploadimage';\n\t\t\toEditor.config.uploadUrl = 'http:\/\/prh2.localhost\/'+'pages\/ajax.render.php';\n\t\t\toEditor.config.filebrowserBrowseUrl = 'http:\/\/prh2.localhost\/'+'pages\/ajax.render.php?operation=cke_browse&temp_id=1sgctap661qgcflo8hgta6v0av_0072506001548235565&obj_class=Informatique&obj_key=-2';\n\t\t\toEditor.on( 'fileUploadResponse', function( evt ) {\n\t\t\t\tvar fileLoader = evt.data.fileLoader;\n\t\t\t\tvar xhr = fileLoader.xhr;\n\t\t\t\tvar data = evt.data;\n\t\t\t\ttry {\n\t\t\t        var response = JSON.parse( xhr.responseText );\n\t\t\n\t\t\t        \/\/ Error message does not need to mean that upload finished unsuccessfully.\n\t\t\t        \/\/ It could mean that ex. file name was changes during upload due to naming collision.\n\t\t\t        if ( response.error && response.error.message ) {\n\t\t\t            data.message = response.error.message;\n\t\t\t        }\n\t\t\n\t\t\t        \/\/ But !uploaded means error.\n\t\t\t        if ( !response.uploaded ) {\n\t\t\t            evt.cancel();\n\t\t\t        } else {\n\t\t\t            data.fileName = response.fileName;\n\t\t\t           \tdata.url = response.url;\n\t\t\t\t\t\t\n\t\t\t            \/\/ Do not call the default listener.\n\t\t\t            evt.stop();\n\t\t\t        }\n\t\t\t    } catch ( err ) {\n\t\t\t        \/\/ Response parsing error.\n\t\t\t        data.message = fileLoader.lang.filetools.responseError;\n\t\t\t        window.console && window.console.log( xhr.responseText );\n\t\t\n\t\t\t        evt.cancel();\n\t\t\t    }\n\t\t\t} );\n\t\n\t\t\toEditor.on( 'fileUploadRequest', function( evt ) {\n\t\t\t\tevt.data.fileLoader.uploadUrl += '?operation=cke_img_upload&temp_id=1sgctap661qgcflo8hgta6v0av_0072506001548235565&obj_class=Informatique';\n\t\t\t}, null, null, 4 ); \/\/ Listener with priority 4 will be executed before priority 5.\n\t\t\n\t\t\toEditor.on( 'instanceReady', function() {\n\t\t\t\tif(!CKEDITOR.env.iOS && $('#'+oEditor.id+'_toolbox .editor_magnifier').length == 0)\n\t\t\t\t{\n\t\t\t\t\t$('#'+oEditor.id+'_toolbox').append('<span class=\"editor_magnifier\" title=\"Agrandir \/ Minimiser\" style=\"display:block;width:12px;height:11px;border:1px #A6A6A6 solid;cursor:pointer; background-image:url(\\'http:\/\/prh2.localhost\/\/images\/full-screen.png\\')\">&nbsp;<\/span>');\n\t\t\t\t\t$('#'+oEditor.id+'_toolbox .editor_magnifier').on('click', function() {\n\t\t\t\t\t\t\toEditor.execCommand('maximize');\n\t\t\t\t\t\t\tif ($(this).closest('.cke_maximized').length != 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$('#'+oEditor.id+'_toolbar_collapser').trigger('click');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (oEditor.widgets.registered.uploadimage)\n\t\t\t\t{\n\t\t\t\t\toEditor.widgets.registered.uploadimage.onUploaded = function( upload ) {\n\t\t\t\t\tvar oData = JSON.parse(upload.xhr.responseText);\n\t\t\t\t    \tthis.replaceWith( '<img src=\"' + upload.url + '\" ' +\n\t\t\t\t    \t\t'width=\"' + oData.width + '\" ' +\n\t\t\t\t\t\t\t'height=\"' + oData.height + '\">' );\n\t\t\t\t    }\n\t\t\t\t}\n\t\t\t});\n\t\t});\n                        \t\t\t\t\t$(\"#field_description_5c48332d4cbd0\").off(\"change keyup\").on(\"change keyup\", function(){\n\t\t\t\t\t\tvar me = this;\n\n\t\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\t\tid: $(me).attr(\"id\"),\n\t\t\t\t\t\t\tname: $(me).closest(\".form_field\").attr(\"data-field-id\"),\n\t\t\t\t\t\t\tvalue: $(me).val()\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n                            $(\"[data-field-id='description'][data-form-path='objectform-ticket-create-5c48332d11a57']\").portal_form_field_html({\n                            validators: {\"mandatory\":{\"reg_exp\":\".*\\\\S.*\",\"message\":\"Veuillez remplir ce champ\"}},\n                            set_current_value_callback: function(me, oEvent, oData){ $(me.element).find('textarea').val(oData); }\n                        });\n$('img[data-img-id]').each(function() {\n\tif ($(this).width() > 250)\n\t{\n\t\t$(this).css({'max-width': '250px', width: '', height: '', 'max-height': ''});\n\t}\n\t$(this).addClass('inline-image').attr('href', $(this).attr('src'));\n}).magnificPopup({type: 'image', closeOnContentClick: true });\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"contacts_list":{"id":"contacts_list","html":"<div class=\"form-group \"><label for=\"field_contacts_list_5c48332d4e09b\" class=\"control-label\"><a id=\"form_linkedset_toggler_field_contacts_list_5c48332d4e09b\" class=\"form_linkedset_toggler collapsed\" data-toggle=\"collapse\" href=\"#form_linkedset_wrapper_field_contacts_list_5c48332d4e09b\" aria-expanded=\"false\" aria-controls=\"form_linkedset_wrapper_field_contacts_list_5c48332d4e09b\">Contacts<span class=\"text\">0<\/span><span class=\"glyphicon glyphicon-menu-down collapsed\"><\/><\/a><\/label><div class=\"help-block\"><\/div>\t\t\t\t<div class=\"form_linkedset_wrapper collapse\" id=\"form_linkedset_wrapper_field_contacts_list_5c48332d4e09b\">\n\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t<div class=\"col-xs-12\">\n\t\t\t\t\t\t\t<input type=\"hidden\" id=\"field_contacts_list_5c48332d4e09b\" name=\"contacts_list\" value=\"{&quot;current&quot;:[]}\" \/>\n\t\t\t\t\t\t\t<table id=\"table_field_contacts_list_5c48332d4e09b\" data-field-id=\"contacts_list\" class=\"table table-striped table-bordered responsive\" cellspacing=\"0\" width=\"100%\">\n\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<\/tbody>\n\t\t\t\t\t\t\t<\/table>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t<div class=\"col-xs-12\">\n\t\t\t\t\t\t\t<div class=\"btn-group\" role=\"group\">\n\t\t\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-sm btn-danger\" id=\"btn_remove_field_contacts_list_5c48332d4e09b\" title=\"Enlever\" disabled><span class=\"glyphicon glyphicon-minus\"><\/span><\/button>\n\t\t\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-sm btn-default\" id=\"btn_add_field_contacts_list_5c48332d4e09b\" title=\" Ajouter... \"><span class=\"glyphicon glyphicon-plus\"><\/span><\/button>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div><\/div><\/div>","js_inline":" \t\t\t\t\/\/ Collapse handlers\n\t\t\t\t\/\/ - Collapsing by default to optimize form space\n\t\t\t\t\/\/ It would be better to be able to construct the widget as collapsed, but in this case, datatables thinks the container is very small and therefore renders the table as if it was in microbox.\n\t\t\t\t$('#form_linkedset_wrapper_field_contacts_list_5c48332d4e09b').collapse({toggle: false});\n\t\t\t\t\/\/ - Change toggle icon class\n\t\t\t\t$('#form_linkedset_wrapper_field_contacts_list_5c48332d4e09b').on('shown.bs.collapse', function(){\n\t\t\t\t\t\/\/ Creating the table if null (first expand). If we create it on start, it will be displayed as if it was in a micro screen due to the div being \"display: none;\"\n\t\t\t\t\tif(oTable_field_contacts_list_5c48332d4e09b === undefined)\n\t\t\t\t\t{\n\t\t\t\t\t\tbuildTable_field_contacts_list_5c48332d4e09b();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.on('show.bs.collapse', function(){\n\t\t\t\t\t$('#form_linkedset_toggler_field_contacts_list_5c48332d4e09b > span.glyphicon').removeClass('glyphicon-menu-down collapsed').addClass('glyphicon-menu-down');\n\t\t\t\t})\n\t\t\t\t.on('hide.bs.collapse', function(){\n\t\t\t\t\t$('#form_linkedset_toggler_field_contacts_list_5c48332d4e09b > span.glyphicon').removeClass('glyphicon-menu-down').addClass('glyphicon-menu-down collapsed');\n\t\t\t\t});\n\n\t\t\t\t\/\/ Places a loader in the empty datatables\n\t\t\t\t$('#table_field_contacts_list_5c48332d4e09b > tbody').html('<tr><td class=\"datatables_overlay\" colspan=\"100\">' + $('#page_overlay').html() + '<\/td><\/tr>');\n\n\t\t\t\t\/\/ Prepares data for datatables\n\t\t\t\tvar oColumnProperties_field_contacts_list_5c48332d4e09b = {\"friendlyname\":\"Nom complet\",\"status\":\"Statut\",\"org_id\":\"Organisation\",\"function\":\"Fonction\"};\n\t\t\t\tvar oRawDatas_field_contacts_list_5c48332d4e09b = [];\n\t\t\t\tvar oTable_field_contacts_list_5c48332d4e09b;\n\t\t\t\tvar oSelectedItems_field_contacts_list_5c48332d4e09b = {};\n\n\t\t\t\tvar getColumnsDefinition_field_contacts_list_5c48332d4e09b = function()\n\t\t\t\t{\n\t\t\t\t\tvar aColumnsDefinition = [];\n\n\t\t\t\t\tif(true)\n\t\t\t\t\t{\n\t\t\t\t\t\taColumnsDefinition.push({\n\t\t\t\t\t\t\t\t\"width\": \"auto\",\n\t\t\t\t\t\t\t\t\"searchable\": false,\n\t\t\t\t\t\t\t\t\"sortable\": false,\n\t\t\t\t\t\t\t\t\"title\": '<span class=\"row_input\"><input type=\"checkbox\" id=\"field_contacts_list_5c48332d4e09b_check_all\" name=\"field_contacts_list_5c48332d4e09b_check_all\" title=\"Tout cocher \/ Tout d&eacute;cocher\" \/><\/span>',\n\t\t\t\t\t\t\t\t\"type\": \"html\",\n\t\t\t\t\t\t\t\t\"data\": \"\",\n\t\t\t\t\t\t\t\t\"render\": function(data, type, row)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar oCheckboxElem = $('<span class=\"row_input\"><input type=\"checkbox\" name=\"field_contacts_list_5c48332d4e09b\" \/><\/span>');\n\t\t\t\t\t\t\t\t\toCheckboxElem.find(':input').attr('data-object-id', row.id).attr('data-target-object-id', row.target_id);\n\t\t\t\t\t\t\t\t\treturn oCheckboxElem.prop('outerHTML');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tfor(sKey in oColumnProperties_field_contacts_list_5c48332d4e09b)\n\t\t\t\t\t{\n\t\t\t\t\t\t\/\/ Level main column\n\t\t\t\t\t\taColumnsDefinition.push({\n\t\t\t\t\t\t\t\"width\": \"auto\",\n\t\t\t\t\t\t\t\"searchable\": true,\n\t\t\t\t\t\t\t\"sortable\": true,\n\t\t\t\t\t\t\t\"title\": oColumnProperties_field_contacts_list_5c48332d4e09b[sKey],\n\t\t\t\t\t\t\t\"defaultContent\": \"\",\n\t\t\t\t\t\t\t\"type\": \"html\",\n\t\t\t\t\t\t\t\"data\": \"attributes.\"+sKey+\".att_code\",\n\t\t\t\t\t\t\t\"render\": function(data, type, row){\n\t\t\t\t\t\t\t\tvar cellElem;\n\n\t\t\t\t\t\t\t\t\/\/ Preparing the cell data\n\t\t\t\t\t\t\t\tif(row.attributes[data].url !== undefined)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcellElem = $('<a><\/a>');\n\t\t\t\t\t\t\t\t\tcellElem.attr('href', row.attributes[data].url);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcellElem = $('<span><\/span>');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcellElem.html('<span>' + row.attributes[data].value + '<\/span>');\n\n\t\t\t\t\t\t\t\treturn cellElem.prop('outerHTML');\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\treturn aColumnsDefinition;\n\t\t\t\t};\n\n\t\t\t\t\/\/ Helper to build the datatable\n\t\t\t\t\/\/ Note : Those options should be externalized in an library so we can use them on any DataTables for the portal.\n\t\t\t\t\/\/ We would just have to override \/ complete the necessary elements\n\t\t\t\tvar buildTable_field_contacts_list_5c48332d4e09b = function()\n\t\t\t\t{\n\t\t\t\t\tvar iDefaultOrderColumnIndex = (true) ? 1 : 0;\n\n\t\t\t\t\t\/\/ Instanciates datatables\n\t\t\t\t\toTable_field_contacts_list_5c48332d4e09b = $('#table_field_contacts_list_5c48332d4e09b').DataTable({\n\t\t\t\t\t\t\"language\": {\n\t\t\t\t\t\t\t\"emptyTable\":\t  \"La liste est vide, utilisez le bouton &quot;Ajouter...&quot; pour ajouter des objets.\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"displayLength\": -1,\n\t\t\t\t\t\t\"scrollY\": \"300px\",\n\t\t\t\t\t\t\"scrollCollapse\": true,\n\t\t\t\t\t\t\"retrieve\": true,\n\t\t\t\t\t\t\"order\": [[iDefaultOrderColumnIndex, \"asc\"]],\n\t\t\t\t\t\t\"dom\": 't',\n\t\t\t\t\t\t\"columns\": getColumnsDefinition_field_contacts_list_5c48332d4e09b(),\n\t\t\t\t\t\t\"select\": {\"style\": \"multi\"},\n\t\t\t\t\t\t\"rowId\": \"id\",\n\t\t\t\t\t\t\"data\": oRawDatas_field_contacts_list_5c48332d4e09b,\n\t\t\t\t\t\t\"rowCallback\": function(oRow, oData){\n\t\t\t\t\t\t\t\/\/ Opening in a new modal on click\n\t\t\t\t\t\t\t$(oRow).find('a').off('click').on('click', function(oEvent){\n\t\t\t\t\t\t\t\t\/\/ Prevents link opening.\n\t\t\t\t\t\t\t\toEvent.preventDefault();\n\t\t\t\t\t\t\t\t\/\/ Prevents row selection\n\t\t\t\t\t\t\t\toEvent.stopPropagation();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\/\/ Note : This could be better if we check for an existing modal first instead of always creating a new one\n\t\t\t\t\t\t\t\tvar oModalElem = $('#modal-for-all').clone();\n\t\t\t\t\t\t\t\toModalElem.attr('id', '').appendTo('body');\n\t\t\t\t\t\t\t\t\/\/ Loading content\n\t\t\t\t\t\t\t\toModalElem.find('.modal-content').html($('#page_overlay .overlay_content').html());\n\t\t\t\t\t\t\t\toModalElem.find('.modal-content').load(\n\t\t\t\t\t\t\t\t\t$(this).attr('href'),\n\t\t\t\t\t\t\t\t\t{},\n\t\t\t                        function(sResponseText, sStatus, oXHR){\n\t\t\t                            \/\/ Hiding modal in case of error as the general AJAX error handler will display a message\n\t\t\t                            if(sStatus === 'error')\n\t\t\t                            {\n\t\t\t                                oModalElem.modal('hide');\n\t\t\t                            }\n\t\t\t                        }\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\toModalElem.modal('show');\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\/\/ Handles items selection\/deselection\n\t\t\t\t\t\/\/ - Directly on the table\n\t\t\t\t\toTable_field_contacts_list_5c48332d4e09b.off('select').on('select', function(oEvent, dt, type, indexes){\n\t\t\t\t\t\tvar aData = oTable_field_contacts_list_5c48332d4e09b.rows(indexes).data().toArray();\n\n\t\t\t\t\t\t\/\/ Checking input\n\t\t\t\t\t\t$('#table_field_contacts_list_5c48332d4e09b tbody tr[role=\"row\"].selected td:first-child input').prop('checked', true);\n\t\t\t\t\t\t\/\/ Saving values in temp array\n\t\t\t\t\t\tfor(var i in aData)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar iItemId = aData[i].id;\n\t\t\t\t\t\t\tif(!(iItemId in oSelectedItems_field_contacts_list_5c48332d4e09b))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\toSelectedItems_field_contacts_list_5c48332d4e09b[iItemId] = aData[i].name;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\/\/ Updating remove button\n\t\t\t\t\t\tupdateRemoveButtonState_field_contacts_list_5c48332d4e09b();\n\t\t\t\t\t});\n\t\t\t\t\toTable_field_contacts_list_5c48332d4e09b.off('deselect').on('deselect', function(oEvent, dt, type, indexes){\n\t\t\t\t\t\tvar aData = oTable_field_contacts_list_5c48332d4e09b.rows(indexes).data().toArray();\n\n\t\t\t\t\t\t\/\/ Checking input\n\t\t\t\t\t\t$('#table_field_contacts_list_5c48332d4e09b tbody tr[role=\"row\"]:not(.selected) td:first-child input').prop('checked', false);\n\t\t\t\t\t\t\/\/ Saving values in temp array\n\t\t\t\t\t\tfor(var i in aData)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar iItemId = aData[i].id;\n\t\t\t\t\t\t\tif(iItemId in oSelectedItems_field_contacts_list_5c48332d4e09b)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdelete oSelectedItems_field_contacts_list_5c48332d4e09b[iItemId];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\/\/ Unchecking global checkbox\n\t\t\t\t\t\t$('#field_contacts_list_5c48332d4e09b_check_all').prop('checked', false);\n\t\t\t\t\t\t\/\/ Updating remove button\n\t\t\t\t\t\tupdateRemoveButtonState_field_contacts_list_5c48332d4e09b();\n\t\t\t\t\t});\n\t\t\t\t\t\/\/ - From the global button\n\t\t\t\t\t$('#field_contacts_list_5c48332d4e09b_check_all').off('click').on('click', function(oEvent){\n\t\t\t\t\t\tif($(this).prop('checked'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toTable_field_contacts_list_5c48332d4e09b.rows().select();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toTable_field_contacts_list_5c48332d4e09b.rows().deselect();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tupdateRemoveButtonState_field_contacts_list_5c48332d4e09b();\n\t\t\t\t\t});\n\t\t\t\t};\n                $(\"[data-field-id='contacts_list'][data-form-path='objectform-ticket-create-5c48332d11a57']\").portal_form_field({\n\t\t\t\t\t'validators': [],\n\t\t\t\t\t'get_current_value_callback': function(me, oEvent, oData){\n\t\t\t\t\t\tvar value = null;\n\n\t\t\t\t\t\t\/\/ Retrieving JSON value as a string and not an object\n\t\t\t\t\t\t\/\/\n\t\t\t\t\t\t\/\/ Note : The value is passed as a string instead of an array because the attribute would not be included in the posted data when empty.\n\t\t\t\t\t\t\/\/ Which was an issue when deleting all objects from linkedset\n\t\t\t\t\t\t\/\/\n\t\t\t\t\t\t\/\/ Old code : value = JSON.parse(me.element.find('#field_contacts_list_5c48332d4e09b').val());\n\t\t\t\t\t\tvalue = me.element.find('#field_contacts_list_5c48332d4e09b').val();\n\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t},\n\t\t\t\t\t'set_current_value_callback': function(me, oEvent, oData){\n\t\t\t\t\t\t\/\/ When we have data (meaning that we picked objects from search)\n\t\t\t\t\t\tif(oData !== undefined && Object.keys(oData.values).length > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\/\/ Showing loader while retrieving informations\n\t\t\t\t\t\t\t$('#page_overlay').fadeIn(200);\n\n\t\t\t\t\t\t\t\/\/ Retrieving new rows ids\n\t\t\t\t\t\t\tvar aObjectIds = Object.keys(oData.values);\n\n\t\t\t\t\t\t\t\/\/ Retrieving rows informations so we can add them\n\t\t\t\t\t\t\t$.post(\n\t\t\t\t\t\t\t\t'\/pages\/exec.php\/object\/get-informations\/json?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tsObjectClass: 'Contact',\n\t\t\t\t\t\t\t\t\taObjectIds: aObjectIds,\n\t\t\t\t\t\t\t\t\taObjectAttCodes: [\"friendlyname\",\"status\",\"org_id\",\"function\"]\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction(oData){\n\t\t\t\t\t\t\t\t\t\/\/ Updating datatables\n\t\t\t\t\t\t\t\t\tif(oData.items !== undefined)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t    for(var i in oData.items)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\/\/ Adding target item id information\n\t\t\t\t\t\t\t\t\t\t\toData.items[i].target_id = oData.items[i].id;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\/\/ Adding item to table only if it's not already there\n\t\t\t\t\t\t\t\t\t\t\tif($('#table_field_contacts_list_5c48332d4e09b tr[role=\"row\"] > td input[data-target-object-id=\"' + oData.items[i].target_id + '\"], #table_field_contacts_list_5c48332d4e09b tr[role=\"row\"] > td input[data-target-object-id=\"' + (oData.items[i].target_id*-1) + '\"]').length === 0)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\/\/ Making id negative in order to recognize it when persisting\n\t\t\t\t\t\t\t\t\t\t\t\toData.items[i].id = -1 * parseInt(oData.items[i].id);\n\t\t\t\t\t\t\t\t\t\t\t\toTable_field_contacts_list_5c48332d4e09b.row.add(oData.items[i]);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\toTable_field_contacts_list_5c48332d4e09b.draw();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\/\/ Updating input\n\t\t\t\t\t\t                updateInputValue_field_contacts_list_5c48332d4e09b();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.done(function(oData){\n\t\t\t\t\t\t\t\t\/\/ Updating items count\n\t\t\t\t\t\t\t\tupdateItemCount_field_contacts_list_5c48332d4e09b();\n\t\t\t\t\t\t\t\t\/\/ Updating global checkbox\n\t\t\t\t\t\t\t\t$('#field_contacts_list_5c48332d4e09b_check_all').prop('checked', false);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.always(function(oData){\n\t\t\t\t\t\t\t\t\/\/ Hiding loader\n\t\t\t\t\t\t\t\t$('#page_overlay').fadeOut(200);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\/\/ We come from a button\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t    \/\/ Updating input\n\t\t\t\t\t\t    updateInputValue_field_contacts_list_5c48332d4e09b();\n\t\t\t\t\t\t\t\/\/ Updating items count\n\t\t\t\t\t\t\tupdateItemCount_field_contacts_list_5c48332d4e09b();\n\t\t\t\t\t\t\t\/\/ Updating global checkbox\n\t\t\t\t\t\t\t$('#field_contacts_list_5c48332d4e09b_check_all').prop('checked', false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\t\/\/ Handles items selection\/deselection\n\t\t\t\t\t\/\/ - Remove button state handler\n\t\t\t\t\tvar updateRemoveButtonState_field_contacts_list_5c48332d4e09b = function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar bIsDisabled = (Object.keys(oSelectedItems_field_contacts_list_5c48332d4e09b).length == 0);\n\t\t\t\t\t\t$('#btn_remove_field_contacts_list_5c48332d4e09b').prop('disabled', bIsDisabled);\n\t\t\t\t\t};\n\t\t\t\t\t\/\/ - Item count state handler\n\t\t\t\t\tvar updateItemCount_field_contacts_list_5c48332d4e09b = function()\n\t\t\t\t\t{\n\t\t\t\t\t\t$('#form_linkedset_toggler_field_contacts_list_5c48332d4e09b > .text').text( oTable_field_contacts_list_5c48332d4e09b.rows().count() );\n\t\t\t\t\t};\n\t\t\t\t\t\/\/ - Field input handler\n\t\t\t\t\tvar updateInputValue_field_contacts_list_5c48332d4e09b = function()\n\t\t\t\t\t{\n\t\t\t\t\t    \/\/ Retrieving table rows\n\t\t\t\t\t    var aData = oTable_field_contacts_list_5c48332d4e09b.rows().data().toArray();\n\t\t\t\t\t    \n\t\t\t\t\t    \/\/ Retrieving input values\n                        var oValues = JSON.parse($('#field_contacts_list_5c48332d4e09b').val());\n                        oValues.add = {};\n                        oValues.remove = {};\n                        \n\t\t\t\t\t    \/\/ Checking removed objects\n\t\t\t\t\t    for(var i in oValues.current)\n\t\t\t\t\t    {\n\t\t\t\t\t        if($('#table_field_contacts_list_5c48332d4e09b tr[role=\"row\"] input[data-object-id=\"'+i+'\"]').length === 0)\n                            {\n                                oValues.remove[i] = {};\n                            }\n\t\t\t\t\t    }\n\t\t\t\t\t    \n\t\t\t\t\t    \/\/ Checking added objects\n\t\t\t\t\t    for(var i in aData)\n\t\t\t\t\t    {\n\t\t\t\t\t        if(oValues.current[aData[i].id] === undefined)\n\t\t\t\t\t        {\n\t\t\t\t\t            oValues.add[aData[i].target_id] = {};\n                            }\n\t\t\t\t\t    }\n\t\t\t\t\t    \n                        \/\/ Setting input values\n                        $('#field_contacts_list_5c48332d4e09b').val(JSON.stringify(oValues));\n\t\t\t\t\t};\n\n\t\t\t\t\t\/\/ Handles items remove\/add\n\t\t\t\t\t$('#btn_remove_field_contacts_list_5c48332d4e09b').off('click').on('click', function(){\n\t\t\t\t\t\t\/\/ Removing items from table\n\t\t\t\t\t\toTable_field_contacts_list_5c48332d4e09b.rows({selected: true}).remove().draw();\n\t\t\t\t\t\t\/\/ Resetting selected items\n\t\t\t\t\t\toSelectedItems_field_contacts_list_5c48332d4e09b = {};\n\t\t\t\t\t\t\/\/ Updating form value\n\t\t\t\t\t\t$(\"[data-field-id='contacts_list'][data-form-path='objectform-ticket-create-5c48332d11a57']\").triggerHandler('set_current_value');\n\t\t\t\t\t\t\/\/ Updating global checkbox state\n\t\t\t\t\t\t$('#field_contacts_list_5c48332d4e09b_check_all').prop('checked', false);\n\t\t\t\t\t\t\/\/ Updating remove button\n\t\t\t\t\t\tupdateRemoveButtonState_field_contacts_list_5c48332d4e09b();\n\t\t\t\t\t});\n\t\t\t\t\t$('#btn_add_field_contacts_list_5c48332d4e09b').off('click').on('click', function(){\n\t\t\t\t\t\t\/\/ Preparing current values\n\t\t\t\t\t\tvar aObjectIdsToIgnore = [];\n\t\t\t\t\t\t$('#table_field_contacts_list_5c48332d4e09b tr[role=\"row\"] > td input[data-target-object-id]').each(function(iIndex, oElem){\n\t\t\t\t\t\t\taObjectIdsToIgnore.push( $(oElem).attr('data-target-object-id') );\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\/\/ Creating a new modal\n\t\t\t\t\t\tvar oModalElem;\n\t\t\t\t\t\tif($('.modal[data-source-element=\"btn_add_field_contacts_list_5c48332d4e09b\"]').length === 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toModalElem = $('#modal-for-all').clone();\n\t\t\t\t\t\t\toModalElem.attr('id', '').attr('data-source-element', 'btn_add_field_contacts_list_5c48332d4e09b').appendTo('body');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toModalElem = $('.modal[data-source-element=\"btn_add_field_contacts_list_5c48332d4e09b\"]').first();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\/\/ Resizing to small modal\n\t\t\t\t\t\toModalElem.find('.modal-dialog').removeClass('modal-sm').addClass('modal-lg');\n\t\t\t\t\t\t\/\/ Loading content\n\t\t\t\t\t\toModalElem.find('.modal-content').html($('#page_overlay .overlay_content').html());\n\t\t\t\t\t\toModalElem.find('.modal-content').load(\n\t\t\t\t\t\t\t'\/pages\/exec.php\/object\/search\/from-attribute\/contacts_list\/Informatique?ar_token=eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIyIiwiU2VydmljZSI6IjciLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiI1In19&exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsFormPath: 'objectform-ticket-create-5c48332d11a57',\n\t\t\t\t\t\t\t\tsFieldId: 'contacts_list',\n\t\t\t\t\t\t\t\taObjectIdsToIgnore : aObjectIdsToIgnore\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfunction(sResponseText, sStatus, oXHR){\n\t\t\t\t\t\t\t    \/\/ Hiding modal in case of error as the general AJAX error handler will display a message\n\t\t\t\t\t\t\t    if(sStatus === 'error')\n\t\t\t\t\t\t\t    {\n\t\t\t\t\t\t\t        oModalElem.modal('hide');\n\t\t\t\t\t\t\t    }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\toModalElem.modal('show');\n\t\t\t\t\t});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"org_id":{"id":"org_id","html":"<div class=\"form-group form_group_small\"><input type=\"hidden\" id=\"field_org_id_5c48332d556ff\" name=\"org_id\" value=\"220\" class=\"form-control\" \/><\/div>","js_inline":"","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"request_type":{"id":"request_type","html":"<div class=\"form-group form_group_small\"><input type=\"hidden\" id=\"field_request_type_5c48332d57d74\" name=\"request_type\" value=\"\" class=\"form-control\" \/><\/div>","js_inline":"     \t\t\t\t\t$(\"[data-field-id='request_type'][data-form-path='objectform-ticket-create-5c48332d11a57']\").portal_form_field({\"validators\":{\"mandatory\":{\"reg_exp\":\".*\\\\S.*\",\"message\":\"Veuillez remplir ce champ\"}}});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"attachments_for_form_objectform-ticket-create-5c48332d11a57":{"id":"attachments_for_form_objectform-ticket-create-5c48332d11a57","html":"<div class=\"form-group\"><div class=\"form_field_label\"><label for=\"field_attachments_for_form_objectform-ticket-create-5c48332d11a57_5c48332d5a3ff\" class=\"control-label\">Pi&egrave;ces jointes<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><div class=\"fileupload_field_content\"><div class=\"attachments_container row\"><\/div><div class=\"upload_container row\">Ajouter une pi\u00e8ce jointe: <input type=\"file\" id=\"field_attachments_for_form_objectform-ticket-create-5c48332d11a57_5c48332d5a3ff\" name=\"attachments_for_form_objectform-ticket-create-5c48332d11a57\" \/><span class=\"loader glyphicon glyphicon-refresh\"><\/span>(Taille de fichier max.: 24.00 Mb)<\/div><\/div><\/div><\/div>","js_inline":" \t\t\tvar RemoveAttachment = function(sAttId)\n\t\t\t{\n\t\t\t\t$('#attachment_' + sAttId).attr('name', 'removed_attachments[]');\n\t\t\t\t$('#display_attachment_' + sAttId).hide();\n\t\t\t};\n\n\t\t\t$('#field_attachments_for_form_objectform-ticket-create-5c48332d11a57_5c48332d5a3ff').fileupload({\n\t\t\t\turl: '\/pages\/exec.php\/object\/attachment\/add?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal',\n\t\t\t\tformData: { operation: 'add', temp_id: '1sgctap661qgcflo8hgta6v0av_0072506001548235565', object_class: 'Informatique', 'field_name': 'attachments_for_form_objectform-ticket-create-5c48332d11a57' },\n\t\t\t\tdataType: 'json',\n\t\t\t\tpasteZone: null, \/\/ Don't accept files via Chrome's copy\/paste\n\t\t\t\tdone: function (e, data) {\n\t\t\t\t\tif((data.result.error !== undefined) && window.console)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(data.result.error);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar sDownloadLink = '\/pages\/exec.php\/object\/attachment\/download\/-sAttachmentId-?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal'.replace(\/-sAttachmentId-\/, data.result.att_id);\n\n\t\t\t\t\t\t$(this).closest('.fileupload_field_content').find('.attachments_container').append(\n\t\t\t\t\t\t\t'<div class=\"attachment col-xs-6 col-sm-3 col-md-2\" id=\"display_attachment_'+data.result.att_id+'\">'+\n\t\t\t\t\t\t\t'\t<a data-preview=\"'+data.result.preview+'\" href=\"'+sDownloadLink+'\" title=\"'+data.result.msg+'\">'+\n\t\t\t\t\t\t\t'\t\t<div class=\"attachment_icon\"><img src=\"'+data.result.icon+'\"><\/div>'+\n\t\t\t\t\t\t\t'\t\t<div class=\"attachment_name\">'+data.result.msg+'<\/div>'+\n\t\t\t\t\t\t\t'\t\t<input id=\"attachment_'+data.result.att_id+'\" type=\"hidden\" name=\"attachments[]\" value=\"'+data.result.att_id+'\"\/>'+\n\t\t\t\t\t\t\t'\t<\/a>'+\n\t\t\t\t\t\t\t'\t<input type=\"button\" class=\"btn btn-xs btn-danger hidden\" value=\"Supprimer\"\/>'+\n\t\t\t\t\t\t\t'<\/div>'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\/\/ Preview tooltip\n\t\t\t\t\t\tif(data.result.preview){\n\t\t\t\t\t\t\t$('#display_attachment_'+data.result.att_id).tooltip({\n\t\t\t\t\t\t\t\thtml: true,\n\t\t\t\t\t\t\t\ttitle: function(){ return '<img src=\"'+sDownloadLink+'\" style=\"max-width: 100%;\" \/>'; }\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\/\/ Showing remove button on hover\n\t\t\t\t\t\t$('#display_attachment_'+data.result.att_id).hover( function(){\n\t\t\t\t\t\t\t$(this).children(':button').toggleClass('hidden');\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\/\/ Remove button handler\n\t\t\t\t\t\t$('#display_attachment_'+data.result.att_id+' :button').click(function(oEvent){\n\t\t\t\t\t\t\toEvent.preventDefault();\n\t\t\t\t\t\t\tRemoveAttachment(data.result.att_id);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tstart: function() {\n\t\t\t\t\t\/\/ Scrolling to dropzone so the user can see that attachments are uploaded\n\t\t\t\t\t$(this)[0].scrollIntoView();\n\t\t\t\t\t\/\/ Showing loader\n\t\t\t\t\t$(this).closest('.upload_container').find('.loader').css('visibility', 'visible');\n\t\t\t\t},\n\t\t\t\tstop: function() {\n\t\t\t\t\t\/\/ Hiding the loader\n\t\t\t\t\t$(this).closest('.upload_container').find('.loader').css('visibility', 'hidden');\n\t\t\t\t\t\/\/ Adding this field to the touched fields of the field set so the cancel event is called if necessary\n\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\tid: 'field_attachments_for_form_objectform-ticket-create-5c48332d11a57_5c48332d5a3ff',\n\t\t\t\t\t\tname: 'attachments_for_form_objectform-ticket-create-5c48332d11a57'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\n\t\t\t\/\/ Preview tooltip\n\t\t\t$('.attachment [data-preview=\"true\"]').each(function(iIndex, oElem){\n\t\t\t\t$(oElem).parent().tooltip({\n\t\t\t\t\thtml: true,\n\t\t\t\t\ttitle: function(){ return '<img src=\"'+$(oElem).attr('href')+'\" style=\"max-width: 100%;\" \/>'; }\n\t\t\t\t});\n\t\t\t});\n\t\t\t\/\/ Remove button handler\n\t\t\t$('.attachments_container .attachment :button').click(function(oEvent){\n\t\t\t\toEvent.preventDefault();\n\t\t\t\tRemoveAttachment($(this).closest('.attachment').find(':input[name=\"attachments[]\"]').val());\n\t\t\t});\n\t\t\t\/\/ Remove button showing\n\t\t\tif(true)\n\t\t\t{\n\t\t\t\t$('.attachment').hover( function(){\n\t\t\t\t\t$(this).find(':button').toggleClass('hidden');\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t\/\/ Handles a drag \/ drop overlay\n\t\t\tif($('#drag_overlay').length === 0)\n\t\t\t{\n\t\t\t\t$('body').append( $('<div id=\"drag_overlay\" class=\"global_overlay\"><div class=\"overlay_content\"><div class=\"content_uploader\"><div class=\"icon glyphicon glyphicon-cloud-upload\"><\/div><div class=\"message\">D\u00e9posez vos fichiers pour les ajouter en pi\u00e8ces jointes<\/div><\/div><\/div><\/div>') );\n\t\t\t}\n\n\t\t\t\/\/ Handles highlighting of the drop zone\n\t\t\t\/\/ Note : This is inspired by itop-attachments\/main.attachments.php\n\t\t\t$(document).on('dragover', function(oEvent){\n\t\t\t\tvar bFiles = false;\n\t\t\t\tif (oEvent.dataTransfer && oEvent.dataTransfer.types)\n\t\t\t\t{\n\t\t\t\t\tfor (var i = 0; i < oEvent.dataTransfer.types.length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (oEvent.dataTransfer.types[i] == \"application\/x-moz-nativeimage\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbFiles = false; \/\/ mozilla contains \"Files\" in the types list when dragging images inside the page, but it also contains \"application\/x-moz-nativeimage\" before\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (oEvent.dataTransfer.types[i] == \"Files\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbFiles = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!bFiles) return; \/\/ Not dragging files\n\n\t\t\t\tvar oDropZone = $('#drag_overlay');\n\t\t\t\tvar oTimeout = window.dropZoneTimeout;\n\t\t\t\t\/\/ This is to detect when there is no drag over because there is no \"drag out\" event\n\t\t\t\tif (!oTimeout) {\n\t\t\t\t\toDropZone.removeClass('drag_out').addClass('drag_in');\n\t\t\t\t} else {\n\t\t\t\t\tclearTimeout(oTimeout);\n\t\t\t\t}\n\t\t\t\twindow.dropZoneTimeout = setTimeout(function () {\n\t\t\t\t\twindow.dropZoneTimeout = null;\n\t\t\t\t\toDropZone.removeClass('drag_in').addClass('drag_out');\n\t\t\t\t}, 200);\n\t\t\t});\n\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]}}});
            // Form handler declaration
            $('#objectform-ticket-create-5c48332d11a57').portal_form_handler({
                formmanager_class: "Combodo\x5CiTop\x5CPortal\x5CForm\x5CObjectFormManager",
                formmanager_data: {"id":"objectform-ticket-create-5c48332d11a57","transaction_id":"0072506001548235565","formmanager_class":"Combodo\\iTop\\Portal\\Form\\ObjectFormManager","formrenderer_class":"Combodo\\iTop\\Renderer\\Bootstrap\\BsFormRenderer","formrenderer_endpoint":"\/pages\/exec.php\/object\/create\/Informatique?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal","formobject_class":"Informatique","formmode":"create","formactionrulestoken":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIyIiwiU2VydmljZSI6IjciLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiI1In19","formproperties":{"id":"ticket-create","type":"custom_list","properties":{"display_mode":"cosy","always_show_submit":true},"fields":[],"layout":{"type":"xhtml","content":"  <div class=\"row\">\n    <div class=\"col-sm-6\">\n      <div class=\"form_field\" data-field-id=\"service_id\" data-field-flags=\"mandatory\">\n\t\t\t\t\t\t\t\t<\/div>\n    <\/div>\n    <div class=\"col-sm-6\">\n      <div class=\"form_field\" data-field-id=\"servicesubcategory_id\" data-field-flags=\"mandatory\">\n\t\t\t\t\t\t\t\t<\/div>\n    <\/div>\n  <\/div>\n  <div id=\"service_details_placeholder\">\n\t\t\t\t\t\t<\/div>\n  <div class=\"row\">\n    <div class=\"col-sm-6\">\n      <div class=\"form_field\" data-field-id=\"impact\">\n\t\t\t\t\t\t\t\t<\/div>\n    <\/div>\n    <div class=\"col-sm-6\">\n      <div class=\"form_field\" data-field-id=\"urgency\">\n\t\t\t\t\t\t\t\t<\/div>\n    <\/div>\n  <\/div>\n  <div>\n    <div class=\"form_field\" data-field-id=\"title\">\n\t\t\t\t\t\t\t<\/div>\n    <div class=\"form_field\" data-field-id=\"description\">\n\t\t\t\t\t\t\t<\/div>\n    <div class=\"form_field\" data-field-id=\"contacts_list\">\n\t\t\t\t\t\t\t<\/div>\n  <\/div>"}}},
                field_set: oFieldSet_objectformticketcreate5c48332d11a57,
                submit_btn_selector: $('#objectform-ticket-create-5c48332d11a57').parent().find('.form_btn_submit, .form_btn_transition'),
                cancel_btn_selector: $('#objectform-ticket-create-5c48332d11a57').parent().find('.form_btn_cancel'),
                submit_url: "/pages/exec.php/manage/ongoing-tickets-for-portal-user?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal",
                cancel_url: null,
                endpoint: "/pages/exec.php/object/create/Informatique?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal",
                is_modal: true      });
    
            // Sticky buttons handler
                        if( $('#objectform-ticket-create-5c48332d11a57 .form_btn_regular button').length > 0 )
                {
                    // Note : This pattern if to prevent performance issues
                    // - Cloning buttons
                    var oNormalRegularButtons_objectformticketcreate5c48332d11a57 = $('#objectform-ticket-create-5c48332d11a57 .form_btn_regular');
                    var oStickyRegularButtons_objectformticketcreate5c48332d11a57 = oNormalRegularButtons_objectformticketcreate5c48332d11a57.clone(true, true);
                    oStickyRegularButtons_objectformticketcreate5c48332d11a57.addClass('sticky');
                    if(oStickyRegularButtons_objectformticketcreate5c48332d11a57.find('.form_btn_submit span.glyphicon').length > 0)
                    {
                        oStickyRegularButtons_objectformticketcreate5c48332d11a57.find('.form_btn_submit').html( oStickyRegularButtons_objectformticketcreate5c48332d11a57.find('.form_btn_submit span.glyphicon')[0].outerHTML );
                    }
                    if(oStickyRegularButtons_objectformticketcreate5c48332d11a57.find('.form_btn_cancel span.glyphicon').length > 0)
                    {
                        oStickyRegularButtons_objectformticketcreate5c48332d11a57.find('.form_btn_cancel').html( oStickyRegularButtons_objectformticketcreate5c48332d11a57.find('.form_btn_cancel span.glyphicon')[0].outerHTML );
                    }
    
                    $('#objectform-ticket-create-5c48332d11a57').closest('.modal').append(oStickyRegularButtons_objectformticketcreate5c48332d11a57);
    
                    // - Global timeout for any
                    var oScrollTimeout;
                    // - Scroll handler
                    scrollHandler_objectformticketcreate5c48332d11a57 = function () {
                        if($('#objectform-ticket-create-5c48332d11a57 .form_buttons').visible())
                        {
                            oStickyRegularButtons_objectformticketcreate5c48332d11a57.addClass('closed');
                        }
                        else
                        {
                            oStickyRegularButtons_objectformticketcreate5c48332d11a57.removeClass('closed');
                        }
                    };
                    // - Event binding for scroll
                    $('.modal.in').off('scroll').on('scroll', function () {
                        if (oScrollTimeout) {
                            // Clear the timeout, if one is pending
                            clearTimeout(oScrollTimeout);
                            oScrollTimeout = null;
                        }
                        oScrollTimeout = setTimeout(scrollHandler_objectformticketcreate5c48332d11a57, 50);
                    });
                    // - Event binding for linkedset collapse
                    $('.modal.in').off('shown.bs.collapse hidden.bs.collapse').on('shown.bs.collapse hidden.bs.collapse', function () {
                        scrollHandler_objectformticketcreate5c48332d11a57();
                    });
                    // - Event binding for form building / updating
                    // Note : We do not want to 'off' the event or it will remove listeners from the widget
                    oFieldSet_objectformticketcreate5c48332d11a57.on('form_built', function(oEvent){
                        scrollHandler_objectformticketcreate5c48332d11a57();
                    });
                    // - Initial test
                    setTimeout(function(){ scrollHandler_objectformticketcreate5c48332d11a57(); }, 400);
    
                    // Remove sticky button when closing modal
                    $('#objectform-ticket-create-5c48332d11a57').closest('.modal').on('hide.bs.modal', function () {
                        oStickyRegularButtons_objectformticketcreate5c48332d11a57.remove();
                    });
                }
    
                        // Scroll top (because sometimes when several modals have been opened)
                $('#objectform-ticket-create-5c48332d11a57').closest('.modal').scrollTop(0);
                $('#objectform-ticket-create-5c48332d11a57').closest('.modal').find('.modal-footer').hide();
                });
    

    Thanks for your help Pierre !

    Regards,

    Rafael.

     
  • Rafael AINCIART

    Rafael AINCIART - 2019-01-28

    Hi !

    Anyone to help me ?
    Could it be a bug and should I open a ticket for this issue ?

    Thanks for your answers !

    Regards,

    Rafael.

     
  • Pierre Goiffon

    Pierre Goiffon - 2019-01-31

    Hello,
    Using your browser console check the ajax POST request that is triggered when clicking the submit button : there might be a server side error.
    Also check you log/error.log ?

     
  • Rafael AINCIART

    Rafael AINCIART - 2019-01-31

    Hi Pierre !

    Many many thanks to help me !
    There no error message in the error.log file.

    I can see the dedicated form (with POST action) in the client side code but I don't know how check the ajax POST request ?
    Could you please explain to me the way of doing it ?

    Regards,

    Rafael.

     
    • Pierre Goiffon

      Pierre Goiffon - 2019-01-31

      Yes, I meant the POST return value.
      Attached is an example in Firefox

       
      • Rafael AINCIART

        Rafael AINCIART - 2019-01-31

        Pierre,

        The header tab :

        General :
        Request URL: http://prh2.localhost/pages/exec.php/browse/services?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal
        Request Method: GET
        Status Code: 200 OK
        Remote Address: [::1]:80
        Referrer Policy: no-referrer-when-downgrade
        Response Headers :
        Cache-Control: no-store, no-cache, must-revalidate
        Cache-Control: no-cache, private
        Connection: Keep-Alive
        Content-Type: text/html; charset=UTF-8
        Date: Thu, 31 Jan 2019 13:36:40 GMT
        Expires: Thu, 19 Nov 1981 08:52:00 GMT
        Keep-Alive: timeout=5, max=100
        Pragma: no-cache
        Server: Apache/2.4.34 (Win32) OpenSSL/1.1.0h PHP/7.2.8
        Set-Cookie: itop-6e48b8d6e588efe2c0f4a3e200607efb=cehme79upfpn9f6ca7m5v9p86p; path=/
        Transfer-Encoding: chunked
        X-Powered-By: PHP/7.2.8
        X-Xdebug-Profile-Filename: C:\xampp\tmp\cachegrind.out.2408
        Query String Parameters :
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
        Accept-Encoding: gzip, deflate, br
        Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7
        Cache-Control: max-age=0
        Connection: keep-alive
        Cookie: itop-6e48b8d6e588efe2c0f4a3e200607efb=cehme79upfpn9f6ca7m5v9p86p; SL_G_WPT_TO=fr; SL_GWPT_Show_Hide_tmp=1; SL_wptGlobTipTmp=1
        Host: prh2.localhost
        Referer: http://prh2.localhost/pages/exec.php?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal
        Upgrade-Insecure-Requests: 1
        User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
        exec_module: itop-portal-base
        exec_page: index.php
        portal_id: itop-portal

        And the Response tab :

        <!doctype html>
        <html>
        <head>
            <meta charset="utf-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge">
            <meta name="viewport" content="width=device-width, initial-scale=1">
                        <title>             Nouvelle requête - iTop
            </title>
            <link rel="shortcut icon" href="http://prh2.localhost/images/favicon.ico?itopversion=2.5.1" />
        
                            <link href="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/bootstrap/css/bootstrap.min.css?itopversion=2.5.1" rel="stylesheet">
                        <link href="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css?itopversion=2.5.1" rel="stylesheet">
                        <link href="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/css/dataTables.bootstrap.min.css?itopversion=2.5.1" rel="stylesheet">
                <link href="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/css/fixedHeader.bootstrap.min.css?itopversion=2.5.1" rel="stylesheet">
                <link href="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/css/responsive.bootstrap.min.css?itopversion=2.5.1" rel="stylesheet">
                <link href="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/css/scroller.bootstrap.min.css?itopversion=2.5.1" rel="stylesheet">
                <link href="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/css/select.bootstrap.min.css?itopversion=2.5.1" rel="stylesheet">
                <link href="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/css/select.dataTables.min.css?itopversion=2.5.1" rel="stylesheet">
                        <link href="http://prh2.localhost/css/font-open-sans/font-open-sans.css?itopversion=2.5.1" rel="stylesheet">
                        <link href="http://prh2.localhost/css/font-combodo/font-combodo.css?itopversion=2.5.1" rel="stylesheet">
                        <link href="http://prh2.localhost/css/font-awesome/css/font-awesome.min.css?itopversion=2.5.1" rel="stylesheet">
                        <link href="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/typeahead/css/typeaheadjs.bootstrap.css?itopversion=2.5.1" rel="stylesheet">
                <link href="http://prh2.localhost/css/magnific-popup.css?itopversion=2.5.1" rel="stylesheet">
                <link href="http://prh2.localhost/css/c3.min.css?itopversion=2.5.1" rel="stylesheet">
                        <link href="http://prh2.localhost/env-production/itop-portal-base/portal/web/css/bootstrap-theme-combodo.css?itopversion=2.5.1" rel="stylesheet" id="css_bootstrap_theme">
                        <link href="http://prh2.localhost/env-production/itop-portal-base/portal/web/css/portal.css?itopversion=2.5.1" rel="stylesheet" id="css_portal">
        
        
                    <script type="text/javascript" src="http://prh2.localhost/js/jquery-1.12.4.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/js/jquery-migrate-1.4.1.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/js/jquery-ui-1.11.4.custom.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/js/jquery.magnific-popup.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/js/jquery.iframe-transport.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/js/jquery.fileupload.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/js/d3.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/js/c3.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/bootstrap/js/bootstrap.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/js/latinise/latinise.min.js?itopversion=2.5.1"></script>
                        <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/jquery-visible/js/jquery.visible.min.js?itopversion=2.5.1"></script>
                        <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/jquery-base64/js/jquery.base64.min.js?itopversion=2.5.1"></script>
                        <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/moment/js/moment.min.js?itopversion=2.5.1"></script>
                        <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/js/jquery.dataTables.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/js/dataTables.bootstrap.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/js/dataTables.fixedHeader.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/js/dataTables.responsive.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/js/dataTables.scroller.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/js/dataTables.select.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/datatables/js/datetime-moment.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/js/dataTables.accentNeutraliseForFilter.js?itopversion=2.5.1"></script>
                        <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/js/export.js?itopversion=2.5.1"></script>
                        <script type="text/javascript" src="http://prh2.localhost/js/ckeditor/ckeditor.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/js/ckeditor/adapters/jquery.js?itopversion=2.5.1"></script>
                        <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js?itopversion=2.5.1"></script>
                        <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/typeahead/js/typeahead.bundle.min.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/lib/handlebars/js/handlebars.min-768ddbd.js?itopversion=2.5.1"></script>
                        <script type="text/javascript" src="http://prh2.localhost/js/form_handler.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/js/form_field.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/js/subform_field.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/js/field_set.js?itopversion=2.5.1"></script>
                        <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/js/portal_form_handler.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/js/portal_form_field.js?itopversion=2.5.1"></script>
                <script type="text/javascript" src="http://prh2.localhost/env-production/itop-portal-base/portal/web/js/portal_form_field_html.js?itopversion=2.5.1"></script>
                                                    <script type="text/javascript">
                    $(document).ready(function() {
                        $('.tile.tile_badge[data-toggle="tooltip"]').tooltip({'html': true});
                    });
                </script>
            </head>
        <body class=" page_brick_of_id_services page_browse_brick page_browse_brick_as_mosaic">
        
                                                        <nav class="navbar navbar-fixed-top navbar-default visible-xs" id="topbar" role="navigation">
                            <div class="container-fluid">
                                <div class="navbar-header">
                                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
                                        <span class="icon-bar"></span>
                                        <span class="icon-bar"></span>
                                        <span class="icon-bar"></span>
                                    </button>
                                                                    <a class="navbar-brand pull-right" href="/pages/exec.php/?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal">
                                                                                    <img src="http://prh2.localhost/env-production/../images/logo-itop-dark-bg.svg" alt="Portail standard" />
                                                                            </a>
                                                                <p class="navbar-text">
                                        <a class="navbar-link user_infos" href="/pages/exec.php/user?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal">
                                            <span class="user_photo" style="background-image: url('http://prh2.localhost/env-production/itop-config-mgmt/images/silhouette.png');"></span>
                                            <span class="user_fullname">Rafael AINCIART</span>
                                        </a>
                                    </p>
                                </div>
                                <div class="collapse navbar-collapse" id="navbar">
                                    <ul class="nav navbar-nav">
                                                                            <li class="">
                                                <a href="/pages/exec.php/?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal">
                                                    <span class="brick_icon fa fa-home fa-2x"></span>
                                                    Accueil
                                                </a>
                                            </li>
                                                                                                                                                                                                            <li class="active">
                                                        <a href="/pages/exec.php/browse/services?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal"  >
                                                            <span class="brick_icon fc fc-new-request fc-2x"></span>
                                                            Nouvelle requête
                                                        </a>
                                                    </li>
                                                                                                                                                                        <li class="">
                                                        <a href="/pages/exec.php/manage/ongoing-tickets-for-portal-user?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal"  >
                                                            <span class="brick_icon fc fc-ongoing-request fc-2x"></span>
                                                            Requêtes en cours
                                                        </a>
                                                    </li>
                                                                                                                                                                        <li class="">
                                                        <a href="/pages/exec.php/manage/closed-tickets-for-portal-user?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal"  >
                                                            <span class="brick_icon fc fc-closed-request fc-2x"></span>
                                                            Requêtes fermées
                                                        </a>
                                                    </li>
                                                                                                                                                                                        <li role="separator" class="divider"></li>
                                            <li><a href="/pages/exec.php/user?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal"><span class="brick_icon fa fa-user fa-2x fa-fw"></span>Mon profil</a></li>
                                                                                                                                                                                                                                                        <li><a href="http://prh2.localhost/pages/UI.php" target="_blank"><span class="brick_icon fa fa-list-alt fa-2x fa-fw"></span>Console iTop</a></li>
                                                                                                                                                                                                    <li role="separator" class="divider"></li>
                                                                                <li><a href="http://prh2.localhost/pages/logoff.php"><span class="brick_icon fa fa-sign-out fa-2x fa-fw"></span>Déconnexion</a></li>
                                                                    </ul>
                                </div>
        
                                                                                                        </div>
                        </nav>
        
                                                <nav class="navbar-default hidden-xs col-sm-3 col-md-2" id="sidebar" role="navigation">
                            <div class="user_card bg-primary">
                                <div class="user_photo" style="background-image: url('http://prh2.localhost/env-production/itop-config-mgmt/images/silhouette.png');">
                                </div>
                                <div class="user_infos">
                                    <div class="user_fullname">Rafael AINCIART</div>
                                    <div class="user_email dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="user_options">
                                            rainciart@paie-rh.com
                                            <span class="caret"></span>
                                        </a>
                                        <ul class="dropdown-menu user_options" aria-labelledby="user_options">
                                            <li><a href="/pages/exec.php/user?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal"><span class="brick_icon fa fa-user fa-lg fa-fw"></span>Mon profil</a></li>
                                                                                                                                                                                                                                                        <li><a href="http://prh2.localhost/pages/UI.php" target="_blank" title="Console iTop"><span class="brick_icon fa fa-list-alt fa-lg fa-fw"></span>Console iTop</a></li>
                                                                                                                                                                                                    <li role="separator" class="divider"></li>
                                                                                <li><a href="http://prh2.localhost/pages/logoff.php"><span class="brick_icon fa fa-sign-out fa-lg fa-fw"></span>Déconnexion</a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="menu">
                                                            <ul class="nav navbar-nav">
                                        <li class="">
                                            <a href="/pages/exec.php/?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal">
                                                <span class="brick_icon fa fa-home fa-2x"></span>
                                                Accueil
                                            </a>
                                        </li>
                                                                                                                                                                                        <li class="active">
                                                    <a href="/pages/exec.php/browse/services?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal"  >
                                                        <span class="brick_icon fc fc-new-request fc-2x"></span>
                                                        Nouvelle requête
                                                    </a>
                                                </li>
                                                                                                                                                        <li class="">
                                                    <a href="/pages/exec.php/manage/ongoing-tickets-for-portal-user?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal"  >
                                                        <span class="brick_icon fc fc-ongoing-request fc-2x"></span>
                                                        Requêtes en cours
                                                    </a>
                                                </li>
                                                                                                                                                        <li class="">
                                                    <a href="/pages/exec.php/manage/closed-tickets-for-portal-user?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal"  >
                                                        <span class="brick_icon fc fc-closed-request fc-2x"></span>
                                                        Requêtes fermées
                                                    </a>
                                                </li>
                                                                                                        </ul>
                                                    </div>
        
        
                                                    <div class="logo">
                                                                                                                                    <a href="/pages/exec.php/?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal" title="Portail standard">
                                            <img src="http://prh2.localhost/env-production/../images/logo-itop-dark-bg.svg" alt="Portail standard" />
                                        </a>
                                                            </div>
                                            </nav>
        
                        <div class="container-fluid" id="main-wrapper">
                    <div class="row">
                        <div class="col-xs-12 col-sm-9 col-md-10 col-sm-offset-3 col-md-offset-2">
        
                            <section class="row" id="main-header">
                                    <div class="col-xs-12">
                <div id="main-header-title">
                    <h2>    Nouvelle requête
        </h2>
                </div>
                <div id="main-header-actions">
                                <div class="btn-group  btn_group_explicit">
                                <a href="/pages/exec.php/browse/services/list?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal" class="btn btn-default ">Liste</a>
                                <a href="/pages/exec.php/browse/services/tree?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal" class="btn btn-default ">Hiérarchie</a>
                                <a href="/pages/exec.php/browse/services/mosaic?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal" class="btn btn-default active">Mosaïque</a>
                            </div>
                    </div>
            </div>
                            </section>
        
                            <section class="row" id="main-content">
                                <div class="col-xs-12">
                        <div class="panel panel-default">
                        <div id="brick_content_mosaic">
                            <ol id="mosaic-breadcrumb" class="breadcrumb">
                        <li><a href="#" data-level-id="L"><span class="fa fa-home"></span></a></li>
                    </ol>
                    <div class="mosaic-group" data-level-id="L">
                    </div>
                    </div>
        
            <div id="brick_content_empty" class="text-center">
                            Aucun élément
                    </div>
            <div id="brick_mosaic_overlay">
                            <div class="overlay_content">
                        <div class="content_loader">
            <div class="icon glyphicon glyphicon-refresh"></div>
            <div class="message">
                Veuillez patienter...
            </div>
        </div>          </div>
                    </div>
                </div>
            </div>
                            </section>
                        </div>
                    </div>
        
                                                        </div>
        
                <footer id="footer-wrapper">
                                                        </footer>
        
                            <div class="modal fade" id="modal-for-all" role="dialog">
                        <div class="modal-dialog modal-lg" role="document">
                            <div class="modal-content">
                                <div class="content_loader">
            <div class="icon glyphicon glyphicon-refresh"></div>
            <div class="message">
                Veuillez patienter...
            </div>
        </div>                  </div>
                        </div>
                    </div>
                                    <div class="modal fade" id="modal-for-alert" role="dialog">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Fermer"><span aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title"></h4>
                                </div>
                                <div class="modal-body">
                                    <div class="alert">
                                    </div>
                                    <div class="text-right">
                                        <button type="button" class="btn btn-primary" data-dismiss="modal">Fermer</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
        
                            <div id="page_overlay" class="global_overlay">
                        <div class="overlay_content">
                            <div class="content_loader">
            <div class="icon glyphicon glyphicon-refresh"></div>
            <div class="message">
                Veuillez patienter...
            </div>
        </div>              </div>
                    </div>
        
        
                        <script type="text/javascript">
                                        // Helper to get the application root url
                        var GetAbsoluteUrlAppRoot = function()
                        {
                            return 'http://prh2.localhost/';
                        };
                        // Helper to add a parameter to an url
                        var AddParameterToUrl = function(sUrl, sParamName, sParamValue)
                        {
                            sUrl += (sUrl.split('?')[1] ? '&':'?') + sParamName + '=' + sParamValue;
                            return sUrl;
                        };
                        var GetContentLoaderTemplate = function()
                        {
                            return '<div class="content_loader"><div class="icon glyphicon glyphicon-refresh"></div><div class="message">Veuillez patienter...</div></div>';
                        }
                        var ShowLoginDialog = function()
                        {
                            var oModalElem = $('#modal-for-alert').clone();
                            oModalElem.attr('id', '');
                            oModalElem.find('.modal-content .modal-header .modal-title').html('Authentification');
                            oModalElem.find('.modal-content .modal-body .alert').addClass('alert-danger').html('Vous\x20\u00EAtes\x20d\u00E9connect\u00E9\x20et\x20devez\x20vous\x20reconnecter\x20pour\x20continuer.');
        
                            oModalElem.find('.modal-content .modal-body button').replaceWith( $('<button type="button" class="btn btn-primary" onclick="javascript:window.location.reload();">Cliquez\x20ici\x20pour\x20vous\x20reconnecter...</button>') );
        
                            oModalElem.appendTo('body');
                            oModalElem.modal('show');
                        };
                        var ShowErrorDialog = function(sBody, sTitle)
                        {
                            if(sTitle === undefined)
                            {
                                sTitle = 'Oups\x20\x21\x20Une\x20erreur\x20est\x20survenue.';
                            }
                            if(sBody === undefined)
                            {
                                sBody = 'Impossible\x20de\x20charger\x20les\x20donn\u00E9es,\x20veuillez\x20contacter\x20votre\x20administrateur\x20iTop\x20si\x20le\x20probl\u00E8me\x20persiste.';
                            }
                            var oModalElem = $('#modal-for-alert');
                            oModalElem.find('.modal-content .modal-header .modal-title').html(sTitle);
                            oModalElem.find('.modal-content .modal-body .alert').addClass('alert-danger').html(sBody);
                            oModalElem.modal('show');
                        };
        
        
            // Helpers used for brick's opening target
            var SetActionUrl = function(oElem, sUrl)
            {
                oElem.attr('href', sUrl);
            };
            var SetActionOpeningTarget = function(oElem, sMode)
            {
                if(sMode === 'modal')
                {
                    oElem.attr('data-toggle', 'modal').attr('data-target', '#modal-for-all');
                }
                else if(sMode === 'self')
                {
                    oElem.attr('target', '_self');
                }
                else if(sMode === 'new')
                {
                    oElem.attr('target', '_blank');
                }
            };
        
                    $(document).ready(function(){
                                            // Hack to enable a same modal to load content from different urls
                            $('body').on('hidden.bs.modal', '.modal#modal-for-all', function () {
                                $(this).removeData('bs.modal');
                                $(this).find('.modal-content').html(GetContentLoaderTemplate());
                            });
                            // Hack to enable multiple modals by making sure the .modal-open class is set to the <body> when there is at least one modal open left
                            $('body').on('hidden.bs.modal', function () {
                                if($('.modal.in').length > 0)
                                {
                                    $('body').addClass('modal-open');
                                }
                            });
                            // Hide tooltips when a modal is opening, otherwise it might be overlapping it
                            $('body').on('show.bs.modal', function () {
                                $(this).find('.tooltip.in').tooltip('hide');
                            });
                            // Display a error message on modal if the content could not be loaded.
                            // Note : As of now, we can't display a more detailled message based on the response because Bootstrap doesn't pass response data with the loaded event.
                            $('body').on('loaded.bs.modal', function (oEvent) {
                                var sModalContent = $(oEvent.target).find('.modal-content').html();
        
                                if( (sModalContent === '') || (sModalContent.replace(/[\n\r\t]+/g, '') === GetContentLoaderTemplate()) )
                                {
                                    $(oEvent.target).modal('hide');
                                }
                            });
        
                            // Handle AJAX errors (exceptions (500), logout (401), ...)
                            $(document).ajaxError(function(oEvent, oXHR, oSettings, sError){
                                if(oXHR.status === 401)
                                {
                                    ShowLoginDialog();
                                }
                                else if(oXHR.status === 404)
                                {
                                    ShowErrorDialog('D\u00E9sol\u00E9\x20cet\x20objet\x20n\x27existe\x20pas\x20\x28o\u00F9\x20vous\x20n\x27\u00EAtes\x20pas\x20autoris\u00E9\x20\u00E0\x20l\x27afficher\x29.', 'Page\x20non\x20trouv\u00E9e');
                                }
                                else
                                {
                                    ShowErrorDialog();
                                }
                            });
                                    });
                </script>
        
        
            <script type="text/javascript">
                var sBrowseMode = 'mosaic';
                var oLevelsProperties = {"L-1":{"alias":"L-1","title":"Famille de service","parent_att":null,"name_att":"name","tooltip_att":null,"description_att":null,"image_att":"icon","search":{},"fields":[],"actions":{"default":{"type":"drilldown","rules":[]}},"levels":["L-1-1"]},"L-1-1":{"alias":"L-1-1","title":"Service","parent_att":"servicefamily_id","name_att":"name","tooltip_att":"description","description_att":"description","image_att":"icon","search":{},"fields":[],"actions":{"drilldown":{"type":"drilldown","rules":[],"opening_target":"modal"}},"levels":["L-1-1-1"]},"L-1-1-1":{"alias":"L-1-1-1","title":"Sous cat\u00e9gorie de service","parent_att":"service_id","name_att":"name","tooltip_att":"description","description_att":"description","image_att":null,"search":{},"fields":[],"actions":{"create_from_this":{"type":"create_from_this","rules":["contact-to-userrequest","servicesubcategory-to-userrequest","go-to-open-request-on-submit"],"factory":{"type":"method","value":"\\Ticket::CreateFromServiceSubcategory"},"icon_class":"fc fc-new-request fc-1-6x fc-flip-horizontal","opening_target":"modal","title":"Cr\u00e9er","url":"\/pages\/exec.php\/object\/create-from-factory\/-objectClass-\/-objectId-\/XFRpY2tldDo6Q3JlYXRlRnJvbVNlcnZpY2VTdWJjYXRlZ29yeQ==?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal"},"view":{"type":"view","rules":[],"opening_target":"modal","title":"D\u00e9tails","icon_class":"glyphicon glyphicon-list-alt"}}}};
                var oRawDatas = {"L-1::1":{"level_alias":"L-1","id":"1","name":"Assistance IDC","class":"ServiceFamily","subitems":{"L-1-1::2":{"level_alias":"L-1-1","id":"2","name":"Appli Web","class":"Service","subitems":{"L-1-1-1::6":{"level_alias":"L-1-1-1","id":"6","name":"Cr\u00e9ation de dossier","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIxIiwiU2VydmljZSI6IjIiLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiI2In19","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjEiLCJTZXJ2aWNlIjoiMiIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjYifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>"},"L-1-1-1::13":{"level_alias":"L-1-1-1","id":"13","name":"Passage en IDS","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIxIiwiU2VydmljZSI6IjIiLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiIxMyJ9fQ==","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjEiLCJTZXJ2aWNlIjoiMiIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjEzIn19"},"tooltip":"<div ><\/div>","description":"<div ><\/div>"}},"action_rules_token":{"drilldown":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjEiLCJTZXJ2aWNlIjoiMiIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjYifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>","image":null},"L-1-1::5":{"level_alias":"L-1-1","id":"5","name":"Fichier de contr\u00f4le","class":"Service","subitems":{"L-1-1-1::7":{"level_alias":"L-1-1-1","id":"7","name":"CSG","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIxIiwiU2VydmljZSI6IjUiLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiI3In19","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjEiLCJTZXJ2aWNlIjoiNSIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjcifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>"},"L-1-1-1::8":{"level_alias":"L-1-1-1","id":"8","name":"Fillon","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIxIiwiU2VydmljZSI6IjUiLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiI4In19","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjEiLCJTZXJ2aWNlIjoiNSIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjgifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>"}},"action_rules_token":{"drilldown":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjEiLCJTZXJ2aWNlIjoiNSIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjcifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>","image":null}},"action_rules_token":{"default":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjEiLCJTZXJ2aWNlIjoiMiIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjYifX0="},"image":null},"L-1::2":{"level_alias":"L-1","id":"2","name":"Assistance informatique","class":"ServiceFamily","subitems":{"L-1-1::6":{"level_alias":"L-1-1","id":"6","name":"Installations","class":"Service","subitems":{"L-1-1-1::2":{"level_alias":"L-1-1-1","id":"2","name":"Applications","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIyIiwiU2VydmljZSI6IjYiLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiIyIn19","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjIiLCJTZXJ2aWNlIjoiNiIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjIifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>"},"L-1-1-1::3":{"level_alias":"L-1-1-1","id":"3","name":"Autres","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIyIiwiU2VydmljZSI6IjYiLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiIzIn19","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjIiLCJTZXJ2aWNlIjoiNiIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjMifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>"}},"action_rules_token":{"drilldown":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjIiLCJTZXJ2aWNlIjoiNiIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjIifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>","image":null},"L-1-1::7":{"level_alias":"L-1-1","id":"7","name":"Utilisateurs","class":"Service","subitems":{"L-1-1-1::5":{"level_alias":"L-1-1-1","id":"5","name":"Cr\u00e9ation","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIyIiwiU2VydmljZSI6IjciLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiI1In19","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjIiLCJTZXJ2aWNlIjoiNyIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjUifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>"},"L-1-1-1::11":{"level_alias":"L-1-1-1","id":"11","name":"Modification","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIyIiwiU2VydmljZSI6IjciLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiIxMSJ9fQ==","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjIiLCJTZXJ2aWNlIjoiNyIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjExIn19"},"tooltip":"<div ><\/div>","description":"<div ><\/div>"},"L-1-1-1::15":{"level_alias":"L-1-1-1","id":"15","name":"Suppression","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIyIiwiU2VydmljZSI6IjciLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiIxNSJ9fQ==","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjIiLCJTZXJ2aWNlIjoiNyIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjE1In19"},"tooltip":"<div ><\/div>","description":"<div ><\/div>"}},"action_rules_token":{"drilldown":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjIiLCJTZXJ2aWNlIjoiNyIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjUifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>","image":null}},"action_rules_token":{"default":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjIiLCJTZXJ2aWNlIjoiNiIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjIifX0="},"image":null},"L-1::3":{"level_alias":"L-1","id":"3","name":"Assistance Juridique \/ Conseil","class":"ServiceFamily","subitems":{"L-1-1::3":{"level_alias":"L-1-1","id":"3","name":"Conseil l\u00e9gal","class":"Service","subitems":{"L-1-1-1::4":{"level_alias":"L-1-1-1","id":"4","name":"Contrats \/ Avenants","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIzIiwiU2VydmljZSI6IjMiLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiI0In19","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjMiLCJTZXJ2aWNlIjoiMyIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjQifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>"},"L-1-1-1::14":{"level_alias":"L-1-1-1","id":"14","name":"Rupture conventionnelle","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIzIiwiU2VydmljZSI6IjMiLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiIxNCJ9fQ==","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjMiLCJTZXJ2aWNlIjoiMyIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjE0In19"},"tooltip":"<div ><\/div>","description":"<div ><\/div>"}},"action_rules_token":{"drilldown":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjMiLCJTZXJ2aWNlIjoiMyIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjQifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>","image":null}},"action_rules_token":{"default":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjMiLCJTZXJ2aWNlIjoiMyIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjQifX0="},"image":null},"L-1::4":{"level_alias":"L-1","id":"4","name":"Assistance P\u00e9gase","class":"ServiceFamily","subitems":{"L-1-1::1":{"level_alias":"L-1-1","id":"1","name":"Analytique","class":"Service","subitems":{"L-1-1-1::10":{"level_alias":"L-1-1-1","id":"10","name":"Import","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiI0IiwiU2VydmljZSI6IjEiLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiIxMCJ9fQ==","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjQiLCJTZXJ2aWNlIjoiMSIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjEwIn19"},"tooltip":"<div ><\/div>","description":"<div ><\/div>"},"L-1-1-1::12":{"level_alias":"L-1-1-1","id":"12","name":"Param\u00e9trages","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiI0IiwiU2VydmljZSI6IjEiLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiIxMiJ9fQ==","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjQiLCJTZXJ2aWNlIjoiMSIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjEyIn19"},"tooltip":"<div ><\/div>","description":"<div ><\/div>"}},"action_rules_token":{"drilldown":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjQiLCJTZXJ2aWNlIjoiMSIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjEwIn19"},"tooltip":"<div ><\/div>","description":"<div ><\/div>","image":null},"L-1-1::4":{"level_alias":"L-1-1","id":"4","name":"Droits utilisateurs","class":"Service","subitems":{"L-1-1-1::1":{"level_alias":"L-1-1-1","id":"1","name":"Acc\u00e8s aux dossiers","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiI0IiwiU2VydmljZSI6IjQiLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiIxIn19","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjQiLCJTZXJ2aWNlIjoiNCIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjEifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>"},"L-1-1-1::9":{"level_alias":"L-1-1-1","id":"9","name":"Gestion des droits","class":"ServiceSubcategory","subitems":[],"action_rules_token":{"create_from_this":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiI0IiwiU2VydmljZSI6IjQiLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiI5In19","view":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjQiLCJTZXJ2aWNlIjoiNCIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjkifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>"}},"action_rules_token":{"drilldown":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjQiLCJTZXJ2aWNlIjoiNCIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjEifX0="},"tooltip":"<div ><\/div>","description":"<div ><\/div>","image":null}},"action_rules_token":{"default":"eyJydWxlcyI6W10sInNvdXJjZXMiOnsiU2VydmljZUZhbWlseSI6IjQiLCJTZXJ2aWNlIjoiMSIsIlNlcnZpY2VTdWJjYXRlZ29yeSI6IjEwIn19"},"image":null}};
                var sMosaicEffectName = 'fade';
                var oMosaicEffectOptions = {};
                var iMosaicEffectDuration = 200;
        
                // Show a loader over the mosaic
                var showMosaicLoader = function()
                {
                    $("#brick_content_mosaic").hide();
                    $('#brick_mosaic_overlay').show();
                };
                // Hide the loader over the tree
                var hideMosaicLoader = function()
                {
                    $('#brick_mosaic_overlay').hide();
                    $("#brick_content_mosaic").show();
                }
                // Show the requested level
                var showLevel = function(sLevelAlias, sItemId)
                {
                    // Retrieving level to show
                    var sLevelId = sLevelAlias + ((sItemId !== undefined) ? '::'+sItemId : '' );
                    var oLevelElem = $('#brick_content_mosaic .mosaic-group[data-level-id="' + sLevelId + '"]');
                    var bLevelLoaded = (oLevelElem.length > 0);
        
                    // Hiding current level
                    $('#brick_content_mosaic .mosaic-group:visible').hide(
                        sMosaicEffectName,
                        oMosaicEffectOptions,
                        iMosaicEffectDuration,
                        function(){
                            // Showing level
                            if(!bLevelLoaded)
                            {
                                showMosaicLoader();
                                loadChildNodes(sLevelAlias, sItemId);
                            }
                            else
                            {
                                oLevelElem.show(sMosaicEffectName, oMosaicEffectOptions, iMosaicEffectDuration, function(){ buildBreadcrumb(); });
                            }
                        }
                    );
                };
                // Registers the toggle listeners on the tree nodes. Used after every AJAX calls.
                var registerToggleListeners = function()
                {
                    $('#brick_content_mosaic .mosaic-drilldown').off('click').on('click', function (oEvent) {
                        oEvent.preventDefault();
        
                        showLevel($(this).attr('data-level-alias'), $(this).attr('data-item-id'));
                    });
        
                    $('#brick_content_mosaic .mosaic-rollup').off('click').on('click', function (oEvent) {
                        oEvent.preventDefault();
        
                        var upperlevelId = $(this).attr('data-level-id');
                        var upperlevelIdParts = upperlevelId.split('::');
        
                        showLevel(upperlevelIdParts[0], upperlevelIdParts[1]);
                    });
        
                    // Allows link in item's description to work. Otherwise, the predentDefault of the item takes over.
                    $('#brick_content_mosaic .mosaic-item-description a').off('click').on('click', function(oEvent){
                        oEvent.stopPropagation();
                    });
                };
                // Registers the filter listeners on the tree.
                var registerFilterListeners = function()
                {
                    /*$('#brick_search_field').treeListFilter('#brick_content_mosaic', iSearchDelay, filterResultsHandler);*/
                };
                // Load current node childnodes throught AJAX
                var loadChildNodes = function(sLevelAlias, sNodeId)
                {
                    var sUrl = '/pages/exec.php/browse/services/tree/expand/-sLevelAlias-/-sNodeId-?sBrowseMode=mosaic&exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal';
                    sUrl = sUrl.replace(/-sLevelAlias-/, sLevelAlias).replace(/-sNodeId-/, sNodeId);
        
                    $.ajax(sUrl)
                    .done(function(data) {
                        // Building child nodes
                        for(index in data.data)
                        {
                            var sublevel = data.data[index];
                            var sublevelData = {};
                            sublevelData[sublevel.level_alias+"::"+sublevel.id] = sublevel;
                            buildMosaic(sublevelData, sLevelAlias+"::"+sNodeId, false);
                        }
                        // Showing sublevel
                        $('#brick_content_mosaic .mosaic-group[data-level-id="'+sLevelAlias+"::"+sNodeId+'"]').show(sMosaicEffectName, oMosaicEffectOptions, iMosaicEffectDuration, function(){ buildBreadcrumb(); });
        
                        registerToggleListeners();
                    })
                    .fail(function() {
                        alert('Impossible de charger les données, veuillez contacter votre administrateur iTop si le problème persiste.');
                    })
                    .always(function(){
                        hideMosaicLoader();
                    });
                };
                // Build mosaic nodes from data under the nodeId
                var buildMosaic = function(data, nodeId, isRootLevel)
                {
                    if(nodeId === undefined)
                    {
                        // We are on the root node
                        nodeId = 'L';
                    }
                    if(isRootLevel === undefined)
                    {
                        isRootLevel = true;
                    }
        
                    // Building node if necessary
                    if($('div[data-level-id="'+nodeId+'"]').length === 0)
                    {
                        $('#brick_content_mosaic').append( $('<div></div>').addClass('mosaic-group').attr('data-level-id', nodeId) );
                    }
        
                    if(!isRootLevel)
                    {
                        // Retrieving upper level id
                        var levelIdParts = nodeId.split('::');
                        var upperlevelId = $('.mosaic-item[data-level-alias="'+levelIdParts[0]+'"][data-item-id="'+levelIdParts[1]+'"]').closest('.mosaic-group').attr('data-level-id');
        
                        // Building back button
                        if( $('div[data-level-id="'+nodeId+'"] .mosaic-group-back').length === 0 ) {
                            var backElem = $('<div></div>').addClass('mosaic-group-item').addClass('mosaic-group-back');
                            var aElem = $('<a></a>').addClass('mosaic-item').addClass('mosaic-rollup').attr('href', '#').attr('data-level-id', upperlevelId).html('<div class="mosaic-item-text"><span class="glyphicon glyphicon-arrow-left"></span></div>');
        
                            backElem.append(aElem);
                            $('div[data-level-id="' + nodeId + '"]').append(backElem);
                        }
                    }
                    else
                    {
                        $('div[data-level-id="'+nodeId+'"]').html('');
                    }
        
                    $.each(data, function(i, item){
                        var levelId = item.level_alias+'::'+item.id;
                        var levelAltId = item.level_alias+'_'+item.id;
                        var levelActions = oLevelsProperties[item.level_alias].actions;
                        var levelActionsKeys = Object.keys(levelActions);
                        var levelPrimaryAction = levelActions[levelActionsKeys[0]];
                        var url = '';
        
                        // Building node
                        var itemElem  = $('<div></div>').addClass('mosaic-group-item');
                        var aElem   = $('<a></a>').addClass('mosaic-item').attr('data-item-id', item.id).attr('href', '#').attr('data-level-alias', item.level_alias);
                        var iItemFlags = 0;
                        // - Adding stub div
                        var textElem = $('<div></div>').addClass('mosaic-item-text');
                        // - Adding wrapper to textElem to easily control text's subnodes flow
                        var textWrapperElem = $('<div></div>').addClass('mosaic-item-text-wrapper');
                        textWrapperElem.appendTo(textElem);
                        // - Adding image
                        if( (item.image !== undefined) && (item.image !== '') && (item.image !== null) )
                        {
                            iItemFlags += 4;
                            aElem.append( $('<div></div>').addClass('mosaic-item-image').append( $('<img />').attr('src', item.image) ) );
                        }
                        // - Adding name
                        if( (item.name !== undefined) && (item.name !== '') )
                        {
                            iItemFlags += 1;
                            textWrapperElem.append( $('<div></div>').addClass('mosaic-item-name').html(item.name) );
                        }
                        // - Adding description
                        if( (item.description !== undefined) && (item.description !== '') )
                        {
                            iItemFlags += 2;
                            textWrapperElem.append( $('<div></div>').addClass('mosaic-item-description').html(item.description) );
                        }
                        aElem.append( textElem );
                        // - Adding CSS class to adjust the layout regarding which properties are available
                        aElem.addClass('mosaic-item-layout-'+iItemFlags);
                        // - Appending element
                        $('div[data-level-id="'+nodeId+'"]').append(itemElem);
                        itemElem.append(aElem);
        
                        // Building tooltip for the node
                        if( (item.tooltip !== undefined) && (item.tooltip !== '') )
                        {
                            aElem.attr('title', item.tooltip).attr('data-toggle', 'tooltip').tooltip({html: true, trigger: 'hover', placement: 'top'});
                        }
        
                        // Building actions for that node
                        switch(levelPrimaryAction.type)
                        {
                            case 'drilldown':
                                aElem.addClass('mosaic-drilldown');
                                break;
                            case 'view':
                                url = '/pages/exec.php/object/view/-objectClass-/-objectId-?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal'.replace(/-objectClass-/, item.class).replace(/-objectId-/, item.id);
                                SetActionUrl(aElem, url);
                                SetActionOpeningTarget(aElem, levelPrimaryAction.opening_target);
                                break;
                            case 'edit':
                                url = '/pages/exec.php/object/edit/-objectClass-/-objectId-?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal'.replace(/-objectClass-/, item.class).replace(/-objectId-/, item.id);
                                SetActionUrl(aElem, url);
                                SetActionOpeningTarget(aElem, levelPrimaryAction.opening_target);
                                break;
                            case 'create_from_this':
                                url = levelPrimaryAction.url.replace(/-objectClass-/, item.class).replace(/-objectId-/, item.id);
                                url = AddParameterToUrl(url, 'ar_token', item.action_rules_token[levelPrimaryAction.type]);
                                SetActionUrl(aElem, url);
                                SetActionOpeningTarget(aElem, levelPrimaryAction.opening_target);
                                break;
                            default:
                                //console.log('Action "'+levelPrimaryAction.type+'" not implemented for primary action');
                                break;
                        }
        
                        if(levelActionsKeys.length > 1)
                        {
                            // Retrieving secondary action (Now we also display primary action)
                            var actionsButtons = {};
                            for(j = 0; j < levelActionsKeys.length; j++)
                            {
                                actionsButtons[levelActionsKeys[j]] = levelActions[levelActionsKeys[j]];
                            }
        
                            // Preparing secondary actions container
                            var actionsElem = $('<div></div>').addClass('mosaic-group-item-actions');
                            itemElem.append(actionsElem);
                            // Preparing secondary actions menu
                            var actionsSSTogglerElem = $('<a class="glyphicon glyphicon-menu-hamburger" data-toggle="collapse" data-target="#item-actions-menu-'+levelAltId+'"></a>');
                            var actionsSSMenuElem = $('<div id="item-actions-menu-'+levelAltId+'" class="item-action-wrapper panel panel-default"></div>');
                            var actionsSSMenuContainerElem = $('<div class="panel-body"></div>');
                            actionsSSMenuElem.append(actionsSSMenuContainerElem);
                            actionsElem.append(actionsSSTogglerElem);
                            actionsElem.append(actionsSSMenuElem);
        
                            // Adding secondary actions
                            for(j in actionsButtons)
                            {
                                var action = actionsButtons[j];
                                var actionElem = $('<a></a>');
                                var actionIconElem = $('<span></span>').appendTo(actionElem);
        
                                switch(action.type)
                                {
                                    case 'view':
                                        url = '/pages/exec.php/object/view/-objectClass-/-objectId-?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal'.replace(/-objectClass-/, item.class).replace(/-objectId-/, item.id);
                                        break;
                                    case 'edit':
                                        url = '/pages/exec.php/object/edit/-objectClass-/-objectId-?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal'.replace(/-objectClass-/, item.class).replace(/-objectId-/, item.id);
                                        break;
                                    case 'create_from_this':
                                        url = action.url.replace(/-objectClass-/, item.class).replace(/-objectId-/, item.id);
                                        url = AddParameterToUrl(url, 'ar_token', item.action_rules_token[action.type]);
                                        break;
                                    default:
                                        url = '#';
                                        //console.log('Action "'+action.type+'" not implemented for secondary action');
                                        break;
                                }
                                SetActionUrl(actionElem, url);
                                SetActionOpeningTarget(actionElem, action.opening_target);
        
                                // Adding title if present
                                if(action.title !== undefined)
                                {
                                    actionElem.attr('title', action.title);
                                }
                                // Adding icon class if present
                                if(action.icon_class !== undefined)
                                {
                                    actionIconElem.addClass(action.icon_class);
                                }
        
                                actionElem.append(action.title);
                                actionsSSMenuContainerElem.append( $('<p></p>').append(actionElem) );
                            }
                        }
        
                        // Building subnodes if necessary
                        if(item.subitems.length !== 0)
                        {
                            var subitemsElem;
                            if($('div[data-level-id="'+levelId+'"]').length > 0)
                            {
                                subitemsElem = $('div[data-level-id="'+levelId+'"]');
                            }
                            else
                            {
                                subitemsElem = $('<div></div>').addClass('mosaic-group').attr('data-level-id', levelId);
                                $('div[data-level-id="'+nodeId+'"]').after(subitemsElem);
                            }
                            buildMosaic(item.subitems, levelId, false);
                        }               
                    });
        
                    // Update listeners
                    if(isRootLevel)
                    {
                        registerToggleListeners();
                    }
                };
                // Build breadcrumb
                var buildBreadcrumb = function(oCurrentElem)
                {
                    var aCurrentLevelParts = [];
                    var bLeafLevel = false;
        
                    // If no current item, it's because we begin to build the breadcrumb, starting from the bottom
                    if(oCurrentElem === undefined)
                    {
                        bLeafLevel = true;
        
                        // Retrieving current level id
                        var sCurrentLevelId = $('#brick_content_mosaic > .mosaic-group:visible').attr('data-level-id');
                        aCurrentLevelParts = sCurrentLevelId.split('::');
        
                        // Emptying breadcrumb
                        $('#mosaic-breadcrumb > li:not(:first-of-type)').remove();
        
                        // Finding current item
                        oCurrentElem = $('#brick_content_mosaic .mosaic-item[data-level-alias="'+aCurrentLevelParts[0]+'"][data-item-id="'+aCurrentLevelParts[1]+'"]');
                        if(oCurrentElem.length === 0)
                        {
                            return false;
                        }
                    }
                    else
                    {
                        aCurrentLevelParts = [oCurrentElem.attr('data-level-alias'), oCurrentElem.attr('data-item-id')];
                    }
        
                    // Adding level as crumb
                    var oCrumb = $('<li></li>');
                    var oCrumbLink = (bLeafLevel) ? $('<span></span>') : $('<a></a>');
                    oCrumbLink.html( oCurrentElem.find('.mosaic-item-name').html() );
                    oCrumbLink.attr('data-level-id', aCurrentLevelParts.join('::')).attr('href', '#');
                    oCrumb.append(oCrumbLink).insertAfter('#mosaic-breadcrumb > li:first-of-type');
                    if(bLeafLevel)
                    {
                        oCrumb.addClass('active');
                    }
                    // Adding listener
                    $('#mosaic-breadcrumb > li:not(:last-of-type) > a').off('click').on('click', function(oEvent){
                        oEvent.preventDefault();
        
                        var levelId = $(this).attr('data-level-id');
                        var levelIdParts = levelId.split('::');
        
                        showLevel(levelIdParts[0], levelIdParts[1]);
                    });
        
                    // Finding parent level
                    var oParentLevelElem = oCurrentElem.closest('.mosaic-group');
                    if(oParentLevelElem.length > 0)
                    {
                        var sParentLevelId = oParentLevelElem.attr('data-level-id');
                        var aParentLevelParts = sParentLevelId.split('::');
                        var oParentElem = $('#brick_content_mosaic .mosaic-item[data-level-alias="'+aParentLevelParts[0]+'"][data-item-id="'+aParentLevelParts[1]+'"]');
        
                        if(oParentElem.length === 1)
                        {
                            buildBreadcrumb(oParentElem);
                        }
                    }
                };
        
                $(document).ready(function(){
                    // Auto collapse item actions popup
                    $('body').click(function(){
                        $('#brick_content_mosaic .item-action-wrapper.collapse.in').collapse('hide');
                    });
        
                    // Build the tree (collapsed)
                    showMosaicLoader();
                    buildMosaic(oRawDatas);
                    hideMosaicLoader();
                    registerFilterListeners();
        
                    // Open first level if only one item
                    // TODO: We must disable opening of first level when pre-filtering when filtering will be implemented
                    if($('#brick_content_mosaic > .mosaic-group[data-level-id="L"] > .mosaic-group-item').length == 1)
                    {
                        setTimeout(function(){
                            $('#brick_content_mosaic > .mosaic-group[data-level-id="L"] > .mosaic-group-item > .mosaic-item').trigger('click');
                        }, 300);
                    }
                });
            </script>
        
                                </body>
        </html>
        
         
        • Pierre Goiffon

          Pierre Goiffon - 2019-01-31

          This is not the right http query, see again my capture : you should find the POST request.
          This request should be done to a path like this one : /pages/exec.php/object/create/UserRequest?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal

           
          • Rafael AINCIART

            Rafael AINCIART - 2019-02-04

            Hi Pierre !

            Sorry, I was using Chrome and the dev tool is not exactly the same.
            I just installed Firefow and I have the good interface as you show me.

            Please see the result in attach. The problem for me is that all the request are in GET method...

            Thank you !

             
            • Rafael AINCIART

              Rafael AINCIART - 2019-02-04

              Pierre,

              I think the POST entry you want me to give you is generated after I submit the form. Isn't it?
              In my situation, I can see the "save" button but click on it does not do anything. So impossible for me to submit the form.
              It is just as if the client code is inactive to initiate the Ajax request...

              As you can see in the screenshot above, the only requests I can see in the console concern the first load of the empty form in order to create the Ticket.

              I wish I'm clear enough... And I don't know where I can have a look to understand what is not working.

              Thank you to help me.

              Regards,

              Rafael.

               
              • Rafael AINCIART

                Rafael AINCIART - 2019-02-04

                To complete the idea in my previous post, I can submit the form by clicking on "Cancel" button (it works !) and then I can see a POST request in the console (See in attach).
                Only the "Save" button does not do anything.

                 
              • Pierre Goiffon

                Pierre Goiffon - 2019-02-05

                Hello,

                I think the POST entry you want me to give you is generated after I submit the form. Isn't it?

                It is !

                So something isn't working in the JavaScript that is triggered when clicking the button... But you said there was no JS error...

                Someone needs to debug...
                Try to create a package that reproduce the error on a "blank" iTop ?

                 
                • Rafael AINCIART

                  Rafael AINCIART - 2019-02-05

                  Hi Pierre,

                  I have a single extension that I have installed on different "blank" instances of iTop :
                  * 2.5 with simple Ticket management
                  * 2.5 with compliant ITIL Ticket management
                  * 2.6 with compliant ITIL Ticket management
                  * 2.6 with compliant ITIL Ticket management + ITIL Change Management
                  The result is always the same.

                  Please find this extension in attach.

                  Hope it helps !

                  Rafael.

                   
                  • Rafael AINCIART

                    Rafael AINCIART - 2019-02-07

                    Pierre, Guillaume,

                    Would you have any magic idea to go further on analysis?
                    I still do not understand..., but I live in hope that a solution exists ;)

                    Regards,

                    Rafael.

                     
  • Rafael AINCIART

    Rafael AINCIART - 2019-01-31

    Hi again,

    Ok, Google is my friend ;)

    In the developer console > Network tab > XHR :
    When I load the form I can see the following messages

    content.js:43 [Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
    (anonymous) @ content.js:43
    content.js:90 [Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
    (anonymous) @ content.js:90
    content.js:162 [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
    (anonymous) @ content.js:162
    jquery-1.12.4.min.js?itopversion=2.5.1:4 XHR finished loading: GET "http://prh2.localhost/pages/exec.php/object/create-from-factory/ServiceSubcategory/5/XFRpY2tldDo6Q3JlYXRlRnJvbVNlcnZpY2VTdWJjYXRlZ29yeQ==?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal&ar_token=eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIyIiwiU2VydmljZSI6IjciLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiI1In19".
    send @ jquery-1.12.4.min.js?itopversion=2.5.1:4
    ajax @ jquery-1.12.4.min.js?itopversion=2.5.1:4
    n.fn.load @ jquery-1.12.4.min.js?itopversion=2.5.1:4
    jQuery.fn.(anonymous function) @ jquery-migrate-1.4.1.min.js?itopversion=2.5.1:557
    c @ bootstrap.min.js?itopversion=2.5.1:6
    (anonymous) @ bootstrap.min.js?itopversion=2.5.1:6
    each @ jquery-1.12.4.min.js?itopversion=2.5.1:2
    each @ jquery-1.12.4.min.js?itopversion=2.5.1:2
    b @ bootstrap.min.js?itopversion=2.5.1:6
    (anonymous) @ bootstrap.min.js?itopversion=2.5.1:6
    dispatch @ jquery-1.12.4.min.js?itopversion=2.5.1:3
    r.handle @ jquery-1.12.4.min.js?itopversion=2.5.1:3
    ckeditor.js?itopversion=2.5.1:88 [Violation] Avoid using document.write().
    write @ ckeditor.js?itopversion=2.5.1:88
    setData @ ckeditor.js?itopversion=2.5.1:835
    (anonymous) @ ckeditor.js?itopversion=2.5.1:370
    n @ ckeditor.js?itopversion=2.5.1:10
    (anonymous) @ ckeditor.js?itopversion=2.5.1:12
    CKEDITOR.editor.CKEDITOR.editor.fire @ ckeditor.js?itopversion=2.5.1:13
    setData @ ckeditor.js?itopversion=2.5.1:273
    b @ ckeditor.js?itopversion=2.5.1:828
    (anonymous) @ ckeditor.js?itopversion=2.5.1:830
    CKEDITOR.editor.setMode @ ckeditor.js?itopversion=2.5.1:349
    (anonymous) @ ckeditor.js?itopversion=2.5.1:344
    n @ ckeditor.js?itopversion=2.5.1:10
    (anonymous) @ ckeditor.js?itopversion=2.5.1:12
    CKEDITOR.editor.CKEDITOR.editor.fire @ ckeditor.js?itopversion=2.5.1:13
    fireOnce @ ckeditor.js?itopversion=2.5.1:12
    CKEDITOR.editor.CKEDITOR.editor.fireOnce @ ckeditor.js?itopversion=2.5.1:13
    (anonymous) @ ckeditor.js?itopversion=2.5.1:266
    f @ ckeditor.js?itopversion=2.5.1:246
    load @ ckeditor.js?itopversion=2.5.1:246
    (anonymous) @ ckeditor.js?itopversion=2.5.1:265
    (anonymous) @ ckeditor.js?itopversion=2.5.1:253
    (anonymous) @ ckeditor.js?itopversion=2.5.1:251
    f @ ckeditor.js?itopversion=2.5.1:246
    load @ ckeditor.js?itopversion=2.5.1:246
    load @ ckeditor.js?itopversion=2.5.1:251
    h @ ckeditor.js?itopversion=2.5.1:252
    (anonymous) @ ckeditor.js?itopversion=2.5.1:253
    C @ ckeditor.js?itopversion=2.5.1:264
    (anonymous) @ ckeditor.js?itopversion=2.5.1:263
    (anonymous) @ ckeditor.js?itopversion=2.5.1:498
    (anonymous) @ ckeditor.js?itopversion=2.5.1:251
    f @ ckeditor.js?itopversion=2.5.1:246
    C @ ckeditor.js?itopversion=2.5.1:246
    w @ ckeditor.js?itopversion=2.5.1:246
    (anonymous) @ ckeditor.js?itopversion=2.5.1:247
    ckeditor.js?itopversion=2.5.1:247 [Violation] 'setTimeout' handler took 167ms

    Il fill the form and I click on the submit button : nothing...

    Does it helps ?

    Regards,

    Rafael.

     
  • Rafael AINCIART

    Rafael AINCIART - 2019-01-31

    Supplement to the reply (Response tab content) :

    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h4 class="modal-title">            Création de Informatique
    </h4>
    </div>
    <div class="modal-body">    
    
    <form id="objectform-ticket-create-5c52c05689d93" class="form_cosy form_object_state_new" method="POST" action="/pages/exec.php/object/create/Informatique?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal"
    data-object-state="new">
    <input type="hidden" name="transaction_id" value="0564856001548927062" />
    <div class="form_alerts">
                    <div class="alert alert-success" role="alert" style="display: none;"></div>
            <div class="alert alert-warning" role="alert" style="display: none;"></div>
            <div class="alert alert-error alert-danger" role="alert" style="display: none;"></div>
            </div>
    <div class="form_fields">
                    <root>  <div class="row">
    <div class="col-sm-6">
      <div class="form_field" data-field-id="service_id" data-field-flags="mandatory" data-form-path="objectform-ticket-create-5c52c05689d93">
                                </div>
    </div>
    <div class="col-sm-6">
      <div class="form_field" data-field-id="servicesubcategory_id" data-field-flags="mandatory" data-form-path="objectform-ticket-create-5c52c05689d93">
                                </div>
    </div>
    </div>
    <div id="service_details_placeholder">
                        </div>
    <div class="row">
    <div class="col-sm-6">
      <div class="form_field" data-field-id="impact" data-form-path="objectform-ticket-create-5c52c05689d93">
                                </div>
    </div>
    <div class="col-sm-6">
      <div class="form_field" data-field-id="urgency" data-form-path="objectform-ticket-create-5c52c05689d93">
                                </div>
    </div>
    </div>
    <div>
    <div class="form_field" data-field-id="title" data-form-path="objectform-ticket-create-5c52c05689d93">
                            </div>
    <div class="form_field" data-field-id="description" data-form-path="objectform-ticket-create-5c52c05689d93">
                            </div>
    <div class="form_field" data-field-id="contacts_list" data-form-path="objectform-ticket-create-5c52c05689d93">
                            </div>
    </div></root>
    
            </div>
    <div class="form_buttons">
                                                <div class="form_btn_misc">
    
    
    
    
    
    
                </div>
                                                <div class="form_btn_regular">
                                                    <button class="btn btn-default form_btn_cancel" type="button" value="cancel" title="Annuler" data-dismiss="modal">
                        <span class="glyphicon glyphicon-remove"></span>
                        Annuler
                    </button>
                                            <button class="btn btn-primary form_btn_submit" type="submit" value="submit" title="Valider">
                            <span class="glyphicon glyphicon-ok"></span>
                            Valider
                        </button>
                                                </div>
            </div>
    </form>
    
    <script type="text/javascript">
    $(document).ready(function(){
        // Form field set declaration
        var oFieldSet_objectformticketcreate5c52c05689d93 = $('#objectform-ticket-create-5c52c05689d93 > .form_fields').field_set({"fields_impacts":{"org_id":["service_id"],"service_id":["servicesubcategory_id"],"request_type":["servicesubcategory_id"]},"form_path":"objectform-ticket-create-5c52c05689d93","fields_list":{"service_id":{"id":"service_id","html":"<div class=\"form-group form_group_small \"><div class=\"form_field_label\"><label for=\"field_service_id_5c52c056a4f16\" class=\"control-label\">service id<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><div class=\"row\"><div class=\"col-xs-12 col-sm-12 col-md-12\"><select id=\"field_service_id_5c52c056a4f16\" name=\"service_id\" class=\"form-control\"><option value=\"\">-- choisir une valeur --<\/option><option value=\"1\"  >Analytique<\/option><option value=\"2\"  >Appli Web<\/option><option value=\"3\"  >Conseil l&eacute;gal<\/option><option value=\"4\"  >Droits utilisateurs<\/option><option value=\"5\"  >Fichier de contr&ocirc;le<\/option><option value=\"6\"  >Installations<\/option><option value=\"7\" selected >Utilisateurs<\/option><\/select><\/div><div class=\"col-xs-0 col-sm-0 col-md-0 text-right\"><\/div><\/div><\/div><\/div>","js_inline":" \t\t\t\t\t\t$(\"#field_service_id_5c52c056a4f16\").off(\"change keyup\").on(\"change keyup\", function(){\n\t\t\t\t\t\t\tvar me = this;\n\n\t\t\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\t\t\tid: $(me).attr(\"id\"),\n\t\t\t\t\t\t\t\tname: $(me).closest(\".form_field\").attr(\"data-field-id\"),\n\t\t\t\t\t\t\t\tvalue: $(me).val()\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$(\"[data-field-id='service_id'][data-form-path='objectform-ticket-create-5c52c05689d93']\").portal_form_field({\n\t\t\t\t\t\t\t'validators': []\n\t\t\t\t\t\t});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"servicesubcategory_id":{"id":"servicesubcategory_id","html":"<div class=\"form-group form_group_small \"><div class=\"form_field_label\"><label for=\"field_servicesubcategory_id_5c52c056b48d4\" class=\"control-label\">servicesubcategory id<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><div class=\"row\"><div class=\"col-xs-12 col-sm-12 col-md-12\"><select id=\"field_servicesubcategory_id_5c52c056b48d4\" name=\"servicesubcategory_id\" class=\"form-control\"><option value=\"\">-- choisir une valeur --<\/option><option value=\"5\" selected >Cr&eacute;ation<\/option><option value=\"11\"  >Modification<\/option><option value=\"15\"  >Suppression<\/option><\/select><\/div><div class=\"col-xs-0 col-sm-0 col-md-0 text-right\"><\/div><\/div><\/div><\/div>","js_inline":" \t\t\t\t\t\t$(\"#field_servicesubcategory_id_5c52c056b48d4\").off(\"change keyup\").on(\"change keyup\", function(){\n\t\t\t\t\t\t\tvar me = this;\n\n\t\t\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\t\t\tid: $(me).attr(\"id\"),\n\t\t\t\t\t\t\t\tname: $(me).closest(\".form_field\").attr(\"data-field-id\"),\n\t\t\t\t\t\t\t\tvalue: $(me).val()\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$(\"[data-field-id='servicesubcategory_id'][data-form-path='objectform-ticket-create-5c52c05689d93']\").portal_form_field({\n\t\t\t\t\t\t\t'validators': []\n\t\t\t\t\t\t});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"impact":{"id":"impact","html":"<div class=\"form-group form_group_small form_mandatory\"><div class=\"form_field_label\"><label for=\"field_impact_5c52c056be808\" class=\"control-label\">impact<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><select id=\"field_impact_5c52c056be808\" name=\"impact\"  class=\"form-control\"><option value=\"\"  >-- choisir une valeur --<\/option><option value=\"1\" selected >1<\/option><option value=\"2\"  >2<\/option><option value=\"3\"  >3<\/option><\/select><\/div><\/div>","js_inline":"                         \t\t\t\t\t$(\"#field_impact_5c52c056be808\").off(\"change keyup\").on(\"change keyup\", function(){\n\t\t\t\t\t\tvar me = this;\n\n\t\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\t\tid: $(me).attr(\"id\"),\n\t\t\t\t\t\t\tname: $(me).closest(\".form_field\").attr(\"data-field-id\"),\n\t\t\t\t\t\t\tvalue: $(me).val()\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n    \t\t\t\t\t$(\"[data-field-id='impact'][data-form-path='objectform-ticket-create-5c52c05689d93']\").portal_form_field({\"validators\":{\"mandatory\":{\"reg_exp\":\".*\\\\S.*\",\"message\":\"Veuillez remplir ce champ\"}}});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"urgency":{"id":"urgency","html":"<div class=\"form-group form_group_small form_mandatory\"><div class=\"form_field_label\"><label for=\"field_urgency_5c52c056c0b9f\" class=\"control-label\">urgency<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><select id=\"field_urgency_5c52c056c0b9f\" name=\"urgency\"  class=\"form-control\"><option value=\"\"  >-- choisir une valeur --<\/option><option value=\"1\"  >1<\/option><option value=\"2\"  >2<\/option><option value=\"3\"  >3<\/option><option value=\"4\" selected >4<\/option><\/select><\/div><\/div>","js_inline":"                         \t\t\t\t\t$(\"#field_urgency_5c52c056c0b9f\").off(\"change keyup\").on(\"change keyup\", function(){\n\t\t\t\t\t\tvar me = this;\n\n\t\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\t\tid: $(me).attr(\"id\"),\n\t\t\t\t\t\t\tname: $(me).closest(\".form_field\").attr(\"data-field-id\"),\n\t\t\t\t\t\t\tvalue: $(me).val()\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n    \t\t\t\t\t$(\"[data-field-id='urgency'][data-form-path='objectform-ticket-create-5c52c05689d93']\").portal_form_field({\"validators\":{\"mandatory\":{\"reg_exp\":\".*\\\\S.*\",\"message\":\"Veuillez remplir ce champ\"}}});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"title":{"id":"title","html":"<div class=\"form-group form_group_small form_mandatory\"><div class=\"form_field_label\"><label for=\"field_title_5c52c056c3783\" class=\"control-label\">Titre<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><input type=\"text\" id=\"field_title_5c52c056c3783\" name=\"title\" value=\"\" class=\"form-control\" maxlength=\"255\" \/><\/div><\/div>","js_inline":"                         \t\t\t\t\t$(\"#field_title_5c52c056c3783\").off(\"change keyup\").on(\"change keyup\", function(){\n\t\t\t\t\t\tvar me = this;\n\n\t\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\t\tid: $(me).attr(\"id\"),\n\t\t\t\t\t\t\tname: $(me).closest(\".form_field\").attr(\"data-field-id\"),\n\t\t\t\t\t\t\tvalue: $(me).val()\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n    \t\t\t\t\t$(\"[data-field-id='title'][data-form-path='objectform-ticket-create-5c52c05689d93']\").portal_form_field({\"validators\":{\"mandatory\":{\"reg_exp\":\".*\\\\S.*\",\"message\":\"Veuillez remplir ce champ\"}}});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"description":{"id":"description","html":"<div class=\"form-group form_mandatory\"><div class=\"form_field_label\"><label for=\"field_description_5c52c056c4829\" class=\"control-label\">Description<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><div><textarea id=\"field_description_5c52c056c4829\" name=\"description\" class=\"form-control\" rows=\"8\"><\/textarea><\/div><\/div><\/div>","js_inline":" \t\t\t\t\t\t\t$('#field_description_5c52c056c4829').addClass('htmlEditor');\n\t\t\t\t\t\t\t$('#field_description_5c52c056c4829').ckeditor(function(){}, {language: 'fr fr', contentsLanguage: 'fr fr'});\n\t\t\/\/ Hook the file upload of all CKEditor instances\n\t\t$('.htmlEditor').each(function() {\n\t\t\tvar oEditor = $(this).ckeditorGet();\n\t\t\toEditor.config.extraPlugins = 'font,uploadimage';\n\t\t\toEditor.config.uploadUrl = 'http:\/\/prh2.localhost\/'+'pages\/ajax.render.php';\n\t\t\toEditor.config.filebrowserBrowseUrl = 'http:\/\/prh2.localhost\/'+'pages\/ajax.render.php?operation=cke_browse&temp_id=d6bk96abv313fm0ftscdtk49g9_0564856001548927062&obj_class=Informatique&obj_key=-2';\n\t\t\toEditor.on( 'fileUploadResponse', function( evt ) {\n\t\t\t\tvar fileLoader = evt.data.fileLoader;\n\t\t\t\tvar xhr = fileLoader.xhr;\n\t\t\t\tvar data = evt.data;\n\t\t\t\ttry {\n\t\t\t        var response = JSON.parse( xhr.responseText );\n\t\t\n\t\t\t        \/\/ Error message does not need to mean that upload finished unsuccessfully.\n\t\t\t        \/\/ It could mean that ex. file name was changes during upload due to naming collision.\n\t\t\t        if ( response.error && response.error.message ) {\n\t\t\t            data.message = response.error.message;\n\t\t\t        }\n\t\t\n\t\t\t        \/\/ But !uploaded means error.\n\t\t\t        if ( !response.uploaded ) {\n\t\t\t            evt.cancel();\n\t\t\t        } else {\n\t\t\t            data.fileName = response.fileName;\n\t\t\t           \tdata.url = response.url;\n\t\t\t\t\t\t\n\t\t\t            \/\/ Do not call the default listener.\n\t\t\t            evt.stop();\n\t\t\t        }\n\t\t\t    } catch ( err ) {\n\t\t\t        \/\/ Response parsing error.\n\t\t\t        data.message = fileLoader.lang.filetools.responseError;\n\t\t\t        window.console && window.console.log( xhr.responseText );\n\t\t\n\t\t\t        evt.cancel();\n\t\t\t    }\n\t\t\t} );\n\t\n\t\t\toEditor.on( 'fileUploadRequest', function( evt ) {\n\t\t\t\tevt.data.fileLoader.uploadUrl += '?operation=cke_img_upload&temp_id=d6bk96abv313fm0ftscdtk49g9_0564856001548927062&obj_class=Informatique';\n\t\t\t}, null, null, 4 ); \/\/ Listener with priority 4 will be executed before priority 5.\n\t\t\n\t\t\toEditor.on( 'instanceReady', function() {\n\t\t\t\tif(!CKEDITOR.env.iOS && $('#'+oEditor.id+'_toolbox .editor_magnifier').length == 0)\n\t\t\t\t{\n\t\t\t\t\t$('#'+oEditor.id+'_toolbox').append('<span class=\"editor_magnifier\" title=\"Agrandir \/ Minimiser\" style=\"display:block;width:12px;height:11px;border:1px #A6A6A6 solid;cursor:pointer; background-image:url(\\'http:\/\/prh2.localhost\/\/images\/full-screen.png\\')\">&nbsp;<\/span>');\n\t\t\t\t\t$('#'+oEditor.id+'_toolbox .editor_magnifier').on('click', function() {\n\t\t\t\t\t\t\toEditor.execCommand('maximize');\n\t\t\t\t\t\t\tif ($(this).closest('.cke_maximized').length != 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$('#'+oEditor.id+'_toolbar_collapser').trigger('click');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (oEditor.widgets.registered.uploadimage)\n\t\t\t\t{\n\t\t\t\t\toEditor.widgets.registered.uploadimage.onUploaded = function( upload ) {\n\t\t\t\t\tvar oData = JSON.parse(upload.xhr.responseText);\n\t\t\t\t    \tthis.replaceWith( '<img src=\"' + upload.url + '\" ' +\n\t\t\t\t    \t\t'width=\"' + oData.width + '\" ' +\n\t\t\t\t\t\t\t'height=\"' + oData.height + '\">' );\n\t\t\t\t    }\n\t\t\t\t}\n\t\t\t});\n\t\t});\n                        \t\t\t\t\t$(\"#field_description_5c52c056c4829\").off(\"change keyup\").on(\"change keyup\", function(){\n\t\t\t\t\t\tvar me = this;\n\n\t\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\t\tid: $(me).attr(\"id\"),\n\t\t\t\t\t\t\tname: $(me).closest(\".form_field\").attr(\"data-field-id\"),\n\t\t\t\t\t\t\tvalue: $(me).val()\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n                            $(\"[data-field-id='description'][data-form-path='objectform-ticket-create-5c52c05689d93']\").portal_form_field_html({\n                            validators: {\"mandatory\":{\"reg_exp\":\".*\\\\S.*\",\"message\":\"Veuillez remplir ce champ\"}},\n                            set_current_value_callback: function(me, oEvent, oData){ $(me.element).find('textarea').val(oData); }\n                        });\n$('img[data-img-id]').each(function() {\n\tif ($(this).width() > 250)\n\t{\n\t\t$(this).css({'max-width': '250px', width: '', height: '', 'max-height': ''});\n\t}\n\t$(this).addClass('inline-image').attr('href', $(this).attr('src'));\n}).magnificPopup({type: 'image', closeOnContentClick: true });\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"contacts_list":{"id":"contacts_list","html":"<div class=\"form-group \"><label for=\"field_contacts_list_5c52c056c5a5c\" class=\"control-label\"><a id=\"form_linkedset_toggler_field_contacts_list_5c52c056c5a5c\" class=\"form_linkedset_toggler collapsed\" data-toggle=\"collapse\" href=\"#form_linkedset_wrapper_field_contacts_list_5c52c056c5a5c\" aria-expanded=\"false\" aria-controls=\"form_linkedset_wrapper_field_contacts_list_5c52c056c5a5c\">Contacts<span class=\"text\">0<\/span><span class=\"glyphicon glyphicon-menu-down collapsed\"><\/><\/a><\/label><div class=\"help-block\"><\/div>\t\t\t\t<div class=\"form_linkedset_wrapper collapse\" id=\"form_linkedset_wrapper_field_contacts_list_5c52c056c5a5c\">\n\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t<div class=\"col-xs-12\">\n\t\t\t\t\t\t\t<input type=\"hidden\" id=\"field_contacts_list_5c52c056c5a5c\" name=\"contacts_list\" value=\"{&quot;current&quot;:[]}\" \/>\n\t\t\t\t\t\t\t<table id=\"table_field_contacts_list_5c52c056c5a5c\" data-field-id=\"contacts_list\" class=\"table table-striped table-bordered responsive\" cellspacing=\"0\" width=\"100%\">\n\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<\/tbody>\n\t\t\t\t\t\t\t<\/table>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t<div class=\"col-xs-12\">\n\t\t\t\t\t\t\t<div class=\"btn-group\" role=\"group\">\n\t\t\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-sm btn-danger\" id=\"btn_remove_field_contacts_list_5c52c056c5a5c\" title=\"Enlever\" disabled><span class=\"glyphicon glyphicon-minus\"><\/span><\/button>\n\t\t\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-sm btn-default\" id=\"btn_add_field_contacts_list_5c52c056c5a5c\" title=\" Ajouter... \"><span class=\"glyphicon glyphicon-plus\"><\/span><\/button>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div><\/div><\/div>","js_inline":" \t\t\t\t\/\/ Collapse handlers\n\t\t\t\t\/\/ - Collapsing by default to optimize form space\n\t\t\t\t\/\/ It would be better to be able to construct the widget as collapsed, but in this case, datatables thinks the container is very small and therefore renders the table as if it was in microbox.\n\t\t\t\t$('#form_linkedset_wrapper_field_contacts_list_5c52c056c5a5c').collapse({toggle: false});\n\t\t\t\t\/\/ - Change toggle icon class\n\t\t\t\t$('#form_linkedset_wrapper_field_contacts_list_5c52c056c5a5c').on('shown.bs.collapse', function(){\n\t\t\t\t\t\/\/ Creating the table if null (first expand). If we create it on start, it will be displayed as if it was in a micro screen due to the div being \"display: none;\"\n\t\t\t\t\tif(oTable_field_contacts_list_5c52c056c5a5c === undefined)\n\t\t\t\t\t{\n\t\t\t\t\t\tbuildTable_field_contacts_list_5c52c056c5a5c();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.on('show.bs.collapse', function(){\n\t\t\t\t\t$('#form_linkedset_toggler_field_contacts_list_5c52c056c5a5c > span.glyphicon').removeClass('glyphicon-menu-down collapsed').addClass('glyphicon-menu-down');\n\t\t\t\t})\n\t\t\t\t.on('hide.bs.collapse', function(){\n\t\t\t\t\t$('#form_linkedset_toggler_field_contacts_list_5c52c056c5a5c > span.glyphicon').removeClass('glyphicon-menu-down').addClass('glyphicon-menu-down collapsed');\n\t\t\t\t});\n\n\t\t\t\t\/\/ Places a loader in the empty datatables\n\t\t\t\t$('#table_field_contacts_list_5c52c056c5a5c > tbody').html('<tr><td class=\"datatables_overlay\" colspan=\"100\">' + $('#page_overlay').html() + '<\/td><\/tr>');\n\n\t\t\t\t\/\/ Prepares data for datatables\n\t\t\t\tvar oColumnProperties_field_contacts_list_5c52c056c5a5c = {\"friendlyname\":\"Nom complet\",\"status\":\"Statut\",\"org_id\":\"Organisation\",\"function\":\"Fonction\"};\n\t\t\t\tvar oRawDatas_field_contacts_list_5c52c056c5a5c = [];\n\t\t\t\tvar oTable_field_contacts_list_5c52c056c5a5c;\n\t\t\t\tvar oSelectedItems_field_contacts_list_5c52c056c5a5c = {};\n\n\t\t\t\tvar getColumnsDefinition_field_contacts_list_5c52c056c5a5c = function()\n\t\t\t\t{\n\t\t\t\t\tvar aColumnsDefinition = [];\n\n\t\t\t\t\tif(true)\n\t\t\t\t\t{\n\t\t\t\t\t\taColumnsDefinition.push({\n\t\t\t\t\t\t\t\t\"width\": \"auto\",\n\t\t\t\t\t\t\t\t\"searchable\": false,\n\t\t\t\t\t\t\t\t\"sortable\": false,\n\t\t\t\t\t\t\t\t\"title\": '<span class=\"row_input\"><input type=\"checkbox\" id=\"field_contacts_list_5c52c056c5a5c_check_all\" name=\"field_contacts_list_5c52c056c5a5c_check_all\" title=\"Tout cocher \/ Tout d&eacute;cocher\" \/><\/span>',\n\t\t\t\t\t\t\t\t\"type\": \"html\",\n\t\t\t\t\t\t\t\t\"data\": \"\",\n\t\t\t\t\t\t\t\t\"render\": function(data, type, row)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar oCheckboxElem = $('<span class=\"row_input\"><input type=\"checkbox\" name=\"field_contacts_list_5c52c056c5a5c\" \/><\/span>');\n\t\t\t\t\t\t\t\t\toCheckboxElem.find(':input').attr('data-object-id', row.id).attr('data-target-object-id', row.target_id);\n\t\t\t\t\t\t\t\t\treturn oCheckboxElem.prop('outerHTML');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tfor(sKey in oColumnProperties_field_contacts_list_5c52c056c5a5c)\n\t\t\t\t\t{\n\t\t\t\t\t\t\/\/ Level main column\n\t\t\t\t\t\taColumnsDefinition.push({\n\t\t\t\t\t\t\t\"width\": \"auto\",\n\t\t\t\t\t\t\t\"searchable\": true,\n\t\t\t\t\t\t\t\"sortable\": true,\n\t\t\t\t\t\t\t\"title\": oColumnProperties_field_contacts_list_5c52c056c5a5c[sKey],\n\t\t\t\t\t\t\t\"defaultContent\": \"\",\n\t\t\t\t\t\t\t\"type\": \"html\",\n\t\t\t\t\t\t\t\"data\": \"attributes.\"+sKey+\".att_code\",\n\t\t\t\t\t\t\t\"render\": function(data, type, row){\n\t\t\t\t\t\t\t\tvar cellElem;\n\n\t\t\t\t\t\t\t\t\/\/ Preparing the cell data\n\t\t\t\t\t\t\t\tif(row.attributes[data].url !== undefined)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcellElem = $('<a><\/a>');\n\t\t\t\t\t\t\t\t\tcellElem.attr('href', row.attributes[data].url);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcellElem = $('<span><\/span>');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcellElem.html('<span>' + row.attributes[data].value + '<\/span>');\n\n\t\t\t\t\t\t\t\treturn cellElem.prop('outerHTML');\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\treturn aColumnsDefinition;\n\t\t\t\t};\n\n\t\t\t\t\/\/ Helper to build the datatable\n\t\t\t\t\/\/ Note : Those options should be externalized in an library so we can use them on any DataTables for the portal.\n\t\t\t\t\/\/ We would just have to override \/ complete the necessary elements\n\t\t\t\tvar buildTable_field_contacts_list_5c52c056c5a5c = function()\n\t\t\t\t{\n\t\t\t\t\tvar iDefaultOrderColumnIndex = (true) ? 1 : 0;\n\n\t\t\t\t\t\/\/ Instanciates datatables\n\t\t\t\t\toTable_field_contacts_list_5c52c056c5a5c = $('#table_field_contacts_list_5c52c056c5a5c').DataTable({\n\t\t\t\t\t\t\"language\": {\n\t\t\t\t\t\t\t\"emptyTable\":\t  \"La liste est vide, utilisez le bouton &quot;Ajouter...&quot; pour ajouter des objets.\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"displayLength\": -1,\n\t\t\t\t\t\t\"scrollY\": \"300px\",\n\t\t\t\t\t\t\"scrollCollapse\": true,\n\t\t\t\t\t\t\"retrieve\": true,\n\t\t\t\t\t\t\"order\": [[iDefaultOrderColumnIndex, \"asc\"]],\n\t\t\t\t\t\t\"dom\": 't',\n\t\t\t\t\t\t\"columns\": getColumnsDefinition_field_contacts_list_5c52c056c5a5c(),\n\t\t\t\t\t\t\"select\": {\"style\": \"multi\"},\n\t\t\t\t\t\t\"rowId\": \"id\",\n\t\t\t\t\t\t\"data\": oRawDatas_field_contacts_list_5c52c056c5a5c,\n\t\t\t\t\t\t\"rowCallback\": function(oRow, oData){\n\t\t\t\t\t\t\t\/\/ Opening in a new modal on click\n\t\t\t\t\t\t\t$(oRow).find('a').off('click').on('click', function(oEvent){\n\t\t\t\t\t\t\t\t\/\/ Prevents link opening.\n\t\t\t\t\t\t\t\toEvent.preventDefault();\n\t\t\t\t\t\t\t\t\/\/ Prevents row selection\n\t\t\t\t\t\t\t\toEvent.stopPropagation();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\/\/ Note : This could be better if we check for an existing modal first instead of always creating a new one\n\t\t\t\t\t\t\t\tvar oModalElem = $('#modal-for-all').clone();\n\t\t\t\t\t\t\t\toModalElem.attr('id', '').appendTo('body');\n\t\t\t\t\t\t\t\t\/\/ Loading content\n\t\t\t\t\t\t\t\toModalElem.find('.modal-content').html($('#page_overlay .overlay_content').html());\n\t\t\t\t\t\t\t\toModalElem.find('.modal-content').load(\n\t\t\t\t\t\t\t\t\t$(this).attr('href'),\n\t\t\t\t\t\t\t\t\t{},\n\t\t\t                        function(sResponseText, sStatus, oXHR){\n\t\t\t                            \/\/ Hiding modal in case of error as the general AJAX error handler will display a message\n\t\t\t                            if(sStatus === 'error')\n\t\t\t                            {\n\t\t\t                                oModalElem.modal('hide');\n\t\t\t                            }\n\t\t\t                        }\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\toModalElem.modal('show');\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\/\/ Handles items selection\/deselection\n\t\t\t\t\t\/\/ - Directly on the table\n\t\t\t\t\toTable_field_contacts_list_5c52c056c5a5c.off('select').on('select', function(oEvent, dt, type, indexes){\n\t\t\t\t\t\tvar aData = oTable_field_contacts_list_5c52c056c5a5c.rows(indexes).data().toArray();\n\n\t\t\t\t\t\t\/\/ Checking input\n\t\t\t\t\t\t$('#table_field_contacts_list_5c52c056c5a5c tbody tr[role=\"row\"].selected td:first-child input').prop('checked', true);\n\t\t\t\t\t\t\/\/ Saving values in temp array\n\t\t\t\t\t\tfor(var i in aData)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar iItemId = aData[i].id;\n\t\t\t\t\t\t\tif(!(iItemId in oSelectedItems_field_contacts_list_5c52c056c5a5c))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\toSelectedItems_field_contacts_list_5c52c056c5a5c[iItemId] = aData[i].name;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\/\/ Updating remove button\n\t\t\t\t\t\tupdateRemoveButtonState_field_contacts_list_5c52c056c5a5c();\n\t\t\t\t\t});\n\t\t\t\t\toTable_field_contacts_list_5c52c056c5a5c.off('deselect').on('deselect', function(oEvent, dt, type, indexes){\n\t\t\t\t\t\tvar aData = oTable_field_contacts_list_5c52c056c5a5c.rows(indexes).data().toArray();\n\n\t\t\t\t\t\t\/\/ Checking input\n\t\t\t\t\t\t$('#table_field_contacts_list_5c52c056c5a5c tbody tr[role=\"row\"]:not(.selected) td:first-child input').prop('checked', false);\n\t\t\t\t\t\t\/\/ Saving values in temp array\n\t\t\t\t\t\tfor(var i in aData)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar iItemId = aData[i].id;\n\t\t\t\t\t\t\tif(iItemId in oSelectedItems_field_contacts_list_5c52c056c5a5c)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdelete oSelectedItems_field_contacts_list_5c52c056c5a5c[iItemId];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\/\/ Unchecking global checkbox\n\t\t\t\t\t\t$('#field_contacts_list_5c52c056c5a5c_check_all').prop('checked', false);\n\t\t\t\t\t\t\/\/ Updating remove button\n\t\t\t\t\t\tupdateRemoveButtonState_field_contacts_list_5c52c056c5a5c();\n\t\t\t\t\t});\n\t\t\t\t\t\/\/ - From the global button\n\t\t\t\t\t$('#field_contacts_list_5c52c056c5a5c_check_all').off('click').on('click', function(oEvent){\n\t\t\t\t\t\tif($(this).prop('checked'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toTable_field_contacts_list_5c52c056c5a5c.rows().select();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toTable_field_contacts_list_5c52c056c5a5c.rows().deselect();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tupdateRemoveButtonState_field_contacts_list_5c52c056c5a5c();\n\t\t\t\t\t});\n\t\t\t\t};\n                $(\"[data-field-id='contacts_list'][data-form-path='objectform-ticket-create-5c52c05689d93']\").portal_form_field({\n\t\t\t\t\t'validators': [],\n\t\t\t\t\t'get_current_value_callback': function(me, oEvent, oData){\n\t\t\t\t\t\tvar value = null;\n\n\t\t\t\t\t\t\/\/ Retrieving JSON value as a string and not an object\n\t\t\t\t\t\t\/\/\n\t\t\t\t\t\t\/\/ Note : The value is passed as a string instead of an array because the attribute would not be included in the posted data when empty.\n\t\t\t\t\t\t\/\/ Which was an issue when deleting all objects from linkedset\n\t\t\t\t\t\t\/\/\n\t\t\t\t\t\t\/\/ Old code : value = JSON.parse(me.element.find('#field_contacts_list_5c52c056c5a5c').val());\n\t\t\t\t\t\tvalue = me.element.find('#field_contacts_list_5c52c056c5a5c').val();\n\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t},\n\t\t\t\t\t'set_current_value_callback': function(me, oEvent, oData){\n\t\t\t\t\t\t\/\/ When we have data (meaning that we picked objects from search)\n\t\t\t\t\t\tif(oData !== undefined && Object.keys(oData.values).length > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\/\/ Showing loader while retrieving informations\n\t\t\t\t\t\t\t$('#page_overlay').fadeIn(200);\n\n\t\t\t\t\t\t\t\/\/ Retrieving new rows ids\n\t\t\t\t\t\t\tvar aObjectIds = Object.keys(oData.values);\n\n\t\t\t\t\t\t\t\/\/ Retrieving rows informations so we can add them\n\t\t\t\t\t\t\t$.post(\n\t\t\t\t\t\t\t\t'\/pages\/exec.php\/object\/get-informations\/json?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tsObjectClass: 'Contact',\n\t\t\t\t\t\t\t\t\taObjectIds: aObjectIds,\n\t\t\t\t\t\t\t\t\taObjectAttCodes: [\"friendlyname\",\"status\",\"org_id\",\"function\"]\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction(oData){\n\t\t\t\t\t\t\t\t\t\/\/ Updating datatables\n\t\t\t\t\t\t\t\t\tif(oData.items !== undefined)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t    for(var i in oData.items)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\/\/ Adding target item id information\n\t\t\t\t\t\t\t\t\t\t\toData.items[i].target_id = oData.items[i].id;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\/\/ Adding item to table only if it's not already there\n\t\t\t\t\t\t\t\t\t\t\tif($('#table_field_contacts_list_5c52c056c5a5c tr[role=\"row\"] > td input[data-target-object-id=\"' + oData.items[i].target_id + '\"], #table_field_contacts_list_5c52c056c5a5c tr[role=\"row\"] > td input[data-target-object-id=\"' + (oData.items[i].target_id*-1) + '\"]').length === 0)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\/\/ Making id negative in order to recognize it when persisting\n\t\t\t\t\t\t\t\t\t\t\t\toData.items[i].id = -1 * parseInt(oData.items[i].id);\n\t\t\t\t\t\t\t\t\t\t\t\toTable_field_contacts_list_5c52c056c5a5c.row.add(oData.items[i]);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\toTable_field_contacts_list_5c52c056c5a5c.draw();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\/\/ Updating input\n\t\t\t\t\t\t                updateInputValue_field_contacts_list_5c52c056c5a5c();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.done(function(oData){\n\t\t\t\t\t\t\t\t\/\/ Updating items count\n\t\t\t\t\t\t\t\tupdateItemCount_field_contacts_list_5c52c056c5a5c();\n\t\t\t\t\t\t\t\t\/\/ Updating global checkbox\n\t\t\t\t\t\t\t\t$('#field_contacts_list_5c52c056c5a5c_check_all').prop('checked', false);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.always(function(oData){\n\t\t\t\t\t\t\t\t\/\/ Hiding loader\n\t\t\t\t\t\t\t\t$('#page_overlay').fadeOut(200);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\/\/ We come from a button\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t    \/\/ Updating input\n\t\t\t\t\t\t    updateInputValue_field_contacts_list_5c52c056c5a5c();\n\t\t\t\t\t\t\t\/\/ Updating items count\n\t\t\t\t\t\t\tupdateItemCount_field_contacts_list_5c52c056c5a5c();\n\t\t\t\t\t\t\t\/\/ Updating global checkbox\n\t\t\t\t\t\t\t$('#field_contacts_list_5c52c056c5a5c_check_all').prop('checked', false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\t\/\/ Handles items selection\/deselection\n\t\t\t\t\t\/\/ - Remove button state handler\n\t\t\t\t\tvar updateRemoveButtonState_field_contacts_list_5c52c056c5a5c = function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar bIsDisabled = (Object.keys(oSelectedItems_field_contacts_list_5c52c056c5a5c).length == 0);\n\t\t\t\t\t\t$('#btn_remove_field_contacts_list_5c52c056c5a5c').prop('disabled', bIsDisabled);\n\t\t\t\t\t};\n\t\t\t\t\t\/\/ - Item count state handler\n\t\t\t\t\tvar updateItemCount_field_contacts_list_5c52c056c5a5c = function()\n\t\t\t\t\t{\n\t\t\t\t\t\t$('#form_linkedset_toggler_field_contacts_list_5c52c056c5a5c > .text').text( oTable_field_contacts_list_5c52c056c5a5c.rows().count() );\n\t\t\t\t\t};\n\t\t\t\t\t\/\/ - Field input handler\n\t\t\t\t\tvar updateInputValue_field_contacts_list_5c52c056c5a5c = function()\n\t\t\t\t\t{\n\t\t\t\t\t    \/\/ Retrieving table rows\n\t\t\t\t\t    var aData = oTable_field_contacts_list_5c52c056c5a5c.rows().data().toArray();\n\t\t\t\t\t    \n\t\t\t\t\t    \/\/ Retrieving input values\n                        var oValues = JSON.parse($('#field_contacts_list_5c52c056c5a5c').val());\n                        oValues.add = {};\n                        oValues.remove = {};\n                        \n\t\t\t\t\t    \/\/ Checking removed objects\n\t\t\t\t\t    for(var i in oValues.current)\n\t\t\t\t\t    {\n\t\t\t\t\t        if($('#table_field_contacts_list_5c52c056c5a5c tr[role=\"row\"] input[data-object-id=\"'+i+'\"]').length === 0)\n                            {\n                                oValues.remove[i] = {};\n                            }\n\t\t\t\t\t    }\n\t\t\t\t\t    \n\t\t\t\t\t    \/\/ Checking added objects\n\t\t\t\t\t    for(var i in aData)\n\t\t\t\t\t    {\n\t\t\t\t\t        if(oValues.current[aData[i].id] === undefined)\n\t\t\t\t\t        {\n\t\t\t\t\t            oValues.add[aData[i].target_id] = {};\n                            }\n\t\t\t\t\t    }\n\t\t\t\t\t    \n                        \/\/ Setting input values\n                        $('#field_contacts_list_5c52c056c5a5c').val(JSON.stringify(oValues));\n\t\t\t\t\t};\n\n\t\t\t\t\t\/\/ Handles items remove\/add\n\t\t\t\t\t$('#btn_remove_field_contacts_list_5c52c056c5a5c').off('click').on('click', function(){\n\t\t\t\t\t\t\/\/ Removing items from table\n\t\t\t\t\t\toTable_field_contacts_list_5c52c056c5a5c.rows({selected: true}).remove().draw();\n\t\t\t\t\t\t\/\/ Resetting selected items\n\t\t\t\t\t\toSelectedItems_field_contacts_list_5c52c056c5a5c = {};\n\t\t\t\t\t\t\/\/ Updating form value\n\t\t\t\t\t\t$(\"[data-field-id='contacts_list'][data-form-path='objectform-ticket-create-5c52c05689d93']\").triggerHandler('set_current_value');\n\t\t\t\t\t\t\/\/ Updating global checkbox state\n\t\t\t\t\t\t$('#field_contacts_list_5c52c056c5a5c_check_all').prop('checked', false);\n\t\t\t\t\t\t\/\/ Updating remove button\n\t\t\t\t\t\tupdateRemoveButtonState_field_contacts_list_5c52c056c5a5c();\n\t\t\t\t\t});\n\t\t\t\t\t$('#btn_add_field_contacts_list_5c52c056c5a5c').off('click').on('click', function(){\n\t\t\t\t\t\t\/\/ Preparing current values\n\t\t\t\t\t\tvar aObjectIdsToIgnore = [];\n\t\t\t\t\t\t$('#table_field_contacts_list_5c52c056c5a5c tr[role=\"row\"] > td input[data-target-object-id]').each(function(iIndex, oElem){\n\t\t\t\t\t\t\taObjectIdsToIgnore.push( $(oElem).attr('data-target-object-id') );\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\/\/ Creating a new modal\n\t\t\t\t\t\tvar oModalElem;\n\t\t\t\t\t\tif($('.modal[data-source-element=\"btn_add_field_contacts_list_5c52c056c5a5c\"]').length === 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toModalElem = $('#modal-for-all').clone();\n\t\t\t\t\t\t\toModalElem.attr('id', '').attr('data-source-element', 'btn_add_field_contacts_list_5c52c056c5a5c').appendTo('body');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toModalElem = $('.modal[data-source-element=\"btn_add_field_contacts_list_5c52c056c5a5c\"]').first();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\/\/ Resizing to small modal\n\t\t\t\t\t\toModalElem.find('.modal-dialog').removeClass('modal-sm').addClass('modal-lg');\n\t\t\t\t\t\t\/\/ Loading content\n\t\t\t\t\t\toModalElem.find('.modal-content').html($('#page_overlay .overlay_content').html());\n\t\t\t\t\t\toModalElem.find('.modal-content').load(\n\t\t\t\t\t\t\t'\/pages\/exec.php\/object\/search\/from-attribute\/contacts_list\/Informatique?ar_token=eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIyIiwiU2VydmljZSI6IjciLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiI1In19&exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsFormPath: 'objectform-ticket-create-5c52c05689d93',\n\t\t\t\t\t\t\t\tsFieldId: 'contacts_list',\n\t\t\t\t\t\t\t\taObjectIdsToIgnore : aObjectIdsToIgnore\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfunction(sResponseText, sStatus, oXHR){\n\t\t\t\t\t\t\t    \/\/ Hiding modal in case of error as the general AJAX error handler will display a message\n\t\t\t\t\t\t\t    if(sStatus === 'error')\n\t\t\t\t\t\t\t    {\n\t\t\t\t\t\t\t        oModalElem.modal('hide');\n\t\t\t\t\t\t\t    }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\toModalElem.modal('show');\n\t\t\t\t\t});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"org_id":{"id":"org_id","html":"<div class=\"form-group form_group_small\"><input type=\"hidden\" id=\"field_org_id_5c52c056cd046\" name=\"org_id\" value=\"220\" class=\"form-control\" \/><\/div>","js_inline":"","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"request_type":{"id":"request_type","html":"<div class=\"form-group form_group_small\"><input type=\"hidden\" id=\"field_request_type_5c52c056cf073\" name=\"request_type\" value=\"\" class=\"form-control\" \/><\/div>","js_inline":"     \t\t\t\t\t$(\"[data-field-id='request_type'][data-form-path='objectform-ticket-create-5c52c05689d93']\").portal_form_field({\"validators\":{\"mandatory\":{\"reg_exp\":\".*\\\\S.*\",\"message\":\"Veuillez remplir ce champ\"}}});\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]},"attachments_for_form_objectform-ticket-create-5c52c05689d93":{"id":"attachments_for_form_objectform-ticket-create-5c52c05689d93","html":"<div class=\"form-group\"><div class=\"form_field_label\"><label for=\"field_attachments_for_form_objectform-ticket-create-5c52c05689d93_5c52c056d14fa\" class=\"control-label\">Pi&egrave;ces jointes<\/label><\/div><div class=\"form_field_control\"><div class=\"help-block\"><\/div><div class=\"fileupload_field_content\"><div class=\"attachments_container row\"><\/div><div class=\"upload_container row\">Ajouter une pi\u00e8ce jointe: <input type=\"file\" id=\"field_attachments_for_form_objectform-ticket-create-5c52c05689d93_5c52c056d14fa\" name=\"attachments_for_form_objectform-ticket-create-5c52c05689d93\" \/><span class=\"loader glyphicon glyphicon-refresh\"><\/span>(Taille de fichier max.: 24.00 Mb)<\/div><\/div><\/div><\/div>","js_inline":" \t\t\tvar RemoveAttachment = function(sAttId)\n\t\t\t{\n\t\t\t\t$('#attachment_' + sAttId).attr('name', 'removed_attachments[]');\n\t\t\t\t$('#display_attachment_' + sAttId).hide();\n\t\t\t};\n\n\t\t\t$('#field_attachments_for_form_objectform-ticket-create-5c52c05689d93_5c52c056d14fa').fileupload({\n\t\t\t\turl: '\/pages\/exec.php\/object\/attachment\/add?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal',\n\t\t\t\tformData: { operation: 'add', temp_id: 'd6bk96abv313fm0ftscdtk49g9_0564856001548927062', object_class: 'Informatique', 'field_name': 'attachments_for_form_objectform-ticket-create-5c52c05689d93' },\n\t\t\t\tdataType: 'json',\n\t\t\t\tpasteZone: null, \/\/ Don't accept files via Chrome's copy\/paste\n\t\t\t\tdone: function (e, data) {\n\t\t\t\t\tif((data.result.error !== undefined) && window.console)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(data.result.error);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar sDownloadLink = '\/pages\/exec.php\/object\/attachment\/download\/-sAttachmentId-?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal'.replace(\/-sAttachmentId-\/, data.result.att_id);\n\n\t\t\t\t\t\t$(this).closest('.fileupload_field_content').find('.attachments_container').append(\n\t\t\t\t\t\t\t'<div class=\"attachment col-xs-6 col-sm-3 col-md-2\" id=\"display_attachment_'+data.result.att_id+'\">'+\n\t\t\t\t\t\t\t'\t<a data-preview=\"'+data.result.preview+'\" href=\"'+sDownloadLink+'\" title=\"'+data.result.msg+'\">'+\n\t\t\t\t\t\t\t'\t\t<div class=\"attachment_icon\"><img src=\"'+data.result.icon+'\"><\/div>'+\n\t\t\t\t\t\t\t'\t\t<div class=\"attachment_name\">'+data.result.msg+'<\/div>'+\n\t\t\t\t\t\t\t'\t\t<input id=\"attachment_'+data.result.att_id+'\" type=\"hidden\" name=\"attachments[]\" value=\"'+data.result.att_id+'\"\/>'+\n\t\t\t\t\t\t\t'\t<\/a>'+\n\t\t\t\t\t\t\t'\t<input type=\"button\" class=\"btn btn-xs btn-danger hidden\" value=\"Supprimer\"\/>'+\n\t\t\t\t\t\t\t'<\/div>'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\/\/ Preview tooltip\n\t\t\t\t\t\tif(data.result.preview){\n\t\t\t\t\t\t\t$('#display_attachment_'+data.result.att_id).tooltip({\n\t\t\t\t\t\t\t\thtml: true,\n\t\t\t\t\t\t\t\ttitle: function(){ return '<img src=\"'+sDownloadLink+'\" style=\"max-width: 100%;\" \/>'; }\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\/\/ Showing remove button on hover\n\t\t\t\t\t\t$('#display_attachment_'+data.result.att_id).hover( function(){\n\t\t\t\t\t\t\t$(this).children(':button').toggleClass('hidden');\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\/\/ Remove button handler\n\t\t\t\t\t\t$('#display_attachment_'+data.result.att_id+' :button').click(function(oEvent){\n\t\t\t\t\t\t\toEvent.preventDefault();\n\t\t\t\t\t\t\tRemoveAttachment(data.result.att_id);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tstart: function() {\n\t\t\t\t\t\/\/ Scrolling to dropzone so the user can see that attachments are uploaded\n\t\t\t\t\t$(this)[0].scrollIntoView();\n\t\t\t\t\t\/\/ Showing loader\n\t\t\t\t\t$(this).closest('.upload_container').find('.loader').css('visibility', 'visible');\n\t\t\t\t},\n\t\t\t\tstop: function() {\n\t\t\t\t\t\/\/ Hiding the loader\n\t\t\t\t\t$(this).closest('.upload_container').find('.loader').css('visibility', 'hidden');\n\t\t\t\t\t\/\/ Adding this field to the touched fields of the field set so the cancel event is called if necessary\n\t\t\t\t\t$(this).closest(\".field_set\").trigger(\"field_change\", {\n\t\t\t\t\t\tid: 'field_attachments_for_form_objectform-ticket-create-5c52c05689d93_5c52c056d14fa',\n\t\t\t\t\t\tname: 'attachments_for_form_objectform-ticket-create-5c52c05689d93'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\n\t\t\t\/\/ Preview tooltip\n\t\t\t$('.attachment [data-preview=\"true\"]').each(function(iIndex, oElem){\n\t\t\t\t$(oElem).parent().tooltip({\n\t\t\t\t\thtml: true,\n\t\t\t\t\ttitle: function(){ return '<img src=\"'+$(oElem).attr('href')+'\" style=\"max-width: 100%;\" \/>'; }\n\t\t\t\t});\n\t\t\t});\n\t\t\t\/\/ Remove button handler\n\t\t\t$('.attachments_container .attachment :button').click(function(oEvent){\n\t\t\t\toEvent.preventDefault();\n\t\t\t\tRemoveAttachment($(this).closest('.attachment').find(':input[name=\"attachments[]\"]').val());\n\t\t\t});\n\t\t\t\/\/ Remove button showing\n\t\t\tif(true)\n\t\t\t{\n\t\t\t\t$('.attachment').hover( function(){\n\t\t\t\t\t$(this).find(':button').toggleClass('hidden');\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t\/\/ Handles a drag \/ drop overlay\n\t\t\tif($('#drag_overlay').length === 0)\n\t\t\t{\n\t\t\t\t$('body').append( $('<div id=\"drag_overlay\" class=\"global_overlay\"><div class=\"overlay_content\"><div class=\"content_uploader\"><div class=\"icon glyphicon glyphicon-cloud-upload\"><\/div><div class=\"message\">D\u00e9posez vos fichiers pour les ajouter en pi\u00e8ces jointes<\/div><\/div><\/div><\/div>') );\n\t\t\t}\n\n\t\t\t\/\/ Handles highlighting of the drop zone\n\t\t\t\/\/ Note : This is inspired by itop-attachments\/main.attachments.php\n\t\t\t$(document).on('dragover', function(oEvent){\n\t\t\t\tvar bFiles = false;\n\t\t\t\tif (oEvent.dataTransfer && oEvent.dataTransfer.types)\n\t\t\t\t{\n\t\t\t\t\tfor (var i = 0; i < oEvent.dataTransfer.types.length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (oEvent.dataTransfer.types[i] == \"application\/x-moz-nativeimage\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbFiles = false; \/\/ mozilla contains \"Files\" in the types list when dragging images inside the page, but it also contains \"application\/x-moz-nativeimage\" before\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (oEvent.dataTransfer.types[i] == \"Files\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbFiles = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!bFiles) return; \/\/ Not dragging files\n\n\t\t\t\tvar oDropZone = $('#drag_overlay');\n\t\t\t\tvar oTimeout = window.dropZoneTimeout;\n\t\t\t\t\/\/ This is to detect when there is no drag over because there is no \"drag out\" event\n\t\t\t\tif (!oTimeout) {\n\t\t\t\t\toDropZone.removeClass('drag_out').addClass('drag_in');\n\t\t\t\t} else {\n\t\t\t\t\tclearTimeout(oTimeout);\n\t\t\t\t}\n\t\t\t\twindow.dropZoneTimeout = setTimeout(function () {\n\t\t\t\t\twindow.dropZoneTimeout = null;\n\t\t\t\t\toDropZone.removeClass('drag_in').addClass('drag_out');\n\t\t\t\t}, 200);\n\t\t\t});\n\n","css_inline":"","js_files":[],"css_files":[],"css_classes":["form_field_cosy"]}}});
        // Form handler declaration
        $('#objectform-ticket-create-5c52c05689d93').portal_form_handler({
            formmanager_class: "Combodo\x5CiTop\x5CPortal\x5CForm\x5CObjectFormManager",
            formmanager_data: {"id":"objectform-ticket-create-5c52c05689d93","transaction_id":"0564856001548927062","formmanager_class":"Combodo\\iTop\\Portal\\Form\\ObjectFormManager","formrenderer_class":"Combodo\\iTop\\Renderer\\Bootstrap\\BsFormRenderer","formrenderer_endpoint":"\/pages\/exec.php\/object\/create\/Informatique?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal","formobject_class":"Informatique","formmode":"create","formactionrulestoken":"eyJydWxlcyI6WyJjb250YWN0LXRvLXVzZXJyZXF1ZXN0Iiwic2VydmljZXN1YmNhdGVnb3J5LXRvLXVzZXJyZXF1ZXN0IiwiZ28tdG8tb3Blbi1yZXF1ZXN0LW9uLXN1Ym1pdCJdLCJzb3VyY2VzIjp7IlNlcnZpY2VGYW1pbHkiOiIyIiwiU2VydmljZSI6IjciLCJTZXJ2aWNlU3ViY2F0ZWdvcnkiOiI1In19","formproperties":{"id":"ticket-create","type":"custom_list","properties":{"display_mode":"cosy","always_show_submit":false},"fields":[],"layout":{"type":"xhtml","content":"  <div class=\"row\">\n    <div class=\"col-sm-6\">\n      <div class=\"form_field\" data-field-id=\"service_id\" data-field-flags=\"mandatory\">\n\t\t\t\t\t\t\t\t<\/div>\n    <\/div>\n    <div class=\"col-sm-6\">\n      <div class=\"form_field\" data-field-id=\"servicesubcategory_id\" data-field-flags=\"mandatory\">\n\t\t\t\t\t\t\t\t<\/div>\n    <\/div>\n  <\/div>\n  <div id=\"service_details_placeholder\">\n\t\t\t\t\t\t<\/div>\n  <div class=\"row\">\n    <div class=\"col-sm-6\">\n      <div class=\"form_field\" data-field-id=\"impact\">\n\t\t\t\t\t\t\t\t<\/div>\n    <\/div>\n    <div class=\"col-sm-6\">\n      <div class=\"form_field\" data-field-id=\"urgency\">\n\t\t\t\t\t\t\t\t<\/div>\n    <\/div>\n  <\/div>\n  <div>\n    <div class=\"form_field\" data-field-id=\"title\">\n\t\t\t\t\t\t\t<\/div>\n    <div class=\"form_field\" data-field-id=\"description\">\n\t\t\t\t\t\t\t<\/div>\n    <div class=\"form_field\" data-field-id=\"contacts_list\">\n\t\t\t\t\t\t\t<\/div>\n  <\/div>"}}},
            field_set: oFieldSet_objectformticketcreate5c52c05689d93,
            submit_btn_selector: $('#objectform-ticket-create-5c52c05689d93').parent().find('.form_btn_submit, .form_btn_transition'),
            cancel_btn_selector: $('#objectform-ticket-create-5c52c05689d93').parent().find('.form_btn_cancel'),
            submit_url: "/pages/exec.php/manage/ongoing-tickets-for-portal-user?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal",
            cancel_url: null,
            endpoint: "/pages/exec.php/object/create/Informatique?exec_module=itop-portal-base&exec_page=index.php&portal_id=itop-portal",
            is_modal: true      });
    
        // Sticky buttons handler
                    if( $('#objectform-ticket-create-5c52c05689d93 .form_btn_regular button').length > 0 )
            {
                // Note : This pattern if to prevent performance issues
                // - Cloning buttons
                var oNormalRegularButtons_objectformticketcreate5c52c05689d93 = $('#objectform-ticket-create-5c52c05689d93 .form_btn_regular');
                var oStickyRegularButtons_objectformticketcreate5c52c05689d93 = oNormalRegularButtons_objectformticketcreate5c52c05689d93.clone(true, true);
                oStickyRegularButtons_objectformticketcreate5c52c05689d93.addClass('sticky');
                if(oStickyRegularButtons_objectformticketcreate5c52c05689d93.find('.form_btn_submit span.glyphicon').length > 0)
                {
                    oStickyRegularButtons_objectformticketcreate5c52c05689d93.find('.form_btn_submit').html( oStickyRegularButtons_objectformticketcreate5c52c05689d93.find('.form_btn_submit span.glyphicon')[0].outerHTML );
                }
                if(oStickyRegularButtons_objectformticketcreate5c52c05689d93.find('.form_btn_cancel span.glyphicon').length > 0)
                {
                    oStickyRegularButtons_objectformticketcreate5c52c05689d93.find('.form_btn_cancel').html( oStickyRegularButtons_objectformticketcreate5c52c05689d93.find('.form_btn_cancel span.glyphicon')[0].outerHTML );
                }
    
                $('#objectform-ticket-create-5c52c05689d93').closest('.modal').append(oStickyRegularButtons_objectformticketcreate5c52c05689d93);
    
                // - Global timeout for any
                var oScrollTimeout;
                // - Scroll handler
                scrollHandler_objectformticketcreate5c52c05689d93 = function () {
                    if($('#objectform-ticket-create-5c52c05689d93 .form_buttons').visible())
                    {
                        oStickyRegularButtons_objectformticketcreate5c52c05689d93.addClass('closed');
                    }
                    else
                    {
                        oStickyRegularButtons_objectformticketcreate5c52c05689d93.removeClass('closed');
                    }
                };
                // - Event binding for scroll
                $('.modal.in').off('scroll').on('scroll', function () {
                    if (oScrollTimeout) {
                        // Clear the timeout, if one is pending
                        clearTimeout(oScrollTimeout);
                        oScrollTimeout = null;
                    }
                    oScrollTimeout = setTimeout(scrollHandler_objectformticketcreate5c52c05689d93, 50);
                });
                // - Event binding for linkedset collapse
                $('.modal.in').off('shown.bs.collapse hidden.bs.collapse').on('shown.bs.collapse hidden.bs.collapse', function () {
                    scrollHandler_objectformticketcreate5c52c05689d93();
                });
                // - Event binding for form building / updating
                // Note : We do not want to 'off' the event or it will remove listeners from the widget
                oFieldSet_objectformticketcreate5c52c05689d93.on('form_built', function(oEvent){
                    scrollHandler_objectformticketcreate5c52c05689d93();
                });
                // - Initial test
                setTimeout(function(){ scrollHandler_objectformticketcreate5c52c05689d93(); }, 400);
    
                // Remove sticky button when closing modal
                $('#objectform-ticket-create-5c52c05689d93').closest('.modal').on('hide.bs.modal', function () {
                    oStickyRegularButtons_objectformticketcreate5c52c05689d93.remove();
                });
            }
    
                    // Scroll top (because sometimes when several modals have been opened)
            $('#objectform-ticket-create-5c52c05689d93').closest('.modal').scrollTop(0);
            $('#objectform-ticket-create-5c52c05689d93').closest('.modal').find('.modal-footer').hide();
            });
    </script></div>
    <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>
            </div>
    
     
  • Rafael AINCIART

    Rafael AINCIART - 2019-01-31

    I just installed a new instance of iTop (2.6.0). The creation of the Ticket works fine.
    Before adding my extension, I save the source code of the page.
    After adding my extension, creation of the Ticket doesn't work and the main difference I can see between the 2 codes concerns the following instruction :

    <script type="text/javascript">
            ...
            var oLevelsProperties =...;
    </script>
    

    Before customization :
    "factory":{"type":"class","value":"UserRequest"}
    After customization :
    "factory":{"type":"method","value":"\\Ticket::CreateFromServiceSubcategory"}

    Is there an error in this instruction ?

    Thanks for your help !

    Regards,

    Rafael.

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.