Menu

RequestTicket - History on Ticket Edit Form

2020-12-13
2020-12-13
  • Mushrraf Baig Ashraf

    Hello! Hopefully you are fine!

    I want to display the History Tab on the Edit Form in Portal. To be precise, something to be put inside this:

    <form id="ticket-edit" _delta="redefine">
        <twig>
            ..............
        </twig>
        </form>
    

    I want to know both options:

    1: To display the whole tab.

    2: To display specific entries.

    Any help would be appreciated!

    Regards
    Mushrraf Baig Ashraf

     
  • Molkobain

    Molkobain - 2020-12-13

    Hello Mushrraf,

    Unfortunately it's tno possible (natively) to display the history in the end-users portal.
    This only you could do this is by creating a rather complex iTop extension.

    Take care,
    Guillaume

     
  • Mushrraf Baig Ashraf

    Infact, I have noticed a function DisplayBareHistory with the following code:

    $oHistoryFilter = new DBObjectSearch('CMDBChangeOp');
    $oHistoryFilter->AddCondition('objkey', $this->GetKey(), '=');
    $oHistoryFilter->AddCondition('objclass', get_class($this), '=');
    $oBlock = new HistoryBlock($oHistoryFilter, 'table', false);
    $oBlock->SetLimit($iLimitCount, $iLimitStart);
    $oBlock->Display($oPage, 'history');

    So, hopefully I can use it.

    As for what you said, I am already working in an extension. So, I can tread this complex path, God willing.

    I am not getting the exact Interface funtion which would let me to change the HTML of "Editing Request" form

    I tried the following code but it gets called on the form creation, not on the edition:

    <method id="DisplayBareRelations" _delta="redefine">
                    <static>false</static>
                    <access>public</access>
                    <type>Overload-cmdbAbstractObject</type>
                    <code><![CDATA[public function DisplayBareRelations(WebPage $oPage, $bEditMode = false)
                  {       
                     exit("Came Inside");
    
                  }]]>
                    </code>
                </method>
    

    So, I hope that if you only refer to the function which gets called on RequestEdit (objectform-ticket-edit), then I am hopeful to get it to work.

    Regards
    Mushrraf Baig Ashraf

     
  • Molkobain

    Molkobain - 2020-12-13

    This method can only be used in the backoffice part of iTop, not the portal. For instance, the $oPage parameter does not exist in the portal, only in the backoffice.

    Cheers,
    Guillaume

     

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.