-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'snipe:master' into fixes/auto_asset_tag_phrasing
- Loading branch information
Showing
6 changed files
with
90 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,15 +6,49 @@ | |
|
||
class ModalController extends Controller | ||
{ | ||
function show($type, $itemId = null) { | ||
$view = view("modals.${type}"); | ||
|
||
if($type == "statuslabel") { | ||
$view->with('statuslabel_types', Helper::statusTypeList()); | ||
} | ||
if(in_array($type, ['kit-model', 'kit-license', 'kit-consumable', 'kit-accessory'])) { | ||
$view->with('kitId', $itemId); | ||
/** | ||
* Load the modal views after confirming they are in the allowed_types array. | ||
* The allowed types away just prevents shithead skiddies from fuzzing the urls | ||
* with automated scripts and junking up the logs. - snipe | ||
* | ||
* @version v5.3.7-pre | ||
* @author [Brady Wetherington] [<[email protected]>] | ||
* @author [A. Gianotto] [<[email protected]] | ||
* @return View | ||
*/ | ||
function show ($type, $itemId = null) { | ||
|
||
// These values should correspond to a file in resources/views/modals/ | ||
$allowed_types = [ | ||
'category', | ||
'kit-model', | ||
'kit-license', | ||
'kit-consumable', | ||
'kit-accessory', | ||
'location', | ||
'manufacturer', | ||
'model', | ||
'statuslabel', | ||
'supplier', | ||
'upload-file', | ||
'user', | ||
]; | ||
|
||
|
||
if (in_array($type, $allowed_types)) { | ||
$view = view("modals.${type}"); | ||
|
||
if ($type == "statuslabel") { | ||
$view->with('statuslabel_types', Helper::statusTypeList()); | ||
} | ||
if (in_array($type, ['kit-model', 'kit-license', 'kit-consumable', 'kit-accessory'])) { | ||
$view->with('kitId', $itemId); | ||
} | ||
return $view; | ||
} | ||
return $view; | ||
|
||
abort(404,'Page not found'); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
database/migrations/2021_12_27_151849_change_supplier_address_length.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class ChangeSupplierAddressLength extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('suppliers', function (Blueprint $table) { | ||
// | ||
$table->string('address', 250)->nullable()->change(); | ||
$table->string('address2', 250)->nullable()->change(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('suppliers', function (Blueprint $table) { | ||
// | ||
$table->text('address', 50)->nullable()->default(null)->change(); | ||
$table->text('address2', 50)->nullable()->default(null)->change(); | ||
}); | ||
} | ||
} |