[rt-users] Question about your Priorityasstring extension

Ruslan Zakirov ruz at bestpractical.com
Mon Dec 14 13:33:22 EST 2009


Hello,

Cced the list.

I think in this extension we wrap the label into a html element with
css class. So you can add coloring using CSS. Just checked it and it's
the case. Priority label is wrapped into a <span> with different
classes, for example:

* ticket-info-priority-normal
* ticket-info-priority-urgent
* ticket-info-final-priority-normal

where "normal" and "urgent" are priority labels. You can add the
following rules into CSS:

.ticket-info-priority-normal { color: green; }
.ticket-info-priority-urgent { color: red; }

And so on. Please send me back a documentation patch for the module.

On Mon, Dec 14, 2009 at 9:11 PM, Christophe Sahut
<christophe.sahut at sgs.com> wrote:
>
> Hi Ruslan,
>
>  I used the patch on the wiki for 3.6.x to convert numeric priority to labels and I switched to your extension for RT 3.8.x. It works well.
>
>  I lost a feature between the two versions, it's the color of the labels. In the old version, I had redifined in the "/opt/rt3/local/html/Elements/RT__Ticket/ColumnMap" file :
>
>
>     Priority => {
>         title     => 'Priority', # loc
>         attribute => 'Priority',
>         name      => 'Priority',
>         value     => sub { return $_[0]->Priority }
>     },
>
> to:
>
>     Priority => {
>         title     => 'Priority', # loc
>         attribute => 'Priority',
>         value     => sub {
>
>           my $pstring = $RT::PriorityType?$_[0]->PriorityAsString() : $_[0]->Priority;
>
>           # optional color-coding is below. comment it out if you dont like it.
>
>           # start-color-coding
>           my $priority = $_[0]->Priority;
>           my $colors = undef;
>             if ($priority ge '90') {
>                  $colors = "#FF0000";
>             } elsif ($priority ge '70') {
>                  $colors = "#FF6C00";
>             } elsif ($priority ge '50') {
>                  $colors = "#000EFF";
>             } elsif ($priority ge '0') {
>                  $colors = "#009000";
>             }
>
>             if ($colors) {
>                  $pstring = "<font color=$colors>$pstring</font>"
>             }
>           # end-color-coding
>
>           return \"<b>$pstring</b>";
>         }
>     },
>
>
>
> Even it's ugly (hard coding of colors in the code), it worked well.
>
> I see there is a file brought with your extension /opt/rt3/local/plugins/RT-Extension-PriorityAsString/html/Callbacks/PriorityAsString/Elements/RT__Ticket/ColumnMap/Once preventing this hack to work I guess.
>
> Do you have any idea to make this work or maybe to add this feature to your plugin ?
>
> Many thanks !
>
> --
>
> Christophe Sahut
>
> Information Technology
>
> SGS SA
>
> 1, Place des Alpes
> CH – 1211 – Geneva
>
> Phone:  +41 22 739 96 49
> Mobile:  +41 78 899 29 39
>
> E-mail :   Christophe.Sahut at sgs.com
>
>
>
> Information in this email and any attachments is confidential and
> intended solely for the use of the individual(s) to whom it is addressed
> or otherwise directed. Please note that any views or opinions presented
> in this email are solely those of the author and do not necessarily
> represent those of the Company.
> Finally, the recipient should check this email and any attachments for
> the presence of viruses. The Company accepts no liability for any damage
> caused by any virus transmitted by this email.
> All SGS services are rendered in accordance with the applicable SGS
> conditions of service available on request and accessible at
> http://www.sgs.com/terms_and_conditions.htm



--
Best regards, Ruslan.



More information about the rt-users mailing list