Bug 16726: [FOLLOW-UP] Putting text in h1
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqplan.tt
index a836138..66f6b9f 100644 (file)
@@ -1,13 +1,11 @@
+[% USE Price %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Administration &rsaquo; Budgets &rsaquo; Funds &rsaquo; Planning for [% budget_period_description %] by [% authcat %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
-[% INCLUDE 'calendar.inc' %]
-<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
+<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script>
 <script type="text/javascript">
 //<![CDATA[
-// ---------------------------------------------------------------------
-// Javascript
-// ---------------------------------------------------------------------
     function Check(f) {
             var ok=1;
             var _alertString="";
                     alert(alertString2);
             }
     }
-
-
-YAHOO.util.Event.onAvailable("popmenu", function () {
-
-    var itemData  = new Array();
-    table = document.getElementById('plan') 
-    tableTmp =  table.cloneNode(true); 
-    tableTmp.id = 'planTmp';
-
-    [% FOREACH authvals_ro IN authvals_row %]
-        itemData.push( {   text: "[% authvals_ro.val %]",  onclick: { fn: addColumn, obj:  ["[% authvals_ro.colnum %]",  "[% authvals_ro.code %]"]    }    }     );
-
-    [% END %]
-    oMenu = new YAHOO.widget.Menu("basicmenu",
-            {  position: "dynamic", itemdata: itemData , clicktohide  : "true" , context:["popmenu","tl","tr"] }
-    );
-
-   oMenu.render("popmenu");
-   YAHOO.util.Event.addListener("add_popmenu_item", "click", oMenu.show, null, oMenu);
-
-// oMenu.removeItem(2);   // TODO.....
-
-});
+    $(document).ready(function() {
+        $("#selections input").on("change",function(e){
+            var num = $(this).attr("id");
+            if(num == 'showall'){
+                showAllColumns();
+                e.stopPropagation();
+            } else if(num == 'hideall'){
+                hideAllColumns();
+                e.stopPropagation();
+            } else {
+                if($(this).prop("checked")){
+                    showColumn(num);
+                } else {
+                    hideColumn(num);
+                }
+            }
+        });
+    });
 //]]>
 </script>
-<style type="text/css">td.locked { background-image: url('/intranet-tmpl/prog/img/locked.png'); padding-left : 20px; background-repeat: no-repeat; background-position: 4% 50%; } a.control { font-size:85%;text-decoration:none; }</style>
+<style type="text/css">td.locked { background-image: url('[% interface %]/[% theme %]/img/locked.png'); padding-left : 20px; background-repeat: no-repeat; background-position: 5px 5px; } a.control { font-size:85%;text-decoration:none; }</style>
 </head>
 <body id="admin_aqplan" class="admin">
 [% INCLUDE 'header.inc' %]
@@ -83,7 +76,6 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
 <div id="yui-main">
 <div class="yui-b">
 
-
 [% INCLUDE 'budgets-admin-toolbar.inc' %]
 
 <form method="post" id="Aform" name="Aform"  action="/cgi-bin/koha/admin/aqplan.pl">
@@ -93,21 +85,20 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
 
     [% IF ( budget_lines ) %]
 
-    [% IF ( currency ) %]<p><b>Currency = [% currency %]</b>.
-    [% IF ( show_actual ) %]
-        <b>Each cell contain both actual and estimated values.</b>
-    [% ELSE %]
-        <b>Cells contain estimated values only.</b>
-    [% END %]
-    </p>[% ELSE %]<div class="dialog alert"><h3>No active currency is defined</h3><p>Please <a href="/cgi-bin/koha/admin/currency.pl">specify an active currency</a>.</p></div>
-[% IF ( show_actual ) %]
-        <p><b>Each cell contain both actual and estimated values.</b></p>
-    [% ELSE %]
-        <p><b>Cells contain estimated values only.</b></p>
-    [% END %]
-    [% END %]
+        [% INCLUDE 'budgets-active-currency.inc' %]
+        [% IF ( show_actual ) %]
+            <p><b>Each cell contain both actual and estimated values.</b></p>
+        [% ELSE %]
+            <p><b>Cells contain estimated values only.</b></p>
+        [% END %]
 
-    <table id="plan" width="100%">
+    <p id="selections">
+        <strong>Show/hide columns:</strong> <span class="selected"><input type="checkbox" checked="checked" id="showall"/><label for="showall">Show all columns</label></span> <span><input type="checkbox" id="hideall"/><label for="hideall">Hide all columns</label></span>
+        [% FOREACH authvals_ro IN authvals_row %]
+            <span class="selected"><label><input type="checkbox" checked="checked" id="col[% authvals_ro.colnum %]">[% authvals_ro.code %]</label></span>
+        [% END %]
+    </p>
+    <table id="plan">
     <thead>
     <tr>
     <th>Fund name</th>
@@ -117,41 +108,26 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
          [% IF ( authvals_ro.display ) %]
             <th id="col[% authvals_ro.code %]" class="[% authvals_ro.colnum %]">
         [% ELSE %]
-            <th id="col[% authvals_ro.code %]" styl="display:none;" class="[% authvals_ro.colnum %]">
+            <th id="col[% authvals_ro.code %]" style="display:none;" class="[% authvals_ro.colnum %]">
         [% END %]
 
     [% authvals_ro.code %]</th>
     [% END %]
 
-    <th>Fund remaining</th><th>&nbsp;</th>
+    <th class="remaining">Fund remaining</th><th>&nbsp;</th>
     </tr>
-    <tr>
-    <th>&nbsp;</th><th>&nbsp;</th>
-    [% FOREACH authvals_ro IN authvals_row %]
-         [% IF ( authvals_ro.display ) %]
-            <th class="[% authvals_ro.colnum %]">
-        [% ELSE %]
-            <th style="display:none;" class="[% authvals_ro.colnum %]">
-        [% END %]
-
-    <a class="control" onclick="delColumn('[% authvals_ro.colnum %]', 'col[% authvals_ro.code %]')" href="#" title="Hide this column">[ hide ]</a></th>
-
-    [% END %]
-    <th id="popmenu"><a style="font-size:85%;text-decoration:none;" id="add_popmenu_item" href="#" title="Show a hidden column">[ show a column ]</a></th><th>&nbsp;</th>
-     </tr>
-
     </thead>
 
     <tbody>
     [% FOREACH budget_line IN budget_lines %]
-    [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
+    <tr>
         [% IF ( budget_line.budget_lock ) %]
-            <td align="left" class="locked" title="Fund locked">
+            <td class="locked" title="Fund locked">
         [% ELSE %]
-            <td align="left">
+            <td>
         [% END %]
-        <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_id=[% budget_line.budget_id %]&amp;budget_period_id=[% budget_line.budget_period_id %]">[% budget_line.budget_name_indent %]</a></td>
-        <td><span id="budget_tot_formatted_[% budget_line.budget_id %]">[% budget_line.budget_amount_formatted %]&nbsp;</span>
+        <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_id=[% budget_line.budget_id %]&amp;budget_period_id=[% budget_period_id %]">[% budget_line.budget_name %]</a></td>
+        <td><span id="[% budget_line.budget_amount %]">[% budget_line.budget_amount | $Price %]&nbsp;</span>
 
 
         <!-- NEXT DIV ELEMENT IS USED BY JS FOR CALC-ING AUTO-FILL AND ESTIMATED AMOUNTS -->
@@ -163,10 +139,10 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
             [% ELSE %]
                 <td style="display:none;" class="[% line.colnum %]">
             [% END %]
-            <table class="invis" width="100%">
+            <table class="invis">
                 <tr>
-                    [% IF ( line.show_actual ) %]
-                        <td   width="50%"  >[% line.actual_amount %]</td>
+                    [% IF show_actual %]
+                        <td    >[% line.actual_amount %]</td>
                     [% END %]
                 <td>
 
@@ -183,28 +159,28 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
         [% END %]
 
         <td>
-        <table class="invis" width="100%">
+        <table class="invis">
             <tr>
-       [% IF ( budget_line.show_actual ) %]
+       [% IF show_actual %]
             [% IF ( budget_line.act_negative ) %]
-                <td width="50%" style="color: red;">
+                <td style="color: red;">
             [% ELSIF ( budget_line.act_positive ) %]
-                <td width="50%" style="color: green;">
+                <td style="color: green;">
             [% ELSE %]
-                <td width="50%">
+                <td>
             [% END %]
                     [% budget_line.budget_act_remain %]
             </td>
         [% END %]
 
         [% IF ( budget_line.est_negative ) %]
-            <td width="50%" style="color: red;" id="budget_est_[% budget_line.budget_id %]">
+            <td style="color: red;" id="budget_est_[% budget_line.budget_id %]">
         [% ELSIF ( budget_line.est_positive ) %]
-            <td width="50%" style="color: green;" id="budget_est_[% budget_line.budget_id %]">
+            <td style="color: green;" id="budget_est_[% budget_line.budget_id %]">
         [% ELSE %]
-            <td width="50%" id="budget_est_[% budget_line.budget_id %]">
+            <td id="budget_est_[% budget_line.budget_id %]">
         [% END %] 
-                [% budget_line.budget_est_remain %]&nbsp;
+                [% budget_line.budget_est_remain | $Price %]&nbsp;
             </td>
             </tr>
         </table>
@@ -222,6 +198,7 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
     </tbody>
     </table>
 
+    <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
     [% IF ( budget_period_locked ) %]
         <!-- <input STYLE="background: gray;"   type="submit" value="Save" disabled="disabled"/> -->
     [% ELSE %]
@@ -242,6 +219,8 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
 
 </form>
 
+        [% ELSIF not budget_period_id %]
+<div class="dialog alert">That budget does not exist! Please select a budget to continue.</div>
         [% ELSE %]
 <div class="dialog message">No funds to display for this search criteria</div>
         [% END %]
@@ -252,13 +231,29 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
 <div class="yui-b">
 
 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
+    <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
 <fieldset class="brief">
 <h4>Filter</h4>
-
+[% BLOCK planning_types %]
+[%   SWITCH type %]
+[%     CASE 'MONTHS'    %]<span>by months</span>
+[%     CASE 'ITEMTYPES' %]<span>by item types</span>
+[%     CASE 'BRANCHES'  %]<span>by libraries</span>
+[%     CASE             %]<span>by [% type %]</span>
+[%   END %]
+[% END %]
 <ol>
     <li>
         <label for="authcat"> Select planning type:</label>
-        [% authcat_dropbox %]
+        <select name="authcat" id="authcat" size="1">
+        [% FOREACH value IN authcat_dropbox.values %]
+            [% IF ( value == authcat_dropbox.default ) %]
+            <option value="[% value %]" selected="selected">[% PROCESS planning_types type=value %]</option>
+            [% ELSE %]
+            <option value="[% value %]">[% PROCESS planning_types type=value %]</option>
+            [% END %]
+        [% END %]
+        </select>
     </li>
     <li class="radio">
     [% IF ( show_mine ) %]
@@ -288,23 +283,37 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
         <label for="show_actual">Show actual/estimated values</label>
     </li>
     </ol>
-<fieldset class="action">
-        <input type="submit" name="option_submit" value="Submit" /></fieldset>
+    <fieldset class="action">
+        <input type="submit" name="option_submit" value="Submit" />
+        <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
+    </fieldset>
 </fieldset>
 </form>
 [% IF ( budget_lines ) %]
 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
-<h4>Export</h4>
 <fieldset class="brief">
+<h4>Export</h4>
     <ol>
-    <li><label for="basename">Output to a file named: </label><input type="text" name="basename" id="basename" value="Export" /></li>
-    <li><label class="inline" for="MIME">Into an application
-    </label>[% CGIextChoice %]
-    [% CGIsepChoice %]</li>
+        <li><label for="basename">Output to a file named: </label><input type="text" name="basename" id="basename" value="Export" /></li>
+        <li><label class="inline" for="MIME">Into an application</label>
+            <select name="MIME" id="MIME" size="1">
+            [% FOREACH value IN CGIextChoice %]
+                <option value="[% value %]">[% value %]</option>
+            [% END %]
+            </select>
+            <select name="sep" id="sep" size="1">
+            [% FOREACH value IN CGIsepChoice %]
+                <option value="[% value %]">[% value %]</option>
+            [% END %]
+            </select>
+        </li>
     </ol>
     <fieldset class="action">    <input type="submit" value="Submit"/>
+    <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
     <input type="hidden" name="report_name" value="[% report_name %]" />
     <input type="hidden" name="output" value="file" /></fieldset>
+    <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
+    <input type="hidden" name="authcat" value="[% authcat %]" />
     </fieldset>
 </form>
 [% END %]