Nuiton-redmine-site-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
March 2012
- 2 participants
- 2 discussions
21 Mar '12
Author: tchemit
Date: 2012-03-21 12:21:21 +0100 (Wed, 21 Mar 2012)
New Revision: 36
Url: http://nuiton.org/repositories/revision/nuiton-redmine-site/36
Log:
fixes #2023 (templates are notc ompatible with redmine 1.3)
Added:
cl-overview-project/trunk/app/views/projects/show.html.erb
Removed:
cl-overview-project/trunk/app/views/projects/show.rhtml
Copied: cl-overview-project/trunk/app/views/projects/show.html.erb (from rev 35, cl-overview-project/trunk/app/views/projects/show.rhtml)
===================================================================
--- cl-overview-project/trunk/app/views/projects/show.html.erb (rev 0)
+++ cl-overview-project/trunk/app/views/projects/show.html.erb 2012-03-21 11:21:21 UTC (rev 36)
@@ -0,0 +1,158 @@
+<%
+if $PROGRAM_NAME.include?("redmine-chorem")
+ domain = "chorem.org"
+ domainsonar = "org.chorem"
+ domainmaven = "org/chorem"
+else
+ if $PROGRAM_NAME.include?("redmine-nuiton")
+ domain = "nuiton.org"
+ domainsonar = "org.nuiton"
+ domainmaven = "org/nuiton"
+ else
+ domain = "forge.codelutin.com"
+ domainsonar = "com.codelutin.forge"
+ domainmaven = "forge.codelutin.com"
+ end
+end
+mavenrepo = ""
+mavencentral = false
+(a)project.custom_values.each do |custom_value|
+ if !custom_value.value.empty? && custom_value.custom_field.name == "maven-release-repository"
+ mavenrepo=custom_value.value
+ if mavenrepo == "http://nexus.nuiton.org/nexus/content/repositories/central-releases/"
+ mavencentral = true
+ end
+ end
+end
+
+if mavenrepo == ""
+ mavenrepo = "http://nexus.nuiton.org/nexus/content/repositories/other-releases/"
+end
+
+%>
+
+<link href="/plugin_assets/cl-overview-project/stylesheets/cl-overview-project.css" media="screen" rel="stylesheet" type="text/css" />
+
+<%= textilizable @project.description %>
+
+ <ul>
+ <% if @subprojects.any? %>
+ <li><%=l(:label_subproject_plural)%>: <%= @subprojects.collect{|p| link_to(h(p.name), :action => 'show', :id => p)}.join(", ") %></li>
+ <% end %>
+ <% if @project.parent %>
+ <li><%=l(:field_parent)%>: <%= link_to h((a)project.parent.name), :controller => 'projects', :action => 'show', :id => @project.parent %></li>
+ <% end %>
+ <% @project.custom_values.each do |custom_value| %>
+ <% if !custom_value.value.empty? && ! custom_value == "maven-release-repository" %>
+ <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>
+ <% end %>
+ <% end %>
+ </ul>
+
+<div class="boxes">
+
+<div class="splitcontentleft">
+
+ <div class="web-site box">
+ <h3 class="icon22">Site web</h3>
+ <ul>
+ <li>Site web : <a href="http://maven-site.<%=domain%>/<%=(a)project.identifier%>" class="external">http://maven-site.<%=domain%>/<%=(a)project.identifier%></a></li>
+ <% unless @project.homepage.blank? %><li>Demo : <%= link_to(h((a)project.homepage), @project.homepage) %></li><% end %>
+ <li><a href="<%=(a)project.identifier%>/files">Download</a></li>
+ </ul>
+ </div>
+
+
+ <div class="listes box">
+ <h3 class="icon22">Listes</h3>
+ <ul>
+ <li>Liste pour que les utilisateurs puissent échanger : <a href="http://list.<%=domain%>/cgi-bin/mailman/listinfo/<%=(a)project.identifier%>-users" class="external"><%=(a)project.identifier%>-users</a></li>
+ <li>Liste de discussion des développeurs : <a href="http://list.<%=domain%>/cgi-bin/mailman/listinfo/<%=(a)project.identifier%>-devel" class="external"><%=(a)project.identifier%>-devel</a></li>
+ <li>Liste recevant tous les commits svn : <a href="http://list.<%=domain%>/cgi-bin/mailman/listinfo/<%=(a)project.identifier%>-commits" class="external"><%=(a)project.identifier%>-commits</a></li>
+ </ul>
+ </div>
+
+ <div class="dev box">
+ <h3 class="icon22">Environnement de développement</h3>
+ <ul>
+ <li><a href="http://svn.<%=domain%>/svn/<%=(a)project.identifier%>" class="external">Dépot des sources (SVN)</a></li>
+ <li><a href="http://ci.<%=domain%>/jenkins/job/<%=(a)project.identifier%>" class="external">Integration continue (Hudson)</li>
+ <li><a href="http://qa.<%=domain%>/sonar/project/index/<%=domainsonar%>:<%=(a)project.identifier%>" class="external">Analyses et metrics du code (Sonar)</li>
+ <!--li><a href="http://maven.<%=domain%>/release/<%=domainmaven%>/<%=(a)project.identifier%>" class="external">Dépot des binaires (Maven)</li-->
+
+ <li><a href="<%=mavenrepo%><%=domainmaven%>/<%=(a)project.identifier%>" class="external">Dépot des binaires (Maven)</a>
+ <% if mavencentral == true %>
+ <a href="http://repo1.maven.org/maven2/<%=domainmaven%>/<%=(a)project.identifier%>" class="icon22 mavencentral">synchronized on Central</a>
+ <% end %>
+ </li>
+ </ul>
+ </div>
+
+</div>
+
+<div class="splitcontentright">
+ <%= render :partial => 'members_box' %>
+
+ <% if User.current.allowed_to?(:view_issues, @project) %>
+ <div class="issues box">
+ <h3><%=l(:label_issue_tracking)%></h3>
+ <ul>
+ <% for tracker in @trackers %>
+ <li><%= link_to tracker.name, :controller => 'issues', :action => 'index', :project_id => @project,
+ :set_filter => 1,
+ "tracker_id" => tracker.id %>:
+ <%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i,
+
+ :total => @total_issues_by_tracker[tracker].to_i) %>
+ </li>
+ <% end %>
+ </ul>
+ <p>
+ <%= link_to l(:label_issue_view_all), :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 %>
+ </p>
+ </div>
+ <% end %>
+
+
+ <% if @news.any? && authorize_for('news', 'index') %>
+ <div class="last-news box">
+ <h3><%=l(:label_news_latest)%></h3>
+ <%= render :partial => 'news/news', :collection => @news %>
+ <p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p>
+ </div>
+ <% end %>
+</div>
+
+
+</div>
+
+<% content_for :sidebar do %>
+ <div id="planning">
+ <h3>Planning</h3>
+ <p><% if User.current.allowed_to?(:view_calendar, @project, :global => true) %>
+ <%= link_to(l(:label_calendar), :controller => 'calendars', :action => 'show', :project_id => @project) %>
+ <% end %>
+ <% if User.current.allowed_to?(:view_gantt, @project, :global => true) %>
+ | <%= link_to(l(:label_gantt), :controller => 'gantts', :action => 'show', :project_id => @project) %>
+ <% end %>
+ </p>
+
+ </div>
+
+
+ <% if @total_hours && User.current.allowed_to?(:view_time_entries, @project) %>
+ <div id="time">
+ <h3><%= l(:label_spent_time) %></h3>
+ <p><span class="icon icon-time"><%= l_hours(@total_hours) %></span></p>
+ <p><%= link_to(l(:label_details), {:controller => 'timelog', :action => 'index', :project_id => @project}) %> |
+ <%= link_to(l(:label_report), {:controller => 'time_entry_reports', :action => 'report', :project_id => @project}) %></p>
+ </div>
+ <% end %>
+<% end %>
+
+
+<% content_for :header_tags do %>
+<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
+<% end %>
+
+<% html_title(l(:label_overview)) -%>
Deleted: cl-overview-project/trunk/app/views/projects/show.rhtml
===================================================================
--- cl-overview-project/trunk/app/views/projects/show.rhtml 2012-03-19 19:00:49 UTC (rev 35)
+++ cl-overview-project/trunk/app/views/projects/show.rhtml 2012-03-21 11:21:21 UTC (rev 36)
@@ -1,158 +0,0 @@
-<%
-if $PROGRAM_NAME.include?("redmine-chorem")
- domain = "chorem.org"
- domainsonar = "org.chorem"
- domainmaven = "org/chorem"
-else
- if $PROGRAM_NAME.include?("redmine-nuiton")
- domain = "nuiton.org"
- domainsonar = "org.nuiton"
- domainmaven = "org/nuiton"
- else
- domain = "forge.codelutin.com"
- domainsonar = "com.codelutin.forge"
- domainmaven = "forge.codelutin.com"
- end
-end
-mavenrepo = ""
-mavencentral = false
-(a)project.custom_values.each do |custom_value|
- if !custom_value.value.empty? && custom_value.custom_field.name == "maven-release-repository"
- mavenrepo=custom_value.value
- if mavenrepo == "http://nexus.nuiton.org/nexus/content/repositories/central-releases/"
- mavencentral = true
- end
- end
-end
-
-if mavenrepo == ""
- mavenrepo = "http://nexus.nuiton.org/nexus/content/repositories/other-releases/"
-end
-
-%>
-
-<link href="/plugin_assets/cl-overview-project/stylesheets/cl-overview-project.css" media="screen" rel="stylesheet" type="text/css" />
-
-<%= textilizable @project.description %>
-
- <ul>
- <% if @subprojects.any? %>
- <li><%=l(:label_subproject_plural)%>: <%= @subprojects.collect{|p| link_to(h(p.name), :action => 'show', :id => p)}.join(", ") %></li>
- <% end %>
- <% if @project.parent %>
- <li><%=l(:field_parent)%>: <%= link_to h((a)project.parent.name), :controller => 'projects', :action => 'show', :id => @project.parent %></li>
- <% end %>
- <% @project.custom_values.each do |custom_value| %>
- <% if !custom_value.value.empty? && ! custom_value == "maven-release-repository" %>
- <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>
- <% end %>
- <% end %>
- </ul>
-
-<div class="boxes">
-
-<div class="splitcontentleft">
-
- <div class="web-site box">
- <h3 class="icon22">Site web</h3>
- <ul>
- <li>Site web : <a href="http://maven-site.<%=domain%>/<%=(a)project.identifier%>" class="external">http://maven-site.<%=domain%>/<%=(a)project.identifier%></a></li>
- <% unless @project.homepage.blank? %><li>Demo : <%= link_to(h((a)project.homepage), @project.homepage) %></li><% end %>
- <li><a href="<%=(a)project.identifier%>/files">Download</a></li>
- </ul>
- </div>
-
-
- <div class="listes box">
- <h3 class="icon22">Listes</h3>
- <ul>
- <li>Liste pour que les utilisateurs puissent échanger : <a href="http://list.<%=domain%>/cgi-bin/mailman/listinfo/<%=(a)project.identifier%>-users" class="external"><%=(a)project.identifier%>-users</a></li>
- <li>Liste de discussion des développeurs : <a href="http://list.<%=domain%>/cgi-bin/mailman/listinfo/<%=(a)project.identifier%>-devel" class="external"><%=(a)project.identifier%>-devel</a></li>
- <li>Liste recevant tous les commits svn : <a href="http://list.<%=domain%>/cgi-bin/mailman/listinfo/<%=(a)project.identifier%>-commits" class="external"><%=(a)project.identifier%>-commits</a></li>
- </ul>
- </div>
-
- <div class="dev box">
- <h3 class="icon22">Environnement de développement</h3>
- <ul>
- <li><a href="http://svn.<%=domain%>/svn/<%=(a)project.identifier%>" class="external">Dépot des sources (SVN)</a></li>
- <li><a href="http://ci.<%=domain%>/jenkins/job/<%=(a)project.identifier%>" class="external">Integration continue (Hudson)</li>
- <li><a href="http://qa.<%=domain%>/sonar/project/index/<%=domainsonar%>:<%=(a)project.identifier%>" class="external">Analyses et metrics du code (Sonar)</li>
- <!--li><a href="http://maven.<%=domain%>/release/<%=domainmaven%>/<%=(a)project.identifier%>" class="external">Dépot des binaires (Maven)</li-->
-
- <li><a href="<%=mavenrepo%><%=domainmaven%>/<%=(a)project.identifier%>" class="external">Dépot des binaires (Maven)</a>
- <% if mavencentral == true %>
- <a href="http://repo1.maven.org/maven2/<%=domainmaven%>/<%=(a)project.identifier%>" class="icon22 mavencentral">synchronized on Central</a>
- <% end %>
- </li>
- </ul>
- </div>
-
-</div>
-
-<div class="splitcontentright">
- <%= render :partial => 'members_box' %>
-
- <% if User.current.allowed_to?(:view_issues, @project) %>
- <div class="issues box">
- <h3><%=l(:label_issue_tracking)%></h3>
- <ul>
- <% for tracker in @trackers %>
- <li><%= link_to tracker.name, :controller => 'issues', :action => 'index', :project_id => @project,
- :set_filter => 1,
- "tracker_id" => tracker.id %>:
- <%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i,
-
- :total => @total_issues_by_tracker[tracker].to_i) %>
- </li>
- <% end %>
- </ul>
- <p>
- <%= link_to l(:label_issue_view_all), :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 %>
- </p>
- </div>
- <% end %>
-
-
- <% if @news.any? && authorize_for('news', 'index') %>
- <div class="last-news box">
- <h3><%=l(:label_news_latest)%></h3>
- <%= render :partial => 'news/news', :collection => @news %>
- <p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p>
- </div>
- <% end %>
-</div>
-
-
-</div>
-
-<% content_for :sidebar do %>
- <div id="planning">
- <h3>Planning</h3>
- <p><% if User.current.allowed_to?(:view_calendar, @project, :global => true) %>
- <%= link_to(l(:label_calendar), :controller => 'calendars', :action => 'show', :project_id => @project) %>
- <% end %>
- <% if User.current.allowed_to?(:view_gantt, @project, :global => true) %>
- | <%= link_to(l(:label_gantt), :controller => 'gantts', :action => 'show', :project_id => @project) %>
- <% end %>
- </p>
-
- </div>
-
-
- <% if @total_hours && User.current.allowed_to?(:view_time_entries, @project) %>
- <div id="time">
- <h3><%= l(:label_spent_time) %></h3>
- <p><span class="icon icon-time"><%= l_hours(@total_hours) %></span></p>
- <p><%= link_to(l(:label_details), {:controller => 'timelog', :action => 'index', :project_id => @project}) %> |
- <%= link_to(l(:label_report), {:controller => 'time_entry_reports', :action => 'report', :project_id => @project}) %></p>
- </div>
- <% end %>
-<% end %>
-
-
-<% content_for :header_tags do %>
-<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
-<% end %>
-
-<% html_title(l(:label_overview)) -%>
1
0
19 Mar '12
Author: bpoussin
Date: 2012-03-19 20:00:49 +0100 (Mon, 19 Mar 2012)
New Revision: 35
Url: http://nuiton.org/repositories/revision/nuiton-redmine-site/35
Log:
add piwik plugin to add piwik tracker
Added:
redmine_piwik_plugin/
redmine_piwik_plugin/trunk/
redmine_piwik_plugin/trunk/README.rdoc
redmine_piwik_plugin/trunk/app/
redmine_piwik_plugin/trunk/app/controllers/
redmine_piwik_plugin/trunk/app/helpers/
redmine_piwik_plugin/trunk/app/models/
redmine_piwik_plugin/trunk/app/views/
redmine_piwik_plugin/trunk/app/views/settings/
redmine_piwik_plugin/trunk/app/views/settings/_piwik_settings.erb
redmine_piwik_plugin/trunk/assets/
redmine_piwik_plugin/trunk/assets/images/
redmine_piwik_plugin/trunk/assets/javascripts/
redmine_piwik_plugin/trunk/assets/stylesheets/
redmine_piwik_plugin/trunk/config/
redmine_piwik_plugin/trunk/config/locales/
redmine_piwik_plugin/trunk/config/locales/en.yml
redmine_piwik_plugin/trunk/config/locales/fr.yml
redmine_piwik_plugin/trunk/db/
redmine_piwik_plugin/trunk/db/migrate/
redmine_piwik_plugin/trunk/init.rb
redmine_piwik_plugin/trunk/lang/
redmine_piwik_plugin/trunk/lang/en.yml
redmine_piwik_plugin/trunk/lang/fr.yml
redmine_piwik_plugin/trunk/lib/
redmine_piwik_plugin/trunk/lib/piwik_hooks.rb
redmine_piwik_plugin/trunk/lib/tasks/
redmine_piwik_plugin/trunk/test/
redmine_piwik_plugin/trunk/test/test_helper.rb
Added: redmine_piwik_plugin/trunk/README.rdoc
===================================================================
--- redmine_piwik_plugin/trunk/README.rdoc (rev 0)
+++ redmine_piwik_plugin/trunk/README.rdoc 2012-03-19 19:00:49 UTC (rev 35)
@@ -0,0 +1,3 @@
+= piwik_plugin
+
+Description goes here
Added: redmine_piwik_plugin/trunk/app/views/settings/_piwik_settings.erb
===================================================================
--- redmine_piwik_plugin/trunk/app/views/settings/_piwik_settings.erb (rev 0)
+++ redmine_piwik_plugin/trunk/app/views/settings/_piwik_settings.erb 2012-03-19 19:00:49 UTC (rev 35)
@@ -0,0 +1,20 @@
+<p>
+ <%= l(:piwik_directions) %>
+</p>
+
+<p>
+ <label><%= l(:piwik_code_label) %></label><%= text_area_tag 'settings[piwik_code]', @settings['piwik_code'], :rows => 10, :cols => 85 %>
+</p>
+
+<p>
+ <label><%= l(:piwik_log_anonymous_label) %></label><%= check_box_tag 'settings[piwik_log_anonymous]', '1', @settings['piwik_log_anonymous'] %>
+</p>
+
+<p>
+ <label><%= l(:piwik_log_authenticated_label) %></label><%= check_box_tag 'settings[piwik_log_authenticated]', '1', @settings['piwik_log_authenticated'] %>
+</p>
+
+<p>
+ <label><%= l(:piwik_log_administrator_label) %></label><%= check_box_tag 'settings[piwik_log_administrator]', '1', @settings['piwik_log_administrator'] %>
+</p>
+
Added: redmine_piwik_plugin/trunk/config/locales/en.yml
===================================================================
--- redmine_piwik_plugin/trunk/config/locales/en.yml (rev 0)
+++ redmine_piwik_plugin/trunk/config/locales/en.yml 2012-03-19 19:00:49 UTC (rev 35)
@@ -0,0 +1,6 @@
+en:
+ piwik_directions: Enter your <a href="http://piwik.org/">Piwik</a> JavaScript code into the area below and choose your logging options.
+ piwik_code_label: Piwik code (including script tags)
+ piwik_log_anonymous_label: Log anonymous users
+ piwik_log_authenticated_label: Log authenticated user
+ piwik_log_administrator_label: Log administrator users
Added: redmine_piwik_plugin/trunk/config/locales/fr.yml
===================================================================
--- redmine_piwik_plugin/trunk/config/locales/fr.yml (rev 0)
+++ redmine_piwik_plugin/trunk/config/locales/fr.yml 2012-03-19 19:00:49 UTC (rev 35)
@@ -0,0 +1,6 @@
+fr:
+ piwik_directions: Mettez ici votre code JavaScript <a href="http://piwik.org/">Piwik</a> et choisissez vos options de logging.
+ piwik_code_label: Piwik code (tags de script inclus)
+ piwik_log_anonymous_label: Utilisateur anonyme
+ piwik_log_authenticated_label: Utilisateur authentifier
+ piwik_log_administrator_label: Utilisateur administrateur
Added: redmine_piwik_plugin/trunk/init.rb
===================================================================
--- redmine_piwik_plugin/trunk/init.rb (rev 0)
+++ redmine_piwik_plugin/trunk/init.rb 2012-03-19 19:00:49 UTC (rev 35)
@@ -0,0 +1,20 @@
+require 'redmine'
+
+require_dependency 'piwik_hooks'
+
+Redmine::Plugin.register :piwik_plugin do
+ name 'Redmine Piwik Plugin'
+ author 'Benjamin POUSSIN'
+ description 'This is a plugin for Redmine to add piwik script to all pages'
+ version '0.0.1'
+ url 'http://www.nuiton.org'
+ author_url 'http://www.nuiton.org/users/4'
+
+ settings :default => {
+ 'piwik_code' => '',
+ 'piwik_log_anonymous' => true,
+ 'piwik_log_authenticated' => true,
+ 'piwik_log_administrator' => true
+ }, :partial => 'settings/piwik_settings'
+
+end
Added: redmine_piwik_plugin/trunk/lang/en.yml
===================================================================
--- redmine_piwik_plugin/trunk/lang/en.yml (rev 0)
+++ redmine_piwik_plugin/trunk/lang/en.yml 2012-03-19 19:00:49 UTC (rev 35)
@@ -0,0 +1,6 @@
+# English strings go here
+piwik_directions: Enter your <a href="http://piwik.org/">Piwik</a> JavaScript code into the area below and choose your logging options.
+piwik_code_label: Piwik code (including script tags)
+piwik_log_anonymous_label: Log anonymous users
+piwik_log_authenticated_label: Log authenticated user
+piwik_log_administrator_label: Log administrator users
Added: redmine_piwik_plugin/trunk/lang/fr.yml
===================================================================
--- redmine_piwik_plugin/trunk/lang/fr.yml (rev 0)
+++ redmine_piwik_plugin/trunk/lang/fr.yml 2012-03-19 19:00:49 UTC (rev 35)
@@ -0,0 +1,6 @@
+# Francais strings go here
+piwik_directions: Mettez ici votre code JavaScript <a href="http://piwik.org/">Piwik</a> et choisissez vos options de logging.
+piwik_code_label: Piwik code (tags de script inclus)
+piwik_log_anonymous_label: Utilisateur anonyme
+piwik_log_authenticated_label: Utilisateur authentifier
+piwik_log_administrator_label: Utilisateur administrateur
Added: redmine_piwik_plugin/trunk/lib/piwik_hooks.rb
===================================================================
--- redmine_piwik_plugin/trunk/lib/piwik_hooks.rb (rev 0)
+++ redmine_piwik_plugin/trunk/lib/piwik_hooks.rb 2012-03-19 19:00:49 UTC (rev 35)
@@ -0,0 +1,20 @@
+# This class hooks into Redmine's View Listeners in order to
+# add content to the page
+class PiwikHooks < Redmine::Hook::ViewListener
+
+ # Adds the Piwik code to the layout if the current user meets
+ # the conditions setup by the System Administrator
+ def view_layouts_base_body_bottom(context = { })
+ log_anon = Setting.plugin_piwik_plugin['piwik_log_anonymous']
+ log_auth = Setting.plugin_piwik_plugin['piwik_log_authenticated']
+ log_admin = Setting.plugin_piwik_plugin['piwik_log_administrator']
+
+ if (User.current.anonymous? && log_anon) || # Anon user
+ (User.current.logged? && log_auth && !User.current.admin?) || # Auth users who are not admins
+ (User.current.admin? && log_admin) # Admin user
+ return Setting.plugin_piwik_plugin['piwik_code']
+ else
+ return ''
+ end
+ end
+end
Added: redmine_piwik_plugin/trunk/test/test_helper.rb
===================================================================
--- redmine_piwik_plugin/trunk/test/test_helper.rb (rev 0)
+++ redmine_piwik_plugin/trunk/test/test_helper.rb 2012-03-19 19:00:49 UTC (rev 35)
@@ -0,0 +1,5 @@
+# Load the normal Rails helper
+require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper')
+
+# Ensure that we are using the temporary fixture path
+Engines::Testing.set_fixture_path
1
0