Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Copy button.

Highlighted
AlanMarch
Super Collector

Copy button.

Hello Everyone,

 

I know you can disable the copy button in the conf file, but this affects all requests system wide.  Does anyone know if it is possible to disable the copy button on a specific request type?

 

Thanks,

Alan

6 REPLIES
Jim Esler
Honored Contributor

Re: Copy button.

The Copy button is added to the page in RequestSecButtons.jsp. You can customize the logic here if you want to add criteria for including or excluding it.

Deep Mehta
Regular Collector

Re: Copy button.

Hi Alan, 

 

Any specific reason for not allowing users to copy? 

 

If you don't want request data to be copied over to new request, you can clear field values in the new request by:

1. Add a new execution step to the start of workflow with ksc_store command

2. Adding new line to request type commands section.

3. Set up rules (apply on creation) to clear field values.

 

eg. Use ksc_store command

ksc_store KNTA_PROJECT_TYPE=""

 

Hope you can find a workaround. 

 

Thanks,

Deep

vcaillea
Acclaimed Contributor

Re: Copy button.

Hi Alan,

 

1- Paste this JavaScript function below in your RequestRulesUserLibrary.js file (for each node PPM/server/<node>/deploy/itg.war/web/knta/crt/js) :

/*
*
* Hide the "Make a Copy" button - Works on IE and Firefox (but spacer not hidden on Firefox)
*
*/
function hideCopyButton() {
  var pageRefs,i;
  // Get array of <a> links
  pageRefs=document.getElementsByTagName('a');
  for(i in pageRefs)
  {
    // Look for the link which calls the request copy
    if(pageRefs[i].href == "javascript&colon;copyRequest(true);") {
        // Hide the parent (span) of the parent (td) of the link
        pageRefs[i].parentNode.parentNode.style.display="none";
        // Check if the sibbling button exists and if it is the "delete" button
        if (pageRefs[i].parentNode.parentNode.nextSibling.nextSibling.firstChild &&
            pageRefs[i].parentNode.parentNode.nextSibling.nextSibling.firstChild.firstChild.href == "javascript&colon;deleteRequest();")
          // Hide the blank spacer, so the "delete" button is well left aligned
          pageRefs[i].parentNode.parentNode.nextSibling.style.display="none";
    }
  }
}

2-Create a UI Rule on Load and call this function like hideCopyButton().

 

Regards,

Vince

AlanMarch
Super Collector

Re: Copy button.

Thank you everyone for your suggestions.  I'm familiar with some of them some others I am not, but I like everything that is suggested here.  I will try them and post my results.

gatienza
Occasional Contributor

Re: Copy button.

Hi, i have created the funtion in RequestRulesUserLibrary.js and have created the rule, but it doesn't work.

The button still appears. What is it happens? Thanks in advance

bzdafro
Collector

Re: Copy button.

We are looking to do something similar.   User copy requests and it pulls the Notes section (which we want to disable).  I didnt see a way to reset the Notes field using a rule, clear field (since Notes is built in token and not in the request header).   Is the best way to add a command as the first step? 

//Add this to "OnDomLoad" event