Skip to content

Commit

Permalink
fix working-current from master
Browse files Browse the repository at this point in the history
  • Loading branch information
speedy32129 committed Mar 28, 2019
1 parent ca9a39f commit d3abe82
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 129 deletions.
14 changes: 7 additions & 7 deletions GPL.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Preamble
Preamble

The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Expand Down Expand Up @@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.

GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License applies to any program or other work which contains
Expand Down Expand Up @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

NO WARRANTY
NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
Expand All @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs
How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
Expand Down
17 changes: 5 additions & 12 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The newest version is always at {GitHub}[http://github.com/speedy32129/time_logg
== Install

1. Follow the Redmine plugin installation steps at: http://www.redmine.org/wiki/redmine/Plugins Make sure the plugin is installed to <tt>plugins/time_logger</tt>
2. Setup the database using the migrations. <tt>rake redmine:plugins:migrate RAILS_ENV=production</tt>
2. Setup the database using the migrations. <tt>rake redmine:plugins RAILS_ENV=production</tt>
3. Login to your Redmine install as an Administrator
4. Setup the 'log time' permissions for your roles
5. Add "Time tracking" to the enabled modules for your project
Expand Down Expand Up @@ -79,20 +79,13 @@ the 'New' status will automatically change it to 'In progress'.

1. Open a shell to your Redmine's <tt>/plugins/time_logger</tt> folder
2. Update your git copy with <tt>git pull</tt>
3. Update the database using the migrations. <tt>rake db:migrate_plugins RAILS_ENV=production</tt>
3. Update the database using the migrations. <tt>rake redmine:plugins RAILS_ENV=production</tt>
4. Restart your Redmine

=== Change History
0.5.4.0 - Updates
re-orginized the settings panels to make room for new transitions.
The plan is to add two transitons types.
1. for current activity to change the status to.
A. For example if original status is Open then change it to In Progress.
B. So when the logger is not longer active change it to Open.

0.5.3 - updates
fixed javascript variable declaration
added icon sets so user can have more choice with their theme - for now this is to be done manually. Just delte the icons in /time_logger/assets/images (not the sub-folders) then copy from one of the sub-folders (colorized or original) into /time_logger/assets/image.
0.5.3 - updates
fixed javascript variable declaration
added icon sets so user can have more choice with their theme - for now this is to be done manually. Just delte the icons in /time_logger/assets/images (not the sub-folders) then copy from one of the sub-folders (colorized or original) into /time_logger/assets/image.
add TLHelper function back due to problem with time_logger
fix for missing icons on status transitions
fixes for status transitions - removal - Special thanks to kotashiratsuka indirectly!!
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def status_from_id(status_id)
IssueStatus.find_by_id(status_id)
end

def statuses_list()
def statuses_list
IssueStatus.all
end

Expand All @@ -26,7 +26,7 @@ def to_status_options(statuses)

def new_transition_from_options(transitions)
statuses = []
for status in statuses_list()
for status in statuses_list
statuses << status unless transitions.has_key?(status.id.to_s)
#if !transitions.has_key?(status.id.to_s)
# statuses << status
Expand All @@ -35,8 +35,8 @@ def new_transition_from_options(transitions)
to_status_options(statuses)
end

def new_transition_to_options()
to_status_options(statuses_list())
def new_transition_to_options
to_status_options(statuses_list)
end

def global_allowed_to?(user, action)
Expand Down
37 changes: 19 additions & 18 deletions app/views/settings/_time_logger.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<div>
<h3><%= l(:time_logger_settings_general_title) %></h3>
<hr />
<div class="box tabular">
<p>
<%= label_tag 'settings[refresh_rate]', l(:time_logger_refresh_rate) %>
<%= text_field_tag 'settings[refresh_rate]', @settings['refresh_rate'], { :size => 4 } %>
(<%= l(:time_logger_seconds) %>)
</p>
</div>
</div> <%# Hack to close the div opened by redmine before rendering this view. This is to avoid the big box wrapping all the settings content. %>

<h3><%= l(:time_logger_settings_general_title) %></h3>

<h3><%= l(:time_logger_settings_transition_title) %></h3>
<hr />
<div>
<%= l(:time_logger_settings_transition_msg) %>
<br /><br /><b><%= l(:time_logger_settings_transition_note) %></b>
<br /><br />
<%= render :partial => 'time_loggers/status_transition_list', :locals => { :transitions => @settings['status_transitions'] } %>
</div>
<div class="box tabular">
<p>
<%= label_tag 'settings[refresh_rate]', l(:time_logger_refresh_rate) %>
<%= text_field_tag 'settings[refresh_rate]', @settings['refresh_rate'], { :size => 4 } %>
(<%= l(:time_logger_seconds) %>)
</p>
</div>

<h3><%= l(:time_logger_settings_transition_title) %></h3>

<div>
<p><%= l(:time_logger_settings_transition_msg) %></p>
<p><%= l(:time_logger_settings_transition_note) %></p>

<%= render :partial => 'time_loggers/status_transition_list', :locals => { :transitions => @settings['status_transitions'] } %>

<%# The div is not close as redmine will close the one opened before rendering this view. As we close this div at the begining of the view, we need an open one before returning. %>
19 changes: 0 additions & 19 deletions app/views/settings/_time_logger.html.erb.org

This file was deleted.

65 changes: 20 additions & 45 deletions app/views/time_loggers/_status_transition_list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,19 @@
<% edit_allowed = User.current.admin %>
<% transitions = transitions.nil? ? {} : transitions %>
<% has_zombie = false %>
<div id="add-transition">
<table class="list">
<thead>
<tr>
<th class="zombie" width="5%"></th>
<th class="from" width="35%"><%= l(:time_logger_settings_from_status) %></th>
<th class="to" width="35%"><%= l(:time_logger_settings_to_status) %></th>
<% if edit_allowed %>
<th class="buttons" width="25%"></th>
<% else %>
<th width="25%"></th>
<% end %>
</tr>
<tr>
<th class="zombie"></th>
<th class="from">
<%= select_tag 'new-transition-from', new_transition_from_options(transitions) %>
</th>
<th>
<%= select_tag 'new-transition-to', new_transition_to_options %>
</th>
<% if edit_allowed %>
<th>
<%= link_to l(:time_logger_settings_new_transition_add),
'#',
:remote => true,
:onclick => "addTransitionField();$('form').submit();",
:class => 'icon icon-add',
:id => 'link-add-transition'
%>
</th>
<% else %><th></th>
<% end %>
</tr>
</thead>
</table>
</div>
<br />
<div class="autoscroll">
<table class="list">
<thead>
<tr>
<th class="zombie" width="5%"></th>
<th class="from" width="35%"><%= l(:time_logger_settings_from_status) %></th>
<th class="to" width="35%"><%= l(:time_logger_settings_to_status) %></th>
<th class="zombie"></th>
<th class="from"><%= l(:time_logger_settings_from_status) %></th>
<th class="to"><%= l(:time_logger_settings_to_status) %></th>
<% if edit_allowed %>
<th class="buttons" width="25%"></th>
<% else %><th width="25%"></th>
<th class="buttons"></th>
<% end %>
</tr>
</thead>

<tbody>
<% if transitions.empty? %>
<tr class="odd">
Expand Down Expand Up @@ -85,7 +47,6 @@
:class => 'icon icon-del'
%>
</td>
<% else %><td></td>
<% end %>
</tr>
<% end %>
Expand All @@ -98,5 +59,19 @@
<p class="legend icon icon-warning"><%= l(:time_logger_settings_zombie_transition) %></p>
<% end %>


<% if edit_allowed %>
<div id="add-transition">
<%= label_tag 'new-transition-from', l(:time_logger_settings_new_transition_from) %>
<%= select_tag 'new-transition-from', new_transition_from_options(transitions) %>
<%= label_tag 'new-transition-to', l(:time_logger_settings_new_transition_to) %>
<%= select_tag 'new-transition-to', new_transition_to_options %>
<%= link_to l(:time_logger_settings_new_transition_add),
'#',
:remote => true,
:onclick => "addTransitionField();$('form').submit();",
:class => 'icon icon-add',
:id => 'link-add-transition'
%>
</div>
<% end %>
</div>
2 changes: 1 addition & 1 deletion config/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ ru:
time_logger_settings_unknown_status: "Неизвестный статус"
time_logger_settings_zombie_transition: "zombie status transition"
time_logger_zombie_legend: "zombie time tracker"

time_logger_list_title: "Таймеры трудозатрат"
42 changes: 21 additions & 21 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
if Rails::VERSION::MAJOR >= 4
Rails.application.routes.draw do
match 'time_loggers/stop', :to => "time_loggers#stop", via: [:get, :post]
match 'time_loggers/start', :to => "time_loggers#start", via: [:get, :post]
match 'time_loggers/suspend', :to => "time_loggers#suspend", via: [:get, :post]
match 'time_loggers/resume', :to => "time_loggers#resume", via: [:get, :post]
match 'time_loggers/render_menu', :to => "time_loggers#render_menu", via: [:get, :post]
match 'time_loggers/add_status_transition', :to => "time_loggers#add_status_transition", via: [:get, :post]
match 'time_loggers/delete_status_transition', :to => "time_loggers#delete_status_transition", via: [:get, :post]
match 'time_loggers/show_report', :to => "time_loggers#show_report", via: [:get, :post]
match 'time_loggers/delete', :to => "time_loggers#delete", via: [:get, :post]
match 'time_loggers', :to => "time_loggers#index", via: [:get, :post]
match 'time_loggers/stop', :to => 'time_loggers#stop', via: [:get, :post]
match 'time_loggers/start', :to => 'time_loggers#start', via: [:get, :post]
match 'time_loggers/suspend', :to => 'time_loggers#suspend', via: [:get, :post]
match 'time_loggers/resume', :to => 'time_loggers#resume', via: [:get, :post]
match 'time_loggers/render_menu', :to => 'time_loggers#render_menu', via: [:get, :post]
match 'time_loggers/add_status_transition', :to => 'time_loggers#add_status_transition', via: [:get, :post]
match 'time_loggers/delete_status_transition', :to => 'time_loggers#delete_status_transition', via: [:get, :post]
match 'time_loggers/show_report', :to => 'time_loggers#show_report', via: [:get, :post]
match 'time_loggers/delete', :to => 'time_loggers#delete', via: [:get, :post]
match 'time_loggers', :to => 'time_loggers#index', via: [:get, :post]
end
elsif Rails::VERSION::MAJOR = 3
elsif Rails::VERSION::MAJOR >= 3
Rails.application.routes.draw do
match 'time_loggers/stop' , :to => "time_loggers#stop"
match 'time_loggers/start' , :to => "time_loggers#start"
match 'time_loggers/suspend', :to => "time_loggers#suspend"
match 'time_loggers/resume' , :to => "time_loggers#resume"
match 'time_loggers/render_menu', :to => "time_loggers#render_menu"
match 'time_loggers/add_status_transition', :to => "time_loggers#add_status_transition"
match 'time_loggers/delete_status_transition', :to => "time_loggers#delete_status_transition"
match 'time_loggers/show_report', :to => "time_loggers#show_report"
match 'time_loggers/delete', :to => "time_loggers#delete"
match 'time_loggers' , :to => "time_loggers#index"
match 'time_loggers/stop' , :to => 'time_loggers#stop'
match 'time_loggers/start' , :to => 'time_loggers#start'
match 'time_loggers/suspend', :to => 'time_loggers#suspend'
match 'time_loggers/resume' , :to => 'time_loggers#resume'
match 'time_loggers/render_menu', :to => 'time_loggers#render_menu'
match 'time_loggers/add_status_transition', :to => 'time_loggers#add_status_transition'
match 'time_loggers/delete_status_transition', :to => 'time_loggers#delete_status_transition'
match 'time_loggers/show_report', :to => 'time_loggers#show_report'
match 'time_loggers/delete', :to => 'time_loggers#delete'
match 'time_loggers' , :to => 'time_loggers#index'
end
end
4 changes: 2 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
author 'Jim McAleer'
description 'The orignal author was Jérémie Delaitre.'
url 'https://github.com/speedy32129/time_logger'
version '0.5.4.0'
version '0.5.4'


#fix for contect menus
Expand All @@ -25,7 +25,7 @@
permission :view_others_time_loggers, :time_loggers => :index
permission :delete_others_time_loggers, :time_loggers => :delete

menu :account_menu, :time_logger_menu, '',
menu :account_menu, :time_logger_menu, 'javascript:void(0)',
{
:caption => '',
:html => { :id => 'time-logger-menu' },
Expand Down

0 comments on commit d3abe82

Please sign in to comment.