Building a MARC Framework now is not possible to set default values for the field indicators. It would be very useful to set default values for indicators because in many cases they change very rarely
*** Bug 5095 has been marked as a duplicate of this bug. ***
Hi, With regard to Bug 4888 in the Koha Bugzilla, we would like to know the development stage on this bug because we had intended to develop a new functionality to validate indicators depending on the field you're on according to marc21 rules. Something like the issue brought up on the bug. We thought on creating a new section on the intranet to manage the values of the indicators depending on the field and even the frameworkcode if you want to. When you're cataloguing a bibliographic or an authority you'll have the possibility of open a pop-up to see and choose a correct value for the indicator you're focused. When you're going to save the record it will validate the indicators values and notify the wrong ones. Thanks Salva
Salva: to the best of my knowledge, no one has done any work on this bug. Also, the feature you describe sounds very useful.
(In reply to comment #3) > Salva: to the best of my knowledge, no one has done any work on this bug. Also, > the feature you describe sounds very useful. Ok, perfect, so we carry on with development on the bug and we'll notify further improvements or news thanks
Hi, We have developed a solution for this bug and we would like to know what you think before sending the patch. There's a little guide about the enhancement in this link: https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B2dwXW_1hO2qYzdmZTMzZjgtODg0My00OWEwLWJiYTMtNzUzYTliOTE1NDY4&hl=en Please be free to comment. Before sending the patch for commit with the new functionality we've uploaded on an external server for anyone who wants to see and comment about it. http://masmedios.info:8090/ user: developer password: development We'll let it active till this friday (2011-01-05) and send the final patch with the proposed changes for public testing. Please be nice when you're in the server. Salva
Created attachment 3113 [details] Patches compressed on zip format Hi, I want to inform that the patches for this bug are ready to be sent and tested. There are two patches, the first one to deal with the change of version (from 3.0300018 to 3.03.00.019, I will have to adjust it as time goes by and the versions change before this patch is applied) and the install/upgrade of the database; the second one to add the functionality through "pm", "pl", "tmpl" and "js" files. As I have to incorporate the values for the indicators as defined on http://www.loc.gov/marc/bibliographic/ecbdhome.html for MARC 21 to each framework given on the installation, there's a considerable amount of data in the first patch (1257 KB). I would like to know whether I have to send the patch to the koha-patches list on raw format or I could send it compressed as zip. I don't know how you have dealt with this situation before and the correct way to proceed. Anyway I attach them as a zip to this bug. There's a link to a pdf showing a demo of the functionality on a former comment in this bug. Tables added in mysql: marc_indicators (id of a indicator on a framework and field) , marc_indicators_values (values allowed for the indicators), marc_indicators_value (values of the indicators for a field), marc_indicators_desc (description of a value for a language) The files added/changed (* => changed , + => added): Patch: 0001-Bug-4888-Add-funtionality-for-indicators-Databas.patch * kohaversion.pl: as there are changes in the database an upgrade of version is needed. * installer/data/mysql/updatedatabase.pl: making the upgrade in the database. The normal procedure is execute the "do" method of the database conex object, but with the amount of data involved to store in the database I think it's more optimum to make a dump form the file marc21_indicators.sql to the database through command shell. * installer/data/mysql/kohastructure.sql: added structure for the indicators on a new installation. * installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql: added data for the indicators on a new installation. + installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_indicators.sql: a sql file with all the changes in the database, is called from installer/data/mysql/updatedatabase.pl. * installer/data/mysql/en/mandatory/sysprefs.sql: add two new system preferences to control the display of plugin indicators and to check the validity of its values. Patch 0002-Bug-4888-Add-funtionality-for-indicators-Intrane.patch + C4/Indicators.pm: It includes all the methods for accessing the data from the database and utility functions. * admin/marctagstructure.pl: to clone indicators from a framework to another one and to delete them. + admin/marc_indicators_structure.pl: to add/edit/delete indicators belonging to a marc field. * cataloguing/addbiblio.pl: to check validity of indicators and add them to a record. + cataloguing/indicators_ajax.pl: to ask for the indicators values of a framework and send them through a xml stream. + cataloguing/marc21_indicators.pl: plugin functionality, show and check indicators for a marc field. + koha-tmpl/intranet-tmpl/prog/en/js/indicators.js: all javascript functionality: ajax, checking... + koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_indicators_structure.tmpl: template for marc_indicators_structure.pl * koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tmpl: template for marctagstructure.pl * koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref: add system preferences * koha-tmpl/intranet-tmpl/prog/en/modules/admin/addbiblio.tmpl: template for addbiblio.pl + koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc21_indicators.tmpl: template for marc21_indicators.pl Regards Salva
This bug is mentioned in: Bug 4888 - Add funtionality for indicators - Database files http://lists.koha-community.org/pipermail/koha-patches/2011-February/013814.html Bug 4888 - Add funtionality for indicators - Intranet Files http://lists.koha-community.org/pipermail/koha-patches/2011-February/013815.html
the first patch does not apply: Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all y Applying: Bug 4888 - Add funtionality for indicators - Database files Using index info to reconstruct a base tree... error: patch failed: kohaversion.pl:16 error: kohaversion.pl: patch does not apply Did you hand edit your patch? It does not apply to blobs recorded in its index. Cannot fall back to three-way merge. Patch failed at 0001 Bug 4888 - Add funtionality for indicators - Database files When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort". nengard@debian:~/kohaclone$
Thanks Nicole, I'll review the patch and update it to meet the current master state. Regards Salva
Created attachment 3586 [details] [review] New proposed patch Corrected and optimized patch. Now only the Default framework is populated on Web installer or updatedatabase. The remainder ones can be populated through cloning with one that possess indicators when editing the framework., or cloning from another one when creating a new framework. The rest of the functionality hasn't changed much.
the new version needs to be signed off
I have a design problem with this patch. * marc_indicators marc_indicators_value => couldn't those table just be a field on marc_tag_structure ? * marc_indicators_values => this table sounds useless for me, it's a constant table, why not use a Perl array ? Something like 2 fields: default_indicator1 enum('','0','1','2','3','4','5','6','7','8','9','a','b','c','d'...'z'); default_indicator2 enum('','0','1','2','3','4','5','6','7','8','9','a','b','c','d'...'z'); in marc_tag_structure are they not doing the same thing ? Otherwise, I like the idea & like the fact you can have control over the valid values of indicators (even if, but i'm not a librarian), I still think most indicators are just here for cutting hairs in 4 -frenchism suspected-)
(In reply to comment #12) > I have a design problem with this patch. > * marc_indicators marc_indicators_value => couldn't those table just be a field > on marc_tag_structure ? > * marc_indicators_values => this table sounds useless for me, it's a constant > table, why not use a Perl array ? > > Something like 2 fields: > default_indicator1 > enum('','0','1','2','3','4','5','6','7','8','9','a','b','c','d'...'z'); > default_indicator2 > enum('','0','1','2','3','4','5','6','7','8','9','a','b','c','d'...'z'); > > in marc_tag_structure are they not doing the same thing ? > > Otherwise, I like the idea & like the fact you can have control over the valid > values of indicators (even if, but i'm not a librarian), I still think most > indicators are just here for cutting hairs in 4 -frenchism suspected-) If we create the values of the indicators as a column in the marc_tag_structure then we can only set one value for indicator-field-framework, and we want to be able to set a list of values for indicator-field-framework. So I created a table "marc_indicators" to relate the field and framework with an indicator, and a second table "marc_indicators_value" related with the former to set a list of values, not only one. A third table "marc_indicators_desc" exists to specify the description of the value (related to an indicator-field-framework) on the language you want to. The table "marc_indicators_values" contains the allowed values for the indicators so the database is coherent and consistent and can check constraints and perform "on delete cascade" by itself. Besides this approach is more flexible so in a future a development in the intranet can be made to add more values without changing the database (the enum column).
Created attachment 3849 [details] [review] Revised patch without marcflavour discrimination MARC21 discrimination removed from the source code, only remains at the web installer database framework population.
This sounds like an interesting and quite big new feature. Because of the switch to Template::Toolkit the patch does not apply any longer and needs to be reformatted first. Applying: Bug 4888 - pre-set of field indicators value /home/katrin/kohaclone/.git/rebase-apply/patch:278: trailing whitespace. my $query = qq|SELECT tagfield,liblibrarian,libopac,mandatory,repeatable /home/katrin/kohaclone/.git/rebase-apply/patch:279: trailing whitespace. FROM marc_tag_structure /home/katrin/kohaclone/.git/rebase-apply/patch:442: trailing whitespace. $query = qq|INSERT INTO marc_indicators_desc /home/katrin/kohaclone/.git/rebase-apply/patch:562: trailing whitespace. $query = qq|INSERT INTO marc_indicators_desc /home/katrin/kohaclone/.git/rebase-apply/patch:893: trailing whitespace. #!/usr/bin/perl error: patch failed: cataloguing/addbiblio.pl:1029 error: cataloguing/addbiblio.pl: patch does not apply error: patch failed: installer/data/mysql/de-DE/mandatory/sysprefs.sql:309 error: installer/data/mysql/de-DE/mandatory/sysprefs.sql: patch does not apply error: patch failed: installer/data/mysql/en/mandatory/sysprefs.sql:309 error: installer/data/mysql/en/mandatory/sysprefs.sql: patch does not apply error: patch failed: installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql:311 error: installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql: patch does not apply error: patch failed: installer/data/mysql/it-IT/necessari/sysprefs.sql:295 error: installer/data/mysql/it-IT/necessari/sysprefs.sql: patch does not apply error: patch failed: installer/data/mysql/pl-PL/mandatory/sysprefs.sql:308 error: installer/data/mysql/pl-PL/mandatory/sysprefs.sql: patch does not apply error: patch failed: installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql:363 error: installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql: patch does not apply error: patch failed: installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql:387 error: installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql: patch does not apply error: patch failed: installer/data/mysql/updatedatabase.pl:4209 error: installer/data/mysql/updatedatabase.pl: patch does not apply warning: koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css has type 100644, expected 100755 error: koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tmpl: does not exist in index error: koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tmpl: does not exist in index error: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl: does not exist in index Patch failed at 0001 Bug 4888 - pre-set of field indicators value When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort". Patch left in /tmp/Revised-patch-without-marcflavour-discrimination-JGmNwV.patch
Created attachment 4270 [details] [review] New propose patch for tt templates and authtype support as well I've recoded the patch to support tt templates instead of tmpl, and to allow the same functionality for authtypes that the frameworks got, so the biblios and authorities can have its sets of indicators.
Is this patch valid for Unimarc too?
Julian: the feature is interesting for UNIMARC too I don't know if the patch is working for UNIMARC as well, please, take some timetime to test : * setup a unimarc site * apply the patch * look at the redbook, or ask Stéphane for some suggestions * add default indicator for a field that has one * check it works in cataloguing and authorities There's nothing specific about indicators in UNIMARC (except they are not the same as MARC21), so it should work fine. However, once it's signed-off, please create another bug (ENH) = "define default indicators for UNIMARC like the default ones for MARC21", linked to 4888
Patch does not apply on master Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all y Applying: Bug 4888 - pre-set of field indicators value Using index info to reconstruct a base tree... <stdin>:319: trailing whitespace. <stdin>:348: trailing whitespace. my $query = ($type eq 'auth')?qq|SELECT tagfield,liblibrarian,libopac,mandatory,repeatable <stdin>:349: trailing whitespace. FROM auth_tag_structure <stdin>:350: trailing whitespace. WHERE authtypecode=? AND tagfield=?|:qq|SELECT tagfield,liblibrarian,libopac,mandatory,repeatable <stdin>:351: trailing whitespace. FROM marc_tag_structure warning: squelched 20 whitespace errors warning: 25 lines add whitespace errors. Falling back to patching base and 3-way merge... Auto-merging admin/auth_tag_structure.pl Auto-merging cataloguing/addbiblio.pl CONFLICT (content): Merge conflict in cataloguing/addbiblio.pl Auto-merging installer/data/mysql/de-DE/mandatory/sysprefs.sql CONFLICT (content): Merge conflict in installer/data/mysql/de-DE/mandatory/sysprefs.sql Auto-merging installer/data/mysql/en/mandatory/sysprefs.sql CONFLICT (content): Merge conflict in installer/data/mysql/en/mandatory/sysprefs.sql Auto-merging installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql CONFLICT (content): Merge conflict in installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql Auto-merging installer/data/mysql/it-IT/necessari/sysprefs.sql CONFLICT (content): Merge conflict in installer/data/mysql/it-IT/necessari/sysprefs.sql Auto-merging installer/data/mysql/kohastructure.sql Auto-merging installer/data/mysql/pl-PL/mandatory/sysprefs.sql CONFLICT (content): Merge conflict in installer/data/mysql/pl-PL/mandatory/sysprefs.sql Auto-merging installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql CONFLICT (content): Merge conflict in installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql Auto-merging installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql CONFLICT (content): Merge conflict in installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql Auto-merging installer/data/mysql/updatedatabase.pl CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl Auto-merging koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt Failed to merge in the changes. Patch failed at 0001 Bug 4888 - pre-set of field indicators value When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".
Patch needs some work, because now only one syspref.sql file needs to be updated.
Created attachment 14827 [details] [review] Bug 4888 - pre-set of field indicators value Preload on database of the set of field indicators value as defined by http://www.loc.gov/marc/bibliographic/ecbdhome.html. New sql files in marc21/mandatory to create and populate the indicators tables with the sets of values for the Default framework/authtype. Each framework/authtype will be able to have its own copy to allow individual modification of indicators value. When editing the framework/authtype exists the possibility of cloning the indicators set from an existing framework/authtype populated with indicators. Modification of the intranet administration-Marc Frameworks/Authority MARC Framework to clone on creation from another framework and to delete set of indicators from a framework. Management (add/modify/delete) for indicators of the fields in the Framework Structure. Modification of the intranet cataloguing addbiblio / authorities authorities to enable a plugin to see the defined indicators value for a specific framework, and to check validity of indicators value. Two new system preferences: CheckValueIndicators for checking the value of the indicators when cataloguing a biblio record; DisplayPluginValueIndicators: to enable the plugin at addbiblio to see indicators value and to check too. Rebased to master 01/2013 Bug 4888 - rebase follow-up Fixing errors I made during rebase
I tried to resurrect this patch. I have not tested much yet, but I think there are some problems and it does not seem to give the option to add a default value for indicators automatically (or i have not found it yet). I don't think I will have time to work much on this, I wanted to put the rebased version up here anyway and invite you to test it.
Created attachment 14828 [details] [review] Bug 4888 - pre-set of field indicators value Preload on database of the set of field indicators value as defined by http://www.loc.gov/marc/bibliographic/ecbdhome.html. New sql files in marc21/mandatory to create and populate the indicators tables with the sets of values for the Default framework/authtype. Each framework/authtype will be able to have its own copy to allow individual modification of indicators value. When editing the framework/authtype exists the possibility of cloning the indicators set from an existing framework/authtype populated with indicators. Modification of the intranet administration-Marc Frameworks/Authority MARC Framework to clone on creation from another framework and to delete set of indicators from a framework. Management (add/modify/delete) for indicators of the fields in the Framework Structure. Modification of the intranet cataloguing addbiblio / authorities authorities to enable a plugin to see the defined indicators value for a specific framework, and to check validity of indicators value. Two new system preferences: CheckValueIndicators for checking the value of the indicators when cataloguing a biblio record; DisplayPluginValueIndicators: to enable the plugin at addbiblio to see indicators value and to check too. Rebased to master 01/2013 Bug 4888 - rebase follow-up Fixing errors I made during rebase Bug 4888 follow-up: rebase errors 2 Another rebase error fixed
Looks like i b0rked the authorities part (authorities.tt)
Created attachment 14830 [details] [review] Bug 4888 - pre-set of field indicators value Preload on database of the set of field indicators value as defined by http://www.loc.gov/marc/bibliographic/ecbdhome.html. New sql files in marc21/mandatory to create and populate the indicators tables with the sets of values for the Default framework/authtype. Each framework/authtype will be able to have its own copy to allow individual modification of indicators value. When editing the framework/authtype exists the possibility of cloning the indicators set from an existing framework/authtype populated with indicators. Modification of the intranet administration-Marc Frameworks/Authority MARC Framework to clone on creation from another framework and to delete set of indicators from a framework. Management (add/modify/delete) for indicators of the fields in the Framework Structure. Modification of the intranet cataloguing addbiblio / authorities authorities to enable a plugin to see the defined indicators value for a specific framework, and to check validity of indicators value. Two new system preferences: CheckValueIndicators for checking the value of the indicators when cataloguing a biblio record; DisplayPluginValueIndicators: to enable the plugin at addbiblio to see indicators value and to check too. Rebased to master 01/2013 Bug 4888 - rebase follow-up Fixing errors I made during rebase Bug 4888 follow-up: rebase errors 2 Another rebase error fixed Bug 4888 follow-up: fix authorities.tt Fixed an error in authorities.tt
Checking for the right values works in the pop-up window. Entering a "wrong" value directly into the "Add MARC record" view and pressinf 'Save' results not in a waring/message but the error Can't call method "fields" on an undefined value at /home/mirko/koha/C4/Biblio.pm line 2527. (checked in OPAC)
Created attachment 14837 [details] [review] Bug 4888 - pre-set of field indicators value Preload on database of the set of field indicators value as defined by http://www.loc.gov/marc/bibliographic/ecbdhome.html. New sql files in marc21/mandatory to create and populate the indicators tables with the sets of values for the Default framework/authtype. Each framework/authtype will be able to have its own copy to allow individual modification of indicators value. When editing the framework/authtype exists the possibility of cloning the indicators set from an existing framework/authtype populated with indicators. Modification of the intranet administration-Marc Frameworks/Authority MARC Framework to clone on creation from another framework and to delete set of indicators from a framework. Management (add/modify/delete) for indicators of the fields in the Framework Structure. Modification of the intranet cataloguing addbiblio / authorities authorities to enable a plugin to see the defined indicators value for a specific framework, and to check validity of indicators value. Two new system preferences: CheckValueIndicators for checking the value of the indicators when cataloguing a biblio record; DisplayPluginValueIndicators: to enable the plugin at addbiblio to see indicators value and to check too. Rebased to master 01/2013 Bug 4888 - rebase follow-up Fixing errors I made during rebase Bug 4888 follow-up: rebase errors 2 Another rebase error fixed Bug 4888 follow-up: fix authorities.tt Fixed an error in authorities.tt Bug 4888 follow-up fixed auth_tag_structure.tt
I think this really needs a test plan.
(In reply to Mirko Tietgen from comment #27) > Created attachment 14837 [details] [review] [review] > Bug 4888 - pre-set of field indicators value > > Preload on database of the set of field indicators value as defined by > http://www.loc.gov/marc/bibliographic/ecbdhome.html. > New sql files in marc21/mandatory to create and populate the indicators > tables with the sets of values for > the Default framework/authtype. > Each framework/authtype will be able to have its own copy to allow > individual modification of indicators value. > When editing the framework/authtype exists the possibility of cloning the > indicators set from an existing > framework/authtype populated with indicators. > > Modification of the intranet administration-Marc Frameworks/Authority MARC > Framework to clone on creation from > another framework and to delete set of indicators from a framework. > Management (add/modify/delete) for indicators of the fields in the Framework > Structure. > > Modification of the intranet cataloguing addbiblio / authorities authorities > to enable a plugin to see the > defined indicators value for a specific framework, and to check validity of > indicators value. > > Two new system preferences: CheckValueIndicators for checking the value of > the indicators when cataloguing > a biblio record; DisplayPluginValueIndicators: to enable the plugin at > addbiblio to see indicators value and to > check too. > > Rebased to master 01/2013 > > Bug 4888 - rebase follow-up > > Fixing errors I made during rebase > > Bug 4888 follow-up: rebase errors 2 > > Another rebase error fixed > > Bug 4888 follow-up: fix authorities.tt > > Fixed an error in authorities.tt > > Bug 4888 follow-up > > fixed auth_tag_structure.tt Hi, Do you always work on this patch? Regards, Marjorie
(In reply to Marjorie Barry-Vila from comment #29) > Hi, > > Do you always work on this patch? > > Regards, > Marjorie I'm not working on this. AFAIR the patch (written by somebody else) did not do what I was hoping for.
I am not sure which bug added it, but we do now have the option to set default values for indicators in the MARC bibliographic framework configuration.