diff --git a/app/Http/Controllers/SystemController.php b/app/Http/Controllers/SystemController.php index 29669c3..ff51733 100644 --- a/app/Http/Controllers/SystemController.php +++ b/app/Http/Controllers/SystemController.php @@ -31,6 +31,7 @@ class SystemController extends Controller */ public function add_address(Request $request,System $o) { + // @todo a point address is failing validation // @todo This should be admin of the zone $this->authorize('admin',$o); session()->flash('accordion','address'); @@ -161,7 +162,7 @@ class SystemController extends Controller $oo->host_id = $request->post('host_id_new'); $oo->node_id = $request->post('node_id_new'); $oo->point_id = 0; - $oo->role = Address::NODE_NC; + $oo->role = Address::NODE_ACTIVE; $oo->active = TRUE; $o->addresses()->save($oo); @@ -204,7 +205,7 @@ class SystemController extends Controller $oo->node_id = $request->post('node_id'); $oo->point_id = $request->post('point_id'); $oo->hub_id = $request->post('hub_id') > 0 ? $request->post('hub_id') : NULL; - $oo->role = (! $oo->point_id) && $request->post('hub') ? Address::NODE_HC : Address::NODE_ACTIVE; + $oo->role = ((! $oo->point_id) && $request->post('hub')) ? Address::NODE_HC : Address::NODE_ACTIVE; $oo->active = TRUE; $o->addresses()->save($oo); diff --git a/resources/views/system/widget/form-system.blade.php b/resources/views/system/widget/form-system.blade.php index e58ed08..f3d73f3 100644 --- a/resources/views/system/widget/form-system.blade.php +++ b/resources/views/system/widget/form-system.blade.php @@ -21,38 +21,34 @@
- @if($o->exists) - @can('update',$o) - -
-
- active))checked @endif> - + @can('update',$o) + +
+
+ active))checked @endif> + - active))checked @endif> - -
+ active))checked @endif> +
- @endcan - @endif +
+ @endcan
- @if($o->exists) - @can('update',$o) - -
-
- hold))checked @endif> - + @can('update',$o) + +
+
+ hold))checked @endif> + - hold))checked @endif> - -
+ hold))checked @endif> +
- @endcan - @endif +
+ @endcan