1[%# This Source Code Form is subject to the terms of the Mozilla Public
2  # License, v. 2.0. If a copy of the MPL was not distributed with this
3  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4  #
5  # This Source Code Form is "Incompatible With Secondary Licenses", as
6  # defined by the Mozilla Public License, v. 2.0.
7  #%]
8
9[%# INTERFACE:
10  # queryshare_groups: list of groups the user may share queries with
11  #                    (id, name).
12  # bless_group_ids: list of group ids the user may bless.
13  #%]
14
15[% IF user.can_bless %]
16  <script type="text/javascript"><!--
17    function update_checkbox(group) {
18      var bless_groups = [[% bless_group_ids.join(",") FILTER js %]];
19      var checkbox = document.getElementById(group.name.replace(/share_(\d+)/, "force_$1"));
20
21      if (bz_isValueInArray(bless_groups, group.value)) {
22        YAHOO.util.Dom.removeClass(checkbox.parentNode, "bz_default_hidden");
23      } else {
24        YAHOO.util.Dom.addClass(checkbox.parentNode, "bz_default_hidden");
25        checkbox.checked = false;
26      }
27    } //-->
28  </script>
29[% END %]
30
31<p>Ihre persönlichen gespeicherten Suchen:</p>
32
33<blockquote>
34  <table border="1" cellpadding="3">
35    <tr>
36      <th>
37        Bezeichnung der Suche
38      </th>
39      <th>
40        Starten
41      </th>
42      <th>
43        Bearbeiten
44      </th>
45      <th>
46        Vergessen
47      </th>
48      <th>
49        Im Fußbereich zeigen
50      </th>
51      [% may_share = user.in_group(Param('querysharegroup')) && queryshare_groups.size %]
52      [% IF may_share %]
53        <th>
54          Für Gruppe zugänglich machen
55        </th>
56      [% END %]
57    </tr>
58    <tr>
59      <td>Meine [% terms.Bugs %]</td>
60      <td>
61        [% filtered_username = user.login FILTER uri %]
62        <a href="[% Param('mybugstemplate').replace('%userid%', filtered_username) %]">Starten</a>
63      </td>
64      <td>
65        &nbsp;
66      </td>
67      <td>
68        &nbsp;
69      </td>
70      <td align="center">
71        <input type="checkbox"
72               name="showmybugslink"
73               value="1"
74               [% " checked" IF user.showmybugslink %]>
75      </td>
76      [% IF may_share %]
77        <td>
7879        </td>
80      [% END %]
81    </tr>
82    [% FOREACH q = user.queries %]
83      <tr>
84        <td>[% q.name FILTER html %]</td>
85        <td>
86          <a href="buglist.cgi?cmdtype=dorem&amp;remaction=run&amp;namedcmd=[% q.name FILTER uri %]
87                   [% IF q.shared_with_group.id %]&amp;sharer_id=[% user.id FILTER uri %][% END %]">Starten</a>
88        </td>
89        <td>
90          <a href="query.cgi?[% q.edit_link FILTER html %]&amp;known_name=
91                   [% q.name FILTER uri %]">Bearbeiten</a>
92        </td>
93        <td>
94          [% IF q.used_in_whine %]
95            Zunächst aus den <a href="editwhines.cgi">Geplanten Abfragen</a>
96            entfernen
97          [% ELSE %]
98            <a href="buglist.cgi?cmdtype=dorem&amp;remaction=forget&amp;namedcmd=
99                     [% q.name FILTER uri %]&amp;token=
100                     [% issue_hash_token([q.id, q.name]) FILTER uri %]">Vergessen</a>
101          [% END %]
102        </td>
103        <td align="center">
104          <input type="checkbox"
105                 name="link_in_footer_[% q.id FILTER html %]"
106                 value="1"
107                 alt="[% q.name FILTER html %]"
108                 [% " checked" IF q.link_in_footer %]>
109        </td>
110        [% IF may_share %]
111          <td>
112            <select name="share_[% q.id FILTER html %]"
113              [% IF user.can_bless %] onchange="update_checkbox(this);"[% END %]>
114              <option value="">Nicht veröffentlichen</option>
115              [% FOREACH group = queryshare_groups %]
116                <option value="[% group.id %]"
117                        [% ' selected="selected"'
118                           IF q.shared_with_group.id == group.id %]
119                >[% group.name FILTER html %]</option>
120              [% END %]
121            </select>
122            [% IF user.can_bless %]
123              <span [% IF !bless_group_ids.grep("^$q.shared_with_group.id\$").0
124                     %]class="bz_default_hidden"[% END %]>
125                <input type="checkbox" id="force_[% q.id FILTER html %]"
126                       name="force_[% q.id FILTER html %]" value="1">
127                <label for="force_[% q.id FILTER html %]">Fußbereich</label>
128              </span>
129            [% END %]
130            [% IF q.shared_with_users %]
131              <br>(Steht [% q.shared_with_users FILTER html %]
132              Benutzer[%+ 'n' IF q.shared_with_users > 1 %] zur Verfügung)
133            [% END %]
134          </td>
135        [% END %]
136      </tr>
137    [% END %]
138  </table>
139[% IF user.can_bless %]
140  <p>Wenn Sie die Markierung „Fußbereich“ setzen und Sie
141     „Änderungen vornehmen“ drücken, dann wird die entsprechende Suche nicht
142     nur der angegebenen Gruppe zur Verfügung gestellt, sondern ihren
143     Mitgliedern auch im Fußbereich angezeigt.</p>
144[% END %]
145</blockquote>
146
147[% IF user.queries_available.size %]
148  <p>Sie können folgende von anderen Benutzern zugänglich gemachten Suchen
149  verwenden:</p>
150
151  <table border="1" cellpadding="3">
152    <tr>
153      <th>
154        Bezeichnung der Suche
155      </th>
156      <th>
157        Zur Verfügung gestellt von
158      </th>
159      <th>
160        Dieser Gruppe zur Verfügung gestellt
161      </th>
162      <th>
163        Starten
164      </th>
165      <th>
166        Bearbeiten
167      </th>
168      <th>
169        Im Fußbereich zeigen
170      </th>
171    </tr>
172    [% FOREACH q = user.queries_available %]
173      <tr>
174        <td>[% q.name FILTER html %]</td>
175        <td>[% q.user.identity FILTER html %]</td>
176        <td>[% q.shared_with_group.name FILTER html %]</td>
177        <td>
178          <a href="buglist.cgi?cmdtype=dorem&amp;remaction=run&amp;namedcmd=
179                   [% q.name FILTER uri %]&amp;sharer_id=
180                   [% q.user.id FILTER uri %]">Starten</a>
181        </td>
182        <td>
183          <a href="query.cgi?[% q.edit_link FILTER html %]&amp;known_name=
184                   [% q.name FILTER uri %]">Bearbeiten</a>
185        </td>
186        <td align="center">
187          <input type="checkbox"
188                 name="link_in_footer_[% q.id FILTER html %]"
189                 value="1"
190                 alt="[% q.name FILTER html %]"
191                 [% " checked" IF q.link_in_footer %]>
192        </td>
193      </tr>
194    [% END %]
195  </table>
196[% ELSE %]
197  <p>Ihnen sind von anderen Benutzern keine Suchen zur Verfügung gestellt.</p>
198[% END %]
199