ug 7561: Fast cataloging - Allow add/edit items and delete record
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / en / includes / cat-toolbar.inc
index 12a4ad0..ee39f31 100644 (file)
@@ -9,7 +9,7 @@
                } 
        }
     function PopupZ3950Confirmed() {
-        if (confirm(_("Please note that this Z39.50 search could replace the current record."))){
+        if (confirm(_("Please note that this external search could replace the current record."))){
             PopupZ3950();
         }
     }
@@ -18,7 +18,7 @@
        function GetZ3950Terms(){
                var strQuery="&frameworkcode=";
                [% FOREACH z3950_search_param IN z3950_search_params %]
-                       strQuery += "&" + "[% z3950_search_param.name |html %]" + "=" + "[% z3950_search_param.encvalue |html %]";
+            strQuery += "&" + "[% z3950_search_param.name |uri %]" + "=" + "[% z3950_search_param.value |uri %]";
                [% END %]
                return strQuery;
        }
@@ -27,7 +27,7 @@
        function addToShelf() { window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=[% biblionumber %]','Add_to_virtualshelf','width=500,height=400,toolbar=false,scrollbars=yes');
        }
     function printBiblio() {window.print(); }
-[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
+[% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
     function confirm_deletion() {
         var count = [% count %];
         var holdcount = [% holdcount %];
         var countdeletedorders = [% countdeletedorders %];
         var is_confirmed;
        if (count > 0){
-            is_confirmed = alert( count + " " +_("item(s) are attached to this record. You must delete all items before deleting this record.") );
+            is_confirmed = alert( _("%s item(s) are attached to this record. You must delete all items before deleting this record.").format(count) );
          }
         else if (countorders > 0){
             [% IF ( CAN_user_acquisition_order_manage ) %]
-                is_confirmed = confirm( _("Warning: This record is used in")+" "+ countorders + " " +_("order(s). Deleting it could cause serious issues on acquisition module. Are you sure you want to delete this record?") );
+                is_confirmed = confirm( _("Warning: This record is used in %s order(s). Deleting it could cause serious issues on acquisition module. Are you sure you want to delete this record?").format(countorders) );
             [% ELSE %]
-                is_confirmed = alert( countorders + " " +_("order(s) are using this record. You need order managing permissions to delete this record.") );
+                is_confirmed = alert( _("%s order(s) are using this record. You need order managing permissions to delete this record.").format(countorders) );
             [% END %]
         }
         else if (countdeletedorders > 0){
              [% IF ( CAN_user_acquisition_order_manage ) %]
-                 is_confirmed = confirm( countdeletedorders + " " +_("deleted order(s) are using this record. Are you sure you want to delete this record?") );
+                 is_confirmed = confirm( _("%s deleted order(s) are using this record. Are you sure you want to delete this record?").format(countdeletedorders) );
              [% ELSE %]
-                 is_confirmed = alert( countdeletedorders + " " +_("deleted order(s) are using this record. You need order managing permissions to delete this record.") );
+                 is_confirmed = alert( _("%s deleted order(s) are using this record. You need order managing permissions to delete this record.").format(countdeletedorders) );
              [% END %]
         }
         else if ( holdcount > 0 ) {
-            is_confirmed = confirm( holdcount + " " + _("holds(s) for this record. Are you sure you want to delete this record?"));
+            is_confirmed = confirm( _("%s holds(s) for this record. Are you sure you want to delete this record?").format(holdcount) );
         } else {
             is_confirmed = confirm(_("Are you sure you want to delete this record?"));
         }
     }
 [% END %]
 
-[% IF ( CAN_user_editcatalogue_edit_items ) %]
+[% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
     function confirm_items_deletion() {
         var count = [% count %];
         var holdcount = [% holdcount %];
 
         if ( holdcount > 0 ) {
-            alert( holdcount + " " + _("hold(s) on this record. You must delete all holds before deleting all items.") );
+            alert( _("%s hold(s) on this record. You must delete all holds before deleting all items.").format(holdcount) );
         } else if ( count > 0 ) {
-            if( confirm( _("Are you sure you want to delete the") + " " + count + " " + _("attached items?") ) ) {
+            if( confirm( _("Are you sure you want to delete the %s attached items?").format(count) ) ) {
                 window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&biblionumber=[% biblionumber %]";
             } else {
                 return false;
@@ -152,22 +152,22 @@ CAN_user_serials_create_subscription ) %]
             [% IF ( EasyAnalyticalRecords && CAN_user_editcatalogue_edit_catalogue ) %]
                 <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&amp;analyze=1">Analyze items</a></li>
             [% END %]
-            [% IF CAN_user_editcatalogue_edit_catalogue %]
+            [% IF CAN_user_editcatalogue_edit_catalogue && ! EasyAnalyticalRecords %]
                 <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?parentbiblionumber=[% biblionumber %]">New child record</a></li>
             [% END %]
     </ul>
     </div>
 [% END %]
 
-[% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel ) %]
+[% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel ) or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
     <div class="btn-group">
     <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-pencil"></i> Edit <span class="caret"></span></button>
         <ul class="dropdown-menu">
-            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
+            [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
             <li><a id="editbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=[% current_framework %]&amp;op=">Edit record</a></li>
             [% END %]
 
-            [% IF ( CAN_user_editcatalogue_edit_items ) %]
+            [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
             <li><a id="edititems" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]">Edit items</a></li>
             [% END %]
 
@@ -193,17 +193,19 @@ CAN_user_serials_create_subscription ) %]
             [% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]<li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&amp;filetype=image">Upload image</a>[% END %][% END %]
 
             [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
-            <li><a id="duplicatebiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=[% current_framework %]&amp;op=duplicate">Edit as new (duplicate)</a></li>
-            <li><a href="#" id="z3950copy">Replace record via Z39.50</a></li>
+                <li><a id="duplicatebiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=[% current_framework %]&amp;op=duplicate">Edit as new (duplicate)</a></li>
+                <li><a href="#" id="z3950copy">Replace record via Z39.50/SRU</a></li>
+            [% END %]
 
+            [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
                 [% IF ( count ) %]
                     <li class="disabled"><a id="deletebiblio" data-toggle="tooltip" data-placement="left" title="[% count %] item(s) are attached to this record. You must delete all items before deleting this record." href="#">Delete record</a></li>
                 [% ELSE %]
-                    <li><a id="deletebiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&amp;biblionumber=[% biblionumber %]">Delete record</a></li>
+                    <li><a id="deletebiblio" href="#">Delete record</a></li>
                 [% END %]
             [% END %]
 
-            [% IF ( CAN_user_editcatalogue_edit_items ) %]
+            [% IF CAN_user_editcatalogue_delete_all_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
                 [% IF ( count ) %]
                     <li><a href="#" id="deleteallitems">Delete all items</a></li>
                 [% ELSE %]
@@ -234,11 +236,11 @@ CAN_user_serials_create_subscription ) %]
     <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">Add to <span class="caret"></span></button>
     <ul class="dropdown-menu">
         <li><a href="#" id="addtocart">Cart</a></li>
-        <li><a id="addtoshelf" href="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=[% biblionumber %]">List</a></li>
+        <li><a href="#" id="addtoshelf">List</a></li>
     </ul>
     </div>
 [% ELSIF ( virtualshelves ) %]
-    <div class="btn-group"><a id="addtoshelf" class="btn btn-small" href="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=[% biblionumber %]"><i class="icon-list"></i> Add to list</a> </div>
+    <div class="btn-group"><a id="addtoshelf" class="btn btn-small"><i class="icon-list"></i> Add to list</a> </div>
 [% ELSIF ( intranetbookbag ) %]
     <div class="btn-group"><a id="addtocart" class="btn btn-small"><i class="icon-shopping-cart"></i> Add to cart</a> </div>
 [% END %]