enju_purchase_request 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  class PurchaseRequestsController < ApplicationController
2
2
  load_and_authorize_resource :except => :index
3
3
  authorize_resource :only => :index
4
- before_filter :get_user_if_nil
4
+ before_filter :get_user
5
5
  before_filter :get_order_list
6
6
  before_filter :store_page, :only => :index
7
7
  after_filter :solr_commit, :only => [:create, :update, :destroy]
@@ -7,6 +7,7 @@ require 'attribute_normalizer'
7
7
  require 'configatron'
8
8
  require 'addressable/uri'
9
9
  require 'nkf'
10
+ require 'acts_as_list'
10
11
 
11
12
  module EnjuPurchaseRequest
12
13
  class Engine < Rails::Engine
@@ -1,3 +1,3 @@
1
1
  module EnjuPurchaseRequest
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -60,9 +60,8 @@ class ApplicationController < ActionController::Base
60
60
  raise CanCan::AccessDenied
61
61
  end
62
62
 
63
- def get_user_if_nil
63
+ def get_user
64
64
  @user = User.where(:username => params[:user_id]).first if params[:user_id]
65
- #authorize! :show, @user if @user
66
65
  end
67
66
 
68
67
  def get_order_list
@@ -23,8 +23,8 @@ ActiveRecord::Schema.define(:version => 20111201163718) do
23
23
  t.string "url"
24
24
  t.integer "position"
25
25
  t.datetime "deleted_at"
26
- t.datetime "created_at"
27
- t.datetime "updated_at"
26
+ t.datetime "created_at", :null => false
27
+ t.datetime "updated_at", :null => false
28
28
  end
29
29
 
30
30
  create_table "items", :force => true do |t|
@@ -32,8 +32,8 @@ ActiveRecord::Schema.define(:version => 20111201163718) do
32
32
  t.string "item_identifier"
33
33
  t.integer "circulation_status_id", :default => 5, :null => false
34
34
  t.integer "checkout_type_id", :default => 1, :null => false
35
- t.datetime "created_at"
36
- t.datetime "updated_at"
35
+ t.datetime "created_at", :null => false
36
+ t.datetime "updated_at", :null => false
37
37
  t.datetime "deleted_at"
38
38
  t.integer "shelf_id", :default => 1, :null => false
39
39
  t.integer "basket_id"
@@ -64,8 +64,8 @@ ActiveRecord::Schema.define(:version => 20111201163718) do
64
64
  t.datetime "ordered_at"
65
65
  t.datetime "deleted_at"
66
66
  t.string "state"
67
- t.datetime "created_at"
68
- t.datetime "updated_at"
67
+ t.datetime "created_at", :null => false
68
+ t.datetime "updated_at", :null => false
69
69
  end
70
70
 
71
71
  add_index "order_lists", ["bookstore_id"], :name => "index_order_lists_on_bookstore_id"
@@ -76,8 +76,8 @@ ActiveRecord::Schema.define(:version => 20111201163718) do
76
76
  t.integer "purchase_request_id", :null => false
77
77
  t.integer "position"
78
78
  t.string "state"
79
- t.datetime "created_at"
80
- t.datetime "updated_at"
79
+ t.datetime "created_at", :null => false
80
+ t.datetime "updated_at", :null => false
81
81
  end
82
82
 
83
83
  add_index "orders", ["order_list_id"], :name => "index_orders_on_order_list_id"
@@ -95,8 +95,8 @@ ActiveRecord::Schema.define(:version => 20111201163718) do
95
95
  t.text "note"
96
96
  t.datetime "accepted_at"
97
97
  t.datetime "denied_at"
98
- t.datetime "created_at"
99
- t.datetime "updated_at"
98
+ t.datetime "created_at", :null => false
99
+ t.datetime "updated_at", :null => false
100
100
  t.datetime "deleted_at"
101
101
  t.string "state"
102
102
  t.string "pub_date"
@@ -110,8 +110,8 @@ ActiveRecord::Schema.define(:version => 20111201163718) do
110
110
  t.text "display_name"
111
111
  t.text "note"
112
112
  t.integer "position"
113
- t.datetime "created_at"
114
- t.datetime "updated_at"
113
+ t.datetime "created_at", :null => false
114
+ t.datetime "updated_at", :null => false
115
115
  end
116
116
 
117
117
  create_table "user_groups", :force => true do |t|
@@ -119,15 +119,15 @@ ActiveRecord::Schema.define(:version => 20111201163718) do
119
119
  t.text "display_name"
120
120
  t.text "note"
121
121
  t.integer "position"
122
- t.datetime "created_at"
123
- t.datetime "updated_at"
122
+ t.datetime "created_at", :null => false
123
+ t.datetime "updated_at", :null => false
124
124
  end
125
125
 
126
126
  create_table "user_has_roles", :force => true do |t|
127
127
  t.integer "user_id"
128
128
  t.integer "role_id"
129
- t.datetime "created_at"
130
- t.datetime "updated_at"
129
+ t.datetime "created_at", :null => false
130
+ t.datetime "updated_at", :null => false
131
131
  end
132
132
 
133
133
  create_table "users", :force => true do |t|
@@ -136,8 +136,8 @@ ActiveRecord::Schema.define(:version => 20111201163718) do
136
136
  t.string "username"
137
137
  t.text "note"
138
138
  t.string "locale"
139
- t.datetime "created_at"
140
- t.datetime "updated_at"
139
+ t.datetime "created_at", :null => false
140
+ t.datetime "updated_at", :null => false
141
141
  t.string "email", :default => "", :null => false
142
142
  t.string "encrypted_password", :limit => 128, :default => "", :null => false
143
143
  t.string "reset_password_token"
Binary file
@@ -0,0 +1,31 @@
1
+ <!--
2
+ Licensed to the Apache Software Foundation (ASF) under one or more
3
+ contributor license agreements. See the NOTICE file distributed with
4
+ this work for additional information regarding copyright ownership.
5
+ The ASF licenses this file to You under the Apache License, Version 2.0
6
+ (the "License"); you may not use this file except in compliance with
7
+ the License. You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ -->
17
+
18
+ <!-- The content of this page will be statically included into the top
19
+ of the admin page. Uncomment this as an example to see there the content
20
+ will show up.
21
+
22
+ <hr>
23
+ <i>This line will appear before the first table</i>
24
+ <tr>
25
+ <td colspan="2">
26
+ This row will be appended to the end of the first table
27
+ </td>
28
+ </tr>
29
+ <hr>
30
+
31
+ -->
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with
5
+ this work for additional information regarding copyright ownership.
6
+ The ASF licenses this file to You under the Apache License, Version 2.0
7
+ (the "License"); you may not use this file except in compliance with
8
+ the License. You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ -->
18
+
19
+ <!-- If this file is found in the config directory, it will only be
20
+ loaded once at startup. If it is found in Solr's data
21
+ directory, it will be re-loaded every commit.
22
+ -->
23
+
24
+ <elevate>
25
+ <query text="foo bar">
26
+ <doc id="1" />
27
+ <doc id="2" />
28
+ <doc id="3" />
29
+ </query>
30
+
31
+ <query text="ipod">
32
+ <doc id="MA147LL/A" /> <!-- put the actual ipod at the top -->
33
+ <doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
34
+ </query>
35
+
36
+ </elevate>
@@ -0,0 +1,246 @@
1
+ # The ASF licenses this file to You under the Apache License, Version 2.0
2
+ # (the "License"); you may not use this file except in compliance with
3
+ # the License. You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ # Syntax:
14
+ # "source" => "target"
15
+ # "source".length() > 0 (source cannot be empty.)
16
+ # "target".length() >= 0 (target can be empty.)
17
+
18
+ # example:
19
+ # "À" => "A"
20
+ # "\u00C0" => "A"
21
+ # "\u00C0" => "\u0041"
22
+ # "ß" => "ss"
23
+ # "\t" => " "
24
+ # "\n" => ""
25
+
26
+ # À => A
27
+ "\u00C0" => "A"
28
+
29
+ # Á => A
30
+ "\u00C1" => "A"
31
+
32
+ # Â => A
33
+ "\u00C2" => "A"
34
+
35
+ # Ã => A
36
+ "\u00C3" => "A"
37
+
38
+ # Ä => A
39
+ "\u00C4" => "A"
40
+
41
+ # Å => A
42
+ "\u00C5" => "A"
43
+
44
+ # Æ => AE
45
+ "\u00C6" => "AE"
46
+
47
+ # Ç => C
48
+ "\u00C7" => "C"
49
+
50
+ # È => E
51
+ "\u00C8" => "E"
52
+
53
+ # É => E
54
+ "\u00C9" => "E"
55
+
56
+ # Ê => E
57
+ "\u00CA" => "E"
58
+
59
+ # Ë => E
60
+ "\u00CB" => "E"
61
+
62
+ # Ì => I
63
+ "\u00CC" => "I"
64
+
65
+ # Í => I
66
+ "\u00CD" => "I"
67
+
68
+ # Î => I
69
+ "\u00CE" => "I"
70
+
71
+ # Ï => I
72
+ "\u00CF" => "I"
73
+
74
+ # IJ => IJ
75
+ "\u0132" => "IJ"
76
+
77
+ # Ð => D
78
+ "\u00D0" => "D"
79
+
80
+ # Ñ => N
81
+ "\u00D1" => "N"
82
+
83
+ # Ò => O
84
+ "\u00D2" => "O"
85
+
86
+ # Ó => O
87
+ "\u00D3" => "O"
88
+
89
+ # Ô => O
90
+ "\u00D4" => "O"
91
+
92
+ # Õ => O
93
+ "\u00D5" => "O"
94
+
95
+ # Ö => O
96
+ "\u00D6" => "O"
97
+
98
+ # Ø => O
99
+ "\u00D8" => "O"
100
+
101
+ # Œ => OE
102
+ "\u0152" => "OE"
103
+
104
+ # Þ
105
+ "\u00DE" => "TH"
106
+
107
+ # Ù => U
108
+ "\u00D9" => "U"
109
+
110
+ # Ú => U
111
+ "\u00DA" => "U"
112
+
113
+ # Û => U
114
+ "\u00DB" => "U"
115
+
116
+ # Ü => U
117
+ "\u00DC" => "U"
118
+
119
+ # Ý => Y
120
+ "\u00DD" => "Y"
121
+
122
+ # Ÿ => Y
123
+ "\u0178" => "Y"
124
+
125
+ # à => a
126
+ "\u00E0" => "a"
127
+
128
+ # á => a
129
+ "\u00E1" => "a"
130
+
131
+ # â => a
132
+ "\u00E2" => "a"
133
+
134
+ # ã => a
135
+ "\u00E3" => "a"
136
+
137
+ # ä => a
138
+ "\u00E4" => "a"
139
+
140
+ # å => a
141
+ "\u00E5" => "a"
142
+
143
+ # æ => ae
144
+ "\u00E6" => "ae"
145
+
146
+ # ç => c
147
+ "\u00E7" => "c"
148
+
149
+ # è => e
150
+ "\u00E8" => "e"
151
+
152
+ # é => e
153
+ "\u00E9" => "e"
154
+
155
+ # ê => e
156
+ "\u00EA" => "e"
157
+
158
+ # ë => e
159
+ "\u00EB" => "e"
160
+
161
+ # ì => i
162
+ "\u00EC" => "i"
163
+
164
+ # í => i
165
+ "\u00ED" => "i"
166
+
167
+ # î => i
168
+ "\u00EE" => "i"
169
+
170
+ # ï => i
171
+ "\u00EF" => "i"
172
+
173
+ # ij => ij
174
+ "\u0133" => "ij"
175
+
176
+ # ð => d
177
+ "\u00F0" => "d"
178
+
179
+ # ñ => n
180
+ "\u00F1" => "n"
181
+
182
+ # ò => o
183
+ "\u00F2" => "o"
184
+
185
+ # ó => o
186
+ "\u00F3" => "o"
187
+
188
+ # ô => o
189
+ "\u00F4" => "o"
190
+
191
+ # õ => o
192
+ "\u00F5" => "o"
193
+
194
+ # ö => o
195
+ "\u00F6" => "o"
196
+
197
+ # ø => o
198
+ "\u00F8" => "o"
199
+
200
+ # œ => oe
201
+ "\u0153" => "oe"
202
+
203
+ # ß => ss
204
+ "\u00DF" => "ss"
205
+
206
+ # þ => th
207
+ "\u00FE" => "th"
208
+
209
+ # ù => u
210
+ "\u00F9" => "u"
211
+
212
+ # ú => u
213
+ "\u00FA" => "u"
214
+
215
+ # û => u
216
+ "\u00FB" => "u"
217
+
218
+ # ü => u
219
+ "\u00FC" => "u"
220
+
221
+ # ý => y
222
+ "\u00FD" => "y"
223
+
224
+ # ÿ => y
225
+ "\u00FF" => "y"
226
+
227
+ # ff => ff
228
+ "\uFB00" => "ff"
229
+
230
+ # fi => fi
231
+ "\uFB01" => "fi"
232
+
233
+ # fl => fl
234
+ "\uFB02" => "fl"
235
+
236
+ # ffi => ffi
237
+ "\uFB03" => "ffi"
238
+
239
+ # ffl => ffl
240
+ "\uFB04" => "ffl"
241
+
242
+ # ſt => ft
243
+ "\uFB05" => "ft"
244
+
245
+ # st => st
246
+ "\uFB06" => "st"