* separated user DMSF project preferences

git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@34 5e329b0b-a2ee-ea63-e329-299493fc886d
This commit is contained in:
vit.jonas@gmail.com 2011-05-10 20:52:16 +00:00
parent 18758ce780
commit cebfe4dd90
11 changed files with 30 additions and 9 deletions

View File

@ -49,11 +49,14 @@ class DmsfStateController < ApplicationController
end
def user_pref
end
def user_pref_save
@user_pref = DmsfUserPref.for(@project, User.current)
@user_pref.email_notify = params[:email_notify];
@user_pref.save
flash[:notice] = l(:notice_your_preferences_were_saved)
redirect_to URI.unescape(params[:current])
redirect_to :action => "user_pref", :id => @project
end
def folder_notify_activate

View File

@ -1,4 +1,4 @@
<% html_title("DMSF") %>
<% html_title(l(:dmsf)) %>
<div class="contextual">
<% if User.current.allowed_to?(:folder_manipulation, @project) %>
@ -162,7 +162,7 @@ form_tag({:action => "entries_operation", :id => @project, :folder_id => @folder
<%= render(:partial => "multi_upload") %>
<br />
<%= render(:partial => "user_pref") %>
<%= link_to(l(:link_user_preferences), {:controller => "dmsf_state", :action => "user_pref", :id => @project}) %>
<% content_for :header_tags do %>
<script type="text/javascript">

View File

@ -1,7 +1,13 @@
<% html_title(l(:dmsf)) %>
<div class="contextual">
</div>
<h2><%= l(:link_user_preferences) %></h2>
<div class="box">
<% form_tag({:controller => "dmsf_state", :action => "user_pref", :id => @project, :current => URI.escape(request.url)},
<% form_tag({:controller => "dmsf_state", :action => "user_pref_save", :id => @project},
:method=>:post) do %>
<h3>Your <%= l(:dmsf) %> preferences for project</h3>
<div>
Notifications:
<%= select_tag("email_notify",
@ -10,4 +16,8 @@
<%= submit_tag("Save", :title => "Save preferences") %>
</div>
<% end %>
</div>
</div>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "dmsf", :plugin => "redmine_dmsf" %>
<% end %>

View File

@ -49,7 +49,6 @@ cs:
:title_notifications_active_deactivate: "Notifications active: Deactivate"
:title_notifications_not_active_activate: "Notifications not active: Activate"
:title_title_version_version_download: "%{title} version %{version} download"
:title_locked_by_user: "Locked by %{user}"
:title_locked_by_you: "Locked by you"
:title_waiting_for_approval: "Waiting for Approval"
@ -60,3 +59,6 @@ cs:
:title_download_checked: "Download checked in Zip archive"
:submit_email: "Email"
:title_send_checked_by_email: "Send checked by email"
:link_user_preferences: "Your DMSF project preferences"

View File

@ -59,4 +59,5 @@ de:
:title_download_checked: "Download checked in Zip archive"
:submit_email: "Email"
:title_send_checked_by_email: "Send checked by email"
:link_user_preferences: "Your DMSF project preferences"

View File

@ -59,4 +59,5 @@ en-GB:
:title_download_checked: "Download checked in Zip archive"
:submit_email: "Email"
:title_send_checked_by_email: "Send checked by email"
:link_user_preferences: "Your DMSF project preferences"

View File

@ -58,4 +58,5 @@ en:
:submit_download: "Download"
:title_download_checked: "Download checked in Zip archive"
:submit_email: "Email"
:title_send_checked_by_email: "Send checked by email"
:title_send_checked_by_email: "Send checked by email"
:link_user_preferences: "Your DMSF project preferences"

View File

@ -59,4 +59,5 @@ es:
:title_download_checked: "Download checked in Zip archive"
:submit_email: "Email"
:title_send_checked_by_email: "Send checked by email"
:link_user_preferences: "Your DMSF project preferences"

View File

@ -59,4 +59,5 @@ fr:
:title_download_checked: "Download checked in Zip archive"
:submit_email: "Email"
:title_send_checked_by_email: "Send checked by email"
:link_user_preferences: "Your DMSF project preferences"

View File

@ -59,4 +59,5 @@ ru:
:title_download_checked: "Download checked in Zip archive"
:submit_email: "Email"
:title_send_checked_by_email: "Send checked by email"
:link_user_preferences: "Your DMSF project preferences"

View File

@ -43,7 +43,7 @@ Redmine::Plugin.register :redmine_dmsf do
project_module :dmsf do
permission :browse_documents, {:dmsf => [:index]}
permission :user_preferences, {:dmsf_state => [:user_pref]}
permission :user_preferences, {:dmsf_state => [:user_pref, :user_pref_save]}
permission :view_dmsf_files, {:dmsf => [:download_file, :download_revision, :entries_operation, :email_entries_send],
:dmsf_detail => [:file_detail]}
permission :folder_manipulation, {:dmsf_detail => [:create_folder, :delete_folder, :folder_detail, :save_folder]}