enju_inter_library_loan 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +45 -0
- data/app/controllers/inter_library_loans_controller.rb +125 -0
- data/app/models/inter_library_loan.rb +111 -0
- data/app/views/inter_library_loans/edit.html.erb +149 -0
- data/app/views/inter_library_loans/index.atom.builder +11 -0
- data/app/views/inter_library_loans/index.html.erb +50 -0
- data/app/views/inter_library_loans/index.rss.builder +31 -0
- data/app/views/inter_library_loans/new.html.erb +42 -0
- data/app/views/inter_library_loans/show.html.erb +58 -0
- data/config/locales/translation_en.yml +20 -0
- data/config/locales/translation_ja.yml +20 -0
- data/config/routes.rb +6 -0
- data/db/migrate/148_create_inter_library_loans.rb +23 -0
- data/lib/enju_inter_library_loan.rb +4 -0
- data/lib/enju_inter_library_loan/engine.rb +13 -0
- data/lib/enju_inter_library_loan/version.rb +3 -0
- data/lib/tasks/enju_inter_library_loan_tasks.rake +4 -0
- data/spec/controllers/inter_library_loans_controller_spec.rb +185 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +71 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/ability.rb +12 -0
- data/spec/dummy/app/models/item.rb +7 -0
- data/spec/dummy/app/models/library.rb +128 -0
- data/spec/dummy/app/models/library_group.rb +86 -0
- data/spec/dummy/app/models/manifestation.rb +6 -0
- data/spec/dummy/app/models/patron.rb +167 -0
- data/spec/dummy/app/models/patron_type.rb +19 -0
- data/spec/dummy/app/models/role.rb +5 -0
- data/spec/dummy/app/models/shelf.rb +54 -0
- data/spec/dummy/app/models/user.rb +27 -0
- data/spec/dummy/app/models/user_has_role.rb +4 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/page/403.html.erb +9 -0
- data/spec/dummy/app/views/page/403.mobile.erb +5 -0
- data/spec/dummy/app/views/page/403.xml.erb +4 -0
- data/spec/dummy/app/views/page/404.html.erb +9 -0
- data/spec/dummy/app/views/page/404.mobile.erb +5 -0
- data/spec/dummy/app/views/page/404.xml.erb +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +47 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +30 -0
- data/spec/dummy/config/environments/production.rb +60 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/devise.rb +209 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +60 -0
- data/spec/dummy/db/migrate/001_create_patrons.rb +62 -0
- data/spec/dummy/db/migrate/005_create_manifestations.rb +68 -0
- data/spec/dummy/db/migrate/006_create_items.rb +36 -0
- data/spec/dummy/db/migrate/059_create_libraries.rb +34 -0
- data/spec/dummy/db/migrate/069_create_shelves.rb +19 -0
- data/spec/dummy/db/migrate/080_create_library_groups.rb +25 -0
- data/spec/dummy/db/migrate/20080905191442_create_patron_types.rb +16 -0
- data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20100222124420_add_allow_bookmark_external_url_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20110115022329_add_position_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20111020063828_remove_dsbl_from_library_group.rb +11 -0
- data/spec/dummy/db/migrate/20111201121844_create_roles.rb +12 -0
- data/spec/dummy/db/migrate/20111201155456_create_users.rb +13 -0
- data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +31 -0
- data/spec/dummy/db/migrate/20111201163718_create_user_has_roles.rb +10 -0
- data/spec/dummy/db/schema.rb +289 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/master_model.rb +41 -0
- data/spec/dummy/lib/url_validator.rb +10 -0
- data/spec/dummy/log/test.log +5034 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/factories/inter_library_loan.rb +6 -0
- data/spec/factories/item.rb +7 -0
- data/spec/factories/library.rb +13 -0
- data/spec/factories/manifestation.rb +5 -0
- data/spec/factories/user.rb +31 -0
- data/spec/fixtures/inter_library_loans.yml +84 -0
- data/spec/fixtures/libraries.yml +108 -0
- data/spec/fixtures/library_groups.yml +34 -0
- data/spec/fixtures/patron_types.yml +35 -0
- data/spec/fixtures/patrons.yml +338 -0
- data/spec/fixtures/roles.yml +21 -0
- data/spec/fixtures/user_has_roles.yml +41 -0
- data/spec/fixtures/users.yml +69 -0
- data/spec/models/inter_library_loan_spec.rb +26 -0
- data/spec/spec_helper.rb +46 -0
- data/spec/support/controller_macros.rb +48 -0
- data/spec/support/devise.rb +4 -0
- metadata +386 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2011 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'rdoc/task'
|
9
|
+
rescue LoadError
|
10
|
+
require 'rdoc/rdoc'
|
11
|
+
require 'rake/rdoctask'
|
12
|
+
RDoc::Task = Rake::RDocTask
|
13
|
+
end
|
14
|
+
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
17
|
+
rdoc.title = 'EnjuPurchaseRequest'
|
18
|
+
rdoc.options << '--line-numbers'
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
end
|
22
|
+
|
23
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
24
|
+
load 'rails/tasks/engine.rake'
|
25
|
+
|
26
|
+
|
27
|
+
Bundler::GemHelper.install_tasks
|
28
|
+
|
29
|
+
require 'rake/testtask'
|
30
|
+
|
31
|
+
Rake::TestTask.new(:test) do |t|
|
32
|
+
t.libs << 'lib'
|
33
|
+
t.libs << 'test'
|
34
|
+
t.pattern = 'test/**/*_test.rb'
|
35
|
+
t.verbose = false
|
36
|
+
end
|
37
|
+
|
38
|
+
require 'rspec/core'
|
39
|
+
require 'rspec/core/rake_task'
|
40
|
+
|
41
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
42
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
43
|
+
end
|
44
|
+
|
45
|
+
task :default => :spec
|
@@ -0,0 +1,125 @@
|
|
1
|
+
class InterLibraryLoansController < ApplicationController
|
2
|
+
load_and_authorize_resource
|
3
|
+
before_filter :get_item
|
4
|
+
before_filter :store_page, :only => :index
|
5
|
+
|
6
|
+
# GET /inter_library_loans
|
7
|
+
# GET /inter_library_loans.json
|
8
|
+
def index
|
9
|
+
if @item
|
10
|
+
@inter_library_loans = @item.inter_library_loans.page(params[:page])
|
11
|
+
else
|
12
|
+
@inter_library_loans = InterLibraryLoan.page(params[:page])
|
13
|
+
end
|
14
|
+
|
15
|
+
respond_to do |format|
|
16
|
+
format.html # index.html.erb
|
17
|
+
format.json { render :json => @inter_library_loans }
|
18
|
+
format.rss { render :layout => false }
|
19
|
+
format.atom
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /inter_library_loans/1
|
24
|
+
# GET /inter_library_loans/1.json
|
25
|
+
def show
|
26
|
+
@inter_library_loan = InterLibraryLoan.find(params[:id])
|
27
|
+
|
28
|
+
respond_to do |format|
|
29
|
+
format.html # show.html.erb
|
30
|
+
format.json { render :json => @inter_library_loan }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# GET /inter_library_loans/new
|
35
|
+
# GET /inter_library_loans/new.json
|
36
|
+
def new
|
37
|
+
@inter_library_loan = InterLibraryLoan.new
|
38
|
+
@libraries = LibraryGroup.first.real_libraries
|
39
|
+
@libraries.reject!{|library| library == current_user.library}
|
40
|
+
|
41
|
+
respond_to do |format|
|
42
|
+
format.html # new.html.erb
|
43
|
+
format.json { render :json => @inter_library_loan }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# GET /inter_library_loans/1/edit
|
48
|
+
def edit
|
49
|
+
@inter_library_loan = InterLibraryLoan.find(params[:id])
|
50
|
+
@libraries = LibraryGroup.first.real_libraries
|
51
|
+
@libraries.reject!{|library| library == current_user.library}
|
52
|
+
end
|
53
|
+
|
54
|
+
# POST /inter_library_loans
|
55
|
+
# POST /inter_library_loans.json
|
56
|
+
def create
|
57
|
+
@inter_library_loan = InterLibraryLoan.new(params[:inter_library_loan])
|
58
|
+
item = Item.where(:item_identifier => params[:inter_library_loan][:item_identifier]).first
|
59
|
+
@inter_library_loan.item = item
|
60
|
+
|
61
|
+
respond_to do |format|
|
62
|
+
if @inter_library_loan.save
|
63
|
+
@inter_library_loan.sm_request!
|
64
|
+
flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.inter_library_loan'))
|
65
|
+
format.html { redirect_to(@inter_library_loan) }
|
66
|
+
format.json { render :json => @inter_library_loan, :status => :created, :location => @inter_library_loan }
|
67
|
+
else
|
68
|
+
@libraries = LibraryGroup.first.real_libraries
|
69
|
+
@libraries.reject!{|library| library == current_user.library}
|
70
|
+
format.html { render :action => "new" }
|
71
|
+
format.json { render :json => @inter_library_loan.errors, :status => :unprocessable_entity }
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# PUT /inter_library_loans/1
|
77
|
+
# PUT /inter_library_loans/1.json
|
78
|
+
def update
|
79
|
+
@inter_library_loan = InterLibraryLoan.find(params[:id])
|
80
|
+
@item = @inter_library_loan.item
|
81
|
+
|
82
|
+
case @inter_library_loan.state
|
83
|
+
when 'requested'
|
84
|
+
@inter_library_loan.sm_ship!
|
85
|
+
when 'shipped'
|
86
|
+
@inter_library_loan.sm_receive!
|
87
|
+
when 'received'
|
88
|
+
@inter_library_loan.sm_return_ship!
|
89
|
+
when 'return_shipped'
|
90
|
+
@inter_library_loan.sm_return_receive!
|
91
|
+
when 'return_received'
|
92
|
+
end
|
93
|
+
|
94
|
+
respond_to do |format|
|
95
|
+
if @inter_library_loan.update_attributes(params[:inter_library_loan])
|
96
|
+
flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.inter_library_loan'))
|
97
|
+
format.html { redirect_to(@inter_library_loan) }
|
98
|
+
format.json { head :ok }
|
99
|
+
else
|
100
|
+
@inter_library_loan.item = @item
|
101
|
+
@libraries = LibraryGroup.first.real_libraries
|
102
|
+
@libraries.reject!{|library| library == current_user.library}
|
103
|
+
format.html { render :action => "edit" }
|
104
|
+
format.json { render :json => @inter_library_loan.errors, :status => :unprocessable_entity }
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# DELETE /inter_library_loans/1
|
110
|
+
# DELETE /inter_library_loans/1.json
|
111
|
+
def destroy
|
112
|
+
@inter_library_loan = InterLibraryLoan.find(params[:id])
|
113
|
+
@inter_library_loan.destroy
|
114
|
+
|
115
|
+
respond_to do |format|
|
116
|
+
if @item
|
117
|
+
format.html { redirect_to item_inter_library_loans_url(@item) }
|
118
|
+
format.json { head :ok }
|
119
|
+
else
|
120
|
+
format.html { redirect_to(inter_library_loans_url) }
|
121
|
+
format.json { head :ok }
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
class InterLibraryLoan < ActiveRecord::Base
|
2
|
+
scope :completed, where(:state => 'return_received')
|
3
|
+
#scope :processing, lambda {|item, borrowing_library| {:conditions => ['item_id = ? AND borrowing_library_id = ? AND state != ?', item.id, borrowing_library.id, 'return_received']}}
|
4
|
+
scope :processing, lambda {|item, borrowing_library| {:conditions => ['item_id = ? AND borrowing_library_id = ?', item.id, borrowing_library.id]}}
|
5
|
+
|
6
|
+
belongs_to :item, :validate => true
|
7
|
+
#belongs_to :reserve
|
8
|
+
belongs_to :borrowing_library, :foreign_key => 'borrowing_library_id', :class_name => 'Library', :validate => true
|
9
|
+
|
10
|
+
validates_presence_of :item_id, :borrowing_library_id
|
11
|
+
validates_associated :item, :borrowing_library
|
12
|
+
validate :check_library, :on => :create
|
13
|
+
|
14
|
+
def check_library
|
15
|
+
if self.item and self.borrowing_library
|
16
|
+
unless InterLibraryLoan.processing(self.item, self.borrowing_library).blank?
|
17
|
+
errors.add(:borrowing_library)
|
18
|
+
errors.add(:item_identifier)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.per_page
|
24
|
+
10
|
25
|
+
end
|
26
|
+
|
27
|
+
attr_accessor :item_identifier
|
28
|
+
|
29
|
+
state_machine :initial => :pending do
|
30
|
+
before_transition :pending => :requested, :do => :do_request
|
31
|
+
before_transition :requested => :shipped, :do => :ship
|
32
|
+
before_transition :shipped => :received, :do => :receive
|
33
|
+
before_transition :received => :return_shipped, :do => :return_ship
|
34
|
+
before_transition :return_shipped => :return_received, :do => :return_receive
|
35
|
+
|
36
|
+
event :sm_request do
|
37
|
+
transition :pending => :requested
|
38
|
+
end
|
39
|
+
|
40
|
+
event :sm_ship do
|
41
|
+
transition :requested => :shipped
|
42
|
+
end
|
43
|
+
|
44
|
+
event :sm_receive do
|
45
|
+
transition :shipped => :received
|
46
|
+
end
|
47
|
+
|
48
|
+
event :sm_return_ship do
|
49
|
+
transition :received => :return_shipped
|
50
|
+
end
|
51
|
+
|
52
|
+
event :sm_return_receive do
|
53
|
+
transition :return_shipped => :return_received
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def do_request
|
58
|
+
InterLibraryLoan.transaction do
|
59
|
+
self.item.update_attributes({:circulation_status => CirculationStatus.where(:name => 'Recalled').first})
|
60
|
+
self.update_attributes({:requested_at => Time.zone.now})
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def ship
|
65
|
+
InterLibraryLoan.transaction do
|
66
|
+
self.item.update_attributes({:circulation_status => CirculationStatus.where(:name => 'In Transit Between Library Locations').first})
|
67
|
+
self.update_attributes({:shipped_at => Time.zone.now})
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def receive
|
72
|
+
InterLibraryLoan.transaction do
|
73
|
+
self.item.update_attributes({:circulation_status => CirculationStatus.where(:name => 'In Process').first})
|
74
|
+
self.update_attributes({:received_at => Time.zone.now})
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def return_ship
|
79
|
+
InterLibraryLoan.transaction do
|
80
|
+
self.item.update_attributes({:circulation_status => CirculationStatus.where(:name => 'In Transit Between Library Locations').first})
|
81
|
+
self.update_attributes({:return_shipped_at => Time.zone.now})
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def return_receive
|
86
|
+
InterLibraryLoan.transaction do
|
87
|
+
# TODO: 'Waiting To Be Reshelved'
|
88
|
+
self.item.update_attributes({:circulation_status => CirculationStatus.where(:name => 'Available On Shelf').first})
|
89
|
+
self.update_attributes({:return_received_at => Time.zone.now})
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# == Schema Information
|
95
|
+
#
|
96
|
+
# Table name: inter_library_loans
|
97
|
+
#
|
98
|
+
# id :integer not null, primary key
|
99
|
+
# item_id :integer not null
|
100
|
+
# borrowing_library_id :integer not null
|
101
|
+
# requested_at :datetime
|
102
|
+
# shipped_at :datetime
|
103
|
+
# received_at :datetime
|
104
|
+
# return_shipped_at :datetime
|
105
|
+
# return_received_at :datetime
|
106
|
+
# deleted_at :datetime
|
107
|
+
# state :string(255)
|
108
|
+
# created_at :datetime
|
109
|
+
# updated_at :datetime
|
110
|
+
#
|
111
|
+
|
@@ -0,0 +1,149 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.editing', :model => t('activerecord.models.inter_library_loan')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<%= form_for(@inter_library_loan) do |f| -%>
|
6
|
+
<%= f.error_messages -%>
|
7
|
+
|
8
|
+
<div class="field">
|
9
|
+
<%= f.label t('inter_library_loan.borrowing_library') -%><br />
|
10
|
+
<%= f.select(:borrowing_library_id, @libraries.collect{|l| [l.display_name.localize, l.id]}) -%>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="field">
|
14
|
+
<%= f.label t('activerecord.models.item') -%><br />
|
15
|
+
<%= link_to @inter_library_loan.item.shelf.library.display_name.localize, @inter_library_loan.item.shelf.library -%>
|
16
|
+
<%= link_to @inter_library_loan.item.item_identifier, @inter_library_loan.item -%>
|
17
|
+
(<%= link_to @inter_library_loan.item.manifestation.original_title, @inter_library_loan.item.manifestation -%>)
|
18
|
+
<%= f.hidden_field :item_id -%>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<%- case @inter_library_loan.state
|
22
|
+
when 'requested' -%>
|
23
|
+
<div class="field">
|
24
|
+
<%= f.label :requested_at -%><br />
|
25
|
+
<%=l @inter_library_loan.requested_at if @inter_library_loan.requested_at %>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<%- if @inter_library_loan.item.hold?(current_user.library) -%>
|
29
|
+
<div class="field">
|
30
|
+
<%= f.label :shipped_at -%><br />
|
31
|
+
<%= f.datetime_select :shipped_at -%>
|
32
|
+
</div>
|
33
|
+
<div class="actions">
|
34
|
+
<%= f.submit :confirm => t('page.are_you_sure') -%>
|
35
|
+
</div>
|
36
|
+
<%- end -%>
|
37
|
+
<%- when 'shipped' -%>
|
38
|
+
<div class="field">
|
39
|
+
<%= f.label :requested_at -%><br />
|
40
|
+
<%=l @inter_library_loan.requested_at if @inter_library_loan.requested_at %>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div class="field">
|
44
|
+
<%= f.label :shipped_at -%><br />
|
45
|
+
<%=l @inter_library_loan.shipped_at if @inter_library_loan.shipped_at %>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<%- if !@inter_library_loan.item.hold?(current_user.library) -%>
|
49
|
+
<div class="field">
|
50
|
+
<%= f.label :received_at -%><br />
|
51
|
+
<%= f.datetime_select :received_at -%>
|
52
|
+
</div>
|
53
|
+
<div class="actions">
|
54
|
+
<%= f.submit :confirm => t('page.are_you_sure') -%>
|
55
|
+
</div>
|
56
|
+
<%- end -%>
|
57
|
+
<%- when 'received' -%>
|
58
|
+
<div class="field">
|
59
|
+
<%= f.label :requested_at -%><br />
|
60
|
+
<%=l @inter_library_loan.requested_at if @inter_library_loan.requested_at %>
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<div class="field">
|
64
|
+
<%= f.label :shipped_at -%><br />
|
65
|
+
<%=l @inter_library_loan.shipped_at if @inter_library_loan.shipped_at %>
|
66
|
+
</div>
|
67
|
+
|
68
|
+
<div class="field">
|
69
|
+
<%= f.label :received_at -%><br />
|
70
|
+
<%=l @inter_library_loan.received_at if @inter_library_loan.received_at %>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
<%- if !@inter_library_loan.item.hold?(current_user.library) -%>
|
74
|
+
<div class="field">
|
75
|
+
<%= f.label :return_shippd_at -%><br />
|
76
|
+
<%= f.datetime_select :return_shipped_at -%>
|
77
|
+
</div>
|
78
|
+
<div class="actions">
|
79
|
+
<%= f.submit :confirm => t('page.are_you_sure') -%>
|
80
|
+
</div>
|
81
|
+
<%- end -%>
|
82
|
+
<%- when 'return_shipped' -%>
|
83
|
+
<div class="field">
|
84
|
+
<%= f.label :requested_at -%><br />
|
85
|
+
<%=l @inter_library_loan.requested_at if @inter_library_loan.requested_at %>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
<div class="field">
|
89
|
+
<%= f.label :shipped_at -%><br />
|
90
|
+
<%=l @inter_library_loan.shipped_at if @inter_library_loan.shipped_at %>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div class="field">
|
94
|
+
<%= f.label :received_at -%><br />
|
95
|
+
<%=l @inter_library_loan.received_at if @inter_library_loan.received_at %>
|
96
|
+
</div>
|
97
|
+
|
98
|
+
<div class="field">
|
99
|
+
<%= f.label :return_shippd_at -%><br />
|
100
|
+
<%=l @inter_library_loan.return_shipped_at if @inter_library_loan.return_shipped_at %>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<%- if @inter_library_loan.item.hold?(current_user.library) -%>
|
104
|
+
<div class="field">
|
105
|
+
<%= f.label :return_received_at -%><br />
|
106
|
+
<%= f.datetime_select :return_received_at -%>
|
107
|
+
</div>
|
108
|
+
<div class="actions">
|
109
|
+
<%= f.submit :confirm => t('page.are_you_sure') -%>
|
110
|
+
</div>
|
111
|
+
<%- end -%>
|
112
|
+
<%- when 'return_received' -%>
|
113
|
+
<div class="field">
|
114
|
+
<%= f.label :requested_at -%><br />
|
115
|
+
<%=l @inter_library_loan.requested_at if @inter_library_loan.requested_at %>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<div class="field">
|
119
|
+
<%= f.label :shipped_at -%><br />
|
120
|
+
<%=l @inter_library_loan.shipped_at if @inter_library_loan.shipped_at %>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<div class="field">
|
124
|
+
<%= f.label :received_at -%><br />
|
125
|
+
<%=l @inter_library_loan.received_at if @inter_library_loan.received_at %>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<div class="field">
|
129
|
+
<%= f.label :return_shippd_at -%><br />
|
130
|
+
<%=l @inter_library_loan.return_shipped_at if @inter_library_loan.return_shipped_at %>
|
131
|
+
</div>
|
132
|
+
|
133
|
+
<div class="field">
|
134
|
+
<%= f.label :return_received_at -%><br />
|
135
|
+
<%=l @inter_library_loan.return_received_at if @inter_library_loan.return_received_at %>
|
136
|
+
</div>
|
137
|
+
<%- end -%>
|
138
|
+
|
139
|
+
<%- end -%>
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</div>
|
143
|
+
|
144
|
+
<div id="submenu" class="ui-corner-all">
|
145
|
+
<ul>
|
146
|
+
<li><%= link_to t('page.show'), @inter_library_loan -%></li>
|
147
|
+
<li><%= link_to t('page.back'), inter_library_loans_path -%></li>
|
148
|
+
</ul>
|
149
|
+
</div>
|