enju_biblio 0.3.13 → 0.4.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/app/controllers/agents_controller.rb +6 -0
- data/app/controllers/content_types_controller.rb +1 -1
- data/app/controllers/items_controller.rb +10 -18
- data/app/controllers/manifestations_controller.rb +85 -80
- data/app/controllers/resource_import_results_controller.rb +2 -6
- data/app/controllers/series_statements_controller.rb +6 -0
- data/app/helpers/enju_biblio/application_helper.rb +5 -5
- data/app/helpers/manifestations_helper.rb +12 -12
- data/app/models/agent.rb +4 -13
- data/app/models/agent_import_file.rb +1 -1
- data/app/models/agent_relationship_type.rb +8 -7
- data/app/models/agent_type.rb +10 -7
- data/app/models/carrier_type.rb +14 -11
- data/app/models/content_type.rb +10 -7
- data/app/models/create_type.rb +8 -7
- data/app/models/doi_record.rb +36 -0
- data/app/models/form_of_work.rb +11 -8
- data/app/models/frequency.rb +11 -8
- data/app/models/identifier.rb +1 -1
- data/app/models/identifier_type.rb +1 -0
- data/app/models/import_request.rb +3 -4
- data/app/models/isbn_record.rb +51 -0
- data/app/models/isbn_record_and_manifestation.rb +18 -0
- data/app/models/issn_record.rb +49 -0
- data/app/models/issn_record_and_manifestation.rb +18 -0
- data/app/models/item.rb +7 -55
- data/app/models/language.rb +10 -9
- data/app/models/license.rb +9 -7
- data/app/models/manifestation.rb +271 -158
- data/app/models/manifestation_relationship_type.rb +9 -7
- data/app/models/medium_of_performance.rb +11 -8
- data/app/models/periodical.rb +33 -0
- data/app/models/periodical_and_manifestation.rb +16 -0
- data/app/models/picture_file.rb +2 -0
- data/app/models/produce_type.rb +8 -7
- data/app/models/realize_type.rb +8 -7
- data/app/models/resource_export_file.rb +8 -6
- data/app/models/resource_export_file_state_machine.rb +1 -1
- data/app/models/resource_import_file.rb +62 -153
- data/app/views/agent_import_results/index.txt.erb +3 -0
- data/app/views/agent_relationship_types/index.html.erb +1 -1
- data/app/views/agent_relationship_types/show.html.erb +1 -1
- data/app/views/agent_relationships/_form.html.erb +1 -1
- data/app/views/agent_types/index.html.erb +1 -1
- data/app/views/agent_types/show.html.erb +1 -1
- data/app/views/agents/_agent.html.erb +1 -1
- data/app/views/agents/_agent_list.html.erb +2 -2
- data/app/views/agents/_form.html.erb +4 -4
- data/app/views/agents/_index_agent.html.erb +1 -1
- data/app/views/agents/_index_agent_merge_list.html.erb +1 -1
- data/app/views/agents/_index_expression.html.erb +2 -2
- data/app/views/agents/_index_manifestation.html.erb +2 -2
- data/app/views/agents/_index_work.html.erb +2 -2
- data/app/views/agents/index.atom.builder +1 -1
- data/app/views/agents/index.rss.builder +3 -3
- data/app/views/agents/show.html+phone.erb +2 -2
- data/app/views/agents/show.html.erb +2 -2
- data/app/views/carrier_types/index.html.erb +2 -2
- data/app/views/carrier_types/show.html.erb +3 -3
- data/app/views/content_types/index.html.erb +1 -1
- data/app/views/content_types/show.html.erb +1 -1
- data/app/views/countries/index.html.erb +1 -1
- data/app/views/countries/show.html.erb +1 -1
- data/app/views/create_types/index.html.erb +1 -1
- data/app/views/create_types/show.html.erb +1 -1
- data/app/views/creates/_form.html.erb +1 -1
- data/app/views/form_of_works/index.html.erb +1 -1
- data/app/views/form_of_works/show.html.erb +1 -1
- data/app/views/frequencies/index.html.erb +1 -1
- data/app/views/frequencies/show.html.erb +1 -1
- data/app/views/identifier_types/index.html.erb +1 -1
- data/app/views/identifier_types/show.html.erb +1 -1
- data/app/views/items/_form.html.erb +13 -33
- data/app/views/items/index.html+phone.erb +3 -3
- data/app/views/items/index.html.erb +3 -3
- data/app/views/items/show.html+phone.erb +5 -5
- data/app/views/items/show.html.erb +119 -134
- data/app/views/languages/index.html.erb +1 -1
- data/app/views/languages/show.html.erb +1 -1
- data/app/views/layouts/agents.html.erb +2 -2
- data/app/views/layouts/items.html.erb +1 -1
- data/app/views/layouts/manifestations.html.erb +4 -4
- data/app/views/licenses/index.html.erb +1 -1
- data/app/views/licenses/show.html.erb +1 -1
- data/app/views/manifestation_relationship_types/index.html.erb +1 -1
- data/app/views/manifestation_relationship_types/show.html.erb +1 -1
- data/app/views/manifestation_relationships/_form.html.erb +1 -1
- data/app/views/manifestations/_call_number.html.erb +3 -3
- data/app/views/manifestations/_carrier_type_facet.html.erb +1 -1
- data/app/views/manifestations/_classification_facet.html.erb +2 -2
- data/app/views/manifestations/_export_detail.html.erb +0 -1
- data/app/views/manifestations/_export_list.html.erb +3 -4
- data/app/views/manifestations/_form.html.erb +8 -31
- data/app/views/manifestations/_identifier_fields.html.erb +1 -1
- data/app/views/manifestations/_language_facet.html.erb +1 -1
- data/app/views/manifestations/_library_facet.html.erb +1 -1
- data/app/views/manifestations/_manifestation.txt.erb +1 -1
- data/app/views/manifestations/_pub_year_facet.html.erb +1 -1
- data/app/views/manifestations/_reservable_facet.html.erb +2 -2
- data/app/views/manifestations/_show_creators.html.erb +1 -1
- data/app/views/manifestations/_show_detail_librarian.html.erb +13 -37
- data/app/views/manifestations/_show_detail_user.html.erb +13 -25
- data/app/views/manifestations/_show_holding.html+phone.erb +3 -3
- data/app/views/manifestations/_show_holding.html.erb +2 -2
- data/app/views/manifestations/explain.sru +9 -0
- data/app/views/manifestations/index.atom.builder +1 -1
- data/app/views/manifestations/index.html.erb +7 -7
- data/app/views/manifestations/index.opds.builder +1 -1
- data/app/views/manifestations/index.rdf.builder +3 -3
- data/app/views/manifestations/index.rss.builder +3 -3
- data/app/views/manifestations/index.sru.builder +101 -0
- data/app/views/manifestations/index.txt.erb +1 -0
- data/app/views/manifestations/show.txt.erb +1 -0
- data/app/views/medium_of_performances/index.html.erb +1 -1
- data/app/views/medium_of_performances/show.html.erb +1 -1
- data/app/views/notifier/manifestation_info.en.text.erb +1 -1
- data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
- data/app/views/picture_files/edit.html.erb +0 -4
- data/app/views/produce_types/index.html.erb +1 -1
- data/app/views/produce_types/show.html.erb +1 -1
- data/app/views/produces/_form.html.erb +1 -1
- data/app/views/realize_types/index.html.erb +1 -1
- data/app/views/realize_types/show.html.erb +1 -1
- data/app/views/realizes/_form.html.erb +1 -1
- data/app/views/resource_import_files/_results.html.erb +0 -6
- data/app/views/resource_import_files/new.html.erb +2 -2
- data/app/views/resource_import_results/index.html.erb +11 -0
- data/app/views/resource_import_results/index.txt.erb +3 -0
- data/app/views/series_statements/_form.html.erb +8 -6
- data/app/views/series_statements/show.html.erb +0 -12
- data/config/locales/translation_en.yml +1 -28
- data/config/locales/translation_ja.yml +3 -30
- data/config/routes.rb +0 -2
- data/db/migrate/20081027150907_create_picture_files.rb +2 -0
- data/db/migrate/20160319144230_create_issn_records.rb +11 -0
- data/db/migrate/20160506144040_create_isbn_records.rb +11 -0
- data/db/migrate/20170116134107_create_issn_record_and_manifestations.rb +11 -0
- data/db/migrate/20170116134120_create_isbn_record_and_manifestations.rb +11 -0
- data/db/migrate/20190102034126_create_doi_records.rb +13 -0
- data/db/migrate/20190311154610_create_periodicals.rb +10 -0
- data/db/migrate/20190312033839_create_periodical_and_manifestations.rb +11 -0
- data/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
- data/lib/enju_biblio/openurl.rb +1 -5
- data/lib/enju_biblio/porta_cql.rb +282 -0
- data/lib/enju_biblio/sru.rb +83 -0
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/enju_biblio.rb +2 -0
- data/lib/generators/enju_biblio/setup/setup_generator.rb +0 -2
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/agent_relationship_types.yml +3 -3
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/agent_types.yml +2 -4
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/carrier_types.yml +8 -26
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/content_types.yml +12 -24
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/create_types.yml +4 -22
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/form_of_works.yml +1 -1
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/frequencies.yml +9 -18
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/languages.yml +2 -4
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/licenses.yml +2 -2
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/manifestation_relationship_types.yml +2 -4
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/medium_of_performances.yml +15 -0
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/produce_types.yml +2 -19
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/realize_types.yml +3 -21
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_isbn_which_is_already_imported/assigns_a_newly_created_import_request_as_import_request.yml +121 -0
- data/spec/controllers/content_types_controller_spec.rb +1 -1
- data/spec/controllers/items_controller_spec.rb +1 -59
- data/spec/controllers/manifestations_controller_spec.rb +19 -49
- data/spec/dummy/app/helpers/application_helper.rb +1 -1
- data/spec/dummy/app/models/user.rb +4 -0
- data/spec/dummy/bin/bundle +1 -1
- data/spec/dummy/bin/setup +1 -3
- data/spec/dummy/bin/update +4 -2
- data/spec/dummy/bin/yarn +3 -3
- data/spec/dummy/config/application.rb +1 -2
- data/spec/dummy/config/database.yml +70 -9
- data/spec/dummy/config/initializers/assets.rb +2 -2
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/002_devise_create_users.rb +1 -0
- data/spec/dummy/db/migrate/113_create_events.rb +2 -4
- data/spec/dummy/db/migrate/154_create_messages.rb +4 -8
- data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +3 -3
- data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +2 -4
- data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -4
- data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +2 -2
- data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +1 -0
- data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140523171309_create_event_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140524135607_create_bookmark_stat_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +1 -1
- data/spec/dummy/db/migrate/20140812153137_create_event_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20151128142913_create_places.rb +14 -0
- data/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb +5 -0
- data/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160815045420_add_most_recent_to_bookmark_stat_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20170116150432_create_jpno_records.rb +10 -0
- data/spec/dummy/db/migrate/20171126072934_create_ndla_records.rb +10 -0
- data/spec/dummy/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107172413_add_constraints_to_most_recent_for_bookmark_stat_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180709023035_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +36 -0
- data/spec/dummy/db/migrate/20180709023036_add_missing_unique_indices.acts_as_taggable_on_engine.rb +26 -0
- data/spec/dummy/db/migrate/20180709023037_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +20 -0
- data/spec/dummy/db/migrate/20180709023038_add_missing_taggable_index.acts_as_taggable_on_engine.rb +15 -0
- data/spec/dummy/db/migrate/20180709023039_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +15 -0
- data/spec/dummy/db/migrate/20180709023040_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb +23 -0
- data/spec/dummy/db/migrate/20180709161346_add_created_at_to_tag.rb +6 -0
- data/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb +5 -0
- data/spec/dummy/db/migrate/20190501043418_create_ndl_bib_id_records.rb +10 -0
- data/spec/dummy/db/migrate/20190508160525_create_retains.rb +10 -0
- data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
- data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
- data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
- data/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
- data/spec/dummy/db/migrate/20190706052525_add_display_name_translations_to_circulation_status.rb +5 -0
- data/spec/dummy/db/schema.rb +335 -221
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/factories/create_types.rb +8 -7
- data/spec/factories/produce_types.rb +8 -7
- data/spec/factories/realize_types.rb +8 -7
- data/spec/factories/series_statement.rb +3 -4
- data/spec/fixtures/agent_relationship_types.yml +8 -7
- data/spec/fixtures/agent_types.yml +11 -10
- data/spec/fixtures/carrier_types.yml +16 -15
- data/spec/fixtures/content_types.yml +20 -31
- data/spec/fixtures/create_types.yml +12 -15
- data/spec/fixtures/creates.yml +0 -2
- data/spec/fixtures/form_of_works.yml +11 -10
- data/spec/fixtures/frequencies.yml +17 -25
- data/spec/fixtures/items.yml +11 -12
- data/spec/fixtures/languages.yml +11 -11
- data/spec/fixtures/libraries.yml +30 -30
- data/spec/fixtures/library_groups.yml +11 -6
- data/spec/fixtures/licenses.yml +8 -7
- data/spec/fixtures/manifestation_relationship_types.yml +12 -11
- data/spec/fixtures/manifestations.yml +0 -1
- data/spec/fixtures/medium_of_performances.yml +10 -9
- data/spec/fixtures/picture_files.yml +2 -0
- data/spec/fixtures/produce_types.yml +10 -11
- data/spec/fixtures/produces.yml +0 -2
- data/spec/fixtures/profiles.yml +8 -5
- data/spec/fixtures/realize_types.yml +11 -13
- data/spec/fixtures/realizes.yml +0 -2
- data/spec/fixtures/request_status_types.yml +14 -14
- data/spec/fixtures/request_types.yml +13 -13
- data/spec/fixtures/resource_export_files.yml +1 -1
- data/spec/fixtures/resource_import_results.yml +2 -2
- data/spec/fixtures/roles.yml +22 -5
- data/spec/fixtures/shelves.yml +16 -16
- data/spec/fixtures/user_groups.yml +12 -12
- data/spec/fixtures/user_has_roles.yml +3 -4
- data/spec/fixtures/users.yml +0 -3
- data/spec/models/agent_relationship_type_spec.rb +8 -7
- data/spec/models/agent_type_spec.rb +8 -7
- data/spec/models/carrier_type_spec.rb +12 -11
- data/spec/models/content_type_spec.rb +8 -7
- data/spec/models/create_type_spec.rb +8 -7
- data/spec/models/doi_record_spec.rb +19 -0
- data/spec/models/form_of_work_spec.rb +8 -7
- data/spec/models/frequency_spec.rb +8 -7
- data/spec/models/item_spec.rb +0 -7
- data/spec/models/language_spec.rb +10 -9
- data/spec/models/license_spec.rb +8 -7
- data/spec/models/manifestation_relationship_type_spec.rb +8 -7
- data/spec/models/manifestation_spec.rb +81 -24
- data/spec/models/medium_of_performance_spec.rb +8 -7
- data/spec/models/periodical_and_manifestation_spec.rb +17 -0
- data/spec/models/periodical_spec.rb +16 -0
- data/spec/models/picture_file_spec.rb +2 -0
- data/spec/models/produce_type_spec.rb +8 -7
- data/spec/models/realize_type_spec.rb +8 -7
- data/spec/models/resource_export_file_spec.rb +9 -62
- data/spec/models/resource_import_file_spec.rb +14 -44
- data/spec/rails_helper.rb +8 -4
- data/spec/system/manifestations_spec.rb +0 -30
- data/spec/views/items/index.html.erb_spec.rb +6 -7
- data/spec/views/manifestations/index.html.erb_spec.rb +1 -1
- data/spec/views/manifestations/index.rdf.builder_spec.rb +1 -0
- data/spec/views/manifestations/{index.txt.ruby_spec.rb → index.txt.erb_spec.rb} +1 -1
- data/spec/views/manifestations/{show.txt.ruby_spec.rb → show.txt.erb_spec.rb} +2 -2
- data/spec/views/resource_import_results/show.html.erb_spec.rb +1 -1
- metadata +560 -718
- data/app/controllers/item_custom_properties_controller.rb +0 -69
- data/app/controllers/manifestation_custom_properties_controller.rb +0 -69
- data/app/models/item_custom_property.rb +0 -18
- data/app/models/item_custom_value.rb +0 -17
- data/app/models/manifestation_custom_property.rb +0 -18
- data/app/models/manifestation_custom_value.rb +0 -17
- data/app/policies/item_custom_property_policy.rb +0 -21
- data/app/policies/manifestation_custom_property_policy.rb +0 -21
- data/app/views/agent_import_results/index.txt.ruby +0 -5
- data/app/views/item_custom_properties/_form.html.erb +0 -32
- data/app/views/item_custom_properties/edit.html.erb +0 -13
- data/app/views/item_custom_properties/index.html.erb +0 -43
- data/app/views/item_custom_properties/new.html.erb +0 -12
- data/app/views/item_custom_properties/show.html.erb +0 -28
- data/app/views/items/_item.json.jbuilder +0 -17
- data/app/views/items/index.json.jbuilder +0 -5
- data/app/views/items/show.json.jbuilder +0 -1
- data/app/views/manifestation_custom_properties/_form.html.erb +0 -32
- data/app/views/manifestation_custom_properties/edit.html.erb +0 -13
- data/app/views/manifestation_custom_properties/index.html.erb +0 -43
- data/app/views/manifestation_custom_properties/new.html.erb +0 -12
- data/app/views/manifestation_custom_properties/show.html.erb +0 -28
- data/app/views/manifestations/index.txt.ruby +0 -7
- data/app/views/manifestations/show.json.jbuilder +0 -2
- data/app/views/manifestations/show.txt.ruby +0 -5
- data/app/views/resource_import_results/index.txt.ruby +0 -5
- data/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
- data/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
- data/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
- data/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
- data/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
- data/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/agents.yml +0 -19
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_import_custom_values.yml +0 -121
- data/spec/cassette_library/resource_import_results/index_txt_ruby/renders_a_list_of_resource_import_results.yml +0 -121
- data/spec/controllers/item_custom_properties_controller_spec.rb +0 -449
- data/spec/controllers/manifestation_custom_properties_controller_spec.rb +0 -449
- data/spec/dummy/db/migrate/20081117143156_create_inventory_files.rb +0 -18
- data/spec/dummy/db/migrate/20081117143455_create_inventories.rb +0 -17
- data/spec/dummy/db/migrate/20090706125521_add_attachments_inventory_to_inventory_file.rb +0 -15
- data/spec/dummy/db/migrate/20091202124834_create_versions.rb +0 -18
- data/spec/dummy/db/migrate/20100525171356_acts_as_taggable_on_migration.rb +0 -30
- data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +0 -5
- data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +0 -6
- data/spec/dummy/db/migrate/20120413100431_add_fingerprint_to_inventory_file.rb +0 -5
- data/spec/dummy/db/migrate/20150421023923_create_identities.rb +0 -14
- data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +0 -5
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -18
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +0 -22
- data/spec/factories/item_custom_property.rb +0 -6
- data/spec/factories/item_custom_value.rb +0 -6
- data/spec/factories/manifestation_custom_property.rb +0 -6
- data/spec/factories/manifestation_custom_value.rb +0 -6
- data/spec/fixtures/carrier_type_has_checkout_types.yml +0 -31
- data/spec/fixtures/checkout_stat_has_manifestations.yml +0 -24
- data/spec/fixtures/checkout_stat_has_users.yml +0 -24
- data/spec/fixtures/checkout_types.yml +0 -34
- data/spec/fixtures/circulation_statuses.yml +0 -136
- data/spec/fixtures/inventory_files.yml +0 -40
- data/spec/fixtures/item_custom_properties.yml +0 -24
- data/spec/fixtures/manifestation_checkout_stats.yml +0 -29
- data/spec/fixtures/manifestation_custom_properties.yml +0 -24
- data/spec/fixtures/manifestation_reserve_stats.yml +0 -29
- data/spec/fixtures/reserve_stat_has_manifestations.yml +0 -24
- data/spec/fixtures/reserve_stat_has_users.yml +0 -24
- data/spec/fixtures/reserve_transitions.yml +0 -104
- data/spec/fixtures/reserves.yml +0 -143
- data/spec/fixtures/use_restrictions.yml +0 -93
- data/spec/fixtures/user_checkout_stats.yml +0 -28
- data/spec/fixtures/user_group_has_checkout_types.yml +0 -111
- data/spec/fixtures/user_reserve_stats.yml +0 -28
- data/spec/models/item_custom_property_spec.rb +0 -18
- data/spec/models/item_custom_value_spec.rb +0 -17
- data/spec/models/manifestation_custom_property_spec.rb +0 -18
- data/spec/models/manifestation_custom_value_spec.rb +0 -17
- data/spec/requests/item_custom_properties_spec.rb +0 -129
- data/spec/requests/manifestation_custom_properties_spec.rb +0 -129
- data/spec/routing/item_custom_properties_routing_spec.rb +0 -38
- data/spec/routing/manifestation_custom_properties_routing_spec.rb +0 -38
- data/spec/system/items_spec.rb +0 -121
- data/spec/system/series_statements_spec.rb +0 -16
- data/spec/views/agent_import_results/index.html.erb_spec.rb +0 -29
- data/spec/views/agent_import_results/index.txt.ruby_spec.rb +0 -20
- data/spec/views/agent_import_results/show.html.erb_spec.rb +0 -24
- data/spec/views/item_custom_properties/edit.html.erb_spec.rb +0 -21
- data/spec/views/item_custom_properties/index.html.erb_spec.rb +0 -25
- data/spec/views/item_custom_properties/new.html.erb_spec.rb +0 -21
- data/spec/views/item_custom_properties/show.html.erb_spec.rb +0 -16
- data/spec/views/items/index.json.jbuilder_spec.rb +0 -15
- data/spec/views/items/show.json.jbuilder_spec.rb +0 -15
- data/spec/views/manifestation_custom_properties/edit.html.erb_spec.rb +0 -21
- data/spec/views/manifestation_custom_properties/index.html.erb_spec.rb +0 -25
- data/spec/views/manifestation_custom_properties/new.html.erb_spec.rb +0 -21
- data/spec/views/manifestation_custom_properties/show.html.erb_spec.rb +0 -16
- data/spec/views/manifestations/show.json.jbuilder_spec.rb +0 -16
- data/spec/views/resource_import_results/index.txt.ruby_spec.rb +0 -22
@@ -30,11 +30,13 @@ class ResourceExportFile < ApplicationRecord
|
|
30
30
|
def export!
|
31
31
|
transition_to!(:started)
|
32
32
|
role_name = user.try(:role).try(:name)
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
tempfile = Tempfile.new(['resource_export_file_', '.txt'])
|
34
|
+
tempfile.puts(Manifestation.csv_header(role_name, col_sep: "\t"))
|
35
|
+
Manifestation.find_each do |manifestation|
|
36
|
+
tempfile.puts(manifestation.to_csv(format: :txt, role: role_name))
|
37
|
+
end
|
38
|
+
tempfile.close
|
39
|
+
self.resource_export = File.new(tempfile.path, "r")
|
38
40
|
save!
|
39
41
|
transition_to!(:completed)
|
40
42
|
mailer = ResourceExportMailer.completed(self)
|
@@ -64,7 +66,7 @@ end
|
|
64
66
|
# user_id :integer
|
65
67
|
# resource_export_file_name :string
|
66
68
|
# resource_export_content_type :string
|
67
|
-
# resource_export_file_size :
|
69
|
+
# resource_export_file_size :bigint
|
68
70
|
# resource_export_updated_at :datetime
|
69
71
|
# executed_at :datetime
|
70
72
|
# created_at :datetime
|
@@ -6,7 +6,7 @@ class ResourceExportFileStateMachine
|
|
6
6
|
state :completed
|
7
7
|
state :failed
|
8
8
|
|
9
|
-
transition from: :pending, to:
|
9
|
+
transition from: :pending, to: :started
|
10
10
|
transition from: :started, to: [:completed, :failed]
|
11
11
|
|
12
12
|
after_transition(from: :pending, to: :started) do |resource_export_file|
|
@@ -76,13 +76,12 @@ class ResourceImportFile < ApplicationRecord
|
|
76
76
|
#end
|
77
77
|
row_num = 1
|
78
78
|
|
79
|
-
ResourceImportResult.create!(resource_import_file_id: id, body:
|
79
|
+
ResourceImportResult.create!(resource_import_file_id: id, body: rows.headers.join("\t"))
|
80
80
|
rows.each do |row|
|
81
81
|
row_num += 1
|
82
|
-
import_result = ResourceImportResult.
|
82
|
+
import_result = ResourceImportResult.create!(resource_import_file_id: id, body: row.fields.join("\t"))
|
83
83
|
if row['dummy'].to_s.strip.present?
|
84
84
|
import_result.error_message = "line #{row_num}: #{I18n.t('import.dummy')}"
|
85
|
-
import_result.body = ([nil, nil] + row.fields).join("\t")
|
86
85
|
import_result.save!
|
87
86
|
next
|
88
87
|
end
|
@@ -93,7 +92,6 @@ class ResourceImportFile < ApplicationRecord
|
|
93
92
|
import_result.item = item
|
94
93
|
import_result.manifestation = item.manifestation
|
95
94
|
import_result.error_message = "line #{row_num}: #{I18n.t('import.item_found')}"
|
96
|
-
import_result.body = ([item.manifestation.id, item.id] + row.fields).join("\t")
|
97
95
|
import_result.save!
|
98
96
|
num[:item_found] += 1
|
99
97
|
next
|
@@ -189,13 +187,8 @@ class ResourceImportFile < ApplicationRecord
|
|
189
187
|
import_result.manifestation = manifestation
|
190
188
|
|
191
189
|
if manifestation
|
192
|
-
ResourceImportFile.import_manifestation_custom_value(row, manifestation).each do |value|
|
193
|
-
value.update!(manifestation: manifestation)
|
194
|
-
end
|
195
|
-
|
196
|
-
item = nil
|
197
190
|
if item_identifier.present? || row['shelf'].present? || row['call_number'].present?
|
198
|
-
item = create_item(row, manifestation)
|
191
|
+
import_result.item = create_item(row, manifestation)
|
199
192
|
else
|
200
193
|
if manifestation.fulltext_content?
|
201
194
|
item = create_item(row, manifestation)
|
@@ -207,21 +200,17 @@ class ResourceImportFile < ApplicationRecord
|
|
207
200
|
end
|
208
201
|
num[:failed] += 1
|
209
202
|
end
|
210
|
-
|
211
|
-
if item
|
212
|
-
ResourceImportFile.import_item_custom_value(row, item).each do |value|
|
213
|
-
value.update!(item: item)
|
214
|
-
end
|
215
|
-
|
216
|
-
import_result.item = item
|
217
|
-
end
|
218
203
|
else
|
219
204
|
num[:failed] += 1
|
220
205
|
end
|
221
206
|
|
222
|
-
import_result.body = ([manifestation.try(:id), item.try(:id)] + row.fields).join("\t")
|
223
207
|
import_result.save!
|
224
|
-
num[:item_imported] +=
|
208
|
+
num[:item_imported] +=1 if import_result.item
|
209
|
+
|
210
|
+
if row_num % 50 == 0
|
211
|
+
Sunspot.commit
|
212
|
+
GC.start
|
213
|
+
end
|
225
214
|
end
|
226
215
|
|
227
216
|
Sunspot.commit
|
@@ -322,24 +311,55 @@ class ResourceImportFile < ApplicationRecord
|
|
322
311
|
rows.each do |row|
|
323
312
|
row_num += 1
|
324
313
|
import_result = ResourceImportResult.create!(resource_import_file_id: id, body: row.fields.join("\t"))
|
325
|
-
|
326
|
-
|
327
|
-
item = Item.find_by(id: row['item_id'].to_s.strip) if row['item_id'].to_s.strip.present?
|
328
|
-
end
|
329
|
-
|
314
|
+
item_identifier = row['item_identifier'].to_s.strip
|
315
|
+
item = Item.find_by(item_identifier: item_identifier) if item_identifier.present?
|
330
316
|
if item
|
331
317
|
if item.manifestation
|
332
318
|
fetch(row, edit_mode: 'update')
|
333
|
-
item = update_item(item, row)
|
334
319
|
end
|
335
|
-
|
336
|
-
|
337
|
-
|
320
|
+
shelf = Shelf.find_by(name: row['shelf'].to_s.strip)
|
321
|
+
bookstore = Bookstore.find_by(name: row['bookstore'])
|
322
|
+
required_role = Role.find_by(name: row['required_role'])
|
323
|
+
|
324
|
+
item.shelf = shelf if shelf
|
325
|
+
item.bookstore = bookstore if bookstore
|
326
|
+
item.required_role = required_role if required_role
|
327
|
+
|
328
|
+
acquired_at = Time.zone.parse(row['acquired_at']) rescue nil
|
329
|
+
binded_at = Time.zone.parse(row['binded_at']) rescue nil
|
330
|
+
item.acquired_at = acquired_at if acquired_at
|
331
|
+
item.binded_at = binded_at if binded_at
|
332
|
+
|
333
|
+
if defined?(EnjuCirculation)
|
334
|
+
circulation_status = CirculationStatus.find_by(name: row['circulation_status'])
|
335
|
+
checkout_type = CheckoutType.find_by(name: row['checkout_type'])
|
336
|
+
use_restriction = UseRestriction.find_by(name: row['use_restriction'].to_s.strip)
|
337
|
+
item.circulation_status = circulation_status if circulation_status
|
338
|
+
item.checkout_type = checkout_type if checkout_type
|
339
|
+
item.use_restriction = use_restriction if use_restriction
|
338
340
|
end
|
339
|
-
|
340
|
-
|
341
|
+
|
342
|
+
item_columns = %w(
|
343
|
+
call_number
|
344
|
+
binding_item_identifier binding_call_number binded_at
|
345
|
+
)
|
346
|
+
item_columns.each do |column|
|
347
|
+
if row[column].present?
|
348
|
+
item.assign_attributes(:"#{column}" => row[column])
|
349
|
+
end
|
341
350
|
end
|
342
351
|
|
352
|
+
item.price = row['item_price'] if row['item_price'].present?
|
353
|
+
item.note = row['item_note'].try(:gsub, /\\n/, "\n") if row['item_note'].present?
|
354
|
+
item.url = row['item_url'] if row['item_url'].present?
|
355
|
+
|
356
|
+
if row['include_supplements']
|
357
|
+
if %w(t true).include?(row['include_supplements'].downcase.strip)
|
358
|
+
item.include_supplements = true
|
359
|
+
else
|
360
|
+
item.include_supplements = false if item.include_supplements
|
361
|
+
end
|
362
|
+
end
|
343
363
|
item.manifestation.reload
|
344
364
|
item.save!
|
345
365
|
import_result.item = item
|
@@ -351,9 +371,6 @@ class ResourceImportFile < ApplicationRecord
|
|
351
371
|
end
|
352
372
|
if manifestation
|
353
373
|
fetch(row, edit_mode: 'update')
|
354
|
-
ResourceImportFile.import_manifestation_custom_value(row, manifestation).each do |value|
|
355
|
-
value.update!(manifestation: manifestation)
|
356
|
-
end
|
357
374
|
import_result.manifestation = manifestation
|
358
375
|
end
|
359
376
|
end
|
@@ -379,11 +396,8 @@ class ResourceImportFile < ApplicationRecord
|
|
379
396
|
|
380
397
|
rows.each do |row|
|
381
398
|
row_num += 1
|
382
|
-
|
383
|
-
|
384
|
-
item = Item.find_by(id: row['item_id'].to_s.strip) if row['item_id'].to_s.strip.present?
|
385
|
-
end
|
386
|
-
|
399
|
+
item_identifier = row['item_identifier'].to_s.strip
|
400
|
+
item = Item.find_by(item_identifier: item_identifier)
|
387
401
|
if item
|
388
402
|
item.destroy if item.removable?
|
389
403
|
end
|
@@ -407,9 +421,10 @@ class ResourceImportFile < ApplicationRecord
|
|
407
421
|
row_num = 1
|
408
422
|
|
409
423
|
rows.each do |row|
|
410
|
-
|
424
|
+
item_identifier = row['item_identifier'].to_s.strip
|
425
|
+
item = Item.find_by(item_identifier: item_identifier)
|
411
426
|
unless item
|
412
|
-
item = Item.find_by(id: row['item_id'].to_s.strip)
|
427
|
+
item = Item.find_by(id: row['item_id'].to_s.strip)
|
413
428
|
end
|
414
429
|
|
415
430
|
manifestation_identifier = row['manifestation_identifier'].to_s.strip
|
@@ -466,9 +481,6 @@ class ResourceImportFile < ApplicationRecord
|
|
466
481
|
use_restriction include_supplements item_note item_url
|
467
482
|
dummy
|
468
483
|
)
|
469
|
-
header_columns += ManifestationCustomProperty.order(:position).pluck(:name).map{|c| "manifestation:#{c}"}
|
470
|
-
header_columns += ItemCustomProperty.order(:position).pluck(:name).map{|c| "item:#{c}"}
|
471
|
-
|
472
484
|
if defined?(EnjuSubject)
|
473
485
|
header_columns += ClassificationType.order(:position).pluck(:name).map{|c| "classification:#{c}"}
|
474
486
|
header_columns += SubjectHeadingType.order(:position).pluck(:name).map{|s| "subject:#{s}"}
|
@@ -565,68 +577,12 @@ class ResourceImportFile < ApplicationRecord
|
|
565
577
|
item
|
566
578
|
end
|
567
579
|
|
568
|
-
def update_item(item, row)
|
569
|
-
shelf = Shelf.find_by(name: row['shelf'].to_s.strip)
|
570
|
-
bookstore = Bookstore.find_by(name: row['bookstore'])
|
571
|
-
required_role = Role.find_by(name: row['required_role'])
|
572
|
-
|
573
|
-
item.shelf = shelf if shelf
|
574
|
-
item.bookstore = bookstore if bookstore
|
575
|
-
item.required_role = required_role if required_role
|
576
|
-
|
577
|
-
acquired_at = Time.zone.parse(row['acquired_at']) rescue nil
|
578
|
-
binded_at = Time.zone.parse(row['binded_at']) rescue nil
|
579
|
-
item.acquired_at = acquired_at if acquired_at
|
580
|
-
item.binded_at = binded_at if binded_at
|
581
|
-
|
582
|
-
if defined?(EnjuCirculation)
|
583
|
-
circulation_status = CirculationStatus.find_by(name: row['circulation_status'])
|
584
|
-
checkout_type = CheckoutType.find_by(name: row['checkout_type'])
|
585
|
-
use_restriction = UseRestriction.find_by(name: row['use_restriction'].to_s.strip)
|
586
|
-
item.circulation_status = circulation_status if circulation_status
|
587
|
-
item.checkout_type = checkout_type if checkout_type
|
588
|
-
item.use_restriction = use_restriction if use_restriction
|
589
|
-
end
|
590
|
-
|
591
|
-
item_columns = %w(
|
592
|
-
call_number
|
593
|
-
binding_item_identifier binding_call_number binded_at
|
594
|
-
)
|
595
|
-
item_columns.each do |column|
|
596
|
-
if row[column].present?
|
597
|
-
item.assign_attributes(:"#{column}" => row[column])
|
598
|
-
end
|
599
|
-
end
|
600
|
-
|
601
|
-
item.price = row['item_price'] if row['item_price'].present?
|
602
|
-
item.note = row['item_note'].try(:gsub, /\\n/, "\n") if row['item_note'].present?
|
603
|
-
item.url = row['item_url'] if row['item_url'].present?
|
604
|
-
|
605
|
-
if row['include_supplements']
|
606
|
-
if %w(t true).include?(row['include_supplements'].downcase.strip)
|
607
|
-
item.include_supplements = true
|
608
|
-
else
|
609
|
-
item.include_supplements = false if item.include_supplements
|
610
|
-
end
|
611
|
-
end
|
612
|
-
|
613
|
-
item
|
614
|
-
end
|
615
|
-
|
616
580
|
def fetch(row, options = {edit_mode: 'create'})
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
item = Item.find_by(item_identifier: row['item_identifier'].to_s.strip)
|
623
|
-
end
|
624
|
-
if row['item_id'].to_s.strip.present?
|
625
|
-
item = Item.find_by(id: row['item_id'].to_s.strip)
|
626
|
-
end
|
627
|
-
|
628
|
-
manifestation = item.manifestation if item
|
629
|
-
|
581
|
+
case options[:edit_mode]
|
582
|
+
when 'create'
|
583
|
+
manifestation = nil
|
584
|
+
when 'update'
|
585
|
+
manifestation = Item.find_by(item_identifier: row['item_identifier'].to_s.strip).try(:manifestation)
|
630
586
|
unless manifestation
|
631
587
|
manifestation_identifier = row['manifestation_identifier'].to_s.strip
|
632
588
|
manifestation = Manifestation.find_by(manifestation_identifier: manifestation_identifier) if manifestation_identifier
|
@@ -807,7 +763,6 @@ class ResourceImportFile < ApplicationRecord
|
|
807
763
|
manifestation.set_agent_role_type(publishers_list, scope: :publisher)
|
808
764
|
end
|
809
765
|
end
|
810
|
-
|
811
766
|
manifestation
|
812
767
|
end
|
813
768
|
|
@@ -822,7 +777,7 @@ class ResourceImportFile < ApplicationRecord
|
|
822
777
|
def set_identifier(row)
|
823
778
|
identifiers = []
|
824
779
|
%w(isbn issn doi jpno ncid).each do |id_type|
|
825
|
-
if row[id_type
|
780
|
+
if row["#{id_type}"].present?
|
826
781
|
row[id_type].split(/\/\//).each do |identifier_s|
|
827
782
|
import_id = Identifier.new(body: identifier_s)
|
828
783
|
identifier_type = IdentifierType.find_by(name: id_type)
|
@@ -834,52 +789,6 @@ class ResourceImportFile < ApplicationRecord
|
|
834
789
|
end
|
835
790
|
identifiers
|
836
791
|
end
|
837
|
-
|
838
|
-
def self.import_manifestation_custom_value(row, manifestation)
|
839
|
-
values = []
|
840
|
-
ManifestationCustomProperty.order(:position).pluck(:name).map{|c| "manifestation:#{c}"}.each do |column_name|
|
841
|
-
value = nil
|
842
|
-
property = column_name.split(':').last
|
843
|
-
next if row[column_name].blank?
|
844
|
-
if manifestation
|
845
|
-
value = manifestation.manifestation_custom_values.find_by(manifestation_custom_property: property)
|
846
|
-
end
|
847
|
-
|
848
|
-
if value
|
849
|
-
value.value = row[column_name]
|
850
|
-
else
|
851
|
-
value = ManifestationCustomValue.new(
|
852
|
-
manifestation_custom_property: ManifestationCustomProperty.find_by(name: property),
|
853
|
-
value: row[column_name]
|
854
|
-
)
|
855
|
-
end
|
856
|
-
values << value
|
857
|
-
end
|
858
|
-
values
|
859
|
-
end
|
860
|
-
|
861
|
-
def self.import_item_custom_value(row, item)
|
862
|
-
values = []
|
863
|
-
ItemCustomProperty.order(:position).pluck(:name).map{|c| "item:#{c}"}.each do |column_name|
|
864
|
-
value = nil
|
865
|
-
property = column_name.split(':').last
|
866
|
-
next if row[column_name].blank?
|
867
|
-
if item
|
868
|
-
value = item.item_custom_values.find_by(item_custom_property: property)
|
869
|
-
end
|
870
|
-
|
871
|
-
if value
|
872
|
-
value.value = row[column_name]
|
873
|
-
else
|
874
|
-
value = ItemCustomValue.new(
|
875
|
-
item_custom_property: ItemCustomProperty.find_by(name: property),
|
876
|
-
value: row[column_name]
|
877
|
-
)
|
878
|
-
end
|
879
|
-
values << value
|
880
|
-
end
|
881
|
-
values
|
882
|
-
end
|
883
792
|
end
|
884
793
|
|
885
794
|
# == Schema Information
|
@@ -24,7 +24,7 @@
|
|
24
24
|
</td>
|
25
25
|
<td><%= agent_relationship_type.name -%></td>
|
26
26
|
<td>
|
27
|
-
<%= link_to agent_relationship_type.display_name
|
27
|
+
<%= link_to agent_relationship_type.display_name, agent_relationship_type -%>
|
28
28
|
<br />
|
29
29
|
<%= agent_relationship_type.note %>
|
30
30
|
</td>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
</div>
|
24
24
|
<div class="field">
|
25
25
|
<%= f.label :agent_relationship_type_id %><br />
|
26
|
-
<%= f.select(:agent_relationship_type_id, @agent_relationship_types.collect{|r| [r.display_name
|
26
|
+
<%= f.select(:agent_relationship_type_id, @agent_relationship_types.collect{|r| [r.display_name, r.id]}) -%>
|
27
27
|
</div>
|
28
28
|
<div class="actions">
|
29
29
|
<%= f.submit %>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<%= link_to agent.full_name, agent -%><br />
|
4
4
|
<%= agent.full_name_transcription -%>
|
5
5
|
</td>
|
6
|
-
<td><%= agent.agent_type.display_name
|
6
|
+
<td><%= agent.agent_type.display_name -%></td>
|
7
7
|
<td>
|
8
8
|
<%- if policy(agent).destroy? -%>
|
9
9
|
<%= link_to t('page.edit'), edit_agent_path(agent) -%>
|
@@ -3,14 +3,14 @@
|
|
3
3
|
<%- @agent.parents.each do |agent_relationship| -%>
|
4
4
|
<li>
|
5
5
|
[P]
|
6
|
-
(<%= agent_relationship.agent_relationship_type.display_name
|
6
|
+
(<%= agent_relationship.agent_relationship_type.display_name -%>)
|
7
7
|
<%= link_to agent_relationship.parent.full_name, agent_relationship.parent -%>
|
8
8
|
</li>
|
9
9
|
<%- end -%>
|
10
10
|
<%- @agent.children.each do |agent_relationship| -%>
|
11
11
|
<li>
|
12
12
|
[P]
|
13
|
-
(<%= agent_relationship.agent_relationship_type.display_name
|
13
|
+
(<%= agent_relationship.agent_relationship_type.display_name -%>)
|
14
14
|
<%= link_to agent_relationship.child.full_name, agent_relationship.child -%>
|
15
15
|
</li>
|
16
16
|
<%- end -%>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<div class="field">
|
6
6
|
<%= f.label t('activerecord.models.agent_type') -%>
|
7
|
-
<%= f.select(:agent_type_id, @agent_types.collect{|p| [p.display_name
|
7
|
+
<%= f.select(:agent_type_id, @agent_types.collect{|p| [p.display_name, p.id]}) -%>
|
8
8
|
</div>
|
9
9
|
|
10
10
|
<div class="field">
|
@@ -52,12 +52,12 @@
|
|
52
52
|
|
53
53
|
<div class="field">
|
54
54
|
<%= f.label t('activerecord.models.language') -%>
|
55
|
-
<%= f.select(:language_id, @languages.collect{|l| [l.display_name
|
55
|
+
<%= f.select(:language_id, @languages.collect{|l| [l.display_name, l.id]}) -%>
|
56
56
|
</div>
|
57
57
|
|
58
58
|
<div class="field">
|
59
59
|
<%= f.label t('activerecord.models.country') -%>
|
60
|
-
<%= f.select(:country_id, @countries.collect{|c| [c.display_name
|
60
|
+
<%= f.select(:country_id, @countries.collect{|c| [c.display_name, c.id]}) -%>
|
61
61
|
</div>
|
62
62
|
|
63
63
|
<div class="field">
|
@@ -72,7 +72,7 @@
|
|
72
72
|
|
73
73
|
<div class="field">
|
74
74
|
<%= f.label t('role.required_role') -%>
|
75
|
-
<%= f.select(:required_role_id, @roles.collect{|r| [r.display_name
|
75
|
+
<%= f.select(:required_role_id, @roles.collect{|r| [r.display_name, r.id]}) -%>
|
76
76
|
</div>
|
77
77
|
|
78
78
|
<div class="actions">
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<%= link_to agent.full_name, agent -%><br />
|
33
33
|
<%= agent.full_name_transcription -%>
|
34
34
|
</td>
|
35
|
-
<td><%= agent.agent_type.display_name
|
35
|
+
<td><%= agent.agent_type.display_name -%></td>
|
36
36
|
<td><%=l agent.date_of_birth if agent.date_of_birth -%></td>
|
37
37
|
<td>
|
38
38
|
<%- if policy(agent).destroy? -%>
|
@@ -26,7 +26,7 @@
|
|
26
26
|
<%- @agents.each do |agent| -%>
|
27
27
|
<tr class="line<%= cycle("0", "1") -%>">
|
28
28
|
<td><%= link_to agent.full_name, agent_merge_list_agent_path(@agent_merge_list, agent) -%></td>
|
29
|
-
<td><%= agent.agent_type.display_name
|
29
|
+
<td><%= agent.agent_type.display_name -%></td>
|
30
30
|
<td><%=l agent.date_of_birth if agent.date_of_birth -%></td>
|
31
31
|
<td>
|
32
32
|
<%- if policy(agent).destroy? -%>
|
@@ -30,8 +30,8 @@
|
|
30
30
|
<%- @agents.each do |agent| -%>
|
31
31
|
<tr class="line<%= cycle("0", "1") -%>">
|
32
32
|
<td><%= link_to agent.full_name, agent -%></td>
|
33
|
-
<td><%= expression.realized(agent).realize_type.display_name
|
34
|
-
<td><%= agent.agent_type.display_name
|
33
|
+
<td><%= expression.realized(agent).realize_type.display_name if params[:mode] != 'add' and expression.realized(agent).try(:realize_type) -%></td>
|
34
|
+
<td><%= agent.agent_type.display_name -%></td>
|
35
35
|
<td>
|
36
36
|
<%- if policy(agent).destroy? -%>
|
37
37
|
<%- if params[:mode] == 'add' -%>
|
@@ -26,8 +26,8 @@
|
|
26
26
|
<%- @agents.each do |agent| -%>
|
27
27
|
<tr class="line<%= cycle("0", "1") -%>">
|
28
28
|
<td><%= link_to agent.full_name, agent -%></td>
|
29
|
-
<td><%= manifestation.produced(agent).produce_type.display_name
|
30
|
-
<td><%= agent.agent_type.display_name
|
29
|
+
<td><%= manifestation.produced(agent).produce_type.display_name if params[:mode] != 'add' and manifestation.produced(agent).try(:produce_type) -%></td>
|
30
|
+
<td><%= agent.agent_type.display_name -%></td>
|
31
31
|
<td>
|
32
32
|
<%- if policy(agent).destroy? -%>
|
33
33
|
<%- if params[:mode] == 'add' -%>
|
@@ -34,8 +34,8 @@
|
|
34
34
|
<%- @agents.each do |agent| -%>
|
35
35
|
<tr class="line<%= cycle("0", "1") -%>">
|
36
36
|
<td><%= link_to agent.full_name, agent -%></td>
|
37
|
-
<td><%= work.created(agent).create_type.display_name
|
38
|
-
<td><%= agent.agent_type.display_name
|
37
|
+
<td><%= work.created(agent).create_type.display_name if params[:mode] != 'add' and work.created(agent).try(:create_type) -%></td>
|
38
|
+
<td><%= agent.agent_type.display_name -%></td>
|
39
39
|
<td>
|
40
40
|
<%- if policy(agent).destroy? -%>
|
41
41
|
<%- if params[:mode] == 'add' -%>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
atom_feed(url: agents_url(format: :atom)) do |feed|
|
2
|
-
feed.title t('agent.library_group_agent', library_group_name: @library_group.display_name
|
2
|
+
feed.title t('agent.library_group_agent', library_group_name: @library_group.display_name)
|
3
3
|
feed.updated(@agents.first ? @agents.first.created_at : Time.zone.now)
|
4
4
|
|
5
5
|
@agents.each do |agent|
|
@@ -3,12 +3,12 @@ xml.rss('version' => "2.0",
|
|
3
3
|
'xmlns:opensearch' => "http://a9.com/-/spec/opensearch/1.1/",
|
4
4
|
'xmlns:atom' => "http://www.w3.org/2005/Atom"){
|
5
5
|
xml.channel{
|
6
|
-
xml.title t('agent.library_group_agent', library_group_name: @library_group.display_name
|
7
|
-
xml.link "#{request.protocol}#{request.host_with_port}#{url_for(
|
6
|
+
xml.title t('agent.library_group_agent', library_group_name: @library_group.display_name)
|
7
|
+
xml.link "#{request.protocol}#{request.host_with_port}#{url_for(filtered_params.merge(format: nil, only_path: true))}"
|
8
8
|
xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
|
9
9
|
xml.language @locale.to_s
|
10
10
|
xml.ttl "60"
|
11
|
-
xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(
|
11
|
+
xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(filtered_params.merge(format: :rss, only_path: true))}"
|
12
12
|
xml.tag! "atom:link", rel: 'alternate', href: agents_url
|
13
13
|
xml.tag! "atom:link", rel: 'search', type: 'application/opensearchdescription+xml', href: page_opensearch_url
|
14
14
|
if params[:query].present?
|
@@ -20,7 +20,7 @@
|
|
20
20
|
</tr>
|
21
21
|
<tr>
|
22
22
|
<td><strong><%= t('activerecord.models.agent_type') -%>:</strong></td>
|
23
|
-
<td><%= @agent.agent_type.display_name
|
23
|
+
<td><%= @agent.agent_type.display_name -%></td>
|
24
24
|
</tr>
|
25
25
|
<tr>
|
26
26
|
<td><strong><%= t('activerecord.attributes.agent.email') -%>:</strong></td>
|
@@ -44,7 +44,7 @@
|
|
44
44
|
</tr>
|
45
45
|
<tr>
|
46
46
|
<td><strong><%= t('activerecord.models.language') -%>:</strong></td>
|
47
|
-
<td><%= @agent.language.display_name
|
47
|
+
<td><%= @agent.language.display_name -%></td>
|
48
48
|
</tr>
|
49
49
|
<tr>
|
50
50
|
<td><strong><%= t('activerecord.attributes.agent.note') -%>:</strong></td>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
</tr>
|
30
30
|
<tr>
|
31
31
|
<td><strong><%= t('activerecord.models.agent_type') -%>:</strong></td>
|
32
|
-
<td><%= @agent.agent_type.display_name
|
32
|
+
<td><%= @agent.agent_type.display_name -%></td>
|
33
33
|
</tr>
|
34
34
|
<tr>
|
35
35
|
<td><strong><%= t('activerecord.attributes.agent.email') -%>:</strong></td>
|
@@ -53,7 +53,7 @@
|
|
53
53
|
</tr>
|
54
54
|
<tr>
|
55
55
|
<td><strong><%= t('activerecord.models.language') -%>:</strong></td>
|
56
|
-
<td><%= @agent.language.display_name
|
56
|
+
<td><%= @agent.language.display_name -%></td>
|
57
57
|
</tr>
|
58
58
|
<tr>
|
59
59
|
<td><strong><%= t('activerecord.attributes.agent.note') -%>:</strong></td>
|
@@ -23,11 +23,11 @@
|
|
23
23
|
<%- end -%>
|
24
24
|
</td>
|
25
25
|
<td>
|
26
|
-
<%= image_tag(carrier_type_path(carrier_type, format: :download), size: '16x16', class: 'enju_icon', alt: carrier_type.display_name
|
26
|
+
<%= image_tag(carrier_type_path(carrier_type, format: :download), size: '16x16', class: 'enju_icon', alt: carrier_type.display_name) %>
|
27
27
|
<%= carrier_type.name -%>
|
28
28
|
</td>
|
29
29
|
<td>
|
30
|
-
<%= link_to carrier_type.display_name
|
30
|
+
<%= link_to carrier_type.display_name, carrier_type -%>
|
31
31
|
<br />
|
32
32
|
<%= carrier_type.note %>
|
33
33
|
</td>
|
@@ -10,13 +10,13 @@
|
|
10
10
|
|
11
11
|
<p>
|
12
12
|
<strong><%= t('activerecord.attributes.carrier_type.display_name') -%>:</strong>
|
13
|
-
<%= @carrier_type.display_name
|
13
|
+
<%= @carrier_type.display_name -%>
|
14
14
|
</p>
|
15
15
|
|
16
16
|
<p>
|
17
17
|
<strong><%= t('page.file') -%>:</strong>
|
18
18
|
<%= link_to carrier_type_path(@carrier_type, format: :download) do -%>
|
19
|
-
<%= image_tag(carrier_type_path(@carrier_type, format: :download), size: '16x16', class: 'enju_icon', alt: @carrier_type.display_name
|
19
|
+
<%= image_tag(carrier_type_path(@carrier_type, format: :download), size: '16x16', class: 'enju_icon', alt: @carrier_type.display_name) %>
|
20
20
|
<%= @carrier_type.attachment_file_name %>
|
21
21
|
<% end %>
|
22
22
|
</p>
|
@@ -27,7 +27,7 @@
|
|
27
27
|
</p>
|
28
28
|
<ul>
|
29
29
|
<% @carrier_type.checkout_types.each do |checkout_type| %>
|
30
|
-
<li><%= link_to checkout_type.display_name
|
30
|
+
<li><%= link_to checkout_type.display_name, checkout_type %></li>
|
31
31
|
<% end %>
|
32
32
|
</ul>
|
33
33
|
<% end %>
|