Resolve "Sprint 20180129" #1019

Merged
jankstudio merged 3 commits from 175-sprint-20180129 into master 2019-01-27 19:17:35 +00:00
2 changed files with 13 additions and 0 deletions
Showing only changes of commit 1bd5c30875 - Show all commits

View file

@ -1142,6 +1142,11 @@ class JobOrderController extends BaseController
if (empty($obj))
throw $this->createNotFoundException('The item does not exist');
// check if we can assign
if (!$obj->canAssign())
throw $this->createNotFoundException('Cannot assign rider to this job order.');
// check if lat and lng are provided
if (empty($req->request->get('coord_lng')) || empty($req->request->get('coord_lat'))) {
$error_array['coordinates'] = 'No map coordinates provided. Please click on a location on the map.';

View file

@ -734,4 +734,12 @@ class JobOrder
return false;
}
public function canAssign()
{
if ($this->status == JOStatus::ASSIGNED)
return true;
return false;
}
}