# Change logged in user's password\r
def change_password\r
@user = self.logged_in_user\r
- flash.now[:notice] = l(:notice_can_t_change_password) and render :action => 'my_account' and return if @user.auth_source_id\r
+ flash[:notice] = l(:notice_can_t_change_password) and redirect_to :action => 'my_account' and return if @user.auth_source_id\r
if @user.check_password?(@params[:password])\r
@user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]\r
- flash.now[:notice] = l(:notice_account_password_updated) if @user.save\r
+ if @user.save\r
+ flash[:notice] = l(:notice_account_password_updated)\r
+ else\r
+ render :action => 'my_account'\r
+ return\r
+ end\r
else\r
- flash.now[:notice] = l(:notice_account_wrong_password)\r
+ flash[:notice] = l(:notice_account_wrong_password)\r
end\r
- render :action => 'my_account'\r
+ redirect_to :action => 'my_account'\r
end\r
\r
# Enable user to choose a new password\r
a.mail_enabled = (params[:action_ids] || []).include? a.id.to_s \r
a.save\r
}\r
- flash[:notice] = "Mail options were successfully updated."\r
+ flash.now[:notice] = l(:notice_successful_update)\r
end\r
end\r
\r
def require_login\r
unless self.logged_in_user\r
store_location\r
- redirect_to(:controller => "account", :action => "login")\r
+ redirect_to :controller => "account", :action => "login"\r
return false\r
end\r
true\r
def require_admin\r
return unless require_login\r
unless self.logged_in_user.admin?\r
- flash[:notice] = "Acces denied"\r
- redirect_to:controller => ''\r
+ render :nothing => true, :status => 403\r
return false\r
end\r
true\r
if @user_membership and Permission.allowed_to_role( "%s/%s" % [ @params[:controller], @params[:action] ], @user_membership.role_id ) \r
return true \r
end \r
- flash[:notice] = "Acces denied"\r
- redirect_to :controller => ''\r
+ render :nothing => true, :status => 403\r
false\r
end\r
\r
return\r
end \r
if request.post? and @custom_field.save\r
+ flash[:notice] = l(:notice_successful_create)\r
redirect_to :action => 'list'\r
end\r
@trackers = Tracker.find(:all)\r
if @custom_field.is_a? IssueCustomField\r
@custom_field.trackers = params[:tracker_ids] ? Tracker.find(params[:tracker_ids]) : []\r
end\r
- flash[:notice] = 'Custom field was successfully updated.'\r
+ flash[:notice] = l(:notice_successful_update)\r
redirect_to :action => 'list'\r
end\r
@trackers = Tracker.find(:all)\r
def edit\r
@categories = Enumeration::get_values('DCAT')
if request.post? and @document.update_attributes(params[:document])
- flash[:notice] = 'Document was successfully updated.'
+ flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'show', :id => @document
end
end \r
\r
def edit
if request.post? and @category.update_attributes(params[:category])
- flash[:notice] = 'Issue category was successfully updated.'
+ flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'projects', :action => 'settings', :id => @project
end
end
def create
@issue_status = IssueStatus.new(params[:issue_status])
if @issue_status.save
- flash[:notice] = 'IssueStatus was successfully created.'
+ flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'list'
else
render :action => 'new'
def update
@issue_status = IssueStatus.find(params[:id])
if @issue_status.update_attributes(params[:issue_status])
- flash[:notice] = 'IssueStatus was successfully updated.'
+ flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'list'
else
render :action => 'edit'
@issue.custom_values = @custom_values\r
@issue.attributes = params[:issue]\r
if @issue.save
- flash[:notice] = 'Issue was successfully updated.'\r
+ flash[:notice] = l(:notice_successful_update)\r
redirect_to :action => 'show', :id => @issue
end\r
end
@issue.fixed_version_id = (params[:issue][:fixed_version_id])\r
@issue.assigned_to_id = (params[:issue][:assigned_to_id]) \r
if @issue.save\r
- flash[:notice] = 'Issue was successfully updated.'\r
+ flash[:notice] = l(:notice_successful_update)\r
Mailer.deliver_issue_change_status(@issue) if Permission.find_by_controller_and_action(@params[:controller], @params[:action]).mail_enabled?\r
redirect_to :action => 'show', :id => @issue\r
end
def edit
if request.post? and @member.update_attributes(params[:member])
- flash[:notice] = 'Member was successfully updated.'
+ flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'projects', :action => 'settings', :id => @project\r
end
end
def destroy
@member.destroy\r
- flash[:notice] = 'Member was successfully removed.'
+ flash[:notice] = l(:notice_successful_delete)
redirect_to :controller => 'projects', :action => 'settings', :id => @project
end\r
\r
def edit
if request.post? and @news.update_attributes(params[:news])
- flash[:notice] = 'News was successfully updated.'
+ flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'show', :id => @news
end
end
@custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }\r
@project.custom_values = @custom_values \r
if @project.save
- flash[:notice] = 'Project was successfully created.'
+ flash[:notice] = l(:notice_successful_create)
redirect_to :controller => 'admin', :action => 'projects'\r
end \r
end \r
@project.custom_values = @custom_values\r
end\r
if @project.update_attributes(params[:project])
- flash[:notice] = 'Project was successfully updated.'
+ flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'settings', :id => @project\r
else\r
settings\r
if request.post?\r
@issue_category = @project.issue_categories.build(params[:issue_category])\r
if @issue_category.save\r
+ flash[:notice] = l(:notice_successful_create)\r
redirect_to :action => 'settings', :id => @project\r
else\r
settings\r
def add_version\r
@version = @project.versions.build(params[:version])\r
if request.post? and @version.save\r
+ flash[:notice] = l(:notice_successful_create)\r
redirect_to :action => 'settings', :id => @project\r
end\r
end\r
@member = @project.members.build(params[:member])\r
if request.post?\r
if @member.save\r
- flash[:notice] = 'Member was successfully added.'\r
+ flash[:notice] = l(:notice_successful_create)\r
redirect_to :action => 'settings', :id => @project\r
else \r
settings\r
@attachment.author_id = self.logged_in_user.id if self.logged_in_user\r
end \r
if @document.save\r
+ flash[:notice] = l(:notice_successful_create)\r
redirect_to :action => 'list_documents', :id => @project\r
end \r
end\r
@custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }\r
@issue.custom_values = @custom_values \r
if @issue.save\r
- flash[:notice] = "Issue was successfully added."\r
+ flash[:notice] = l(:notice_successful_create)\r
Mailer.deliver_issue_add(@issue) if Permission.find_by_controller_and_action(@params[:controller], @params[:action]).mail_enabled?\r
redirect_to :action => 'list_issues', :id => @project\r
end \r
@news.attributes = params[:news]\r
@news.author_id = self.logged_in_user.id if self.logged_in_user\r
if @news.save\r
+ flash[:notice] = l(:notice_successful_create)\r
redirect_to :action => 'list_news', :id => @project\r
end\r
end\r
@attachment = @project.versions.find(params[:version_id]).attachments.build(params[:attachment]) \r
@attachment.author_id = self.logged_in_user.id if self.logged_in_user\r
if @attachment.save\r
+ flash[:notice] = l(:notice_successful_create)\r
redirect_to :controller => 'projects', :action => 'list_files', :id => @project\r
end\r
end\r
# used as a before_filter\r
def find_project\r
@project = Project.find(params[:id]) \r
- rescue\r
- flash[:notice] = 'Project not found.'
+ rescue
redirect_to :action => 'list' \r
end\r
end
if request.post?
@role.permissions = Permission.find(@params[:permission_ids]) if @params[:permission_ids]
if @role.save
- flash[:notice] = 'Role was successfully created.'
+ flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'list'
end\r
end
if request.post? and @role.update_attributes(params[:role])
@role.permissions = Permission.find(@params[:permission_ids] || [])\r
Permission.allowed_to_role_expired
- flash[:notice] = 'Role was successfully updated.'
+ flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'list'
end
@permissions = Permission.find(:all, :conditions => ["is_public=?", false], :order => 'sort ASC')
}\r
}\r
if @role.save\r
- flash[:notice] = 'Workflow was successfully updated.'\r
+ flash[:notice] = l(:notice_successful_update)\r
end\r
end\r
@roles = Role.find_all\r
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
\r
class TrackersController < ApplicationController\r
- layout 'base'\r
- before_filter :require_admin\r
+ layout 'base'\r
+ before_filter :require_admin\r
def index
list
def new
@tracker = Tracker.new(params[:tracker])
if request.post? and @tracker.save
- flash[:notice] = 'Tracker was successfully created.'
+ flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'list'
end
end
def edit
@tracker = Tracker.find(params[:id])
if request.post? and @tracker.update_attributes(params[:tracker])
- flash[:notice] = 'Tracker was successfully updated.'
+ flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'list'
end
end
@custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => params["custom_fields"][x.id.to_s]) }\r
@user.custom_values = @custom_values \r
if @user.save
- flash[:notice] = 'User was successfully created.'
+ flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'list'
end\r
end
@user.custom_values = @custom_values\r
end\r
if @user.update_attributes(params[:user])
- flash[:notice] = 'User was successfully updated.'
+ flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'list'
end\r
end
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
\r
class VersionsController < ApplicationController\r
- layout 'base'\r
- before_filter :find_project, :authorize\r
-
- def edit
- if request.post? and @version.update_attributes(params[:version])
- flash[:notice] = 'Version was successfully updated.'
+ layout 'base'\r
+ before_filter :find_project, :authorize\r
+
+ def edit
+ if request.post? and @version.update_attributes(params[:version])
+ flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'projects', :action => 'settings', :id => @project
- end
- end
-
- def destroy\r
- @version.destroy
- redirect_to :controller => 'projects', :action => 'settings', :id => @project\r
+ end
+ end
+
+ def destroy\r
+ @version.destroy
+ redirect_to :controller => 'projects', :action => 'settings', :id => @project\r
rescue\r
flash[:notice] = "Unable to delete version"\r
- redirect_to :controller => 'projects', :action => 'settings', :id => @project\r
- end\r
- \r
+ redirect_to :controller => 'projects', :action => 'settings', :id => @project\r
+ end\r
+\r
def download\r
@attachment = @version.attachments.find(params[:attachment_id])\r
@attachment.increment_download\r
send_file @attachment.diskfile, :filename => @attachment.filename\r
rescue\r
- flash[:notice]="Requested file doesn't exist or has been deleted."\r
+ flash[:notice] = l(:notice_file_not_found)\r
redirect_to :controller => 'projects', :action => 'list_files', :id => @project\r
end \r
\r
def destroy_file\r
@version.attachments.find(params[:attachment_id]).destroy\r
+ flash[:notice] = l(:notice_successful_delete)\r
redirect_to :controller => 'projects', :action => 'list_files', :id => @project\r
end\r
\r
private\r
- def find_project\r
+ def find_project\r
@version = Version.find(params[:id])\r
- @project = @version.project\r
- end
+ @project = @version.project\r
+ end
end
end\r
\r
def lang_options_for_select\r
- GLoc.valid_languages.collect {|lang| [ l_lang_name(lang.to_s, lang), lang.to_s]}\r
+ (GLoc.valid_languages.sort {|x,y| x.to_s <=> y.to_s }).collect {|lang| [ l_lang_name(lang.to_s, lang), lang.to_s]}\r
end\r
end
def custom_field_tag(custom_value) \r
custom_field = custom_value.custom_field\r
field_name = "custom_fields[#{custom_field.id}]"\r
+ field_id = "custom_fields_#{custom_field.id}"\r
+ \r
case custom_field.field_format\r
when "string", "int", "date"\r
- text_field_tag field_name, custom_value.value\r
+ text_field_tag field_name, custom_value.value, :id => field_id\r
when "text"\r
- text_area_tag field_name, custom_value.value, :cols => 60, :rows => 3\r
+ text_area_tag field_name, custom_value.value, :id => field_id, :cols => 60, :rows => 3\r
when "bool"\r
- check_box_tag(field_name, "1", custom_value.value == "1") + \r
+ check_box_tag(field_name, "1", custom_value.value == "1", :id => field_id) + \r
hidden_field_tag(field_name, "0")\r
when "list"\r
select_tag field_name, \r
"<option></option>" + options_for_select(custom_field.possible_values.split('|'),\r
- custom_value.value)\r
+ custom_value.value), :id => field_id\r
end\r
end\r
\r
def custom_field_label_tag(custom_value)\r
content_tag "label", custom_value.custom_field.name +\r
- (custom_value.custom_field.is_required? ? " <span class=\"required\">*</span>" : "")\r
+ (custom_value.custom_field.is_required? ? " <span class=\"required\">*</span>" : ""),\r
+ :for => "custom_fields_#{custom_value.custom_field.id}"\r
end\r
\r
def custom_field_tag_with_label(custom_value)\r
<div class="splitcontentleft">\r
<div class="box">\r
<h3><%=l(:label_information_plural)%></h3>\r
-
+
<%= start_form_tag :action => 'my_account' %>
\r
<!--[form:user]-->
<%= text_field 'user', 'lastname' %></p>
<p><label for="user_mail"><%=l(:field_mail)%> <span class="required">*</span></label><br/>
- <%= text_field 'user', 'mail' %></p>\r
+ <%= text_field 'user', 'mail', :size => 40 %></p>\r
\r
<p><label for="user_language"><%=l(:field_language)%></label><br/>
<%= select("user", "language", lang_options_for_select) %></p>
<% unless @user.auth_source_id %>\r
<div class="box">\r
<h3><%=l(:field_password)%></h3>\r
-
+
<%= start_form_tag :action => 'change_password' %>
\r
<p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label><br/>
<p><%=l(:text_select_mail_notifications)%></p>\r
\r
<%= start_form_tag ({}, :id => 'mail_options_form')%>\r
-<% for action in @actions %>\r
- <%= check_box_tag "action_ids[]", action.id, action.mail_enabled? %>\r
- <%= action.description %><br />\r
+\r
+<% actions = @actions.group_by {|p| p.group_id } %>\r
+<% actions.keys.sort.each do |group_id| %>\r
+<fieldset style="margin-top: 6px;"><legend><strong><%= l(Permission::GROUPS[group_id]) %></strong></legend>\r
+<% actions[group_id].each do |p| %>\r
+ <div style="width:170px;float:left;"><%= check_box_tag "action_ids[]", p.id, p.mail_enabled? %>\r
+ <%= l(p.description.to_sym) %>\r
+ </div>\r
+<% end %>\r
+</fieldset>\r
<% end %>\r
+\r
+\r
<br />\r
<p>\r
<a href="javascript:checkAll('mail_options_form', true)"><%=l(:button_check_all)%></a> |\r
<div class="box">\r
<h3><%=l(:label_news_latest)%></h3> \r
<% for news in @news %>\r
- <p>\r
- <b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br />\r
+ <p><b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br />\r
<%= news.summary %>\r
- <small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small>\r
- </p>\r
+ <small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small></p>\r
<hr />\r
<% end %>
<center><small>[ <%= link_to l(:label_news_view_all), :controller => 'projects', :action => 'list_news', :id => @project %> ]</small></center>\r
activerecord_error_taken: has already been taken\r
activerecord_error_not_a_number: is not a number\r
\r
-general_fmt_age: %d yr\r
-general_fmt_age_plural: %d yrs\r
-general_fmt_date: %%b %%d, %%Y (%%a)\r
-general_fmt_datetime: %%b %%d, %%Y (%%a), %%I:%%M %%p\r
-general_fmt_datetime_short: %%b %%d, %%I:%%M %%p\r
-general_fmt_time: %%I:%%M %%p\r
+general_fmt_age: %d año\r
+general_fmt_age_plural: %d años\r
+general_fmt_date: %%d/%%m/%%Y\r
+general_fmt_datetime: %%d/%%m/%%Y %%H:%%M\r
+general_fmt_datetime_short: %%d/%%m %%H:%%M\r
+general_fmt_time: %%H:%%M\r
general_text_No: 'No'\r
-general_text_Yes: 'Yes'\r
+general_text_Yes: 'Sí'\r
general_text_no: 'no'\r
-general_text_yes: 'yes'\r
+general_text_yes: 'sí'\r
general_lang_es: 'Español'\r
\r
notice_account_updated: Account was successfully updated.\r
notice_file_not_found: Requested file doesn't exist or has been deleted.\r
\r
gui_validation_error: 1 error\r
-gui_validation_error_plural: %d errors\r
+gui_validation_error_plural: %d errores\r
\r
field_name: Nombre\r
field_description: Descripción\r
field_lastname: Apellido\r
field_mail: Email\r
field_filename: Fichero\r
-#field_filesize: Size\r
+field_filesize: Tamaño\r
field_downloads: Telecargas\r
field_author: Autor\r
field_created_on: Creado\r
field_updated_on: Actualizado\r
-#field_field_format: Format\r
+field_field_format: Formato\r
field_is_for_all: Para todos los proyectos\r
field_possible_values: Valores posibles\r
field_regexp: Expresión regular\r
field_project: Proyecto\r
field_issue: Petición\r
field_status: Estatuto\r
-#field_notes: Notes\r
+field_notes: Notas\r
field_is_closed: Petición resuelta\r
field_is_default: Estatuto por defecto\r
field_html_color: Color\r
label_information_plural: Informaciones\r
label_please_login: Conexión\r
#label_register: Register\r
-#label_password_lost: Lost password\r
+label_password_lost: ¿Olvidaste la contraseña?\r
label_home: Acogida\r
label_my_page: Mi página\r
label_my_account: Mi cuenta\r
label_version_new: Nueva versión\r
label_version_plural: Versiónes\r
label_confirmation: Confirmación\r
-#label_export_csv: Export to CSV\r
+label_export_csv: Exportar a CSV\r
label_read: Leer...\r
label_public_projects: Proyectos publicos\r
label_open_issues: Abierta\r
text_project_destroy_confirmation: ¿ Estás seguro de querer eliminar el proyecto ?\r
text_workflow_edit: Seleccionar un workflow para actualizar\r
\r
-#default_role_manager: Manager\r
-#default_role_developper: Developer\r
-#default_role_reporter: Reporter\r
+default_role_manager: Manager\r
+default_role_developper: Desarrollador\r
+default_role_reporter: Informador\r
default_tracker_bug: Anomalía\r
default_tracker_feature: Evolución\r
default_tracker_support: Asistencia\r
}\r
\r
#content h2 a{font-weight:normal;}\r
-#content h3{margin:0 0 5px 0; font-size:1.4em; letter-spacing:-1px;}\r
+#content h3{margin:0 0 12px 0; font-size:1.4em; letter-spacing:-1px;}\r
#content a:hover,#subcontent a:hover{text-decoration:underline;}\r
#content ul,#content ol{margin:0 5px 16px 35px;}\r
#content dl{margin:0 5px 10px 25px;}\r
background-color:#CEE1ED;\r
}\r
\r
-hr { border:0px; border-bottom:1px dashed #000000; }\r
+hr { border:none; border-bottom: dotted 2px #c0c0c0; }\r
\r
\r
/**************** Sidebar styles ****************/\r
post "account/change_password", :password => 'jsmith', :new_password => "hello", :new_password_confirmation => "hello2"
assert_response :success
+ assert_template "account/my_account"
assert_tag :tag => "div", :attributes => { :class => "errorExplanation" }
-
+
+ post "account/change_password", :password => 'jsmithZZ', :new_password => "hello", :new_password_confirmation => "hello"
+ assert_redirected_to "account/my_account"
+ assert_equal 'Wrong password', flash[:notice]
+
post "account/change_password", :password => 'jsmith', :new_password => "hello", :new_password_confirmation => "hello"
- assert_response :success
+ assert_redirected_to "account/my_account"
log_user('jsmith', 'hello')
end
assert_template "projects/add"
post "projects/add", :project => { :name => "blog", :description => "weblog", :is_public => 1}
assert_redirected_to "admin/projects"
- assert_equal 'Project was successfully created.', flash[:notice]
+ assert_equal 'Successful creation.', flash[:notice]
project = Project.find_by_name("blog")
assert_kind_of Project, project