CSS Formatierung Auf-/Absteigende Sortierung

Hilfe zu Znuny Problemen aller Art
Locked
pokyu01
Znuny newbie
Posts: 58
Joined: 05 Aug 2010, 12:57
Znuny Version: 2.4.7

CSS Formatierung Auf-/Absteigende Sortierung

Post by pokyu01 »

Hallo Zusammen,

ab der Version 3.0 werden im Kunden- bzw. Agentenfrontend die ab-/aufsteigend sortierten Spalten, falls man den Parameter CustomerTicketOverviewSortable auf Ja gesetzt hat, mit CSS gesondert (dunkelgrau + Pfeil nach oben bzw. unten) formatiert (siehe Dateianhang unten).



Nun habe ich die CustomerTicketOverView.dtl um weitere Spalten ("SLA", "TicketFreeText3", "CustomerID", "CustomerName") erweitert. Hier ein Ausschnitt aus der o.g. DTL Datei

Code: Select all

...
                    <th class="Age $LQData{"AgeSort"}">
                        <a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=$Env{"Subaction"};SortBy=Age;OrderBy=$LQData{"OrderBy"};Filter=$LQData{"Filter"}">
                            $Text{"Age"}
                        </a>
                    </th>
                    <th class="Sla $LQData{"SlaSort"}">
                        <a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=$Env{"Subaction"};SortBy=SLA;OrderBy=$LQData{"OrderBy"};Filter=$LQData{"Filter"}">
                            $Text{"SLA"}
                        </a>
                    </th>
                    <th class="TicketFreeText3 $LQData{"TicketFreeText3Sort"}">
                        <a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=$Env{"Subaction"};SortBy=TicketFreeText3;OrderBy=$LQData{"OrderBy"};Filter=$LQData{"Filter"}">
                            $Text{"Aussenwirkung"}
                        </a>
                    </th>
                    <th class="CustomerID $LQData{"CSS"}">
                        <a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=$Env{"Subaction"};SortBy=CustomerID;OrderBy=$LQData{"OrderBy"};Filter=$LQData{"Filter"}">
                            $Text{"Kunde"}
                        </a>
                    </th>
                    <th class="CustomerName $LQData{"CustomerNameSort"}">
                        <a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=$Env{"Subaction"};SortBy=CustomerName;OrderBy=$LQData{"OrderBy"};Filter=$LQData{"Filter"}">
                            $Text{"Ticketmelder"}
                        </a>
                    </th>
...
Die Anzeige/Sortierung funktioniert soweit. Was nicht funktioniert, ist die CSS Formatierung, da die eingefügten Spalten irgendwie in einem der OTRS Modulen/Konfigurationen nicht bekannt sind.

Sortiert man Tickets in der Spalte „Age“, so wird die class Eigenschaft wie folgt ergänzt.

Code: Select all

class="Age SortDescending"
Beim Klicken auf die Spalte „SLA“ passiert irgendwie gar nichts.

Code: Select all

class="Sla "
Hat jemand eine Idee, woran das Problem liegen könnte?

Danke!!!

Gruß

Yury
You do not have the required permissions to view the files attached to this post.
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

Re: CSS Formatierung Auf-/Absteigende Sortierung

Post by artjoms15 »

Hello, Yury.
1) what link do you see in the adress bar? Does SortBy property sets to SLA? e.g. ...Subaction=CompanyTickets;SortBy=SLA;Order=...
2) Have you made any changes in CustomerTicketOverView.pm? Like registering new sorting columns?

Cheers!
Artjoms.
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
pokyu01
Znuny newbie
Posts: 58
Joined: 05 Aug 2010, 12:57
Znuny Version: 2.4.7

Re: CSS Formatierung Auf-/Absteigende Sortierung

Post by pokyu01 »

hello Artjoms,

thank you for your reply.

1. here is a link I see in adress bar by clicking on SLA column.

.../otrs/customer.pl?Action=CustomerTicketOverView;Subaction=MyTickets;SortBy=SLA;OrderBy=Up;Filter=Open

2. I haven't made any changes in CustomerCustomerTicketOverView.pm.

Is it generally allowed to modify this file?
Won't this file be overriden while next update?
At which location can new sorting columns be registred?

regards

yury
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

Re: CSS Formatierung Auf-/Absteigende Sortierung

Post by artjoms15 »

Some people still need the step-by-step solution on how to do do the formatting of newly created columns, so here is the explanation and steps:
1) File \var\httpd\htdocs\skins\Customer\default\css\Core.Table.css holds the required css From there we see, that, if the <th> class holds SortAscending/Descending in it the css will be applied.

Code: Select all

.Overview thead .SortAscending a,
.Overview thead .SortDescending a {
    color: #222;
    font-weight: 600;
    text-align: left;
    background: url(../img/sortable_bg.png) no-repeat top right;
    text-shadow: 0 1px 0 #BBB;
}

.Overview thead .SortDescending a {
    background-position: bottom right;
}

.Overview tbody {
    background-color: transparent;
}


So let' s find a place where it can be done

2)Of course it is the file OTRS\Kernel\Modules\CustomerTicketOverView.pm
ther you should edit these lines
~Line:256 add

Code: Select all

my $TypeSort   = ''; //I add column Type 
~Line:275 add

Code: Select all

 if ( $Self->{SortBy} eq 'Type' ) {
            $TypeSort = $Sort;
        } 
~Line:291 add

Code: Select all

TypeSort   => $TypeSort,
3) Afterwards you can edit OTRS\Kernel\Output\HTML\Standard\CustomerTicketOverView.dtl and add required column

Code: Select all

	<th class="Ticket $LQData{"TypeSort"}">
					  <a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=$Env{"Subaction"};SortBy=Type;OrderBy=$LQData{"OrderBy"};Filter=$LQData{"Filter"}">
                            $Text{"Type"}
                        </a>
                    </th>
Of course you SHOULD make a custom skin out of this, so after update all the changes keep alive, but you can also manually do changes after every update :)

Hope that will help someone ;)
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
Locked