git-svn-id: http://redmine.rubyforge.org/svn/trunk@12 e93f8b46-1217-0410-a6f0-8f06a7374b81pull/351/head
parent
7e57db1edb
commit
310a0f924a
@ -0,0 +1,82 @@ |
||||
# redMine - project management software |
||||
# Copyright (C) 2006 Jean-Philippe Lang |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
|
||||
class AuthSourcesController < ApplicationController |
||||
layout 'base' |
||||
before_filter :require_admin |
||||
|
||||
def index |
||||
list |
||||
render :action => 'list' |
||||
end |
||||
|
||||
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) |
||||
verify :method => :post, :only => [ :destroy, :create, :update ], |
||||
:redirect_to => { :action => :list } |
||||
|
||||
def list |
||||
@auth_source_pages, @auth_sources = paginate :auth_sources, :per_page => 10 |
||||
end |
||||
|
||||
def new |
||||
@auth_source = AuthSourceLdap.new |
||||
end |
||||
|
||||
def create |
||||
@auth_source = AuthSourceLdap.new(params[:auth_source]) |
||||
if @auth_source.save |
||||
flash[:notice] = l(:notice_successful_create) |
||||
redirect_to :action => 'list' |
||||
else |
||||
render :action => 'new' |
||||
end |
||||
end |
||||
|
||||
def edit |
||||
@auth_source = AuthSource.find(params[:id]) |
||||
end |
||||
|
||||
def update |
||||
@auth_source = AuthSource.find(params[:id]) |
||||
if @auth_source.update_attributes(params[:auth_source]) |
||||
flash[:notice] = l(:notice_successful_update) |
||||
redirect_to :action => 'list' |
||||
else |
||||
render :action => 'edit' |
||||
end |
||||
end |
||||
|
||||
def test_connection |
||||
@auth_method = AuthSource.find(params[:id]) |
||||
begin |
||||
@auth_method.test_connection |
||||
rescue => text |
||||
flash[:notice] = text |
||||
end |
||||
flash[:notice] ||= l(:notice_successful_connection) |
||||
redirect_to :action => 'list' |
||||
end |
||||
|
||||
def destroy |
||||
@auth_source = AuthSource.find(params[:id]) |
||||
unless @auth_source.users.find(:first) |
||||
@auth_source.destroy |
||||
flash[:notice] = l(:notice_successful_delete) |
||||
end |
||||
redirect_to :action => 'list' |
||||
end |
||||
end |
@ -0,0 +1,19 @@ |
||||
# redMine - project management software |
||||
# Copyright (C) 2006 Jean-Philippe Lang |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
|
||||
module AuthSourcesHelper |
||||
end |
@ -0,0 +1,47 @@ |
||||
# redMine - project management software |
||||
# Copyright (C) 2006 Jean-Philippe Lang |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
|
||||
class AuthSource < ActiveRecord::Base |
||||
has_many :users |
||||
|
||||
validates_presence_of :name |
||||
validates_uniqueness_of :name |
||||
|
||||
def authenticate(login, password) |
||||
end |
||||
|
||||
def test_connection |
||||
end |
||||
|
||||
def auth_method_name |
||||
"Abstract" |
||||
end |
||||
|
||||
# Try to authenticate a user not yet registered against available sources |
||||
def self.authenticate(login, password) |
||||
AuthSource.find(:all, :conditions => ["onthefly_register=?", true]).each do |source| |
||||
begin |
||||
logger.debug "Authenticating '#{login}' against '#{source.name}'" if logger && logger.debug? |
||||
attrs = source.authenticate(login, password) |
||||
rescue |
||||
attrs = nil |
||||
end |
||||
return attrs if attrs |
||||
end |
||||
return nil |
||||
end |
||||
end |
@ -0,0 +1,79 @@ |
||||
# redMine - project management software |
||||
# Copyright (C) 2006 Jean-Philippe Lang |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
|
||||
require 'net/ldap' |
||||
require 'iconv' |
||||
|
||||
class AuthSourceLdap < AuthSource |
||||
validates_presence_of :host, :port, :attr_login |
||||
|
||||
def after_initialize |
||||
self.port = 389 if self.port == 0 |
||||
end |
||||
|
||||
def authenticate(login, password) |
||||
attrs = [] |
||||
# get user's DN |
||||
ldap_con = initialize_ldap_con(self.account, self.account_password) |
||||
login_filter = Net::LDAP::Filter.eq( self.attr_login, login ) |
||||
object_filter = Net::LDAP::Filter.eq( "objectClass", "organizationalPerson" ) |
||||
dn = String.new |
||||
ldap_con.search( :base => self.base_dn, |
||||
:filter => object_filter & login_filter, |
||||
:attributes=> ['dn', self.attr_firstname, self.attr_lastname, self.attr_mail]) do |entry| |
||||
dn = entry.dn |
||||
attrs = [:firstname => AuthSourceLdap.get_attr(entry, self.attr_firstname), |
||||
:lastname => AuthSourceLdap.get_attr(entry, self.attr_lastname), |
||||
:mail => AuthSourceLdap.get_attr(entry, self.attr_mail), |
||||
:auth_source_id => self.id ] |
||||
end |
||||
return nil if dn.empty? |
||||
logger.debug "DN found for #{login}: #{dn}" if logger && logger.debug? |
||||
# authenticate user |
||||
ldap_con = initialize_ldap_con(dn, password) |
||||
return nil unless ldap_con.bind |
||||
# return user's attributes |
||||
logger.debug "Authentication successful for '#{login}'" if logger && logger.debug? |
||||
attrs |
||||
rescue Net::LDAP::LdapError => text |
||||
raise "LdapError: " + text |
||||
end |
||||
|
||||
# test the connection to the LDAP |
||||
def test_connection |
||||
ldap_con = initialize_ldap_con(self.account, self.account_password) |
||||
ldap_con.open { } |
||||
rescue Net::LDAP::LdapError => text |
||||
raise "LdapError: " + text |
||||
end |
||||
|
||||
def auth_method_name |
||||
"LDAP" |
||||
end |
||||
|
||||
private |
||||
def initialize_ldap_con(ldap_user, ldap_password) |
||||
Net::LDAP.new( {:host => self.host, |
||||
:port => self.port, |
||||
:auth => { :method => :simple, :username => Iconv.new('iso-8859-15', 'utf-8').iconv(ldap_user), :password => Iconv.new('iso-8859-15', 'utf-8').iconv(ldap_password) }} |
||||
) |
||||
end |
||||
|
||||
def self.get_attr(entry, attr_name) |
||||
entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name] |
||||
end |
||||
end |
@ -0,0 +1,27 @@ |
||||
# redMine - project management software |
||||
# Copyright (C) 2006 Jean-Philippe Lang |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
|
||||
class IssueCustomField < CustomField |
||||
has_and_belongs_to_many :projects, :join_table => "custom_fields_projects", :foreign_key => "custom_field_id" |
||||
has_and_belongs_to_many :trackers, :join_table => "custom_fields_trackers", :foreign_key => "custom_field_id" |
||||
has_many :issues, :through => :issue_custom_values |
||||
|
||||
def type_name |
||||
:label_issue_plural |
||||
end |
||||
end |
||||
|
@ -0,0 +1,22 @@ |
||||
# redMine - project management software |
||||
# Copyright (C) 2006 Jean-Philippe Lang |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
|
||||
class ProjectCustomField < CustomField |
||||
def type_name |
||||
:label_project_plural |
||||
end |
||||
end |
@ -0,0 +1,44 @@ |
||||
# redMine - project management software |
||||
# Copyright (C) 2006 Jean-Philippe Lang |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
|
||||
class Token < ActiveRecord::Base |
||||
belongs_to :user |
||||
|
||||
@@validity_time = 1.day |
||||
|
||||
def before_create |
||||
self.value = Token.generate_token_value |
||||
end |
||||
|
||||
# Return true if token has expired |
||||
def expired? |
||||
return Time.now > self.created_on + @@validity_time |
||||
end |
||||
|
||||
# Delete all expired tokens |
||||
def self.destroy_expired |
||||
Token.delete_all ["created_on < ?", Time.now - @@validity_time] |
||||
end |
||||
|
||||
private |
||||
def self.generate_token_value |
||||
chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a |
||||
token_value = '' |
||||
40.times { |i| token_value << chars[rand(chars.size-1)] } |
||||
token_value |
||||
end |
||||
end |
@ -0,0 +1,23 @@ |
||||
# redMine - project management software |
||||
# Copyright (C) 2006 Jean-Philippe Lang |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
|
||||
class UserCustomField < CustomField |
||||
def type_name |
||||
:label_user_plural |
||||
end |
||||
end |
||||
|
@ -1,13 +1,25 @@ |
||||
<div class="box"> |
||||
<h2><%=_('Please login') %></h2> |
||||
<center> |
||||
<div class="box login"> |
||||
<h2><%= image_tag 'login' %> <%=l(:label_please_login)%></h2> |
||||
|
||||
<%= start_form_tag :action=> "login" %> |
||||
<p><label for="login"><%=_ 'Login' %>:</label><br/> |
||||
<%= text_field_tag 'login', nil, :size => 25 %></p> |
||||
|
||||
<p><label for="user_password"><%=_ 'Password' %>:</label><br/> |
||||
<%= password_field_tag 'password', nil, :size => 25 %></p> |
||||
<%= start_form_tag :action=> "login" %> |
||||
<table cellpadding="4"> |
||||
<tr> |
||||
<td><label for="login"><%=l(:field_login)%>:</label></td> |
||||
<td><%= text_field_tag 'login', nil, :size => 25 %></td> |
||||
</tr> |
||||
<tr> |
||||
<td><label for="password"><%=l(:field_password)%>:</label></td> |
||||
<td><%= password_field_tag 'password', nil, :size => 25 %></td> |
||||
</tr> |
||||
</table> |
||||
|
||||
|
||||
|
||||
<p><input type="submit" name="login" value="<%=_ 'Log in' %> »" class="primary" /></p> |
||||
<%= end_form_tag %> |
||||
</div> |
||||
<p><center><input type="submit" name="login" value="<%=l(:button_login)%> »" class="primary" /></center></p> |
||||
<%= end_form_tag %> |
||||
<br /> |
||||
<% unless $RDM_SELF_REGISTRATION == false %><%= link_to l(:label_register), :action => 'register' %> |<% end %> |
||||
<%= link_to l(:label_password_lost), :action => 'lost_password' %> |
||||
</div> |
||||
</center> |
@ -0,0 +1,14 @@ |
||||
<center> |
||||
<div class="box login"> |
||||
<h2><%=l(:label_password_lost)%></h2> |
||||
|
||||
<%= start_form_tag %> |
||||
|
||||
<p><label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label><br/> |
||||
<%= text_field_tag 'mail', nil, :size => 40 %></p> |
||||
|
||||
<p><center><%= submit_tag l(:button_submit) %></center></p> |
||||
|
||||
<%= end_form_tag %> |
||||
</div> |
||||
</center> |
@ -1,19 +1,22 @@ |
||||
<h2><%=_('My page') %></h2> |
||||
<h2><%=l(:label_my_page)%></h2> |
||||
|
||||
<p> |
||||
<%=_('Welcome')%> <b><%= @user.firstname %></b><br /> |
||||
<% unless @user.last_before_login_on.nil? %> |
||||
<%=_('Last login')%>: <%= format_time(@user.last_before_login_on) %> |
||||
<%=l(:label_last_login)%>: <%= format_time(@user.last_before_login_on) %> |
||||
<% end %> |
||||
</p> |
||||
|
||||
<div class="splitcontentleft"> |
||||
<h3><%=_('Reported issues')%></h3> |
||||
<h3><%=l(:label_reported_issues)%></h3> |
||||
<%= render :partial => 'issues/list_simple', :locals => { :issues => @reported_issues } %> |
||||
<%= "<p>(Last #{@reported_issues.length} updated)</p>" if @reported_issues.length > 0 %> |
||||
<% if @reported_issues.length > 0 %> |
||||
<p><%=lwr(:label_last_updates, @reported_issues.length)%></p> |
||||
<% end %> |
||||
</div> |
||||
<div class="splitcontentright"> |
||||
<h3><%=_('Assigned to me')%></h3> |
||||
<h3><%=l(:label_assigned_to_me_issues)%></h3> |
||||
<%= render :partial => 'issues/list_simple', :locals => { :issues => @assigned_issues } %> |
||||
<%= "<p>(Last #{@assigned_issues.length} updated)</p>" if @assigned_issues.length > 0 %> |
||||
<% if @assigned_issues.length > 0 %> |
||||
<p><%=lwr(:label_last_updates, @assigned_issues.length)%></p> |
||||
<% end %> |
||||
</div> |
@ -0,0 +1,21 @@ |
||||
<center> |
||||
<div class="box login"> |
||||
<h2><%=l(:label_password_lost)%></h2> |
||||
|
||||
<p><%=l(:field_login)%>: <strong><%= @user.login %></strong><br /> |
||||
|
||||
<%= error_messages_for 'user' %> |
||||
|
||||
<%= start_form_tag :token => @token.value %> |
||||
|
||||
<p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label><br/> |
||||
<%= password_field_tag 'new_password', nil, :size => 25 %></p> |
||||
|
||||
<p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label><br/> |
||||
<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p> |
||||
|
||||
<p><center><%= submit_tag l(:button_save) %></center></p> |
||||
<%= end_form_tag %> |
||||
|
||||
</div> |
||||
</center> |
@ -0,0 +1,46 @@ |
||||
<h2><%=l(:label_register)%></h2> |
||||
|
||||
<%= start_form_tag %> |
||||
|
||||
<%= error_messages_for 'user' %> |
||||
|
||||
<div class="box"> |
||||
<!--[form:user]--> |
||||
<p><label for="user_login"><%=l(:field_login)%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'user', 'login', :size => 25 %></p> |
||||
|
||||
<p><label for="password"><%=l(:field_password)%></label> <span class="required">*</span><br/> |
||||
<%= password_field_tag 'password', nil, :size => 25 %></p> |
||||
|
||||
<p><label for="password_confirmation"><%=l(:field_password_confirmation)%></label> <span class="required">*</span><br/> |
||||
<%= password_field_tag 'password_confirmation', nil, :size => 25 %></p> |
||||
|
||||
<p><label for="user_firstname"><%=l(:field_firstname)%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'user', 'firstname' %></p> |
||||
|
||||
<p><label for="user_lastname"><%=l(:field_lastname)%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'user', 'lastname' %></p> |
||||
|
||||
<p><label for="user_mail"><%=l(:field_mail)%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'user', 'mail' %></p> |
||||
|
||||
<p><label for="user_language"><%=l(:field_language)%></label><br/> |
||||
<%= select("user", "language", Localization.langs.invert) %></p> |
||||
|
||||
<% for custom_value in @custom_values %> |
||||
<div style="float:left;margin-right:10px;"> |
||||
<p><%= content_tag "label", custom_value.custom_field.name %> |
||||
<% if custom_value.custom_field.is_required? %><span class="required">*</span><% end %> |
||||
<br /> |
||||
<%= custom_field_tag custom_value %></p> |
||||
</div> |
||||
<% end %> |
||||
|
||||
<div style="clear: both;"></div> |
||||
|
||||
<p><%= check_box 'user', 'mail_notification' %> <label for="user_mail_notification"><%=l(:field_mail_notification)%></label></p> |
||||
<!--[eoform:user]--> |
||||
</div> |
||||
|
||||
<%= submit_tag l(:button_submit) %> |
||||
<%= end_form_tag %> |
@ -1,45 +1,50 @@ |
||||
<h2><%=_('Administration')%></h2> |
||||
<h2><%=l(:label_administration)%></h2> |
||||
|
||||
<p> |
||||
<%= image_tag "projects" %> |
||||
<%= link_to _('Projects'), :controller => 'admin', :action => 'projects' %> | |
||||
<%= link_to _('New'), :controller => 'projects', :action => 'add' %> |
||||
<%= link_to l(:label_project_plural), :controller => 'admin', :action => 'projects' %> | |
||||
<%= link_to l(:label_new), :controller => 'projects', :action => 'add' %> |
||||
</p> |
||||
|
||||
<p> |
||||
<%= image_tag "users" %> |
||||
<%= link_to _('Users'), :controller => 'users' %> | |
||||
<%= link_to _('New'), :controller => 'users', :action => 'add' %> |
||||
<%= link_to l(:label_user_plural), :controller => 'users' %> | |
||||
<%= link_to l(:label_new), :controller => 'users', :action => 'add' %> |
||||
</p> |
||||
|
||||
<p> |
||||
<%= image_tag "role" %> |
||||
<%= link_to _('Roles and permissions'), :controller => 'roles' %> |
||||
<%= link_to l(:label_role_and_permissions), :controller => 'roles' %> |
||||
</p> |
||||
|
||||
<p> |
||||
<%= image_tag "tracker" %> |
||||
<%= link_to _('Trackers'), :controller => 'trackers' %> | |
||||
<%= link_to _('Custom fields'), :controller => 'custom_fields' %> |
||||
<%= link_to l(:label_tracker_plural), :controller => 'trackers' %> | |
||||
<%= link_to l(:label_custom_field_plural), :controller => 'custom_fields' %> |
||||
</p> |
||||
|
||||
<p> |
||||
<%= image_tag "workflow" %> |
||||
<%= link_to _('Issue Statuses'), :controller => 'issue_statuses' %> | |
||||
<%= link_to _('Workflow'), :controller => 'roles', :action => 'workflow' %> |
||||
<%= link_to l(:label_issue_status_plural), :controller => 'issue_statuses' %> | |
||||
<%= link_to l(:label_workflow), :controller => 'roles', :action => 'workflow' %> |
||||
</p> |
||||
|
||||
<p> |
||||
<%= image_tag "options" %> |
||||
<%= link_to _('Enumerations'), :controller => 'enumerations' %> |
||||
<%= link_to l(:label_enumerations), :controller => 'enumerations' %> |
||||
</p> |
||||
|
||||
<p> |
||||
<%= image_tag "mailer" %> |
||||
<%= link_to _('Mail notifications'), :controller => 'admin', :action => 'mail_options' %> |
||||
<%= link_to l(:field_mail_notification), :controller => 'admin', :action => 'mail_options' %> |
||||
</p> |
||||
|
||||
<p> |
||||
<%= image_tag "login" %> |
||||
<%= link_to l(:label_authentication), :controller => 'auth_sources' %> |
||||
</p> |
||||
|
||||
<p> |
||||
<%= image_tag "help" %> |
||||
<%= link_to _('Information'), :controller => 'admin', :action => 'info' %> |
||||
<%= link_to l(:label_information_plural), :controller => 'admin', :action => 'info' %> |
||||
</p> |
@ -1,16 +1,16 @@ |
||||
<h2><%=_('Mail notifications')%></h2> |
||||
<h2><%=l(:field_mail_notification)%></h2> |
||||
|
||||
<p><%=_('Select actions for which mail notification should be enabled.')%></p> |
||||
<p><%=l(:text_select_mail_notifications)%></p> |
||||
|
||||
<%= start_form_tag ({}, :id => 'mail_options_form')%> |
||||
<% for action in @actions %> |
||||
<%= check_box_tag "action_ids[]", action.id, action.mail_enabled? %> |
||||
<%= action.descr %><br /> |
||||
<%= action.description %><br /> |
||||
<% end %> |
||||
<br /> |
||||
<p> |
||||
<a href="javascript:checkAll('mail_options_form', true)"><%=_('Check all')%></a> | |
||||
<a href="javascript:checkAll('mail_options_form', false)"><%=_('Uncheck all')%></a> |
||||
<a href="javascript:checkAll('mail_options_form', true)"><%=l(:button_check_all)%></a> | |
||||
<a href="javascript:checkAll('mail_options_form', false)"><%=l(:button_uncheck_all)%></a> |
||||
</p> |
||||
<%= submit_tag _('Save') %> |
||||
<%= submit_tag l(:button_save) %> |
||||
<%= end_form_tag %> |
@ -0,0 +1,49 @@ |
||||
<%= error_messages_for 'auth_source' %> |
||||
|
||||
<div class="box"> |
||||
<!--[form:auth_source]--> |
||||
<p><label for="auth_source_name"><%=l(:field_name)%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'auth_source', 'name' %></p> |
||||
|
||||
<p><label for="auth_source_host"><%=l(:field_host)%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'auth_source', 'host' %></p> |
||||
|
||||
<p><label for="auth_source_port"><%=l(:field_port)%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'auth_source', 'port', :size => 6 %></p> |
||||
|
||||
<p><label for="auth_source_account"><%=l(:field_account)%></label><br/> |
||||
<%= text_field 'auth_source', 'account' %></p> |
||||
|
||||
<p><label for="auth_source_account_password"><%=l(:field_password)%></label><br/> |
||||
<%= password_field 'auth_source', 'account_password' %></p> |
||||
|
||||
<p><label for="auth_source_base_dn"><%=l(:field_base_dn)%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'auth_source', 'base_dn', :size => 60 %></p> |
||||
|
||||
<p><%= check_box 'auth_source', 'onthefly_register' %> |
||||
<label for="auth_source_onthefly_register"><%=l(:field_onthefly)%></label></p> |
||||
|
||||
<fieldset><legend><%=l(:label_attribute_plural)%></legend> |
||||
<div style="float:left;margin-right:10px;"> |
||||
<p><label for="auth_source_attr_login"><%=l(:field_login)%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'auth_source', 'attr_login', :size => 20 %></p> |
||||
</div> |
||||
|
||||
<div style="float:left;margin-right:10px;"> |
||||
<p><label for="auth_source_attr_firstname"><%=l(:field_firstname)%></label><br/> |
||||
<%= text_field 'auth_source', 'attr_firstname', :size => 20 %></p> |
||||
</div> |
||||
|
||||
<div style="float:left;margin-right:10px;"> |
||||
<p><label for="auth_source_attr_lastname"><%=l(:field_lastname)%></label><br/> |
||||
<%= text_field 'auth_source', 'attr_lastname', :size => 20 %></p> |
||||
</div> |
||||
|
||||
<div> |
||||
<p><label for="auth_source_attr_mail"><%=l(:field_mail)%></label><br/> |
||||
<%= text_field 'auth_source', 'attr_mail', :size => 20 %></p> |
||||
</div> |
||||
</fieldset> |
||||
|
||||
<!--[eoform:auth_source]--> |
||||
</div> |
@ -0,0 +1,7 @@ |
||||
<h2><%=l(:label_auth_source)%> (<%= @auth_source.auth_method_name %>)</h2> |
||||
|
||||
<%= start_form_tag :action => 'update', :id => @auth_source %> |
||||
<%= render :partial => 'form' %> |
||||
<%= submit_tag l(:button_save) %> |
||||
<%= end_form_tag %> |
||||
|
@ -0,0 +1,32 @@ |
||||
<h2><%=l(:label_auth_source_plural)%></h2> |
||||
|
||||
<table border="0" cellspacing="1" cellpadding="2" class="listTableContent"> |
||||
<tr class="ListHead"> |
||||
<td><%=l(:field_name)%></td> |
||||
<td><%=l(:field_type)%></td> |
||||
<td><%=l(:field_host)%></td> |
||||
<td></td> |
||||
<td></td> |
||||
</tr> |
||||
|
||||
<% for source in @auth_sources %> |
||||
<tr class="<%= cycle("odd", "even") %>"> |
||||
<td><%= link_to source.name, :action => 'edit', :id => source%></td> |
||||
<td align="center"><%= source.auth_method_name %></td> |
||||
<td align="center"><%= source.host %></td> |
||||
<td align="center"> |
||||
<%= link_to l(:button_test), :action => 'test_connection', :id => source %> |
||||
</td> |
||||
<td align="center"> |
||||
<%= start_form_tag :action => 'destroy', :id => source %> |
||||
<%= submit_tag l(:button_delete), :class => "button-small" %> |
||||
<%= end_form_tag %> |
||||
</td> |
||||
</tr> |
||||
<% end %> |
||||
</table> |
||||
|
||||
<%= pagination_links_full @auth_source_pages %> |
||||
<br /> |
||||
<%= link_to '» ' + l(:label_auth_source_new), :action => 'new' %> |
||||
|
@ -0,0 +1,6 @@ |
||||
<h2><%=l(:label_auth_source_new)%> (<%= @auth_source.auth_method_name %>)</h2> |
||||
|
||||
<%= start_form_tag :action => 'create' %> |
||||
<%= render :partial => 'form' %> |
||||
<%= submit_tag l(:button_create) %> |
||||
<%= end_form_tag %> |
@ -1,26 +1,53 @@ |
||||
<%= error_messages_for 'custom_field' %> |
||||
|
||||
<!--[form:custom_field]--> |
||||
<p><label for="custom_field_name"><%=_('Name')%></label><br/> |
||||
<%= text_field 'custom_field', 'name' %></p> |
||||
<div class="box"> |
||||
<p><label for="custom_field_name"><%=l(:field_name)%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'custom_field', 'name' %></p> |
||||
|
||||
<p><label for="custom_field_typ"><%=_('Type')%></label><br/> |
||||
<%= select("custom_field", "typ", CustomField::TYPES) %></p> |
||||
<p><label for="custom_field_typ"><%=l(:field_field_format)%></label><br/> |
||||
<%= select("custom_field", "field_format", custom_field_formats_for_select) %></p> |
||||
|
||||
<p><%= check_box 'custom_field', 'is_required' %> |
||||
<label for="custom_field_is_required"><%=_('Required')%></label></p> |
||||
|
||||
<p><%= check_box 'custom_field', 'is_for_all' %> |
||||
<label for="custom_field_is_for_all"><%=_('For all projects')%></label></p> |
||||
|
||||
<p><label for="custom_field_min_length"><%=_('Min - max length')%></label> (<%=_('0 means no restriction')%>)<br/> |
||||
<p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label> (<%=l(:text_min_max_length_info)%>)<br/> |
||||
<%= text_field 'custom_field', 'min_length', :size => 5 %> - |
||||
<%= text_field 'custom_field', 'max_length', :size => 5 %></p> |
||||
|
||||
<p><label for="custom_field_regexp"><%=_('Regular expression pattern')%></label> (eg. ^[A-Z0-9]+$)<br/> |
||||
<p><label for="custom_field_regexp"><%=l(:field_regexp)%></label> (<%=l(:text_regexp_info)%>)<br/> |
||||
<%= text_field 'custom_field', 'regexp', :size => 50 %></p> |
||||
|
||||
<p><label for="custom_field_possible_values"><%=_('Possible values')%></label> (separator: |)<br/> |
||||
<%= text_area 'custom_field', 'possible_values', :rows => 5, :cols => 60 %></p> |
||||
<p><label for="custom_field_possible_values"><%=l(:field_possible_values)%></label> (<%=l(:text_possible_values_info)%>)<br/> |
||||
<%= text_area 'custom_field', 'possible_values', :rows => 5, :cols => 60 %></p> |
||||
</div> |
||||
<!--[eoform:custom_field]--> |
||||
|
||||
<div class="box"> |
||||
<% case type.to_s |
||||
when "IssueCustomField" %> |
||||
|
||||
<fieldset><legend><%=l(:label_tracker_plural)%></legend> |
||||
<% for tracker in @trackers %> |
||||
<input type="checkbox" |
||||
name="tracker_ids[]" |
||||
value="<%= tracker.id %>" |
||||
<%if @custom_field.trackers.include? tracker%>checked="checked"<%end%> |
||||
> <%= tracker.name %> |
||||
<% end %></fieldset> |
||||
|
||||
|
||||
<p><%= check_box 'custom_field', 'is_required' %> |
||||
<label for="custom_field_is_required"><%=l(:field_is_required)%></label></p> |
||||
|
||||
<p><%= check_box 'custom_field', 'is_for_all' %> |
||||
<label for="custom_field_is_for_all"><%=l(:field_is_for_all)%></label></p> |
||||
|
||||
<% when "UserCustomField" %> |
||||
<p><%= check_box 'custom_field', 'is_required' %> |
||||
<label for="custom_field_is_required"><%=l(:field_is_required)%></label></p> |
||||
|
||||
<% when "ProjectCustomField" %> |
||||
<p><%= check_box 'custom_field', 'is_required' %> |
||||
<label for="custom_field_is_required"><%=l(:field_is_required)%></label></p> |
||||
|
||||
|
||||
<% end %> |
||||
</div> |
||||
|
@ -1,6 +1,6 @@ |
||||
<h2><%=_('Custom field')%></h2> |
||||
<h2><%=l(:label_custom_field)%> (<%=l(@custom_field.type_name)%>)</h2> |
||||
|
||||
<%= start_form_tag :action => 'edit', :id => @custom_field %> |
||||
<%= render :partial => 'form' %> |
||||
<%= submit_tag _('Save') %> |
||||
<%= render :partial => 'form', :locals => { :type => @custom_field.type } %> |
||||
<%= submit_tag l(:button_save) %> |
||||
<%= end_form_tag %> |
||||
|
@ -1,32 +1,37 @@ |
||||
<h2><%=_('Custom fields')%></h2> |
||||
<h2><%=l(:label_custom_field_plural)%></h2> |
||||
|
||||
<table border="0" cellspacing="1" cellpadding="2" class="listTableContent"> |
||||
<tr class="ListHead"> |
||||
<th><%=_('Name')%></th> |
||||
<th><%=_('Type')%></th> |
||||
<th><%=_('Required')%></th> |
||||
<th><%=_('For all projects')%></th> |
||||
<th><%=l(:field_name)%></th> |
||||
<th><%=l(:field_type)%></th> |
||||
<th><%=l(:field_field_format)%></th> |
||||
<th><%=l(:field_is_required)%></th> |
||||
<th><%=l(:field_is_for_all)%></th> |
||||
<th><%=_('Used by')%></th> |
||||
<th></th> |
||||
</tr> |
||||
<% for custom_field in @custom_fields %> |
||||
<tr class="<%= cycle("odd", "even") %>"> |
||||
<td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td> |
||||
<td align="center"><%= CustomField::TYPES[custom_field.typ][0] %></td> |
||||
<td align="center"><%= l(custom_field.type_name) %></td> |
||||
<td align="center"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format]) %></td> |
||||
<td align="center"><%= image_tag 'true' if custom_field.is_required? %></td> |
||||
<td align="center"><%= image_tag 'true' if custom_field.is_for_all? %></td> |
||||
<td align="center"><%= custom_field.projects.count.to_s + ' ' + _('Project') + '(s)' unless custom_field.is_for_all? %></td> |
||||
<td align="center"><%= custom_field.projects.count.to_s + ' ' + lwr(:label_project, custom_field.projects.count) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %></td> |
||||
<td align="center"> |
||||
<%= start_form_tag :action => 'destroy', :id => custom_field %> |
||||
<%= submit_tag _('Delete'), :class => "button-small" %> |
||||
<%= submit_tag l(:button_delete), :class => "button-small" %> |
||||
<%= end_form_tag %> </td> |
||||
</tr> |
||||
<% end %> |
||||
</table> |
||||
|
||||
<%= link_to ('« ' + _('Previous')), { :page => @custom_field_pages.current.previous } if @custom_field_pages.current.previous %> |
||||
<%= link_to (_('Next') + ' »'), { :page => @custom_field_pages.current.next } if @custom_field_pages.current.next %> |
||||
<%= pagination_links_full @custom_field_pages %> |
||||
|
||||
<br /> |
||||
|
||||
<%= link_to ('» ' + _('New custom field')), :action => 'new' %> |
||||
<%=l(:label_custom_field_new)%>: |
||||
<ul> |
||||
<li><%= link_to l(:label_issue_plural), :action => 'new', :type => 'IssueCustomField' %></li> |
||||
<li><%= link_to l(:label_project_plural), :action => 'new', :type => 'ProjectCustomField' %></li> |
||||
<li><%= link_to l(:label_user_plural), :action => 'new', :type => 'UserCustomField' %></li> |
||||
</ul> |
||||
|
@ -1,7 +1,8 @@ |
||||
<h2><%=_('New custom field')%></h2> |
||||
<h2><%=l(:label_custom_field_new)%> (<%=l(@custom_field.type_name)%>)</h2> |
||||
|
||||
<%= start_form_tag :action => 'new' %> |
||||
<%= render :partial => 'form' %> |
||||
<%= submit_tag _('Create') %> |
||||
<%= render :partial => 'form', :locals => { :type => @custom_field.type } %> |
||||
<%= hidden_field_tag 'type', @custom_field.type %> |
||||
<%= submit_tag l(:button_save) %> |
||||
<%= end_form_tag %> |
||||
|
||||
|
@ -1,15 +1,15 @@ |
||||
<%= error_messages_for 'document' %> |
||||
|
||||
<!--[form:document]--> |
||||
<p><label for="document_category_id"><%=_('Category')%></label><br /> |
||||
<p><label for="document_category_id"><%=l(:field_category)%></label><br /> |
||||
<select name="document[category_id]"> |
||||
<%= options_from_collection_for_select @categories, "id", "name",@document.category_id %> |
||||
<%= options_from_collection_for_select @categories, "id", "name", @document.category_id %> |
||||
</select></p> |
||||
|
||||
<p><label for="document_title"><%=_('Title')%> <span class="required">*</span></label><br /> |
||||
<p><label for="document_title"><%=l(:field_title)%> <span class="required">*</span></label><br /> |
||||
<%= text_field 'document', 'title', :size => 60 %></p> |
||||
|
||||
<p><label for="document_descr"><%=_('Description')%> <span class="required">*</span></label><br /> |
||||
<%= text_area 'document', 'descr', :cols => 60, :rows => 5 %></p> |
||||
<p><label for="document_description"><%=l(:field_description)%> <span class="required">*</span></label><br /> |
||||
<%= text_area 'document', 'description', :cols => 60, :rows => 5 %></p> |
||||
<!--[eoform:document]--> |
||||
|
||||
|
@ -1,6 +1,6 @@ |
||||
<%=_('Issue')%> #<%= issue.id %> - <%= issue.subject %> |
||||
<%=_('Author')%>: <%= issue.author.display_name %> |
||||
|
||||
<%= issue.descr %> |
||||
<%= issue.description %> |
||||
|
||||
http://<%= RDM_HOST_NAME %>/issues/show/<%= issue.id %> |
||||
http://<%= $RDM_HOST_NAME %>/issues/show/<%= issue.id %> |
@ -0,0 +1,3 @@ |
||||
Une nouvelle demande (#<%= @issue.id %>) a été soumise. |
||||
---------------------------------------- |
||||
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %> |
@ -0,0 +1,3 @@ |
||||
La demande #<%= @issue.id %> a été mise à jour au statut "<%= @issue.status.name %>". |
||||
---------------------------------------- |
||||
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %> |
@ -0,0 +1,3 @@ |
||||
To change your password, use the following link: |
||||
|
||||
http://<%= $RDM_HOST_NAME %>/account/lost_password?token=<%= @token.value %> |
@ -0,0 +1,3 @@ |
||||
Pour changer votre mot de passe, utilisez le lien suivant: |
||||
|
||||
http://<%= $RDM_HOST_NAME %>/account/lost_password?token=<%= @token.value %> |
@ -0,0 +1,3 @@ |
||||
To activate your redMine account, use the following link: |
||||
|
||||
http://<%= $RDM_HOST_NAME %>/account/register?token=<%= @token.value %> |
@ -0,0 +1,3 @@ |
||||
Pour activer votre compte sur redMine, utilisez le lien suivant: |
||||
|
||||
http://<%= $RDM_HOST_NAME %>/account/register?token=<%= @token.value %> |
@ -1,10 +1,10 @@ |
||||
<h2><%= @news.title %></h2> |
||||
|
||||
<p> |
||||
<b><%=_('Summary')%></b>: <%= @news.shortdescr %><br /> |
||||
<b><%=_('Summary')%></b>: <%= @news.summary %><br /> |
||||
<b><%=_('By')%></b>: <%= @news.author.display_name %><br /> |
||||
<b><%=_('Date')%></b>: <%= format_time(@news.created_on) %> |
||||
</p> |
||||
|
||||
<%= simple_format auto_link @news.descr %> |
||||
<%= simple_format auto_link @news.description %> |
||||
|
||||
|
@ -1,31 +1,37 @@ |
||||
<%= error_messages_for 'user' %> |
||||
|
||||
<div class="box"> |
||||
<!--[form:user]--> |
||||
<p><label for="user_login"><%=_('Login')%></label><br/> |
||||
<p><label for="user_login"><%=_('Login')%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'user', 'login', :size => 25 %></p> |
||||
|
||||
<p><label for="password"><%=_('Password')%></label><br/> |
||||
<p><label for="password"><%=_('Password')%></label> <span class="required">*</span><br/> |
||||
<%= password_field_tag 'password', nil, :size => 25 %></p> |
||||
|
||||
<p><label for="password_confirmation"><%=_('Confirmation')%></label><br/> |
||||
<p><label for="password_confirmation"><%=_('Confirmation')%></label> <span class="required">*</span><br/> |
||||
<%= password_field_tag 'password_confirmation', nil, :size => 25 %></p> |
||||
|
||||
<p><label for="user_firstname"><%=_('Firstname')%></label><br/> |
||||
<p><label for="user_firstname"><%=_('Firstname')%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'user', 'firstname' %></p> |
||||
|
||||
<p><label for="user_lastname"><%=_('Lastname')%></label><br/> |
||||
<p><label for="user_lastname"><%=_('Lastname')%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'user', 'lastname' %></p> |
||||
|
||||
<p><label for="user_mail"><%=_('Mail')%></label><br/> |
||||
<p><label for="user_mail"><%=_('Mail')%></label> <span class="required">*</span><br/> |
||||
<%= text_field 'user', 'mail' %></p> |
||||
|
||||
<p><label for="user_language"><%=_('Language')%></label><br/> |
||||
<%= select("user", "language", Localization.langs) %></p> |
||||
<%= select("user", "language", Localization.langs.invert) %></p> |
||||
|
||||
<% for custom_value in @custom_values %> |
||||
<p><%= custom_field_tag_with_label custom_value %></p> |
||||
<% end %> |
||||
|
||||
<div style="clear: both;"></div> |
||||
|
||||
<p><%= check_box 'user', 'admin' %> <label for="user_admin"><%=_('Administrator')%></label></p> |
||||
|
||||
<p><%= check_box 'user', 'mail_notification' %> <label for="user_mail_notification"><%=_('Mail notifications')%></label></p> |
||||
|
||||
<p><%= check_box 'user', 'locked' %> <label for="user_locked"><%=_('Locked')%></label></p> |
||||
<!--[eoform:user]--> |
||||
|
||||
</div> |
||||
|
@ -0,0 +1,57 @@ |
||||
# redMine - project management software |
||||
# Copyright (C) 2006 Jean-Philippe Lang |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
|
||||
|
||||
# To set your own configuration, rename this file to config_custom.rb |
||||
# and edit parameters below |
||||
# Don't forget to restart the application after any change. |
||||
|
||||
|
||||
# Application host name |
||||
# Used to provide absolute links in mail notifications |
||||
# $RDM_HOST_NAME = "somenet.foo" |
||||
|
||||
# File storage path |
||||
# Directory used to store uploaded files |
||||
# #{RAILS_ROOT} represents application's home directory |
||||
# $RDM_STORAGE_PATH = "#{RAILS_ROOT}/files" |
||||
|
||||
# Set $RDM_LOGIN_REQUIRED to true if you want to force users to login |
||||
# to access any page of the application |
||||
# $RDM_LOGIN_REQUIRED = false |
||||
|
||||
# Uncomment to disable user self-registration |
||||
# $RDM_SELF_REGISTRATION = false |
||||
|
||||
# Default langage ('en', 'es', 'fr' are available) |
||||
# $RDM_DEFAULT_LANG = 'en' |
||||
|
||||
# Page title |
||||
# $RDM_HEADER_TITLE = "Title" |
||||
|
||||
# Page sub-title |
||||
# $RDM_HEADER_SUBTITLE = "Sub title" |
||||
|
||||
# Welcome page title |
||||
# $RDM_WELCOME_TITLE = "Welcome" |
||||
|
||||
# Welcome page text |
||||
# $RDM_WELCOME_TEXT = "" |
||||
|
||||
# Signature displayed in footer |
||||
# Email adresses will be automatically displayed as a mailto link |
||||
# $RDM_FOOTER_SIG = "admin@somenet.foo" |
@ -0,0 +1,113 @@ |
||||
_gloc_rule_default: '|n| n==1 ? "" : "_plural" ' |
||||
|
||||
actionview_datehelper_select_day_prefix: |
||||
actionview_datehelper_select_month_names: January,February,March,April,May,June,July,August,September,October,November,December |
||||
actionview_datehelper_select_month_names_abbr: Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec |
||||
actionview_datehelper_select_month_prefix: |
||||
actionview_datehelper_select_year_prefix: |
||||
actionview_datehelper_time_in_words_day: 1 day |
||||
actionview_datehelper_time_in_words_day_plural: %d days |
||||
actionview_datehelper_time_in_words_hour_about: about an hour |
||||
actionview_datehelper_time_in_words_hour_about_plural: about %d hours |
||||
actionview_datehelper_time_in_words_hour_about_single: about an hour |
||||
actionview_datehelper_time_in_words_minute: 1 minute |
||||
actionview_datehelper_time_in_words_minute_half: half a minute |
||||
actionview_datehelper_time_in_words_minute_less_than: less than a minute |
||||
actionview_datehelper_time_in_words_minute_plural: %d minutes |
||||
actionview_datehelper_time_in_words_minute_single: 1 minute |
||||
actionview_datehelper_time_in_words_second_less_than: less than a second |
||||
actionview_datehelper_time_in_words_second_less_than_plural: less than %d seconds |
||||
actionview_instancetag_blank_option: Please select |
||||
|
||||
activerecord_error_inclusion: is not included in the list |
||||
activerecord_error_exclusion: is reserved |
||||
activerecord_error_invalid: is invalid |
||||
activerecord_error_confirmation: doesn't match confirmation |
||||
activerecord_error_accepted: must be accepted |
||||
activerecord_error_empty: can't be empty |
||||
activerecord_error_blank: can't be blank |
||||
activerecord_error_too_long: is too long |
||||
activerecord_error_too_short: is too short |
||||
activerecord_error_wrong_length: is the wrong length |
||||
activerecord_error_taken: has already been taken |
||||
activerecord_error_not_a_number: is not a number |
||||
|
||||
general_fmt_age: %d yr |
||||
general_fmt_age_plural: %d yrs |
||||
general_fmt_date: %%b %%d, %%Y (%%a) |
||||
general_fmt_datetime: %%b %%d, %%Y (%%a), %%I:%%M %%p |
||||
general_fmt_datetime_short: %%b %%d, %%I:%%M %%p |
||||
general_fmt_time: %%I:%%M %%p |
||||
general_text_No: 'No' |
||||
general_text_Yes: 'Yes' |
||||
general_text_no: 'no' |
||||
general_text_yes: 'yes' |
||||
|
||||
notice_account_updated: Account was successfully updated. |
||||
notice_account_invalid_creditentials: Invalid user or password |
||||
notice_account_password_updated: Password was successfully updated. |
||||
notice_account_wrong_password: Wrong password |
||||
notice_account_register_done: Account was successfully created. |
||||
notice_account_unknown_email: Unknown user. |
||||
notice_account_lost_email_sent: An email with instructions to choose a new password has been sent to you. |
||||
|
||||
gui_menu_home: Home |
||||
gui_menu_my_page: My page |
||||
gui_menu_projects: Projects |
||||
gui_menu_my_account: My account |
||||
gui_menu_admin: Administration |
||||
gui_menu_login: Login |
||||
gui_menu_logout: Logout |
||||
gui_menu_help: Help |
||||
gui_validation_error: 1 error |
||||
gui_validation_error_plural: %d errors |
||||
|
||||
field_name: Name |
||||
field_description: Description |
||||
field_summary: Summary |
||||
field_is_required: Required |
||||
field_firstname: Firstname |
||||
field_lastname: Lastname |
||||
field_mail: Email |
||||
field_filename: File |
||||
field_filesize: Size |
||||
field_downloads: Downloads |
||||
field_author: Author |
||||
field_created_on: Created |
||||
field_updated_on: Updated |
||||
field_field_format: Format |
||||
field_is_for_all: For all projects |
||||
field_possible_values: Possible values |
||||
field_regexp: Regular expression |
||||
field_min_length: Minimum length |
||||
field_max_length: Maximum length |
||||
field_value: Value |
||||
field_category: Catogory |
||||
field_title: Title |
||||
field_project: Project |
||||
field_issue: Issue |
||||
field_status: Status |
||||
field_notes: Notes |
||||
field_is_closed: Issue closed |
||||
field_is_default: Default status |
||||
field_html_color: Color |
||||
field_tracker: Tracker |
||||
field_subject: Subject |
||||
field_assigned_to: Assigned to |
||||
field_priority: Priority |
||||
field_fixed_version: Fixed version |
||||
field_user: User |
||||
field_role: Role |
||||
field_homepage: Homepage |
||||
field_is_public: Public |
||||
field_parent: Subproject de |
||||
field_is_in_chlog: Issues displayed in changelog |
||||
field_login: Login |
||||
field_mail_notification: Mail notifications |
||||
field_admin: Administrator |
||||
field_locked: Locked |
||||
field_last_login_on: Last connection |
||||
field_language: Language |
||||
field_effective_date: Date |
||||
field_password: Password |
||||
field_password_confirmation: Confirmation |
@ -1,4 +1,6 @@ |
||||
Localization.define('en', 'English') do |l| |
||||
l.store '(date)', lambda { |t| t.strftime('%m/%d/%Y') } |
||||
l.store '(time)', lambda { |t| t.strftime('%m/%d/%Y %I:%M%p') } |
||||
|
||||
l.store '%d errors', ['1 error', '%d errors'] |
||||
end |
@ -0,0 +1,199 @@ |
||||
_gloc_rule_default: '|n| n==1 ? "" : "_plural" ' |
||||
|
||||
actionview_datehelper_select_day_prefix: |
||||
actionview_datehelper_select_month_names: Janvier,Février,Mars,Avril,Mai,Juin,Juillet,Août,Septembre,Octobre,Novembre,Décembre |
||||
actionview_datehelper_select_month_names_abbr: Jan,Fév,Mars,Avril,Mai,Juin,Juil,Août,Sept,Oct,Nov,Déc |
||||
actionview_datehelper_select_month_prefix: |
||||
actionview_datehelper_select_year_prefix: |
||||
actionview_datehelper_time_in_words_day: 1 jour |
||||
actionview_datehelper_time_in_words_day_plural: %d jours |
||||
actionview_datehelper_time_in_words_hour_about: about an hour |
||||
actionview_datehelper_time_in_words_hour_about_plural: about %d hours |
||||
actionview_datehelper_time_in_words_hour_about_single: about an hour |
||||
actionview_datehelper_time_in_words_minute: 1 minute |
||||
actionview_datehelper_time_in_words_minute_half: 30 secondes |
||||
actionview_datehelper_time_in_words_minute_less_than: moins d'une minute |
||||
actionview_datehelper_time_in_words_minute_plural: %d minutes |
||||
actionview_datehelper_time_in_words_minute_single: 1 minute |
||||
actionview_datehelper_time_in_words_second_less_than: moins d'une seconde |
||||
actionview_datehelper_time_in_words_second_less_than_plural: moins de %d secondes |
||||
actionview_instancetag_blank_option: Choisir |
||||
|
||||
activerecord_error_inclusion: n'est pas inclus dans la liste |
||||
activerecord_error_exclusion: est reservé |
||||
activerecord_error_invalid: est invalide |
||||
activerecord_error_confirmation: ne correspond pas à la confirmation |
||||
activerecord_error_accepted: doit être accepté |
||||
activerecord_error_empty: doit être renseigné |
||||
activerecord_error_blank: doit être renseigné |
||||
activerecord_error_too_long: est trop long |
||||
activerecord_error_too_short: est trop court |
||||
activerecord_error_wrong_length: n'est pas de la bonne longueur |
||||
activerecord_error_taken: est déjà utilisé |
||||
activerecord_error_not_a_number: n'est pas un nombre |
||||
|
||||
general_fmt_age: %d an |
||||
general_fmt_age_plural: %d ans |
||||
general_fmt_date: %%d/%%m/%%Y |
||||
general_fmt_datetime: %%d/%%m/%%Y %%H:%%M |
||||
general_fmt_datetime_short: %%d/%%m %%H:%%M |
||||
general_fmt_time: %%H:%%M |
||||
general_text_No: 'Non' |
||||
general_text_Yes: 'Oui' |
||||
general_text_no: 'non' |
||||
general_text_yes: 'oui' |
||||
|
||||
notice_account_updated: Le compte a été mis à jour avec succès. |
||||
notice_account_invalid_creditentials: Identifiant ou mot de passe invalide. |
||||
notice_account_password_updated: Mot de passe mis à jour avec succès. |
||||
notice_account_wrong_password: Mot de passe incorrect |
||||
notice_account_register_done: Un message contenant les instructions pour activer votre compte vous a été envoyé. |
||||
notice_account_unknown_email: Aucun compte ne correspond à cette adresse. |
||||
notice_account_lost_email_sent: Un message contenant les instructions pour choisir un nouveau mot de passe vous a été envoyé. |
||||
notice_account_activated: Votre compte a été activé. Vous pouvez à présent vous connecter. |
||||
notice_successful_update: Mise à jour effectuée avec succès. |
||||
notice_successful_create: Création effectuée avec succès. |
||||
notice_successful_delete: Suppression effectuée avec succès. |
||||
notice_successful_connection: Connection réussie. |
||||
|
||||
gui_validation_error: 1 erreur |
||||
gui_validation_error_plural: %d erreurs |
||||
|
||||
field_name: Nom |
||||
field_description: Description |
||||
field_summary: Résumé |
||||
field_is_required: Obligatoire |
||||
field_firstname: Prénom |
||||
field_lastname: Nom |
||||
field_mail: Email |
||||
field_filename: Fichier |
||||
field_filesize: Taille |
||||
field_downloads: Téléchargements |
||||
field_author: Auteur |
||||
field_created_on: Créé |
||||
field_updated_on: Mis à jour |
||||
field_field_format: Format |
||||
field_is_for_all: Pour tous les projets |
||||
field_possible_values: Valeurs possibles |
||||
field_regexp: Expression régulière |
||||
field_min_length: Longueur minimum |
||||
field_max_length: Longueur maximum |
||||
field_value: Valeur |
||||
field_category: Catégorie |
||||
field_title: Titre |
||||
field_project: Projet |
||||
field_issue: Demande |
||||
field_status: Statut |
||||
field_notes: Notes |
||||
field_is_closed: Demande fermée |
||||
field_is_default: Statut par défaut |
||||
field_html_color: Couleur |
||||
field_tracker: Tracker |
||||
field_subject: Sujet |
||||
field_assigned_to: Assigné à |
||||
field_priority: Priorité |
||||
field_fixed_version: Version corrigée |
||||
field_user: Utilisateur |
||||
field_role: Rôle |
||||
field_homepage: Site web |
||||
field_is_public: Public |
||||
field_parent: Sous-projet de |
||||
field_is_in_chlog: Demandes affichées dans l'historique |
||||
field_login: Identifiant |
||||
field_mail_notification: Notifications par mail |
||||
field_admin: Administrateur |
||||
field_locked: Verrouillé |
||||
field_last_login_on: Dernière connexion |
||||
field_language: Langue |
||||
field_effective_date: Date |
||||
field_password: Mot de passe |
||||
field_new_password: Nouveau mot de passe |
||||
field_password_confirmation: Confirmation |
||||
field_version: Version |
||||
field_type: Type |
||||
field_host: Hôte |
||||
field_port: Port |
||||
field_account: Compte |
||||
field_base_dn: Base DN |
||||
field_attr_login: Attribut Identifiant |
||||
field_attr_firstname: Attribut Prénom |
||||
field_attr_lastname: Attribut Nom |
||||
field_attr_mail: Attribut Email |
||||
field_onthefly: Création des utilisateurs à la volée |
||||
|
||||
label_user: Utilisateur |
||||
label_user_plural: Utilisateurs |
||||
label_user_new: Nouvel utilisateur |
||||
label_project: Projet |
||||
label_project_new: Nouveau projet |
||||
label_project_plural: Projets |
||||
label_issue: Demande |
||||
label_issue_new: Nouvelle demande |
||||
label_issue_plural: Demandes |
||||
label_role: Rôle |
||||
label_role_plural: Rôles |
||||
label_role_add: Nouveau rôle |
||||
label_role_and_permissions: Rôles et permissions |
||||
label_tracker: Tracker |
||||
label_tracker_plural: Trackers |
||||
label_tracker_add: Nouveau tracker |
||||
label_workflow: Workflow |
||||
label_issue_status: Statut de demandes |
||||
label_issue_status_plural: Statuts de demandes |
||||
label_issue_status_add: Nouveau statut |
||||
label_custom_field: Champ personnalisé |
||||
label_custom_field_plural: Champs personnalisés |
||||
label_custom_field_new: Nouveau champ personnalisé |
||||
label_enumerations: Listes de valeurs |
||||
label_information: Information |
||||
label_information_plural: Informations |
||||
label_please_login: Identification |
||||
label_register: S'enregistrer |
||||
label_password_lost: Mot de passe perdu |
||||
label_home: Accueil |
||||
label_my_page: Ma page |
||||
label_my_account: Mon compte |
||||
label_administration: Administration |
||||
label_login: Connexion |
||||
label_logout: Déconnexion |
||||
label_help: Aide |
||||
label_reported_issues: Demandes soumises |
||||
label_assigned_to_me_issues: Demandes qui me sont assignées |
||||
label_last_login: Dernière connexion |
||||
label_last_updates: Dernière mise à jour |
||||
label_last_updates_plural: %d dernières mises à jour |
||||
label_registered_on: Inscrit le |
||||
label_activity: Activité |
||||
label_new: Nouveau |
||||
label_logged_as: Connecté en tant que |
||||
label_environment: Environnement |
||||
label_authentication: Authentification |
||||
label_auth_source: Mode d'authentification |
||||
label_auth_source_new: Nouveau mode d'authentification |
||||
label_auth_source_plural: Modes d'authentification |
||||
label_subproject: Sous-projet |
||||
label_subproject_plural: Sous-projets |
||||
label_min_max_length: Longueurs mini - maxi |
||||
label_list: Liste |
||||
label_date: Date |
||||
label_integer: Entier |
||||
label_boolean: Booléen |
||||
label_string: Chaîne |
||||
label_text: Texte |
||||
label_attribute: Attribut |
||||
label_attribute_plural: Attributs |
||||
|
||||
|
||||
button_login: Connexion |
||||
button_submit: Soumettre |
||||
button_save: Valider |
||||
button_check_all: Tout cocher |
||||
button_uncheck_all: Tout décocher |
||||
button_delete: Supprimer |
||||
button_create: Créer |
||||
button_test: Tester |
||||
|
||||
text_select_mail_notifications: Sélectionner les actions pour lesquelles la notification par mail doit être activée. |
||||
text_regexp_info: eg. ^[A-Z0-9]+$ |
||||
text_min_max_length_info: 0 pour aucune restriction |
||||
text_possible_values_info: valeurs séparées par | |
@ -0,0 +1,24 @@ |
||||
desc 'Create YAML test fixtures from data in an existing database. |
||||
Defaults to development database. Set RAILS_ENV to override.' |
||||
|
||||
task :extract_fixtures => :environment do |
||||
sql = "SELECT * FROM %s" |
||||
skip_tables = ["schema_info"] |
||||
ActiveRecord::Base.establish_connection |
||||
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name| |
||||
i = "000" |
||||
File.open("#{RAILS_ROOT}/#{table_name}.yml", 'w' ) do |file| |
||||
data = ActiveRecord::Base.connection.select_all(sql % table_name) |
||||
file.write data.inject({}) { |hash, record| |
||||
|
||||
# cast extracted values |
||||
ActiveRecord::Base.connection.columns(table_name).each { |col| |
||||
record[col.name] = col.type_cast(record[col.name]) if record[col.name] |
||||
} |
||||
|
||||
hash["#{table_name}_#{i.succ!}"] = record |
||||
hash |
||||
}.to_yaml |
||||
end |
||||
end |
||||
end |
Before Width: | Height: | Size: 379 B |
After Width: | Height: | Size: 483 B |
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 342 B |
@ -0,0 +1,556 @@ |
||||
//*****************************************************************************
|
||||
// Do not remove this notice.
|
||||
//
|
||||
// Copyright 2000-2004 by Mike Hall.
|
||||
// See http://www.brainjar.com for terms of use.
|
||||
//*****************************************************************************
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Emulation de la fonction push pour IE5.0
|
||||
//----------------------------------------------------------------------------
|
||||
if(!Array.prototype.push){Array.prototype.push=function(){for(var i=0;i<arguments.length;i++)this[this.length]=arguments[i];};}; |
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Code to determine the browser and version.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function Browser() { |
||||
|
||||
var ua, s, i; |
||||
|
||||
this.isIE = false; // Internet Explorer
|
||||
this.isOP = false; // Opera
|
||||
this.isNS = false; // Netscape
|
||||
this.version = null; |
||||
//-- debut ajout ci ----
|
||||
this.isIE5mac = false; // Internet Explorer 5 mac
|
||||
//-- fin ajout ci ----
|
||||
|
||||
ua = navigator.userAgent; |
||||
|
||||
//-- debut ajout ci ----
|
||||
if (ua.indexOf("Opera")==-1 && ua.indexOf("MSIE 5")>-1 && ua.indexOf("Mac")>-1) { |
||||
this.isIE5mac = true; |
||||
this.version = ""; |
||||
return; |
||||
} |
||||
//-- fin ajout ci ----
|
||||
|
||||
s = "Opera"; |
||||
if ((i = ua.indexOf(s)) >= 0) { |
||||
this.isOP = true; |
||||
this.version = parseFloat(ua.substr(i + s.length)); |
||||
return; |
||||
} |
||||
|
||||
s = "Netscape6/"; |
||||
if ((i = ua.indexOf(s)) >= 0) { |
||||
this.isNS = true; |
||||
this.version = parseFloat(ua.substr(i + s.length)); |
||||
return; |
||||
} |
||||
|
||||
// Treat any other "Gecko" browser as Netscape 6.1.
|
||||
|
||||
s = "Gecko"; |
||||
if ((i = ua.indexOf(s)) >= 0) { |
||||
this.isNS = true; |
||||
this.version = 6.1; |
||||
return; |
||||
} |
||||
|
||||
s = "MSIE"; |
||||
if ((i = ua.indexOf(s))) { |
||||
this.isIE = true; |
||||
this.version = parseFloat(ua.substr(i + s.length)); |
||||
return; |
||||
} |
||||
} |
||||
|
||||
var browser = new Browser(); |
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Code for handling the menu bar and active button.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
var activeButton = null; |
||||
|
||||
|
||||
function buttonClick(event, menuId) { |
||||
|
||||
var button; |
||||
|
||||
// Get the target button element.
|
||||
|
||||
if (browser.isIE) |
||||
button = window.event.srcElement; |
||||
else |
||||
button = event.currentTarget; |
||||
|
||||
// Blur focus from the link to remove that annoying outline.
|
||||
|
||||
button.blur(); |
||||
|
||||
// Associate the named menu to this button if not already done.
|
||||
// Additionally, initialize menu display.
|
||||
|
||||
if (button.menu == null) { |
||||
button.menu = document.getElementById(menuId); |
||||
if (button.menu.isInitialized == null) |
||||
menuInit(button.menu); |
||||
} |
||||
|
||||
// Set mouseout event handler for the button, if not already done.
|
||||
|
||||
if (button.onmouseout == null) |
||||
button.onmouseout = buttonOrMenuMouseout; |
||||
|
||||
// Exit if this button is the currently active one.
|
||||
|
||||
if (button == activeButton) |
||||
return false; |
||||
|
||||
// Reset the currently active button, if any.
|
||||
|
||||
if (activeButton != null) |
||||
resetButton(activeButton); |
||||
|
||||
// Activate this button, unless it was the currently active one.
|
||||
|
||||
if (button != activeButton) { |
||||
depressButton(button); |
||||
activeButton = button; |
||||
} |
||||
else |
||||
activeButton = null; |
||||
|
||||
return false; |
||||
} |
||||
|
||||
function buttonMouseover(event, menuId) { |
||||
|
||||
var button; |
||||
//-- debut ajout ci ----
|
||||
if (!browser.isIE5mac) {
|
||||
//-- fin ajout ci ----
|
||||
|
||||
//-- debut ajout ci ----
|
||||
cicacheselect(); |
||||
//-- fin ajout ci ----
|
||||
|
||||
// Activates this button's menu if no other is currently active.
|
||||
|
||||
if (activeButton == null) { |
||||
buttonClick(event, menuId); |
||||
return; |
||||
} |
||||
|
||||
// Find the target button element.
|
||||
|
||||
if (browser.isIE) |
||||
button = window.event.srcElement; |
||||
else |
||||
button = event.currentTarget; |
||||
|
||||
// If any other button menu is active, make this one active instead.
|
||||
|
||||
if (activeButton != null && activeButton != button) |
||||
buttonClick(event, menuId); |
||||
//-- debut ajout ci ----
|
||||
}
|
||||
//-- fin ajout ci ----
|
||||
|
||||
} |
||||
|
||||
function depressButton(button) { |
||||
|
||||
var x, y; |
||||
|
||||
// Update the button's style class to make it look like it's
|
||||
// depressed.
|
||||
|
||||
button.className += " menuButtonActive"; |
||||
|
||||
// Set mouseout event handler for the button, if not already done.
|
||||
|
||||
if (button.onmouseout == null) |
||||
button.onmouseout = buttonOrMenuMouseout; |
||||
if (button.menu.onmouseout == null) |
||||
button.menu.onmouseout = buttonOrMenuMouseout; |
||||
|
||||
// Position the associated drop down menu under the button and
|
||||
// show it.
|
||||
|
||||
x = getPageOffsetLeft(button); |
||||
y = getPageOffsetTop(button) + button.offsetHeight - 1; |
||||
|
||||
// For IE, adjust position.
|
||||
|
||||
if (browser.isIE) { |
||||
x += button.offsetParent.clientLeft; |
||||
y += button.offsetParent.clientTop; |
||||
} |
||||
|
||||
button.menu.style.left = x + "px"; |
||||
button.menu.style.top = y + "px";0 |
||||
button.menu.style.visibility = "visible"; |
||||
} |
||||
|
||||
function resetButton(button) { |
||||
|
||||
// Restore the button's style class.
|
||||
|
||||
removeClassName(button, "menuButtonActive"); |
||||
|
||||
// Hide the button's menu, first closing any sub menus.
|
||||
|
||||
if (button.menu != null) { |
||||
closeSubMenu(button.menu); |
||||
button.menu.style.visibility = "hidden"; |
||||
} |
||||
} |
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Code to handle the menus and sub menus.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function menuMouseover(event) { |
||||
|
||||
var menu; |
||||
//-- debut ajout ci ----
|
||||
if (!browser.isIE5mac) {
|
||||
//-- fin ajout ci ----
|
||||
//-- debut ajout ci ----
|
||||
cicacheselect(); |
||||
//-- fin ajout ci ----
|
||||
|
||||
// Find the target menu element.
|
||||
if (browser.isIE) |
||||
menu = getContainerWith(window.event.srcElement, "DIV", "menu"); |
||||
else |
||||
menu = event.currentTarget; |
||||
|
||||
// Close any active sub menu.
|
||||
|
||||
if (menu.activeItem != null) |
||||
closeSubMenu(menu); |
||||
//-- debut ajout ci ----
|
||||
}
|
||||
//-- fin ajout ci ----
|
||||
} |
||||
|
||||
function menuItemMouseover(event, menuId) { |
||||
|
||||
var item, menu, x, y; |
||||
//-- debut ajout ci ----
|
||||
cicacheselect(); |
||||
//-- fin ajout ci ----
|
||||
|
||||
// Find the target item element and its parent menu element.
|
||||
|
||||
if (browser.isIE) |
||||
item = getContainerWith(window.event.srcElement, "A", "menuItem"); |
||||
else |
||||
item = event.currentTarget; |
||||
menu = getContainerWith(item, "DIV", "menu"); |
||||
|
||||
// Close any active sub menu and mark this one as active.
|
||||
|
||||
if (menu.activeItem != null) |
||||
closeSubMenu(menu); |
||||
menu.activeItem = item; |
||||
|
||||
// Highlight the item element.
|
||||
|
||||
item.className += " menuItemHighlight"; |
||||
|
||||
// Initialize the sub menu, if not already done.
|
||||
|
||||
if (item.subMenu == null) { |
||||
item.subMenu = document.getElementById(menuId); |
||||
if (item.subMenu.isInitialized == null) |
||||
menuInit(item.subMenu); |
||||
} |
||||
|
||||
// Set mouseout event handler for the sub menu, if not already done.
|
||||
|
||||
if (item.subMenu.onmouseout == null) |
||||
item.subMenu.onmouseout = buttonOrMenuMouseout; |
||||
|
||||
// Get position for submenu based on the menu item.
|
||||
|
||||
x = getPageOffsetLeft(item) + item.offsetWidth; |
||||
y = getPageOffsetTop(item); |
||||
|
||||
// Adjust position to fit in view.
|
||||
|
||||
var maxX, maxY; |
||||
|
||||
if (browser.isIE) { |
||||
maxX = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) + |
||||
(document.documentElement.clientWidth != 0 ? document.documentElement.clientWidth : document.body.clientWidth); |
||||
maxY = Math.max(document.documentElement.scrollTop, document.body.scrollTop) + |
||||
(document.documentElement.clientHeight != 0 ? document.documentElement.clientHeight : document.body.clientHeight); |
||||
} |
||||
if (browser.isOP) { |
||||
maxX = document.documentElement.scrollLeft + window.innerWidth; |
||||
maxY = document.documentElement.scrollTop + window.innerHeight; |
||||
} |
||||
if (browser.isNS) { |
||||
maxX = window.scrollX + window.innerWidth; |
||||
maxY = window.scrollY + window.innerHeight; |
||||
} |
||||
maxX -= item.subMenu.offsetWidth; |
||||
maxY -= item.subMenu.offsetHeight; |
||||
|
||||
if (x > maxX) |
||||
x = Math.max(0, x - item.offsetWidth - item.subMenu.offsetWidth |
||||
+ (menu.offsetWidth - item.offsetWidth)); |
||||
y = Math.max(0, Math.min(y, maxY)); |
||||
|
||||
// Position and show the sub menu.
|
||||
|
||||
item.subMenu.style.left = x + "px"; |
||||
item.subMenu.style.top = y + "px"; |
||||
item.subMenu.style.visibility = "visible"; |
||||
|
||||
// Stop the event from bubbling.
|
||||
|
||||
if (browser.isIE) |
||||
window.event.cancelBubble = true; |
||||
else |
||||
event.stopPropagation(); |
||||
} |
||||
|
||||
function closeSubMenu(menu) { |
||||
|
||||
if (menu == null || menu.activeItem == null) |
||||
return; |
||||
|
||||
// Recursively close any sub menus.
|
||||
|
||||
if (menu.activeItem.subMenu != null) { |
||||
closeSubMenu(menu.activeItem.subMenu); |
||||
menu.activeItem.subMenu.style.visibility = "hidden"; |
||||
menu.activeItem.subMenu = null; |
||||
} |
||||
removeClassName(menu.activeItem, "menuItemHighlight"); |
||||
menu.activeItem = null; |
||||
} |
||||
|
||||
|
||||
function buttonOrMenuMouseout(event) { |
||||
|
||||
var el; |
||||
|
||||
// If there is no active button, exit.
|
||||
|
||||
if (activeButton == null) |
||||
return; |
||||
|
||||
// Find the element the mouse is moving to.
|
||||
|
||||
if (browser.isIE) |
||||
el = window.event.toElement; |
||||
else if (event.relatedTarget != null) |
||||
el = (event.relatedTarget.tagName ? event.relatedTarget : event.relatedTarget.parentNode); |
||||
|
||||
// If the element is not part of a menu, reset the active button.
|
||||
|
||||
if (getContainerWith(el, "DIV", "menu") == null) { |
||||
resetButton(activeButton); |
||||
activeButton = null; |
||||
//-- debut ajout ci ----
|
||||
cimontreselect(); |
||||
//-- fin ajout ci ----
|
||||
} |
||||
} |
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Code to initialize menus.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function menuInit(menu) { |
||||
|
||||
var itemList, spanList; |
||||
var textEl, arrowEl; |
||||
var itemWidth; |
||||
var w, dw; |
||||
var i, j; |
||||
|
||||
// For IE, replace arrow characters.
|
||||
|
||||
if (browser.isIE) { |
||||
menu.style.lineHeight = "2.5ex"; |
||||
spanList = menu.getElementsByTagName("SPAN"); |
||||
for (i = 0; i < spanList.length; i++) |
||||
if (hasClassName(spanList[i], "menuItemArrow")) { |
||||
spanList[i].style.fontFamily = "Webdings"; |
||||
spanList[i].firstChild.nodeValue = "4"; |
||||
} |
||||
} |
||||
|
||||
// Find the width of a menu item.
|
||||
|
||||
itemList = menu.getElementsByTagName("A"); |
||||
if (itemList.length > 0) |
||||
itemWidth = itemList[0].offsetWidth; |
||||
else |
||||
return; |
||||
|
||||
// For items with arrows, add padding to item text to make the
|
||||
// arrows flush right.
|
||||
|
||||
for (i = 0; i < itemList.length; i++) { |
||||
spanList = itemList[i].getElementsByTagName("SPAN"); |
||||
textEl = null; |
||||
arrowEl = null; |
||||
for (j = 0; j < spanList.length; j++) { |
||||
if (hasClassName(spanList[j], "menuItemText")) |
||||
textEl = spanList[j]; |
||||
if (hasClassName(spanList[j], "menuItemArrow")) |
||||
arrowEl = spanList[j]; |
||||
} |
||||
if (textEl != null && arrowEl != null) { |
||||
textEl.style.paddingRight = (itemWidth
|
||||
- (textEl.offsetWidth + arrowEl.offsetWidth)) + "px"; |
||||
// For Opera, remove the negative right margin to fix a display bug.
|
||||
if (browser.isOP) |
||||
arrowEl.style.marginRight = "0px"; |
||||
} |
||||
} |
||||
|
||||
// Fix IE hover problem by setting an explicit width on first item of
|
||||
// the menu.
|
||||
|
||||
if (browser.isIE) { |
||||
w = itemList[0].offsetWidth; |
||||
itemList[0].style.width = w + "px"; |
||||
dw = itemList[0].offsetWidth - w; |
||||
w -= dw; |
||||
itemList[0].style.width = w + "px"; |
||||
} |
||||
|
||||
// Mark menu as initialized.
|
||||
|
||||
menu.isInitialized = true; |
||||
} |
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// General utility functions.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function getContainerWith(node, tagName, className) { |
||||
|
||||
// Starting with the given node, find the nearest containing element
|
||||
// with the specified tag name and style class.
|
||||
|
||||
while (node != null) { |
||||
if (node.tagName != null && node.tagName == tagName && |
||||
hasClassName(node, className)) |
||||
return node; |
||||
node = node.parentNode; |
||||
} |
||||
|
||||
return node; |
||||
} |
||||
|
||||
function hasClassName(el, name) { |
||||
|
||||
var i, list; |
||||
|
||||
// Return true if the given element currently has the given class
|
||||
// name.
|
||||
|
||||
list = el.className.split(" "); |
||||
for (i = 0; i < list.length; i++) |
||||
if (list[i] == name) |
||||
return true; |
||||
|
||||
return false; |
||||
} |
||||
|
||||
function removeClassName(el, name) { |
||||
|
||||
var i, curList, newList; |
||||
|
||||
if (el.className == null) |
||||
return; |
||||
|
||||
// Remove the given class name from the element's className property.
|
||||
|
||||
newList = new Array(); |
||||
curList = el.className.split(" "); |
||||
for (i = 0; i < curList.length; i++) |
||||
if (curList[i] != name) |
||||
newList.push(curList[i]); |
||||
el.className = newList.join(" "); |
||||
} |
||||
|
||||
function getPageOffsetLeft(el) { |
||||
|
||||
var x; |
||||
|
||||
// Return the x coordinate of an element relative to the page.
|
||||
|
||||
x = el.offsetLeft; |
||||
if (el.offsetParent != null) |
||||
x += getPageOffsetLeft(el.offsetParent); |
||||
|
||||
return x; |
||||
} |
||||
|
||||
function getPageOffsetTop(el) { |
||||
|
||||
var y; |
||||
|
||||
// Return the x coordinate of an element relative to the page.
|
||||
|
||||
y = el.offsetTop; |
||||
if (el.offsetParent != null) |
||||
y += getPageOffsetTop(el.offsetParent); |
||||
|
||||
return y; |
||||
} |
||||
|
||||
//-- debut ajout ci ----
|
||||
function cicacheselect(){ |
||||
if (browser.isIE) { |
||||
oSelects = document.getElementsByTagName('SELECT'); |
||||
if (oSelects.length > 0) { |
||||
for (i = 0; i < oSelects.length; i++) { |
||||
oSlt = oSelects[i]; |
||||
if (oSlt.style.visibility != 'hidden') {oSlt.style.visibility = 'hidden';} |
||||
} |
||||
}
|
||||
oSelects = document.getElementsByName('masquable'); |
||||
if (oSelects.length > 0) { |
||||
for (i = 0; i < oSelects.length; i++) { |
||||
oSlt = oSelects[i]; |
||||
if (oSlt.style.visibility != 'hidden') {oSlt.style.visibility = 'hidden';} |
||||
} |
||||
}
|
||||
} |
||||
}
|
||||
|
||||
function cimontreselect(){ |
||||
if (browser.isIE) { |
||||
oSelects = document.getElementsByTagName('SELECT'); |
||||
if (oSelects.length > 0) { |
||||
for (i = 0; i < oSelects.length; i++) { |
||||
oSlt = oSelects[i]; |
||||
if (oSlt.style.visibility != 'visible') {oSlt.style.visibility = 'visible';} |
||||
} |
||||
}
|
||||
oSelects = document.getElementsByName('masquable'); |
||||
if (oSelects.length > 0) { |
||||
for (i = 0; i < oSelects.length; i++) { |
||||
oSlt = oSelects[i]; |
||||
if (oSlt.style.visibility != 'visible') {oSlt.style.visibility = 'visible';} |
||||
} |
||||
}
|
||||
} |
||||
}
|
||||
|
||||
//-- fin ajout ci ----
|
@ -0,0 +1,39 @@ |
||||
/*========== Drop down menu ==============*/ |
||||
div.menu { |
||||
background-color: #FFFFFF; |
||||
border-style: solid; |
||||
border-width: 1px; |
||||
border-color: #7F9DB9; |
||||
position: absolute; |
||||
top: 0px; |
||||
left: 0px; |
||||
padding: 0; |
||||
visibility: hidden; |
||||
z-index: 101; |
||||
} |
||||
|
||||
div.menu a.menuItem { |
||||
font-size: 10px; |
||||
font-weight: normal; |
||||
line-height: 2em; |
||||
color: #000000; |
||||
background-color: #FFFFFF; |
||||
cursor: default; |
||||
display: block; |
||||
padding: 0 1em; |
||||
margin: 0; |
||||
border: 0; |
||||
text-decoration: none; |
||||
white-space: nowrap; |
||||
} |
||||
|
||||
div.menu a.menuItem:hover, div.menu a.menuItemHighlight { |
||||
background-color: #80b0da; |
||||
color: #ffffff; |
||||
} |
||||
|
||||
div.menu a.menuItem span.menuItemText {} |
||||
|
||||
div.menu a.menuItem span.menuItemArrow { |
||||
margin-right: -.75em; |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue