Browse files

Merge pull request #95 from rescuedcode/cant_archive_users

Bug [#46218623] Can't archive a user
  • Loading branch information...
2 parents 998ff59 + ae2b7fa commit ac0893fc19930236c6ae31cc057238dd3632ff82 @fermion fermion committed Mar 19, 2013
View
23 app/assets/javascripts/models/membership.js.coffee
@@ -9,14 +9,19 @@ class window.StaffPlan.Models.Membership extends StaffPlan.Model
toJSON: ->
membership:
- archived: @get("archived")
+ # Permissions
+ permissions: @get("permissions") or []
user_id: @get("user_id")
- company_id: @get("company_id")
- disabled: @get("disabled")
- employment_status: @get("employment_status")
- salary: @get("salary")
- full_time_equivalent: @get("full_time_equivalent")
- id: @get("id")
- payment_frequency: @get("payment_frequency")
-
+ # Archived / Disabled
+ archived: @get("archived") or false
+ disabled: @get("disabled") or false
+ # Is the user an intern, a contractor...
+ employment_status: @get("employment_status")
+ # Salary information for full time employees
+ salary: @get("salary") or 0
+ full_time_equivalent: @get("full_time_equivalent") or 0
+ # Salary information for contractors
+ payment_frequency: @get("payment_frequency") or "hourly"
+ weekly_allocation: @get("weekly_allocation") or 0
+ rate: @get("rate") or 0
View
5 app/assets/javascripts/views/users/edit.js.coffee
@@ -35,7 +35,10 @@ class window.StaffPlan.Views.Users.Edit extends StaffPlan.View
else
memo['permissions'].push $(elem).val()
else
- memo[$(elem).data('attribute')] = $(elem).val()
+ if $(elem).attr("type") is "checkbox"
+ memo[$(elem).data('attribute')] = $(elem).prop("checked")
+ else
+ memo[$(elem).data('attribute')] = $(elem).val()
memo
, {}
@model.save userAttributes,

0 comments on commit ac0893f

Please sign in to comment.