Add the Log buttons to the Customized portlets in Project summary tab.

We have a requirement that to add the Log Button to the Customized Portlets in Project summary like Risks and Issues is having.

Please help.

Regards,

Praveen.

  • Suggested Answer

    0  

    Hi Praveen,

    It all depends on what your custom portlet is.

    - If it's a List Portlet, there is no way to have the button.

    - If it's a Request List Portlet, you can adda button in the Portlet Preference to create a new Request of the type displayed, but it will not automatically populate the Project Field if you create a Risk or Issue.

    The only way to get the behavior you're looking for is to create an HTML+ porlet (i.e. custom HTML/CSS/JS code) and add a button that will open the "Create Risk" request creation page while passing the project information using UI Rule  fillFieldsFromURL().  Check at the end of this PPM page for more information on this UI rule function: /itg/html/requestRulesJSFunctions.html

    As for getting the project information to pass to that method, currently you'll need your JS code to check in the Project page HTML code and retrieve the information from the HTML code. It's a bit tedious, but doable. FYI, this is the JS code I'm using in an HTML+ portlet I wrote to generate the CodeString value containing the Project ID and Project name - exactly what you'll need to pass to fillFieldsFromURL():

        let projectId = window.parent.document.getElementById('projectId').value;
      	let projectTitle = window.parent.document.getElementsByClassName('project-title-text')[0].childNodes[1].title;
        const regexpProjName = /Project:\W(.+)\W\(#\d+\)/;
        const match = projectTitle.match(regexpProjName);
        let projectName = match[1];
        let projectCode = projectId.length + '.' + projectName.length + '.' + projectId + '.' + projectName;

    Note that in next PPM version (25.1) we should introduce a new PPM Javascript API available for HTML+ portlets and custom code running on Request Details page that will very easily provide you the information of the page you're currently on - in our case, the project ID and project Name - without having to go look into the page HTML code. 

    Of course, leveraging an HTML+ portlet implies that you have Javascript development skills available in-house, and you'll have to re-create your whole table displaying your list of dependencies. But since you already have the datasource returning the project dependencies, the hardest part is done.