[% USE KohaDates %]
+[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Tools › News</title>
[% INCLUDE 'doc-head-close.inc' %]
<li>
<label for="branch">Library: </label>
<select id="branch" name="branch">
- [% IF ( new_detail.branchcode == '' ) %]
- <option value="" selected="selected">All libraries</option>
- [% ELSE %]
- <option value="" >All libraries</option>
- [% END %]
- [% FOREACH branch_item IN branch_list %]
- [% IF ( branch_item.value.branchcode == new_detail.branchcode ) %]
- <option value="[% branch_item.value.branchcode %]" selected="selected">[% branch_item.value.branchname %]</option>
- [% ELSE %]
- <option value="[% branch_item.value.branchcode %]">[% branch_item.value.branchname %]</option>
- [% END %]
- [% END %]
+ [% IF ( new_detail.branchcode == '' ) %]
+ <option value="" selected="selected">All libraries</option>
+ [% ELSE %]
+ <option value="" >All libraries</option>
+ [% END %]
+ [% PROCESS options_for_libraries libraries => Branches.all( selected => new_detail.branchcode, unfiltered => 1, ) %]
</select>
</li>
<li>
[% ELSE %]
<option value="" >All libraries</option>
[% END %]
- [% FOREACH branch_item IN branch_list %]
- [% IF ( branch_item.value.branchcode == branchcode ) %]
- <option value="[% branch_item.value.branchcode %]"
- selected="selected">[% branch_item.value.branchname %]
- </option>
- [% ELSE %]
- <option value="[% branch_item.value.branchcode %]"
- >[% branch_item.value.branchname %]
- </option>
- [% END %]
- [% END %]
+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
</select>
<input type="submit" class="button" value="Filter" />
</form>