Skip to content

Commit

Permalink
Merge pull request #34 from dhanasingh/dev
Browse files Browse the repository at this point in the history
changes for 2.0
  • Loading branch information
suganya-thulasiraman committed Oct 8, 2015
2 parents 5c586fc + 0b82621 commit de59948
Show file tree
Hide file tree
Showing 25 changed files with 1,181 additions and 200 deletions.
42 changes: 28 additions & 14 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,34 @@ If an apache passenger module is used then make sure the following settings are
b) RailsAppSpawnerIdleTime 0
c) PassengerPreStart http://rails-app-url/

Release Notes for 1.9
Release Notes for 2.0
Features:
- Permission changes
-- The project member with 'Edit time logs' can edit other member time/expense sheet with his permission.
- TE Admin users is introduced
- Empty time/expense sheet can be viewed.
- Sorting of timesheet rows.
- Allow entering time in different format.
- Non empty icon if detail time entry popup has no values.
- Comment box size increased.
- Name is shown for closed or inactive project, issue and activity.

Bugs:
- Error message is shown if issue is blank when "Allow blank issue" is OFF.
- Closed date is considered instead of updated date for closed issues.
- Made compatible with Redmine 3.1.1.
- Reminder email for submission and approval can be send by manager and TE admins.
- TE admins are allowed to modify and approve time/expense.
- Added User custom field filters in list page.
- "Please select" option is added in Issue and Activity dropdown.
- In log time page, error message is shown for restricted tracker type and on TE related error, the Create/Save button will be disabled.
- A warning message is shown when the user leaves an unsaved time/expense sheet page.

Bugs:
- Permission changes - When a Manager edits a Member T&E, his permission will be checked rather than the member's permission.

We would like to thank Fotonation(http://www.fotonation.com) for sponsoring this release.

Customization:
For any Customization/Support, please contact us, our consulting team will be happy to help you

Adhi Software Pvt Ltd
http://www.adhisoftware.co.in
[email protected]
+1 732 661 8294
+91 44 27470401
+91 44 27470402

Here are the Customizations we have done for our clients:
1. Monthly Calendar - Puny Human
2. Supervisor Approvals - Fotonation


Please provide your rating at http://www.redmine.org/plugins/wk-time
61 changes: 49 additions & 12 deletions app/controllers/wkexpense_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,23 @@ def getEntityNames
["#{Wkexpense.table_name}", "#{WkExpenseEntry.table_name}"]
end

def findBySql(selectStr,sqlStr,wkSelectStr,wkSqlStr, status, ids)
spField = getSpecificField()
dtRangeForUsrSqlStr = "(" + getAllWeekSql(@from, @to) + ") tmp1"
teSqlStr = "(" + wkSelectStr + " ,exp.currency" + sqlStr + " inner join wk_expense_entries exp on v1.id = exp.id " + wkSqlStr + ") tmp2"
query = "select tmp3.user_id, tmp3.spent_on, tmp3.#{spField}, tmp3.status, tmp3.status_updater, tmp3.created_on, tmp3.currency from (select tmp1.id as user_id, tmp1.created_on, tmp1.selected_date as spent_on, " +
def getQuery(teQuery, ids, from, to, status)
spField = getSpecificField()
dtRangeForUsrSqlStr = "(" + getAllWeekSql(from, to) + ") tmp1"
teSqlStr = "(" + teQuery + ") tmp2"
query = "select tmp3.user_id, tmp3.spent_on, tmp3.#{spField}, tmp3.status, tmp3.status_updater, tmp3.created_on, tmp3.currency from (select tmp1.id as user_id, tmp1.created_on, tmp1.selected_date as spent_on, " +
"case when tmp2.#{spField} is null then 0 else tmp2.#{spField} end as #{spField}, " +
"case when tmp2.status is null then 'e' else tmp2.status end as status, tmp2.currency, tmp2.status_updater from "
query = query + dtRangeForUsrSqlStr + " left join " + teSqlStr
query = query + " on tmp1.id = tmp2.user_id and tmp1.selected_date = tmp2.spent_on where tmp1.id in (#{ids}) ) tmp3 "
query = query + " left outer join (select min( #{getDateSqlString('t.spent_on')} ) as min_spent_on, t.user_id as usrid from wk_expense_entries t, users u "
query = query + " where u.id = t.user_id and u.id in (#{ids}) group by t.user_id ) vw on vw.usrid = tmp3.user_id "
query = query + getWhereCond(status)
query = query + " order by tmp3.spent_on desc, tmp3.user_id "

query = query + dtRangeForUsrSqlStr + " left join " + teSqlStr
query = query + " on tmp1.id = tmp2.user_id and tmp1.selected_date = tmp2.spent_on where tmp1.id in (#{ids}) ) tmp3 "
query = query + " left outer join (select min( #{getDateSqlString('t.spent_on')} ) as min_spent_on, t.user_id as usrid from wk_expense_entries t, users u "
query = query + " where u.id = t.user_id and u.id in (#{ids}) group by t.user_id ) vw on vw.usrid = tmp3.user_id "
query = query + getWhereCond(status)
query = query + " order by tmp3.spent_on desc, tmp3.user_id "
end

def findBySql(query)
spField = getSpecificField()
result = WkExpenseEntry.find_by_sql("select count(*) as id from (" + query + ") as v2")
@entry_count = result[0].id
setLimitAndOffset()
Expand Down Expand Up @@ -237,4 +240,38 @@ def expense_entry_scope(options={})
end
scope
end

def getTELabel
l(:label_wk_expensesheet)
end

def findTEEntryBySql(query)
WkExpenseEntry.find_by_sql(query)
end

def formQuery(wkSelectStr, sqlStr, wkSqlStr)
query = wkSelectStr + " ,exp.currency" + sqlStr + " inner join wk_expense_entries exp on v1.id = exp.id " + wkSqlStr
end

def getUserCFFromSession
#return user custom field filters from session
session[:wkexpense][:filters]
end

def getUserIdFromSession
#return user_id from session
session[:wkexpense][:user_id]
end

def getStatusFromSession
session[:wkexpense][:status]
end

def setUserIdsInSession(ids)
session[:wkexpense][:all_user_ids] = ids
end

def getUserIdsFromSession
session[:wkexpense][:all_user_ids]
end
end
Loading

0 comments on commit de59948

Please sign in to comment.