enju_leaf 1.1.0.rc3 → 1.1.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/enju_leaf.js +0 -2
- data/app/controllers/page_controller.rb +2 -2
- data/app/controllers/users_controller.rb +7 -7
- data/app/views/layouts/patrons.html.erb +2 -2
- data/app/views/my_accounts/show.html.erb +9 -1
- data/app/views/page/_menu.html.erb +1 -1
- data/app/views/page/advanced_search.html.erb +2 -2
- data/app/views/page/configuration.html.erb +3 -3
- data/app/views/page/export.html.erb +2 -2
- data/app/views/page/import.html.erb +1 -1
- data/app/views/page/statistics.html.erb +2 -2
- data/app/views/users/index.html.erb +0 -11
- data/app/views/users/new.html.erb +4 -4
- data/app/views/users/show.html.erb +9 -1
- data/config/locales/translation_en.yml +13 -13
- data/config/locales/translation_ja.yml +13 -13
- data/lib/enju_leaf/user.rb +12 -12
- data/lib/enju_leaf/version.rb +1 -1
- data/lib/enju_leaf.rb +2 -2
- data/lib/generators/enju_leaf/setup/setup_generator.rb +10 -3
- data/spec/dummy/db/migrate/001_create_patrons.rb +7 -7
- data/spec/dummy/db/migrate/012_create_owns.rb +2 -2
- data/spec/dummy/db/migrate/015_create_creates.rb +2 -2
- data/spec/dummy/db/migrate/047_create_produces.rb +2 -2
- data/spec/dummy/db/migrate/125_create_donates.rb +2 -2
- data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +2 -2
- data/spec/dummy/db/migrate/20080905191442_create_patron_types.rb +1 -1
- data/spec/dummy/db/migrate/20081028083142_create_patron_import_files.rb +8 -8
- data/spec/dummy/db/migrate/20090812151902_create_patron_relationship_types.rb +1 -1
- data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
- data/spec/dummy/db/migrate/20100606073747_create_patron_relationships.rb +4 -4
- data/spec/dummy/db/migrate/20100814091104_add_position_to_patron_relationship.rb +2 -2
- data/spec/dummy/db/migrate/20100925074559_create_patron_import_results.rb +3 -3
- data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +4 -4
- data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +2 -2
- data/spec/dummy/db/migrate/20120511072422_add_patron_identifier_to_patron.rb +2 -2
- data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +1 -1
- data/spec/dummy/db/schema.rb +129 -129
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/data/test/index/{_6z.fdt → _7z.fdt} +0 -0
- data/spec/dummy/solr/data/test/index/{_6z.fdx → _7z.fdx} +0 -0
- data/spec/dummy/solr/data/test/index/{_6z.fnm → _7z.fnm} +0 -0
- data/spec/dummy/solr/data/test/index/{_6z.frq → _7z.frq} +0 -0
- data/spec/dummy/solr/data/test/index/{_6z.nrm → _7z.nrm} +0 -0
- data/spec/dummy/solr/data/test/index/{_6z.prx → _7z.prx} +0 -0
- data/spec/dummy/solr/data/test/index/{_6z.tii → _7z.tii} +0 -0
- data/spec/dummy/solr/data/test/index/{_6z.tis → _7z.tis} +0 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/segments_g1 +0 -0
- data/spec/factories/{patron.rb → agent.rb} +3 -3
- data/spec/factories/agent_relationship.rb +6 -0
- data/spec/factories/agent_relationship_type.rb +5 -0
- data/spec/factories/agent_type.rb +5 -0
- data/spec/factories/create.rb +1 -1
- data/spec/factories/donate.rb +1 -1
- data/spec/factories/own.rb +1 -1
- 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/produces.yml +20 -20
- data/spec/fixtures/realizes.yml +11 -11
- data/spec/spec_helper.rb +0 -2
- data/vendor/assets/javascripts/jquery.colorbox.js +70 -33
- data/vendor/assets/javascripts/jquery.ui.menubar.js +342 -187
- data/vendor/assets/stylesheets/jquery.ui.menubar.css +25 -5
- metadata +61 -76
- data/app/assets/stylesheets/images/ajax-loader.gif +0 -0
- data/app/assets/stylesheets/images/border.png +0 -0
- data/app/assets/stylesheets/images/controls.png +0 -0
- data/app/assets/stylesheets/images/icons-18-black.png +0 -0
- data/app/assets/stylesheets/images/icons-18-white.png +0 -0
- data/app/assets/stylesheets/images/icons-36-black.png +0 -0
- data/app/assets/stylesheets/images/icons-36-white.png +0 -0
- data/app/assets/stylesheets/images/ie6/borderBottomCenter.png +0 -0
- data/app/assets/stylesheets/images/ie6/borderBottomLeft.png +0 -0
- data/app/assets/stylesheets/images/ie6/borderBottomRight.png +0 -0
- data/app/assets/stylesheets/images/ie6/borderMiddleLeft.png +0 -0
- data/app/assets/stylesheets/images/ie6/borderMiddleRight.png +0 -0
- data/app/assets/stylesheets/images/ie6/borderTopCenter.png +0 -0
- data/app/assets/stylesheets/images/ie6/borderTopLeft.png +0 -0
- data/app/assets/stylesheets/images/ie6/borderTopRight.png +0 -0
- data/app/assets/stylesheets/images/loading.gif +0 -0
- data/app/assets/stylesheets/images/loading_background.png +0 -0
- data/app/assets/stylesheets/images/overlay.png +0 -0
- data/app/assets/stylesheets/images/spinner_bar.gif +0 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/solr/data/test/index/segments_e1 +0 -0
- data/spec/factories/patron_relationship.rb +0 -6
- data/spec/factories/patron_relationship_type.rb +0 -5
- data/spec/factories/patron_type.rb +0 -5
- data/vendor/assets/stylesheets/images/ie6/borderBottomCenter.png +0 -0
- data/vendor/assets/stylesheets/images/ie6/borderBottomLeft.png +0 -0
- data/vendor/assets/stylesheets/images/ie6/borderBottomRight.png +0 -0
- data/vendor/assets/stylesheets/images/ie6/borderMiddleLeft.png +0 -0
- data/vendor/assets/stylesheets/images/ie6/borderMiddleRight.png +0 -0
- data/vendor/assets/stylesheets/images/ie6/borderTopCenter.png +0 -0
- data/vendor/assets/stylesheets/images/ie6/borderTopLeft.png +0 -0
- data/vendor/assets/stylesheets/images/ie6/borderTopRight.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baefdbbfe33d9dec160ba06c822e62bdf204e019
|
4
|
+
data.tar.gz: 014dc99c9485bf5a02a84014f0100e4a8291f5ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa869125065c2bb8979e0c094adcba997848447cd68f96033668ea628552df6e3d2b656ac42e1a70a76604d69a1cf6d9e7761dfa9501366ff40050a6aed58e8e
|
7
|
+
data.tar.gz: 63ad27f3d4c5b0e2bafdc3bbcba3f013fd462280c3c9a37aa3b3f92d123c914d13e20cc94b0cdaeec5790691647ae4631b45ba25f486223a98367ae9dbe24a2c
|
@@ -8,8 +8,8 @@ class PageController < ApplicationController
|
|
8
8
|
def index
|
9
9
|
if user_signed_in?
|
10
10
|
session[:user_return_to] = nil
|
11
|
-
#unless current_user.
|
12
|
-
# redirect_to
|
11
|
+
#unless current_user.agent
|
12
|
+
# redirect_to new_user_agent_url(current_user); return
|
13
13
|
#end
|
14
14
|
if defined?(EnjuBookmark)
|
15
15
|
@tags = current_user.bookmarks.tag_counts.sort{|a,b| a.count <=> b.count}.reverse
|
@@ -2,7 +2,7 @@
|
|
2
2
|
class UsersController < ApplicationController
|
3
3
|
load_and_authorize_resource :except => :index
|
4
4
|
authorize_resource :only => :index
|
5
|
-
before_filter :
|
5
|
+
before_filter :get_agent, :only => :new
|
6
6
|
before_filter :store_location, :only => [:index]
|
7
7
|
before_filter :clear_search_sessions, :only => [:show]
|
8
8
|
after_filter :solr_commit, :only => [:create, :update, :destroy]
|
@@ -56,8 +56,8 @@ class UsersController < ApplicationController
|
|
56
56
|
end
|
57
57
|
|
58
58
|
session[:user_return_to] = nil
|
59
|
-
#unless @user.
|
60
|
-
# redirect_to
|
59
|
+
#unless @user.agent
|
60
|
+
# redirect_to new_user_agent_url(@user); return
|
61
61
|
#end
|
62
62
|
if defined?(EnjuBookmark)
|
63
63
|
@tags = @user.bookmarks.tag_counts.sort{|a,b| a.count <=> b.count}.reverse
|
@@ -80,17 +80,17 @@ class UsersController < ApplicationController
|
|
80
80
|
@user = User.new
|
81
81
|
prepare_options
|
82
82
|
@user_groups = UserGroup.all
|
83
|
-
if @
|
83
|
+
if @agent.try(:user)
|
84
84
|
flash[:notice] = t('page.already_activated')
|
85
|
-
redirect_to @
|
85
|
+
redirect_to @agent
|
86
86
|
return
|
87
87
|
end
|
88
|
-
@user.
|
88
|
+
@user.agent_id = @agent.id if @agent
|
89
89
|
@user.library = current_user.library
|
90
90
|
@user.locale = current_user.locale
|
91
91
|
end
|
92
92
|
|
93
|
-
# GET /
|
93
|
+
# GET /agents/1/edit
|
94
94
|
def edit
|
95
95
|
if @user == current_user
|
96
96
|
redirect_to edit_my_account_url
|
@@ -5,8 +5,8 @@
|
|
5
5
|
<title><%= title(controller.controller_name) %></title>
|
6
6
|
<%= render 'page/include' %>
|
7
7
|
<%- if controller.action_name == 'index' -%>
|
8
|
-
<%= auto_discovery_link_tag(:rss, url_for(params.merge(:format => 'rss', :page => nil, :commit => nil, :only_path => true)), :title => (t('
|
9
|
-
<%= auto_discovery_link_tag(:atom, url_for(params.merge(:format => 'atom', :page => nil, :commit => nil, :only_path => true)), :title => (t('
|
8
|
+
<%= auto_discovery_link_tag(:rss, url_for(params.merge(:format => 'rss', :page => nil, :commit => nil, :only_path => true)), :title => (t('agent.library_group_agent', :library_group_name => @library_group.display_name.localize) + " (RSS)")) %>
|
9
|
+
<%= auto_discovery_link_tag(:atom, url_for(params.merge(:format => 'atom', :page => nil, :commit => nil, :only_path => true)), :title => (t('agent.library_group_agent', :library_group_name => @library_group.display_name.localize) + " (Atom)")) %>
|
10
10
|
<%- end -%>
|
11
11
|
</head>
|
12
12
|
<body>
|
@@ -28,7 +28,15 @@
|
|
28
28
|
<%= link_to checkout.item.item_identifier, checkout.item %><br />
|
29
29
|
(<%= link_to checkout.item.manifestation.original_title, checkout.item.manifestation %>)
|
30
30
|
</td>
|
31
|
-
<td
|
31
|
+
<td>
|
32
|
+
<%=l checkout.due_date, :formats => :only_date %>
|
33
|
+
<br />
|
34
|
+
<%- if can? :update, checkout -%>
|
35
|
+
<% unless checkout.checkin %>
|
36
|
+
(<%= link_to t('checkout.extend'), edit_checkout_path(checkout) -%>)
|
37
|
+
<% end %>
|
38
|
+
<%- end -%>
|
39
|
+
</td>
|
32
40
|
</tr>
|
33
41
|
<% end %>
|
34
42
|
</table>
|
@@ -106,7 +106,7 @@
|
|
106
106
|
<%- if user_signed_in? -%>
|
107
107
|
<%- if current_user.has_role?('Librarian') -%>
|
108
108
|
<li><%= link_to t('user.management'), users_path -%></li>
|
109
|
-
<li><%= link_to t('page.
|
109
|
+
<li><%= link_to t('page.agent_management'), agents_path -%></li>
|
110
110
|
<li><%= link_to t('page.import'), page_import_path -%></li>
|
111
111
|
<!--
|
112
112
|
<li><%= link_to t('page.export'), 'page/export' -%></li>
|
@@ -13,11 +13,11 @@
|
|
13
13
|
<td><%= text_field_tag 'tag' -%></td>
|
14
14
|
</tr>
|
15
15
|
<tr>
|
16
|
-
<td><label><%= t('
|
16
|
+
<td><label><%= t('agent.creator') -%>:</label></td>
|
17
17
|
<td><%= text_field_tag 'creator' -%></td>
|
18
18
|
</tr>
|
19
19
|
<tr>
|
20
|
-
<td><label><%= t('
|
20
|
+
<td><label><%= t('agent.publisher') -%>:</label></td>
|
21
21
|
<td><%= text_field_tag 'publisher' -%></td>
|
22
22
|
</tr>
|
23
23
|
<tr>
|
@@ -63,7 +63,7 @@
|
|
63
63
|
<li><%= link_to t('activerecord.models.inventory'), inventory_files_path -%></li>
|
64
64
|
<% end %>
|
65
65
|
<% if defined?(EnjuResourceMerge) %>
|
66
|
-
<li><%= link_to t('activerecord.models.
|
66
|
+
<li><%= link_to t('activerecord.models.agent_merge_list'), agent_merge_lists_path -%></li>
|
67
67
|
<li><%= link_to t('activerecord.models.series_statement_merge_list'), series_statement_merge_lists_path -%></li>
|
68
68
|
<% end %>
|
69
69
|
</ul>
|
@@ -97,11 +97,11 @@
|
|
97
97
|
<li><%= link_to t('activerecord.models.circulation_status'), circulation_statuses_path -%></li>
|
98
98
|
<li><%= link_to t('activerecord.models.use_restriction'), use_restrictions_path -%></li>
|
99
99
|
<% end %>
|
100
|
-
<li><%= link_to t('activerecord.models.
|
100
|
+
<li><%= link_to t('activerecord.models.agent_type'), agent_types_path -%></li>
|
101
101
|
<li><%= link_to t('activerecord.models.language'), languages_path -%></li>
|
102
102
|
<li><%= link_to t('activerecord.models.country'), countries_path -%></li>
|
103
103
|
<li><%= link_to t('activerecord.models.frequency'), frequencies_path -%></li>
|
104
|
-
<li><%= link_to t('activerecord.models.
|
104
|
+
<li><%= link_to t('activerecord.models.agent_relationship_type'), agent_relationship_types_path -%></li>
|
105
105
|
<li><%= link_to t('activerecord.models.manifestation_relationship_type'), manifestation_relationship_types_path -%></li>
|
106
106
|
<li><%= link_to t('activerecord.models.license'), licenses_path -%></li>
|
107
107
|
<!--
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<div id="content_list">
|
4
4
|
|
5
5
|
<ul>
|
6
|
-
<li><%= link_to t('activerecord.models.
|
6
|
+
<li><%= link_to t('activerecord.models.agent'), agent_import_files_path -%>
|
7
7
|
(<%= t('activerecord.models.user') -%>)</li>
|
8
8
|
|
9
9
|
<li><%= link_to t('activerecord.models.event'), event_import_files_path -%></li>
|
@@ -8,8 +8,8 @@
|
|
8
8
|
<th><%= t('page.note') -%></th>
|
9
9
|
</tr>
|
10
10
|
<tr>
|
11
|
-
<td><%= link_to t('activerecord.models.
|
12
|
-
<td><%=
|
11
|
+
<td><%= link_to t('activerecord.models.agent'), agents_path -%></td>
|
12
|
+
<td><%= Agent.count -%></td>
|
13
13
|
<td></td>
|
14
14
|
</tr>
|
15
15
|
<tr>
|
@@ -24,10 +24,6 @@
|
|
24
24
|
<%= link_to image_tag('icons/arrow_up.png', :size => '16x16', :alt => t('page.asc')), url_for(params.merge(:sort_by => 'created_at', :order => 'asc', :only_path => true)) -%>
|
25
25
|
<%= link_to image_tag('icons/arrow_down.png', :size => '16x16', :alt => t('page.desc')), url_for(params.merge(:sort_by => 'created_at', :order => 'desc', :only_path => true)) -%>
|
26
26
|
</th>
|
27
|
-
<% if defined?(EnjuCirculation) %>
|
28
|
-
<th><%= t('activerecord.models.checkout') -%></th>
|
29
|
-
<th><%= t('activerecord.models.reserve') -%></th>
|
30
|
-
<% end %>
|
31
27
|
<th></th>
|
32
28
|
</tr>
|
33
29
|
|
@@ -38,13 +34,6 @@
|
|
38
34
|
</td>
|
39
35
|
<td><%= user.user_number -%></td>
|
40
36
|
<td><%= l(user.created_at) if user.created_at -%></td>
|
41
|
-
<% if defined?(EnjuCirculation) %>
|
42
|
-
<td>
|
43
|
-
<%= link_to t('activerecord.models.checkout'), new_basket_path(:user_number => user.user_number) unless user.user_number.blank? -%>
|
44
|
-
(<%= link_to t('page.checkout_history'), user_checkouts_path(user) -%>)
|
45
|
-
</td>
|
46
|
-
<td><%= link_to t('activerecord.models.reserve'), user_reserves_path(user) -%></td>
|
47
|
-
<% end %>
|
48
37
|
<td>
|
49
38
|
<%= link_to t('user.edit_account'), edit_user_path(user) -%>
|
50
39
|
</td>
|
@@ -5,12 +5,12 @@
|
|
5
5
|
<%= simple_form_for(@user, :validate => true) do |f| -%>
|
6
6
|
<%= f.error_messages -%>
|
7
7
|
|
8
|
-
<%- if @
|
8
|
+
<%- if @agent -%>
|
9
9
|
<h2 class="resource_title">
|
10
10
|
[P]
|
11
|
-
<%= link_to @
|
11
|
+
<%= link_to @agent.full_name, @agent -%>
|
12
12
|
</h2>
|
13
|
-
<%= f.hidden_field :
|
13
|
+
<%= f.hidden_field :agent_id -%>
|
14
14
|
<%- end -%>
|
15
15
|
|
16
16
|
<div class="field">
|
@@ -80,6 +80,6 @@
|
|
80
80
|
<div id="submenu" class="ui-corner-all">
|
81
81
|
<ul>
|
82
82
|
<li><%= link_to t('page.listing', :model => t('activerecord.models.user')), users_path -%></li>
|
83
|
-
<li><%= link_to t('page.import'),
|
83
|
+
<li><%= link_to t('page.import'), new_agent_import_file_path -%></li>
|
84
84
|
</ul>
|
85
85
|
</div>
|
@@ -30,7 +30,15 @@
|
|
30
30
|
<%= link_to checkout.item.item_identifier, checkout.item %><br />
|
31
31
|
(<%= link_to checkout.item.manifestation.original_title, checkout.item.manifestation %>)
|
32
32
|
</td>
|
33
|
-
<td
|
33
|
+
<td>
|
34
|
+
<%=l checkout.due_date, :formats => :only_date %>
|
35
|
+
<br />
|
36
|
+
<%- if can? :update, checkout -%>
|
37
|
+
<% unless checkout.checkin %>
|
38
|
+
(<%= link_to t('checkout.extend'), edit_checkout_path(checkout) -%>)
|
39
|
+
<% end %>
|
40
|
+
<%- end -%>
|
41
|
+
</td>
|
34
42
|
</tr>
|
35
43
|
<% end %>
|
36
44
|
</table>
|
@@ -37,7 +37,7 @@ en:
|
|
37
37
|
keyword_list: Keyword list
|
38
38
|
user_number: User number
|
39
39
|
state: State
|
40
|
-
|
40
|
+
agent: Agent
|
41
41
|
library: Library
|
42
42
|
user_group: User group
|
43
43
|
full_name: Full name
|
@@ -149,7 +149,7 @@ en:
|
|
149
149
|
remove_this_facet: "Remove this facet"
|
150
150
|
no_subject: "No subjects."
|
151
151
|
no_tag: "No tags."
|
152
|
-
|
152
|
+
add_agent: "Add a agent"
|
153
153
|
total: "Total"
|
154
154
|
sort_by: "Sort by"
|
155
155
|
bookmarklet: "Bookmarklet"
|
@@ -182,7 +182,7 @@ en:
|
|
182
182
|
new: "New %{model}"
|
183
183
|
editing: "Editing %{model}"
|
184
184
|
showing: "Showing %{model}"
|
185
|
-
|
185
|
+
agent_management: "Agent management"
|
186
186
|
user_management: "User management"
|
187
187
|
back_to: "Back to %{model} index"
|
188
188
|
picture: "Picture"
|
@@ -265,11 +265,11 @@ en:
|
|
265
265
|
from_to: "-"
|
266
266
|
all_libraries: "All libraries"
|
267
267
|
work:
|
268
|
-
|
268
|
+
agents_work: "%{agent_name}'s works"
|
269
269
|
library_group_work: "Works in %{library_group_name}"
|
270
270
|
add: "Add a work"
|
271
271
|
expression:
|
272
|
-
|
272
|
+
agents_expression: "%{agent_name}'s expressions"
|
273
273
|
manifestations_expression: "Expressions in %{manifestation_title}"
|
274
274
|
library_group_expression: "Expressions in %{library_group_name}"
|
275
275
|
add: "Add an expression"
|
@@ -325,14 +325,14 @@ en:
|
|
325
325
|
add_lending_policy: "Add a new lending policy"
|
326
326
|
edit_exemplification: "Edit exemplification"
|
327
327
|
accepted_at: "Accepted at"
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
328
|
+
agent:
|
329
|
+
library_group_agent: "Agents of %{library_group_name}"
|
330
|
+
work_agent: "Creaters of %{work_title}"
|
331
|
+
expression_agent: "Realizers of %{expression_title}"
|
332
|
+
manifestation_agent: "Producers of %{manifestation_title}"
|
333
333
|
activate_as_user: "Activate as an user"
|
334
334
|
deactivate: "Deactivate this user"
|
335
|
-
add: "Add a
|
335
|
+
add: "Add a agent"
|
336
336
|
publication: "Publications"
|
337
337
|
recent_publication: "Recent publications"
|
338
338
|
all_publication: "All publications"
|
@@ -363,7 +363,7 @@ en:
|
|
363
363
|
edit_profile: "Edit profile"
|
364
364
|
edit_account: "Edit account"
|
365
365
|
already_activated: "Already activated."
|
366
|
-
|
366
|
+
specify_agent: "Specify the agent."
|
367
367
|
wrong_password: "Wrong password."
|
368
368
|
password_mismatch: "Password mismatch."
|
369
369
|
cannot_destroy_myself: "You can't destroy yourself."
|
@@ -371,7 +371,7 @@ en:
|
|
371
371
|
last_librarian: "This user is the last librarian in this system."
|
372
372
|
only_administrator_can_destroy: "Only administrators can destroy this user."
|
373
373
|
this_user_has_checked_out_item: "This user has checked-out items."
|
374
|
-
|
374
|
+
agent_profile: "Agent profile"
|
375
375
|
set_auto_generated_password: "Set auto-generated password"
|
376
376
|
history: "History"
|
377
377
|
account_management: "Account management"
|
@@ -33,7 +33,7 @@ ja:
|
|
33
33
|
keyword_list: キーワードリスト
|
34
34
|
user_number: 利用者番号
|
35
35
|
state: 状態
|
36
|
-
|
36
|
+
agent: 人物・団体
|
37
37
|
library: 所属館
|
38
38
|
user_group: ユーザグループ
|
39
39
|
full_name: 氏名
|
@@ -134,7 +134,7 @@ ja:
|
|
134
134
|
remove_this_facet: "この絞り込みを解除する"
|
135
135
|
no_subject: "件名はついていません。"
|
136
136
|
no_tag: "タグはついていません。"
|
137
|
-
|
137
|
+
add_agent: "人物・団体を追加する"
|
138
138
|
total: "合計"
|
139
139
|
sort_by: "次の項目で並べ替える"
|
140
140
|
bookmarklet: "ブックマークレット"
|
@@ -166,7 +166,7 @@ ja:
|
|
166
166
|
new: "%{model}の新規作成"
|
167
167
|
editing: "%{model}の編集"
|
168
168
|
showing: "%{model}の表示"
|
169
|
-
|
169
|
+
agent_management: "人物・団体の管理"
|
170
170
|
user_management: "利用者の管理"
|
171
171
|
back_to: "%{model}の一覧に戻る"
|
172
172
|
picture: "画像"
|
@@ -243,11 +243,11 @@ ja:
|
|
243
243
|
to: "から"
|
244
244
|
all_libraries: "全ての図書館"
|
245
245
|
work:
|
246
|
-
|
246
|
+
agent_work: "%{agent_name} の書いた資料"
|
247
247
|
library_group_work: "%{library_group_name} にある書いた資料"
|
248
248
|
add: "書いた資料を追加する"
|
249
249
|
expression:
|
250
|
-
|
250
|
+
agent_expression: "%{agent_name} の協力した資料"
|
251
251
|
manifestations_expression: "%{manifestation_title} に含まれる協力した資料"
|
252
252
|
library_group_expression: "%{library_group_name} にある協力した資料"
|
253
253
|
add: "協力した資料を追加する"
|
@@ -262,7 +262,7 @@ ja:
|
|
262
262
|
edit_publisher: "出版者を編集"
|
263
263
|
edit_expression: "協力した資料を編集"
|
264
264
|
edit_item: "所蔵を編集"
|
265
|
-
|
265
|
+
agent_manifestation: "%{agent_name} の資料"
|
266
266
|
expressions_manifestation: "%{expression_title} の出版した資料"
|
267
267
|
library_group_manifestation: "%{library_group_name} にある資料"
|
268
268
|
reserve_this: "この資料を予約する"
|
@@ -303,11 +303,11 @@ ja:
|
|
303
303
|
add_lending_policy: "貸出規則の追加"
|
304
304
|
edit_exemplification: "書誌の付け替え"
|
305
305
|
accepted_at: "受入時刻"
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
306
|
+
agent:
|
307
|
+
library_group_agent: "%{library_group_name} の人物・団体"
|
308
|
+
work_agent: "%{work_title} の著作者"
|
309
|
+
expression_agent: "%{expression_title} の編者"
|
310
|
+
manifestation_agent: "%{manifestation_title} の出版者"
|
311
311
|
activate_as_user: "利用者として登録する"
|
312
312
|
deactivate: "利用者登録を解除する"
|
313
313
|
add: "人物・団体を追加する"
|
@@ -339,7 +339,7 @@ ja:
|
|
339
339
|
edit_profile: "プロフィールの編集"
|
340
340
|
edit_account: "アカウント情報の編集"
|
341
341
|
already_activated: "すでに利用者として登録されています。"
|
342
|
-
|
342
|
+
specify_agent: "人物・団体を指定してください。"
|
343
343
|
wrong_password: "パスワードが間違っています。"
|
344
344
|
password_mismatch: "パスワードが一致しません。"
|
345
345
|
cannot_destroy_myself: "自分自身を削除することはできません。"
|
@@ -347,7 +347,7 @@ ja:
|
|
347
347
|
last_librarian: "この利用者はシステム上の最後の図書館員です。"
|
348
348
|
only_administrator_can_destroy: "この利用者は管理者でなければ削除できません。"
|
349
349
|
this_user_has_checked_out_item: "この利用者は貸出中の資料があります。"
|
350
|
-
|
350
|
+
agent_profile: "人物・団体のプロフィール"
|
351
351
|
set_auto_generated_password: "自動生成したパスワードを設定する"
|
352
352
|
history: "履歴"
|
353
353
|
account_management: "アカウント管理"
|
data/lib/enju_leaf/user.rb
CHANGED
@@ -22,7 +22,7 @@ module EnjuLeaf
|
|
22
22
|
scope :administrators, where('roles.name = ?', 'Administrator').includes(:role)
|
23
23
|
scope :librarians, where('roles.name = ? OR roles.name = ?', 'Administrator', 'Librarian').includes(:role)
|
24
24
|
scope :suspended, where('locked_at IS NOT NULL')
|
25
|
-
#has_one :
|
25
|
+
#has_one :agent, :dependent => :destroy
|
26
26
|
if defined?(EnjuBiblio)
|
27
27
|
has_many :import_requests
|
28
28
|
has_many :picture_files, :as => :picture_attachable, :dependent => :destroy
|
@@ -33,7 +33,7 @@ module EnjuLeaf
|
|
33
33
|
belongs_to :user_group
|
34
34
|
belongs_to :required_role, :class_name => 'Role', :foreign_key => 'required_role_id' #, :validate => true
|
35
35
|
has_many :export_files if defined?(EnjuExport)
|
36
|
-
#has_one :
|
36
|
+
#has_one :agent_import_result
|
37
37
|
accepts_nested_attributes_for :user_has_role
|
38
38
|
|
39
39
|
validates :username, :presence => true, :uniqueness => true, :format => {:with => /\A[0-9A-Za-z][0-9A-Za-z_\-]*[0-9A-Za-z]\Z/}, :allow_blank => true
|
@@ -49,12 +49,12 @@ module EnjuLeaf
|
|
49
49
|
end
|
50
50
|
|
51
51
|
validates_presence_of :email, :email_confirmation, :on => :create, :if => proc{|user| !user.operator.try(:has_role?, 'Librarian')}
|
52
|
-
validates_associated :user_group, :library #, :
|
52
|
+
validates_associated :user_group, :library #, :agent
|
53
53
|
validates_presence_of :user_group, :library, :locale #, :user_number
|
54
54
|
validates :user_number, :uniqueness => true, :format => {:with => /\A[0-9A-Za-z_]+\Z/}, :allow_blank => true
|
55
55
|
validates_confirmation_of :email, :on => :create, :if => proc{|user| !user.operator.try(:has_role?, 'Librarian')}
|
56
56
|
|
57
|
-
before_validation :
|
57
|
+
before_validation :set_role_and_agent, :on => :create
|
58
58
|
before_validation :set_lock_information
|
59
59
|
before_destroy :check_role_before_destroy
|
60
60
|
before_save :check_expiration
|
@@ -70,7 +70,7 @@ module EnjuLeaf
|
|
70
70
|
searchable do
|
71
71
|
text :username, :email, :note, :user_number
|
72
72
|
text :name do
|
73
|
-
#
|
73
|
+
#agent.name if agent
|
74
74
|
end
|
75
75
|
string :username
|
76
76
|
string :email
|
@@ -90,7 +90,7 @@ module EnjuLeaf
|
|
90
90
|
:zip_code, :address, :telephone_number, :fax_number, :address_note,
|
91
91
|
:operator, :password_not_verified,
|
92
92
|
:update_own_account, :auto_generated_password,
|
93
|
-
:locked, :current_password #, :
|
93
|
+
:locked, :current_password #, :agent_id
|
94
94
|
|
95
95
|
paginates_per 10
|
96
96
|
|
@@ -120,11 +120,11 @@ module EnjuLeaf
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
-
def
|
123
|
+
def set_role_and_agent
|
124
124
|
self.required_role = Role.where(:name => 'Librarian').first
|
125
125
|
self.locale = I18n.default_locale.to_s
|
126
|
-
#unless self.
|
127
|
-
# self.
|
126
|
+
#unless self.agent
|
127
|
+
# self.agent = Agent.create(:full_name => self.username) if self.username
|
128
128
|
#end
|
129
129
|
end
|
130
130
|
|
@@ -226,9 +226,9 @@ module EnjuLeaf
|
|
226
226
|
end
|
227
227
|
end
|
228
228
|
|
229
|
-
|
230
|
-
|
231
|
-
|
229
|
+
def patron
|
230
|
+
LocalPatron.new({:username => username})
|
231
|
+
end
|
232
232
|
|
233
233
|
def full_name
|
234
234
|
username
|
data/lib/enju_leaf/version.rb
CHANGED
data/lib/enju_leaf.rb
CHANGED
@@ -166,7 +166,7 @@ module EnjuLeaf
|
|
166
166
|
|
167
167
|
unless params[:mode] == "add"
|
168
168
|
expression = @expression
|
169
|
-
|
169
|
+
agent = @agent
|
170
170
|
manifestation = @manifestation
|
171
171
|
reservable = @reservable
|
172
172
|
carrier_type = params[:carrier_type]
|
@@ -179,7 +179,7 @@ module EnjuLeaf
|
|
179
179
|
end
|
180
180
|
|
181
181
|
search.build do
|
182
|
-
with(:publisher_ids).equal_to
|
182
|
+
with(:publisher_ids).equal_to agent.id if agent
|
183
183
|
with(:original_manifestation_ids).equal_to manifestation.id if manifestation
|
184
184
|
with(:reservable).equal_to reservable unless reservable.nil?
|
185
185
|
unless carrier_type.blank?
|
@@ -21,10 +21,13 @@ ActiveSupport::Inflector.inflections do |inflect|
|
|
21
21
|
end
|
22
22
|
EOS
|
23
23
|
inject_into_file 'config/environments/development.rb',
|
24
|
-
"
|
24
|
+
" config.action_mailer.default_url_options = {:host => 'localhost:3000'}\n",
|
25
|
+
:after => "::Application.configure do\n"
|
26
|
+
inject_into_file 'config/environments/test.rb',
|
27
|
+
" config.action_mailer.default_url_options = {:host => 'localhost:3000'}\n",
|
25
28
|
:after => "::Application.configure do\n"
|
26
29
|
inject_into_file 'config/environments/production.rb',
|
27
|
-
"
|
30
|
+
" config.action_mailer.default_url_options = {:host => 'localhost:3000'}\n",
|
28
31
|
:after => "::Application.configure do\n"
|
29
32
|
generate("devise:install")
|
30
33
|
generate("devise", "User")
|
@@ -39,7 +42,7 @@ EOS
|
|
39
42
|
gsub_file 'app/models/user.rb', /, :registerable,$/, ', #:registerable,'
|
40
43
|
gsub_file 'app/models/user.rb', /, :trackable, :validatable$/, <<EOS
|
41
44
|
, :trackable, #:validatable,
|
42
|
-
|
45
|
+
:lockable, :lock_strategy => :none, :unlock_strategy => :none
|
43
46
|
enju_leaf_user_model
|
44
47
|
EOS
|
45
48
|
inject_into_class "app/controllers/application_controller.rb", ApplicationController do
|
@@ -79,6 +82,10 @@ use Rack::Protection, :except => [:escaped_params, :json_csrf, :http_origin, :se
|
|
79
82
|
EOS
|
80
83
|
end
|
81
84
|
generate("sunspot_rails:install")
|
85
|
+
generate("kaminari:config")
|
86
|
+
gsub_file 'config/initializers/kaminari_config.rb',
|
87
|
+
/# config.default_per_page = 25$/,
|
88
|
+
"config.default_per_page = 10"
|
82
89
|
remove_file "public/index.html"
|
83
90
|
remove_file "app/views/layouts/application.html.erb"
|
84
91
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class CreatePatrons < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
-
create_table :
|
3
|
+
create_table :agents do |t|
|
4
4
|
t.integer :user_id
|
5
5
|
t.string :last_name
|
6
6
|
t.string :middle_name
|
@@ -35,7 +35,7 @@ class CreatePatrons < ActiveRecord::Migration
|
|
35
35
|
t.datetime :date_of_death
|
36
36
|
t.integer :language_id, :default => 1, :null => false
|
37
37
|
t.integer :country_id, :default => 1, :null => false
|
38
|
-
t.integer :
|
38
|
+
t.integer :agent_type_id, :default => 1, :null => false
|
39
39
|
t.integer :lock_version, :default => 0, :null => false
|
40
40
|
t.text :note
|
41
41
|
t.integer :required_role_id, :default => 1, :null => false
|
@@ -44,10 +44,10 @@ class CreatePatrons < ActiveRecord::Migration
|
|
44
44
|
t.text :email
|
45
45
|
t.text :url
|
46
46
|
end
|
47
|
-
add_index :
|
48
|
-
add_index :
|
49
|
-
add_index :
|
50
|
-
add_index :
|
51
|
-
add_index :
|
47
|
+
add_index :agents, :user_id, :unique => true
|
48
|
+
add_index :agents, :language_id
|
49
|
+
add_index :agents, :country_id
|
50
|
+
add_index :agents, :required_role_id
|
51
|
+
add_index :agents, :full_name
|
52
52
|
end
|
53
53
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
class CreateOwns < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :owns do |t|
|
4
|
-
t.references :
|
4
|
+
t.references :agent, :null => false
|
5
5
|
t.references :item, :null => false
|
6
6
|
t.integer :position
|
7
7
|
t.timestamps
|
8
8
|
end
|
9
|
-
add_index :owns, :
|
9
|
+
add_index :owns, :agent_id
|
10
10
|
add_index :owns, :item_id
|
11
11
|
end
|
12
12
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
class CreateCreates < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :creates do |t|
|
4
|
-
t.references :
|
4
|
+
t.references :agent, :null => false
|
5
5
|
t.references :work, :null => false
|
6
6
|
t.integer :position
|
7
7
|
t.timestamps
|
8
8
|
end
|
9
|
-
add_index :creates, :
|
9
|
+
add_index :creates, :agent_id
|
10
10
|
add_index :creates, :work_id
|
11
11
|
end
|
12
12
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
class CreateProduces < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :produces do |t|
|
4
|
-
t.references :
|
4
|
+
t.references :agent, :null => false
|
5
5
|
t.references :manifestation, :null => false
|
6
6
|
t.integer :position
|
7
7
|
t.timestamps
|
8
8
|
end
|
9
|
-
add_index :produces, :
|
9
|
+
add_index :produces, :agent_id
|
10
10
|
add_index :produces, :manifestation_id
|
11
11
|
end
|
12
12
|
end
|