enju_biblio 0.1.0.pre25 → 0.1.0.pre26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b77ffc96e4138749d604cd7468d23cd691939f2
4
- data.tar.gz: 02e4f25f8e4cb0b5cf8d9f68c4d3b3ec3a7ef705
3
+ metadata.gz: c13e2a38d5c6944c5ed3a848a94409d27c2e7ab3
4
+ data.tar.gz: fc303a17573c7c188a1a305ea929f0fe0f553cc6
5
5
  SHA512:
6
- metadata.gz: cbd34e6e8e4239b41e319fed7a0aa66580a295659976a91a8428a4c26e88e079d3a819a51318344535c3af0ef4dab5e4d91b73be4b24698454bc6f5aabc3aff4
7
- data.tar.gz: 4d08b3f0ffee4794ad852b2296d44ab7b42e890253510fe0def153e1bb16fb2357803a9b56b74ebc4379ea767f0a86a080cc8bc47195865391823fab68757883
6
+ metadata.gz: 8b0b4215ba1bf4a50dc52dce7c171f8948ffb060db270db63d7717c9de43fc8811bb1ede2b594715d4daa4a5aca1e422220adc38ca2db75dd5ba95ec8fd2bbab
7
+ data.tar.gz: f4a4891b39e3ebc5204c9f66fdf0e60a5e5f06a04dd94262f2ffef273dc37cfd252950eb07cf200ce7ff810de0e7be864ec348dea8f0e1ad654a6f7bf4b09f16
@@ -158,9 +158,11 @@ class ItemsController < ApplicationController
158
158
  # GET /items/1/edit
159
159
  def edit
160
160
  @item.library_id = @item.shelf.library_id
161
- unless @item.use_restriction
162
- @item.build_item_has_use_restriction
163
- @item.item_has_use_restriction.use_restriction = UseRestriction.where(:name => 'Not For Loan').first
161
+ if defined?(EnjuCirculation)
162
+ unless @item.use_restriction
163
+ @item.build_item_has_use_restriction
164
+ @item.item_has_use_restriction.use_restriction = UseRestriction.where(:name => 'Not For Loan').first
165
+ end
164
166
  end
165
167
  end
166
168
 
@@ -11,7 +11,7 @@ module EnjuBiblio
11
11
  end if LibraryGroup.site_config.network_access_allowed?(ip_address)
12
12
  can [:read, :create, :update], Item
13
13
  can [:destroy, :delete], Item do |item|
14
- item.deletable?
14
+ item.removable?
15
15
  end
16
16
  can [:read, :create, :update], Manifestation
17
17
  can [:destroy, :delete], Manifestation do |manifestation|
data/app/models/item.rb CHANGED
@@ -78,15 +78,13 @@ class Item < ActiveRecord::Base
78
78
  Addressable::URI.parse("#{LibraryGroup.site_config.url}manifestations/#{self.manifestation.id}").normalize.to_s if self.manifestation
79
79
  end
80
80
 
81
- def deletable?
82
- if circulation_status.name == 'Removed'
83
- return false
81
+ def removable?
82
+ if defined?(EnjuCirculation)
83
+ return false if circulation_status.name == 'Removed'
84
+ return false if checkouts.not_returned.exists?
85
+ true
84
86
  else
85
- if defined?(EnjuCirculation)
86
- checkouts.not_returned.empty?
87
- else
88
- true
89
- end
87
+ true
90
88
  end
91
89
  end
92
90
 
@@ -9,7 +9,7 @@ class Manifestation < ActiveRecord::Base
9
9
  :title_alternative_transcription, :description, :abstract, :available_at,
10
10
  :valid_until, :date_submitted, :date_accepted, :date_captured, :ndl_bib_id,
11
11
  :pub_date, :edition_string, :volume_number, :issue_number, :serial_number,
12
- :ndc, :content_type_id, :attachment,
12
+ :ndc, :content_type_id, :attachment, :classification_number,
13
13
  :series_has_manifestation_attributes
14
14
  attr_accessible :fulltext_content,
15
15
  :doi, :number_of_page_string
@@ -316,7 +316,7 @@ class ResourceImportFile < ActiveRecord::Base
316
316
  item_identifier = row['item_identifier'].to_s.strip
317
317
  item = Item.where(:item_identifier => item_identifier).first
318
318
  if item
319
- item.destroy if item.deletable?
319
+ item.destroy if item.removable?
320
320
  end
321
321
  row_num += 1
322
322
  end
@@ -41,7 +41,7 @@
41
41
  <%- end -%>
42
42
  <%- end -%>
43
43
  <%- end -%>
44
- </p>
44
+ </p>
45
45
 
46
46
  <p>
47
47
  <strong><%= t('activerecord.models.use_restriction') -%>:</strong>
@@ -12,9 +12,9 @@
12
12
  <% end %>
13
13
  <% end %>
14
14
  </td>
15
- <% if defined?(EnjuCirculation) %>
16
- <% if signed_in? %>
17
- <td id="edit_icons">
15
+ <% if signed_in? %>
16
+ <td id="edit_icons">
17
+ <% if defined?(EnjuCirculation) %>
18
18
  <% unless params[:mode] == 'add' %>
19
19
  <% if manifestation.is_reservable_by?(current_user) %>
20
20
  <%- reserve = manifestation.is_reserved_by?(current_user) -%>
@@ -26,36 +26,36 @@
26
26
  <% end %>
27
27
  <br />
28
28
  <% end %>
29
- <%- if can? :update, manifestation -%>
30
- <% unless params[:mode] == 'add' %>
31
- <%= link_to image_tag('icons/book_edit.png', :size => '16x16', :alt => t('page.edit')), edit_manifestation_path(manifestation) -%>
32
- <% if @series_statement %>
33
- <% if manifestation.series_statement == @series_statement %>
34
- <%= link_to t('page.destroy'), series_statement_series_has_manifestation_path(manifestation.series_statement, manifestation.series_has_manifestation), :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
35
- <% end %>
29
+ <% end %>
30
+ <%- if can? :update, manifestation -%>
31
+ <% unless params[:mode] == 'add' %>
32
+ <%= link_to image_tag('icons/book_edit.png', :size => '16x16', :alt => t('page.edit')), edit_manifestation_path(manifestation) -%>
33
+ <% if @series_statement %>
34
+ <% if manifestation.series_statement == @series_statement %>
35
+ <%= link_to t('page.destroy'), series_statement_series_has_manifestation_path(manifestation.series_statement, manifestation.series_has_manifestation), :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
36
36
  <% end %>
37
- <% else %>
38
- <% case %>
39
- <% when @index_patron[:creator] %>
40
- <%= link_to t('page.add'), new_patron_create_path(@index_patron[:creator], :work_id => manifestation.id) unless manifestation.creators.include?(@index_patron[:creator]) -%>
41
- <% when @index_patron[:contributor] %>
42
- <%= link_to t('page.add'), new_patron_realize_path(@index_patron[:contributor], :expression_id => manifestation.id) unless manifestation.contributors.include?(@index_patron[:contributor]) -%>
43
- <% when @index_patron[:publisher] %>
44
- <%= link_to t('page.add'), new_patron_produce_path(@index_patron[:publisher], :manifestation_id => manifestation.id) unless manifestation.publishers.include?(@index_patron[:publisher]) -%>
45
- <% when @series_statement %>
46
- <% unless manifestation.series_statement -%>
47
- <%= link_to t('page.add'), new_series_has_manifestation_path(:series_statement_id => @series_statement.id, :manifestation_id => manifestation.id) -%>
48
- <% end %>
49
- <% when @manifestation %>
50
- <%= link_to t('page.add'), new_manifestation_manifestation_relationship_path(@manifestation, :child_id => manifestation.id) unless @manifestation.derived_manifestations.include?(manifestation) or @manifestation == manifestation -%>
51
- <% when @item %>
52
- <%= link_to t('page.change'), edit_exemplify_path(@item.exemplify, :manifestation_id => manifestation.id) unless @item.manifestation == manifestation -%>
53
- <% else %>
54
- <%= link_to image_tag('icons/arrow_divide.png', :size => '16x16', :alt => t('manifestation.add_derivation')), manifestation_manifestations_path(manifestation, :mode => 'add') -%>
37
+ <% end %>
38
+ <% else %>
39
+ <% case %>
40
+ <% when @index_patron[:creator] %>
41
+ <%= link_to t('page.add'), new_patron_create_path(@index_patron[:creator], :work_id => manifestation.id) unless manifestation.creators.include?(@index_patron[:creator]) -%>
42
+ <% when @index_patron[:contributor] %>
43
+ <%= link_to t('page.add'), new_patron_realize_path(@index_patron[:contributor], :expression_id => manifestation.id) unless manifestation.contributors.include?(@index_patron[:contributor]) -%>
44
+ <% when @index_patron[:publisher] %>
45
+ <%= link_to t('page.add'), new_patron_produce_path(@index_patron[:publisher], :manifestation_id => manifestation.id) unless manifestation.publishers.include?(@index_patron[:publisher]) -%>
46
+ <% when @series_statement %>
47
+ <% unless manifestation.series_statement -%>
48
+ <%= link_to t('page.add'), new_series_has_manifestation_path(:series_statement_id => @series_statement.id, :manifestation_id => manifestation.id) -%>
55
49
  <% end %>
56
- <%- end -%>
50
+ <% when @manifestation %>
51
+ <%= link_to t('page.add'), new_manifestation_manifestation_relationship_path(@manifestation, :child_id => manifestation.id) unless @manifestation.derived_manifestations.include?(manifestation) or @manifestation == manifestation -%>
52
+ <% when @item %>
53
+ <%= link_to t('page.change'), edit_exemplify_path(@item.exemplify, :manifestation_id => manifestation.id) unless @item.manifestation == manifestation -%>
54
+ <% else %>
55
+ <%= link_to image_tag('icons/arrow_divide.png', :size => '16x16', :alt => t('manifestation.add_derivation')), manifestation_manifestations_path(manifestation, :mode => 'add') -%>
56
+ <% end %>
57
57
  <%- end -%>
58
- </td>
59
- <%- end -%>
58
+ <%- end -%>
59
+ </td>
60
60
  <% end %>
61
61
  </tr>
@@ -36,9 +36,11 @@
36
36
  <%= patrons_list(series_statement.root_manifestation.publishers.readable_by(current_user)) %>
37
37
  <% end %>
38
38
  <% else %>
39
- <% if series_statement.latest_issue.publishers.exists? %>
40
- <br />
41
- <%= patrons_list(series_statement.latest_issue.publishers.readable_by(current_user)) %>
39
+ <% if series_statement.latest_issue %>
40
+ <% if series_statement.latest_issue.publishers.exists? %>
41
+ <br />
42
+ <%= patrons_list(series_statement.latest_issue.publishers.readable_by(current_user)) %>
43
+ <% end %>
42
44
  <% end %>
43
45
  <% end %>
44
46
  <% if series_statement.issn? %>
@@ -1,3 +1,3 @@
1
1
  module EnjuBiblio
2
- VERSION = "0.1.0.pre25"
2
+ VERSION = "0.1.0.pre26"
3
3
  end
@@ -11,7 +11,7 @@
11
11
  end if LibraryGroup.site_config.network_access_allowed?(ip_address)
12
12
  can [:read, :create, :update], Item
13
13
  can [:destroy, :delete], Item do |item|
14
- item.deletable?
14
+ item.removable?
15
15
  end
16
16
  can [:read, :create, :update], Manifestation
17
17
  can [:destroy, :delete], Manifestation do |manifestation|
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_biblio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre25
4
+ version: 0.1.0.pre26
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-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -234,20 +234,6 @@ dependencies:
234
234
  - - '>='
235
235
  - !ruby/object:Gem::Version
236
236
  version: '0'
237
- - !ruby/object:Gem::Dependency
238
- name: nested_form
239
- requirement: !ruby/object:Gem::Requirement
240
- requirements:
241
- - - '>='
242
- - !ruby/object:Gem::Version
243
- version: '0'
244
- type: :runtime
245
- prerelease: false
246
- version_requirements: !ruby/object:Gem::Requirement
247
- requirements:
248
- - - '>='
249
- - !ruby/object:Gem::Version
250
- version: '0'
251
237
  - !ruby/object:Gem::Dependency
252
238
  name: sqlite3
253
239
  requirement: !ruby/object:Gem::Requirement
@@ -1142,19 +1128,10 @@ files:
1142
1128
  - spec/dummy/solr/conf/spellings.txt
1143
1129
  - spec/dummy/solr/conf/stopwords.txt
1144
1130
  - spec/dummy/solr/conf/synonyms.txt
1145
- - spec/dummy/solr/data/test/index/_2m7.fdt
1146
- - spec/dummy/solr/data/test/index/_2m7.fdx
1147
- - spec/dummy/solr/data/test/index/_2m7.fnm
1148
- - spec/dummy/solr/data/test/index/_2m7.frq
1149
- - spec/dummy/solr/data/test/index/_2m7.nrm
1150
- - spec/dummy/solr/data/test/index/_2m7.prx
1151
- - spec/dummy/solr/data/test/index/_2m7.tii
1152
- - spec/dummy/solr/data/test/index/_2m7.tis
1153
1131
  - spec/dummy/solr/data/test/index/segments.gen
1154
- - spec/dummy/solr/data/test/index/segments_3ra
1132
+ - spec/dummy/solr/data/test/index/segments_46s
1155
1133
  - spec/dummy/solr/data/test/spellchecker/segments.gen
1156
1134
  - spec/dummy/solr/data/test/spellchecker/segments_1
1157
- - spec/dummy/tmp/cache/4AD/470/country_all
1158
1135
  - spec/dummy/tmp/cache/4F7/F90/default_role
1159
1136
  - spec/dummy/tmp/cache/6E4/420/search_engine_all
1160
1137
  - spec/factories/basket.rb
@@ -1584,19 +1561,10 @@ test_files:
1584
1561
  - spec/dummy/solr/conf/spellings.txt
1585
1562
  - spec/dummy/solr/conf/stopwords.txt
1586
1563
  - spec/dummy/solr/conf/synonyms.txt
1587
- - spec/dummy/solr/data/test/index/_2m7.fdt
1588
- - spec/dummy/solr/data/test/index/_2m7.fdx
1589
- - spec/dummy/solr/data/test/index/_2m7.fnm
1590
- - spec/dummy/solr/data/test/index/_2m7.frq
1591
- - spec/dummy/solr/data/test/index/_2m7.nrm
1592
- - spec/dummy/solr/data/test/index/_2m7.prx
1593
- - spec/dummy/solr/data/test/index/_2m7.tii
1594
- - spec/dummy/solr/data/test/index/_2m7.tis
1595
1564
  - spec/dummy/solr/data/test/index/segments.gen
1596
- - spec/dummy/solr/data/test/index/segments_3ra
1565
+ - spec/dummy/solr/data/test/index/segments_46s
1597
1566
  - spec/dummy/solr/data/test/spellchecker/segments.gen
1598
1567
  - spec/dummy/solr/data/test/spellchecker/segments_1
1599
- - spec/dummy/tmp/cache/4AD/470/country_all
1600
1568
  - spec/dummy/tmp/cache/4F7/F90/default_role
1601
1569
  - spec/dummy/tmp/cache/6E4/420/search_engine_all
1602
1570
  - spec/factories/basket.rb
@@ -1,3 +0,0 @@
1
- ����idtype
2
- class_name created_at_d updated_at_ddate_of_birth_d work_ids_imexpression_ids_immanifestation_ids_imrequired_role_id_ipatron_type_id_i name_text
3
- place_textother_designation_textoriginal_patron_ids_im
@@ -1 +0,0 @@
1
- NRM�yyxyyxxxxxyttuuux��||���������������||�������������