Bug 11490: Add prefs MaxItemsToProcessForBatchMod and MaxItemsToDisplayForBatchDel
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqbudgetperiods.tt
index 51b8b8a..ecedbea 100644 (file)
@@ -1,7 +1,33 @@
 [% USE KohaDates %]
-[% USE format %]
+[% USE Price %]
+
+[%- BLOCK action_menu %]
+    <div class="dropdown">
+        <a class="btn btn-mini dropdown-toggle" id="budgetmenu_[% block_budget_id %]" role="button" data-toggle="dropdown" href="#">
+           Actions <b class="caret"></b>
+        </a>
+        <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="budgetmenu_[% block_budget_id %]">
+              <li>
+                  <a href="[% script_name %]?op=add_form&amp;budget_period_id=[% block_budget_id |html %]"><i class="fa fa-pencil"></i> Edit</a>
+              </li>
+              <li>
+                  <a href="[% script_name %]?op=delete_confirm&amp;budget_period_id=[% block_budget_id %]"><i class="fa fa-trash"></i> Delete</a>
+              </li>
+              <li>
+                  <a href="[% script_name %]?op=duplicate_form&amp;budget_period_id=[% block_budget_id %]"><i class="fa fa-copy"></i> Duplicate</a>
+              </li>
+              <li>
+                  <a href="[% script_name %]?op=close_form&amp;budget_period_id=[% block_budget_id %]"><i class="fa fa-times-circle"></i> Close</a>
+              </li>
+              <li>
+                  <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_period_id=[% block_budget_id %]"><i class="fa fa-plus"></i> Add fund</a>
+              </li>
+        </ul>
+    </div>
+[% END -%]
+
 [% INCLUDE 'doc-head-open.inc' %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
 [% INCLUDE 'datatables.inc' %]
@@ -9,7 +35,7 @@
     <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" />
     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script>
 [% END %]
-<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
+<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script>
 <script type="text/javascript">
 // #################################################################################
 // Javascript
             tabs.tabs("option", "active", [% tab %]);
         [% END %]
         $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, {
-            "sDom": 't',
-            "aaSorting": [],
             "aoColumnDefs": [
                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
                 { "sType": "title-string", "aTargets" : [ "title-string" ] }
             ],
-            "bPaginate": false,
+            "sPaginationType": "four_button",
             'bAutoWidth': false
         } ) );
 
             var budget_from = "[% budget_period_description %]";
             var budget_to = $("#to_budget_period_id").find("option:selected").html();
             var alert_message = _("You have chosen to move all unreceived orders from '%s' to '%s'.").format(budget_from, budget_to);
-            alert_message += _("\nThis action cannot be reversed. Do you wish to continue?");
+            alert_message += "\n" + _("This action cannot be reversed. Do you wish to continue?");
             return confirm ( alert_message );
           });
         [% END %]
             ],
             'bSort': true,
             'aaSortingFixed': [[ 1, 'asc' ]],
-            'bPaginate': false,
-            "bAutoWidth": false
+            "bAutoWidth": false,
+            "sPaginationType": "full_numbers"
           }));
         [% END %]
     });
 
     [% IF ( add_form ) %]&rsaquo;
         [% IF ( budget_period_id ) %]
-            Modify budget'[% budget_period_id %]'
+            Modify budget [% budget_period_description %]
         [% ELSE %]
             Add budget
         [% END %]
     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
     <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo;
 
-    <!-- add or modify a budget period -->
-    <!-- ####################################### -->
     [% IF ( add_form ) %]
-        <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budget</a> &rsaquo;
+        <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
         [% IF ( budget_period_id ) %]
-            Modify budget [% budget_period_description %]
-
+            <span>Modify budget '[% budget_period_description %]'</span>
         [% ELSE %]
-            Add budget
+            <span>Add budget</span>
         [% END %]
     [% END %]
-
-    <!-- delete a budget period -->
-    <!-- ################################ -->
     [% IF ( delete_confirm ) %]
         <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
         [% IF ( total ) %]
-            Cannot delete budget '[% budget_period_description %]'
+            <span>Cannot delete budget '[% budget_period_description %]'</span>
         [% ELSE %]
-            Delete budget '[% budget_period_description %]'?
+            <span>Delete budget '[% budget_period_description %]'?</span>
         [% END %]
     [% END %]
-    <!-- duplicate a budget -->
     [% IF ( duplicate_form ) %]
         <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo; Duplicate budget
     [% END %]
-
-    <!-- close a budget -->
     [% IF close_form %]
         <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
-        Close budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>
+        <span>Close budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a></span>
     [% END %]
-
-    <!-- budget closed -->
     [% IF closed %]
         <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
-        Budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a> closed
+        <span>Budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a> closed</span>
     [% END %]
-    <!-- display budget periods list -->
-    <!-- ########################################## -->
     [% IF ( else ) %]
-        Budgets administration
+        <span>Budgets administration</span>
     [% END %]
 </div>
 
     <input type="text" id="budget_period_description" name="budget_period_description" value="[% budgetperiod.budget_period_description %]" />
     </li>
 
+    <li>
+      <label for="amount_change_percentage">Change amounts by</label>
+      <input type="text" id="amount_change_percentage" name="amount_change_percentage" /> %
+      <div class="hint">(can be positive or negative)</div>
+    </li>
+
+    <li>
+      <label for="amount_change_round_increment">If amounts changed, round to a multiple of</label>
+      <input type="text" id="amount_change_round_increment" name="amount_change_round_increment" />
+      <div class="hint">(amounts will be rounded down)</div>
+    </li>
+
     <li>
       <label for="mark_as_inactive">Mark the original budget as inactive</label>
       <input type="checkbox" id="mark_as_inactive" name="mark_original_budget_as_inactive" />
     <!--  add or modify a budget period   -->
 
     [% IF ( budget_period_id ) %]
-        <h3>Modify budget</h3>
+        <h3>Modify budget <i>[% budget_period_description %]</i></h3>
     [% ELSE %]
         <h3>Add budget</h3>
        [% END %]
         <!-- ############################## -->
         <label for="budget_period_total">Total amount: </label>
         <input type="text" id="budget_period_total" name="budget_period_total"
-        size="10" maxlength="80" value="[% budget_period_total %]" />
+        size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" />
     </li>
 
     <li>
     <fieldset class="action">
         <!-- "save changes" button -->
         <!-- ###################################### -->
-        <input type="button" value="Save changes"  onclick="Check(this.form)"    />
+        <input type="button" value="Save"  onclick="Check(this.form)" />
         <!--             <input type="submit" value="Save Changes"  />  -->
-        [% IF ( budget_period_id ) %]<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>[% END %]
+        [% IF ( budget_period_id ) %]
+            <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>
+        [% ELSE %]
+            <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl" class="cancel">Cancel</a>
+        [% END %]
     </fieldset>
 
 </form>
     <form action="[% script_name %]" method="post">
         <input type="hidden" name="op" value="delete_confirmed" />
         <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
-        <input type="submit" class="approve" value="Delete" />
+        <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
     </form>
-
     <form action="[% script_name %]" method="post">
-        <input type="submit" class="deny" value="Cancel" />
+        <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
     </form>
 
     </div>
             [% IF r.orders_moved.size > 0 %]
               [% FOR order IN r.orders_moved %]
                 <tr>
-                  <td>[% r.budget.budget_name %] (id=[% r.budget.budget_id %]) Amount=[% r.budget.budget_amount | format ("%.2f") %][% IF r.unspent_moved %] ([% r.unspent_moved | format ("%.2f")%] remaining has been moved)[% END %]</td>
+                  <td>[% r.budget.budget_name %] (id=[% r.budget.budget_id %]) Amount=[% r.budget.budget_amount | $Price %][% IF r.unspent_moved %] ([% r.unspent_moved | $Price %] remaining has been moved)[% END %]</td>
                   <td>[% order.basketname %]</td>
                   <td>[% order.ordernumber %]</td>
                   <td>Moved!</td>
           [% ELSE %]
             [% IF r.error == 'budget_code_not_exists' %]
               <tr>
-                <td>[% r.budget.budget_id %] [% r.budget.budget_amount | format ("%.2f") %][% IF r.unspent_moved %] ([% r.unspent_moved | format ("%.2f") %] remaining has been moved)[% END %]</td>
+                <td>[% r.budget.budget_id %] [% r.budget.budget_amount | $Price %][% IF r.unspent_moved %] ([% r.unspent_moved | $Price %] remaining has been moved)[% END %]</td>
                 <td></td>
                 <td></td>
                 <td>This fund code does not exist in the destination budget.</td>
                     <span style="color:green;">Locked</span>&nbsp;
                   [% END %]
                 </td>
-                <td class="data">[% period_active.budget_period_total %]</td>
+                <td class="data">[% period_active.budget_period_total | $Price %]</td>
                 <td>
-                  <a href="[% script_name %]?op=add_form&amp;budget_period_id=[% period_active.budget_period_id |html %]">Edit</a>
-                  <a href="[% script_name %]?op=delete_confirm&amp;budget_period_id=[% period_active.budget_period_id %]">Delete</a>
-                  <a href="[% script_name %]?op=duplicate_form&amp;budget_period_id=[% period_active.budget_period_id %]">Duplicate</a>
-                  <a href="[% script_name %]?op=close_form&amp;budget_period_id=[% period_active.budget_period_id %]">Close</a>
-                  <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_period_id=[% period_active.budget_period_id %]">Add fund</a>
+                    [% PROCESS action_menu block_budget_id=period_active.budget_period_id %]
                 </td>
                 </tr>
               [% END %]
       [% ELSE %]
         No active budgets
       [% END %]
-      <div class="paginationBar">[% active_pagination_bar %]</div>
     </div>
     <div id="inactive">
       [% IF ( period_inactive_loop ) %]
           </thead>
           <tbody>
               [% FOREACH period_loo IN period_inactive_loop %]
-                  [% IF ( loop.odd ) %]
-                      <tr>
-                  [% ELSE %]
-                      <tr class="highlight">
-                  [% END %]
+                  <tr>
                   <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_loo.budget_period_id %]" title="View funds for [% period_loo.budget_period_description %]">[% period_loo.budget_period_description %]</a></td>
                   <td><span title="[% period_loo.budget_period_startdate %]">[% period_loo.budget_period_startdate | $KohaDates %]</span></td>
                   <td><span title="[% period_loo.budget_period_enddate %]">[% period_loo.budget_period_enddate | $KohaDates %]</span></td>
                   <td> [% IF ( period_loo.budget_period_locked ) %]<span style="color:green;">Locked</span>&nbsp;[% ELSE %][% END %] </td>
-                  <td class="data">[% period_loo.budget_period_total %]</td>
+                  <td class="data">[% period_loo.budget_period_total | $Price %]</td>
                   <td>
-                      <a href="[% script_name %]?op=add_form&amp;budget_period_id=[% period_loo.budget_period_id |html %]">Edit</a>
-                      <a href="[% script_name %]?op=delete_confirm&amp;budget_period_id=[% period_loo.budget_period_id %]">Delete</a>
-                      <a href="[% script_name %]?op=duplicate_form&amp;budget_period_id=[% period_loo.budget_period_id %]">Duplicate</a>
-                      <a href="[% script_name %]?op=close_form&amp;budget_period_id=[% period_loo.budget_period_id %]">Close</a>
-                  <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_period_id=[% period_loo.budget_period_id %]">Add fund</a>
+                        [% PROCESS action_menu block_budget_id=period_loo.budget_period_id %]
                   </td>
                   </tr>
               [% END %]
       [% ELSE %]
         No inactive budgets
       [% END %]
-      <div class="pages">[% inactive_pagination_bar %]</div>
     </div>
   </div>
 [% END %]