[rt-users] custom field type, checkboxes

Joel Schuweiler jschuweiler at fonality.com
Mon Mar 3 19:47:39 EST 2008


I'm not quite out of the woods yet, as I've decided to spend time trying 
to figure out rt's back end, such that checking and un-checking a value 
will work. I could whip this up fairly quickly with javascript, but 
where is the fun in that?

That said, I would appreciate any help anyone can provide. I'm currently 
poking around RT::ObjectCustomFieldValue_Overlay.pm

-Joel

Joel Schuweiler wrote:
> I personally did the following in my EditCustomFieldSelect (in my local dir)
>
> <%method options>
> % my $selected;
> % my $CFVs = $CustomField->Values;
> % my @levels;
> % while ($CFVs and my $value = $CFVs->Next )
> % {
>
> % if ($CustomField->MaxValues == 0 )
> % {
>
>                 <input type="checkbox" style="border: none;" 
> value="<%$value->Name%>"
> % if ($Values)
> % {
>                     <% $Values->HasEntry($value->Name) && ($$SelectedRef 
> = 1) && 'CHECKED' %>
> % }
> % elsif ($Default)
> % {
>                     <% (ref $Default ? (grep {$_ eq $value->Name} 
> @{$Default}) : ($Default eq $value->Name))
>                         && ($$SelectedRef = 1) && 'CHECKED' %>
> % }
>                 ><% $value->Name%><br>
> % }
> % else
> % {
>                 <option value="<%$value->Name%>"
> % if ($Values)
> % {
>                         <% $Values->HasEntry($value->Name) && 
> ($$SelectedRef = 1) && 'SELECTED' %>
> % }
> % elsif ($Default)
> % {
>                     <% (ref $Default ? (grep {$_ eq $value->Name} 
> @{$Default}) : ($Default eq $value->Name))
>                         && ($$SelectedRef = 1) && 'SELECTED' %>
> % }
>                 ><% $value->Name%></option>
> % }
> % }
>
> Todd Chapman wrote:
>   
>> Does this help?
>>
>> http://lists.bestpractical.com/pipermail/rt-users/2007-November/048774.html
>>
>> On 3/2/08, Jan Grant <jan.grant at bristol.ac.uk> wrote:
>>   
>>     
>>> On Sun, 2 Mar 2008, Todd Chapman wrote:
>>>
>>>  > This would be easy enough to do. There is a callback in 3.6 that lets
>>>  > you control what Mason component is used to render a custom field.
>>>
>>>
>>> Can you supply some details, or a pointer to this?
>>>
>>>
>>>  --
>>>  jan grant, ISYS, University of Bristol. http://www.bris.ac.uk/
>>>  Tel +44 (0)117 3317661   http://ioctl.org/jan/
>>>  ...You're visualising the _duck_ taped over my _mouth_..?
>>>
>>>     
>>>       
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20080303/22ababb4/attachment.htm>


More information about the rt-users mailing list