[Koha-patches] [PATCH] Delete all calls to thesaurus_popup.pl, and no more used plugins.

henridamien.laurent at biblibre.com henridamien.laurent at biblibre.com
Fri Mar 6 11:38:06 CET 2009


From: Nahuel Angelinetti <nahuel.angelinetti at biblibre.com>

Signed-off-by: Henri-Damien LAURENT <henridamien.laurent at biblibre.com>
---
 C4/Biblio.pm                                       |   15 --
 cataloguing/value_builder/unimarc_field_60X.pl     |  132 -----------------
 .../value_builder/unimarc_field_700_701_702.pl     |  156 --------------------
 .../en/modules/cataloguing/thesaurus_popup.tmpl    |   43 ------
 .../value_builder/unimarc_field_60X.tmpl           |  115 --------------
 5 files changed, 0 insertions(+), 461 deletions(-)
 mode change 100644 => 100755 C4/Biblio.pm
 delete mode 100755 cataloguing/value_builder/unimarc_field_60X.pl
 delete mode 100755 cataloguing/value_builder/unimarc_field_700_701_702.pl
 delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/thesaurus_popup.tmpl
 delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_60X.tmpl

diff --git a/C4/Biblio.pm b/C4/Biblio.pm
old mode 100644
new mode 100755
index c15bdb9..e911713
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -2160,21 +2160,6 @@ sub PrepareItemrecordDisplay {
                         -multiple => 0,
                     );
                 }
-                elsif ( $tagslib->{$tag}->{$subfield}->{thesaurus_category} ) {
-                    $subfield_data{marc_value} =
-"<input type=\"text\" name=\"field_value\"  size=\"47\" maxlength=\"255\" /> <a href=\"javascript:Dopop('cataloguing/thesaurus_popup.pl?category=$tagslib->{$tag}->{$subfield}->{thesaurus_category}&index=',)\">...</a>";
-
-#"
-# COMMENTED OUT because No $i is provided with this API.
-# And thus, no value_builder can be activated.
-# BUT could be thought over.
-#         } elsif ($tagslib->{$tag}->{$subfield}->{'value_builder'}) {
-#             my $plugin="value_builder/".$tagslib->{$tag}->{$subfield}->{'value_builder'};
-#             require $plugin;
-#             my $extended_param = plugin_parameters($dbh,$itemrecord,$tagslib,$i,0);
-#             my ($function_name,$javascript) = plugin_javascript($dbh,$record,$tagslib,$i,0);
-#             $subfield_data{marc_value}="<input type=\"text\" value=\"$value\" name=\"field_value\"  size=47 maxlength=255 DISABLE READONLY OnFocus=\"javascript:Focus$function_name()\" OnBlur=\"javascript:Blur$function_name()\"> <a href=\"javascript:Clic$function_name()\">...</a> $javascript";
-                }
                 else {
                     $subfield_data{marc_value} =
 "<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"50\" maxlength=\"255\" />";
diff --git a/cataloguing/value_builder/unimarc_field_60X.pl b/cataloguing/value_builder/unimarc_field_60X.pl
deleted file mode 100755
index 68451b2..0000000
--- a/cataloguing/value_builder/unimarc_field_60X.pl
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/usr/bin/perl
-
-
-# Copyright 2000-2002 Katipo Communications
-#
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
-#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
-
-use strict;
-use C4::Auth;
-use CGI;
-use C4::Context;
-
-use C4::Search;
-use C4::Output;
-use C4::Authorities;
-
-sub plugin_javascript {
-    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
-    my $function_name = $field_number;
-    my $res           = "
-        <script type=\"text/javascript\">
-            function Focus$function_name(subfield_managed) {
-    	        return 1;
-            }
-
-            function Blur$function_name(subfield_managed) {
-            	return 1;
-            }
-
-            function Clic$function_name(index) {
-            	defaultvalue=document.getElementById(\"$field_number\").value;
-            	window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&index=$field_number&result=\"+defaultvalue,\"unimarc 600\",'width=700,height=300,toolbar=false,scrollbars=yes');
-
-            }
-        </script>
-    ";
-
-    return ( $function_name, $res );
-}
-
-sub plugin {
-    my ($input)       = @_;
-    my $dbh           = C4::Context->dbh;
-    my $index         = $input->param('index');
-    my $result        = $input->param('result');
-    my $search_string = $input->param('search_string');
-    my $op            = $input->param('op');
-    my $id            = $input->param('id');
-    my $insert        = $input->param('insert');
-    my %stdlib;
-    my $select_list;
-
-    if ( $op eq "add" ) {
-        newauthority( $dbh, 'NC', $insert, $insert, '', 1, '' );
-        $search_string = $insert;
-    }
-    if ( $op eq "select" ) {
-        my $sti =
-          $dbh->prepare("select stdlib from bibliothesaurus where id=?");
-        $sti->execute($id);
-        my ($freelib_text) = $sti->fetchrow_array;
-        $result = $freelib_text;
-    }
-    my $Rsearch_string = "$search_string%";
-    my $authoritysep   = C4::Context->preference('authoritysep');
-    my @splitted       = /$authoritysep/, $search_string;
-    my $level          = $#splitted + 1;
-    my $sti;
-    if ($search_string)
-    {    # if no search pattern, returns only the 50 1st top level values
-        $sti =
-          $dbh->prepare(
-"select distinct freelib,father,level from bibliothesaurus where category='NC' and freelib like ? order by father,freelib"
-          );
-    }
-    else {
-        $sti =
-          $dbh->prepare(
-"select distinct freelib,father,level from bibliothesaurus where category='NC' and level=0 and freelib like ? order by father,freelib limit 0,50"
-          );
-    }
-    $sti->execute($Rsearch_string);
-    my @results;
-    while ( my ( $freelib, $father, $level ) = $sti->fetchrow ) {
-        my %line;
-        if ($father) {
-            $line{value} = "$father $freelib";
-        }
-        else {
-            $line{value} = "$freelib";
-        }
-        $line{level}  = $level + 1;
-        $line{father} = $father;
-        push @results, \%line;
-    }
-    my @DeeperResults = SearchDeeper( 'NC', $search_string );
-    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
-        {
-            template_name => "cataloguing/value_builder/unimarc_field_60X.tmpl",
-            query         => $input,
-            type          => "intranet",
-            authnotrequired => 0,
-            flagsrequired   => { editcatalogue => 1 },
-            debug           => 1,
-        }
-    );
-
-# builds collection list : search isbn and editor, in parent, then load collections from bibliothesaurus table
-    $template->param(
-        index         => $index,
-        result        => $result,
-        search_string => $search_string ? $search_string : $result,
-        results       => \@results,
-        deeper        => \@DeeperResults,
-    );
-    output_html_with_http_headers $input, $cookie, $template->output;
-}
-
-1;
diff --git a/cataloguing/value_builder/unimarc_field_700_701_702.pl b/cataloguing/value_builder/unimarc_field_700_701_702.pl
deleted file mode 100755
index 01f23c9..0000000
--- a/cataloguing/value_builder/unimarc_field_700_701_702.pl
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/usr/bin/perl
-
-
-# Copyright 2000-2002 Katipo Communications
-#
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
-#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
-
-use strict;
-use C4::Auth;
-use CGI;
-use C4::Context;
-
-use C4::Search;
-use C4::Output;
-use C4::Authorities;
-
-sub plugin_javascript {
-my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
-my $function_name= $field_number;
-my $res="
-<script>
-function Focus$function_name(subfield_managed) {
-return 1;
-}
-
-function Blur$function_name(subfield_managed) {
-	return 1;
-}
-
-function Clic$function_name(index) {
-	defaultvalue=document.getElementById(\"$field_number\").value;
-	newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_700_701_702.pl&index=$field_number&result=\"+defaultvalue,\"unimarc 700\",'width=700,height=300,toolbar=false,scrollbars=yes');
-
-}
-</script>
-";
-
-return ($function_name,$res);
-}
-sub plugin {
-	my ($input) = @_;
-	my $dbh = C4::Context->dbh;
-#	my $input = new CGI;
-	my $index= $input->param('index');
-	my $result= $input->param('result');
-	my $search_string= $input->param('search_string');
-	my $op = $input->param('op');
-	my $id = $input->param('id');
-	my $insert = $input->param('insert');
-	my @freelib;
-	my %stdlib;
-	my $select_list;
-	my ($a,$b,$c,$f) ; # the 4 managed subfields.
-	if ($op eq "add") {
-		newauthority($dbh,'NP',$insert,$insert,'',1,'');
-		$search_string=$insert;
-	}
-	if ($op eq "select") {
-		my $sti = $dbh->prepare("select stdlib from bibliothesaurus where id=?");
-		$sti->execute($id);
-		my ($freelib_text) = $sti->fetchrow_array;
-		$result = $freelib_text;
-		# fill the 4 managed subfields
-		my @arr = split //,$result;
-		my $where = 1;
-		foreach my $x (@arr) {
-			next if ($x eq ')');
-			if ($x eq ',') {
-				$where=2;
-				next;
-			}
-			if ($x eq '(') {
-				if ($result =~ /.*;.*/) {
-					$where=3;
-				} else {
-					$where=4;
-				}
-				next;
-			}
-			if ($x eq ';') {
-				$where=4;
-				next;
-			}
-			if ($where eq 1) {
-				$a.=$x;
-			}
-			if ($where eq 2) {
-				$b.=$x;
-			}
-			if ($where eq 3) {
-				$c.=$x;
-			}
-			if ($where eq 4) {
-				$f.=$x;
-			}
-		}
-# remove trailing blanks
-		$a=~ s/^\s+//g;
-		$b=~ s/^\s+//g;
-		$c=~ s/^\s+//g;
-		$f=~ s/^\s+//g;
-		$a=~ s/\s+$//g;
-		$b=~ s/\s+$//g;
-		$c=~ s/\s+$//g;
-		$f=~ s/^s+$//g;
-	}
-	if ($search_string) {
-	#	my $sti=$dbh->prepare("select id,freelib from bibliothesaurus where freelib like '".$search_string."%' and category ='$category'");
-		my $sti=$dbh->prepare("select id,freelib from bibliothesaurus where match (category,freelib) AGAINST (?) and category ='NP'");
-		$sti->execute($search_string);
-		while (my $line=$sti->fetchrow_hashref) {
-			$stdlib{$line->{'id'}} = "$line->{'freelib'}";
-			push(@freelib,$line->{'id'});
-		}
-		$select_list= CGI::scrolling_list( -name=>'id',
-				-values=> \@freelib,
-				-default=> "",
-				-size=>1,
-				-multiple=>0,
-				-labels=> \%stdlib
-				);
-	}
-	my ($template, $loggedinuser, $cookie)
-	= get_template_and_user({template_name => "cataloguing/value_builder/unimarc_field_700_701_702.tmpl",
-					query => $input,
-					type => "intranet",
-					authnotrequired => 0,
-					flagsrequired => { editcatalogue => 1},
-					debug => 1,
-					});
-# builds collection list : search isbn and editor, in parent, then load collections from bibliothesaurus table
-	$template->param(index => $index,
-							result =>$result,
-							select_list => $select_list,
-							search_string => $search_string?$search_string:$result,
-							a => $a,
-							b => $b,
-							c => $c,
-							f => $f,);
-        output_html_with_http_headers $input, $cookie, $template->output;
-}
-
-1;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/thesaurus_popup.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/thesaurus_popup.tmpl
deleted file mode 100644
index 12454c9..0000000
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/thesaurus_popup.tmpl
+++ /dev/null
@@ -1,43 +0,0 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha &rsaquo; Thesaurus value builder for category <!-- TMPL_VAR name="category" --></title>
-<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-	<script type="text/javascript">
-		function report() {
-			opener.document.f.field_value[<!-- TMPL_VAR name="index" -->].value= document.f_pop.result.value;
-			self.close();
-			return false;
-		}
-		</script>
-	</head>
-	<body>
-	<form name="f_pop" action="cataloguing/thesaurus_popup.pl" method="post">
-	<textarea name="result" rows="10" cols="60"><!-- TMPL_VAR name="result" --></textarea><br />
-	<p><input type="text" name="search_string" value="<!-- TMPL_VAR name="search_string" -->" />
-	<input type="hidden" name="category" value="<!-- TMPL_VAR name="category" -->" />
-	<input type="hidden" name="nohierarchy" value="<!-- TMPL_VAR NAME="nohierarchy" -->" />
-	<input type="hidden" name="index" value="<!-- TMPL_VAR name="index" -->" />
-	<input type="hidden" name="op" value="search" />
-	<input type="submit" value="Search" />
-	<input type="button" value="OK" onclick="report();" />
-	</form>
-<!-- TMPL_IF name="search_string" -->
-	<form name="f2_pop" action="cataloguing/thesaurus_popup.pl" method="post">
-	<!-- TMPL_VAR name="select_list" -->
-	<input type="hidden" name="category" value="<!-- TMPL_VAR name="category" -->" />	<input type="hidden" name="nohierarchy" value="<!-- TMPL_VAR NAME="nohierarchy" -->" />
-	<input type="hidden" name="index" value="<!-- TMPL_VAR name="index" -->" />
-	<input type="hidden" name="op" value="select" />
-	<input type="hidden" name="result" value="<!-- TMPL_VAR name="result" -->" />
-	<input type="submit" name="OK" value="OK" />
-	</form>
-<!-- /TMPL_IF -->
-	<form name="f3_pop"  action="cataloguing/thesaurus_popup.pl" method="post">
-	<input type="hidden" name="index" value="<!-- TMPL_VAR name="index" -->" />
-	<input type="hidden" name="category" value="<!-- TMPL_VAR name="category" -->" />
-	<input type="hidden" name="nohierarchy" value="<!-- TMPL_VAR NAME="nohierarchy" -->" />
-	<input type="hidden" name="op" value="add" />
-	insert a new authority : <input type="text" name="insert" />
-	<input type="submit" name="NEW" value="NEW" />
-	</form>
-		
-		</body>
-		</html>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_60X.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_60X.tmpl
deleted file mode 100644
index bf51d7a..0000000
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_60X.tmpl
+++ /dev/null
@@ -1,115 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-	<title>Thesaurus_search</title>
-</head>
-<body>
-	<script type="text/javascript">
-            function report(value2report) {
-                //alert('report');
-                if (document.f_pop.result.value.length==0) {
-                        document.f_pop.result.value = value2report;
-                } else {
-                        document.f_pop.result.value = document.f_pop.result.value+'|'+value2report;
-                }
-                return true;
-            }
-
-            function finish() {
-                //alert(opener.document.getElementById("<!-- TMPL_VAR name="index" -->").value);
-                //alert(document.f_pop.result.value);
-                opener.document.getElementById("<!-- TMPL_VAR name="index" -->").value = document.f_pop.result.value;
-                window.close();
-                return false;
-            }
-	</script>
-	<form name="f_pop" action="cataloguing/plugin_launcher.pl" method="post">
-		<input type="hidden" name="plugin_name" value="unimarc_field_60X.pl">
-		<textarea name="result" rows=10 cols=50><!-- TMPL_VAR name="result" --></textarea>
-		<br/><input type="button" value="OK" onClick="javascript:finish()">
-		<p><h2>Recherche</h2>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=A">A</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=B">B</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=C">C</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=D">D</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=E">E</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=F">F</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=G">G</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=H">H</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=I">I</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=J">J</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=K">K</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=L">L</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=M">M</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=N">N</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=O">O</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=P">P</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=Q">Q</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=R">R</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=S">S</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=T">T</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=U">U</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=V">V</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=W">W</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=X">X</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=Y">Y</a>
-			<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&search_string=Z">Z</a>
-			<br/>
-			<input type="text" name="search_string" value="<!-- TMPL_VAR name="search_string" -->">
-			<input type="hidden" name="category" value="<!-- TMPL_VAR name="category" -->">
-			<input type="hidden" name="index" value="<!-- TMPL_VAR name="index" -->">
-			<input type="hidden" name="op" value="search">
-			<input type="submit" value="Chercher">
-		</p>
-	</form>
-	<table>
-	<tr>
-		<td valign="top">
-		<h2>Results</h2>
-			<table>
-				<!-- TMPL_LOOP name="results" -->
-					<tr>
-					<td>
-						<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&index=<!-- TMPL_VAR name="index" -->&level=<!-- TMPL_VAR name="level" -->&search_string=<!-- TMPL_VAR name=value ESCAPE=URL -->">
-							<!-- TMPL_VAR name="value" -->
-						</a>
-					</td>
-					<td>
-						<input type="button" value="Reporter" OnClick="javascript:report('<!-- TMPL_VAR name="value" -->')"><br/>
-					</td>
-					</tr>
-				<!-- /TMPL_LOOP -->
-			</table>
-		</td>
-		<td>
-		<!-- TMPL_IF name=deeper -->
-		<td valign="top">
-			<h2>Dependancies</h2>
-			<!-- /TMPL_IF -->
-			<table>
-			<!-- TMPL_LOOP name="deeper" -->
-				<tr><td>
-				<a href="cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&index=<!-- TMPL_VAR name="index" -->&level=<!-- TMPL_VAR name="level" -->&search_string=<!-- TMPL_VAR ESCAPE="URL" name="father" -->+<!-- TMPL_VAR ESCAPE="URL" name="stdlib" -->">
-					<!-- TMPL_VAR name="father" --> <!-- TMPL_VAR name="stdlib" -->
-				</a></td>
-				<td>
-					<input type="button" value="Reporter" OnClick="javascript:report('<!-- TMPL_VAR ESCAPE=HTML name="father" --> <!-- TMPL_VAR ESCAPE=HTML name="stdlib" -->')"><br/>
-				</td></tr>
-			<!-- /TMPL_LOOP -->
-			</table>
-		</td>
-	</tr>
-	</table>
-<h2>Adding</h2>
-<form name="f3_pop"  action="cataloguing/thesaurus_popup.pl" method="post">
-	<input type="hidden" name="index" value="<!-- TMPL_VAR name="index" -->">
-	<input type="hidden" name="op" value="add">
-	<input type="hidden" name="category" value="<!-- TMPL_VAR name="category" -->">
-	Create a new authority/thesaurus entry : <input type="text" name="insert" value="<!-- TMPL_VAR name="search_string" -->">
-	<input type="submit" name="NEW" value="Ajouter">
-	</form>
-</body>
-</html>
-- 
1.5.6.3




More information about the Koha-patches mailing list