Added file areas and TIC processing
This commit is contained in:
@@ -12,7 +12,7 @@ use Illuminate\Support\Facades\Notification;
|
||||
use Illuminate\Support\ViewErrorBag;
|
||||
|
||||
use App\Http\Requests\SystemRegister;
|
||||
use App\Models\{Address,Echoarea,Setup,System,SystemZone,Zone};
|
||||
use App\Models\{Address,Echoarea,Filearea,Setup,System,SystemZone,Zone};
|
||||
use App\Notifications\AddressLink;
|
||||
use App\Rules\{FidoInteger,TwoByteInteger};
|
||||
|
||||
@@ -410,6 +410,40 @@ class SystemController extends Controller
|
||||
->with('echoareas',$eo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the systems fileareas
|
||||
*
|
||||
* @param Request $request
|
||||
* @param System $o
|
||||
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function fileareas(Request $request,System $o)
|
||||
{
|
||||
$ao = $o->addresses->firstWhere('id',$request->address_id);
|
||||
|
||||
if (($request->method() == 'POST') && $request->post()) {
|
||||
session()->flash('accordion','filearea');
|
||||
|
||||
// Ensure we have session details for this address.
|
||||
if (! $ao->session('sespass'))
|
||||
return redirect()->back()->withErrors('System doesnt belong to this network');
|
||||
|
||||
$ao->fileareas()->syncWithPivotValues($request->get('id',[]),['subscribed'=>Carbon::now()]);
|
||||
|
||||
return redirect()->back()->with('success','Fileareas updated');;
|
||||
}
|
||||
|
||||
$fo = Filearea::active()
|
||||
->where('domain_id',$ao->zone->domain_id)
|
||||
->orderBy('name')
|
||||
->get();
|
||||
|
||||
return view('system.widget.filearea')
|
||||
->with('o',$o)
|
||||
->with('ao',$ao)
|
||||
->with('fileareas',$fo);
|
||||
}
|
||||
|
||||
public function home()
|
||||
{
|
||||
return view('system.home');
|
||||
|
Reference in New Issue
Block a user