Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7c128d33

Von Moritz Bunkus vor mehr als 15 Jahren hinzugefügt

  • ID 7c128d33b4db9f5d2a090a04ffdcb9e08a0a3db3
  • Vorgänger 256d534f
  • Nachfolger 19864404

Das Umsortieren der Ergebnisliste der Historiensuchmaschine gefixt und ohne JavaScript realisiert, sodass sie auch funktioniert, wenn sie per POST-Request aufgerufen wurde.

Unterschiede anzeigen:

bin/mozilla/am.pl
2818 2818

  
2819 2819
  $auth->assert('config');
2820 2820

  
2821
  my $callback     = build_std_url(qw(action einschraenkungen fromdate todate mitarbeiter searchid what2search));
2822
  $form->{order} ||= 'h.itime--1';
2823

  
2821 2824
  my %search = ( "Artikelnummer"          => "parts",
2822 2825
                 "Kundennummer"           => "customer",
2823 2826
                 "Lieferantennummer"      => "vendor",
......
2867 2870
                                     "SUCCESS"        => ($form->get_history($dbh, $daten, $restriction, $form->{order}) ne "0"),
2868 2871
                                     "NONEWWINDOW"    => 1,
2869 2872
                                     uc($sort)        => 1,
2870
                                     uc($sort) . "BY" => $sortby
2873
                                     uc($sort) . "BY" => $sortby,
2874
                                     'callback'       => $callback,
2871 2875
                                   });
2872 2876
  $dbh->disconnect();
2873 2877

  
templates/webpages/common/show_history_de.html
1 1
[% USE HTML %]
2 2
[% IF SUCCESS %]
3
<script type="text/javascript">
4
  function orderBy(order,desc) {
5
    var reg = /\&order\=(.+)\-\-(\d)$/;
6
    reg.exec(document.location.href);
7
    if(RegExp.$1 == order) {
8
      document.location.href = document.location.href.substring(0,document.location.href.lastIndexOf("&order=")) + "&order=" + order + "--" + desc;
9
    }
10
    else {
11
      if(reg.test(document.location.href)) {
12
        document.location.href = document.location.href.substring(0,document.location.href.lastIndexOf("&order=")) + "&order=" + order + "--" + desc;
13
      }
14
      else {
15
        document.location.href = document.location.href + "&order=" + order + "--" + desc;
16
      }
17
    }
18
  }
19
</script>
3

  
4
[% BLOCK column_header %]
5
            <table height="0" width="0" cellpadding="0" cellspacing="0" marginheight="0" marginwidth="0" valign="top" border="0">
6
             [% IF THIS_COLUMN && !THIS_COLUMN_DOWN %]
7
               <tr><td><a title="Reihenfolge" style="background: #ccccff; border: solid 1px #aaaade;">&and;</a></td></tr>
8
             [% ELSE %]
9
               <tr><td><a href="[% callback %]&order=[% column %]--0" title="Reihenfolge" style="border: solid 1px #aaaade;">&and;</a></td></tr>
10
             [% END %]
11
             [% IF THIS_COLUMN &&  THIS_COLUMN_DOWN %]
12
               <tr><td><a title="Reihenfolge" style="background: #ccccff; border: solid 1px #aaaade;">&or;</a></td></tr>
13
             [% ELSE %]
14
               <tr><td><a href="[% callback %]&order=[% column %]--1" title="Reihenfolge" style="border: solid 1px #aaaade;">&or;</a></td></tr>
15
             [% END %]
16
            </table>
17
[% END %]
18

  
20 19
<table>
21 20
	<tr>
22 21
		<th class="listtop">
......
26 25
			     &nbsp;Zeitpunkt&nbsp;
27 26
          </td>
28 27
          <td valign="top">
29
            <table height="0" width="0" cellpadding="0" cellspacing="0" marginheight="0" marginwidth="0" valign="top" border="0">
30
              [% IF ITIME %]
31
                [% IF ITIMEBY %]
32
                  <tr><td><a href="javascript:orderBy('h.itime',0);" title="Reihenfolge" style="border: solid 1px #aaaade;">&and;</a></td></tr>
33
                  <tr><td><a title="Reihenfolge" style="background: #ccccff; border: solid 1px #aaaade;">&or;</a></td></tr>
34
                [% ELSE %]
35
                  <tr><td><a title="Reihenfolge" style="background: #ccccff; border: solid 1px #aaaade;">&and;</a></td></tr>
36
                  <tr><td><a href="javascript:orderBy('h.itime',1);" style="border: solid 1px #aaaade;">&or;</a></td></tr>
37
                [% END %]
38
              [% ELSE %]
39
                <tr><td><a href="javascript:orderBy('h.itime',0);" title="Reihenfolge" style="border: solid 1px #aaaade;">&and;</a></td></tr>
40
                <tr><td><a href="javascript:orderBy('h.itime',1);" title="Reihenfolge" style="border: solid 1px #aaaade;">&or;</a></td></tr>
41
              [% END %]
42
            </table>
28
           [% PROCESS column_header THIS_COLUMN=ITIME THIS_COLUMN_DOWN=ITIMEBY column='h.itime' %]
43 29
          </td>
44 30
        </tr>
45 31
      </table>
......
51 37
            &nbsp;Mitarbeiter&nbsp;
52 38
          </td>
53 39
          <td valign="top">
54
            <table height="0" width="0" cellpadding="0" cellspacing="0" marginheight="0" marginwidth="0" valign="top" border="0">
55
              [% IF NAME %]
56
                [% IF NAMEBY %]
57
                  <tr><td height="0" width="0"><a href="javascript:orderBy('emp.name',0);" title="Reihenfolge" style="border: solid 1px #aaaade;">&and;</a></td></tr>
58
                  <tr><td height="0" width="0"><a title="Reihenfolge" style="background: #ccccff; border: solid 1px #aaaade;">&or;</a></td></tr>
59
                [% ELSE %]
60
                  <tr><td><a title="Reihenfolge" style="background: #ccccff; border: solid 1px #aaaade;">&and;</a></td></tr>
61
                  <tr><td><a href="javascript:orderBy('emp.name',1);" style="border: solid 1px #aaaade;">&or;</a></td></tr>
62
                [% END %]
63
              [% ELSE %]
64
                <tr><td><a href="javascript:orderBy('emp.name',0);" title="Reihenfolge" style="border: solid 1px #aaaade;">&and;</a></td></tr>
65
                <tr><td><a href="javascript:orderBy('emp.name',1);" title="Reihenfolge" style="border: solid 1px #aaaade;">&or;</a></td></tr>
66
              [% END %]
67
            </table>
40
           [% PROCESS column_header THIS_COLUMN=NAME THIS_COLUMN_DOWN=NAMEBY column='emp.name' %]
68 41
          </td>
69 42
        </tr>
70 43
      </table>
......
94 67
           &nbsp;ID-Nummer (intern)&nbsp;
95 68
          </td>
96 69
          <td valign="top">
97
            <table height="0" width="0" cellpadding="0" cellspacing="0" marginheight="0" marginwidth="0" valign="top" border="0">
98
              [% IF TRANS_ID %]
99
                [% IF TRANS_IDBY %]
100
                  <tr><td height="0" width="0"><a href="javascript:orderBy('h.trans_id',0);" title="Reihenfolge" style="border: solid 1px #aaaade;">&and;</a></td></tr>
101
                  <tr><td height="0" width="0"><a title="Reihenfolge" style="background: #ccccff; border: solid 1px #aaaade;">&or;</a></td></tr>
102
                [% ELSE %]
103
                  <tr><td><a title="Reihenfolge" style="background: #ccccff; border: solid 1px #aaaade;">&and;</a></td></tr>
104
                  <tr><td><a href="javascript:orderBy('h.trans_id',1);" style="border: solid 1px #aaaade;">&or;</a></td></tr>
105
                [% END %]
106
              [% ELSE %]
107
                <tr><td><a href="javascript:orderBy('h.trans_id',0);" title="Reihenfolge" style="border: solid 1px #aaaade;">&and;</a></td></tr>
108
                <tr><td><a href="javascript:orderBy('h.trans_id',1);" title="Reihenfolge" style="border: solid 1px #aaaade;">&or;</a></td></tr>
109
              [% END %]
110
            </table>
70
            [% PROCESS column_header THIS_COLUMN=TRANS_ID THIS_COLUMN_DOWN=TRANS_IDBY column='h.trans_id' %]
111 71
          </td>
112 72
        </tr>
113 73
      </table>
......
119 79
           &nbsp;Buchungsnummer&nbsp;
120 80
          </td>
121 81
          <td valign="top">
122
            <table height="0" width="0" cellpadding="0" cellspacing="0" marginheight="0" marginwidth="0" valign="top" border="0" >
123
              [% IF SNUMBERS %]
124
                [% IF SNUMBERSBY %]
125
                  <tr><td height="0" width="0"><a href="javascript:orderBy('h.snumbers',0);" title="Reihenfolge" style="border: solid 1px #aaaade;">&and;</a></td></tr>
126
                  <tr><td height="0" width="0"><a title="Reihenfolge" style="background: #ccccff; border: solid 1px #aaaade;">&or;</a></td></tr>
127
                [% ELSE %]
128
                  <tr><td><a title="Reihenfolge" style="background: #ccccff; border: solid 1px #aaaade;">&and;</a></td></tr>
129
                  <tr><td><a href="javascript:orderBy('h.snumbers',1);" style="border: solid 1px #aaaade;">&or;</a></td></tr>
130
                [% END %]
131
              [% ELSE %]
132
                <tr><td><a href="javascript:orderBy('h.snumbers',0);" title="Reihenfolge" style="border: solid 1px #aaaade;">&and;</a></td></tr>
133
                <tr><td><a href="javascript:orderBy('h.snumbers',1);" title="Reihenfolge" style="border: solid 1px #aaaade;">&or;</a></td></tr>
134
              [% END %]
135
            </table>
82
            [% PROCESS column_header THIS_COLUMN=SNUMBERS THIS_COLUMN_DOWN=SNUMBERSBY column='h.snumbers' %]
136 83
          </td>
137 84
        </tr>
138 85
      </table>
templates/webpages/common/show_history_master.html
1 1
[% USE HTML %]
2 2
[% IF SUCCESS %]
3
<script type="text/javascript">
4
  function orderBy(order,desc) {
5
    var reg = /\&order\=(.+)\-\-(\d)$/;
6
    reg.exec(document.location.href);
7
    if(RegExp.$1 == order) {
8
      document.location.href = document.location.href.substring(0,document.location.href.lastIndexOf("&order=")) + "&order=" + order + "--" + desc;
9
    }
10
    else {
11
      if(reg.test(document.location.href)) {
12
        document.location.href = document.location.href.substring(0,document.location.href.lastIndexOf("&order=")) + "&order=" + order + "--" + desc;
13
      }
14
      else {
15
        document.location.href = document.location.href + "&order=" + order + "--" + desc;
16
      }
17
    }
18
  }
19
</script>
3

  
4
[% BLOCK column_header %]
5
            <table height="0" width="0" cellpadding="0" cellspacing="0" marginheight="0" marginwidth="0" valign="top" border="0">
6
             [% IF THIS_COLUMN && !THIS_COLUMN_DOWN %]
7
               <tr><td><a title="<translate>order</translate>" style="background: #ccccff; border: solid 1px #aaaade;">&and;</a></td></tr>
8
             [% ELSE %]
9
               <tr><td><a href="[% callback %]&order=[% column %]--0" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&and;</a></td></tr>
10
             [% END %]
11
             [% IF THIS_COLUMN &&  THIS_COLUMN_DOWN %]
12
               <tr><td><a title="<translate>order</translate>" style="background: #ccccff; border: solid 1px #aaaade;">&or;</a></td></tr>
13
             [% ELSE %]
14
               <tr><td><a href="[% callback %]&order=[% column %]--1" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&or;</a></td></tr>
15
             [% END %]
16
            </table>
17
[% END %]
18

  
20 19
<table>
21 20
	<tr>
22 21
		<th class="listtop">
......
26 25
			     &nbsp;<translate>Zeitpunkt</translate>&nbsp;
27 26
          </td>
28 27
          <td valign="top">
29
            <table height="0" width="0" cellpadding="0" cellspacing="0" marginheight="0" marginwidth="0" valign="top" border="0">
30
              [% IF ITIME %]
31
                [% IF ITIMEBY %]
32
                  <tr><td><a href="javascript:orderBy('h.itime',0);" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&and;</a></td></tr>
33
                  <tr><td><a title="<translate>order</translate>" style="background: #ccccff; border: solid 1px #aaaade;">&or;</a></td></tr>
34
                [% ELSE %]
35
                  <tr><td><a title="<translate>order</translate>" style="background: #ccccff; border: solid 1px #aaaade;">&and;</a></td></tr>
36
                  <tr><td><a href="javascript:orderBy('h.itime',1);" style="border: solid 1px #aaaade;">&or;</a></td></tr>
37
                [% END %]
38
              [% ELSE %]
39
                <tr><td><a href="javascript:orderBy('h.itime',0);" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&and;</a></td></tr>
40
                <tr><td><a href="javascript:orderBy('h.itime',1);" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&or;</a></td></tr>
41
              [% END %]
42
            </table>
28
           [% PROCESS column_header THIS_COLUMN=ITIME THIS_COLUMN_DOWN=ITIMEBY column='h.itime' %]
43 29
          </td>
44 30
        </tr>
45 31
      </table>
......
51 37
            &nbsp;<translate>Mitarbeiter</translate>&nbsp;
52 38
          </td>
53 39
          <td valign="top">
54
            <table height="0" width="0" cellpadding="0" cellspacing="0" marginheight="0" marginwidth="0" valign="top" border="0">
55
              [% IF NAME %]
56
                [% IF NAMEBY %]
57
                  <tr><td height="0" width="0"><a href="javascript:orderBy('emp.name',0);" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&and;</a></td></tr>
58
                  <tr><td height="0" width="0"><a title="<translate>order</translate>" style="background: #ccccff; border: solid 1px #aaaade;">&or;</a></td></tr>
59
                [% ELSE %]
60
                  <tr><td><a title="<translate>order</translate>" style="background: #ccccff; border: solid 1px #aaaade;">&and;</a></td></tr>
61
                  <tr><td><a href="javascript:orderBy('emp.name',1);" style="border: solid 1px #aaaade;">&or;</a></td></tr>
62
                [% END %]
63
              [% ELSE %]
64
                <tr><td><a href="javascript:orderBy('emp.name',0);" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&and;</a></td></tr>
65
                <tr><td><a href="javascript:orderBy('emp.name',1);" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&or;</a></td></tr>
66
              [% END %]
67
            </table>
40
           [% PROCESS column_header THIS_COLUMN=NAME THIS_COLUMN_DOWN=NAMEBY column='emp.name' %]
68 41
          </td>
69 42
        </tr>
70 43
      </table>
......
94 67
           &nbsp;<translate>ID-Nummer</translate>&nbsp;
95 68
          </td>
96 69
          <td valign="top">
97
            <table height="0" width="0" cellpadding="0" cellspacing="0" marginheight="0" marginwidth="0" valign="top" border="0">
98
              [% IF TRANS_ID %]
99
                [% IF TRANS_IDBY %]
100
                  <tr><td height="0" width="0"><a href="javascript:orderBy('h.trans_id',0);" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&and;</a></td></tr>
101
                  <tr><td height="0" width="0"><a title="<translate>order</translate>" style="background: #ccccff; border: solid 1px #aaaade;">&or;</a></td></tr>
102
                [% ELSE %]
103
                  <tr><td><a title="<translate>order</translate>" style="background: #ccccff; border: solid 1px #aaaade;">&and;</a></td></tr>
104
                  <tr><td><a href="javascript:orderBy('h.trans_id',1);" style="border: solid 1px #aaaade;">&or;</a></td></tr>
105
                [% END %]
106
              [% ELSE %]
107
                <tr><td><a href="javascript:orderBy('h.trans_id',0);" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&and;</a></td></tr>
108
                <tr><td><a href="javascript:orderBy('h.trans_id',1);" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&or;</a></td></tr>
109
              [% END %]
110
            </table>
70
            [% PROCESS column_header THIS_COLUMN=TRANS_ID THIS_COLUMN_DOWN=TRANS_IDBY column='h.trans_id' %]
111 71
          </td>
112 72
        </tr>
113 73
      </table>
......
119 79
           &nbsp;<translate>Belegnummer</translate>&nbsp;
120 80
          </td>
121 81
          <td valign="top">
122
            <table height="0" width="0" cellpadding="0" cellspacing="0" marginheight="0" marginwidth="0" valign="top" border="0" >
123
              [% IF SNUMBERS %]
124
                [% IF SNUMBERSBY %]
125
                  <tr><td height="0" width="0"><a href="javascript:orderBy('h.snumbers',0);" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&and;</a></td></tr>
126
                  <tr><td height="0" width="0"><a title="<translate>order</translate>" style="background: #ccccff; border: solid 1px #aaaade;">&or;</a></td></tr>
127
                [% ELSE %]
128
                  <tr><td><a title="<translate>order</translate>" style="background: #ccccff; border: solid 1px #aaaade;">&and;</a></td></tr>
129
                  <tr><td><a href="javascript:orderBy('h.snumbers',1);" style="border: solid 1px #aaaade;">&or;</a></td></tr>
130
                [% END %]
131
              [% ELSE %]
132
                <tr><td><a href="javascript:orderBy('h.snumbers',0);" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&and;</a></td></tr>
133
                <tr><td><a href="javascript:orderBy('h.snumbers',1);" title="<translate>order</translate>" style="border: solid 1px #aaaade;">&or;</a></td></tr>
134
              [% END %]
135
            </table>
82
            [% PROCESS column_header THIS_COLUMN=SNUMBERS THIS_COLUMN_DOWN=SNUMBERSBY column='h.snumbers' %]
136 83
          </td>
137 84
        </tr>
138 85
      </table>

Auch abrufbar als: Unified diff