<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://greggsmith.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Display_Buttons_for_specific_Roles_only</id>
		<title>Display Buttons for specific Roles only - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://greggsmith.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Display_Buttons_for_specific_Roles_only"/>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Display_Buttons_for_specific_Roles_only&amp;action=history"/>
		<updated>2026-04-17T14:14:18Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.1</generator>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Display_Buttons_for_specific_Roles_only&amp;diff=3993&amp;oldid=prev</id>
		<title>Kowy: New page: __NOTOC__ Category:Customizations Category:r12 {{Global Header}} {{Global Announcement}}  == Overview == This article describe in example how to simply show a button (or anything e...</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Display_Buttons_for_specific_Roles_only&amp;diff=3993&amp;oldid=prev"/>
				<updated>2009-12-02T10:49:54Z</updated>
		
		<summary type="html">&lt;p&gt;New page: __NOTOC__ &lt;a href=&quot;/wiki/index.php?title=Category:Customizations&quot; title=&quot;Category:Customizations&quot;&gt;Category:Customizations&lt;/a&gt; &lt;a href=&quot;/wiki/index.php?title=Category:R12&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:R12 (page does not exist)&quot;&gt;Category:r12&lt;/a&gt; {{Global Header}} {{Global Announcement}}  == Overview == This article describe in example how to simply show a button (or anything e...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
[[Category:Customizations]]&lt;br /&gt;
[[Category:r12]]&lt;br /&gt;
{{Global Header}}&lt;br /&gt;
{{Global Announcement}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
This article describe in example how to simply show a button (or anything else, button code of course can be easily changed) on page only for some specific roles.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
This example draws a button &amp;quot;Convert to incident&amp;quot; only for roles ''Administrator'', ''Level 1 Analyst'' and ''Service Desk Manager''. You can place it anywhere into detail_cr.htmpl page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var role_list_txt = &amp;lt;PDM_FMT ESC_STYLE=C PAD=NO&amp;gt;&amp;quot;$SESSION.ROLE_LIST&amp;quot;&amp;lt;/PDM_FMT&amp;gt;;&lt;br /&gt;
var role_list = role_list_txt.split( &amp;quot;@,@&amp;quot; );&lt;br /&gt;
if (role_list.length &amp;gt; 2)&lt;br /&gt;
{&lt;br /&gt;
	var roleName = '';&lt;br /&gt;
	for (var i=1; i&amp;lt;role_list.length; i+=2) {&lt;br /&gt;
		if (role_list[i] == $SESSION.ROLE_ID) {&lt;br /&gt;
			roleName = role_list[i-1];&lt;br /&gt;
			break;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	if (roleName == 'Administrator' || roleName == 'Level 1 Analyst' || roleName == 'Service Desk Manager') {&lt;br /&gt;
		var popupURL = '$cgi?SID=$SESSION.SID+FID=' +  fid_generator() + &lt;br /&gt;
			'+FACTORY=cr+PERSID=$args.persistent_id+OP=UPDATE+ACTIVITY_LOG_TYPE=FLD+HTMPL=act_chgtype_cr.htmpl';&lt;br /&gt;
		&amp;lt;PDM_MACRO NAME=button CAPTION=&amp;quot;Convert to incident&amp;quot; ID=convert_to_incident &lt;br /&gt;
			FUNC=&amp;quot;popupActivityWithURL(popupURL, 'crtype')&amp;quot; WIDTH=180 NEWROW=yes ENDROW=yes&amp;gt;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''This example works only on SD R12!!!'''&lt;/div&gt;</summary>
		<author><name>Kowy</name></author>	</entry>

	</feed>