&GetBranchInfo
&ModBranchCategoryInfo
&DelBranch
+ &DelBranchCategory
);
=head2 GetBranches
=cut
-sub DeleteBranchCategory {
+sub DelBranchCategory {
my ($categorycode) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("delete from branchcategories where categorycode = ?");
my $results;
if ($operator) {
#do a specific search
+ # automatic replace for short operator
+ $operator='title' if $operator eq 'ti';
+ $operator='author' if $operator eq 'au';
my $dbh = C4::Context->dbh;
$operator='LIKE' if $operator eq '=' and $right=~ /%/;
my $sth = $dbh->prepare("SELECT biblionumbers FROM nozebra WHERE indexname=? AND value $operator ?");
elsif ( $op eq 'categorydelete_confirmed' ) {
# actually delete branch and return to the main screen....
- DeleteBranchCategory($categorycode);
+ DelBranchCategory($categorycode);
$template->param( else => 1 );
default("MESSAGE6",$template);
# checks all item fields are in the same tag and in tab 10
-$sth = $dbh->prepare("select tagfield,tab,kohafield from marc_subfield_structure where kohafield like \"items.%\"");
+$sth = $dbh->prepare("select tagfield,tab,kohafield from marc_subfield_structure where kohafield like \"items.%\" and tab >=0");
$sth->execute;
my $field;
($res,$res2,$field) = $sth->fetchrow;
#warn "TAGF : $tagfield";
while (($res,$res2,$field) = $sth->fetchrow) {
# (ignore itemnumber, that must be in -1 tab)
- if (($res ne $tagfield or $res2 ne $tab ) && $res2 ne -1) {
+ if (($res ne $tagfield) or ($res2 ne $tab)) {
$subtotal++;
}
}
$subtotal++;
}
}
-if ($subtotal eq 0) {
+if ($subtotal == 0) {
$template->param(itemfields => 0);
} else {
$template->param(itemfields => 1);
}
# add more_subfields empty lines for add if needed
- for ( my $j = $i ; $j <= $more_subfields + $i ; $j++ ) {
+ for ( my $j = 1 ; $j <= 1 ; $j++ ) {
my %row_data; # get a fresh hash for the row data
+ $row_data{'subfieldcode'} = '';
+
$row_data{tab} = CGI::scrolling_list(
-name => 'tab',
-id => "tab$j",
$row_data{toggle} = $toggle;
$row_data{row} = $j;
push( @loop_data, \%row_data );
+ use Data::Dumper;
+ warn "push : ".Dumper(%row_data);
}
$template->param( 'use-heading-flags-p' => 1 );
$template->param( 'heading-edit-subfields-p' => 1 );
"select * from marc_subfield_structure where tagfield=? and tagsubfield=? and frameworkcode=?"
);
- #FIXME : called with 2 bind variables when 3 are needed
- $sth->execute( $tagfield, $tagsubfield );
+ $sth->execute( $tagfield, $tagsubfield, $frameworkcode );
my $data = $sth->fetchrow_hashref;
$sth->finish;
$template->param(
$tabsysprefs{Stemming}="Catalogue";
$tabsysprefs{WeightFields}="Catalogue";
$tabsysprefs{expandedSearchOption}="Catalogue";
+ $tabsysprefs{NoZebra}="Catalogue";
+ $tabsysprefs{NoZebraIndexes}="Catalogue";
+ $tabsysprefs{ReceiveBackIssues}="Catalogue";
# Circulation
$tabsysprefs{maxoutstanding}="Circulation";
$tabsysprefs{borrowerRelationship}="Members";
$tabsysprefs{BorrowersTitles}="Members";
$tabsysprefs{patronimages}="Members";
+ $tabsysprefs{MinPasswordLength}="Members";
# OPAC
$tabsysprefs{AmazonAssocTag}="OPAC";
#---- 200$a for isbn
#---- 200$b for editor
#---- 200$c (repeated) for collections
- my $sth;
-#= $dbh->prepare("select auth_subfield_table.authid,subfieldvalue from auth_subfield_table
-# left join auth_header on auth_subfield_table.authid=auth_header.authid
-# where authtypecode='EDITORS' and tag='200' and subfieldcode='a'");
- my $sth2;
- # = $dbh->prepare("select subfieldvalue from auth_subfield_table where tag='200' and subfieldcode='b' and authid=?");
+ my $sth
+= $dbh->prepare("select auth_subfield_table.authid,subfieldvalue from auth_subfield_table
+ left join auth_header on auth_subfield_table.authid=auth_header.authid
+ where authtypecode='EDITORS' and tag='200' and subfieldcode='a'");
+ my $sth2
+ = $dbh->prepare("select subfieldvalue from auth_subfield_table where tag='200' and subfieldcode='b' and authid=?");
$sth->execute;
my @editors;
my $authoritysep = C4::Context->preference("authoritysep");
<td>Define issuing rules in a matrix for branches / borrowers / item types (number of issues, duration, cost...).</td>
</tr>
<tr>
+ <td><a href="/cgi-bin/koha/admin/finesrules.pl">Fines rules</a></td>
+ <td>Define fines in a matrix for branches / borrowers / item types (cost, grace period...).</td>
+</tr>
+<tr>
<th colspan="2">Catalogue</th>
</tr>
<tr>
</tr>
</table>
- <input type="button" value="Update" onClick="Check(this.form)" /> <input type="button" value="Cancel" onclick="location.href='<!-- TMPL_VAR NAME="script_name" -->'; return false;" />
+ <input type="button" value="OK" onClick="Check(this.form)" /> <input type="button" value="Cancel" onclick="location.href='<!-- TMPL_VAR NAME="script_name" -->'; return false;" />
</form>
<!-- /TMPL_IF -->
<input type="hidden" name="frameworkcode" value="<!-- TMPL_VAR NAME="frameworkcode" -->" />
<input type="submit" value="Save Changes" />
- <h3>Tag <!-- TMPL_VAR NAME="tagfield" --></h3>
- <b>Edit subfields :</b>
+ <h2>Tag <!-- TMPL_VAR NAME="tagfield" --></h2>
<div id="tabs">
+ <p>Edit subfield
<!-- TMPL_LOOP NAME="loop" -->
- <!-- TMPL_IF NAME="subfieldcode"-->
- <input type="hidden" name="tagsubfield" value="<!-- TMPL_VAR NAME="subfieldcode" -->" />
+ <!-- TMPL_IF name="subfieldcode" -->
+ <input type="hidden" name="tagsubfield" value="<!-- TMPL_VAR NAME="subfieldcode" -->" />
+ <!-- /TMPL_IF -->
<a
href="javascript:active('sub<!-- TMPL_VAR NAME='subfieldcode' -->');"
class="tab_inactive"
>
<!-- TMPL_VAR NAME="subfieldcode" -->
</a>
- <!-- /TMPL_IF -->
- <!-- /TMPL_LOOP -->
+ <!-- /TMPL_LOOP -->
+ </p>
</div>
<div id="content" style="display:block">
<!-- TMPL_LOOP NAME="loop" -->
- <!-- TMPL_IF NAME="subfieldcode"-->
<div id="content_sub<!-- TMPL_VAR NAME="subfieldcode" -->" class="content_hidden">
<h3>Basic constaints</h3>
- <p><label for="liblibrarian<!-- TMPL_VAR NAME="row" -->">Text for librarian</label><input id="liblibrarian<!-- TMPL_VAR NAME="row" -->" type="text" name="liblibrarian" value="<!-- TMPL_VAR NAME="liblibrarian" -->" size="40" maxlength="80" /></p>
- <p><label for="libopac<!-- TMPL_VAR NAME="row" -->">Text for OPAC</label><input type="text" id="libopac<!-- TMPL_VAR NAME="row" -->" name="libopac" value="<!-- TMPL_VAR NAME="libopac" -->" size="40" maxlength="80" /></p>
- <p><label for="repeatable<!-- TMPL_VAR NAME="row" -->">Repeatable</label><!-- TMPL_VAR NAME="repeatable" --> </p>
- <p><label for="mandatory<!-- TMPL_VAR NAME="row" -->">Mandatory</label><!-- TMPL_VAR NAME="mandatory" --> </p>
- <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>
-
- <a href="javascript:displayMoreConstraint('more<!-- TMPL_VAR NAME="subfieldcode" -->')">display more constraints</a>
-
+ <!-- TMPL_UNLESS name="subfieldcode" -->
+ <p>Subfield code: <input type="text" name="tagsubfield" value="<!-- TMPL_VAR NAME="subfieldcode" -->" /></p>
+ <!-- /TMPL_UNLESS -->
+ <p><label for="liblibrarian<!-- TMPL_VAR NAME="row" -->">Text for librarian</label><input id="liblibrarian<!-- TMPL_VAR NAME="row" -->" type="text" name="liblibrarian" value="<!-- TMPL_VAR NAME="liblibrarian" -->" size="40" maxlength="80" /></p>
+ <p><label for="libopac<!-- TMPL_VAR NAME="row" -->">Text for OPAC</label><input type="text" id="libopac<!-- TMPL_VAR NAME="row" -->" name="libopac" value="<!-- TMPL_VAR NAME="libopac" -->" size="40" maxlength="80" /></p>
+ <p><label for="repeatable<!-- TMPL_VAR NAME="row" -->">Repeatable</label><!-- TMPL_VAR NAME="repeatable" --> </p>
+ <p><label for="mandatory<!-- TMPL_VAR NAME="row" -->">Mandatory</label><!-- TMPL_VAR NAME="mandatory" --> </p>
+ <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>
+
+ <a href="javascript:displayMoreConstraint('more<!-- TMPL_VAR NAME="subfieldcode" -->')">display more constraints</a>
<span id="more<!-- TMPL_VAR NAME="subfieldcode" -->" class="content_hidden">
<h3>Advanced constraint</h3>
<p>
<p><label for="kohafield<!-- TMPL_VAR NAME="row" -->">Koha link</label><!-- TMPL_VAR NAME="kohafield" --></p>
</span>
</div>
- <!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</div>
</form>
while (my ($biblionumber,$time)=$sth->fetchrow ){
# my $record;
- my $record = GetMarcBiblio($biblionumber);
+ my $record = GetMarcBiblio($biblionumber);
#print $record->as_marc;
- MARCmodrecord($biblionumber,$record,$time);
+ MARCmodrecord($biblionumber,$record,$time);
#
}
}
substr($string,22,6,"frey50");
unless ($record->subfield(100,"a")){
- $record->insert_fields_ordered(MARC::Field->new(100,"","","a"=>$string));
+ $record->insert_fields_ordered(MARC::Field->new(100,"","","a"=>"$string"));
}
# warn "APRES : ".$record->as_formatted;
# delete all items related fields
foreach ($record->field('995')) {
$record->delete_field($_);
}
- if ($update){
+ if ($update){
&ModBiblioMarc($record,$biblionumber,'');
print "$biblionumber \n";
}
$|=1; # flushes output
# limit for database dumping
-my $limit = "LIMIT 100";
+my $limit;# = "LIMIT 100";
my $directory;
my $skip_export;
my $keep_export;
my %index = GetNoZebraIndexes();
+unless (%index) {
+ if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
+ $dbh->do("UPDATE systempreferences SET value=\"'title' => '200a,200c,200d,200e,225a,225d,225e,225f,225h,225i,225v,500*,501*,503*,510*,512*,513*,514*,515*,516*,517*,518*,519*,520*,530*,531*,532*,540*,541*,545*,604t,610t,605a',
+ 'author' =>'200f,600a,601a,604a,700a,700b,700c,700d,700a,701b,701c,701d,702a,702b,702c,702d,710a,710b,710c,710d,711a,711b,711c,711d,712a,712b,712c,712d',
+ 'isbn' => '010a',
+ 'issn' => '011a',
+ 'biblionumber' =>'0909',
+ 'itemtype' => '200b',
+ 'language' => '010a',
+ 'publisher' => '210x',
+ 'date' => '210d',
+ 'note' => '300a,301a,302a,303a,304a,305a,306az,307a,308a,309a,310a,311a,312a,313a,314a,315a,316a,317a,318a,319a,320a,321a,322a,323a,324a,325a,326a,327a,328a,330a,332a,333a,336a,337a,345a',
+ 'Koha-Auth-Number' => '6009,6019,6029,6039,6049,6059,6069,6109',
+ 'subject' => '600*,601*,606*,610*',
+ 'dewey' => '676a',
+ 'host-item' => '995a,995c',\" where variable='NoZebraIndexes'");
+ %index = GetNoZebraIndexes();
+ } else {
+ # build a MARC21 default index file
+ }
+}
$|=1;
while (my ($biblionumber) = $sth->fetchrow) {
$i++;
my $sth = $dbh->prepare("INSERT INTO nozebra (indexname,value,biblionumbers) VALUES (?,?,?)");
foreach my $key (keys %result) {
foreach my $index (keys %{$result{$key}}) {
- $sth->execute($key,$index,$result{$key}->{$index});
- if (length($result{$key}->{$index}) > 40000) {
- print length($result{$key}->{$index})."\n for $key / $index\n";
+ if (length($result{$key}->{$index}) > 1000000) {
+ print "very long index (".length($result{$key}->{$index}).")for $key / $index. update mySQL config file if you have an error just after this warning (max_paquet_size parameter)\n";
}
+ $sth->execute($key,$index,$result{$key}->{$index});
}
}
{
indexname => 'branchcode',
content => 'branchcode',
-
+ type => 'PRI',
+ }
+ ],
+ branchrelations => [
+ {
+ indexname => 'PRIMARY',
+ content => 'categorycode',
+ type => 'PRI',
+ }
+ ],
+ branchrelations => [
+ { indexname => 'PRIMARY',
+ content => 'branchcode,categorycode',
+ type => 'PRI',
+ },
+ { indexname => 'branchcode',
+ content => 'branchcode',
+ },
+ { indexname => 'categorycode',
+ content => 'categorycode',
}
],
currency => [
# onDelete => 'CASCADE|SET NULL|NO ACTION| RESTRICT',
# }
# ],
+ branchrelations => [
+ { key => 'branchcode',
+ foreigntable => 'branches',
+ foreignkey => 'branchcode',
+ onUpdate => 'CASCADE',
+ onDelete => 'CASCADE',
+ },
+ { key => 'categorycode',
+ foreigntable => 'branchcategories',
+ foreignkey => 'categorycode',
+ onUpdate => 'CASCADE',
+ onDelete => 'CASCADE',
+ },
+ ],
shelfcontents => [
{ key => 'shelfnumber',
foreigntable => 'bookshelf',
exit;
# $Log$
+# Revision 1.164 2007/05/04 16:24:09 tipaul
+# various bugfixes on parameters modules + adding default NoZebraIndexes systempreference if it's empty
+#
# Revision 1.163 2007/05/02 16:44:31 tipaul
# NoZebra SQL index management :
# * adding 3 subs in Biblio.pm