[Koha-patches] [PATCH] Bug 5949 : Popup alert when deleting items from basket, also change planning value to statistics

Chris Cormack chrisc at catalyst.net.nz
Fri Mar 25 01:58:59 CET 2011


From: Christophe Croullebois <christophe.croullebois at biblibre.com>

(MT #2391) : acqui/neworderempty.pl

Multiple fixes in neworderempty.pl, mainly about Modify order line page, link to edit catalog, user can delete items with popup information and can't add items also with popup explanation.
---
 .../prog/en/modules/acqui/neworderempty.tmpl       |   35 ++++++++++++++++---
 1 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl
index 76f5a3f..fd03db4 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl
@@ -63,8 +63,29 @@ if (ok) {
 ff.submit();
 
 }
-
-
+$(document).ready(function() 
+    {
+        //We apply the fonction only for modify option
+        <!--TMPL_IF NAME="quantityrec"-->
+        $('#quantity').blur(function() 
+        {
+            // if user decreases the quantity
+            if($(this).val() < <!-- TMPL_VAR name="quantityrec" -->) 
+            {
+                alert("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog");   
+                return true;
+            } 
+            else 
+            {
+                // if user increases the quantity
+                alert("You can't add a new item, please create a new order line");
+                // and we replace the original value
+                $(this).val(<!-- TMPL_VAR name="quantityrec" -->)
+                return false;
+            }
+        });
+        <!-- /TMPL_IF -->
+    });
 //]]>
 </script>
 </head>
@@ -83,7 +104,7 @@ ff.submit();
 
 <h2>
     <!-- TMPL_IF name="ordernumber" -->
-        Modify order details (line #<!-- TMPL_VAR NAME="ordernumber" -->)
+        Modify order line
     <!-- TMPL_ELSE -->
         New order
     <!-- /TMPL_IF -->
@@ -161,6 +182,8 @@ ff.submit();
             <label for="entertitle" class="required">Title: </label>
                 <input type="text" id="entertitle" size="50" name="title" value="<!-- TMPL_VAR NAME="title" ESCAPE="html" -->" />
             <!-- /TMPL_IF -->
+
+	    <span><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=<!--TMPL_VAR NAME= "biblionumber"-->">Edit Catalog</a></span>
         </li>
         <li>
             <!-- TMPL_IF name="biblionumber" -->
@@ -361,10 +384,10 @@ ff.submit();
             </li>
             <li>
                 <label for="notes">Notes: </label>
-                <textarea id="notes" cols="30" rows="3" name="notes"><!-- TMPL_VAR NAME="notes" --></textarea>
+                <textarea id="notes" cols="30" rows="3" name="notes"></textarea>
             </li>
             <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
-                <label for="sort1">Planning value1: </label>
+                <label for="sort1">Statistic 1: </label>
 
                 <!-- TMPL_IF Name="CGIsort1" -->
                     <!-- TMPL_VAR Name="CGIsort1" -->
@@ -374,7 +397,7 @@ ff.submit();
                 <!--/TMPL_IF -->
             </li>
             <li>
-                <label for="sort2">Planning value2: </label>
+                <label for="sort2">Statistic 2: </label>
 
                 <!-- TMPL_IF Name="CGIsort2" -->
                     <!-- TMPL_VAR Name="CGIsort2" -->
-- 
1.7.1



More information about the Koha-patches mailing list