enju_biblio 0.1.0.pre42 → 0.1.0.pre43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/creates_controller.rb +11 -11
- data/app/controllers/items_controller.rb +3 -3
- data/app/controllers/manifestations_controller.rb +14 -14
- data/app/controllers/owns_controller.rb +10 -10
- data/app/controllers/patron_import_files_controller.rb +34 -34
- data/app/controllers/patron_import_results_controller.rb +5 -5
- data/app/controllers/patron_relationship_types_controller.rb +3 -3
- data/app/controllers/patron_relationships_controller.rb +7 -7
- data/app/controllers/patron_types_controller.rb +3 -3
- data/app/controllers/patrons_controller.rb +61 -61
- data/app/controllers/picture_files_controller.rb +4 -4
- data/app/controllers/produces_controller.rb +11 -11
- data/app/controllers/realizes_controller.rb +11 -11
- data/app/helpers/{patrons_helper.rb → agents_helper.rb} +5 -5
- data/app/models/{patron.rb → agent.rb} +36 -36
- data/app/models/{patron_import_file.rb → agent_import_file.rb} +77 -77
- data/app/models/agent_import_result.rb +26 -0
- data/app/models/{patron_relationship.rb → agent_relationship.rb} +7 -7
- data/app/models/{patron_relationship_type.rb → agent_relationship_type.rb} +4 -4
- data/app/models/{patron_sweeper.rb → agent_sweeper.rb} +6 -6
- data/app/models/{patron_type.rb → agent_type.rb} +4 -4
- data/app/models/country.rb +1 -1
- data/app/models/create.rb +7 -7
- data/app/models/donate.rb +5 -5
- data/app/models/enju_biblio/ability.rb +24 -24
- data/app/models/item.rb +5 -5
- data/app/models/item_sweeper.rb +2 -2
- data/app/models/manifestation.rb +24 -20
- data/app/models/own.rb +7 -7
- data/app/models/page_sweeper.rb +4 -4
- data/app/models/picture_file.rb +1 -1
- data/app/models/produce.rb +7 -7
- data/app/models/realize.rb +7 -7
- data/app/models/resource_import_file.rb +19 -19
- data/app/views/{patron_import_files → agent_import_files}/edit.html.erb +6 -6
- data/app/views/agent_import_files/index.html.erb +40 -0
- data/app/views/{patron_import_files → agent_import_files}/new.html.erb +3 -3
- data/app/views/agent_import_files/show.html.erb +69 -0
- data/app/views/agent_import_results/index.csv.erb +3 -0
- data/app/views/agent_import_results/index.html.erb +52 -0
- data/app/views/agent_import_results/show.html.erb +38 -0
- data/app/views/{patron_relationship_types → agent_relationship_types}/_form.html.erb +1 -1
- data/app/views/{patron_relationship_types → agent_relationship_types}/edit.html.erb +3 -3
- data/app/views/agent_relationship_types/index.html.erb +43 -0
- data/app/views/{patron_relationship_types → agent_relationship_types}/new.html.erb +2 -2
- data/app/views/agent_relationship_types/show.html.erb +29 -0
- data/app/views/{patron_relationships → agent_relationships}/_form.html.erb +7 -7
- data/app/views/{patron_relationships → agent_relationships}/edit.html.erb +3 -3
- data/app/views/agent_relationships/index.html.erb +34 -0
- data/app/views/{patron_relationships → agent_relationships}/new.html.erb +2 -2
- data/app/views/agent_relationships/show.html.erb +24 -0
- data/app/views/{patron_types → agent_types}/_form.html.erb +1 -1
- data/app/views/{patron_types → agent_types}/edit.html.erb +3 -3
- data/app/views/agent_types/index.html.erb +43 -0
- data/app/views/{patron_types → agent_types}/new.html.erb +2 -2
- data/app/views/agent_types/show.html.erb +29 -0
- data/app/views/{patrons → agents}/_expression_list.html.erb +3 -3
- data/app/views/{patrons → agents}/_form.html.erb +9 -9
- data/app/views/{patrons → agents}/_form_family_name_first.html.erb +0 -0
- data/app/views/{patrons → agents}/_form_family_name_last.html.erb +0 -0
- data/app/views/{patrons → agents}/_history_list.html.erb +2 -2
- data/app/views/{patrons → agents}/_index.html.erb +9 -9
- data/app/views/{patrons → agents}/_index_expression.html.erb +15 -15
- data/app/views/{patrons → agents}/_index_manifestation.html.erb +16 -16
- data/app/views/agents/_index_patron.html.erb +71 -0
- data/app/views/agents/_index_patron_merge_list.html.erb +53 -0
- data/app/views/{patrons → agents}/_index_work.html.erb +17 -17
- data/app/views/{patrons → agents}/_manifestation_list.html.erb +3 -3
- data/app/views/agents/_patron.html.erb +13 -0
- data/app/views/agents/_patron_list.html.erb +18 -0
- data/app/views/{patrons → agents}/_work_list.html.erb +1 -1
- data/app/views/agents/edit.html.erb +16 -0
- data/app/views/agents/index.atom.builder +10 -0
- data/app/views/{patrons → agents}/index.html.erb +4 -4
- data/app/views/{patrons → agents}/index.mobile.erb +5 -5
- data/app/views/{patrons → agents}/index.rss.builder +11 -11
- data/app/views/{patrons → agents}/new.html.erb +2 -2
- data/app/views/agents/show.html.erb +152 -0
- data/app/views/{patrons → agents}/show.js.erb +0 -0
- data/app/views/agents/show.mobile.erb +69 -0
- data/app/views/creates/_form.html.erb +5 -5
- data/app/views/creates/_index.html.erb +2 -2
- data/app/views/creates/_index_patron.html.erb +6 -6
- data/app/views/creates/_index_work.html.erb +2 -2
- data/app/views/creates/index.html.erb +2 -2
- data/app/views/creates/new.html.erb +3 -3
- data/app/views/creates/show.html.erb +4 -4
- data/app/views/donates/edit.html.erb +2 -2
- data/app/views/donates/index.html.erb +2 -2
- data/app/views/donates/new.html.erb +2 -2
- data/app/views/donates/show.html.erb +2 -2
- data/app/views/items/index.html.erb +1 -1
- data/app/views/languages/index.html.erb +1 -1
- data/app/views/layouts/patrons.html.erb +2 -2
- data/app/views/manifestations/_index_form_contributor.html.erb +1 -1
- data/app/views/manifestations/_index_form_creator.html.erb +1 -1
- data/app/views/manifestations/_index_form_publisher.html.erb +1 -1
- data/app/views/manifestations/_manifestation_list.html.erb +6 -6
- data/app/views/manifestations/_show.mods.builder +4 -4
- data/app/views/manifestations/_show.rdf.builder +4 -4
- data/app/views/manifestations/_show_creators.html.erb +4 -4
- data/app/views/manifestations/_show_creators.mobile.erb +4 -4
- data/app/views/manifestations/_title.html.erb +3 -3
- data/app/views/manifestations/_title.mobile.erb +3 -3
- data/app/views/manifestations/edit.html.erb +2 -2
- data/app/views/manifestations/index.atom.builder +2 -2
- data/app/views/manifestations/index.html.erb +3 -3
- data/app/views/manifestations/index.opds.builder +2 -2
- data/app/views/manifestations/index.sru.builder +6 -6
- data/app/views/manifestations/new.html.erb +2 -2
- 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/owns/_form.html.erb +1 -1
- data/app/views/owns/index.html.erb +2 -2
- data/app/views/owns/show.html.erb +4 -4
- data/app/views/picture_files/_index.html.erb +1 -1
- data/app/views/picture_files/_index_patron.html.erb +2 -2
- data/app/views/picture_files/index.html.erb +2 -2
- data/app/views/picture_files/show.html.erb +2 -2
- data/app/views/produces/_form.html.erb +5 -5
- data/app/views/produces/_index.html.erb +2 -2
- data/app/views/produces/_index_manifestation.html.erb +3 -3
- data/app/views/produces/_index_patron.html.erb +3 -3
- data/app/views/produces/index.html.erb +2 -2
- data/app/views/produces/new.html.erb +3 -3
- data/app/views/produces/show.html.erb +4 -4
- data/app/views/realizes/_form.html.erb +5 -5
- data/app/views/realizes/_index.html.erb +2 -2
- data/app/views/realizes/_index_expression.html.erb +3 -3
- data/app/views/realizes/_index_patron.html.erb +3 -3
- data/app/views/realizes/index.html.erb +2 -2
- data/app/views/realizes/new.html.erb +3 -3
- data/app/views/realizes/show.html.erb +4 -4
- data/app/views/resource_import_results/show.html.erb +1 -1
- data/config/routes.rb +16 -16
- data/db/migrate/{001_create_patrons.rb → 001_create_agents.rb} +8 -8
- data/db/migrate/012_create_owns.rb +2 -2
- data/db/migrate/015_create_creates.rb +2 -2
- data/db/migrate/047_create_produces.rb +2 -2
- data/db/migrate/125_create_donates.rb +2 -2
- data/db/migrate/20080830154109_create_realizes.rb +2 -2
- data/db/migrate/{20080905191442_create_patron_types.rb → 20080905191442_create_agent_types.rb} +2 -2
- data/db/migrate/20081028083142_create_agent_import_files.rb +22 -0
- data/db/migrate/{20090812151902_create_patron_relationship_types.rb → 20090812151902_create_agent_relationship_types.rb} +2 -2
- data/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
- data/db/migrate/20100606073747_create_agent_relationships.rb +13 -0
- data/db/migrate/20100814091104_add_position_to_agent_relationship.rb +11 -0
- data/db/migrate/20100925074559_create_agent_import_results.rb +12 -0
- data/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +11 -0
- data/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +5 -0
- data/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +5 -0
- data/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +6 -0
- data/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +5 -0
- data/lib/enju_biblio/biblio_helper.rb +8 -8
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/enju_biblio.rb +3 -3
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/patron_relationship_types.yml +3 -3
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/patron_types.yml +2 -2
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/patrons.yml +4 -4
- data/spec/controllers/agent_import_files_controller_spec.rb +321 -0
- data/spec/controllers/{patron_import_results_controller_spec.rb → agent_import_results_controller_spec.rb} +17 -17
- data/spec/controllers/agent_relationship_types_controller_spec.rb +445 -0
- data/spec/controllers/agent_relationships_controller_spec.rb +446 -0
- data/spec/controllers/agent_types_controller_spec.rb +447 -0
- data/spec/controllers/agents_controller_spec.rb +644 -0
- data/spec/controllers/countries_controller_spec.rb +1 -1
- data/spec/controllers/items_controller_spec.rb +4 -4
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +1 -1
- data/spec/controllers/manifestations_controller_spec.rb +4 -4
- data/spec/controllers/owns_controller_spec.rb +2 -2
- data/spec/controllers/resource_import_files_controller_spec.rb +1 -1
- data/spec/dummy/app/helpers/application_helper.rb +5 -222
- data/spec/dummy/app/models/ability.rb +31 -31
- data/spec/dummy/app/models/{local_patron.rb → local_agent.rb} +1 -1
- data/spec/dummy/app/models/user.rb +3 -3
- data/spec/dummy/config/application.rb +0 -1
- data/spec/dummy/config/environments/test.rb +1 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/035_create_reserves.rb +1 -1
- data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -2
- data/spec/dummy/db/schema.rb +132 -132
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_delete_file.tsv +8 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample1.tsv +5 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample2.tsv +8 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample3.tsv +5 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_update_file.tsv +3 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/segments_q76 +0 -0
- data/spec/factories/{patron.rb → agent.rb} +3 -3
- data/spec/factories/create.rb +1 -1
- data/spec/factories/donate.rb +1 -1
- data/spec/factories/own.rb +1 -1
- data/spec/factories/patron_relationship.rb +3 -3
- data/spec/factories/patron_relationship_type.rb +2 -2
- data/spec/factories/patron_type.rb +2 -2
- data/spec/factories/produce.rb +1 -1
- data/spec/factories/realize.rb +1 -1
- data/spec/fixtures/{patron_import_files.yml → agent_import_files.yml} +18 -18
- data/spec/fixtures/{patron_import_results.yml → agent_import_results.yml} +7 -7
- data/spec/fixtures/{patron_relationship_types.yml → agent_relationship_types.yml} +4 -4
- data/spec/fixtures/{patron_relationships.yml → agent_relationships.yml} +4 -4
- data/spec/fixtures/{patron_types.yml → agent_types.yml} +4 -4
- data/spec/fixtures/{patrons.yml → agents.yml} +47 -47
- data/spec/fixtures/creates.yml +8 -8
- data/spec/fixtures/donates.yml +4 -4
- data/spec/fixtures/owns.yml +3 -3
- data/spec/fixtures/picture_files.yml +1 -1
- data/spec/fixtures/produces.yml +20 -20
- data/spec/fixtures/realizes.yml +11 -11
- data/spec/fixtures/reserves.yml +1 -1
- data/spec/models/agent_import_file_spec.rb +96 -0
- data/spec/models/{patron_import_result_spec.rb → agent_import_result_spec.rb} +4 -4
- data/spec/models/{patron_relationship_spec.rb → agent_relationship_spec.rb} +3 -3
- data/spec/models/{patron_relationship_type_spec.rb → agent_relationship_type_spec.rb} +2 -2
- data/spec/models/{patron_spec.rb → agent_spec.rb} +16 -16
- data/spec/models/{patron_type_spec.rb → agent_type_spec.rb} +2 -2
- data/spec/models/create_spec.rb +1 -1
- data/spec/models/donate_spec.rb +1 -1
- data/spec/models/manifestation_spec.rb +1 -1
- data/spec/models/own_spec.rb +1 -1
- data/spec/models/produce_spec.rb +1 -1
- data/spec/models/realize_spec.rb +1 -1
- data/spec/models/resource_import_file_spec.rb +8 -8
- data/spec/requests/agents_spec.rb +9 -0
- data/spec/routing/agent_relationship_types_routing_spec.rb +35 -0
- data/spec/routing/agent_relationships_routing_spec.rb +35 -0
- data/spec/routing/agents_routing_spec.rb +35 -0
- data/spec/views/creates/edit.html.erb_spec.rb +1 -1
- data/spec/views/creates/index.html.erb_spec.rb +2 -2
- data/spec/views/creates/new.html.erb_spec.rb +1 -1
- data/spec/views/creates/show.html.erb_spec.rb +1 -1
- data/spec/views/owns/edit.html.erb_spec.rb +1 -1
- data/spec/views/owns/index.html.erb_spec.rb +2 -2
- data/spec/views/owns/new.html.erb_spec.rb +1 -1
- data/spec/views/owns/show.html.erb_spec.rb +1 -1
- data/spec/views/produces/edit.html.erb_spec.rb +2 -2
- data/spec/views/produces/index.html.erb_spec.rb +2 -2
- data/spec/views/produces/new.html.erb_spec.rb +2 -2
- data/spec/views/produces/show.html.erb_spec.rb +1 -1
- data/spec/views/realizes/edit.html.erb_spec.rb +2 -2
- data/spec/views/realizes/index.html.erb_spec.rb +2 -2
- data/spec/views/realizes/new.html.erb_spec.rb +2 -2
- data/spec/views/realizes/show.html.erb_spec.rb +1 -1
- metadata +131 -187
- data/app/models/patron_import_result.rb +0 -26
- data/app/views/patron_import_files/index.html.erb +0 -40
- data/app/views/patron_import_files/show.html.erb +0 -69
- data/app/views/patron_import_results/index.csv.erb +0 -3
- data/app/views/patron_import_results/index.html.erb +0 -52
- data/app/views/patron_import_results/show.html.erb +0 -38
- data/app/views/patron_relationship_types/index.html.erb +0 -43
- data/app/views/patron_relationship_types/show.html.erb +0 -29
- data/app/views/patron_relationships/index.html.erb +0 -34
- data/app/views/patron_relationships/show.html.erb +0 -24
- data/app/views/patron_types/index.html.erb +0 -43
- data/app/views/patron_types/show.html.erb +0 -29
- data/app/views/patrons/_index_patron.html.erb +0 -71
- data/app/views/patrons/_index_patron_merge_list.html.erb +0 -53
- data/app/views/patrons/_patron.html.erb +0 -13
- data/app/views/patrons/_patron_list.html.erb +0 -18
- data/app/views/patrons/edit.html.erb +0 -16
- data/app/views/patrons/index.atom.builder +0 -10
- data/app/views/patrons/show.html.erb +0 -152
- data/app/views/patrons/show.mobile.erb +0 -69
- data/db/migrate/20081028083142_create_patron_import_files.rb +0 -22
- data/db/migrate/20100606073747_create_patron_relationships.rb +0 -13
- data/db/migrate/20100814091104_add_position_to_patron_relationship.rb +0 -11
- data/db/migrate/20100925074559_create_patron_import_results.rb +0 -12
- data/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +0 -11
- data/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +0 -5
- data/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +0 -5
- data/db/migrate/20120511072422_add_patron_identifier_to_patron.rb +0 -6
- data/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +0 -5
- data/spec/controllers/patron_import_files_controller_spec.rb +0 -321
- data/spec/controllers/patron_relationship_types_controller_spec.rb +0 -445
- data/spec/controllers/patron_relationships_controller_spec.rb +0 -446
- data/spec/controllers/patron_types_controller_spec.rb +0 -447
- data/spec/controllers/patrons_controller_spec.rb +0 -644
- data/spec/dummy/app/mailers/notifier.rb +0 -40
- data/spec/dummy/lib/plugins/ext/event-calendar.rb +0 -38
- data/spec/dummy/lib/plugins/ext/sunspot/abstract_search.rb +0 -12
- data/spec/dummy/lib/plugins/ext/sunspot/dismax.rb +0 -41
- data/spec/dummy/lib/plugins/ext/sunspot/start_record.rb +0 -55
- data/spec/dummy/lib/plugins/ext/sunspot.rb +0 -3
- data/spec/dummy/lib/plugins/ext.rb +0 -1
- data/spec/dummy/lib/plugins.rb +0 -2
- data/spec/dummy/solr/data/test/index/_goc.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_goc.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_goc.fnm +0 -7
- data/spec/dummy/solr/data/test/index/_goc.frq +0 -0
- data/spec/dummy/solr/data/test/index/_goc.nrm +0 -1
- data/spec/dummy/solr/data/test/index/_goc.prx +0 -0
- data/spec/dummy/solr/data/test/index/_goc.tii +0 -0
- data/spec/dummy/solr/data/test/index/_goc.tis +0 -0
- data/spec/dummy/solr/data/test/index/_god.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_god.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_god.fnm +0 -7
- data/spec/dummy/solr/data/test/index/_god.frq +0 -0
- data/spec/dummy/solr/data/test/index/_god.nrm +0 -1
- data/spec/dummy/solr/data/test/index/_god.prx +0 -0
- data/spec/dummy/solr/data/test/index/_god.tii +0 -0
- data/spec/dummy/solr/data/test/index/_god.tis +0 -0
- data/spec/dummy/solr/data/test/index/_goe.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_goe.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_goe.fnm +0 -8
- data/spec/dummy/solr/data/test/index/_goe.frq +0 -0
- data/spec/dummy/solr/data/test/index/_goe.nrm +0 -1
- data/spec/dummy/solr/data/test/index/_goe.prx +0 -0
- data/spec/dummy/solr/data/test/index/_goe.tii +0 -0
- data/spec/dummy/solr/data/test/index/_goe.tis +0 -0
- data/spec/dummy/solr/data/test/index/segments_otc +0 -0
- data/spec/dummy/tmp/cache/4AD/470/country_all +0 -0
- data/spec/models/patron_import_file_spec.rb +0 -96
- data/spec/requests/patrons_spec.rb +0 -9
- data/spec/routing/patron_relationship_types_routing_spec.rb +0 -35
- data/spec/routing/patron_relationships_routing_spec.rb +0 -35
- data/spec/routing/patrons_routing_spec.rb +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05e41c2afb92e36527a3eda64e40ce1699d52245
|
4
|
+
data.tar.gz: 078c063e6952e3fd647c2f3a5b443bce2510ff88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4daa909c36210b558fec08687ac3192a0ee6fc2d3339a0d9c4f64aadcda002a37148133ddd890d6febf0fd60b09a34e1795695a6e299ea4ee46b3d748bbd32fd
|
7
|
+
data.tar.gz: f9cfbe413e6d31f995cba2076b46bc20825ee6479d0a80af74a1ce0f5645b59fd6084a43273b47513c01aa638a68cf3e4becfb4d3fd39569e61fc88003d9c2c1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class CreatesController < ApplicationController
|
2
2
|
load_and_authorize_resource
|
3
|
-
before_filter :
|
3
|
+
before_filter :get_agent, :get_work
|
4
4
|
before_filter :prepare_options, :only => [:new, :edit]
|
5
5
|
after_filter :solr_commit, :only => [:create, :update, :destroy]
|
6
6
|
cache_sweeper :page_sweeper, :only => [:create, :update, :destroy]
|
@@ -9,8 +9,8 @@ class CreatesController < ApplicationController
|
|
9
9
|
# GET /creates.json
|
10
10
|
def index
|
11
11
|
case
|
12
|
-
when @
|
13
|
-
@creates = @
|
12
|
+
when @agent
|
13
|
+
@creates = @agent.creates.order('creates.position').page(params[:page])
|
14
14
|
when @work
|
15
15
|
@creates = @work.creates.order('creates.position').page(params[:page])
|
16
16
|
else
|
@@ -34,16 +34,16 @@ class CreatesController < ApplicationController
|
|
34
34
|
|
35
35
|
# GET /creates/new
|
36
36
|
def new
|
37
|
-
if @
|
38
|
-
redirect_to
|
37
|
+
if @agent and @work.blank?
|
38
|
+
redirect_to agent_works_url(@patorn)
|
39
39
|
return
|
40
|
-
elsif @work and @
|
41
|
-
redirect_to
|
40
|
+
elsif @work and @agent.blank?
|
41
|
+
redirect_to work_agents_url(@work)
|
42
42
|
return
|
43
43
|
else
|
44
44
|
@create = Create.new
|
45
45
|
@create.work = @work
|
46
|
-
@create.
|
46
|
+
@create.agent = @agent
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -98,11 +98,11 @@ class CreatesController < ApplicationController
|
|
98
98
|
respond_to do |format|
|
99
99
|
flash[:notice] = t('controller.successfully_deleted', :model => t('activerecord.models.create'))
|
100
100
|
case
|
101
|
-
when @
|
102
|
-
format.html { redirect_to
|
101
|
+
when @agent
|
102
|
+
format.html { redirect_to agent_works_url(@agent) }
|
103
103
|
format.json { head :no_content }
|
104
104
|
when @work
|
105
|
-
format.html { redirect_to
|
105
|
+
format.html { redirect_to work_agents_url(@work) }
|
106
106
|
format.json { head :no_content }
|
107
107
|
else
|
108
108
|
format.html { redirect_to creates_url }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
class ItemsController < ApplicationController
|
3
3
|
load_and_authorize_resource
|
4
|
-
before_filter :
|
4
|
+
before_filter :get_agent, :get_manifestation, :get_shelf, :except => [:create, :update, :destroy]
|
5
5
|
if defined?(EnjuInventory)
|
6
6
|
before_filter :get_inventory_file
|
7
7
|
end
|
@@ -63,12 +63,12 @@ class ItemsController < ApplicationController
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
|
66
|
+
agent = @agent
|
67
67
|
manifestation = @manifestation
|
68
68
|
shelf = @shelf
|
69
69
|
unless params[:mode] == 'add'
|
70
70
|
search.build do
|
71
|
-
with(:
|
71
|
+
with(:agent_ids).equal_to agent.id if agent
|
72
72
|
with(:manifestation_id).equal_to manifestation.id if manifestation
|
73
73
|
with(:shelf_id).equal_to shelf.id if shelf
|
74
74
|
end
|
@@ -3,7 +3,7 @@ class ManifestationsController < ApplicationController
|
|
3
3
|
load_and_authorize_resource :except => :index
|
4
4
|
authorize_resource :only => :index
|
5
5
|
before_filter :authenticate_user!, :only => :edit
|
6
|
-
before_filter :
|
6
|
+
before_filter :get_agent, :get_manifestation, :except => [:create, :update, :destroy]
|
7
7
|
before_filter :get_expression, :only => :new
|
8
8
|
if defined?(EnjuSubject)
|
9
9
|
before_filter :get_subject, :except => [:create, :update, :destroy]
|
@@ -110,8 +110,8 @@ class ManifestationsController < ApplicationController
|
|
110
110
|
reservable = nil
|
111
111
|
end
|
112
112
|
|
113
|
-
|
114
|
-
@
|
113
|
+
agent = get_index_agent
|
114
|
+
@index_agent = agent
|
115
115
|
manifestation = @manifestation if @manifestation
|
116
116
|
series_statement = @series_statement if @series_statement
|
117
117
|
parent = @parent = Manifestation.where(:id => params[:parent_id]).first if params[:parent_id].present?
|
@@ -122,9 +122,9 @@ class ManifestationsController < ApplicationController
|
|
122
122
|
|
123
123
|
unless mode == 'add'
|
124
124
|
search.build do
|
125
|
-
with(:creator_ids).equal_to
|
126
|
-
with(:contributor_ids).equal_to
|
127
|
-
with(:publisher_ids).equal_to
|
125
|
+
with(:creator_ids).equal_to agent[:creator].id if agent[:creator]
|
126
|
+
with(:contributor_ids).equal_to agent[:contributor].id if agent[:contributor]
|
127
|
+
with(:publisher_ids).equal_to agent[:publisher].id if agent[:publisher]
|
128
128
|
with(:series_statement_ids).equal_to series_statement.id if series_statement
|
129
129
|
with(:parent_ids).equal_to parent.id if parent
|
130
130
|
end
|
@@ -683,19 +683,19 @@ class ManifestationsController < ApplicationController
|
|
683
683
|
end
|
684
684
|
end
|
685
685
|
|
686
|
-
def
|
687
|
-
|
686
|
+
def get_index_agent
|
687
|
+
agent = {}
|
688
688
|
case
|
689
|
-
when params[:
|
690
|
-
|
689
|
+
when params[:agent_id]
|
690
|
+
agent[:agent] = Agent.find(params[:agent_id])
|
691
691
|
when params[:creator_id]
|
692
|
-
|
692
|
+
agent[:creator] = @creator = Agent.find(params[:creator_id])
|
693
693
|
when params[:contributor_id]
|
694
|
-
|
694
|
+
agent[:contributor] = @contributor = Agent.find(params[:contributor_id])
|
695
695
|
when params[:publisher_id]
|
696
|
-
|
696
|
+
agent[:publisher] = @publisher = Agent.find(params[:publisher_id])
|
697
697
|
end
|
698
|
-
|
698
|
+
agent
|
699
699
|
end
|
700
700
|
|
701
701
|
def set_reservable
|
@@ -1,14 +1,14 @@
|
|
1
1
|
class OwnsController < ApplicationController
|
2
2
|
load_and_authorize_resource
|
3
|
-
before_filter :
|
3
|
+
before_filter :get_agent, :get_item
|
4
4
|
after_filter :solr_commit, :only => [:create, :update, :destroy]
|
5
5
|
cache_sweeper :page_sweeper, :only => [:create, :update, :destroy]
|
6
6
|
|
7
7
|
# GET /owns
|
8
8
|
# GET /owns.json
|
9
9
|
def index
|
10
|
-
if @
|
11
|
-
@owns = @
|
10
|
+
if @agent
|
11
|
+
@owns = @agent.owns.order('owns.position').page(params[:page])
|
12
12
|
elsif @item
|
13
13
|
@owns = @item.owns.order('owns.position').page(params[:page])
|
14
14
|
else
|
@@ -32,16 +32,16 @@ class OwnsController < ApplicationController
|
|
32
32
|
|
33
33
|
# GET /owns/new
|
34
34
|
def new
|
35
|
-
if @item and @
|
36
|
-
redirect_to
|
35
|
+
if @item and @agent.blank?
|
36
|
+
redirect_to item_agents_url(@item)
|
37
37
|
return
|
38
|
-
elsif @
|
39
|
-
redirect_to
|
38
|
+
elsif @agent and @item.blank?
|
39
|
+
redirect_to agent_items_url(@agent)
|
40
40
|
return
|
41
41
|
else
|
42
42
|
@own = Own.new
|
43
43
|
@own.item = @item
|
44
|
-
@own.
|
44
|
+
@own.agent = @agent
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -94,8 +94,8 @@ class OwnsController < ApplicationController
|
|
94
94
|
format.html {
|
95
95
|
flash[:notice] = t('controller.successfully_deleted', :model => t('activerecord.models.own'))
|
96
96
|
case
|
97
|
-
when @
|
98
|
-
redirect_to
|
97
|
+
when @agent
|
98
|
+
redirect_to agent_owns_url(@agent)
|
99
99
|
when @item
|
100
100
|
redirect_to item_owns_url(@item)
|
101
101
|
else
|
@@ -1,92 +1,92 @@
|
|
1
|
-
class
|
1
|
+
class AgentImportFilesController < ApplicationController
|
2
2
|
load_and_authorize_resource
|
3
3
|
|
4
|
-
# GET /
|
5
|
-
# GET /
|
4
|
+
# GET /agent_import_files
|
5
|
+
# GET /agent_import_files.json
|
6
6
|
def index
|
7
|
-
@
|
7
|
+
@agent_import_files = AgentImportFile.page(params[:page])
|
8
8
|
|
9
9
|
respond_to do |format|
|
10
10
|
format.html # index.html.erb
|
11
|
-
format.json { render :json => @
|
11
|
+
format.json { render :json => @agent_import_files }
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
# GET /
|
16
|
-
# GET /
|
15
|
+
# GET /agent_import_files/1
|
16
|
+
# GET /agent_import_files/1.json
|
17
17
|
def show
|
18
|
-
if @
|
18
|
+
if @agent_import_file.agent_import.path
|
19
19
|
unless Setting.uploaded_file.storage == :s3
|
20
|
-
file = @
|
20
|
+
file = @agent_import_file.agent_import.path
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
respond_to do |format|
|
25
25
|
format.html # show.html.erb
|
26
|
-
format.json { render :json => @
|
26
|
+
format.json { render :json => @agent_import_file }
|
27
27
|
format.download {
|
28
28
|
if Setting.uploaded_file.storage == :s3
|
29
|
-
redirect_to @
|
29
|
+
redirect_to @agent_import_file.agent_import.expiring_url(10)
|
30
30
|
else
|
31
|
-
send_file file, :filename => @
|
31
|
+
send_file file, :filename => @agent_import_file.agent_import_file_name, :type => 'application/octet-stream'
|
32
32
|
end
|
33
33
|
}
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
# GET /
|
38
|
-
# GET /
|
37
|
+
# GET /agent_import_files/new
|
38
|
+
# GET /agent_import_files/new.json
|
39
39
|
def new
|
40
|
-
@
|
40
|
+
@agent_import_file = AgentImportFile.new
|
41
41
|
|
42
42
|
respond_to do |format|
|
43
43
|
format.html # new.html.erb
|
44
|
-
format.json { render :json => @
|
44
|
+
format.json { render :json => @agent_import_file }
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
# GET /
|
48
|
+
# GET /agent_import_files/1/edit
|
49
49
|
def edit
|
50
50
|
end
|
51
51
|
|
52
|
-
# POST /
|
53
|
-
# POST /
|
52
|
+
# POST /agent_import_files
|
53
|
+
# POST /agent_import_files.json
|
54
54
|
def create
|
55
|
-
@
|
56
|
-
@
|
55
|
+
@agent_import_file = AgentImportFile.new(params[:agent_import_file])
|
56
|
+
@agent_import_file.user = current_user
|
57
57
|
|
58
58
|
respond_to do |format|
|
59
|
-
if @
|
60
|
-
format.html { redirect_to @
|
61
|
-
format.json { render :json => @
|
59
|
+
if @agent_import_file.save
|
60
|
+
format.html { redirect_to @agent_import_file, :notice => t('controller.successfully_created', :model => t('activerecord.models.agent_import_file')) }
|
61
|
+
format.json { render :json => @agent_import_file, :status => :created, :location => @agent_import_file }
|
62
62
|
else
|
63
63
|
format.html { render :action => "new" }
|
64
|
-
format.json { render :json => @
|
64
|
+
format.json { render :json => @agent_import_file.errors, :status => :unprocessable_entity }
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
# PUT /
|
70
|
-
# PUT /
|
69
|
+
# PUT /agent_import_files/1
|
70
|
+
# PUT /agent_import_files/1.json
|
71
71
|
def update
|
72
72
|
respond_to do |format|
|
73
|
-
if @
|
74
|
-
format.html { redirect_to @
|
73
|
+
if @agent_import_file.update_attributes(params[:agent_import_file])
|
74
|
+
format.html { redirect_to @agent_import_file, :notice => t('controller.successfully_updated', :model => t('activerecord.models.agent_import_file')) }
|
75
75
|
format.json { head :no_content }
|
76
76
|
else
|
77
77
|
format.html { render :action => "edit" }
|
78
|
-
format.json { render :json => @
|
78
|
+
format.json { render :json => @agent_import_file.errors, :status => :unprocessable_entity }
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
# DELETE /
|
84
|
-
# DELETE /
|
83
|
+
# DELETE /agent_import_files/1
|
84
|
+
# DELETE /agent_import_files/1.json
|
85
85
|
def destroy
|
86
|
-
@
|
86
|
+
@agent_import_file.destroy
|
87
87
|
|
88
88
|
respond_to do |format|
|
89
|
-
format.html { redirect_to(
|
89
|
+
format.html { redirect_to(agent_import_files_url) }
|
90
90
|
format.json { head :no_content }
|
91
91
|
end
|
92
92
|
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
class
|
1
|
+
class AgentImportResultsController < InheritedResources::Base
|
2
2
|
respond_to :html, :json, :csv
|
3
3
|
load_and_authorize_resource
|
4
4
|
has_scope :file_id
|
5
5
|
actions :index, :show, :destroy
|
6
6
|
|
7
7
|
def index
|
8
|
-
@
|
9
|
-
if @
|
10
|
-
@
|
8
|
+
@agent_import_file = AgentImportFile.where(:id => params[:agent_import_file_id]).first
|
9
|
+
if @agent_import_file
|
10
|
+
@agent_import_results = @agent_import_file.agent_import_results.page(params[:page])
|
11
11
|
else
|
12
|
-
@
|
12
|
+
@agent_import_results = AgentImportResult.page(params[:page])
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
class
|
1
|
+
class AgentRelationshipTypesController < InheritedResources::Base
|
2
2
|
respond_to :html, :json
|
3
3
|
has_scope :page, :default => 1
|
4
4
|
load_and_authorize_resource
|
5
5
|
|
6
6
|
def update
|
7
|
-
@
|
7
|
+
@agent_relationship_type = AgentRelationshipType.find(params[:id])
|
8
8
|
if params[:move]
|
9
|
-
move_position(@
|
9
|
+
move_position(@agent_relationship_type, params[:move])
|
10
10
|
return
|
11
11
|
end
|
12
12
|
update!
|
@@ -1,19 +1,19 @@
|
|
1
|
-
class
|
1
|
+
class AgentRelationshipsController < InheritedResources::Base
|
2
2
|
respond_to :html, :json
|
3
3
|
has_scope :page, :default => 1
|
4
4
|
load_and_authorize_resource
|
5
5
|
before_filter :prepare_options, :except => [:index, :destroy]
|
6
6
|
|
7
7
|
def new
|
8
|
-
@
|
9
|
-
@
|
10
|
-
@
|
8
|
+
@agent_relationship = AgentRelationship.new(params[:agent_relationship])
|
9
|
+
@agent_relationship.parent = Agent.find(params[:agent_id]) rescue nil
|
10
|
+
@agent_relationship.child = Agent.find(params[:child_id]) rescue nil
|
11
11
|
end
|
12
12
|
|
13
13
|
def update
|
14
|
-
@
|
14
|
+
@agent_relationship = AgentRelationship.find(params[:id])
|
15
15
|
if params[:move]
|
16
|
-
move_position(@
|
16
|
+
move_position(@agent_relationship, params[:move])
|
17
17
|
return
|
18
18
|
end
|
19
19
|
update!
|
@@ -21,6 +21,6 @@ class PatronRelationshipsController < InheritedResources::Base
|
|
21
21
|
|
22
22
|
private
|
23
23
|
def prepare_options
|
24
|
-
@
|
24
|
+
@agent_relationship_types = AgentRelationshipType.all
|
25
25
|
end
|
26
26
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
class
|
1
|
+
class AgentTypesController < InheritedResources::Base
|
2
2
|
respond_to :html, :json
|
3
3
|
has_scope :page, :default => 1
|
4
4
|
load_and_authorize_resource
|
5
5
|
|
6
6
|
def update
|
7
|
-
@
|
7
|
+
@agent_type = AgentType.find(params[:id])
|
8
8
|
if params[:move]
|
9
|
-
move_position(@
|
9
|
+
move_position(@agent_type, params[:move])
|
10
10
|
return
|
11
11
|
end
|
12
12
|
update!
|