[Koha-cvs] koha admin/auth_subfields_structure.pl admin/au... [rel_3_0]

Henri-Damien LAURENT laurenthdl at alinto.com
Tue Jan 23 17:15:07 CET 2007


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Henri-Damien LAURENT <hdl>	07/01/23 16:15:07

Modified files:
	admin          : auth_subfields_structure.pl 
	                 auth_tag_structure.pl authtypes.pl 
	koha-tmpl/intranet-tmpl/prog/en/admin: 
	                                       auth_subfields_structure.tmpl 
	                                       auth_tag_structure.tmpl 
	                                       authtypes.tmpl 

Log message:
	BUG FIXING: Thesaurus structure are now editable

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/admin/auth_subfields_structure.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.7.2.4&r2=1.7.2.5
http://cvs.savannah.gnu.org/viewcvs/koha/admin/auth_tag_structure.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.6.2.3&r2=1.6.2.4
http://cvs.savannah.gnu.org/viewcvs/koha/admin/authtypes.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.5.2.2&r2=1.5.2.3
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/admin/auth_subfields_structure.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.2.2.1&r2=1.2.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/admin/auth_tag_structure.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.2.2.1&r2=1.2.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/admin/authtypes.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1&r2=1.1.2.1

Patches:
Index: admin/auth_subfields_structure.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/auth_subfields_structure.pl,v
retrieving revision 1.7.2.4
retrieving revision 1.7.2.5
diff -u -b -r1.7.2.4 -r1.7.2.5
--- admin/auth_subfields_structure.pl	18 Dec 2006 16:35:17 -0000	1.7.2.4
+++ admin/auth_subfields_structure.pl	23 Jan 2007 16:15:07 -0000	1.7.2.5
@@ -106,6 +106,16 @@
 	push (@authorised_values,"branches");
 	push (@authorised_values,"itemtypes");
 
+    # build thesaurus categories list
+    $sth2->finish;
+    $sth2 = $dbh->prepare("select authtypecode from auth_types where authtypecode <> ?");
+    $sth2->execute($authtypecode);
+    my @authtypes;
+    push @authtypes, "";
+    while ( ( my $authtypecode ) = $sth2->fetchrow_array ) {
+        push @authtypes, $authtypecode;
+    }
+
 	# build value_builder list
 	my @value_builder=('');
 
@@ -198,6 +208,14 @@
 		 			-tabindex=>'',
 					-multiple=>0,
 					);
+		$row_data{frameworkcode}  = CGI::scrolling_list(-name=>'frameworkcode',
+					-id=>'frameworkcode',
+					-values=> \@authtypes,
+					-default=>$data->{'frameworkcode'},
+					-size=>1,
+		 			-tabindex=>'',
+					-multiple=>0,
+					);
 		$row_data{value_builder}  = CGI::scrolling_list(-name=>'value_builder',
 					-id=>'value_builder',
 					-values=> \@value_builder,
@@ -305,6 +323,14 @@
 					-size=>1,
 					-multiple=>0,
 					);
+		$row_data{frameworkcode}  = CGI::scrolling_list(-name=>'frameworkcode',
+					-id=>'frameworkcode',
+					-values=> \@authtypes,
+					-default=>$data->{'frameworkcode'},
+					-size=>1,
+		 			-tabindex=>'',
+					-multiple=>0,
+					);
 		$row_data{authorised_value}  = CGI::scrolling_list(-name=>'authorised_value',
 					-id => 'authorised_value',
 					-values=> \@authorised_values,
@@ -312,6 +338,14 @@
 		 			-tabindex=>'',
 					-multiple=>0,
 					);
+		$row_data{value_builder}  = CGI::scrolling_list(-name=>'value_builder',
+					-id=>'value_builder',
+					-values=> \@value_builder,
+					-default=>$data->{'value_builder'},
+					-size=>1,
+		 			-tabindex=>'',
+					-multiple=>0,
+					);
 		$row_data{link} = CGI::checkbox( -name => "link",
 			-id => "link$i",
 			-checked => '',
@@ -336,21 +370,21 @@
 } elsif ($op eq 'add_validate') {
 	my $dbh = C4::Context->dbh;
 	$template->param(tagfield => "$input->param('tagfield')");
-	my $sth=$dbh->prepare("replace auth_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,authtypecode,value_builder,hidden,isurl, link)
-									values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
+	my $sth=$dbh->prepare("replace auth_subfield_structure (authtypecode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,frameworkcode,value_builder,hidden,isurl, link)
+									values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
 	my @tagsubfield	= $input->param('tagsubfield');
 	my @liblibrarian	= $input->param('liblibrarian');
 	my @libopac		= $input->param('libopac');
 	my @kohafield		= $input->param('kohafield');
 	my @tab				= $input->param('tab');
 	my @seealso		= $input->param('seealso');
-	#my @hidden		= $input->param('hidden');
 	my @hidden;
 	my @ohidden		= $input->param('ohidden');
 	my @ihidden		= $input->param('ihidden');
 	my @ehidden		= $input->param('ehidden');
 	my @authorised_values	= $input->param('authorised_value');
-#	my $authtypecodes	= $input->param('authtypecode');
+	my $authtypecode	= $input->param('authtypecode');
+	my @frameworkcodes	= $input->param('frameworkcode');
 	my @value_builder	=$input->param('value_builder');
 	my @link		=$input->param('link');
 	for (my $i=0; $i<= $#tagsubfield ; $i++) {
@@ -365,14 +399,15 @@
 		my $tab				=$tab[$i];
 		my $seealso				=$seealso[$i];
 		my $authorised_value		=$authorised_values[$i];
-#		my $authtypecode		=$authtypecodes;
+		my $frameworkcode		=$frameworkcodes[$i];
 		my $value_builder=$value_builder[$i];
 		my $hidden = $ohidden[$i].$ihidden[$i].$ehidden[$i]; #collate from 3 hiddens;
 		my $isurl = $input->param("isurl$i")?1:0;
 		my $link = $input->param("link$i")?1:0;
 		if ($liblibrarian) {
 			unless (C4::Context->config('demo') eq 1) {
-				$sth->execute ($tagfield,
+				$sth->execute($authtypecode,
+                              $tagfield,
 									$tagsubfield,
 									$liblibrarian,
 									$libopac,
@@ -382,12 +417,10 @@
 									$tab,
 									$seealso,
 									$authorised_value,
-									$authtypecode,
+                              $frameworkcode,
 									$value_builder,
 									$hidden,
 									$isurl,
-									
-
 	 $link,
 					      );
 			}

Index: admin/auth_tag_structure.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/auth_tag_structure.pl,v
retrieving revision 1.6.2.3
retrieving revision 1.6.2.4
diff -u -b -r1.6.2.3 -r1.6.2.4
--- admin/auth_tag_structure.pl	18 Dec 2006 16:35:17 -0000	1.6.2.3
+++ admin/auth_tag_structure.pl	23 Jan 2007 16:15:07 -0000	1.6.2.4
@@ -161,7 +161,7 @@
 						);
 	}
 	$sth->finish;
-	print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=auth_tag_structure.pl?tagfield=$tagfield&authtypecode=$authtypecode\"></html>";
+	print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=auth_tag_structure.pl?searchfield=$tagfield&authtypecode=$authtypecode\">";
 	exit;
 													# END $OP eq ADD_VALIDATE
 ################## DELETE_CONFIRM ##################################

Index: admin/authtypes.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/authtypes.pl,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -b -r1.5.2.2 -r1.5.2.3
--- admin/authtypes.pl	18 Dec 2006 16:35:17 -0000	1.5.2.2
+++ admin/authtypes.pl	23 Jan 2007 16:15:07 -0000	1.5.2.3
@@ -68,7 +68,7 @@
 						$op              => 1); # we show only the TMPL_VAR names $op
 } else {
 $template->param(script_name => $script_name,
-						else              => 1); # we show only the TMPL_VAR names $op
+						'else'              => 1); # we show only the TMPL_VAR names $op
 }
 ################## ADD_FORM ##################################
 # called by default. Used to create form to add or  modify a record

Index: koha-tmpl/intranet-tmpl/prog/en/admin/auth_subfields_structure.tmpl
===================================================================
RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/admin/auth_subfields_structure.tmpl,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -b -r1.2.2.1 -r1.2.2.2
--- koha-tmpl/intranet-tmpl/prog/en/admin/auth_subfields_structure.tmpl	1 Nov 2006 20:15:01 -0000	1.2.2.1
+++ koha-tmpl/intranet-tmpl/prog/en/admin/auth_subfields_structure.tmpl	23 Jan 2007 16:15:07 -0000	1.2.2.2
@@ -23,11 +23,10 @@
 	   <p><label for="tab<!-- TMPL_VAR NAME="row" -->">Managed in tab</label><!-- TMPL_VAR NAME="tab" --> (ignore means that the subfield is NOT managed by Koha)</p>
 	   <p><label for="hidden<!-- TMPL_VAR NAME="row" -->">Hidden</label> Opac:<!-- TMPL_VAR name="ohidden" -->  Intranet:<!-- TMPL_VAR name="ihidden" --> Editor:<!-- TMPL_VAR name="ehidden" --> (see online help)</p>
 	   <p><label for="isurl<!-- TMPL_VAR NAME="row" -->">Is a URL </label><!-- TMPL_VAR NAME="isurl" --> (if checked, it means that the subfield is an URL and can be clicked)</p>
-	   <p><label for="link<!-- TMPL_VAR NAME="row" -->">Is a Linking field </label><!-- TMPL_VAR NAME="link" --> (if checked, it means that the subfield is used for linking authorities)</p>
-        <p><label>Default Options: <p>(choose one)</p></label>
+        <p><label>Help input:</label>
         <ul>
             <li>Authorized Value <!-- TMPL_VAR NAME="authorised_value" --></li>
-            <li>Thesaurus <!-- TMPL_VAR NAME="authtypecode" --></li>
+            <li>Thesaurus <!-- TMPL_VAR NAME="frameworkcode" --></li>
             <li>Plugin <!-- TMPL_VAR NAME="value_builder" --></li>
         </ul>
         </p>	 
@@ -96,16 +95,22 @@
 		<!-- TMPL_ELSE -->
 			<strong>Tab:</strong><!-- TMPL_VAR NAME="tab" -->,
 			<!-- TMPL_IF NAME="kohafield" --> | <strong>Koha field:</strong> <!-- TMPL_VAR NAME="kohafield" -->, <!--/TMPL_IF -->
-			<!-- TMPL_IF NAME="repeatable" -->Repeatable, <!-- TMPL_ELSE -->Not repeatable,<!-- /TMPL_IF -->
-			<!-- TMPL_IF NAME="mandatory" -->Mandatory, <!-- TMPL_ELSE -->Not mandatory,<!-- /TMPL_IF -->
-			<!-- TMPL_IF NAME="seealso" --> | <strong>See Also:</strong> <!-- TMPL_VAR NAME="seealso" -->,<!-- /TMPL_IF -->
-			<!-- TMPL_IF NAME="hidden" -->hidden,<!-- /TMPL_IF -->
-			<!-- TMPL_IF NAME="isurl" -->is an url,<!-- /TMPL_IF -->
-			<!-- TMPL_IF NAME="authorised_value" --> | <strong>Auth value:</strong><!-- TMPL_VAR NAME="authorised_value" -->,<!-- /TMPL_IF -->
-			<!-- TMPL_IF NAME="authtypecode" --> | <strong>Authority:</strong><!-- TMPL_VAR NAME="authtypecode" -->,<!-- /TMPL_IF -->
-			<!-- TMPL_IF NAME="value_builder" --> | <strong>Plugin:</strong><!-- TMPL_VAR NAME="value_builder" -->,<!-- /TMPL_IF -->
-			<!-- TMPL_IF NAME="link" --> | <strong>Link:</strong><!-- TMPL_VAR NAME="link" -->,<!-- /TMPL_IF -->
+			<!-- TMPL_IF NAME="repeatable" -->Repeatable, <!-- TMPL_ELSE -->Not repeatable,
+            <!-- /TMPL_IF -->
+			<!-- TMPL_IF NAME="mandatory" -->Mandatory, <!-- TMPL_ELSE -->Not mandatory,
+            <!-- /TMPL_IF -->
+			<!-- TMPL_IF NAME="seealso" --> | <strong>See Also:</strong> <!-- TMPL_VAR NAME="seealso" -->,
+            <!-- /TMPL_IF -->
+			<!-- TMPL_IF NAME="hidden" -->hidden,
+            <!-- /TMPL_IF -->
+			<!-- TMPL_IF NAME="isurl" -->is an url,
+            <!-- /TMPL_IF -->
+			<!-- TMPL_IF NAME="authorised_value" --> | <strong>Auth value:</strong><!-- TMPL_VAR NAME="authorised_value" -->,
+            <!-- /TMPL_IF -->
+			<!-- TMPL_IF NAME="frameworkcode" --> | <strong>Authority:</strong><!-- TMPL_VAR NAME="frameworkcode" -->,
 		<!-- /TMPL_IF -->
+			<!-- TMPL_IF NAME="value_builder" --> | <strong>Plugin:</strong><!-- TMPL_VAR NAME="value_builder" -->,<!-- /TMPL_IF -->
+          <!--/TMPL_IF-->
 	</td>
 	<td><a href="<!-- TMPL_VAR NAME="delete" -->">Delete</a></td>
 </tr>
@@ -115,14 +120,16 @@
     <a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&tagfield=<!-- TMPL_VAR name="edit_tagfield" -->&authtypecode=<!-- TMPL_VAR name="edit_authtypecode" -->">Edit subfields</a>
     <a href="auth_tag_structure.pl?searchfield=<!-- TMPl_VAR name="tagfield" -->&authtypecode=<!-- TMPL_VAR name="authtypecode"-->">Return to Auth Structure</a>
 </div>
-<!-- TMPL_IF NAME="previous" -->
+    <!-- TMPL_IF NAME="previous" -->
 	<input type="image" src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/1leftarrow.png" title="previous" alt="previous" border="0" >
-	</a><!-- /TMPL_IF -->
-<!-- TMPL_IF NAME="next" -->
+      </a>
+    <!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="next" -->
 	<!-- TMPL_VAR NAME="next" -->
 		<input type="image" src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/1rightarrow.png" title="next" alt="next" border="0" />
 	</a>
-<!-- /TMPL_IF -->
+    <!-- /TMPL_IF -->
+
 <!-- /TMPL_IF -->
 
 

Index: koha-tmpl/intranet-tmpl/prog/en/admin/auth_tag_structure.tmpl
===================================================================
RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/admin/auth_tag_structure.tmpl,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -b -r1.2.2.1 -r1.2.2.2
--- koha-tmpl/intranet-tmpl/prog/en/admin/auth_tag_structure.tmpl	1 Nov 2006 20:15:01 -0000	1.2.2.1
+++ koha-tmpl/intranet-tmpl/prog/en/admin/auth_tag_structure.tmpl	23 Jan 2007 16:15:07 -0000	1.2.2.2
@@ -75,7 +75,7 @@
             <!-- TMPL_IF NAME="repeatable" -->
                 <input type="checkbox" name="repeatable" id="repeatable" value="1" checked/>
             <!-- TMPL_ELSE -->
-                <input type="checkbox" name="repeatable" id="repeatable" value="0"/>
+                <input type="checkbox" name="repeatable" id="repeatable" value="1"/>
             <!-- /TMPL_IF -->
             &nbsp;
         </p>
@@ -83,7 +83,7 @@
             <!-- TMPL_IF NAME="mandatory" -->
                 <input type="checkbox" name="mandatory" id="mandatory" value="1" checked/>
             <!-- TMPL_ELSE -->
-                <input type="checkbox" name="mandatory" id="mandatory" value="0"/>
+                <input type="checkbox" name="mandatory" id="mandatory" value="1"/>
             <!-- /TMPL_IF -->
             &nbsp;
             </p>
@@ -115,6 +115,8 @@
 
     Data deleted
     <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
+    <input type="hidden" name="authtypecode" value="<!-- TMPL_VAR name="authtypecode" -->">
+    <input type="hidden" name="searchfield" value="<!-- TMPL_VAR NAME="searchfield" -->" />
     <input type="submit" value="OK" class="submit" />
     </form>
 <!-- /TMPL_IF -->

Index: koha-tmpl/intranet-tmpl/prog/en/admin/authtypes.tmpl
===================================================================
RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/admin/authtypes.tmpl,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -b -r1.1 -r1.1.2.1
--- koha-tmpl/intranet-tmpl/prog/en/admin/authtypes.tmpl	24 Feb 2006 11:18:17 -0000	1.1
+++ koha-tmpl/intranet-tmpl/prog/en/admin/authtypes.tmpl	23 Jan 2007 16:15:07 -0000	1.1.2.1
@@ -77,6 +77,7 @@
 		<tr><td><label for="authtypetext">Description</label></td><td><input type="text" id="authtypetext" name="authtypetext" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="authtypetext" escape=HTML -->" /></td></tr>
 		<tr><td><label for="summary">Summary</label></td><td><textarea id="summary" name="summary" cols="40" rows="10"><!-- TMPL_VAR NAME="summary" --></textarea></td></tr>
 		<tr><td><label for="auth_tag_to_report">Report tag</label></td><td><input type="text" id="auth_tag_to_report" name="auth_tag_to_report" size="5" maxlength="3" value="<!-- TMPL_VAR NAME="auth_tag_to_report">" />Enter here the number of the tag that will be reported in the biblio (subfield by subfield). For example, in UNIMARC, enter 200 to report every 200 subfield in the 70x biblio</td></tr></table>
+	<input type="hidden" name="op" value="add_validate" />
 	<p><input type="submit" value="OK" onclick="Check(this.form); return false;" />
 			</p>
 	</form>





More information about the Koha-cvs mailing list