<@ var isView = _pt.userPermissions.get('staff') != null && _pt.userPermissions.get('staff') == 'view' ? true : false; var isEdit = _pt.userPermissions.get('staff') != null && _pt.userPermissions.get('staff') == 'edit' ? true : false; var isOwner = _pt.userPermissions.get('staff') != null && _pt.userPermissions.get('staff') == 'owner' ? true : false; var isStaffPrivilegesView = _pt.userPermissions.get('staffPrivileges') != null && _pt.userPermissions.get('staffPrivileges') == 'view' ? true : false; var isStaffPrivilegesEdit = _pt.userPermissions.get('staffPrivileges') != null && _pt.userPermissions.get('staffPrivileges') == 'edit' ? true : false; var isStaffPrivilegesOwner = _pt.userPermissions.get('staffPrivileges') != null && _pt.userPermissions.get('staffPrivileges') == 'owner' ? true : false; @> Back
<@= model.isNew() ? 'Create new staff' : 'Staff details' @>
> *Please check first name
>
> *Please check telephone number
*Please check email
>
<@if(!user.login){@> <@}else{@> <@}@>
<@if(model.isNew()){@>
<@ var checkAllServieces = true; _.each(services.models, function(eachService){ var staffServices = model && model.id ? eachService.get('staffKeys').indexOf(model.id) != -1 : false ; if(!staffServices) checkAllServieces = false; }); @>
name="staff-assigned-services-all" type="checkbox">
<@_.each(services.models, function(eachService){ var staffServices = model && model.id ? eachService.get('staffKeys').indexOf(model.id) != -1 : false ; @>
name="staff-assigned-services">
<@});@>

<@ var checkAllLocations = true; _.each(locations.models, function(eachLocation){ var staffLocations = eachLocation && eachLocation.get('staffKeys') ? ( model.id && eachLocation.get('staffKeys').indexOf(model.id) != -1 ) : false ; if(!staffLocations) checkAllLocations = false; }); @>
name="staff-location-all" type="checkbox">
<@_.each(locations.models, function(eachLocation){@>
>
<@});@>
<@}@>
<@if(!isView){@> <@}@>
Normal working hours
<@for(var j=0;j<=6;j++){ if( model.get('businessDays').indexOf(PICKTIME_FULL_WEEKDAYS_VALUES[j]) != -1 ) { var timeBlock = _.filter( model.get('businessHours'),function(a){return a.indexOf(DAYS_SHORT_NAME[j]+'-') != -1} ); var startTime = +timeBlock[0].split('-')[1]; var endTime = +timeBlock[0].split('-')[2]; var startTimeHours= Math.floor(startTime/60) > 12 ? (Math.floor(startTime/60)-12) : Math.floor(startTime/60); var startTimeMins= startTime%60; var startTimeMed= Math.floor(startTime/60)>12 ? "pm" : "am"; var endTimeHours= Math.floor(endTime/60) > 12 ? (Math.floor(endTime/60)-12) : Math.floor(endTime/60); var endTimeMins= endTime%60; var endTimeMed= Math.floor(endTime/60)>12 ? "pm" : "am"; @>
<@= isView ? 'disabled' : ''@>>
<@=startTimeHours@> <@= startTimeMins < 9 ? ('0'+startTimeMins) : startTimeMins @> <@=startTimeMed@>
to
<@=endTimeHours@> <@= endTimeMins < 9 ? ('0'+endTimeMins) : endTimeMins @> <@=endTimeMed@>
<@}else{@>
>
<@}}@>
<@if(!isView){@> <@}@>
<@if(!model.isNew()){@>
Services
<@ var checkAllServieces = true; _.each(services.models, function(eachService){ var staffServices = model && model.id ? eachService.get('staffKeys').indexOf(model.id) != -1 : false ; if(!staffServices) checkAllServieces = false; }); @>
name="staff-assigned-services-all" type="checkbox" <@= isView ? 'disabled' : ''@>>
<@_.each(services.models, function(eachService){ var staffServices = model && model.id ? eachService.get('staffKeys').indexOf(model.id) != -1 : false ; @>
name="staff-assigned-services" <@= isView ? 'disabled' : ''@>>
<@});@>
<@if(!isView){@> <@}@>
Location
<@ var checkAllLocations = true; _.each(locations.models, function(eachLocation){ var staffLocations = eachLocation && eachLocation.get('staffKeys') ? eachLocation.get('staffKeys').indexOf(model.id) != -1 : false ; if(!staffLocations) checkAllLocations = false; }); @>
name="staff-location-all" type="checkbox" <@= isView ? 'disabled' : ''@>>
<@_.each(locations.models, function(eachLocation){@>
<@= isView ? 'disabled' : ''@>>
<@});@>
<@if(!isView){@> <@}@>
Staff Closed Dates

No staff closed days created yet . Click on the ADD button to create a first closed day

Permission Levels
<@ var isDisabled = _pt.userModel.get('id') == privileges.get('userKey') ? true : false; var isAdmin = _pt.staffPrivilegesCollection.findWhere({ 'userKey' : model.get('userKeys')[0]}).get('isAdmin'); @>
<@= isStaffPrivilegesView ? 'disabled' : ''@>>
">
View Edit Owner
Own Calendar
<@= isStaffPrivilegesView || isAdmin ? 'disabled' : ''@>>
<@= isStaffPrivilegesView || isAdmin ? 'disabled' : ''@>>
<@= isStaffPrivilegesView || isAdmin ? 'disabled' : ''@>>
Other Calendar
name="checkbox-owner-other-calendar" value = "view" type="checkbox" <@= privileges && privileges.get('otherCalendar') == "owner" || privileges.get('otherCalendar') == "edit" || privileges.get('otherCalendar') == "view" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-owner-other-calendar" value = "edit" type="checkbox" <@= privileges && privileges.get('otherCalendar') == "owner" || privileges.get('otherCalendar') == "edit" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-owner-other-calendar" value="owner" type="checkbox" <@= privileges && privileges.get('otherCalendar') == "owner" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
Services
name="checkbox-view-services" value = "view" type="checkbox" <@= privileges && privileges.get('services') == "owner" || privileges.get('services') == "edit" || privileges.get('services') == "view" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-edit-services" value = "edit" type="checkbox" <@= privileges && privileges.get('services') == "owner" || privileges.get('services') == "edit" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-owner-services" value="owner" type="checkbox" <@= privileges && privileges.get('services') == "owner" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
Classes
name="checkbox-view-classes" value = "view" type="checkbox" <@= privileges && privileges.get('classes') == "owner" || privileges.get('classes') == "edit" || privileges.get('classes') == "view" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-edit-classes" value = "edit" type="checkbox" <@= privileges && privileges.get('classes') == "owner" || privileges.get('classes') == "edit" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-owner-classes" value="owner" type="checkbox" <@= privileges && privileges.get('classes') == "owner" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
Staff
name="checkbox-view-staff" value = "view" type="checkbox" <@= privileges && privileges.get('staff') == "owner" || privileges.get('staff') == "edit" || privileges.get('staff') == "view" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-edit-staff" value = "edit" type="checkbox" <@= privileges && privileges.get('staff') == "owner" || privileges.get('staff') == "edit" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-owner-staff" value="owner" type="checkbox" <@= privileges && privileges.get('staff') == "owner" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
Staff Privileges
name="checkbox-view-staffPrivileges" value = "view" type="checkbox" <@= privileges && privileges.get('staffPrivileges') == "owner" || privileges.get('staffPrivileges') == "edit" || privileges.get('staffPrivileges') == "view" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
<@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-owner-staffPrivileges" value="owner" type="checkbox" <@= privileges && privileges.get('staffPrivileges') == "owner" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
Contacts
name="checkbox-view-contacts" value = "view" type="checkbox" <@= privileges && privileges.get('contacts') == "owner" || privileges.get('contacts') == "edit" || privileges.get('contacts') == "view" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-edit-contacts" value = "edit" type="checkbox" <@= privileges && privileges.get('contacts') == "owner" || privileges.get('contacts') == "edit" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-owner-contacts" value="owner" type="checkbox" <@= privileges && privileges.get('contacts') == "owner" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
Locations
name="checkbox-view-locations" value = "view" type="checkbox" <@= privileges && privileges.get('location') == "owner" || privileges.get('location') == "edit" || privileges.get('location') == "view" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-edit-locations" value = "edit" type="checkbox" <@= privileges && privileges.get('location') == "owner" || privileges.get('location') == "edit" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-owner-locations" value="owner" type="checkbox" <@= privileges && privileges.get('location') == "owner" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
Online Booking
name="checkbox-view-onlineBooking" value = "view" type="checkbox" <@= privileges && privileges.get('onlineBooking') == "owner" || privileges.get('onlineBooking') == "edit" || privileges.get('onlineBooking') == "view" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-edit-staffPrivileges" value = "edit" type="checkbox" <@= privileges && privileges.get('onlineBooking') == "owner" || privileges.get('onlineBooking') == "edit" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-owner-staffPrivileges" value="owner" type="checkbox" <@= privileges && privileges.get('onlineBooking') == "owner" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
Settings
name="checkbox-view-settings" value = "view" type="checkbox" <@= privileges && privileges.get('settings') == "owner" || privileges.get('settings') == "edit" || privileges.get('settings') == "view" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-edit-settings" value = "edit" type="checkbox" <@= privileges && privileges.get('settings') == "owner" || privileges.get('settings') == "edit" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-owner-settings" value="owner" type="checkbox" <@= privileges && privileges.get('settings') == "owner" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
Reports
name="checkbox-view-reports" value = "view" type="checkbox" <@= privileges && privileges.get('reports') == "owner" || privileges.get('reports') == "edit" || privileges.get('reports') == "view" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
<@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-owner-reports" value="owner" type="checkbox" <@= privileges && privileges.get('reports') == "owner" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
Apps
name="checkbox-view-apps" value = "view" type="checkbox" <@= privileges && privileges.get('apps') == "owner" || privileges.get('apps') == "edit" || privileges.get('apps') == "view" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-edit-apps" value = "edit" type="checkbox" <@= privileges && privileges.get('apps') == "owner" || privileges.get('apps') == "edit" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
name="checkbox-owner-apps" value="owner" type="checkbox" <@= privileges && privileges.get('apps') == "owner" ? 'checked' : '' @> <@= isStaffPrivilegesView || isDisabled ? 'disabled' : ''@>>
<@if(!isStaffPrivilegesView){@> <@}@>
<@}@>