mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Updated docblocks
This commit is contained in:
parent
95e4845176
commit
a62859dc6d
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Accessories for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Helpers\Helper;
|
use App\Helpers\Helper;
|
||||||
|
@ -29,7 +20,10 @@ use Auth;
|
||||||
use Request;
|
use Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class controls all actions related to accessories
|
* This controller handles all actions related to Accessories for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
*/
|
*/
|
||||||
class AccessoriesController extends Controller
|
class AccessoriesController extends Controller
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Asset Maintenance for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\AssetMaintenance;
|
use App\Models\AssetMaintenance;
|
||||||
|
@ -30,6 +21,12 @@ use App\Models\Setting;
|
||||||
use App\Models\Asset;
|
use App\Models\Asset;
|
||||||
use App\Helpers\Helper;
|
use App\Helpers\Helper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to Asset Maintenance for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v2.0
|
||||||
|
*/
|
||||||
class AssetMaintenancesController extends Controller
|
class AssetMaintenancesController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Asset Models for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Image;
|
use Image;
|
||||||
|
@ -30,7 +22,11 @@ use App\Helpers\Helper;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class controls all actions related to asset models
|
* This class controls all actions related to asset models for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
*/
|
*/
|
||||||
class AssetModelsController extends Controller
|
class AssetModelsController extends Controller
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Assets for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Helpers\Helper;
|
use App\Helpers\Helper;
|
||||||
|
@ -50,7 +41,11 @@ use TCPDF;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class controls all actions related to assets
|
* This class controls all actions related to assets for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
*/
|
*/
|
||||||
class AssetsController extends Controller
|
class AssetsController extends Controller
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,18 +15,16 @@ use Redirect;
|
||||||
use Log;
|
use Log;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles authentication for the user, including local
|
||||||
|
* database users and LDAP users.
|
||||||
|
*
|
||||||
|
* @todo Move LDAP methods into user model for better separation of concerns.
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class AuthController extends Controller
|
class AuthController extends Controller
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Registration & Login Controller
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This controller handles the registration of new users, as well as the
|
|
||||||
| authentication of existing users. By default, this controller uses
|
|
||||||
| a simple trait to add these behaviors. Why don't you explore it?
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
use ThrottlesLogins;
|
use ThrottlesLogins;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,14 @@ namespace App\Http\Controllers\Auth;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles password resets for the user.
|
||||||
|
* It uses the built-in Laravel magic of ResetsPasswords, so we
|
||||||
|
* don't actually do much here.
|
||||||
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class PasswordController extends Controller
|
class PasswordController extends Controller
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Asset Categories for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Helpers\Helper;
|
use App\Helpers\Helper;
|
||||||
|
@ -21,6 +13,13 @@ use Redirect;
|
||||||
use Str;
|
use Str;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class controls all actions related to Categories for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
|
*/
|
||||||
class CategoriesController extends Controller
|
class CategoriesController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Company support for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v2.0
|
|
||||||
*/
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
|
@ -15,6 +7,13 @@ use Lang;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to Companies for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
|
|
||||||
final class CompaniesController extends Controller
|
final class CompaniesController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Components for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v3.0
|
|
||||||
*/
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Helpers\Helper;
|
use App\Helpers\Helper;
|
||||||
|
@ -28,6 +20,12 @@ use Slack;
|
||||||
use Str;
|
use Str;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class controls all actions related to Components for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class ComponentsController extends Controller
|
class ComponentsController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,12 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Consumables for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.8
|
|
||||||
*/
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Helpers\Helper;
|
use App\Helpers\Helper;
|
||||||
|
@ -26,6 +19,12 @@ use Slack;
|
||||||
use Str;
|
use Str;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to Consumables for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class ConsumablesController extends Controller
|
class ConsumablesController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
|
/*! \mainpage Snipe-IT Code Documentation
|
||||||
|
*
|
||||||
|
* \section intro_sec Introduction
|
||||||
|
*
|
||||||
|
* This documentation is designed to allow developers to easily understand
|
||||||
|
* the backend code of Snipe-IT. Familiarity with the PHP language is assumed,
|
||||||
|
* and experience with the Laravel framework (version 5.2) will be very helpful.
|
||||||
|
*
|
||||||
|
* **THIS DOCUMENTATION DOES NOT COVER INSTALLATION.** If you're here and you're not a
|
||||||
|
* developer, you're probably in the wrong place. Please see the
|
||||||
|
* [Installation documentation](http://docs.snipeitapp.com) for
|
||||||
|
* information on how to install Snipe-IT.
|
||||||
|
*
|
||||||
|
* To learn how to set up a development environment and get started developing for Snipe-IT,
|
||||||
|
* please see the [contributing documentation](http://docs.snipeitapp.com/contributing.html).
|
||||||
|
*
|
||||||
|
* Only the Snipe-IT specific controllers, models, helpers, service providers,
|
||||||
|
* etc have been included in this documentation (excluding vendors, Laravel core, etc)
|
||||||
|
* for simplicity.
|
||||||
|
*/
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Auth;
|
use Auth;
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Custom Asset Fields for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v2.0
|
|
||||||
*/
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use View;
|
use View;
|
||||||
|
@ -19,13 +11,25 @@ use App\Models\AssetModel;
|
||||||
use Lang;
|
use Lang;
|
||||||
use Auth;
|
use Auth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to Custom Asset Fields for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @todo Improve documentation here.
|
||||||
|
* @todo Check for raw DB queries and try to convert them to query builder statements
|
||||||
|
* @version v2.0
|
||||||
|
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||||
|
*/
|
||||||
|
|
||||||
class CustomFieldsController extends Controller
|
class CustomFieldsController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Returns a view with a listing of custom fields.
|
||||||
*
|
*
|
||||||
* @return Response
|
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||||
|
* @since [v1.8]
|
||||||
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
@ -39,9 +43,11 @@ class CustomFieldsController extends Controller
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the form for creating a new resource.
|
* Returns a view with a form for creating a new custom fieldset.
|
||||||
*
|
*
|
||||||
* @return Response
|
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||||
|
* @since [v1.8]
|
||||||
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
|
@ -51,9 +57,11 @@ class CustomFieldsController extends Controller
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Validates and stores a new custom fieldset.
|
||||||
*
|
*
|
||||||
* @return Response
|
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||||
|
* @since [v1.8]
|
||||||
|
* @return Redirect
|
||||||
*/
|
*/
|
||||||
public function store()
|
public function store()
|
||||||
{
|
{
|
||||||
|
@ -68,6 +76,13 @@ class CustomFieldsController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Associate the custom field with a custom fieldset.
|
||||||
|
*
|
||||||
|
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||||
|
* @since [v1.8]
|
||||||
|
* @return View
|
||||||
|
*/
|
||||||
public function associate($id)
|
public function associate($id)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -84,11 +99,29 @@ class CustomFieldsController extends Controller
|
||||||
return Redirect::route("admin.custom_fields.show", [$id])->with("success", Lang::get('admin/custom_fields/message.field.create.assoc_success'));
|
return Redirect::route("admin.custom_fields.show", [$id])->with("success", Lang::get('admin/custom_fields/message.field.create.assoc_success'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a view with a form to create a new custom field.
|
||||||
|
*
|
||||||
|
* @see CustomFieldsController::storeField()
|
||||||
|
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||||
|
* @since [v1.8]
|
||||||
|
* @return View
|
||||||
|
*/
|
||||||
public function createField()
|
public function createField()
|
||||||
{
|
{
|
||||||
return View::make("custom_fields.create_field");
|
return View::make("custom_fields.create_field");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates and stores a new custom field.
|
||||||
|
*
|
||||||
|
* @see CustomFieldsController::createField()
|
||||||
|
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||||
|
* @since [v1.8]
|
||||||
|
* @return Redirect
|
||||||
|
*/
|
||||||
public function storeField()
|
public function storeField()
|
||||||
{
|
{
|
||||||
$field=new CustomField(["name" => Input::get("name"),"element" => Input::get("element"),"user_id" => Auth::user()->id]);
|
$field=new CustomField(["name" => Input::get("name"),"element" => Input::get("element"),"user_id" => Auth::user()->id]);
|
||||||
|
@ -114,6 +147,13 @@ class CustomFieldsController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a custom field.
|
||||||
|
*
|
||||||
|
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||||
|
* @since [v1.8]
|
||||||
|
* @return Redirect
|
||||||
|
*/
|
||||||
public function deleteField($field_id)
|
public function deleteField($field_id)
|
||||||
{
|
{
|
||||||
$field=CustomField::find($field_id);
|
$field=CustomField::find($field_id);
|
||||||
|
@ -127,10 +167,12 @@ class CustomFieldsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Validates and stores a new custom field.
|
||||||
*
|
*
|
||||||
|
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @return Response
|
* @since [v1.8]
|
||||||
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
|
@ -158,10 +200,13 @@ class CustomFieldsController extends Controller
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the form for editing the specified resource.
|
* What the actual fuck, Brady?
|
||||||
*
|
*
|
||||||
|
* @todo Uhh, build this?
|
||||||
|
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @return Response
|
* @since [v1.8]
|
||||||
|
* @return Fuckall
|
||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
|
@ -170,10 +215,13 @@ class CustomFieldsController extends Controller
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* GET IN THE SEA BRADY.
|
||||||
*
|
*
|
||||||
|
* @todo Uhh, build this too?
|
||||||
|
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @return Response
|
* @since [v1.8]
|
||||||
|
* @return Fuckall
|
||||||
*/
|
*/
|
||||||
public function update($id)
|
public function update($id)
|
||||||
{
|
{
|
||||||
|
@ -182,10 +230,12 @@ class CustomFieldsController extends Controller
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove the specified resource from storage.
|
* Validates a custom fieldset and then deletes if it has no models associated.
|
||||||
*
|
*
|
||||||
|
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @return Response
|
* @since [v1.8]
|
||||||
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to the admin dashboard
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Http\Controllers\AdminController;
|
use App\Http\Controllers\AdminController;
|
||||||
|
@ -17,11 +9,20 @@ use Redirect;
|
||||||
use App\Models\Asset;
|
use App\Models\Asset;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to the Admin Dashboard
|
||||||
|
* for the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class DashboardController extends Controller
|
class DashboardController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show the administration dashboard page.
|
* Check authorization and display admin dashboard, otherwise display
|
||||||
|
* the user's checked-out assets.
|
||||||
*
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
|
* @since [v1.0]
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function getIndex()
|
public function getIndex()
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Asset Depreciation
|
|
||||||
* for the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Input;
|
use Input;
|
||||||
|
@ -19,14 +11,23 @@ use Str;
|
||||||
use View;
|
use View;
|
||||||
use Auth;
|
use Auth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to Depreciations for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class DepreciationsController extends Controller
|
class DepreciationsController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show a list of all the depreciations.
|
* Returns a view that invokes the ajax tables which actually contains
|
||||||
|
* the content for the depreciation listing, which is generated in getDatatable.
|
||||||
*
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @see DepreciationsController::getDatatable() method that generates the JSON response
|
||||||
|
* @since [v1.0]
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function getIndex()
|
public function getIndex()
|
||||||
{
|
{
|
||||||
// Show the page
|
// Show the page
|
||||||
|
@ -35,8 +36,11 @@ class DepreciationsController extends Controller
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Depreciation create.
|
* Returns a view that displays a form to create a new depreciation.
|
||||||
*
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @see DepreciationsController::postCreate()
|
||||||
|
* @since [v1.0]
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function getCreate()
|
public function getCreate()
|
||||||
|
@ -48,8 +52,11 @@ class DepreciationsController extends Controller
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Depreciation create form processing.
|
* Validates and stores the new depreciation data.
|
||||||
*
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @see DepreciationsController::postCreate()
|
||||||
|
* @since [v1.0]
|
||||||
* @return Redirect
|
* @return Redirect
|
||||||
*/
|
*/
|
||||||
public function postCreate()
|
public function postCreate()
|
||||||
|
@ -77,9 +84,12 @@ class DepreciationsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Depreciation update.
|
* Returns a view that displays a form to update a depreciation.
|
||||||
*
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @see DepreciationsController::postEdit()
|
||||||
* @param int $depreciationId
|
* @param int $depreciationId
|
||||||
|
* @since [v1.0]
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function getEdit($depreciationId = null)
|
public function getEdit($depreciationId = null)
|
||||||
|
@ -99,9 +109,12 @@ class DepreciationsController extends Controller
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Depreciation update form processing page.
|
* Validates and stores the updated depreciation data.
|
||||||
*
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @see DepreciationsController::getEdit()
|
||||||
* @param int $depreciationId
|
* @param int $depreciationId
|
||||||
|
* @since [v1.0]
|
||||||
* @return Redirect
|
* @return Redirect
|
||||||
*/
|
*/
|
||||||
public function postEdit($depreciationId = null)
|
public function postEdit($depreciationId = null)
|
||||||
|
@ -128,9 +141,12 @@ class DepreciationsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the given depreciation.
|
* Validates and deletes a selected depreciation.
|
||||||
*
|
*
|
||||||
* @param int $depreciationId
|
* This is a hard-delete. We do not currently soft-delete depreciations.
|
||||||
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @since [v1.0]
|
||||||
* @return Redirect
|
* @return Redirect
|
||||||
*/
|
*/
|
||||||
public function getDelete($depreciationId)
|
public function getDelete($depreciationId)
|
||||||
|
@ -156,6 +172,15 @@ class DepreciationsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates the JSON used to display the depreciation listing.
|
||||||
|
*
|
||||||
|
* @see DepreciationsController::getIndex()
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
|
* @param string $status
|
||||||
|
* @since [v1.2]
|
||||||
|
* @return String JSON
|
||||||
|
*/
|
||||||
public function getDatatable()
|
public function getDatatable()
|
||||||
{
|
{
|
||||||
$depreciations = Depreciation::select(array('id','name','months'));
|
$depreciations = Depreciation::select(array('id','name','months'));
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to User Groups for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Config;
|
use Config;
|
||||||
|
@ -18,11 +10,21 @@ use Validator;
|
||||||
use View;
|
use View;
|
||||||
use App\Models\Group;
|
use App\Models\Group;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to User Groups for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class GroupsController extends Controller
|
class GroupsController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show a list of all the groups.
|
* Returns a view that invokes the ajax tables which actually contains
|
||||||
|
* the content for the user group listing, which is generated in getDatatable.
|
||||||
*
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @see GroupsController::getDatatable() method that generates the JSON response
|
||||||
|
* @since [v1.0]
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function getIndex()
|
public function getIndex()
|
||||||
|
@ -32,8 +34,11 @@ class GroupsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Group create.
|
* Returns a view that displays a form to create a new User Group.
|
||||||
*
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @see GroupsController::postCreate()
|
||||||
|
* @since [v1.0]
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function getCreate()
|
public function getCreate()
|
||||||
|
@ -50,8 +55,11 @@ class GroupsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Group create form processing.
|
* Validates and stores the new User Group data.
|
||||||
*
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @see GroupsController::getCreate()
|
||||||
|
* @since [v1.0]
|
||||||
* @return Redirect
|
* @return Redirect
|
||||||
*/
|
*/
|
||||||
public function postCreate()
|
public function postCreate()
|
||||||
|
@ -73,9 +81,12 @@ class GroupsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Group update.
|
* Returns a view that presents a form to edit a User Group.
|
||||||
*
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @see GroupsController::postEdit()
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @since [v1.0]
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function getEdit($id = null)
|
public function getEdit($id = null)
|
||||||
|
@ -90,9 +101,12 @@ class GroupsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Group update form processing page.
|
* Validates and stores the updated User Group data.
|
||||||
*
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @see GroupsController::getEdit()
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @since [v1.0]
|
||||||
* @return Redirect
|
* @return Redirect
|
||||||
*/
|
*/
|
||||||
public function postEdit($id = null)
|
public function postEdit($id = null)
|
||||||
|
@ -120,9 +134,12 @@ class GroupsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the given group.
|
* Validates and deletes the User Group.
|
||||||
*
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @see GroupsController::getEdit()
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
* @since [v1.0]
|
||||||
* @return Redirect
|
* @return Redirect
|
||||||
*/
|
*/
|
||||||
public function getDelete($id = null)
|
public function getDelete($id = null)
|
||||||
|
@ -147,8 +164,14 @@ class GroupsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
public function getDatatable($status = null)
|
* Generates the JSON used to display the User Group listing.
|
||||||
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
|
* @since [v2.0]
|
||||||
|
* @return String JSON
|
||||||
|
*/
|
||||||
|
public function getDatatable()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Input::has('offset')) {
|
if (Input::has('offset')) {
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Licenses and
|
|
||||||
* License Seats for the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Assets;
|
use Assets;
|
||||||
|
@ -33,6 +24,12 @@ use Session;
|
||||||
use App\Helpers\Helper;
|
use App\Helpers\Helper;
|
||||||
use Auth;
|
use Auth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to Licenses for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class LicensesController extends Controller
|
class LicensesController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Locations for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Input;
|
use Input;
|
||||||
|
@ -20,11 +11,14 @@ use Str;
|
||||||
use Validator;
|
use Validator;
|
||||||
use View;
|
use View;
|
||||||
use Auth;
|
use Auth;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to Locations for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class LocationsController extends Controller
|
class LocationsController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Manufacturers for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
|
@ -19,6 +11,12 @@ use Str;
|
||||||
use View;
|
use View;
|
||||||
use Auth;
|
use Auth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to Manufacturers for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class ManufacturersController extends Controller
|
class ManufacturersController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles user profile editing
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Image;
|
use Image;
|
||||||
|
@ -18,6 +9,12 @@ use View;
|
||||||
use Auth;
|
use Auth;
|
||||||
use App\Helpers\Helper;
|
use App\Helpers\Helper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to User Profiles for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class ProfileController extends Controller
|
class ProfileController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all reporting actions for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\Accessory;
|
use App\Models\Accessory;
|
||||||
|
@ -30,6 +21,12 @@ use Redirect;
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to Reports for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class ReportsController extends Controller
|
class ReportsController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Settings for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Input;
|
use Input;
|
||||||
|
@ -28,7 +19,10 @@ use App\Http\Requests\SetupUserRequest;
|
||||||
use App\Http\Requests\SettingRequest;
|
use App\Http\Requests\SettingRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class controls all actions related to settings
|
* This controller handles all actions related to Settings for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
*/
|
*/
|
||||||
class SettingsController extends Controller
|
class SettingsController extends Controller
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Status Labels for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Input;
|
use Input;
|
||||||
|
@ -23,6 +14,12 @@ use Auth;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to Status Labels for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class StatuslabelsController extends Controller
|
class StatuslabelsController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Suppliers for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Image;
|
use Image;
|
||||||
|
@ -23,6 +14,12 @@ use Auth;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to Suppliers for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class SuppliersController extends Controller
|
class SuppliersController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions related to Users for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Http\Requests\SetupUserRequest;
|
use App\Http\Requests\SetupUserRequest;
|
||||||
|
@ -39,7 +30,10 @@ use URL;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class controls all actions related to users
|
* This controller handles all actions related to Users for
|
||||||
|
* the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
*/
|
*/
|
||||||
class UsersController extends Controller
|
class UsersController extends Controller
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,14 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This controller handles all actions that allow a logged in user
|
|
||||||
* to view the assets assigned to them (and request an asset) for
|
|
||||||
* the Snipe-IT Asset Management application.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\Accessory;
|
use App\Models\Accessory;
|
||||||
|
@ -30,6 +20,12 @@ use Slack;
|
||||||
use Validator;
|
use Validator;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller handles all actions related to the ability for users
|
||||||
|
* to view their own assets in the Snipe-IT Asset Management application.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class ViewAssetsController extends Controller
|
class ViewAssetsController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Watson\Validating\ValidatingTrait;
|
use Watson\Validating\ValidatingTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for Accessories.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class Accessory extends Model
|
class Accessory extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
|
@ -6,6 +6,12 @@ use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for the Actionlog (the table that keeps a historical log of
|
||||||
|
* checkouts, checkins, and updates).
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class Actionlog extends Model implements ICompanyableChild
|
class Actionlog extends Model implements ICompanyableChild
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
|
@ -13,7 +13,11 @@ use Watson\Validating\ValidatingTrait;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for Assets.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class Asset extends Depreciable
|
class Asset extends Depreciable
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
|
@ -6,6 +6,11 @@ use Illuminate\Support\Facades\Lang;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Watson\Validating\ValidatingTrait;
|
use Watson\Validating\ValidatingTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for Asset Maintenances.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class AssetMaintenance extends Model implements ICompanyableChild
|
class AssetMaintenance extends Model implements ICompanyableChild
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
|
@ -5,6 +5,12 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Watson\Validating\ValidatingTrait;
|
use Watson\Validating\ValidatingTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for Asset Models. Asset Models contain higher level
|
||||||
|
* attributes that are common among the same type of asset.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class AssetModel extends Model
|
class AssetModel extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
|
@ -5,6 +5,14 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Watson\Validating\ValidatingTrait;
|
use Watson\Validating\ValidatingTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for Categories. Categories are a higher-level group
|
||||||
|
* than Asset Models, and handle things like whether or not
|
||||||
|
* to require acceptance from the user, whether or not to
|
||||||
|
* send a EULA to the user, etc.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class Category extends Model
|
class Category extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,11 @@ namespace App\Models;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Watson\Validating\ValidatingTrait;
|
use Watson\Validating\ValidatingTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for Companies.
|
||||||
|
*
|
||||||
|
* @version v1.8
|
||||||
|
*/
|
||||||
final class Company extends Model
|
final class Company extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'companies';
|
protected $table = 'companies';
|
||||||
|
|
|
@ -5,6 +5,12 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
use \Illuminate\Database\Eloquent\Builder;
|
use \Illuminate\Database\Eloquent\Builder;
|
||||||
use \Illuminate\Database\Eloquent\Scope;
|
use \Illuminate\Database\Eloquent\Scope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle query scoping for full company support.
|
||||||
|
*
|
||||||
|
* @todo Move this to a more Laravel 5.2 esque way
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
final class CompanyableChildScope implements Scope
|
final class CompanyableChildScope implements Scope
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,6 +5,12 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
use \Illuminate\Database\Eloquent\Builder;
|
use \Illuminate\Database\Eloquent\Builder;
|
||||||
use \Illuminate\Database\Eloquent\Scope;
|
use \Illuminate\Database\Eloquent\Scope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle query scoping for full company support.
|
||||||
|
*
|
||||||
|
* @todo Move this to a more Laravel 5.2 esque way
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
final class CompanyableScope implements Scope
|
final class CompanyableScope implements Scope
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,6 +11,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Watson\Validating\ValidatingTrait;
|
use Watson\Validating\ValidatingTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for Components.
|
||||||
|
*
|
||||||
|
* @version v1.0
|
||||||
|
*/
|
||||||
class Component extends Model
|
class Component extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* This service provider handles a few custom validation rules.
|
|
||||||
*
|
|
||||||
* PHP version 5.5.9
|
|
||||||
* @package Snipe-IT
|
|
||||||
* @version v3.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use Validator;
|
use Validator;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This service provider handles a few custom validation rules.
|
||||||
|
*
|
||||||
|
* PHP version 5.5.9
|
||||||
|
* @version v3.0
|
||||||
|
*/
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue