Menu

How can I hide buttons when a user submits a request and just add 'Submit'?

Ian Walker
2019-08-07
2019-09-19
1 2 > >> (Page 1 of 2)
  • Ian Walker

    Ian Walker - 2019-08-07

    How can I edit the iTop user portal so that when a new request is created by the end-user the ‘Assign’ and ‘Wait for Approval’ buttons (in orange at the bottom of the window to create a new request) are hidden and replaced by a simple ‘Submit’ button instead which, when clicked, just adds the new ticket in to the system?

    Please see the attached image for the buttons in question.

    I am very new to ITOP so any help is very much appreciated!

    Thanks.
    Ian

     
  • Guillaume Lajarige

    Hello Ian,

    Those buttons appears when the connected user is allowed to make the transitions. To remove them, you can change the default portal behavior and forbid those transition for some profiles. Check this page of the documentation under //classes/class/lifecycle/stimuli/stimulus.

    A bit lower in the same page, you will see an example.

    This has to be done through an extension, you can find a how-to in the online documentation as well.

    Hope it helps,
    Guillaume

     
  • Ian Walker

    Ian Walker - 2019-08-07

    Thanks so much for replying Guillaume! I'm not much of a coder so I was kind of hoping it would be a little easier to do this. I will take a look at the documentationa and see what I can come up with.

    Many thanks.

     
    • Guillaume Lajarige

      Give it a try, and we will help you with the debugging. Many people on the forum have written extensions, so you get some help :)

       
  • Ian Walker

    Ian Walker - 2019-08-07

    Will do, thanks!

    I'm also interested in how I can possibly integrate ITOP with JIRA too. Is there a plugin or extension for that? That's my next thing to try :)

    Thanks again.

     
    • Guillaume Lajarige

      For that second matter, you should open a dedicated topic, otherwise we might mix tings up. (Specify what you mean by integrating)

       

      Last edit: Guillaume Lajarige 2019-08-07
  • Ian Walker

    Ian Walker - 2019-08-07

    Thanks again!

    I will.

     
    👍
    1
  • Ian Walker

    Ian Walker - 2019-08-08

    I don't suppose there is a way to edit the required settings from the admin portal itself and then deploy the changes, instead of having to access the server files directly? If not, is that ever considered as a possible new feature? It would make customisation in terms of look and feel far easier to work with - thanks!

     
  • Guillaume Lajarige

    Hello Ian,

    You must make an extension and deploy it on the server's file system, that's the way iTop can be customize. It's a little bit technical, but once you get how it works, it allows you to do a LOT a things.

    Are you stucked in the extension development or you don't have user permission to access the server?

     
  • Ian Walker

    Ian Walker - 2019-08-08

    I don't have access to the server. I am working on this with an IT guy, but they are not available today. and I am not sure if they will be much of a developer either.

    So I am working on other ITOP configuration stuff right now and have several other open threads with questions!

    Many thanks for replying, Guillaume!

    Ian

     
  • Guillaume Lajarige

    For which profiles do you wish to remove the transitions in the portal? I'm sure someone can make the extension as it is pretty straight forward.

     
  • Ian Walker

    Ian Walker - 2019-08-08

    It would be for all profiles. So that, when they create a new user request, they just fill out the details and click 'Submit'.

     
  • Guillaume Lajarige

    Put the following XML in an extension and you will be good to go 🖖

    <?xml version="1.0" encoding="UTF-8"?>
    <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.6">
      <module_designs>
        <module_design id="itop-portal">
          <classes>
            <class id="UserRequest">
              <lifecycle>
                <stimuli>
                  <stimulus id="ev_assign" _delta="define"/>
                  <stimulus id="ev_wait_for_approval" _delta="define"/>
                </stimuli>
              </lifecycle>
            </class>
            <class id="Incident">
              <lifecycle>
                <stimuli>
                  <stimulus id="ev_assign" _delta="define"/>
                </stimuli>
              </lifecycle>
            </class>
          </classes>
        </module_design>
      </module_designs>
    </itop_design>
    
     
    👍
    1
    • Ian Walker

      Ian Walker - 2019-08-09

      Thank you so much for this, Guillaume. I really appreciate it. I will get an extension made and installed to test it.

       
      • Guillaume Lajarige

        Check this page to know how to make an extension. :)

         
        • Ian Walker

          Ian Walker - 2019-08-13

          Hi Guillaume.

          I tried to make an extension using that code, and I tried to deploy it, and it failed.

          https://ibb.co/44f0dyB

          You can see my extension in the zip attached.

          Thanks - Ian

           
          • Guillaume Lajarige

            Hello Ian,

            Jeffrey is right, you need to add a dependency to the module adding the XML tags you are trying to change. In your case itop-portal:

            ...
            
            SetupWebPage::AddModule(
                __FILE__, // Path to the current file, all other file names are relative to the directory containing this file
                'ian-module/1.0.0',
                array(
                    // Identification
                    //
                    'label' => 'Ian Module',
                    'category' => 'business',
            
                    // Setup
                    //
                    'dependencies' => array(
                        'itop-portal/2.6.0',
                    ),
            
                    ...
            
             
            👍
            1
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2019-08-13

    What exactly was the error?

    Simply at first sight, I think you may need to add a dependency in module.ian-module.php to itop-portal/2.6.0 (or whatever your iTop version is)

     
    👍
    1
  • Ian Walker

    Ian Walker - 2019-08-13

    Thanks Jeffrey and Guilaume, I will give that a try.

    Is there any sort of wiki page or article that explains the contents of each ITOP file that can be edited, so I know where to look to get the right stuff for my modules?

    I kind of want to put all the requirements below in to one extension, is that recommended? I want to do the tasks below but I am not sure in which files to look to find the required data for an extension.

    1 - Remove Wait and Assign buttons from user request form and just show submit.
    2 - Remove Contacts option from new user request form.
    3 - Remove Impacts and Priority from new user request form and respective ticket stored or created in the backend.
    4 - Add new drop-downs to the change management and incident management forms and remove some.
    5 - When a user chooses either change management or incident management from our service catalog then the ticket request form includes the same layout from requirement 3.
    6 - When selecting either Incident Management or Change Management from the backend then a new change or incident has the same fields as in number 3.

    If you can point me as to where to find the correct information for each of these then I can try to write extensions.

    Regards - Ian

     
  • Vincent @ Combodo

    Hello Ian,
    None of the iTop file is expected to be edited, which is why we do not document how they are organized.
    What need to be done in your case is to create an extension (one is enough as all your changes related to the portal). Within that extension, you will mainly enter XML code to alter the default.
    To retrieve the default XML code of the Portal, go on a server with your iTop installed and check the file <itop>/data/datamodel-production.xml
    It contains the full datamodel of your iTop in XML, check for the portal part. It's a good basis for writing your modification. It will give you the XML strutucture and the id of the Bricks and Forms.
    https://www.itophub.io/wiki/page?id=2_6_0%3Acustomization%3Astart
    and https://www.itophub.io/wiki/page?id=2_6_0%3Acustomization%3Axml_reference</itop>

     
    👍
    2
    • Ian Walker

      Ian Walker - 2019-08-13

      Hi vdumas.

      Thanks for taking the time to reply. You've confirmed what I thought and how it kind of works. But surely there is additional work involved if, say, I wanted to add a new drop-down when creating a new user request and then I wanted that stored data to be viewed inside the ticket in the backend - does that make sense?

      So, say I wanted to add a new drop-down called 'Service' when a user chooses Change Management from the service catalogue in our user portal. I want whatever value the user picks from that drop-down to appear in the backend ticket once submitted.

      I will take a look at that file, thanks again!

      Many thanks - Ian

       
  • Vincent @ Combodo

    Hi Ian,
    Start with this tutorial: https://www.itophub.io/wiki/page?id=2_6_0%3Acustomization%3Aadd-attribute-sample it will explains how to add a field to Server, but, replace Server by Ticket or UserRequest and go.
    A drop-down field is going to be either a AttributeEnum or an AttributeExternalKey. In the above example, they add an AttributeText.
    Check the XML reference for the tags required depending on the Attribute type you want as they differ...
    Vincent

     
    👍
    2
    • Ian Walker

      Ian Walker - 2019-08-14

      Hi Vincent.

      I managed to do the tutorial successfully, it took me three attempts! I will try and see if I can edit some more stuff too.

      Regards, Ian

       

      Last edit: Ian Walker 2019-08-14
  • Ian Walker

    Ian Walker - 2019-08-14

    So I am trying to make my first extension (not sure if this should be a new topic or not?).

    What I want to do is this:

    For user requests:

    1 - Remove Impact and Priority and Urgency options (we want the ServiceDesk to set impact, priority and urgency based on the requests that come in).
    2 - Remove contact option.
    3 - Remove unecessary ticket statuses from the status attribute.

    (See image with what I want to remove).

    I am looking at the datamodel.itop-request-mgmt.xml file and I think I have found the code that relates to 1.

    <field id="user-content-impact" xsi:type="AttributeEnum">
    <values>
    <value id="user-content-1">1</value>
    <value id="user-content-2">2</value>
    <value id="user-content-3">3</value>
    </values>
    <sql>impact</sql>
    <defaultvalue>1</defaultvalue>
    <isnullallowed>false</isnullallowed>
    <displaystyle>list</displaystyle>
    </field>
    <field id="user-content-priority" xsi:type="AttributeEnum">
    <values>
    <value id="user-content-1">1</value>
    <value id="user-content-2">2</value>
    <value id="user-content-3">3</value>
    <value id="user-content-4">4</value>
    </values>
    <dependencies>
    <attribute id="user-content-impact">
    <attribute id="user-content-urgency">
    </attribute></attribute></dependencies>
    <sql>priority</sql>
    <defaultvalue>4</defaultvalue>
    <isnullallowed>false</isnullallowed>
    </field>
    <field id="user-content-urgency" xsi:type="AttributeEnum">
    <values>
    <value id="user-content-1">1</value>
    <value id="user-content-2">2</value>
    <value id="user-content-3">3</value>
    <value id="user-content-4">4</value>
    </values>
    <sql>urgency</sql>
    <defaultvalue>4</defaultvalue>
    <isnullallowed>false</isnullallowed>
    </field>*

    My question is, how do I tell my extension to not use the above code so that Impact, Urgency and Priority are not shown and also how does that affect the ticket once submitted to the system - is more work needed?

    For 2, I am not sure but for 3 I have attempted something in the included extension. Any comments is much appreciated.

    Regards - Ian

     

    Last edit: Ian Walker 2019-08-14
  • Vincent @ Combodo

    Hello Ian,
    Your XML is not compliant with the XML reference at all.
    I told you to modify the portal, but you are trying to modify the object data structure (within the portal tag which cannot work).
    Point 1 and 2, can be done easily by overwriting the form within the Portal part of the XML.
    I am planning to write a tutorial on this one...
    Point 3, is way more tricky, as removing states, means removing transitions as well. It has also an impact on compatibilities with available extensions, as they may rely on existing states... There is no tutorial on this yet, also it's a pure XML customization. I'd suggest you to wait until you master the XML structure better.

     
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.