Add multiple Branches at the same time in New Schedule Form

Discussion for TimeTrex open source community developers.
Post Reply
joshsard
Posts: 55
Joined: Sun Feb 14, 2016 6:09 pm

Add multiple Branches at the same time in New Schedule Form

Post by joshsard » Wed Mar 16, 2016 9:22 pm

Hi,

I would like to ask help on how to change the field 'Branch' seen from the New Schedule Form
orig.png
from single selection to multiple selection (like the first field 'Employee').

I actually have managed to figure out how to turn it into multiple selection in the UI but I'm having problems on successfully saving multiple records at the same time, like the current mass adding to the schedule, if multiple employees are selected.

What I'm actually planning was if multiple employees are selected and also multiple branches, if I click save it should have multiple rows shown in the schedule grid per employee per branch.

Can someone guide me which codes to edit in ScheduleViewController.js, where I believe the changes have to be done? I tried looking for occurences of
"user_id, user_ids, branch_id, branch_ids"
but the codes really looks complicated to me :) especially if I tried to mimic the codes for 'mass add employee', I worry that I have to do cascading changes since it was designed to have only single Branch selection.
I tried to look at other forms if there is a multiple selection field used for Branch but there is nothing I've found.

I hope my request is reasonable. Thanks

Btw, im using community edition, see below
version.png
version.png (2.94 KiB) Viewed 1950 times

shaunw
Posts: 7360
Joined: Tue Sep 19, 2006 2:22 pm

Re: Add multiple Branches at the same time in New Schedule F

Post by shaunw » Thu Mar 17, 2016 7:07 am

If I understand you correctly, what you are asking for isn't going to work. If you select multiple employees and/or multiple branches for the same Start/End time, it would try to create duplicate schedules, which would be in conflict with one another and wouldn't make sense.

joshsard
Posts: 55
Joined: Sun Feb 14, 2016 6:09 pm

Re: Add multiple Branches at the same time in New Schedule F

Post by joshsard » Thu Mar 17, 2016 7:09 pm

:( Well can we make it dynamic? I mean for every extra Branch selected there will be another set of fields showing for Start/End time to specify the separate schedule. Or is that too much work?

Post Reply