Update hub form and controller to support the new auto assign flags #607

This commit is contained in:
Kendrick Chan 2021-07-30 17:16:43 +08:00
parent 04e803510c
commit 49fdfa9ea6
3 changed files with 20 additions and 2 deletions

View file

@ -161,6 +161,8 @@ class HubController extends Controller
->setRiderSlots($req->request->get('rider_slots', 0))
->setHubViewFlag($req->request->get('flag_hub_view', false))
->setNotifNumber($req->request->get('notif_number'))
->setAutoAssignHub($req->request->get('flag_hub_auto_assign', false))
->setAutoAssignRider($req->request->get('flag_rider_auto_assign', false))
->clearPaymentMethods();
// set payment methods

View file

@ -247,7 +247,7 @@ class Hub
return $this;
}
public function setAutoAssignHubFlag($flag_hub_auto_assign = true)
public function setAutoAssignHub($flag_hub_auto_assign = true)
{
$this->flag_hub_auto_assign = $flag_hub_auto_assign;
return $this;
@ -258,7 +258,7 @@ class Hub
return $this->flag_hub_auto_assign;
}
public function setAutoAssignRiderFlag($flag_rider_auto_assign = true)
public function setAutoAssignRider($flag_rider_auto_assign = true)
{
$this->flag_rider_auto_assign = $flag_rider_auto_assign;
return $this;

View file

@ -118,6 +118,22 @@
</label>
</span>
</div>
<div class="col-lg-3">
<span class="m-switch m-switch--icon block-switch">
<label>
<input type="checkbox" name="flag_hub_auto_assign" id="status-open" value="1"{{ obj.isAutoAssignHub ? ' checked' }}>
<label class="switch-label">Hub Auto-Assign</label>
<span></span>
</label>
</span>
<span class="m-switch m-switch--icon block-switch">
<label>
<input type="checkbox" name="flag_rider_auto_assign" id="status-open" value="1"{{ obj.isAutoAssignRider ? ' checked' }}>
<label class="switch-label">Rider Auto-Assign</label>
<span></span>
</label>
</span>
</div>
</div>
<div class="form-group m-form__group row no-border">
<div class="col-lg-3">