Project

General

Profile

Time & Expense 1.6

Added by Dhanasingh Krishnapandian over 10 years ago

We are happy to announce the release of Time & Expense plugin version 1.6
Please download it from http://www.redmine.org/plugins/wk-time

Features:
- Supports REST Api
- Separate Permission for Approving Time Logs
- Filter timesheets by groups
- Filter Issues assigned to me
- Configure Public Holidays
- Support for MS SQL Server
- User with View Spent time permission can only see the list page.
Bugs:
- wrap Settings object within Rails.configuration.to_prepare inside init.rb
- Show the message “no users in the selected project" in new time/expense sheet
- Expense report link does not shows up by default
- Allow 0 for time/expense entry

Resources:

User guide:
http://www.adhisoftware.co.in/wp-content/uploads/TE-User-Guide.pdf

Overview presentation in open office format:
http://www.adhisoftware.co.in/wp-content/uploads/TE-Overview.odp

Training Videos:
http://www.youtube.com/watch?v=BptCOCWgivY
http://www.youtube.com/watch?v=afdVgCj-TUc
http://www.youtube.com/watch?v=cTZ2FCqgdwQ


Replies (44)

RE: Time & Expense 1.6 - Added by Darth Vader about 10 years ago

Check your database like it says: time_entries.user_id does not exist which it should. If it does exist, maybe for some reason, the specific user does not have access privileges to that column. I am not a database expert so I am not even sure if there are user privileges on a column but you should check.

RE: Time & Expense 1.6 - Added by Tomas Hubik about 10 years ago

Thanks for tip. Check of database was the first thing I have done. The column and table exist. Otherwise administrator will get the error as well (at least I think :) ). The database user is something different than Redmine user. The Redmine app is accessing the db using single db user. And regarding the permissions I would expect some permission error rather than "not exists" error.

I am just thinking whether about the syntax of the select:
SELECT `projects`.* FROM `projects` WHERE (((projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='time_tracking')) AND (projects.id IN (6,4,26,20,28) AND time_entries.user_id = 7))))

Isn't it problem that table time_entries is not in the first FROM? There should be some kind of JOIN to select column from this table. Or am I wrong?

RE: Time & Expense 1.6 - Added by Tomas Hubik about 10 years ago

I finally found the broken place. I am using plugin http://www.redmine.org/plugins/selfspenttime to restrict user to view only own time logs. Plugin Time & Expense 1.6 somehow redefined some functions this plugin is using and that is why it fails when upgrading from T&E from 1.5 to 1.6 (maybe, I do not know ruby). So the problem is not Time & Expense but old Self Spent Time.

Does anybody know, how to solve this issue? I can not code in ruby. These are the problematic parts of the code:

def total_spent_hours(options = {})
conditions = options[:user] ? "#{TimeEntry.table_name}.user_id = #{options[:user].id}" : "1=1"
@total_spent_hours ||= self_and_descendants.sum("#{TimeEntry.table_name}.hours",
:joins => "LEFT JOIN #{TimeEntry.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id",
:conditions => conditions).to_f || 0.0
end

and maybe also this, but I am not sure:

user.projects_by_role.each do |role, projects|
if role.allowed_to?(permission) && projects.any?
statement_by_role[role] = "#{Project.table_name}.id IN (#{projects.collect(&:id).join(',')})"
elsif permission == :view_time_entries && role.allowed_to?(:view_only_own_time_entries) && projects.any?
statement_by_role[role] = "#{Project.table_name}.id IN (#{projects.collect(&:id).join(',')}) AND #{TimeEntry.table_name}.user_id = #{user.id}"
end
end

Can anybody help me to make the plugin join table {TimeEntry.table_name} to the first query (an maybe also in the second if it is not there already)? I hope this could solve the problem. Or if there is any other solution how to allow users (developers) to view only own lime logs and timesheets, I am listening.

In my opinion, the problem is on this line:
statement_by_role[role] = "#{Project.table_name}.id IN (#{projects.collect(&:id).join(',')}) AND #{TimeEntry.table_name}.user_id = #{user.id}"

But I am postim the whole fragments just not to loose the context.

Thank you very much for any help.

Tomas

RE: Time & Expense 1.6 - Added by Huy Nguyen about 10 years ago

Hello

I'm getting a problem while installing redmine_wktime1.6 plugin
When I rake database it throws the following error :
"undefined method 'custom_fields_tabs' for module 'CustomDieldsHelp'

Anyone could guide me how to fix this error please?

Thank in advance

RE: Time & Expense 1.6 - Added by Dhanasingh Krishnapandian about 10 years ago

Huy,
Are you starting of with a fresh redmine install ?
if yes, install redmine first using the instructions here
http://www.redmine.org/projects/redmine/wiki/RedmineInstall

And then install the plugin using the instructions here
http://www.redmine.org/plugins/wk-time

Time & Expense 1.6 is compatible with Redmine 2.3

Dhanasingh

RE: Time & Expense 1.6 - Added by Huy Nguyen about 10 years ago

Hi Dhanasingh,

Yes I did
Here is my script/about:

Environment:
Redmine version 2.5.0.stable
Ruby version 2.0.0-p451 (2014-02-24) [x86_64-linux]
Rails version 3.2.17
Environment production
Database adapter Mysql2

SCM:
Git 1.7.9.5
Filesystem

Redmine plugins:
redmine_cms 0.0.3
redmine_contacts 3.2.14-light
redmine_contacts_helpdesk 2.2.5-pro
redmine_contacts_invoices 3.1.1-light
redmine_favorite_projects 1.0.1
redmine_finance 1.0.9-light
redmine_issue_checklist 2.0.5
redmine_people 0.1.6
redmine_workload 1.0.2

========
As you said, my redmine 2.5 is not compatible with redmine_wktime 1.6 plugin ?? :(
Do you have any other way ? Please take a look at the list of my installed plugins, is it ok with redmine_wktime1.6?
Thanks a lot

Huy

RE: Time & Expense 1.6 - Added by Dhanasingh Krishnapandian about 10 years ago

no, we haven't played with redmine 2.5 yet, so don't know much about 2.5

RE: Time & Expense 1.6 - Added by Darth Vader about 10 years ago

We have started playing with Redmine 2.5. 2.5 has a completely reworked custom fields the redmine_wktime uses. Attached is a patch to get it working with the new custom fields. This was modeled from the dmsf plugin handling of the new custom fields. The only caveat is that if you remove the redmine_wktime plugin, you'll have to remember to remove any custom fields you created for it first otherwise, it'll break the custom fields function. I have submitted this issue to redmine and I am waiting for an acknowledgement.
Go into the redmine_wktime folder and run:

patch -p0 < init.rb.patch

RE: Time & Expense 1.6 - Added by Huy Nguyen about 10 years ago

Hi Darth,

Thank you for your solution. I really appreciate that.

Hope Redmine will respond to you soon

Huy

RE: Time & Expense 1.6 - Added by Alex Defac about 10 years ago

We get the following message: "Please Note: The timesheet for this period is locked, you cannot log time. It will lead to an error". But as far as I can see I can still write hours on the issue.
Does somebody knows why I see this message?

RE: Time & Expense 1.6 - Added by Peter Drábik almost 10 years ago

Hi, I have very bad English, sorry. When I add multiple records for the same issue, with the same activity performed only by different commentary, the resulting record contains only one item with the first comment and merging time for all added records. I need to show these records to display tasks separately, each with a different commentary. Can you help me, please?

For example:

I have project and issue with ID, e.g. 1, I have done such activity, e.g. Analysis. I worked on the issue on Monday, Tuesday, Wednesday and I I need to add another comment for every days. I'll do it when I have one record which is a task that has one comment and time spent on it is merged from all records.

RE: Time & Expense 1.6 - Added by auddog 007 almost 10 years ago

I'm attempting to use this plugin with 2.5.1 but during the installation I get an error that reads:

rake aborted!
undefined method 'custom_fields_tabs' for module 'CustomFieldsHelper'

Does anyone else have this plugin working with 2.5.1

thanks.

RE: Time & Expense 1.6 - Added by Ivan Rapekas almost 10 years ago

auddog 007 wrote:

I'm attempting to use this plugin with 2.5.1 but during the installation I get an error that reads:

rake aborted!
undefined method 'custom_fields_tabs' for module 'CustomFieldsHelper'

Does anyone else have this plugin working with 2.5.1

thanks.

Look the Darth Vader's patch above.

RE: Time & Expense 1.6 - Added by Dhanasingh Krishnapandian over 9 years ago

Time & Expense 1.7 is released

RE: Time & Expense 1.6 - Added by Radhakrishna M over 9 years ago

Dhanasingh Krishnapandian wrote:

We are happy to announce the release of Time & Expense plugin version 1.6
Please download it from http://www.redmine.org/plugins/wk-time

Hi i am using Redmine2.3.0. i have installed Time & Expense 1.6. When the reporter submitted the time sheet then the Manger is unable to edit that before Approve. Is it possible for me to do like that? Another, i tried to install Time&Expense 1.7 in Redmine 2.3.0 but it showing the following error

D:\redmine-2.3.0>rake redmine:plugins:migrate NAME=redmine_wktime RAILS_ENV=production
rake aborted!
NameError: uninitialized constant CustomFieldsHelper::CUSTOM_FIELDS_TABS

Please help me... My requirement is when the user submitted the time sheet then the manager should able to Edit that sheet and Approve.

RE: Time & Expense 1.6 - Added by Dhanasingh Krishnapandian over 9 years ago

could you please check if the manager has 'Edit time logs' permission ?
And regarding 1.7, it is only compatible with Redmine 2.5.2, so it cannot be installed on Redmine 2.3

Time & Expense 1.7 - Added by Stefan Detzner about 9 years ago

Hi,

I was trying to use the plugin but when the scheduler was about to run I just got an error on redmine log:

==========Scheduler Started==========
Scheduler failed: uninitialized constant WktimeHelper::WkMailer

I only got the single plugin installed, running

Environment:
  Redmine version                2.5.3.stable
  Ruby version                   1.9.3-p484 (2013-11-22) [x86_64-linux]
  Rails version                  3.2.19
  Environment                    production
  Database adapter               Mysql2

Any suggestions except for waiting for a newer release?
Thanks

RE: Time & Expense 1.7 - Added by Adam Kuczma about 9 years ago

Stefan Detzner wrote:

Hi,

I was trying to use the plugin but when the scheduler was about to run I just got an error on redmine log:
[...]

I only got the single plugin installed, running
[...]

Any suggestions except for waiting for a newer release?
Thanks

Hello,

I've had the same problem but found out the solution. Just change filename:
\app\models\Wk_Mailer.rb
to
\app\models\wk_mailer.rb

I hope it will help you too.

Adam

RE: Time & Expense 1.6 - Added by Stefan Detzner about 9 years ago

Hello,

thank you Adam for your constructive feedback, this indeed solves the issue.

Thanks again
Stefan

(26-44/44)