Description
Josef Moravec
2015-04-03 07:30:43 UTC
Created attachment 44770 [details] [review] Bug 13592: Add an option to charge for any hold placed Currently the fee is applied on if all items for the record are issued and at least one hold already exists on the record. This patch does not give a complete answer to the problem (see discussion on bug 13592 for the other user's expectations). It only adds the ability to charge for any hold placed regardless of the conditions. Test plan: 1) Execute the updatedb entry to insert the new pref 2) Confirm that the behavior is the same as before applying this patch 3) Change the HoldFeeMode pref to 'always' 4) Note that the fee is applied for any hold placed Oops, typo in the bug number, sorry for the noise. Created attachment 47326 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Click 'Import' into your new authority type (so you don't overwrite any important existing authority types) 7) Select the file you just exported and click 'Import' 8) Confirm you are taken to auth_tag_structure.pl 9) Go back to Authority types 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Go to Admin -> MARC bibliographic framework 12) Confirm that the 'Export' and 'Import' functions still work here as well Hello Aleisha, I tested patch but output are non correct. Examples: empty export of unification names http://pastebin.com/qnCassBC Personal names, just some mess: http://pastebin.com/1X6NXgeN Expected is same type of output like export from biblio frameworks. Lets find bug :-) Thank You. Mike Hello Aleisha, I tested patch but outputs are non correct. Examples: empty export of unification names http://pastebin.com/qnCassBC Personal names, just some mess: http://pastebin.com/1X6NXgeN Expected is same type of output like export from biblio frameworks. Lets find bug :-) Export from default biblio framework don't work - empty file Thank You. Mike First of all, thank you Aleisha! But this doesn't work, because functions _export_table_* take data from database filtered by column "frameworkcode" which in auth_subfield_structure is not always populated and in auth_tag_structure is not present at all. I'm not sure how to deal with it, just some ideas for now: 1. we could add new parameter to export routines, which can say the column should be used to filter data (authtypecode if we are working with authorities) 2. add and populate column frameworkcode to tables auth_tag_structure and auth_subfield_structure, which should have the same value as authtypecode. But I don't really like this solution as it's more work ending with dumb duplicate column 3. something else or 4. just unify the authtypecode/frameworkcode and name it the same Hello. I vote for solutions 1 or 4. Thanks for response. Mike (In reply to Mike from comment #8) > Hello. > > I vote for solutions 1 or 4. > > A twist one 1, we are already passing a value which tells us if we are looking at authorities or not, if we pass that down to the next layer of functions also, as the new parameter you were talking about, that would be an ok way of doing it I think? 4/ would need massive amounts of testing. 1/ only effects the import and export so I think is a lot safer. Created attachment 47360 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Click 'Import' into your new authority type (so you don't overwrite any important existing authority types) 7) Select the file you just exported and click 'Import' 8) Confirm you are taken to auth_tag_structure.pl 9) Go back to Authority types 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Go to Admin -> MARC bibliographic framework 12) Confirm that the 'Export' and 'Import' functions still work here as well Created attachment 47364 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Click 'Import' into your new authority type (so you don't overwrite any important existing authority types) 7) Select the file you just exported and click 'Import' 8) Confirm you are taken to auth_tag_structure.pl 9) Go back to Authority types 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Go to Admin -> MARC bibliographic framework 12) Confirm that the 'Export' and 'Import' functions still work here as well Sorry, does not apply CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt Created attachment 50046 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Click 'Import' into your new authority type (so you don't overwrite any important existing authority types) 7) Select the file you just exported and click 'Import' 8) Confirm you are taken to auth_tag_structure.pl 9) Go back to Authority types 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Go to Admin -> MARC bibliographic framework 12) Confirm that the 'Export' and 'Import' functions still work here as well Hi, testing this. Export works Ok, all formats. Import does not work. I created a new auth type, then 'imported' some of the exported formats, auth_tag_structure and auth_subfield_structure are not populated, instead auth_tag_structure.pl gives you the option to fill fields using another auth_type (after some time). Looking at the logs you find DBD::mysql::st execute failed: Unknown column 'frameworkcode' in 'where clause' [for Statement "DELETE FROM auth_tag_structure WHERE frameworkcode=? AND ... and that's right because, unfortunately, auth tables use authtypecode instead of frameworkcode. Also in the patch $query = 'SELECT * FROM ' . $table . ' WHERE frameworkcode=?'; $query = 'SELECT * FROM ' . $table . ' WHERE frameworkcode=?'; $query = 'SELECT * FROM ' . $table . ' WHERE frameworkcode=?'; $query = 'SELECT ' . join(',', @fields) . ' FROM ' . $table . ' WHERE frameworkcode=?'; Aditionally there are a few tabs that must be removed, FAIL C4/ImportExportFramework.pm OK critic FAIL forbidden patterns forbidden pattern: tab char (line 234) forbidden pattern: tab char (line 285) forbidden pattern: tab char (line 236) forbidden pattern: tab char (line 235) forbidden pattern: tab char (line 237) forbidden pattern: tab char (line 232) forbidden pattern: tab char (line 233) (In reply to Bernardo Gonzalez Kriegel from comment #14) > Also in the patch > $query = 'SELECT * FROM ' . $table . ' WHERE frameworkcode=?'; > $query = 'SELECT * FROM ' . $table . ' WHERE frameworkcode=?'; > $query = 'SELECT * FROM ' . $table . ' WHERE frameworkcode=?'; > $query = 'SELECT ' . join(',', @fields) . ' FROM ' . $table . ' > WHERE frameworkcode=?'; > This is present code, not in the patch, sorry. Created attachment 53065 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Click 'Import' into your new authority type (so you don't overwrite any important existing authority types) 7) Select the file you just exported and click 'Import' 8) Confirm you are taken to auth_tag_structure.pl 9) Go back to Authority types 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Go to Admin -> MARC bibliographic framework 12) Confirm that the 'Export' and 'Import' functions still work here as well https://bugs.koha-community.org/show_bug.cgi?id=13592 Created attachment 53066 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Click 'Import' into your new authority type (so you don't overwrite any important existing authority types) 7) Select the file you just exported and click 'Import' 8) Confirm you are taken to auth_tag_structure.pl 9) Go back to Authority types 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Go to Admin -> MARC bibliographic framework 12) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Can you please test this again? The import seems to work fine for me because we have put in checks for if it is an authority or not. I've just tested it. Exporting works as expected, but Importing doesn't. After selecting file and confirming it, it takes me to auth_tag_structure.pl as expected, but the newly created authtype is still empty - nothing is imported. Exporting and importing bibliographics frameworks works fine. Created attachment 54840 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) IMPORTANT STEP: Before you import, make sure that the authtypecode of the file you are going to import matches the Code of your new authority type. Use Vim or something similar to do a search and replace and change the codes in your file - do NOT use LibreOffice etc. because it tries to be too helpful and messes with the formatting of the file (this is what has broken the Import function in previous testing of this patch) 7) Import into your new authority type using the file you just exported (make sure you've done Step 6) 8) Confirm you are taken to auth_tag_structure.pl 9) Go back to Authority types 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Just to explain further: We worked out why Import wasn't working. The patch itself appears to be fine. When we try to Import and exported file, the database sees that authtypecode already exists and instead of importing into a new authority type, it simply updates the existing authority type with that authtypecode. This is why we see no error when it doesn't work - it still 'worked', just didn't do what we wanted it to do. This means we must change the file itself so that authtypecode matches the Code of our new authority type, however after spending way too long fiddling around, we realised that LibreOffice formatted the file weirdly after saving and caused errors in the file, so the Import didn't work properly. This is probably a separate bug, regarding the way the code handles incorrectly formatted files and the error message it shows. Changing the authtype code in Vim did not stuff up the formatting and meant we were able to Import correctly. So, the patch itself should work as long as all the speechmarks etc. are in the right places after you have changed the authtypecode to match your new authority type. Created attachment 54899 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) IMPORTANT STEP: Before you import, make sure that the authtypecode of the file you are going to import matches the Code of your new authority type. Use Vim or something similar to do a search and replace and change the codes in your file - do NOT use LibreOffice etc. because it tries to be too helpful and messes with the formatting of the file (this is what has broken the Import function in previous testing of this patch) 7) Import into your new authority type using the file you just exported (make sure you've done Step 6) 8) Confirm you are taken to auth_tag_structure.pl 9) Go back to Authority types 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Go to Admin -> MARC bibliographic framework 12) Confirm that the 'Export' and 'Import' functions still work here as well Note: If the Export does not work for the default auth type, do not panic. The patch for bug 16035 should fix this. Sponsored-by: Catalyst IT Created attachment 54900 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) IMPORTANT STEP: Before you import, make sure that the authtypecode of the file you are going to import matches the Code of your new authority type. Use Vim or something similar to do a search and replace and change the codes in your file - do NOT use LibreOffice etc. because it tries to be too helpful and messes with the formatting of the file (this is what has broken the Import function in previous testing of this patch) 7) Import into your new authority type using the file you just exported (make sure you've done Step 6) 8) Confirm you are taken to auth_tag_structure.pl 9) Go back to Authority types 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Why was this set to Patch doesn't apply? Appears to apply cleanly for me still so will set back to Needs Signoff. :) Applying: Bug 13952: Import and export authority types fatal: sha1 information is lacking or useless (admin/import_export_framework.pl). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 13952: Import and export authority types The copy of the patch that failed is found in: /home/vagrant/kohaclone/.git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-13952-Import-and-export-authority-types-u9za7y.patch Created attachment 57873 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) IMPORTANT STEP: Before you import, make sure that the authtypecode of the file you are going to import matches the Code of your new authority type. Use Vim or something similar to do a search and replace and change the codes in your file - do NOT use LibreOffice etc. because it tries to be too helpful and messes with the formatting of the file (this is what has broken the Import function in previous testing of this patch) 7) Import into your new authority type using the file you just exported (make sure you've done Step 6) 8) Confirm you are taken to auth_tag_structure.pl 9) Go back to Authority types 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Created attachment 59831 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) IMPORTANT STEP: Before you import, make sure that the authtypecode of the file you are going to import matches the Code of your new authority type. Use Vim or something similar to do a search and replace and change the codes in your file - do NOT use LibreOffice etc. because it tries to be too helpful and messes with the formatting of the file (this is what has broken the Import function in previous testing of this patch) 7) Import into your new authority type using the file you just exported (make sure you've done Step 6) 8) Confirm you are taken to auth_tag_structure.pl 9) Go back to Authority types 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Comment on attachment 59831 [details] [review] Bug 13952: Import and export authority types Review of attachment 59831 [details] [review]: ----------------------------------------------------------------- Just eyeballed this. ::: admin/import_export_authtype.pl @@ +18,5 @@ > +# along with Koha; if not, see <http://www.gnu.org/licenses>. > + > + > +use strict; > +use warnings; The recommendation is use Modern::Perl; for the equivalent of these. @@ +26,5 @@ > +use C4::Auth qw/check_cookie_auth/; > +use C4::ImportExportFramework; > + > +my %cookies = CGI::Cookie->fetch(); > +my $authenticated = 0; The variable seems extraneous. Optimized, you could $auth_status //= q{}; and unless ($auth_status eq 'ok'). Exporting does work as expected. But I don't think the importing should work this way: it does NOT matter, to which authtype you import, it imports everytime to the framework with the same typecode - I think step 6 in test plan is bad - biblio framework import does not need that, so it should be consistent. And please update your patch according to comment 29. Created attachment 64421 [details] [review] Bug 13952: [FOLLOW-UP] Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Patch doesn't apply, not sure how to fix, sorry! Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 13952: Import and export authority types Using index info to reconstruct a base tree... M admin/import_export_framework.pl M koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt Auto-merging admin/import_export_framework.pl CONFLICT (content): Merge conflict in admin/import_export_framework.pl error: Failed to merge in the changes. Patch failed at 0001 Bug 13952: Import and export authority types The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-13952-Import-and-export-authority-types-CLgCHQ.patch Created attachment 67914 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) IMPORTANT STEP: Before you import, make sure that the authtypecode of the file you are going to import matches the Code of your new authority type. Use Vim or something similar to do a search and replace and change the codes in your file - do NOT use LibreOffice etc. because it tries to be too helpful and messes with the formatting of the file (this is what has broken the Import function in previous testing of this patch) 7) Import into your new authority type using the file you just exported (make sure you've done Step 6) 8) Confirm you are taken to auth_tag_structure.pl 9) Go back to Authority types 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Created attachment 67915 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Rebased, updated test plan, ready to test Sequence of attached patches is wrong, but works when you apply them in order :) I have started testing by regression testing the bibliographic frameworks export and import and for the default framework some things seem not quite right: - When exporting the default framework to Excel format the file ending changed from xml to ods for bibliographic frameworks - Reimporting the exported file for Default always results in unspecific error message. - QA might ask for tests for the changes to ImportExportFramework.pm Created attachment 68299 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Created attachment 68300 [details] [review] Bug 13952: [FOLLOW-UP] Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Created attachment 68301 [details] [review] Bug 13952: [FOLLOW-UP] Fixing import for default auth type (In reply to Katrin Fischer from comment #36) > Sequence of attached patches is wrong, but works when you apply them in > order :) Fixed! > I have started testing by regression testing the bibliographic frameworks > export and import and for the default framework some things seem not quite > right: > > - When exporting the default framework to Excel format the file ending > changed from xml to ods for bibliographic frameworks hmm I could not recreate this! it seemed to work fine for me > - Reimporting the exported file for Default always results in unspecific > error message. I believe I have fixed this in latest follow-up patch! > - QA might ask for tests for the changes to ImportExportFramework.pm I had a look for the tests but couldn't find them for some reason - do you know what file they're in? I am sorry Aleisha, but the bibliographic default framework still exports as .ods when I select csv. To test: - Go to administration > bibliographic marc frameworks - Export > CSV - Verify file ending is .csv - Apply patches - restart_all on kohadevbox - Repeat export - Verify file ending is now .ods Created attachment 68502 [details] [review] Bug 13952: [FOLLOW-UP] Fixing export on default biblio framework (In reply to Katrin Fischer from comment #41) > I am sorry Aleisha, but the bibliographic default framework still exports as > .ods when I select csv. > > To test: > - Go to administration > bibliographic marc frameworks > - Export > CSV > - Verify file ending is .csv > - Apply patches > - restart_all on kohadevbox > - Repeat export > - Verify file ending is now .ods Sorry Katrin I was missing the 'default' part. Found the problem, fixed in latest patch. Hi Aleisha, export is all looking good now. Signing off.
Not a blocker for me:
1) When exporting authority types, the window stays open in the background, when exporting bibliographic frameworks it closes after clicking the 'export' button.
2) Not a blocker as this is the current behaviour, but maybe something for the future:
>6) IMPORTANT STEP:
> Before you import, make sure that the authtypecode of the file you
> are going to import matches the Code of your new authority type.
Wouldn't it be better to display a warning in the case that the selected framework for import and the code in the file don't match? It seems like this could cause some unwanted data loss.
Created attachment 68512 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 68513 [details] [review] Bug 13952: [FOLLOW-UP] Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 68514 [details] [review] Bug 13952: [FOLLOW-UP] Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 68515 [details] [review] Bug 13952: [FOLLOW-UP] Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> (In reply to Katrin Fischer from comment #44) > Hi Aleisha, export is all looking good now. Signing off. > > Not a blocker for me: > > 1) When exporting authority types, the window stays open in the background, > when exporting bibliographic frameworks it closes after clicking the > 'export' button. Will fix this. > > 2) Not a blocker as this is the current behaviour, but maybe something for > the future: > > >6) IMPORTANT STEP: > > Before you import, make sure that the authtypecode of the file you > > are going to import matches the Code of your new authority type. > > Wouldn't it be better to display a warning in the case that the selected > framework for import and the code in the file don't match? It seems like > this could cause some unwanted data loss. I fixed this in Comment 31, you don't have to match up the authtypecode anymore, this step is from an old test plan. For those in the future testing, please use the most recent test plan from Comment 45. Created attachment 68556 [details] [review] Bug 13952: [FOLLOW-UP] Fixing JS error Missing a bracket that stopped the export modal from closing after clicking the button. Now fixed. Hm, it didn't work for me until I had changed the frameworkcode this morning - I actually had missed the step at first and then went back to look for a reason why it would not work. I had created a new framework, imported into the empty framework, page relaoded, but it remained empty. Hallo, Aleisha and I just walked through this patch and it is all working ok for me. We didn't have to do anything to the export files to get them to import into a new framework, nor did we have any trouble exporting the files. Bibliographic frameworks still worked as well. tl;dr: Sorry, wasn't able to replicate your problem here :( Not sure what exactly the difference could be, Aleisha and I were both using the devbox, with and without Plack enabled, on current master. Any thoughts on what might be different? Cheers, Liz Not sure when I can test again :( Maybe it was just a data problem on my side. Hi Aleisha, want to retest and try to push this through QA, can you please rebase? Created attachment 69940 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 69941 [details] [review] Bug 13952: [FOLLOW-UP] Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 69942 [details] [review] Bug 13952: [FOLLOW-UP] Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 69943 [details] [review] Bug 13952: [FOLLOW-UP] Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 69944 [details] [review] Bug 13952: [FOLLOW-UP] Fixing JS error Missing a bracket that stopped the export modal from closing after clicking the button. Now fixed. (In reply to Katrin Fischer from comment #54) > Hi Aleisha, want to retest and try to push this through QA, can you please > rebase? Rebased, ready for you to retest Hi Aleisha, I still have the problem with the modal not closing. I have used 'restart_all' and shift-reloaded the page a couple of times. Could you take another look please? There are a few JavaScript errors on the page, I think the patches need to be adjusted for the changes made moving the JavaScript to the bottom recently: http://git.koha-community.org/gitweb/?p=koha.git;a=commit;h=7c5c516844625592ed68ca91be5a76852b4bfdb6 Created attachment 76665 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 76666 [details] [review] Bug 13952: [FOLLOW-UP] Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 76667 [details] [review] Bug 13952: [FOLLOW-UP] Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 76668 [details] [review] Bug 13952: [FOLLOW-UP] Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Hello, I've rebased the patches and tested them. When importing authority types, it appears that the modal box never closes, but I waited a few minutes and it did eventually close and all the data had loaded in correctly. So technically the feature works, but it's very slow. I'm not sure how to make it faster. Will set to Needs Signoff for now and allow testing to happen unless someone can give a tip for why it's slow and how to fix that - but for now, it does work. Applying: Bug 13952: Import and export authority types Using index info to reconstruct a base tree... M koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt Failed to merge in the changes. Patch failed at 0001 Bug 13952: Import and export authority types The copy of the patch that failed is found in: /home/vagrant/kohaclone/.git/rebase-apply/patch Created attachment 80794 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 80795 [details] [review] Bug 13952: [FOLLOW-UP] Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 80796 [details] [review] Bug 13952: [FOLLOW-UP] Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 80797 [details] [review] Bug 13952: [FOLLOW-UP] Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Everything work but: - import non correct framework fails, but without any message - export window freeze open after export = different behaviour from MARC framework export Created attachment 81248 [details] [review] Bug 13952: (follow-up) Fixing leftover merge conflict stuff There was some leftover stuff from a merge conflict messing with the JS, so I have fixed this up. The window now closes after export, as expected. Have noticed however that export breaks with authtypecodes that have a slash (/) in them. Will set to Assigned to fix this. Also need to add a fail message for when authtypecodes do not match on import. Created attachment 82853 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 82854 [details] [review] Bug 13952: [FOLLOW-UP] Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 82855 [details] [review] Bug 13952: [FOLLOW-UP] Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 82856 [details] [review] Bug 13952: [FOLLOW-UP] Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Comment on attachment 81248 [details] [review] Bug 13952: (follow-up) Fixing leftover merge conflict stuff Rebased, now redundant (In reply to Aleisha Amohia from comment #74) > > Have noticed however that export breaks with authtypecodes that have a > slash (/) in them. Will set to Assigned to fix this. > I have noticed that this is an issue that already exists in biblio frameworks, so I do not think it is required for this patch. I can work on a patch that depends on this one that fixes this problem in biblio frameworks and authority types, but this patch can get through without this fix. Created attachment 82895 [details] [review] Bug 13952: (follow-up) template filters, moving js to separate file This patch adds filters to the template file and moves the JS into a separate file. (In reply to Aleisha Amohia from comment #74) > Also need to add a fail message for when authtypecodes do not match on > import. Upon further testing, I've realised that this is no longer an issue. You CAN import a file with unmatching authtypecodes and it will work and fix up the authtypecode in the import - it just takes a little while. I have added a note to the popup so the user expects to wait a few minutes. This is ready to test Created attachment 83024 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 83025 [details] [review] Bug 13952: (follow-up) Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 83026 [details] [review] Bug 13952: (follow-up) Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 83027 [details] [review] Bug 13952: (follow-up) Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 83028 [details] [review] Bug 13952: (follow-up) template filters, moving js to separate file This patch adds filters to the template file and moves the JS into a separate file. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Hi Owen, I see you signed off the follow-up, does this count for the whole patch set or only the follow-up? Looking to get my QA token back :) QA failure I'm afraid: 1) Changes to a module without corresponding additions to the tests. 2) I 'think' this patch introduces noise in the existing tests (which makes me think it introduces noise in the logs too, but that is untested). - [Use of uninitialized value $frameworktype in string eq at ~/kohaclone/C4/ImportExportFramework.pm line 1157.] Otherwise, we're really close now. Also.. is this sponsored work? Ignore that last one.. just spotted I missed the 'Sponsored-by' lines :) Created attachment 85073 [details] [review] Bug 13952: (follow-up) Tests Run: prove -v t/db_dependent/ImportExportFramework.t and confirm all tests pass. I've also added a fix to remove the warns when exporting in ODS format. sorry, i got error: sha1 information is lacking or useless (C4/ImportExportFramework.pm). error: could not build fake ancestor on last patch Created attachment 86549 [details] [review] Bug 13952: (follow-up) Tests Run: prove -v t/db_dependent/ImportExportFramework.t and confirm all tests pass. I've also added a fix to remove the warns when exporting in ODS format. Created attachment 86550 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 86551 [details] [review] Bug 13952: (follow-up) Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 86552 [details] [review] Bug 13952: (follow-up) Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 86553 [details] [review] Bug 13952: (follow-up) Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 86554 [details] [review] Bug 13952: (follow-up) template filters, moving js to separate file This patch adds filters to the template file and moves the JS into a separate file. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 86555 [details] [review] Bug 13952: (follow-up) Tests Run: prove -v t/db_dependent/ImportExportFramework.t and confirm all tests pass. I've also added a fix to remove the warns when exporting in ODS format. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Sorry, but still not ready, Export looks OK, but import not. When I try to import xml or ods, i end up with all fields deleted When I try to import CSV I see error message, that framework could not be imported. But automated test pass... Created attachment 103610 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 103611 [details] [review] Bug 13952: (follow-up) Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 103612 [details] [review] Bug 13952: (follow-up) Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 103613 [details] [review] Bug 13952: (follow-up) Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 103614 [details] [review] Bug 13952: (follow-up) template filters, moving js to separate file This patch adds filters to the template file and moves the JS into a separate file. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 103615 [details] [review] Bug 13952: (follow-up) Tests Run: prove -v t/db_dependent/ImportExportFramework.t and confirm all tests pass. I've also added a fix to remove the warns when exporting in ODS format. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Rebased. Working on removing XML options (to be consistent with biblio frameworks) and fixing ODS import. CSV works for me. Created attachment 103616 [details] [review] Bug 13952: (follow-up) Removing XML options (In reply to Aleisha Amohia from comment #108) > Rebased. Working on removing XML options (to be consistent with biblio > frameworks) and fixing ODS import. CSV works for me. Just noticed that ODS does actually work. If you export the framework in ODS format, the tag structure is in one sheet, and the subfield structure is in a second sheet within the document. When exporting the framework in CSV format, all the data is in one sheet, with the tag structure first and the subfield structure underneath. Ready for testing. Would be great to get this one through. Hi Aleisha, it need to be rebase on top of master. Thanks Created attachment 114170 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 114171 [details] [review] Bug 13952: (follow-up) Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 114172 [details] [review] Bug 13952: (follow-up) Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 114173 [details] [review] Bug 13952: (follow-up) Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 114174 [details] [review] Bug 13952: (follow-up) template filters, moving js to separate file This patch adds filters to the template file and moves the JS into a separate file. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 114175 [details] [review] Bug 13952: (follow-up) Tests Run: prove -v t/db_dependent/ImportExportFramework.t and confirm all tests pass. I've also added a fix to remove the warns when exporting in ODS format. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 114176 [details] [review] Bug 13952: (follow-up) Removing XML options Created attachment 114177 [details] [review] Bug 13952: (follow-up) fixing indentation and rebasing Created attachment 115379 [details] [review] Bug 13952: (follow-up) fixing indentation and rebasing Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 115381 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 115382 [details] [review] Bug 13952: (follow-up) Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 115383 [details] [review] Bug 13952: (follow-up) Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 115384 [details] [review] Bug 13952: (follow-up) Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 115385 [details] [review] Bug 13952: (follow-up) template filters, moving js to separate file This patch adds filters to the template file and moves the JS into a separate file. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 115386 [details] [review] Bug 13952: (follow-up) Tests Run: prove -v t/db_dependent/ImportExportFramework.t and confirm all tests pass. I've also added a fix to remove the warns when exporting in ODS format. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 115387 [details] [review] Bug 13952: (follow-up) Removing XML options Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 115388 [details] [review] Bug 13952: (follow-up) fixing indentation and rebasing Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Sorry, if I am asking in a wrong place or form. New to this. Our team has installed KOHA 20.11 (cs) on Ubuntu. We would like to add export and import of authority frameworks, which seems to be solved here. I may act as root at Ubuntu, but I am not a Linux or KOHA expert. Any advice? Hello Primo Kohák, this feature is IN discussion now. Not at master code. So you can import/export authority frameworks to/from database. (In reply to Michal Denar from comment #130) > So you can > import/export authority frameworks to/from database. Thank you. CAN or CANNOT? If I CAN import/export them, how? Explanation: (1) I can import/export biblio frameworks here: http://...cgi-bin/koha/admin/biblio_framework.pl (2) I cannot import/export authority frameworks here: http://...cgi-bin/koha/admin/authtypes.pl (3) I may try to change the 3 files /usr/share/koha/lib/C4/ImportExportFramework.pm /usr/share/koha/intranet/cgi-bin/admin/import_export_framework.pl /usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/modules/admin/authtypes.tt (perhaps also these 2: /usr/share/koha/intranet/htdocs/intranet-tmpl/prog/cs-CZ/modules/admin/authtypes.tt /usr/share/koha/intranet/htdocs/intranet-tmpl/prog/de-DE/modules/admin/authtypes.tt ) and create a 4th one /usr/share/koha/intranet/cgi-bin/admin/import_export_authtype.pl as described in https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115381 (4) There may be a way to import/export authority frameworks not via web administrative interface but from bash. Hi Primo Before you switched this bug to in discussion, it was set to signed off. I have switched it back to signed off. This means the patches attached to this bug have been tested by a member of the community who has said they work. The code is not in Koha yet. The process is needs sign-off -> signed off-> passed qa -> pushed (assuming no issues are found with it) In discussion means it is stalled and people have issues with the patches or the feature itself. So we don't want it in that status. Signed off means it's waiting on a QA team member to test. Hope this helps explain it Chris (In reply to Chris Cormack from comment #132) > Before you switched this bug to in discussion, it was set to signed off. I > have switched it back to signed off. Sorry, I did not understand I am changing the status of the bug. Thank you for the correction and the explanation. (I am only interested in applying the patch (https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115381) to our installation of KOHA. I guess I will not dare to do it.) It has been signed off, so if we were willing to apply the patches to your system you can do that. You could add your sign off also if it worked, that might get it through the QA process faster. I am really sorry, but this patch set no longer applies and I can't fix it: Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 13952: Import and export authority types Applying: Bug 13952: (follow-up) Fixing authority type import error: sha1 information is lacking or useless (C4/ImportExportFramework.pm). error: could not build fake ancestor Patch failed at 0001 Bug 13952: (follow-up) Fixing authority type import The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-13952-follow-up-Fixing-authority-type-import-NMOJ0F.patch Created attachment 125383 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 125384 [details] [review] Bug 13952: (follow-up) Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 125385 [details] [review] Bug 13952: (follow-up) Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 125386 [details] [review] Bug 13952: (follow-up) Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 125387 [details] [review] Bug 13952: (follow-up) template filters, moving js to separate file This patch adds filters to the template file and moves the JS into a separate file. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 125388 [details] [review] Bug 13952: (follow-up) Tests Run: prove -v t/db_dependent/ImportExportFramework.t and confirm all tests pass. I've also added a fix to remove the warns when exporting in ODS format. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 125389 [details] [review] Bug 13952: (follow-up) Removing XML options Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 125390 [details] [review] Bug 13952: (follow-up) fixing indentation and rebasing Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> I've rebased the patches so they should apply now, however importing authority frameworks seems to be broken. I'll fix this tomorrow. Aleisha Created attachment 128316 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 128317 [details] [review] Bug 13952: (follow-up) Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 128318 [details] [review] Bug 13952: (follow-up) Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 128319 [details] [review] Bug 13952: (follow-up) Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 128320 [details] [review] Bug 13952: (follow-up) template filters, moving js to separate file This patch adds filters to the template file and moves the JS into a separate file. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 128321 [details] [review] Bug 13952: (follow-up) Tests Run: prove -v t/db_dependent/ImportExportFramework.t and confirm all tests pass. I've also added a fix to remove the warns when exporting in ODS format. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 128322 [details] [review] Bug 13952: (follow-up) Removing XML options Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 128323 [details] [review] Bug 13952: (follow-up) fixing indentation and rebasing Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 128324 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 128325 [details] [review] Bug 13952: (follow-up) Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 128326 [details] [review] Bug 13952: (follow-up) Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 128327 [details] [review] Bug 13952: (follow-up) Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 128328 [details] [review] Bug 13952: (follow-up) template filters, moving js to separate file This patch adds filters to the template file and moves the JS into a separate file. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 128329 [details] [review] Bug 13952: (follow-up) Tests Run: prove -v t/db_dependent/ImportExportFramework.t and confirm all tests pass. I've also added a fix to remove the warns when exporting in ODS format. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 128330 [details] [review] Bug 13952: (follow-up) Removing XML options Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 128331 [details] [review] Bug 13952: (follow-up) fixing indentation and rebasing Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> We'll need a small fix here: 1) QA test tools FAIL admin/import_export_authtype.pl FAIL critic Subroutine "new" called using indirect syntax at line 36, column 13. See page 349 of PBP. 2) Text +Export all the information of a MARC or Authority Type Framework to an excel "xml" file, comma separated values "csv" file or OpenDocument SpreadSheet "ods" file. As the authority types are also MARC... maybe we could make this read: Export all information of a bibliographic or authority MARC framework to an Excel "xml" file, comma separated values "csv" or OpenDocument SpreadSheet "ods". 3) Unit tests The unit tests pass, but there is 'tons' of these with the patches, while the output without the patches is clean: Use of uninitialized value $frameworktype in string eq at /kohadevbox/koha/C4/ImportExportFramework.pm line 1004, <$dom> line 21. Use of uninitialized value $frameworktype in string eq at /kohadevbox/koha/C4/ImportExportFramework.pm line 678. 4) Translatability In .js files you need to use a double undescore for making things translatable: alert(_("Error importing the authority type %s").format(decodeURIComponent(matches[1]))); Should be: __("Error... 5) First import/export test looks great :) Created attachment 130587 [details] [review] Bug 13952: (follow-up) JS translatability, clean warns, other Also addresses QA test tools, perldoc in ImportExportFramework.pm Created attachment 130917 [details] [review] Bug 13952: Import and export authority types This patch amends C4::ImportExportFramework to work for authority types as well as MARC frameworks. New file: admin/import_export_authtype.pl Update: Ensuring we are passing the right column to the right tables. Update2: Making the error messages the same to be consistent with patch on Bug 15665 Update3: Fixing merge conflicts Update4: Fixing merge conflicts and removing tabs Update5: Getting rid of warns, making sure Import and Export of default authority will work Update6: Merge conflicts and making sure export of default auth type works Update7: Fixing merge conflicts and updating buttons to bootstrap3 To test: 1) Go to Admin -> Authority types 2) Confirm there are two new columns 'Export' and 'Import' in the table 3) Click 'Export' on an existing authority type and choose a file type, click 'Export' 4) Confirm that the authority type is exported as your chosen file type. Save the file 5) Create a new authority type 6) Import into your new authority type using the file you just exported 7) Confirm you are taken to auth_tag_structure.pl 8) Go back to Authority types 9) Export your new authority type. View the exported file and confirm the authtypecode has been updated to match the code you set for the new auth type 10) Click 'Import' next to any existing authority type and attempt to import a file that is not XML, CSV or ODS. Confirm that this fails and you are asked to import a file of the correct file type 11) Confirm Export and Import work for the Default authority type 12) Go to Admin -> MARC bibliographic framework 13) Confirm that the 'Export' and 'Import' functions still work here as well Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 130918 [details] [review] Bug 13952: (follow-up) Fixing authority type import This patch fixes the comments from Comment 29 and the import functionality. You should now be able to import an exported file without editing the file at all and the authority type code will be overwritten in the file (same behaviour as biblio frameworks). Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 130919 [details] [review] Bug 13952: (follow-up) Fixing import for default auth type Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 130920 [details] [review] Bug 13952: (follow-up) Fixing export on default biblio framework Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 130921 [details] [review] Bug 13952: (follow-up) template filters, moving js to separate file This patch adds filters to the template file and moves the JS into a separate file. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 130922 [details] [review] Bug 13952: (follow-up) Tests Run: prove -v t/db_dependent/ImportExportFramework.t and confirm all tests pass. I've also added a fix to remove the warns when exporting in ODS format. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 130923 [details] [review] Bug 13952: (follow-up) Removing XML options Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 130924 [details] [review] Bug 13952: (follow-up) fixing indentation and rebasing Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 130925 [details] [review] Bug 13952: (follow-up) JS translatability, clean warns, other Also addresses QA test tools, perldoc in ImportExportFramework.pm Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Not sure if I had missed setting back to "Signed off", but we got plenty of sign-off lines on these patches anyway! Pushed to master for 22.05, thanks to everybody involved [U+1F984] |