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.
Files changed (319) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/creates_controller.rb +11 -11
  3. data/app/controllers/items_controller.rb +3 -3
  4. data/app/controllers/manifestations_controller.rb +14 -14
  5. data/app/controllers/owns_controller.rb +10 -10
  6. data/app/controllers/patron_import_files_controller.rb +34 -34
  7. data/app/controllers/patron_import_results_controller.rb +5 -5
  8. data/app/controllers/patron_relationship_types_controller.rb +3 -3
  9. data/app/controllers/patron_relationships_controller.rb +7 -7
  10. data/app/controllers/patron_types_controller.rb +3 -3
  11. data/app/controllers/patrons_controller.rb +61 -61
  12. data/app/controllers/picture_files_controller.rb +4 -4
  13. data/app/controllers/produces_controller.rb +11 -11
  14. data/app/controllers/realizes_controller.rb +11 -11
  15. data/app/helpers/{patrons_helper.rb → agents_helper.rb} +5 -5
  16. data/app/models/{patron.rb → agent.rb} +36 -36
  17. data/app/models/{patron_import_file.rb → agent_import_file.rb} +77 -77
  18. data/app/models/agent_import_result.rb +26 -0
  19. data/app/models/{patron_relationship.rb → agent_relationship.rb} +7 -7
  20. data/app/models/{patron_relationship_type.rb → agent_relationship_type.rb} +4 -4
  21. data/app/models/{patron_sweeper.rb → agent_sweeper.rb} +6 -6
  22. data/app/models/{patron_type.rb → agent_type.rb} +4 -4
  23. data/app/models/country.rb +1 -1
  24. data/app/models/create.rb +7 -7
  25. data/app/models/donate.rb +5 -5
  26. data/app/models/enju_biblio/ability.rb +24 -24
  27. data/app/models/item.rb +5 -5
  28. data/app/models/item_sweeper.rb +2 -2
  29. data/app/models/manifestation.rb +24 -20
  30. data/app/models/own.rb +7 -7
  31. data/app/models/page_sweeper.rb +4 -4
  32. data/app/models/picture_file.rb +1 -1
  33. data/app/models/produce.rb +7 -7
  34. data/app/models/realize.rb +7 -7
  35. data/app/models/resource_import_file.rb +19 -19
  36. data/app/views/{patron_import_files → agent_import_files}/edit.html.erb +6 -6
  37. data/app/views/agent_import_files/index.html.erb +40 -0
  38. data/app/views/{patron_import_files → agent_import_files}/new.html.erb +3 -3
  39. data/app/views/agent_import_files/show.html.erb +69 -0
  40. data/app/views/agent_import_results/index.csv.erb +3 -0
  41. data/app/views/agent_import_results/index.html.erb +52 -0
  42. data/app/views/agent_import_results/show.html.erb +38 -0
  43. data/app/views/{patron_relationship_types → agent_relationship_types}/_form.html.erb +1 -1
  44. data/app/views/{patron_relationship_types → agent_relationship_types}/edit.html.erb +3 -3
  45. data/app/views/agent_relationship_types/index.html.erb +43 -0
  46. data/app/views/{patron_relationship_types → agent_relationship_types}/new.html.erb +2 -2
  47. data/app/views/agent_relationship_types/show.html.erb +29 -0
  48. data/app/views/{patron_relationships → agent_relationships}/_form.html.erb +7 -7
  49. data/app/views/{patron_relationships → agent_relationships}/edit.html.erb +3 -3
  50. data/app/views/agent_relationships/index.html.erb +34 -0
  51. data/app/views/{patron_relationships → agent_relationships}/new.html.erb +2 -2
  52. data/app/views/agent_relationships/show.html.erb +24 -0
  53. data/app/views/{patron_types → agent_types}/_form.html.erb +1 -1
  54. data/app/views/{patron_types → agent_types}/edit.html.erb +3 -3
  55. data/app/views/agent_types/index.html.erb +43 -0
  56. data/app/views/{patron_types → agent_types}/new.html.erb +2 -2
  57. data/app/views/agent_types/show.html.erb +29 -0
  58. data/app/views/{patrons → agents}/_expression_list.html.erb +3 -3
  59. data/app/views/{patrons → agents}/_form.html.erb +9 -9
  60. data/app/views/{patrons → agents}/_form_family_name_first.html.erb +0 -0
  61. data/app/views/{patrons → agents}/_form_family_name_last.html.erb +0 -0
  62. data/app/views/{patrons → agents}/_history_list.html.erb +2 -2
  63. data/app/views/{patrons → agents}/_index.html.erb +9 -9
  64. data/app/views/{patrons → agents}/_index_expression.html.erb +15 -15
  65. data/app/views/{patrons → agents}/_index_manifestation.html.erb +16 -16
  66. data/app/views/agents/_index_patron.html.erb +71 -0
  67. data/app/views/agents/_index_patron_merge_list.html.erb +53 -0
  68. data/app/views/{patrons → agents}/_index_work.html.erb +17 -17
  69. data/app/views/{patrons → agents}/_manifestation_list.html.erb +3 -3
  70. data/app/views/agents/_patron.html.erb +13 -0
  71. data/app/views/agents/_patron_list.html.erb +18 -0
  72. data/app/views/{patrons → agents}/_work_list.html.erb +1 -1
  73. data/app/views/agents/edit.html.erb +16 -0
  74. data/app/views/agents/index.atom.builder +10 -0
  75. data/app/views/{patrons → agents}/index.html.erb +4 -4
  76. data/app/views/{patrons → agents}/index.mobile.erb +5 -5
  77. data/app/views/{patrons → agents}/index.rss.builder +11 -11
  78. data/app/views/{patrons → agents}/new.html.erb +2 -2
  79. data/app/views/agents/show.html.erb +152 -0
  80. data/app/views/{patrons → agents}/show.js.erb +0 -0
  81. data/app/views/agents/show.mobile.erb +69 -0
  82. data/app/views/creates/_form.html.erb +5 -5
  83. data/app/views/creates/_index.html.erb +2 -2
  84. data/app/views/creates/_index_patron.html.erb +6 -6
  85. data/app/views/creates/_index_work.html.erb +2 -2
  86. data/app/views/creates/index.html.erb +2 -2
  87. data/app/views/creates/new.html.erb +3 -3
  88. data/app/views/creates/show.html.erb +4 -4
  89. data/app/views/donates/edit.html.erb +2 -2
  90. data/app/views/donates/index.html.erb +2 -2
  91. data/app/views/donates/new.html.erb +2 -2
  92. data/app/views/donates/show.html.erb +2 -2
  93. data/app/views/items/index.html.erb +1 -1
  94. data/app/views/languages/index.html.erb +1 -1
  95. data/app/views/layouts/patrons.html.erb +2 -2
  96. data/app/views/manifestations/_index_form_contributor.html.erb +1 -1
  97. data/app/views/manifestations/_index_form_creator.html.erb +1 -1
  98. data/app/views/manifestations/_index_form_publisher.html.erb +1 -1
  99. data/app/views/manifestations/_manifestation_list.html.erb +6 -6
  100. data/app/views/manifestations/_show.mods.builder +4 -4
  101. data/app/views/manifestations/_show.rdf.builder +4 -4
  102. data/app/views/manifestations/_show_creators.html.erb +4 -4
  103. data/app/views/manifestations/_show_creators.mobile.erb +4 -4
  104. data/app/views/manifestations/_title.html.erb +3 -3
  105. data/app/views/manifestations/_title.mobile.erb +3 -3
  106. data/app/views/manifestations/edit.html.erb +2 -2
  107. data/app/views/manifestations/index.atom.builder +2 -2
  108. data/app/views/manifestations/index.html.erb +3 -3
  109. data/app/views/manifestations/index.opds.builder +2 -2
  110. data/app/views/manifestations/index.sru.builder +6 -6
  111. data/app/views/manifestations/new.html.erb +2 -2
  112. data/app/views/notifier/manifestation_info.en.text.erb +1 -1
  113. data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
  114. data/app/views/owns/_form.html.erb +1 -1
  115. data/app/views/owns/index.html.erb +2 -2
  116. data/app/views/owns/show.html.erb +4 -4
  117. data/app/views/picture_files/_index.html.erb +1 -1
  118. data/app/views/picture_files/_index_patron.html.erb +2 -2
  119. data/app/views/picture_files/index.html.erb +2 -2
  120. data/app/views/picture_files/show.html.erb +2 -2
  121. data/app/views/produces/_form.html.erb +5 -5
  122. data/app/views/produces/_index.html.erb +2 -2
  123. data/app/views/produces/_index_manifestation.html.erb +3 -3
  124. data/app/views/produces/_index_patron.html.erb +3 -3
  125. data/app/views/produces/index.html.erb +2 -2
  126. data/app/views/produces/new.html.erb +3 -3
  127. data/app/views/produces/show.html.erb +4 -4
  128. data/app/views/realizes/_form.html.erb +5 -5
  129. data/app/views/realizes/_index.html.erb +2 -2
  130. data/app/views/realizes/_index_expression.html.erb +3 -3
  131. data/app/views/realizes/_index_patron.html.erb +3 -3
  132. data/app/views/realizes/index.html.erb +2 -2
  133. data/app/views/realizes/new.html.erb +3 -3
  134. data/app/views/realizes/show.html.erb +4 -4
  135. data/app/views/resource_import_results/show.html.erb +1 -1
  136. data/config/routes.rb +16 -16
  137. data/db/migrate/{001_create_patrons.rb → 001_create_agents.rb} +8 -8
  138. data/db/migrate/012_create_owns.rb +2 -2
  139. data/db/migrate/015_create_creates.rb +2 -2
  140. data/db/migrate/047_create_produces.rb +2 -2
  141. data/db/migrate/125_create_donates.rb +2 -2
  142. data/db/migrate/20080830154109_create_realizes.rb +2 -2
  143. data/db/migrate/{20080905191442_create_patron_types.rb → 20080905191442_create_agent_types.rb} +2 -2
  144. data/db/migrate/20081028083142_create_agent_import_files.rb +22 -0
  145. data/db/migrate/{20090812151902_create_patron_relationship_types.rb → 20090812151902_create_agent_relationship_types.rb} +2 -2
  146. data/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
  147. data/db/migrate/20100606073747_create_agent_relationships.rb +13 -0
  148. data/db/migrate/20100814091104_add_position_to_agent_relationship.rb +11 -0
  149. data/db/migrate/20100925074559_create_agent_import_results.rb +12 -0
  150. data/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +11 -0
  151. data/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +5 -0
  152. data/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +5 -0
  153. data/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +6 -0
  154. data/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +5 -0
  155. data/lib/enju_biblio/biblio_helper.rb +8 -8
  156. data/lib/enju_biblio/version.rb +1 -1
  157. data/lib/enju_biblio.rb +3 -3
  158. data/lib/generators/enju_biblio/setup/templates/db/fixtures/patron_relationship_types.yml +3 -3
  159. data/lib/generators/enju_biblio/setup/templates/db/fixtures/patron_types.yml +2 -2
  160. data/lib/generators/enju_biblio/setup/templates/db/fixtures/patrons.yml +4 -4
  161. data/spec/controllers/agent_import_files_controller_spec.rb +321 -0
  162. data/spec/controllers/{patron_import_results_controller_spec.rb → agent_import_results_controller_spec.rb} +17 -17
  163. data/spec/controllers/agent_relationship_types_controller_spec.rb +445 -0
  164. data/spec/controllers/agent_relationships_controller_spec.rb +446 -0
  165. data/spec/controllers/agent_types_controller_spec.rb +447 -0
  166. data/spec/controllers/agents_controller_spec.rb +644 -0
  167. data/spec/controllers/countries_controller_spec.rb +1 -1
  168. data/spec/controllers/items_controller_spec.rb +4 -4
  169. data/spec/controllers/manifestation_relationship_types_controller_spec.rb +1 -1
  170. data/spec/controllers/manifestations_controller_spec.rb +4 -4
  171. data/spec/controllers/owns_controller_spec.rb +2 -2
  172. data/spec/controllers/resource_import_files_controller_spec.rb +1 -1
  173. data/spec/dummy/app/helpers/application_helper.rb +5 -222
  174. data/spec/dummy/app/models/ability.rb +31 -31
  175. data/spec/dummy/app/models/{local_patron.rb → local_agent.rb} +1 -1
  176. data/spec/dummy/app/models/user.rb +3 -3
  177. data/spec/dummy/config/application.rb +0 -1
  178. data/spec/dummy/config/environments/test.rb +1 -0
  179. data/spec/dummy/db/development.sqlite3 +0 -0
  180. data/spec/dummy/db/migrate/035_create_reserves.rb +1 -1
  181. data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -2
  182. data/spec/dummy/db/schema.rb +132 -132
  183. data/spec/dummy/db/test.sqlite3 +0 -0
  184. data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_delete_file.tsv +8 -0
  185. data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample1.tsv +5 -0
  186. data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample2.tsv +8 -0
  187. data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample3.tsv +5 -0
  188. data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_update_file.tsv +3 -0
  189. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  190. data/spec/dummy/solr/data/test/index/segments_q76 +0 -0
  191. data/spec/factories/{patron.rb → agent.rb} +3 -3
  192. data/spec/factories/create.rb +1 -1
  193. data/spec/factories/donate.rb +1 -1
  194. data/spec/factories/own.rb +1 -1
  195. data/spec/factories/patron_relationship.rb +3 -3
  196. data/spec/factories/patron_relationship_type.rb +2 -2
  197. data/spec/factories/patron_type.rb +2 -2
  198. data/spec/factories/produce.rb +1 -1
  199. data/spec/factories/realize.rb +1 -1
  200. data/spec/fixtures/{patron_import_files.yml → agent_import_files.yml} +18 -18
  201. data/spec/fixtures/{patron_import_results.yml → agent_import_results.yml} +7 -7
  202. data/spec/fixtures/{patron_relationship_types.yml → agent_relationship_types.yml} +4 -4
  203. data/spec/fixtures/{patron_relationships.yml → agent_relationships.yml} +4 -4
  204. data/spec/fixtures/{patron_types.yml → agent_types.yml} +4 -4
  205. data/spec/fixtures/{patrons.yml → agents.yml} +47 -47
  206. data/spec/fixtures/creates.yml +8 -8
  207. data/spec/fixtures/donates.yml +4 -4
  208. data/spec/fixtures/owns.yml +3 -3
  209. data/spec/fixtures/picture_files.yml +1 -1
  210. data/spec/fixtures/produces.yml +20 -20
  211. data/spec/fixtures/realizes.yml +11 -11
  212. data/spec/fixtures/reserves.yml +1 -1
  213. data/spec/models/agent_import_file_spec.rb +96 -0
  214. data/spec/models/{patron_import_result_spec.rb → agent_import_result_spec.rb} +4 -4
  215. data/spec/models/{patron_relationship_spec.rb → agent_relationship_spec.rb} +3 -3
  216. data/spec/models/{patron_relationship_type_spec.rb → agent_relationship_type_spec.rb} +2 -2
  217. data/spec/models/{patron_spec.rb → agent_spec.rb} +16 -16
  218. data/spec/models/{patron_type_spec.rb → agent_type_spec.rb} +2 -2
  219. data/spec/models/create_spec.rb +1 -1
  220. data/spec/models/donate_spec.rb +1 -1
  221. data/spec/models/manifestation_spec.rb +1 -1
  222. data/spec/models/own_spec.rb +1 -1
  223. data/spec/models/produce_spec.rb +1 -1
  224. data/spec/models/realize_spec.rb +1 -1
  225. data/spec/models/resource_import_file_spec.rb +8 -8
  226. data/spec/requests/agents_spec.rb +9 -0
  227. data/spec/routing/agent_relationship_types_routing_spec.rb +35 -0
  228. data/spec/routing/agent_relationships_routing_spec.rb +35 -0
  229. data/spec/routing/agents_routing_spec.rb +35 -0
  230. data/spec/views/creates/edit.html.erb_spec.rb +1 -1
  231. data/spec/views/creates/index.html.erb_spec.rb +2 -2
  232. data/spec/views/creates/new.html.erb_spec.rb +1 -1
  233. data/spec/views/creates/show.html.erb_spec.rb +1 -1
  234. data/spec/views/owns/edit.html.erb_spec.rb +1 -1
  235. data/spec/views/owns/index.html.erb_spec.rb +2 -2
  236. data/spec/views/owns/new.html.erb_spec.rb +1 -1
  237. data/spec/views/owns/show.html.erb_spec.rb +1 -1
  238. data/spec/views/produces/edit.html.erb_spec.rb +2 -2
  239. data/spec/views/produces/index.html.erb_spec.rb +2 -2
  240. data/spec/views/produces/new.html.erb_spec.rb +2 -2
  241. data/spec/views/produces/show.html.erb_spec.rb +1 -1
  242. data/spec/views/realizes/edit.html.erb_spec.rb +2 -2
  243. data/spec/views/realizes/index.html.erb_spec.rb +2 -2
  244. data/spec/views/realizes/new.html.erb_spec.rb +2 -2
  245. data/spec/views/realizes/show.html.erb_spec.rb +1 -1
  246. metadata +131 -187
  247. data/app/models/patron_import_result.rb +0 -26
  248. data/app/views/patron_import_files/index.html.erb +0 -40
  249. data/app/views/patron_import_files/show.html.erb +0 -69
  250. data/app/views/patron_import_results/index.csv.erb +0 -3
  251. data/app/views/patron_import_results/index.html.erb +0 -52
  252. data/app/views/patron_import_results/show.html.erb +0 -38
  253. data/app/views/patron_relationship_types/index.html.erb +0 -43
  254. data/app/views/patron_relationship_types/show.html.erb +0 -29
  255. data/app/views/patron_relationships/index.html.erb +0 -34
  256. data/app/views/patron_relationships/show.html.erb +0 -24
  257. data/app/views/patron_types/index.html.erb +0 -43
  258. data/app/views/patron_types/show.html.erb +0 -29
  259. data/app/views/patrons/_index_patron.html.erb +0 -71
  260. data/app/views/patrons/_index_patron_merge_list.html.erb +0 -53
  261. data/app/views/patrons/_patron.html.erb +0 -13
  262. data/app/views/patrons/_patron_list.html.erb +0 -18
  263. data/app/views/patrons/edit.html.erb +0 -16
  264. data/app/views/patrons/index.atom.builder +0 -10
  265. data/app/views/patrons/show.html.erb +0 -152
  266. data/app/views/patrons/show.mobile.erb +0 -69
  267. data/db/migrate/20081028083142_create_patron_import_files.rb +0 -22
  268. data/db/migrate/20100606073747_create_patron_relationships.rb +0 -13
  269. data/db/migrate/20100814091104_add_position_to_patron_relationship.rb +0 -11
  270. data/db/migrate/20100925074559_create_patron_import_results.rb +0 -12
  271. data/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +0 -11
  272. data/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +0 -5
  273. data/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +0 -5
  274. data/db/migrate/20120511072422_add_patron_identifier_to_patron.rb +0 -6
  275. data/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +0 -5
  276. data/spec/controllers/patron_import_files_controller_spec.rb +0 -321
  277. data/spec/controllers/patron_relationship_types_controller_spec.rb +0 -445
  278. data/spec/controllers/patron_relationships_controller_spec.rb +0 -446
  279. data/spec/controllers/patron_types_controller_spec.rb +0 -447
  280. data/spec/controllers/patrons_controller_spec.rb +0 -644
  281. data/spec/dummy/app/mailers/notifier.rb +0 -40
  282. data/spec/dummy/lib/plugins/ext/event-calendar.rb +0 -38
  283. data/spec/dummy/lib/plugins/ext/sunspot/abstract_search.rb +0 -12
  284. data/spec/dummy/lib/plugins/ext/sunspot/dismax.rb +0 -41
  285. data/spec/dummy/lib/plugins/ext/sunspot/start_record.rb +0 -55
  286. data/spec/dummy/lib/plugins/ext/sunspot.rb +0 -3
  287. data/spec/dummy/lib/plugins/ext.rb +0 -1
  288. data/spec/dummy/lib/plugins.rb +0 -2
  289. data/spec/dummy/solr/data/test/index/_goc.fdt +0 -0
  290. data/spec/dummy/solr/data/test/index/_goc.fdx +0 -0
  291. data/spec/dummy/solr/data/test/index/_goc.fnm +0 -7
  292. data/spec/dummy/solr/data/test/index/_goc.frq +0 -0
  293. data/spec/dummy/solr/data/test/index/_goc.nrm +0 -1
  294. data/spec/dummy/solr/data/test/index/_goc.prx +0 -0
  295. data/spec/dummy/solr/data/test/index/_goc.tii +0 -0
  296. data/spec/dummy/solr/data/test/index/_goc.tis +0 -0
  297. data/spec/dummy/solr/data/test/index/_god.fdt +0 -0
  298. data/spec/dummy/solr/data/test/index/_god.fdx +0 -0
  299. data/spec/dummy/solr/data/test/index/_god.fnm +0 -7
  300. data/spec/dummy/solr/data/test/index/_god.frq +0 -0
  301. data/spec/dummy/solr/data/test/index/_god.nrm +0 -1
  302. data/spec/dummy/solr/data/test/index/_god.prx +0 -0
  303. data/spec/dummy/solr/data/test/index/_god.tii +0 -0
  304. data/spec/dummy/solr/data/test/index/_god.tis +0 -0
  305. data/spec/dummy/solr/data/test/index/_goe.fdt +0 -0
  306. data/spec/dummy/solr/data/test/index/_goe.fdx +0 -0
  307. data/spec/dummy/solr/data/test/index/_goe.fnm +0 -8
  308. data/spec/dummy/solr/data/test/index/_goe.frq +0 -0
  309. data/spec/dummy/solr/data/test/index/_goe.nrm +0 -1
  310. data/spec/dummy/solr/data/test/index/_goe.prx +0 -0
  311. data/spec/dummy/solr/data/test/index/_goe.tii +0 -0
  312. data/spec/dummy/solr/data/test/index/_goe.tis +0 -0
  313. data/spec/dummy/solr/data/test/index/segments_otc +0 -0
  314. data/spec/dummy/tmp/cache/4AD/470/country_all +0 -0
  315. data/spec/models/patron_import_file_spec.rb +0 -96
  316. data/spec/requests/patrons_spec.rb +0 -9
  317. data/spec/routing/patron_relationship_types_routing_spec.rb +0 -35
  318. data/spec/routing/patron_relationships_routing_spec.rb +0 -35
  319. data/spec/routing/patrons_routing_spec.rb +0 -35
@@ -184,7 +184,7 @@ describe OwnsController do
184
184
  assigns(:own).should be_valid
185
185
  end
186
186
 
187
- it "redirects to the created patron" do
187
+ it "redirects to the created agent" do
188
188
  post :create, :own => @attrs
189
189
  response.should redirect_to(assigns(:own))
190
190
  end
@@ -212,7 +212,7 @@ describe OwnsController do
212
212
  assigns(:own).should be_valid
213
213
  end
214
214
 
215
- it "redirects to the created patron" do
215
+ it "redirects to the created agent" do
216
216
  post :create, :own => @attrs
217
217
  response.should redirect_to(assigns(:own))
218
218
  end
@@ -128,7 +128,7 @@ describe ResourceImportFilesController do
128
128
  sign_in @user
129
129
  end
130
130
 
131
- it "should create patron_import_file" do
131
+ it "should create agent_import_file" do
132
132
  post :create, :resource_import_file => {:resource_import => fixture_file_upload("/../../examples/resource_import_file_sample1.tsv", 'text/csv') }
133
133
  assigns(:resource_import_file).should be_valid
134
134
  assigns(:resource_import_file).user.username.should eq @user.username
@@ -1,226 +1,9 @@
1
1
  # Methods added to this helper will be available to all templates in the application.
2
2
  module ApplicationHelper
3
- include PictureFilesHelper if defined?(EnjuLibrary)
4
- include EnjuManifestationViewer::ManifestationViewerHelper if defined?(EnjuManifestationViewer)
5
-
6
- def form_icon(carrier_type)
7
- case carrier_type.name
8
- when 'print'
9
- image_tag('icons/book.png', :size => '16x16', :alt => carrier_type.display_name.localize)
10
- when 'CD'
11
- image_tag('icons/cd.png', :size => '16x16', :alt => carrier_type.display_name.localize)
12
- when 'DVD'
13
- image_tag('icons/dvd.png', :size => '16x16', :alt => carrier_type.display_name.localize)
14
- when 'file'
15
- image_tag('icons/monitor.png', :size => '16x16', :alt => carrier_type.display_name.localize)
16
- else
17
- image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
18
- end
19
- rescue NoMethodError
20
- image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
21
- end
22
-
23
- def content_type_icon(content_type)
24
- case content_type.name
25
- when 'text'
26
- image_tag('icons/page_white_text.png', :size => '16x16', :alt => content_type.display_name.localize)
27
- when 'picture'
28
- image_tag('icons/picture.png', :size => '16x16', :alt => content_type.display_name.localize)
29
- when 'sound'
30
- image_tag('icons/sound.png', :size => '16x16', :alt => content_type.display_name.localize)
31
- when 'video'
32
- image_tag('icons/film.png', :size => '16x16', :alt => content_type.display_name.localize)
33
- else
34
- image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
35
- end
36
- rescue NoMethodError
37
- image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
38
- end
39
-
40
- def patron_type_icon(patron_type)
41
- case patron_type
42
- when 'Person'
43
- image_tag('icons/user.png', :size => '16x16', :alt => 'Person')
44
- when 'CorporateBody'
45
- image_tag('icons/group.png', :size => '16x16', :alt => 'CorporateBody')
46
- else
47
- image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
48
- end
49
- end
50
-
51
- def link_to_tag(tag)
52
- link_to tag, manifestations_path(:tag => tag.name)
53
- end
54
-
55
- def render_tag_cloud(tags, options = {})
56
- return nil if tags.nil?
57
- # TODO: add options to specify different limits and sorts
58
- #tags = Tag.all(:limit => 100, :order => 'taggings_count DESC').sort_by(&:name)
59
-
60
- # TODO: add option to specify which classes you want and overide this if you want?
61
- classes = %w(popular v-popular vv-popular vvv-popular vvvv-popular)
62
-
63
- max, min = 0, 0
64
- tags.each do |tag|
65
- #if options[:max] or options[:min]
66
- # max = options[:max].to_i
67
- # min = options[:min].to_i
68
- #end
69
- max = tag.taggings.size if tag.taggings.size > max
70
- min = tag.taggings.size if tag.taggings.size < min
71
- end
72
- divisor = ((max - min).div(classes.size)) + 1
73
-
74
- content_tag :div, :class => "hTagcloud" do
75
- content_tag :ul, :class => "popularity" do
76
- tags.each do |tag|
77
- content_tag :li do
78
- link_to(tag.name, manifestations_path(:tag => tag.name), :class => classes[(tag.taggings.size - min).div(divisor)])
79
- end
80
- end
81
- end
82
- end
83
- end
84
-
85
- def patrons_list(patrons = [], options = {})
86
- return nil if patrons.blank?
87
- patrons_list = []
88
- if options[:nolink]
89
- patrons_list = patrons.map{|patron| patron.full_name}
90
- else
91
- patrons_list = patrons.map{|patron| link_to(patron.full_name, patron, options)}
92
- end
93
- patrons_list.join(" ").html_safe
94
- end
95
-
96
- def book_jacket(manifestation)
97
- if manifestation.picture_files.exists?
98
- link = ''
99
- manifestation.picture_files.each_with_index do |picture_file, i|
100
- if i == 0
101
- link += link_to(show_image(picture_file, :size => :thumb), picture_file_path(picture_file, :format => :download), :rel => "manifestation_#{manifestation.id}")
102
- else
103
- link += content_tag :span, :style => "display: none" do
104
- link_to(show_image(picture_file, :size => :thumb), picture_file_path(picture_file, :format => :download), :rel => "manifestation_#{manifestation.id}")
105
- end
106
- end
107
- end
108
- return link.html_safe
109
- else
110
- link = book_jacket_tag(manifestation)
111
- unless link
112
- link = screenshot_tag(manifestation)
113
- end
114
- end
115
-
116
- unless link
117
- link = link_to image_tag('unknown_resource.png', :width => '100', :height => '100', :alt => '*', :itemprop => 'image'), manifestation
118
- end
119
- link
120
- end
121
-
122
- def database_adapter
123
- case ActiveRecord::Base.configurations["#{Rails.env}"]['adapter']
124
- when 'postgresql'
125
- link_to 'PostgreSQL', 'http://www.postgresql.org/'
126
- when 'jdbcpostgresql'
127
- link_to 'PostgreSQL', 'http://www.postgresql.org/'
128
- when 'mysql'
129
- link_to 'MySQL', 'http://www.mysql.org/'
130
- when 'jdbcmysql'
131
- link_to 'MySQL', 'http://www.mysql.org/'
132
- when 'sqlite3'
133
- link_to 'SQLite', 'http://www.sqlite.org/'
134
- when 'jdbcsqlite3'
135
- link_to 'SQLite', 'http://www.sqlite.org/'
136
- end
137
- end
138
-
139
- def title_action_name
140
- case controller.action_name
141
- when 'index'
142
- t('title.index')
143
- when 'show'
144
- t('title.show')
145
- when 'new'
146
- t('title.new')
147
- when 'edit'
148
- t('title.edit')
149
- end
150
- end
151
-
152
- def link_to_wikipedia(string)
153
- link_to "Wikipedia", "http://#{I18n.locale}.wikipedia.org/wiki/#{URI.escape(string)}"
154
- end
155
-
156
- def locale_display_name(locale)
157
- Language.where(:iso_639_1 => locale).first.display_name
158
- end
159
-
160
- def locale_native_name(locale)
161
- Language.where(:iso_639_1 => locale).first.native_name
162
- end
163
-
164
- def move_position(object)
165
- render :partial => 'page/position', :locals => {:object => object}
166
- end
167
-
168
- def localized_state(state)
169
- case state
170
- when 'pending'
171
- t('state.pending')
172
- when 'canceled'
173
- t('state.canceled')
174
- when 'started'
175
- t('state.started')
176
- when 'failed'
177
- t('state.failed')
178
- when 'completed'
179
- t('state.completed')
180
- else
181
- state
182
- end
183
- end
184
-
185
- def localized_boolean(bool)
186
- case bool.to_s
187
- when nil
188
- when "true"
189
- t('page.boolean.true')
190
- when "false"
191
- t('page.boolean.false')
192
- end
193
- end
194
-
195
- def current_user_role_name
196
- current_user.try(:role).try(:name) || 'Guest'
197
- end
198
-
199
- def title(controller_name)
200
- string = ''
201
- unless ['page', 'routing_error', 'my_accounts'].include?(controller_name)
202
- string << t("activerecord.models.#{controller_name.singularize}") + ' - '
203
- end
204
- if controller_name == 'routing_error'
205
- string << t("page.routing_error") + ' - '
206
- end
207
- string << LibraryGroup.system_name + ' - Next-L Enju Leaf'
208
- string.html_safe
209
- end
210
-
211
- def back_to_index(options = {})
212
- if options == nil
213
- options = {}
214
- else
215
- options.reject!{|key, value| value.blank?}
216
- options.delete(:page) if options[:page].to_i == 1
217
- end
218
- unless controller_name == 'test'
219
- link_to t('page.listing', :model => t("activerecord.models.#{controller_name.singularize}")), url_for(params.merge(:controller => controller_name, :action => :index, :id => nil, :only_path => true).merge(options))
220
- end
221
- end
222
-
223
- def set_focus_on_search_form
224
- javascript_tag("$('#search_form').focus()") if @query.blank?
3
+ include EnjuLeaf::EnjuLeafHelper
4
+ include EnjuBiblio::BiblioHelper if defined?(EnjuBiblio)
5
+ if defined?(EnjuManifestationViewer)
6
+ include EnjuManifestationViewer::BookJacketHelper
7
+ include EnjuManifestationViewer::ManifestationViewerHelper
225
8
  end
226
9
  end
@@ -31,10 +31,10 @@
31
31
  ManifestationRelationship,
32
32
  ManifestationRelationshipType,
33
33
  Own,
34
- Patron,
35
- PatronImportFile,
36
- PatronRelationship,
37
- PatronRelationshipType,
34
+ Agent,
35
+ AgentImportFile,
36
+ AgentRelationship,
37
+ AgentRelationshipType,
38
38
  PictureFile,
39
39
  Produce,
40
40
  ProduceType,
@@ -52,7 +52,7 @@
52
52
  Language,
53
53
  License,
54
54
  MediumOfPerformance,
55
- PatronType,
55
+ AgentType,
56
56
  RequestStatusType,
57
57
  RequestType
58
58
  ] if LibraryGroup.site_config.network_access_allowed?(ip_address)
@@ -67,8 +67,8 @@
67
67
  Language,
68
68
  License,
69
69
  MediumOfPerformance,
70
- PatronImportResult,
71
- PatronType,
70
+ AgentImportResult,
71
+ AgentType,
72
72
  RequestStatusType,
73
73
  RequestType,
74
74
  ResourceImportResult
@@ -80,12 +80,12 @@
80
80
  can [:destroy, :delete], Manifestation do |manifestation|
81
81
  manifestation.items.empty? and !manifestation.series_master?
82
82
  end
83
- can [:index, :create], Patron
84
- can :show, Patron do |patron|
85
- patron.required_role_id <= 3
83
+ can [:index, :create], Agent
84
+ can :show, Agent do |agent|
85
+ agent.required_role_id <= 3
86
86
  end
87
- can [:update, :destroy, :delete], Patron do |patron|
88
- !patron.user.try(:has_role?, 'Librarian') and patron.required_role_id <= 3
87
+ can [:update, :destroy, :delete], Agent do |agent|
88
+ !agent.user.try(:has_role?, 'Librarian') and agent.required_role_id <= 3
89
89
  end
90
90
  can :manage, [
91
91
  Create,
@@ -95,8 +95,8 @@
95
95
  ImportRequest,
96
96
  ManifestationRelationship,
97
97
  Own,
98
- PatronImportFile,
99
- PatronRelationship,
98
+ AgentImportFile,
99
+ AgentRelationship,
100
100
  PictureFile,
101
101
  Produce,
102
102
  Realize,
@@ -114,9 +114,9 @@
114
114
  Language,
115
115
  License,
116
116
  ManifestationRelationshipType,
117
- PatronImportResult,
118
- PatronRelationshipType,
119
- PatronType,
117
+ AgentImportResult,
118
+ AgentRelationshipType,
119
+ AgentType,
120
120
  RequestStatusType,
121
121
  RequestType,
122
122
  ResourceImportResult,
@@ -131,15 +131,15 @@
131
131
  can [:show, :edit], Manifestation do |manifestation|
132
132
  manifestation.required_role_id <= 2
133
133
  end
134
- can :index, Patron
135
- can :update, Patron do |patron|
136
- patron.user == user
134
+ can :index, Agent
135
+ can :update, Agent do |agent|
136
+ agent.user == user
137
137
  end
138
- can :show, Patron do |patron|
139
- #if patron.user == user
138
+ can :show, Agent do |agent|
139
+ #if agent.user == user
140
140
  # true
141
- #elsif patron.user != user
142
- true if patron.required_role_id <= 2 #name == 'Administrator'
141
+ #elsif agent.user != user
142
+ true if agent.required_role_id <= 2 #name == 'Administrator'
143
143
  #end
144
144
  end
145
145
  can :index, PictureFile
@@ -167,8 +167,8 @@
167
167
  ManifestationRelationshipType,
168
168
  MediumOfPerformance,
169
169
  Own,
170
- PatronRelationship,
171
- PatronRelationshipType,
170
+ AgentRelationship,
171
+ AgentRelationshipType,
172
172
  Produce,
173
173
  Realize,
174
174
  SeriesStatement
@@ -178,9 +178,9 @@
178
178
  can :show, Manifestation do |manifestation|
179
179
  manifestation.required_role_id == 1
180
180
  end
181
- can :index, Patron
182
- can :show, Patron do |patron|
183
- patron.required_role_id == 1 #name == 'Guest'
181
+ can :index, Agent
182
+ can :show, Agent do |agent|
183
+ agent.required_role_id == 1 #name == 'Guest'
184
184
  end
185
185
  can :read, [
186
186
  CarrierType,
@@ -200,8 +200,8 @@
200
200
  ManifestationRelationshipType,
201
201
  MediumOfPerformance,
202
202
  Own,
203
- PatronRelationship,
204
- PatronRelationshipType,
203
+ AgentRelationship,
204
+ AgentRelationshipType,
205
205
  PictureFile,
206
206
  Produce,
207
207
  Realize,
@@ -1,4 +1,4 @@
1
- class LocalPatron
1
+ class LocalAgent
2
2
  include ActiveModel::Validations
3
3
  include ActiveModel::Conversion
4
4
  extend ActiveModel::Naming
@@ -7,7 +7,7 @@ class User < ActiveRecord::Base
7
7
  # Setup accessible (or protected) attributes for your model
8
8
  attr_accessible :email, :password, :password_confirmation, :remember_me
9
9
 
10
- has_one :patron
10
+ #has_one :agent
11
11
  has_one :user_has_role
12
12
  has_one :role, :through => :user_has_role
13
13
  belongs_to :user_group
@@ -79,8 +79,8 @@ class User < ActiveRecord::Base
79
79
  enju_bookmark_user_model if defined?(EnjuBookmark)
80
80
  enju_message_user_model if defined?(EnjuBookmark)
81
81
 
82
- def patron
83
- LocalPatron.new(self)
82
+ def agent
83
+ LocalAgent.new(self)
84
84
  end
85
85
 
86
86
  def full_name
@@ -64,4 +64,3 @@ require 'enju_export'
64
64
  require 'enju_ndl'
65
65
  require 'enju_subject'
66
66
  require 'mobylette'
67
- require 'plugins'
@@ -1,4 +1,5 @@
1
1
  Dummy::Application.configure do
2
+ config.action_mailer.default_url_options = {:host => 'localhost:3000'}
2
3
  # Settings specified here will take precedence over those in config/application.rb
3
4
 
4
5
  # The test environment is used exclusively to run your application's
Binary file
@@ -11,7 +11,7 @@ class CreateReserves < ActiveRecord::Migration
11
11
  t.datetime :expired_at
12
12
  t.datetime :deleted_at
13
13
  t.string :state
14
- t.boolean :expiration_notice_to_patron, :default => false
14
+ t.boolean :expiration_notice_to_agent, :default => false
15
15
  t.boolean :expiration_notice_to_library, :default => false
16
16
  end
17
17
 
@@ -1,14 +1,14 @@
1
1
  class CreateParticipates < ActiveRecord::Migration
2
2
  def self.up
3
3
  create_table :participates do |t|
4
- t.integer :patron_id, :null => false
4
+ t.integer :agent_id, :null => false
5
5
  t.integer :event_id, :null => false
6
6
  t.integer :position
7
7
 
8
8
  t.timestamps
9
9
  end
10
10
  add_index :participates, :event_id
11
- add_index :participates, :patron_id
11
+ add_index :participates, :agent_id
12
12
  end
13
13
 
14
14
  def self.down