Enabled address undelete and purge, now showing systems deleted messages
This commit is contained in:
@@ -517,6 +517,46 @@ class SystemController extends Controller
|
||||
return redirect()->to(sprintf('ftn/system/addedit/%d',$o->system_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Recover a deleted address
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @throws \Illuminate\Auth\Access\AuthorizationException
|
||||
*/
|
||||
public function rec_address(int $id)
|
||||
{
|
||||
$o = Address::onlyTrashed()->findOrFail($id);
|
||||
|
||||
// @todo This should be admin of the zone
|
||||
$this->authorize('admin',$o);
|
||||
session()->flash('accordion','address');
|
||||
|
||||
$o->restore();
|
||||
|
||||
return redirect()->to(sprintf('ftn/system/addedit/%d',$o->system_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Recover a deleted address
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @throws \Illuminate\Auth\Access\AuthorizationException
|
||||
*/
|
||||
public function pur_address(int $id)
|
||||
{
|
||||
$o = Address::onlyTrashed()->findOrFail($id);
|
||||
|
||||
// @todo This should be admin of the zone
|
||||
$this->authorize('admin',$o);
|
||||
session()->flash('accordion','address');
|
||||
|
||||
$o->forceDelete();
|
||||
|
||||
return redirect()->to(sprintf('ftn/system/addedit/%d',$o->system_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* register system
|
||||
*/
|
||||
|
Reference in New Issue
Block a user