Bugzilla – Attachment 4632 Details for
Bug 6138
Show local help and isbd punctuation automatically when we are cataloguing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to 3.4 version
0001-0000135-Puntuaci-n-y-ayuda-en-el-proceso-de-Cataloga.patch (text/plain), 17.48 KB, created by
Juan Romay Sieira
on 2011-07-14 18:22:02 UTC
(
hide
)
Description:
Patch to 3.4 version
Filename:
MIME Type:
Creator:
Juan Romay Sieira
Created:
2011-07-14 18:22:02 UTC
Size:
17.48 KB
patch
obsolete
>From ca15f08c77f10515d8708946879a385da7a9b721 Mon Sep 17 00:00:00 2001 >From: Juan Romay Sieira <juan.sieira@xercode.es> >Date: Thu, 30 Jun 2011 10:59:30 +0200 >Subject: [PATCH] =?UTF-8?q?0000135:=20Puntuaci=C3=B3n=20y=20ayuda=20en=20el=20proceso=20de=20Catalogaci=C3=B3n?= >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit >Content-Type: text/plain; charset="utf-8" > >--- > C4/Biblio.pm | 8 ++- > admin/marc_subfields_structure.pl | 16 +++++- > cataloguing/addbiblio.pl | 11 ++++ > installer/data/mysql/kohastructure.sql | 2 + > installer/data/mysql/updatedatabase.pl | 9 +++ > koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css | 5 ++ > koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 55 ++++++++++++++++++++ > .../en/modules/admin/marc_subfields_structure.tt | 25 +++++---- > .../prog/en/modules/cataloguing/addbiblio.tt | 22 +++++--- > kohaversion.pl | 2 +- > 10 files changed, 132 insertions(+), 23 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index d797f40..edbcce7 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -953,7 +953,7 @@ sub GetMarcStructure { > } > > $sth = $dbh->prepare( >- "SELECT tagfield,tagsubfield,liblibrarian,libopac,tab,mandatory,repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link,defaultvalue >+ "SELECT tagfield,tagsubfield,liblibrarian,libopac,tab,mandatory,repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link,defaultvalue,punctuation,help > FROM marc_subfield_structure > WHERE frameworkcode=? > ORDER BY tagfield,tagsubfield >@@ -972,10 +972,12 @@ sub GetMarcStructure { > my $isurl; > my $link; > my $defaultvalue; >+ my $punctuation; >+ my $help; > > while ( > ( $tag, $subfield, $liblibrarian, $libopac, $tab, $mandatory, $repeatable, $authorised_value, >- $authtypecode, $value_builder, $kohafield, $seealso, $hidden, $isurl, $link, $defaultvalue >+ $authtypecode, $value_builder, $kohafield, $seealso, $hidden, $isurl, $link, $defaultvalue, $punctuation, $help > ) > = $sth->fetchrow > ) { >@@ -992,6 +994,8 @@ sub GetMarcStructure { > $res->{$tag}->{$subfield}->{isurl} = $isurl; > $res->{$tag}->{$subfield}->{'link'} = $link; > $res->{$tag}->{$subfield}->{defaultvalue} = $defaultvalue; >+ $res->{$tag}->{$subfield}->{punctuation} = $punctuation; >+ $res->{$tag}->{$subfield}->{help} = $help; > } > > $marc_structure_cache->{$forlibrarian}->{$frameworkcode} = $res; >diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl >index 0049376..65035d9 100755 >--- a/admin/marc_subfields_structure.pl >+++ b/admin/marc_subfields_structure.pl >@@ -179,6 +179,8 @@ if ( $op eq 'add_form' ) { > while ( $data = $sth->fetchrow_hashref ) { > my %row_data; # get a fresh hash for the row data > $row_data{defaultvalue} = $data->{defaultvalue}; >+ $row_data{punctuation} = $data->{'punctuation'}; >+ $row_data{help} = CGI::escapeHTML( $data->{'help'} ); > $row_data{tab} = CGI::scrolling_list( > -name => 'tab', > -id => "tab$i", >@@ -386,11 +388,11 @@ elsif ( $op eq 'add_validate' ) { > # values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" > # ); > my $sth_insert = $dbh->prepare(qq{ >- insert into marc_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,authtypecode,value_builder,hidden,isurl,frameworkcode, link,defaultvalue) >- values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) >+ insert into marc_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,authtypecode,value_builder,hidden,isurl,frameworkcode, link,defaultvalue,punctuation,help) >+ values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) > }); > my $sth_update = $dbh->prepare(qq{ >- update marc_subfield_structure set tagfield=?, tagsubfield=?, liblibrarian=?, libopac=?, repeatable=?, mandatory=?, kohafield=?, tab=?, seealso=?, authorised_value=?, authtypecode=?, value_builder=?, hidden=?, isurl=?, frameworkcode=?, link=?, defaultvalue=? >+ update marc_subfield_structure set tagfield=?, tagsubfield=?, liblibrarian=?, libopac=?, repeatable=?, mandatory=?, kohafield=?, tab=?, seealso=?, authorised_value=?, authtypecode=?, value_builder=?, hidden=?, isurl=?, frameworkcode=?, link=?, defaultvalue=?, punctuation=?, help=? > where tagfield=? and tagsubfield=? and frameworkcode=? > }); > my @tagsubfield = $input->param('tagsubfield'); >@@ -405,6 +407,8 @@ elsif ( $op eq 'add_validate' ) { > my @value_builder = $input->param('value_builder'); > my @link = $input->param('link'); > my @defaultvalue = $input->param('defaultvalue'); >+ my @punctuation = $input->param('punctuation'); >+ my @help = $input->param('help'); > > for ( my $i = 0 ; $i <= $#tagsubfield ; $i++ ) { > my $tagfield = $input->param('tagfield'); >@@ -425,6 +429,8 @@ elsif ( $op eq 'add_validate' ) { > my $isurl = $input->param("isurl$i") ? 1 : 0; > my $link = $link[$i]; > my $defaultvalue = $defaultvalue[$i]; >+ my $punctuation = $punctuation[$i]; >+ my $help = $help[$i]; > > if ($liblibrarian) { > unless ( C4::Context->config('demo') eq 1 ) { >@@ -447,6 +453,8 @@ elsif ( $op eq 'add_validate' ) { > $frameworkcode, > $link, > $defaultvalue, >+ $punctuation, >+ $help, > ( > $tagfield, > $tagsubfield, >@@ -472,6 +480,8 @@ elsif ( $op eq 'add_validate' ) { > $frameworkcode, > $link, > $defaultvalue, >+ $punctuation, >+ $help, > ); > } > } >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index fdf14ca..020527d 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -332,6 +332,8 @@ sub create_input { > mandatory => $tagslib->{$tag}->{$subfield}->{mandatory}, > repeatable => $tagslib->{$tag}->{$subfield}->{repeatable}, > kohafield => $tagslib->{$tag}->{$subfield}->{kohafield}, >+ punctuation => $tagslib->{$tag}->{$subfield}->{punctuation}, >+ help => $tagslib->{$tag}->{$subfield}->{help}, > index => $index_tag, > id => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield, > value => $value, >@@ -505,11 +507,20 @@ sub create_input { > name=\"".$subfield_data{id}."\" > value=\"$value\" > tabindex=\"1\" >+ punctuation=\"".$subfield_data{punctuation}."\" > size=\"67\" > maxlength=\"$max_length\" > class=\"input_marceditor\" >+ onfocus=\"javascript:GetPunctuation(this);\" >+ onblur=\"javascript:CheckPunctuation(this);\" > \/> > "; >+ if ($subfield_data{help}){ >+ $subfield_data{marc_value} .= " >+ <a class=\"showhelp\" href=\"#help_" . $subfield_data{id} . "\">Show help</a> >+ <div class=\"divsubfieldhelp\" id=\"help_" . $subfield_data{id} . "\" style=\"display:none; clear: both\"> <i>" . $subfield_data{help} . "</i></div> >+ "; >+ } > } > } > $subfield_data{'index_subfield'} = $index_subfield; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index e3c6f42..1d5f1e8 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1187,6 +1187,8 @@ CREATE TABLE `marc_subfield_structure` ( > `seealso` varchar(1100) default NULL, > `link` varchar(80) default NULL, > `defaultvalue` text default NULL, >+ `punctuation` varchar(5) default NULL, >+ `help` varchar(255) default NULL, > PRIMARY KEY (`frameworkcode`,`tagfield`,`tagsubfield`), > KEY `kohafield_2` (`kohafield`), > KEY `tab` (`frameworkcode`,`tab`), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 3c7d043..c5c010a 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4354,6 +4354,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >+$DBversion = '3.05.00.0021'; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do(" >+ ALTER TABLE `marc_subfield_structure` ADD `punctuation` VARCHAR( 5 ) NULL , ADD `help` VARCHAR( 255 ) NULL; >+ "); >+ print "Upgrade to $DBversion done (Punctuation and cataloguing help)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 DropAllForeignKeys($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css b/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css >index 26a8066..54d7ace 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css >@@ -83,6 +83,11 @@ a.tagnum { > text-decoration : none; > } > >+.divsubfieldhelp { >+ background-color: #F0FFEF; >+ border: #EFEFEF 1px solid; >+} >+ > .subfield { > color : #00698a; > float: left; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >index 463c28e..b19344d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >@@ -89,3 +89,58 @@ function checkEnter(e){ //e is event object passed from function invocation > return true; > } > } >+ >+/* >+ * Place punctuation when cataloguing >+ */ >+ >+function trim(s) { >+ while (s.length>0 && (s[0]==' '||s[0]=='\n')) s=s.substring(1, s.length); >+ while (s.length>0 && (s[s.length-1]==' '||s[s.length-1]=='\n')) s=s.substring(0, s.length-1); >+ while (s.search (" ") != -1){ >+ s = s.replace (" ",""); >+ } >+ return s; >+} >+ >+/* >+ Place the cursor in a determinate place into a textbox >+*/ >+ >+function placePositionTextbox(elem, myPos) { >+ >+ if(elem != null) { >+ if(elem.createTextRange) { >+ var range = elem.createTextRange(); >+ range.move('character', myPos); >+ range.select(); >+ } >+ else { >+ if(elem.selectionStart) { >+ elem.focus(); >+ elem.setSelectionRange(myPos, myPos); >+ } >+ else >+ elem.focus(); >+ } >+ } >+} >+ >+function GetPunctuation(field){ >+ var val = field.value; >+ if (trim(val) == ""){ >+ field.value = field.getAttribute('punctuation'); >+ placePositionTextbox(field,field.value.length); >+ } >+} >+ >+function CheckPunctuation(field){ >+ var val = field.value; >+ if (val == field.getAttribute('punctuation')){ >+ field.value = ""; >+ } >+} >+ >+/* >+ * END - Place punctuation when cataloguing >+ */ >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt >index 154aea5..46e7359 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt >@@ -106,22 +106,27 @@ > <div id="more[% loo.urisubfieldcode %]" style="display:none; clear: both"> > <fieldset class="rows"> > <legend>Advanced constraints:</legend> >- <ol><li><label for="defaultvalue[% loo.row %]">Default value:</label> >- <input type="text" name="defaultvalue" id="defaultvalue[% loo.row %]" value="[% loo.defaultvalue %]" /></li> >- <li><label for="hidden[% loo.row %]">hidden</label><input type="text" id="hidden[% loo.row %]" name="hidden" value="[% loo.hidden %]" size="2" /> (see online help)</li> >- <li><label for="isurl[% loo.row %]">Is a url:</label>[% loo.isurl %] (if checked, it means that the subfield is a url and can be clicked)</li> >- <li><label for="link[% loo.row %]">Link:</label><input type="text" id="link[% loo.row %]" name="link" value="[% loo.link %]" size="10" maxlength="80" /> (e.g., Title or Local-Number) <span class="error"><em>NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</em></span></li> >- <li><label for="kohafield[% loo.row %]">Koha link:</label>[% loo.kohafield %]</li> >- </ol> >- </fieldset> >- <fieldset class="rows"> >+ <ol> >+ <li><label for="defaultvalue[% loo.row %]">Default value:</label> >+ <input type="text" name="defaultvalue" id="defaultvalue[% loo.row %]" value="[% loo.defaultvalue %]" /></li> >+ <li><label for="punctuation[% loo.row %]">Punctuation:</label> >+ <input type="text" name="punctuation" id="punctuation[% loo.row %]" value="[% loo.punctuation %]" /></li> >+ <li><label for="help[% loo.row %]">Help:</label><br/> >+ <textarea type="text" name="help" id="help[% loo.row %]" cols="40">[% loo.help %]</textarea></li> >+ <li><label for="hidden[% loo.row %]">hidden</label><input type="text" id="hidden[% loo.row %]" name="hidden" value="[% loo.hidden %]" size="2" /> (see online help)</li> >+ <li><label for="isurl[% loo.row %]">Is a url:</label>[% loo.isurl %] (if checked, it means that the subfield is a url and can be clicked)</li> >+ <li><label for="link[% loo.row %]">Link:</label><input type="text" id="link[% loo.row %]" name="link" value="[% loo.link %]" size="10" maxlength="80" /> (e.g., Title or Local-Number) <span class="error"><em>NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</em></span></li> >+ <li><label for="kohafield[% loo.row %]">Koha link:</label>[% loo.kohafield %]</li> >+ </ol> >+ </fieldset> >+ <fieldset class="rows"> > <legend>Other Options: (choose one)</legend> > <ol> > <li><label for="authorised_value[% loo.row %]">Authorized value:</label>[% loo.authorised_value %]</li> > <li><label for="authtypecode[% loo.row %]">Thesaurus:</label>[% loo.authtypes %]</li> > <li><label for="value_builder[% loo.row %]">Plugin:</label>[% loo.value_builder %]</li> > </ol> >- </fieldset> >+ </fieldset> > </div><br class="clear" /><!-- /more --> > </div><!-- /content_sub --> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >index 0a73ace..df07c21 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -9,25 +9,33 @@ > $(document).ready(function() { > $('#addbibliotabs > ul').tabs().bind('show.ui-tabs', function(e, ui) { > $("#"+ui.panel.id+" input:eq(0)").focus(); >- }); >- $('.tag').each(function() { >+ }); >+ $('.tag').each(function() { > var field_id = this.getAttribute('id').substring(0, 7); > if (field_id in fields_in_use) { > fields_in_use[field_id]++; > } else { > fields_in_use[field_id] = 1; > } >- }); >- $('.subfield_line').each(function() { >+ }); >+ $('.subfield_line').each(function() { > var field_id = this.getAttribute('id').substring(0, 12); > if (field_id in fields_in_use) { > fields_in_use[field_id]++; > } else { > fields_in_use[field_id] = 1; > } >- }); >+ }); >+ $("a.showhelp").click(function(){ >+ $("#"+$(this).attr("href").replace("#","")).toggle(); >+ if($(this).html() == "Show help"){ >+ $(this).html("Hide help"); >+ } else { >+ $(this).html("Show help"); >+ } >+ }); > /* check cookie to hide/show marcdocs*/ >- if($.cookie("marcdocs_[% borrowernumber %]") == 'false'){ >+ if($.cookie("marcdocs_[% borrowernumber %]") == 'false'){ > hideMARCdocLinks(); > $("#marcDocsSelect").attr('checked',false); > } else { >@@ -36,7 +44,7 @@ > { path: "/", expires: 365 }); > } > >- }); >+ }); > > $('#header_search > ul').tabs().bind('show.ui-tabs', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); }); > >diff --git a/kohaversion.pl b/kohaversion.pl >index 470ca3d..b1a51f6 100644 >--- a/kohaversion.pl >+++ b/kohaversion.pl >@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts : > use strict; > > sub kohaversion { >- our $VERSION = '3.05.00.002'; >+ our $VERSION = '3.05.00.0021'; > # version needs to be set this way > # so that it can be picked up by Makefile.PL > # during install >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6138
:
3828
|
4632
|
7536
|
10404
|
14354