re-ordered all of the view directories
setup corp tax ratio for structure tax helper modified all view functions for new directory layout
This commit is contained in:
@@ -12,6 +12,7 @@ use App\Models\User\AvailableUserPermission;
|
||||
use App\Models\Esi\EsiScope;
|
||||
use App\Models\Esi\EsiToken;
|
||||
use App\Models\Corporation\CorpStructure;
|
||||
use App\Models\Admin\AllowedLogin;
|
||||
|
||||
class AdminController extends Controller
|
||||
{
|
||||
@@ -91,14 +92,62 @@ class AdminController extends Controller
|
||||
}
|
||||
|
||||
public function displayAllowedLogins() {
|
||||
$logins = AllowedLogin::all();
|
||||
|
||||
return view('admin.allowedlogins')->with('logins', $logins);
|
||||
}
|
||||
|
||||
public function addAllowedLogin() {
|
||||
public function addAllowedLogin(Request $request) {
|
||||
//Set the parameters to validate the form
|
||||
$this->validate($request, [
|
||||
'entity_id' => 'required',
|
||||
'entity_type' => 'required',
|
||||
'entity_name' => 'required',
|
||||
'login_type' => 'required',
|
||||
]);
|
||||
|
||||
//Check to see if the entity exists in the database already
|
||||
$found = AllowedLogin::where([
|
||||
'entity_type' => $request->entityType,
|
||||
'entity_name' => $request->entityName,
|
||||
])->get();
|
||||
if($found != null) {
|
||||
AllowedLogin::where([
|
||||
'entity_type' => $request->entityType,
|
||||
'entity_name' => $request->entityName,
|
||||
])->update([
|
||||
'entity_id' => $request->entityId,
|
||||
'entity_type' => $request->entityType,
|
||||
'entity_name' => $request->entityName,
|
||||
'login_type' => $request->loginType,
|
||||
]);
|
||||
} else {
|
||||
$login = new AllowedLogin;
|
||||
$login->entity_id = $request->entityId;
|
||||
$login->entity_name = $request->entityName;
|
||||
$login->entity_type = $request->entityType;
|
||||
$login->login_type = $request->loginType;
|
||||
}
|
||||
|
||||
return redirect('/admin/dashboard')->with('success', 'Entity added to allowed login list.');
|
||||
}
|
||||
|
||||
public function removeAllowedLogin() {
|
||||
|
||||
public function removeAllowedLogin(Request $request) {
|
||||
//Set the parameters to validate the form
|
||||
$this->validate($request, [
|
||||
'entity_id' => 'required',
|
||||
'entity_type' => 'required',
|
||||
'entity_name' => 'required',
|
||||
'login_type' => 'required',
|
||||
]);
|
||||
|
||||
AllowedLogin::where([
|
||||
'entity_id' => $request->entityId,
|
||||
'entity_type' => $request->entityType,
|
||||
'entity_name' => $request->entityName,
|
||||
'login_type' => $request->loginType,
|
||||
])->delete();
|
||||
|
||||
return redirect('/admin/dashboard')->with('success', 'Entity removed from allowed login list.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,6 @@ class DashboardController extends Controller
|
||||
'roles' => $roles,
|
||||
];
|
||||
|
||||
return view('/dashboard/profile')->with('data', $data);
|
||||
return view('dashboard.profile')->with('data', $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,11 +33,11 @@ class MoonsAdminController extends Controller
|
||||
|
||||
$journal = DB::select('SELECT amount,reason,description,date FROM `player_donation_journal` WHERE corporation_id=98287666 AND date >= DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 MONTH) ORDER BY date DESC');
|
||||
|
||||
return view('moons.moonjournal')->with('journal', $journal);
|
||||
return view('moons.admin.moonjournal')->with('journal', $journal);
|
||||
}
|
||||
|
||||
public function updateMoon() {
|
||||
return view('moons.updatemoon');
|
||||
return view('moons.admin.updatemoon');
|
||||
}
|
||||
|
||||
public function storeUpdateMoon2(Request $request) {
|
||||
@@ -119,7 +119,7 @@ class MoonsAdminController extends Controller
|
||||
}
|
||||
|
||||
public function addMoon() {
|
||||
return view('moons.addmoon');
|
||||
return view('moons.admin.addmoon');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -217,6 +217,6 @@ class MoonsAdminController extends Controller
|
||||
$html .= '</tr>';
|
||||
}
|
||||
|
||||
return view('moons.adminmoon')->with('html', $html);
|
||||
return view('moons.admin.adminmoon')->with('html', $html);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,11 +68,11 @@ class MoonsController extends Controller
|
||||
$html .= '</tr>';
|
||||
}
|
||||
|
||||
return view('moons.moon')->with('html', $html);
|
||||
return view('moons.user.moon')->with('html', $html);
|
||||
}
|
||||
|
||||
public function displayTotalWorthForm() {
|
||||
return view('moons.formTotalWorth');
|
||||
return view('moons.user.formTotalWorth');
|
||||
}
|
||||
|
||||
public function displayTotalWorth(Request $request) {
|
||||
@@ -102,6 +102,6 @@ class MoonsController extends Controller
|
||||
$fourthOre, $fourthQuantity);
|
||||
$totalWorth = number_format($totalWorth, 2, ".", ",");
|
||||
|
||||
return view('moons.displayTotalWorth')->with(['totalWorth' => $totalWorth, 'totalGoo' => $totalGoo]);
|
||||
return view('moons.user.displayTotalWorth')->with(['totalWorth' => $totalWorth, 'totalGoo' => $totalGoo]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ use Auth;
|
||||
use DB;
|
||||
|
||||
use App\Models\Corporation\CorpStructure;
|
||||
use App\Models\Corporation\CorpTaxRatio;
|
||||
use App\Library\Esi\Esi;
|
||||
|
||||
class RegisterStructureController extends Controller
|
||||
@@ -18,10 +19,57 @@ class RegisterStructureController extends Controller
|
||||
$this->middleware('permission:structure.operator');
|
||||
}
|
||||
|
||||
public function displayRegisterTaxRatio() {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
return view('structures.register.taxratio');
|
||||
}
|
||||
|
||||
public function storeTaxRatio(Request $request) {
|
||||
$this->validate($request, [
|
||||
'corpId',
|
||||
'corporation',
|
||||
'type',
|
||||
'ratio',
|
||||
]);
|
||||
|
||||
$ratio = new CorpTaxRatio;
|
||||
$ratio->corporation_id = $request->corpId;
|
||||
$ratio->corporation_name = $request->corporation;
|
||||
$ratio->structure_type = $request->type;
|
||||
$ratio->ratio = $request->ratio;
|
||||
$ratio->save();
|
||||
|
||||
return redirect('structure.admin.dashboard');
|
||||
}
|
||||
|
||||
public function updateTaxRatio(Request $request) {
|
||||
$this->validate($request, [
|
||||
'corporation',
|
||||
'type',
|
||||
'ratio',
|
||||
]);
|
||||
|
||||
CorpTaxRatio::where([
|
||||
'corporation_name' => $request->corporation,
|
||||
'structure_type' => $request->type,
|
||||
])->update([
|
||||
'ratio' => $request->ratio,
|
||||
]);
|
||||
|
||||
return redirect('structure.admin.dashboard')->with('success', 'Tax Ratio updated for structure type: ' . $request->type . ' and corporation: ' . $request->corporation);
|
||||
}
|
||||
|
||||
public function displayTaxRatios() {
|
||||
$taxRatios = CorpTaxRation::all();
|
||||
|
||||
return view('structure.admin.taxratios')->with('structures', $structures);
|
||||
}
|
||||
|
||||
public function displayRegisterStructure() {
|
||||
//Check to see if the user has the read corp journal esi scope before allowing to register a structure
|
||||
if(Auth()->user()->hasEsiScope('esi-wallet.read_corporation_wallets.v1')) {
|
||||
return view('structures.register');
|
||||
return view('structures.register.register');
|
||||
} else {
|
||||
return view('dashboard')->with('error', 'You need to setup your esi scope for read corporation wallets');
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class StructureController extends Controller
|
||||
}
|
||||
|
||||
//Return the view with the data passed to it
|
||||
return view('structures.reprocessingtaxes')->with('taxes', $taxes);
|
||||
return view('structures.user.reprocessingtaxes')->with('taxes', $taxes);
|
||||
}
|
||||
|
||||
public function displayIndustryTaxes() {
|
||||
@@ -78,12 +78,14 @@ class StructureController extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
return view('structures.industrytaxes')->with('taxes', $taxes);
|
||||
return view('structures.user.industrytaxes')->with('taxes', $taxes);
|
||||
}
|
||||
|
||||
public function chooseCorpTaxes() {
|
||||
$this->middleware('role:Admin');
|
||||
|
||||
$corps = CorpStructure::pluck('corporation_name', 'corporation_id');
|
||||
return view('structures.choosecorporation')->with('corps', $corps);
|
||||
return view('structures.admin.choosecorporation')->with('corps', $corps);
|
||||
}
|
||||
|
||||
public function displayCorpTaxes(Request $request) {
|
||||
@@ -107,7 +109,7 @@ class StructureController extends Controller
|
||||
}
|
||||
|
||||
//Return the view with the data passed to it
|
||||
return view('structures.choosecorptaxes')->with('totalTaxes', $totalTaxes);
|
||||
return view('structures.admin.choosecorptaxes')->with('totalTaxes', $totalTaxes);
|
||||
}
|
||||
|
||||
public function displayTaxes() {
|
||||
@@ -135,7 +137,7 @@ class StructureController extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
return view('structures.taxes')->with('totalTaxes', $totalTaxes);
|
||||
return view('structures.user.taxes')->with('totalTaxes', $totalTaxes);
|
||||
}
|
||||
|
||||
public function displayTaxHistory(Request $request) {
|
||||
@@ -165,6 +167,6 @@ class StructureController extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
return view('structures.taxhistory')->with(compact('totalTaxes', 'months'));
|
||||
return view('structures.user.taxhistory')->with(compact('totalTaxes', 'months'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class WikiController extends Controller
|
||||
return redirect('/dashboard')->with('error', 'Already registered for the wiki!');
|
||||
}
|
||||
|
||||
return view('wiki.register')->with('name', $name);
|
||||
return view('wiki.user.register')->with('name', $name);
|
||||
}
|
||||
|
||||
public function storeRegister(Request $request) {
|
||||
@@ -83,7 +83,7 @@ class WikiController extends Controller
|
||||
return redirect('/dashboard')->with('error', 'Login Not Found!');
|
||||
}
|
||||
|
||||
return view('wiki.changepassword')->with('name', $name);
|
||||
return view('wiki.user.changepassword')->with('name', $name);
|
||||
}
|
||||
|
||||
public function changePassword(Request $request) {
|
||||
|
||||
Reference in New Issue
Block a user