enju_circulation 0.1.0.pre16 → 0.1.0.pre17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/reserves_controller.rb +5 -4
  3. data/app/models/reserve.rb +1 -2
  4. data/config/locales/translation_en.yml +1 -0
  5. data/config/locales/translation_ja.yml +1 -0
  6. data/lib/enju_circulation/version.rb +1 -1
  7. data/lib/generators/enju_circulation/setup/USAGE +8 -0
  8. data/lib/generators/enju_circulation/setup/setup_generator.rb +8 -0
  9. data/lib/generators/enju_circulation/setup/templates/db/fixtures/carrier_type_has_checkout_types.yml +8 -0
  10. data/lib/generators/enju_circulation/setup/templates/db/fixtures/carrier_types.yml +29 -0
  11. data/lib/generators/enju_circulation/setup/templates/db/fixtures/checkout_types.yml +22 -0
  12. data/lib/generators/enju_circulation/setup/templates/db/fixtures/circulation_statuses.yml +106 -0
  13. data/lib/generators/enju_circulation/setup/templates/db/fixtures/use_restrictions.yml +79 -0
  14. data/lib/tasks/enju_circulation_tasks.rake +6 -5
  15. data/spec/dummy/db/test.sqlite3 +0 -0
  16. data/spec/dummy/solr/data/test/index/{_12z.fdt → _1bn.fdt} +0 -0
  17. data/spec/dummy/solr/data/test/index/{_12z.fdx → _1bn.fdx} +0 -0
  18. data/spec/dummy/solr/data/test/index/{_12z.fnm → _1bn.fnm} +0 -0
  19. data/spec/dummy/solr/data/test/index/{_12z.frq → _1bn.frq} +0 -0
  20. data/spec/dummy/solr/data/test/index/{_12z.nrm → _1bn.nrm} +0 -0
  21. data/spec/dummy/solr/data/test/index/{_12z.prx → _1bn.prx} +0 -0
  22. data/spec/dummy/solr/data/test/index/{_12z.tii → _1bn.tii} +0 -0
  23. data/spec/dummy/solr/data/test/index/{_12z.tis → _1bn.tis} +0 -0
  24. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  25. data/spec/dummy/solr/data/test/index/segments_2nd +0 -0
  26. metadata +40 -33
  27. data/spec/dummy/solr/data/test/index/segments_261 +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f86efed31c18ea347f1658523aab6bd370f1841
4
- data.tar.gz: 61f456e339046fd324677c83eb51d1c87184919a
3
+ metadata.gz: fec219b16955e4c0948c4eac32f42d0eb65853db
4
+ data.tar.gz: a06d2a6379e17f5b5ac6834d5078781204ffa9a0
5
5
  SHA512:
6
- metadata.gz: 49d8ab628ce347d257b9f20eac121778fbf0a71b27087aa3aa38093519881406206a8f8744d1e387c0ad122d1087dd4c2fd0eeb70d1943da1662df84b8435991
7
- data.tar.gz: 65f319e166213426075e0c833144bae589d1301980143ca532407ded3e60fccaa6586196b8723d82e7f66bd29a32f8029aa58429d4f371b9a8c54f8e681f2f9f
6
+ metadata.gz: da8dc3e8fb1e4e029dcef94f6417d23c26f8383a5e530a0e3899a7f6f5e63d9f9472b70d6669bca0afd5493e6d2e41898006f611c7a4c68dd8dd8ba959fc3f73
7
+ data.tar.gz: 843ba68dff6dd627473e2adf95bf310ae6a59a742fecc8c2cc35f2d7a801af76e122ff8c77b7444f43e4f72d1495f25053703797d626b77e39cee87412fa4d1c
@@ -157,14 +157,15 @@ class ReservesController < ApplicationController
157
157
  # POST /reserves
158
158
  # POST /reserves.json
159
159
  def create
160
- @reserve = Reserve.new(params[:reserve])
161
- @reserve.set_user
162
-
163
160
  if current_user.has_role?('Librarian')
161
+ @reserve = Reserve.new(params[:reserve], :as => :admin)
162
+ @reserve.set_user
164
163
  unless @reserve.user
165
164
  @reserve.user = @user
166
165
  end
167
166
  else
167
+ @reserve = Reserve.new(params[:reserve], :as => :user)
168
+ @reserve.set_user
168
169
  if @reserve.user != current_user
169
170
  if @user != current_user
170
171
  access_denied; return
@@ -194,7 +195,7 @@ class ReservesController < ApplicationController
194
195
  if @reserve.user != current_user
195
196
  access_denied; return
196
197
  end
197
- @reserve.assign_attributes(params[:reserve], :as => :user_update)
198
+ @reserve.assign_attributes(params[:reserve], :as => :user)
198
199
  end
199
200
 
200
201
  if @reserve.valid?
@@ -1,7 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  class Reserve < ActiveRecord::Base
3
- attr_accessible :manifestation_id, :user_number, :expired_at
4
- attr_accessible :expired_at, :as => :user_update
3
+ attr_accessible :manifestation_id, :user_number, :expired_at, :as => :user
5
4
  attr_accessible :manifestation_id, :item_identifier, :user_number,
6
5
  :expired_at, :request_status_type, :canceled_at, :checked_out_at,
7
6
  :expiration_notice_to_patron, :expiration_notice_to_library, :item_id,
@@ -47,6 +47,7 @@ en:
47
47
  postponed_at: Postponed at
48
48
  state: State
49
49
  force_retaining: Force retaining
50
+ item_identifier: Item identifier
50
51
  checkout_type:
51
52
  name: Name
52
53
  display_name: Display name
@@ -45,6 +45,7 @@ ja:
45
45
  postponed_at: 取置取消時刻
46
46
  state: 状態
47
47
  force_retaining: 強制的に取り置きを行う
48
+ item_identifier: 個別資料ID
48
49
  checkout_type:
49
50
  name: 名前
50
51
  display_name: 表示名
@@ -1,3 +1,3 @@
1
1
  module EnjuCirculation
2
- VERSION = "0.1.0.pre16"
2
+ VERSION = "0.1.0.pre17"
3
3
  end
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Explain the generator
3
+
4
+ Example:
5
+ rails generate setup Thing
6
+
7
+ This will create:
8
+ what/will/it/create
@@ -0,0 +1,8 @@
1
+ class EnjuCirculation::SetupGenerator < Rails::Generators::Base
2
+ source_root File.expand_path('../templates', __FILE__)
3
+
4
+ def copy_setup_files
5
+ directory("db/fixtures", "db/fixtures/enju_circulation")
6
+ rake("enju_circulation_engine:install:migrations")
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ carrier_type_has_checkout_type_00001:
4
+ id: 1
5
+ carrier_type_id: 1
6
+ checkout_type_id: 1
7
+ note:
8
+ position: 1
@@ -0,0 +1,29 @@
1
+ ---
2
+ carrier_type_00004:
3
+ name: file
4
+ display_name: "en: file\r\n\
5
+ ja: コンピュータファイル"
6
+ id: 4
7
+ note:
8
+ position: 4
9
+ carrier_type_00001:
10
+ name: print
11
+ display_name: "en: print\r\n\
12
+ ja: 印刷物"
13
+ id: 1
14
+ note: !binary |
15
+ position: 1
16
+ carrier_type_00002:
17
+ name: CD
18
+ display_name: "en: CD\r\n\
19
+ ja: CD"
20
+ id: 2
21
+ note:
22
+ position: 2
23
+ carrier_type_00003:
24
+ name: DVD
25
+ display_name: "en: DVD\r\n\
26
+ ja: DVD"
27
+ id: 3
28
+ note:
29
+ position: 3
@@ -0,0 +1,22 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ checkout_type_00001:
4
+ id: 1
5
+ name: book
6
+ display_name: "en: Book\r\n\
7
+ ja: 図書"
8
+ note:
9
+ position: 1
10
+ checkout_type_00002:
11
+ id: 2
12
+ name: serial
13
+ display_name: "en: Serial\r\n\
14
+ ja: 定期刊行物"
15
+ note:
16
+ position: 2
17
+ checkout_type_00003:
18
+ id: 3
19
+ name: cd
20
+ display_name: CD
21
+ note:
22
+ position: 3
@@ -0,0 +1,106 @@
1
+ ---
2
+ circulation_status_00001:
3
+ name: Available For Pickup
4
+ display_name: "en: Available For Pickup\r\n\
5
+ ja: 持ち出し可能"
6
+ id: 1
7
+ note: ""
8
+ position: 1
9
+ circulation_status_00002:
10
+ name: Available On Shelf
11
+ display_name: "en: Available on Shelf\r\n\
12
+ ja: 在架(利用可能)"
13
+ id: 2
14
+ note: ""
15
+ position: 2
16
+ circulation_status_00003:
17
+ name: Circulation Status Undefined
18
+ display_name: Circulation Status Undefined
19
+ id: 3
20
+ note: ""
21
+ position: 3
22
+ circulation_status_00004:
23
+ name: Claimed Returned Or Never Borrowed
24
+ display_name: Claimed Returned Or Never Borrowed
25
+ id: 4
26
+ note: ""
27
+ position: 4
28
+ circulation_status_00005:
29
+ name: In Process
30
+ display_name: "en: In Process\r\n\
31
+ ja: 作業中"
32
+ id: 5
33
+ note: ""
34
+ position: 5
35
+ circulation_status_00006:
36
+ name: In Transit Between Library Locations
37
+ display_name: In Transit Between Library Locations
38
+ id: 6
39
+ note: ""
40
+ position: 6
41
+ circulation_status_00007:
42
+ name: Lost
43
+ display_name: "en: Lost\r\n\
44
+ ja: 紛失"
45
+ id: 7
46
+ note: ""
47
+ position: 7
48
+ circulation_status_00008:
49
+ name: Missing
50
+ display_name: "en: Missing\r\n\
51
+ ja: 行方不明"
52
+ id: 8
53
+ note: ""
54
+ position: 8
55
+ circulation_status_00009:
56
+ name: Not Available
57
+ display_name: "en: Not Available\r\n\
58
+ ja: 利用不可"
59
+ id: 9
60
+ note: ""
61
+ position: 9
62
+ circulation_status_00010:
63
+ name: On Loan
64
+ display_name: "en: On Loan\r\n\
65
+ ja: 貸出中"
66
+ id: 10
67
+ note: ""
68
+ position: 10
69
+ circulation_status_00011:
70
+ name: On Order
71
+ display_name: On Order
72
+ id: 11
73
+ note: ""
74
+ position: 11
75
+ circulation_status_00012:
76
+ name: Pending Transfer
77
+ display_name: Pending Transfer
78
+ id: 12
79
+ note: ""
80
+ position: 12
81
+ circulation_status_00013:
82
+ name: Recalled
83
+ display_name: Recalled
84
+ id: 13
85
+ note: ""
86
+ position: 13
87
+ circulation_status_00014:
88
+ name: Waiting To Be Reshelved
89
+ display_name: Waiting To Be Reshelved
90
+ id: 14
91
+ note: ""
92
+ position: 14
93
+ circulation_status_00015:
94
+ name: Not arrived
95
+ display_name: "en: Not arrived\r\n\
96
+ ja: 未着"
97
+ id: 15
98
+ note: ""
99
+ position: 15
100
+ circulation_status_00016:
101
+ name: Removed
102
+ display_name: "en: Removed\r\n\
103
+ ja: 除籍済み"
104
+ id: 16
105
+ note: ""
106
+ position: 16
@@ -0,0 +1,79 @@
1
+ ---
2
+ use_restriction_00001:
3
+ name: Available For Supply Without Return
4
+ display_name: Available For Supply Without Return
5
+ id: 1
6
+ position: 1
7
+ note: ""
8
+ use_restriction_00002:
9
+ name: In Library Use Only
10
+ display_name: "en: In Library Use Only\r\nja: 館内利用のみ可"
11
+ id: 2
12
+ position: 2
13
+ note: ""
14
+ use_restriction_00003:
15
+ name: Limited Circulation, Long Loan Period
16
+ display_name: "en: Limited Circulation, Long Loan Period\r\nja: 長期期間貸出"
17
+ id: 3
18
+ position: 3
19
+ note: ""
20
+ use_restriction_00004:
21
+ name: Limited Circulation, Normal Loan Period
22
+ display_name: "en: Limited Circulation, Normal Loan Period\r\nja: 通常期間貸出"
23
+ id: 4
24
+ position: 4
25
+ note: ""
26
+ use_restriction_00005:
27
+ name: Limited Circulation, Short Loan Period
28
+ display_name: "en: Limited Circulation, Short Loan Period\r\nja: 短期期間貸出"
29
+ id: 5
30
+ position: 5
31
+ note: ""
32
+ use_restriction_00006:
33
+ name: No Reproduction
34
+ display_name: No Reproduction
35
+ id: 6
36
+ position: 6
37
+ note: ""
38
+ use_restriction_00007:
39
+ name: Not For Loan
40
+ display_name: "en: Not For Loan\r\nja: 貸出不可"
41
+ id: 7
42
+ position: 7
43
+ note: ""
44
+ use_restriction_00008:
45
+ name: Overnight Only
46
+ display_name: "en: Overnight Only\r\nja: 一夜貸出のみ"
47
+ id: 8
48
+ position: 8
49
+ note: ""
50
+ use_restriction_00009:
51
+ name: Renewals Not Permitted
52
+ display_name: Renewals Not Permitted
53
+ id: 9
54
+ position: 9
55
+ note: ""
56
+ use_restriction_00010:
57
+ name: Supervision Required
58
+ display_name: Supervision Required
59
+ id: 10
60
+ position: 10
61
+ note: ""
62
+ use_restriction_00011:
63
+ name: Term Loan
64
+ display_name: Term Loan
65
+ id: 11
66
+ position: 11
67
+ note: ""
68
+ use_restriction_00012:
69
+ name: Use Only In Controlled Access
70
+ display_name: Use Only In Controlled Access
71
+ id: 12
72
+ position: 12
73
+ note: ""
74
+ use_restriction_00013:
75
+ name: User Signature Required
76
+ display_name: User Signature Required
77
+ id: 13
78
+ position: 13
79
+ note: ""
@@ -1,8 +1,9 @@
1
1
  require 'active_record/fixtures'
2
- desc "copy fixtures for enju_circulation"
3
- task :enju_circulation => :environment do
4
- path = File.expand_path(File.dirname(__FILE__)) + '/../../db/fixtures/'
5
- Dir.glob(path + '*.yml').each do |file|
6
- ActiveRecord::Fixtures.create_fixtures(path, File.basename(file, '.*'))
2
+ desc "create initial records for enju_circulation"
3
+ namespace :enju_circulation do
4
+ task :setup => :environment do
5
+ Dir.glob(Rails.root.to_s + '/db/fixtures/enju_circulation/*.yml').each do |file|
6
+ ActiveRecord::Fixtures.create_fixtures('db/fixtures/enju_circulation', File.basename(file, '.*'))
7
+ end
7
8
  end
8
9
  end
Binary file
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_circulation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre16
4
+ version: 0.1.0.pre17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kosuke Tanabe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-15 00:00:00.000000000 Z
11
+ date: 2013-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: enju_core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.13.rc2
19
+ version: 0.1.0.pre4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 3.2.13.rc2
26
+ version: 0.1.0.pre4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: simple_form
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: 0.1.14.pre4
89
+ version: 0.1.14.pre6
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
- version: 0.1.14.pre4
96
+ version: 0.1.14.pre6
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: enju_event
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: 0.1.17.pre6
103
+ version: 0.1.17.pre8
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: 0.1.17.pre6
110
+ version: 0.1.17.pre8
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: sqlite3
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -170,42 +170,42 @@ dependencies:
170
170
  requirements:
171
171
  - - ~>
172
172
  - !ruby/object:Gem::Version
173
- version: 0.1.0.pre23
173
+ version: 0.1.0.pre28
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - ~>
179
179
  - !ruby/object:Gem::Version
180
- version: 0.1.0.pre23
180
+ version: 0.1.0.pre28
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: enju_library
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - ~>
186
186
  - !ruby/object:Gem::Version
187
- version: 0.1.0.pre11
187
+ version: 0.1.0.pre15
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - ~>
193
193
  - !ruby/object:Gem::Version
194
- version: 0.1.0.pre11
194
+ version: 0.1.0.pre15
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: enju_export
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - ~>
200
200
  - !ruby/object:Gem::Version
201
- version: 0.1.1.pre2
201
+ version: 0.1.1.pre3
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - ~>
207
207
  - !ruby/object:Gem::Version
208
- version: 0.1.1.pre2
208
+ version: 0.1.1.pre3
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: mobylette
211
211
  requirement: !ruby/object:Gem::Requirement
@@ -459,6 +459,13 @@ files:
459
459
  - lib/enju_circulation/user_group.rb
460
460
  - lib/enju_circulation/version.rb
461
461
  - lib/enju_circulation.rb
462
+ - lib/generators/enju_circulation/setup/setup_generator.rb
463
+ - lib/generators/enju_circulation/setup/templates/db/fixtures/carrier_type_has_checkout_types.yml
464
+ - lib/generators/enju_circulation/setup/templates/db/fixtures/carrier_types.yml
465
+ - lib/generators/enju_circulation/setup/templates/db/fixtures/checkout_types.yml
466
+ - lib/generators/enju_circulation/setup/templates/db/fixtures/circulation_statuses.yml
467
+ - lib/generators/enju_circulation/setup/templates/db/fixtures/use_restrictions.yml
468
+ - lib/generators/enju_circulation/setup/USAGE
462
469
  - lib/generators/enju_circulation/views_generator.rb
463
470
  - lib/tasks/enju_circulation_tasks.rake
464
471
  - MIT-LICENSE
@@ -613,16 +620,16 @@ files:
613
620
  - spec/dummy/solr/conf/spellings.txt
614
621
  - spec/dummy/solr/conf/stopwords.txt
615
622
  - spec/dummy/solr/conf/synonyms.txt
616
- - spec/dummy/solr/data/test/index/_12z.fdt
617
- - spec/dummy/solr/data/test/index/_12z.fdx
618
- - spec/dummy/solr/data/test/index/_12z.fnm
619
- - spec/dummy/solr/data/test/index/_12z.frq
620
- - spec/dummy/solr/data/test/index/_12z.nrm
621
- - spec/dummy/solr/data/test/index/_12z.prx
622
- - spec/dummy/solr/data/test/index/_12z.tii
623
- - spec/dummy/solr/data/test/index/_12z.tis
623
+ - spec/dummy/solr/data/test/index/_1bn.fdt
624
+ - spec/dummy/solr/data/test/index/_1bn.fdx
625
+ - spec/dummy/solr/data/test/index/_1bn.fnm
626
+ - spec/dummy/solr/data/test/index/_1bn.frq
627
+ - spec/dummy/solr/data/test/index/_1bn.nrm
628
+ - spec/dummy/solr/data/test/index/_1bn.prx
629
+ - spec/dummy/solr/data/test/index/_1bn.tii
630
+ - spec/dummy/solr/data/test/index/_1bn.tis
624
631
  - spec/dummy/solr/data/test/index/segments.gen
625
- - spec/dummy/solr/data/test/index/segments_261
632
+ - spec/dummy/solr/data/test/index/segments_2nd
626
633
  - spec/dummy/solr/data/test/spellchecker/segments.gen
627
634
  - spec/dummy/solr/data/test/spellchecker/segments_1
628
635
  - spec/factories/basket.rb
@@ -886,16 +893,16 @@ test_files:
886
893
  - spec/dummy/solr/conf/spellings.txt
887
894
  - spec/dummy/solr/conf/stopwords.txt
888
895
  - spec/dummy/solr/conf/synonyms.txt
889
- - spec/dummy/solr/data/test/index/_12z.fdt
890
- - spec/dummy/solr/data/test/index/_12z.fdx
891
- - spec/dummy/solr/data/test/index/_12z.fnm
892
- - spec/dummy/solr/data/test/index/_12z.frq
893
- - spec/dummy/solr/data/test/index/_12z.nrm
894
- - spec/dummy/solr/data/test/index/_12z.prx
895
- - spec/dummy/solr/data/test/index/_12z.tii
896
- - spec/dummy/solr/data/test/index/_12z.tis
896
+ - spec/dummy/solr/data/test/index/_1bn.fdt
897
+ - spec/dummy/solr/data/test/index/_1bn.fdx
898
+ - spec/dummy/solr/data/test/index/_1bn.fnm
899
+ - spec/dummy/solr/data/test/index/_1bn.frq
900
+ - spec/dummy/solr/data/test/index/_1bn.nrm
901
+ - spec/dummy/solr/data/test/index/_1bn.prx
902
+ - spec/dummy/solr/data/test/index/_1bn.tii
903
+ - spec/dummy/solr/data/test/index/_1bn.tis
897
904
  - spec/dummy/solr/data/test/index/segments.gen
898
- - spec/dummy/solr/data/test/index/segments_261
905
+ - spec/dummy/solr/data/test/index/segments_2nd
899
906
  - spec/dummy/solr/data/test/spellchecker/segments.gen
900
907
  - spec/dummy/solr/data/test/spellchecker/segments_1
901
908
  - spec/factories/basket.rb