Just a final note on this - After doing some more investigation, it seems that while Request Tracker doesn't restrict you from creating 2 (or more) drop down values at the same level with the same string value, it also does't use the record ID to filter subsequent drop downs either. - it uses the string value to filter subsequent values. This means if you have 3 fields that filter you end up with a mess of child values that may not relate to the parent value anyway. <div>
<br></div><div>So it seems that adding a prefix or suffix to the text of the drop down value is the only way to achieve what I had wanted.</div><div><br></div><div><br><div><br></div><div><br></div><div><br><br><div class="gmail_quote">
On Mon, Nov 14, 2011 at 8:28 PM, Josh Narins <span dir="ltr"><<a href="mailto:jnarins@seniorbridge.com">jnarins@seniorbridge.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#FFFFFF"><font style="font-size:11.0pt;color:#1F497D">
The array of names is get-at-able with "keys %seen"<br></font><br> <br>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<font style="font-size:10.0pt"><div class="im">
<b>From</b>: Jim Lesinski [mailto:<a href="mailto:jim.lesinski@gmail.com" target="_blank">jim.lesinski@gmail.com</a>]
<br></div><b>Sent</b>: Monday, November 14, 2011 08:19 PM<br><b>To</b>: Josh Narins
<br><b>Cc</b>: <a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a> <<a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a>>
<br><div><div></div><div class="h5"><b>Subject</b>: Re: [rt-users] Categories are based on... How to handle the same value for multiple parent categories
<br></div></div></font> <br></div><div><div></div><div class="h5">
<div>Right, but I think then I'd have to build an array of names and then iterate through that second array to output the option values. I am not sure which would be more efficient but there is probably a better way to do it. </div>
<div><br></div><div>Either way the result of the code would be ideally added to the base code, but not necessarily my personal code :)<br><br>Thanks,<div>Jim Lesinski</div></div><div><br>On Nov 14, 2011, at 7:10 PM, Josh Narins <<a href="mailto:jnarins@seniorbridge.com" target="_blank">jnarins@seniorbridge.com</a>> wrote:<br>
<br></div><div></div><blockquote type="cite"><div><font style="font-size:11.0pt;color:#1F497D">
I don't know anything about your patch, but with Perl, it is more common to write something like...<br><br>next if $seen{ $value->Name }++;<br><br></font><br> <br>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<font style="font-size:10.0pt">
<b>From</b>: Jim Lesinski [mailto:<a href="mailto:jim.lesinski@gmail.com" target="_blank">jim.lesinski@gmail.com</a>]
<br><b>Sent</b>: Monday, November 14, 2011 07:06 PM<br><b>To</b>: <a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a> <<a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a>>
<br><b>Subject</b>: Re: [rt-users] Categories are based on... How to handle the same value for multiple parent categories
<br></font> <br></div>
I had some time after work to code up a possible solution for the searchbuilder. I am new to perl so feel free to correct me.<br><br>Below is a snippet of code from /html/Elements/SelectCustomFieldValue, starting at line 48. I have added my name after the lines I added to make the search builder drop down show only unique string values. It would be super cool if this made it into the base code.<br>
<br>% $m->callback( Name => $Name, CustomField => $CustomField );<br>% if ($CustomField->Type =~ /Select/i) {<br>% my $values = $CustomField->Values;<br><br>% my %seen = (); # Jim Lesinski<br><br><select name="<%$Name%>"><br>
<option value="" selected="selected">-</option><br><option value="NULL"><&|/l&>(no value)</&></option><br>% while (my $value = $values->Next) {<br>
% unless ($seen{$value->Name}){ # Jim Lesinski<br> <option value="<%$value->Name%>"><%$value->Name%></option><br>% $seen{$value->Name} = 1; # Jim Lesinski<br>
% } # Jim Lesinski<br>% }<br></select><br>% }<br>% else {<br><input name="<%$Name%>" size="20" /><br>% }<br><br><br><div class="gmail_quote">On Mon, Nov 14, 2011 at 2:09 PM, Jim Lesinski <span dir="ltr"><<a href="mailto:jim.lesinski@gmail.com" target="_blank">jim.lesinski@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I wouldn't think that the searchbuilder would show the same string value though if you have the value occurring multiple times based on a parent field. In my example below the value "softwarename1.1" will show up in the searchbuilder each time I have entered it for that field. </div>
<div><br></div><div>What I was suggesting is that one way to handle this would be to make the searchbuilder page only add a string value if that string value doesn't exist in the values already. That seems like the simplest was to avoid the same value from showing up several times in the searchbuilder. </div>
<div><br></div><div>Right now what happens is, you end up with 4 "Password Reset" Values in the example below. This also would create 4 "Password Reset" in the searchbuilder dropdown, which works because the search is based on the String value and not the ID of the record.</div>
<div><br></div><div>* Active Directory</div><div> * Password Reset</div><div>* TimeSheet</div> * Password Reset<div>* TestDomain</div> * Password Reset<div>* Whatever</div> * Password Reset<div><br></div>
<div><br></div><div>Just a suggestion... but an excellent way to handle it may be to add functionality to the "Categories are based on" drop down so that you select the parent field first, and then select each value that the current value is visible for. This would let you have a more flexible relationship for building the hierarchy. </div>
<div><br></div><div>Then you could select Field1 as the Parent for Field2, but also specify that Field2.Value1 would be an option when you select Field1.Value1, Field1.Value3, Field1.Value4, Field1.Value7 - etc.</div><div>
<div></div><div><div>
<br></div><div><br></div><div><br></div><div><br></div><div><br><div class="gmail_quote">On Mon, Nov 14, 2011 at 10:53 AM, Kevin Falcone <span dir="ltr"><<a href="mailto:falcone@bestpractical.com" target="_blank">falcone@bestpractical.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Fri, Nov 11, 2011 at 03:01:18PM -0500, Jim Lesinski wrote:<br>
> Hi,<br>
> In request tracker, how would you recommend setting up your dependent drop down lists that<br>
> have a consistent drop down value for multiple parent values? Below, under the 1st level<br>
> Administration value, I show an example of what I am asking about.<br>
<br>
</div>If you use the 'Categories are based on' feature in later 3.8 and 4.0<br>
you'll get much better search options than typing in the Category box.<br>
<br>
> * Hardware<br>
><br>
> * item1.1<br>
> * item1.2<br>
> * item1.3<br>
><br>
> * Software<br>
><br>
> * item2.1<br>
> * item2.2<br>
> * item2.3<br>
><br>
> * Administration<br>
><br>
> * password reset<br>
><br>
> * softwarename1.1<br>
> * softwarename1.2<br>
> * softwarename1.3<br>
><br>
> * profile update<br>
><br>
> * softwarename1.1<br>
> * softwarename1.2<br>
> * softwarename1.3<br>
<div>><br>
> I was able to set up the outline above by using the built in "categories are based on" option<br>
> for drop down lists and entering the value one time for each parent value. The only thing that<br>
> I see as a possible issue with doing this is that the search builder then shows the drop down<br>
> text value multiple times. Maybe just a bug or improvement that could be made in the<br>
> searchbuilder (ie; only show DISTINCT dropdownlist value)? Or should I handle this a different<br>
> way?<br>
> Either way I would appreciate your insight.<br>
> Thanks,<br>
> Jim<br>
<br>
</div><div><div></div><div>> <br><br>
<p><font size="2" face="Verdana"><strong>Josh Narins</strong></font><br><font size="1" face="Verdana">Director of Application Development<br>SeniorBridge</font></p>
<p><font size="1" face="Verdana">845 Third Ave<br>
7th Floor<br>New York, NY 10022 <br>
Tel:
<a href="tel:%28212%29%20994-6194" value="+12129946194" target="_blank">(212) 994-6194</a> <br>
Fax: <a href="tel:%28212%29%20994-4260" value="+12129944260" target="_blank">(212) 994-4260</a> <br>
Mobile: <a href="tel:%28917%29%20488-6248" value="+19174886248" target="_blank">(917) 488-6248</a><br><a href="mailto:jnarins@seniorbridge.com" target="_blank">jnarins@seniorbridge.com</a><br><a href="http://www.seniorbridge.com/" target="_blank">seniorbridge.com</a></font><br>
<br><img border="0" hspace="0" alt="SeniorBridge" align="baseline"></p><br><br>
<hr style="min-height:1px">
<font size="1" face="Verdana"><font color="silver"><strong>SeniorBridge Statement of
Confidentiality:</strong> The contents of this email message are intended for
the exclusive use of the addressee(s) and may contain confidential or privileged
information. Any dissemination, distribution or copying of this email by an
unintended or mistaken recipient is strictly prohibited. In said event, kindly
reply to the sender and destroy all entries of this message and any attachments
from your system. Thank you.</font></font>--------<br>
> RT Training Sessions (<a href="http://bestpractical.com/services/training.html" target="_blank">http://bestpractical.com/services/training.html</a>)<br>
> * Barcelona, Spain ? November 28 & 29, 2011<br>
<br>
</div></div><br>--------<br>
RT Training Sessions (<a href="http://bestpractical.com/services/training.html" target="_blank">http://bestpractical.com/services/training.html</a>)<br>
* Barcelona, Spain — November 28 & 29, 2011<br></blockquote></div><br></div>
</div></div></blockquote></div><br>
</div></blockquote></div></div></div></blockquote></div><br></div></div>