In SBM TeamTrack, how do we restrict actions depending on where a person is in the workflow?

Charity Pearsall's picture

I need to be able to restrict Adding/editing attachments based on where the person is in the workflow. Is that possible? if so, how?

4 Answers

Nikolay Ruban's picture

what about removing unnecessary items from dropdown on the fly? It is not secure, some "hacker" can easily trick the system and add attach, but for Intranet and loyal employees it should work. :)

Nikolay Ruban's picture

Using JavaScript you can remove options from actions dropdown, javascript can be added on stage of template rendering. You'll have to check ITem state and .WriteStream some javascript code to template being rendered. Later, o n client side, javascript will be run and 'll remove al unnecessary options from dropdown menu.

Charity Pearsall's picture

Can you give me an example of how to do this? I am still fairly new to scripting. Would I add this javascript to both the state and transition forms where I do not want to allow attachments?

Nikolay Ruban's picture

Yep, you'll have to add TTScript call to all templates where action dropdown is shown and should be "fixed". But in TT 6.1 this dropdown is loaded in separate frame with all transition buttons, called like formbuttons.

Here is link with small example adding code to template: http://bit.ly/fmufWC

In your case you'll have to do following:

- add $SCRIPT(ModifyActionDropdownForUser) call in proper templat. I preffer adding within javascript page init code.
- create TTScript(ModifyActionDropdownForUser)

Option Explicit
Dim vbCr , vbLf , vbCrLf , vbEol , vbQuote , vbSingleQuote , vbHtmlNewLine
vbCr = Chr(13)
vbLf = Chr(10)
vbCrLf = vbCr & vbLf
vbEol = "<BR>" + vbCrLf
vbHtmlNewLine = "<BR>" + vbCrLf
vbQuote = Chr(34)
vbSingleQuote = Chr(39)
Call Ext.WriteStream("//ModifyActionDropdownForUser" & vbCrLf )
Call Ext.WriteStream("alert('Hello World. Here we have to add code for modifying Action DropDown.');")

This is the basics. Hope this will help you or someone who will be interested in calling adding javascript within teamtrack templates via teamscript.

CMCrossroads is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.