[Koha-patches] [PATCH] Bug 3654: Resubmit: Fixes issues with authorized values

Nicole Engard nengard at gmail.com
Mon Jan 4 08:21:36 CET 2010


 #1 Moves Authorized Values under Basic on the Admin page & menu
 #2 Add defaults for PROC & CART in LOC
 #3 Add MANUAL_INV default
 #4 Add BOR_Notes default
 #5 Fix descriptions and language on authorized values page related
    to these changes
---
 installer/data/mysql/en/optional/auth_val.sql      |    8 ++++
 installer/data/mysql/updatedatabase.pl             |   19 ++++++++++
 .../intranet-tmpl/prog/en/includes/admin-menu.inc  |    4 +-
 .../prog/en/modules/admin/admin-home.tmpl          |    8 ++--
 .../prog/en/modules/admin/authorised_values.tmpl   |   38 ++++++++++++++------
 5 files changed, 60 insertions(+), 17 deletions(-)

diff --git a/installer/data/mysql/en/optional/auth_val.sql b/installer/data/mysql/en/optional/auth_val.sql
index 11328e1..5a39534 100644
--- a/installer/data/mysql/en/optional/auth_val.sql
+++ b/installer/data/mysql/en/optional/auth_val.sql
@@ -24,6 +24,8 @@ INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC',
 INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','GEN','General Stacks');
 INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','AV','Audio Visual');
 INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','REF','Reference');
+INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','CART','Book Cart');
+INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','PROC','Processing Center');
 
 -- collection codes for an item
 INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('CCODE','FIC','Fiction');
@@ -43,3 +45,9 @@ INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('NOT_L
 -- restricted status of an item, linked to items.restricted
 INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('RESTRICTED','0','');
 INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('RESTRICTED','1','Restricted Access');
+
+-- manual invoice types
+INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('MANUAL_INV','Copier Fees','.25');
+
+--custom borrower notes
+INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('BOR_NOTES','ADDR','Address Notes');
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 79bc299..197bcf7 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -3312,6 +3312,25 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
+$DBversion = "XXX";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+
+    eval { $maninv_count = $dbh->do("SELECT 1 FROM authorised_values WHERE category='MANUAL_INV'"); };
+    if ($maninv_count == 0) {
+        $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('MANUAL_INV','Copier Fees','.25')");
+    }
+    eval { $borrnotes_count = $dbh->do("SELECT 1 FROM authorised_values WHERE category='BOR_NOTES'"); };
+    if ($borrnotes_count == 0) {
+        $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('BOR_NOTES','ADDR','Address Notes')");
+    }
+    
+    $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('LOC','CART','Book Cart')");
+    $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('LOC','PROC','Processing Center')");
+
+	print "Upgrade to $DBversion done ( add defaults to authorized values for MANUAL_INV and BOR_NOTES and add new default LOC authorized values for shelf to cart processing )\n";
+	SetVersion ($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc
index 1f82c07..d12aadb 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc
@@ -6,7 +6,8 @@
 <h5>Basic parameters</h5>
 <ul>
 	<li><a href="/cgi-bin/koha/admin/branches.pl">Libraries, branches, groups</a></li>
-	<li><a href="/cgi-bin/koha/admin/itemtypes.pl">Item types and circulation codes</a></li>
+	<li><a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a></li>
+	<li><a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a></li>
 </ul>
 
 <h5>Patrons and circulation</h5>
@@ -22,7 +23,6 @@
 
 <h5>Catalog</h5>
 <ul>
-	<li><a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a></li>
 	<li><a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC Bibliographic framework</a></li>
 	<li><a href="/cgi-bin/koha/admin/koha2marclinks.pl">Koha to MARC mapping</a></li>
 	<li><a href="/cgi-bin/koha/admin/checkmarc.pl">MARC Bibliographic framework test</a></li>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl
index 2a3d17d..a12218d 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl
@@ -32,8 +32,10 @@
 <dl>
         <dt><a href="/cgi-bin/koha/admin/branches.pl">Libraries, branches and groups</a></dt>
         <dd>Define libraries, branches and groups.</dd>
-        <dt><a href="/cgi-bin/koha/admin/itemtypes.pl">Item types and circulation codes</a></dt>
-        <dd>Define item types and circulation codes used for circulation rules.</dd>
+        <dt><a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a></dt>
+        <dd>Define item types used for circulation rules.</dd>
+        <dt><a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a></dt>
+		<dd>Define categories and authorized values for them.</dd>
 </dl>
 
 <h3>Patrons and circulation</h3>
@@ -58,8 +60,6 @@
 <div class="yui-u">
 <h3>Catalog</h3>
 <dl>
-	<dt><a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a></dt>
-	<dd>Define categories and authorized values for them.</dd>
 	<dt><a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC Bibliographic framework</a></dt>
 	<dd>Create and manage Bibliographic frameworks that define the characteristics of your MARC Records (field and subfield definitions) as well as templates for the MARC editor.</dd>
 	<dt><a href="/cgi-bin/koha/admin/koha2marclinks.pl">Koha to MARC mapping</a></dt>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tmpl
index 488dc10..367930a 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tmpl
@@ -163,9 +163,10 @@
 </ul></div>
 
 <h1>Authorized values</h1>
-<p>This table is used in MARC definition. You can define as many categories as you want, and as many authorized values as you want in each category.</p>
-<p>When you define the MARC subfield structure, you can link a subfield to a authorized-value category. When the user ask for adding of modifying a biblio,
-the subfield is not entered through a free field, but though a list of authorized values</p>
+<p>These values can be used in many pull down menus throughout the Koha system. You can define as many categories as you want, and as many authorized values as you want in each category.</p>
+
+<p>When you define the MARC subfield structure, you can link a subfield to a authorized-value category. When the user ask for adding of modifying a biblio, the subfield is not entered through a free field, but though a list of authorized values</p>
+
 <!-- TMPL_IF name="duplicate_category" -->
 <div>
 <span class="problem">Could not add value &quot;<!-- TMPL_VAR name="duplicate_value" -->&quot; for category 
@@ -175,28 +176,43 @@ the subfield is not entered through a free field, but though a list of authorize
 <!-- /TMPL_IF -->
 <form action="/cgi-bin/koha/admin/authorised_values.pl" method="post" id="category"><label for="searchfield">Show Category: </label><!-- TMPL_VAR name="tab_list" --> <input type="submit" value="Submit" /></form>
 <!-- TMPL_IF EXPR="category eq 'Bsort1'" -->
-    <p>Bsort1 is an authorized value attached to patrons, that can be used for stats purposes</p>
+    <p>An authorized value attached to patrons, that can be used for stats purposes</p>
 <!-- /TMPL_IF -->
 <!-- TMPL_IF EXPR="category eq 'Bsort2'" -->
-    <p>Bsort2 is an authorized value attached to patrons, that can be used for stats purposes</p>
+    <p>An authorized value attached to patrons, that can be used for stats purposes</p>
 <!-- /TMPL_IF -->
 <!-- TMPL_IF EXPR="category eq 'Asort1'" -->
-    <p>Asort1 is an authorized value attached to acquisitions, that can be used for stats purposes</p>
+    <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
 <!-- /TMPL_IF -->
 <!-- TMPL_IF EXPR="category eq 'Asort2'" -->
-    <p>Asort2 is an authorized value attached to acquisitions, that can be used for stats purposes</p>
+    <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
 <!-- /TMPL_IF -->
 <!-- TMPL_IF EXPR="category eq 'SUGGEST'" -->
-    <p>The list of patron suggestion reject or accept reasons</p>
+    <p>Reasons to reject or accept patron suggestions</p>
 <!-- /TMPL_IF -->
 <!-- TMPL_IF EXPR="category eq 'DAMAGED'" -->
-    <p>The list of status to describe a damaged item</p>
+    <p>Statuses to describe a damaged item</p>
 <!-- /TMPL_IF -->
 <!-- TMPL_IF EXPR="category eq 'LOST'" -->
-    <p>The list of status to describe a lost item</p>
+   <p>Statuses to describe a lost item</p>
+<!-- /TMPL_IF -->
+<!-- TMPL_IF EXPR="category eq 'MANUAL_INV'" -->
+    <p>Additional values for manual invoice types</p>
+<!-- /TMPL_IF -->
+<!-- TMPL_IF EXPR="category eq 'BOR_NOTES'" -->
+    <p>Values for custom patron notes</p>
+<!-- /TMPL_IF -->
+<!-- TMPL_IF EXPR="category eq 'LOC'" -->
+    <p>Values for shelving locations</p>
 <!-- /TMPL_IF -->
+<!-- TMPL_IF EXPR="category eq 'CCODE'" -->
+    <p>Values for collection codes</p>
+ <!-- /TMPL_IF -->
+ <!-- TMPL_IF EXPR="category eq 'NOT_LOAN'" -->
+    <p>Statuses to describe why an item is not for loan</p>
+ <!-- /TMPL_IF -->
 <table>
-<caption>Authorised values for category <!-- TMPL_VAR name="category" --> :</caption>
+<caption>Authorized values for category <!-- TMPL_VAR name="category" --> :</caption>
 <tr>
 	<th>Authorized value</th>
 	<th>Description</th>
-- 
1.5.6.5




More information about the Koha-patches mailing list