Revision 1404:e2c17a09ce86
| plugins/redmine_bibliography/app/controllers/publications_controller.rb | ||
|---|---|---|
| 250 | 250 |
render :layout => false |
| 251 | 251 |
end |
| 252 | 252 |
|
| 253 |
def get_user_info |
|
| 254 |
object_id = params[:object_id] |
|
| 255 |
value = params[:value] |
|
| 256 |
classname = Kernel.const_get(value.split('_')[0])
|
|
| 257 |
|
|
| 258 |
item = classname.find(value.split('_')[1])
|
|
| 259 |
|
|
| 260 |
name_field = "publication_authorships_attributes_#{object_id}_name_on_paper".to_sym
|
|
| 261 |
email_field = "publication_authorships_attributes_#{object_id}_email".to_sym
|
|
| 262 |
institution_field = "publication_authorships_attributes_#{object_id}_institution".to_sym
|
|
| 263 |
|
|
| 264 |
yes_radio = "publication_authorships_attributes_#{object_id}_identify_author_yes".to_sym
|
|
| 265 |
|
|
| 266 |
respond_to do |format| |
|
| 267 |
format.js {
|
|
| 268 |
render(:update) {|page|
|
|
| 269 |
page[name_field].value = item.name |
|
| 270 |
page[email_field].value = item.mail |
|
| 271 |
page[institution_field].value = item.institution |
|
| 272 |
|
|
| 273 |
page[yes_radio].checked = true |
|
| 274 |
page[name_field].readOnly = true |
|
| 275 |
page[email_field].readOnly = true |
|
| 276 |
page[institution_field].readOnly = true |
|
| 277 |
} |
|
| 278 |
} |
|
| 279 |
end |
|
| 280 |
end |
|
| 281 |
|
|
| 282 | 253 |
def sort_author_order |
| 283 | 254 |
params[:authorships].each_with_index do |id, index| |
| 284 | 255 |
Authorship.update_all(['auth_order=?', index+1], ['id=?', id]) |
| ... | ... | |
| 303 | 274 |
end |
| 304 | 275 |
end |
| 305 | 276 |
|
| 306 |
|
|
| 307 | 277 |
def remove_project |
| 308 | 278 |
@project = Project.find(params[:project_id]) |
| 309 | 279 |
proj = Project.find(params[:remove_project_id]) |
Also available in: Unified diff