Compare commits

...

55 Commits

Author SHA1 Message Date
snipe 8dbc098836 Bumped hash for 3.2.0 2016-08-02 15:25:23 -07:00
snipe 45ea44e172 Bumped hash 2016-08-02 15:16:16 -07:00
snipe fff2bce9e4 Added missing username in header row 2016-08-02 15:16:01 -07:00
snipe 75e0c5565c Add username and custom fields option to custom report 2016-08-02 15:04:10 -07:00
snipe 098e7e4feb Hide email address if there is no value 2016-08-02 15:03:45 -07:00
snipe e4355292e4 Bumped hash version 2016-08-02 13:30:00 -07:00
snipe ca8ca89955 Added custom color to status labels, only show status labels if there are results 2016-08-02 13:25:50 -07:00
snipe 30c45442f9 Merge remote-tracking branch 'origin/develop' 2016-08-02 12:40:06 -07:00
snipe 03c2c267bc Added favicon explicit link 2016-08-02 12:39:49 -07:00
snipe a76fe98b2d Only show a logo if a logo is uploaded 2016-08-02 12:34:08 -07:00
snipe 9e43a44d20 Better styling for forgotten password screens 2016-08-02 12:30:22 -07:00
snipe 6fe639f490 Skip email if no email domain is given 2016-08-02 12:30:02 -07:00
snipe a5467ba25d Slug the username to handle spaces, etc. 2016-08-02 11:12:28 -07:00
snipe 1c09479d5f Merge remote-tracking branch 'origin/develop' 2016-08-02 10:34:43 -07:00
snipe 682c75e990 Bumped version 2016-08-02 10:34:30 -07:00
snipe 1612562f41 Create log record and send EULA when creating a new asset that’s checked out 2016-08-02 10:33:44 -07:00
snipe 1b7f28598d Merge remote-tracking branch 'origin/develop' 2016-08-02 09:54:47 -07:00
snipe 17d5e40e02 Fixes #2383 2016-08-02 09:54:31 -07:00
snipe 099a85e26d Merge remote-tracking branch 'origin/develop' 2016-08-02 05:06:29 -07:00
snipe 0e5209e80f Few more dashboard fixes 2016-08-02 05:06:17 -07:00
snipe 95328f0a6a Merge remote-tracking branch 'origin/develop' 2016-08-02 04:46:25 -07:00
snipe cbc42f3e59 Fix for deleted users display 2016-08-02 04:45:48 -07:00
snipe 846356974d Merge remote-tracking branch 'origin/develop' 2016-08-02 04:26:19 -07:00
snipe ef6fb69cee Fix translation 2016-08-02 04:26:07 -07:00
snipe fb1eab0978 Merge remote-tracking branch 'origin/develop' 2016-08-02 04:24:09 -07:00
snipe 39929c7d89 Better handling for deleted users 2016-08-02 04:23:13 -07:00
snipe d6ba0b67f0 Merge remote-tracking branch 'origin/develop' 2016-08-02 03:50:20 -07:00
snipe 66ad0f1d4c Better fix for location LDAP sync 2016-08-02 03:50:08 -07:00
snipe bfac25d445 Merge remote-tracking branch 'origin/develop' 2016-08-02 03:45:17 -07:00
snipe 3b247ba31f Ignore location field if no value is passed 2016-08-02 03:45:03 -07:00
snipe bc3482b281 Merge remote-tracking branch 'origin/develop' 2016-08-02 03:26:53 -07:00
snipe 23e23bab90 Remove display of port number since it’s ignored anyway 2016-08-02 03:26:38 -07:00
snipe 848e3837aa Merge remote-tracking branch 'origin/develop' 2016-08-02 02:36:40 -07:00
Brady Wetherington 1747be4b29 Enable .env file to point to location of CA Cert (#2382) 2016-08-02 02:36:00 -07:00
snipe 565ea95803 Merge remote-tracking branch 'origin/develop' 2016-08-02 02:33:04 -07:00
snipe e7e8c487c9 Bumped version 2016-08-02 02:32:52 -07:00
snipe 5a242433fb Merge remote-tracking branch 'origin/develop' 2016-08-02 02:12:33 -07:00
snipe 6204969639 Fixed requestable link 2016-08-02 02:12:18 -07:00
snipe cde5efd698 Merge remote-tracking branch 'origin/develop' 2016-08-02 01:36:32 -07:00
snipe 283bb4ae4b Fixes #2381 2016-08-02 01:36:14 -07:00
snipe 3d1d248bb5 Merge remote-tracking branch 'origin/develop' 2016-08-02 01:26:51 -07:00
snipe 9c31c0edce Ignore uploaded barcodes 2016-08-02 01:26:44 -07:00
snipe 39450c1fe9 Eager load throttle query 2016-08-02 01:23:53 -07:00
snipe 64ffd261fc Bumped version 2016-08-02 01:14:11 -07:00
snipe de17da099f Fixed tests 2016-08-02 01:12:58 -07:00
snipe 886a31190c Fixed route 2016-08-02 01:08:37 -07:00
snipe 8246a319a2 Fixes #2363 and #1097 2016-08-02 00:54:38 -07:00
snipe 27adeb427e Generate barcodes locally and try to serve them if they exist 2016-08-01 22:56:28 -07:00
snipe bfc18c758a Removed console message from JS 2016-08-01 21:43:56 -07:00
snipe 735595be07 Typeahead library
(not implemented yet)
2016-08-01 21:43:01 -07:00
snipe 27dee1b793 Removed comment 2016-08-01 20:15:25 -07:00
snipe cdeccb399f Hide extra options if superadmin is checked 2016-08-01 20:11:54 -07:00
snipe 2f679ccc29 Merge remote-tracking branch 'origin/develop' 2016-08-01 18:44:32 -07:00
snipe eac6abe60a Fixes #2378 - disallow admins to create/edit superadmins
Also disables admins from being able to edit groups, since that can grant superadmin access.
2016-08-01 18:43:11 -07:00
Daniel Meltzer c9d3cd724b Fix installer again (#2370)
I hate bash... anyone else want to maintain this? :)
2016-08-01 11:08:46 -07:00
53 changed files with 824 additions and 275 deletions
+1
View File
@@ -15,6 +15,7 @@ Homestead.yaml
output
phpDocumentor.phar
public/uploads/*.gif
public/uploads/barcodes/*.png
public/uploads/*.jpg
public/uploads/*.png
public/uploads/*.svg
+6 -1
View File
@@ -660,7 +660,12 @@ class ObjectImportCommand extends Command
$last_name = $user_email_array['last_name'];
if ($user_email=='') {
$user_email = $user_email_array['username'].'@'.Setting::getSettings()->email_domain;
if (Setting::getSettings()->email_domain) {
$user_email = str_slug($user_email_array['username']).'@'.Setting::getSettings()->email_domain;
} else {
$user_email = '';
}
}
if ($user_username=='') {
+28 -3
View File
@@ -19,6 +19,7 @@ use Str;
use View;
use Auth;
use Request;
use Gate;
/** This controller handles all actions related to Accessories for
* the Snipe-IT Asset Management application.
@@ -591,7 +592,21 @@ class AccessoriesController extends Controller
$rows = array();
foreach ($accessories as $accessory) {
$actions = '<nobr><a href="'.route('checkout/accessory', $accessory->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($accessory->numRemaining() > 0 ) ? '' : ' disabled').'>'.trans('general.checkout').'</a><a href="'.route('update/accessory', $accessory->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/accessory', $accessory->id).'" data-content="'.trans('admin/accessories/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($accessory->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
$actions = '<nobr>';
if (Gate::allows('accessories.checkout')) {
$actions .= '<a href="' . route('checkout/accessory',
$accessory->id) . '" style="margin-right:5px;" class="btn btn-info btn-sm" ' . (($accessory->numRemaining() > 0) ? '' : ' disabled') . '>' . trans('general.checkout') . '</a>';
}
if (Gate::allows('accessories.edit')) {
$actions .= '<a href="' . route('update/accessory',
$accessory->id) . '" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a>';
}
if (Gate::allows('accessories.delete')) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/accessory',
$accessory->id) . '" data-content="' . trans('admin/accessories/message.delete.confirm') . '" data-title="' . trans('general.delete') . ' ' . htmlspecialchars($accessory->name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
}
$actions .= '</nobr>';
$company = $accessory->company;
$rows[] = array(
@@ -654,10 +669,20 @@ class AccessoriesController extends Controller
$rows = array();
foreach ($accessory_users as $user) {
$actions = '<a href="'.route('checkin/accessory', $user->pivot->id).'" class="btn btn-info btn-sm">Checkin</a>';
$actions = '';
if (Gate::allows('accessories.checkin')) {
$actions .= '<a href="' . route('checkin/accessory',
$user->pivot->id) . '" class="btn btn-info btn-sm">Checkin</a>';
}
if (Gate::allows('users.view')) {
$name = (string) link_to('/admin/users/'.$user->id.'/view', e($user->fullName()));
} else {
$name = e($user->fullName());
}
$rows[] = array(
'name' =>(string) link_to('/admin/users/'.$user->id.'/view', e($user->fullName())),
'name' => $name,
'actions' => $actions
);
}
+46 -19
View File
@@ -40,6 +40,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use TCPDF;
use View;
use Carbon\Carbon;
use Gate;
/**
* This class controls all actions related to assets for
@@ -264,13 +265,8 @@ class AssetsController extends Controller
if ($asset->save()) {
if (Input::get('assigned_to')!='') {
$logaction = new Actionlog();
$logaction->asset_id = $asset->id;
$logaction->checkedout_to = $asset->assigned_to;
$logaction->asset_type = 'hardware';
$logaction->user_id = Auth::user()->id;
$logaction->note = e(Input::get('note'));
$log = $logaction->logaction('checkout');
$user = User::find(e(Input::get('assigned_to')));
$asset->checkOutToUser($user, Auth::user(), date('Y-m-d h:i:s'), '', 'Checked out on asset creation', e(Input::get('name')));
}
// Redirect to the asset listing page
\Session::flash('success', trans('admin/hardware/message.create.success'));
@@ -357,7 +353,7 @@ class AssetsController extends Controller
}
if ($request->has('purchase_cost')) {
$asset->purchase_cost = e($request->input('purchase_cost'));
$asset->purchase_cost = e(number_format($request->input('purchase_cost'), 2, '.', ''));
} else {
$asset->purchase_cost = null;
}
@@ -761,14 +757,20 @@ class AssetsController extends Controller
if ($settings->qr_code == '1') {
$asset = Asset::find($assetId);
$size = Helper::barcodeDimensions($settings->barcode_type);
$qr_file = public_path().'/uploads/barcodes/qr-'.str_slug($asset->asset_tag).'.png';
if (isset($asset->id,$asset->asset_tag)) {
$barcode = new \Com\Tecnick\Barcode\Barcode();
$barcode_obj = $barcode->getBarcodeObj($settings->barcode_type, route('view/hardware', $asset->id), $size['height'], $size['width'], 'black', array(-2, -2, -2, -2));
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
if (file_exists($qr_file)) {
$header = ['Content-type' => 'image/png'];
return response()->file($qr_file, $header);
} else {
$barcode = new \Com\Tecnick\Barcode\Barcode();
$barcode_obj = $barcode->getBarcodeObj($settings->barcode_type, route('view/hardware', $asset->id), $size['height'], $size['width'], 'black', array(-2, -2, -2, -2));
file_put_contents($qr_file,$barcode_obj->getPngData());
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
}
}
}
@@ -788,12 +790,20 @@ class AssetsController extends Controller
$settings = Setting::getSettings();
$asset = Asset::find($assetId);
$barcode_file = public_path().'/uploads/barcodes/'.str_slug($settings->alt_barcode).'-'.str_slug($asset->asset_tag).'.png';
if (isset($asset->id,$asset->asset_tag)) {
$barcode = new \Com\Tecnick\Barcode\Barcode();
$barcode_obj = $barcode->getBarcodeObj($settings->alt_barcode, $asset->asset_tag, 250, 20);
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
if (file_exists($barcode_file)) {
$header = ['Content-type' => 'image/png'];
return response()->file($barcode_file, $header);
} else {
$barcode = new \Com\Tecnick\Barcode\Barcode();
$barcode_obj = $barcode->getBarcodeObj($settings->alt_barcode, $asset->asset_tag, 250, 20);
file_put_contents($barcode_file,$barcode_obj->getPngData());
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
}
}
}
@@ -1533,7 +1543,18 @@ class AssetsController extends Controller
$inout = '';
$actions = '';
if ($asset->deleted_at=='') {
$actions = '<div style=" white-space: nowrap;"><a href="'.route('clone/hardware', $asset->id).'" class="btn btn-info btn-sm" title="Clone asset" data-toggle="tooltip"><i class="fa fa-clone"></i></a> <a href="'.route('update/hardware', $asset->id).'" class="btn btn-warning btn-sm" title="Edit asset" data-toggle="tooltip"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $asset->id).'" data-content="'.trans('admin/hardware/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($asset->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
if (Gate::allows('assets.create')) {
$actions = '<div style=" white-space: nowrap;"><a href="' . route('clone/hardware',
$asset->id) . '" class="btn btn-info btn-sm" title="Clone asset" data-toggle="tooltip"><i class="fa fa-clone"></i>';
}
if (Gate::allows('assets.edit')) {
$actions .= '</a> <a href="' . route('update/hardware',
$asset->id) . '" class="btn btn-warning btn-sm" title="Edit asset" data-toggle="tooltip"><i class="fa fa-pencil icon-white"></i></a> ';
}
if (Gate::allows('assets.delete')) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/hardware',
$asset->id) . '" data-content="' . trans('admin/hardware/message.delete.confirm') . '" data-title="' . trans('general.delete') . ' ' . htmlspecialchars($asset->asset_tag) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
}
} elseif ($asset->model->deleted_at=='') {
$actions = '<a href="'.route('restore/hardware', $asset->id).'" title="Restore asset" data-toggle="tooltip" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
}
@@ -1541,9 +1562,15 @@ class AssetsController extends Controller
if ($asset->assetstatus) {
if (($asset->assetstatus->deployable != 0) && ($asset->deleted_at=='')) {
if (($asset->assigned_to !='') && ($asset->assigned_to > 0)) {
$inout = '<a href="'.route('checkin/hardware', $asset->id).'" class="btn btn-primary btn-sm" title="Checkin this asset" data-toggle="tooltip">'.trans('general.checkin').'</a>';
if (Gate::allows('assets.checkin')) {
$inout = '<a href="' . route('checkin/hardware',
$asset->id) . '" class="btn btn-primary btn-sm" title="Checkin this asset" data-toggle="tooltip">' . trans('general.checkin') . '</a>';
}
} else {
$inout = '<a href="'.route('checkout/hardware', $asset->id).'" class="btn btn-info btn-sm" title="Checkout this asset to a user" data-toggle="tooltip">'.trans('general.checkout').'</a>';
if (Gate::allows('assets.checkout')) {
$inout = '<a href="' . route('checkout/hardware',
$asset->id) . '" class="btn btn-info btn-sm" title="Checkout this asset to a user" data-toggle="tooltip">' . trans('general.checkout') . '</a>';
}
}
}
}
+18 -1
View File
@@ -20,6 +20,7 @@ use Str;
use View;
use Validator;
use Illuminate\Http\Request;
use Gate;
/**
* This class controls all actions related to Components for
@@ -454,7 +455,23 @@ class ComponentsController extends Controller
$rows = array();
foreach ($components as $component) {
$actions = '<nobr><a href="'.route('checkout/component', $component->id).'" style="margin-right:5px;" class="btn btn-info btn-sm '.(($component->numRemaining() > 0 ) ? '' : ' disabled').'" '.(($component->numRemaining() > 0 ) ? '' : ' disabled').'>'.trans('general.checkout').'</a><a href="'.route('update/component', $component->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/component', $component->id).'" data-content="'.trans('admin/components/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($component->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
$actions = '<nobr>';
if (Gate::allows('components.checkout')) {
$actions .= '<a href="' . route('checkout/component',
$component->id) . '" style="margin-right:5px;" class="btn btn-info btn-sm ' . (($component->numRemaining() > 0) ? '' : ' disabled') . '" ' . (($component->numRemaining() > 0) ? '' : ' disabled') . '>' . trans('general.checkout') . '</a>';
}
if (Gate::allows('components.edit')) {
$actions .= '<a href="' . route('update/component',
$component->id) . '" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a>';
}
if (Gate::allows('components.delete')) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/component',
$component->id) . '" data-content="' . trans('admin/components/message.delete.confirm') . '" data-title="' . trans('general.delete') . ' ' . htmlspecialchars($component->name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
}
$actions .='</nobr>';
$company = $component->company;
$rows[] = array(
+18 -1
View File
@@ -18,6 +18,7 @@ use Redirect;
use Slack;
use Str;
use View;
use Gate;
/**
* This controller handles all actions related to Consumables for
@@ -444,7 +445,23 @@ class ConsumablesController extends Controller
$rows = array();
foreach ($consumables as $consumable) {
$actions = '<nobr><a href="'.route('checkout/consumable', $consumable->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($consumable->numRemaining() > 0 ) ? '' : ' disabled').'>'.trans('general.checkout').'</a><a href="'.route('update/consumable', $consumable->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/consumable', $consumable->id).'" data-content="'.trans('admin/consumables/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($consumable->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
$actions = '<nobr>';
if (Gate::allows('consumables.checkout')) {
$actions .= '<a href="' . route('checkout/consumable',
$consumable->id) . '" style="margin-right:5px;" class="btn btn-info btn-sm" ' . (($consumable->numRemaining() > 0) ? '' : ' disabled') . '>' . trans('general.checkout') . '</a>';
}
if (Gate::allows('consumables.edit')) {
$actions .= '<a href="' . route('update/consumable',
$consumable->id) . '" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a>';
}
if (Gate::allows('consumables.delete')) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/consumable',
$consumable->id) . '" data-content="' . trans('admin/consumables/message.delete.confirm') . '" data-title="' . trans('general.delete') . ' ' . htmlspecialchars($consumable->name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
}
$actions .='</nobr>';
$company = $consumable->company;
$rows[] = array(
+21 -1
View File
@@ -23,6 +23,7 @@ use Config;
use Session;
use App\Helpers\Helper;
use Auth;
use Gate;
/**
* This controller handles all actions related to Licenses for
@@ -983,7 +984,26 @@ class LicensesController extends Controller
$rows = array();
foreach ($licenses as $license) {
$actions = '<span style="white-space: nowrap;"><a href="'.route('freecheckout/license', $license->id).'" class="btn btn-primary btn-sm'.(($license->remaincount() > 0) ? '' : ' disabled').'" style="margin-right:5px;">'.trans('general.checkout').'</a> <a href="'.route('clone/license', $license->id).'" class="btn btn-info btn-sm" style="margin-right:5px;" title="Clone asset"><i class="fa fa-files-o"></i></a><a href="'.route('update/license', $license->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/license', $license->id).'" data-content="'.trans('admin/licenses/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($license->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></span>';
$actions = '<span style="white-space: nowrap;">';
if (Gate::allows('licenses.checkout')) {
$actions .= '<a href="' . route('freecheckout/license',
$license->id) . '" class="btn btn-primary btn-sm' . (($license->remaincount() > 0) ? '' : ' disabled') . '" style="margin-right:5px;">' . trans('general.checkout') . '</a> ';
}
if (Gate::allows('licenses.create')) {
$actions .= '<a href="' . route('clone/license',
$license->id) . '" class="btn btn-info btn-sm" style="margin-right:5px;" title="Clone asset"><i class="fa fa-files-o"></i></a>';
}
if (Gate::allows('licenses.edit')) {
$actions .= '<a href="' . route('update/license',
$license->id) . '" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a>';
}
if (Gate::allows('licenses.delete')) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/license',
$license->id) . '" data-content="' . trans('admin/licenses/message.delete.confirm') . '" data-title="' . trans('general.delete') . ' ' . htmlspecialchars($license->name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
}
$actions .='</span>';
$rows[] = array(
'id' => $license->id,
+33 -3
View File
@@ -6,7 +6,6 @@ use App\Models\Actionlog;
use App\Models\Asset;
use App\Models\AssetMaintenance;
use Carbon\Carbon;
use Category;
use App\Models\Company;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Log;
@@ -17,6 +16,7 @@ use League\Csv\Reader;
use App\Models\License;
use App\Models\Location;
use App\Models\AssetModel;
use App\Models\CustomField;
use Redirect;
use App\Models\Setting;
use App\Models\User;
@@ -415,8 +415,8 @@ class ReportsController extends Controller
*/
public function getCustomReport()
{
return View::make('reports/custom');
$customfields = CustomField::get();
return View::make('reports/custom')->with('customfields',$customfields);
}
/**
@@ -430,6 +430,7 @@ class ReportsController extends Controller
public function postCustom()
{
$assets = Asset::orderBy('created_at', 'DESC')->get();
$customfields = CustomField::get();
$rows = [ ];
$header = [ ];
@@ -471,6 +472,9 @@ class ReportsController extends Controller
if (e(Input::get('assigned_to')) == '1') {
$header[] = 'Assigned To';
}
if (e(Input::get('username')) == '1') {
$header[] = 'Username';
}
if (e(Input::get('status')) == '1') {
$header[] = 'Status';
}
@@ -484,6 +488,13 @@ class ReportsController extends Controller
$header[] = 'Diff';
}
foreach ($customfields as $customfield) {
if (e(Input::get($customfield->db_column_name())) == '1') {
$header[] = $customfield->name;
}
}
$header = array_map('trim', $header);
$rows[] = implode($header, ',');
@@ -562,6 +573,16 @@ class ReportsController extends Controller
$row[] = ''; // Empty string if unassigned
}
}
if (e(Input::get('username')) == '1') {
if ($asset->assigned_to > 0) {
$user = User::find($asset->assigned_to);
$row[] = '"' .e($user->username). '"';
} else {
$row[] = ''; // Empty string if unassigned
}
}
if (e(Input::get('status')) == '1') {
if (( $asset->status_id == '0' ) && ( $asset->assigned_to == '0' )) {
$row[] = trans('general.ready_to_deploy');
@@ -588,6 +609,15 @@ class ReportsController extends Controller
$row[] = '"' . number_format($depreciation, 2) . '"';
$row[] = '"' . number_format($asset->purchase_cost - $depreciation, 2) . '"';
}
foreach ($customfields as $customfield) {
$column_name = $customfield->db_column_name();
if (e(Input::get($customfield->db_column_name())) == '1') {
$row[] = $asset->$column_name;
}
}
$rows[] = implode($row, ',');
}
@@ -47,23 +47,32 @@ class StatuslabelsController extends Controller
{
$colors = [];
$statuslabels = Statuslabel::get();
$statuslabels = Statuslabel::with('assets')->get();
$labels=[];
$points=[];
$colors=[];
foreach ($statuslabels as $statuslabel) {
$labels[]=$statuslabel->name;
$points[]=$statuslabel->assets()->whereNull('assigned_to')->count();
if ($statuslabel->assets->count() > 0) {
$labels[]=$statuslabel->name;
$points[]=$statuslabel->assets()->whereNull('assigned_to')->count();
if ($statuslabel->color!='') {
$colors[]=$statuslabel->color;
}
}
}
$labels[]='Deployed';
$points[]=Asset::whereNotNull('assigned_to')->count();
$colors_array = array_merge($colors, Helper::chartColors());
$result= [
"labels" => $labels,
"datasets" => [ [
"data" => $points,
"backgroundColor" => Helper::chartColors(),
"hoverBackgroundColor" => Helper::chartColors()
"backgroundColor" => $colors_array,
"hoverBackgroundColor" => $colors_array
]]
];
return $result;
@@ -110,6 +119,7 @@ class StatuslabelsController extends Controller
$statuslabel->deployable = $statustype['deployable'];
$statuslabel->pending = $statustype['pending'];
$statuslabel->archived = $statustype['archived'];
$statuslabel->color = e(Input::get('color'));
// Was the asset created?
@@ -197,6 +207,7 @@ class StatuslabelsController extends Controller
$statuslabel->deployable = $statustype['deployable'];
$statuslabel->pending = $statustype['pending'];
$statuslabel->archived = $statustype['archived'];
$statuslabel->color = e(Input::get('color'));
// Was the asset created?
@@ -247,7 +258,7 @@ class StatuslabelsController extends Controller
public function getDatatable()
{
$statuslabels = Statuslabel::select(array('id','name','deployable','pending','archived'))
$statuslabels = Statuslabel::select(array('id','name','deployable','pending','archived','color'))
->whereNull('deleted_at');
if (Input::has('search')) {
@@ -291,10 +302,18 @@ class StatuslabelsController extends Controller
$actions = '<a href="'.route('update/statuslabel', $statuslabel->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/statuslabel', $statuslabel->id).'" data-content="'.trans('admin/statuslabels/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($statuslabel->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
if ($statuslabel->color!='') {
$color = '<div class="pull-left" style="margin-right: 5px; height: 20px; width: 20px; background-color: '.e($statuslabel->color).'"></div>'.e($statuslabel->color);
} else {
$color = '';
}
$rows[] = array(
'id' => e($statuslabel->id),
'type' => e($label_type),
'name' => e($statuslabel->name),
'color' => $color,
'actions' => $actions
);
}
+30 -27
View File
@@ -876,7 +876,7 @@ class UsersController extends Controller
}
$users = User::select(array('users.id','users.employee_num','users.email','users.username','users.location_id','users.manager_id','users.first_name','users.last_name','users.created_at','users.notes','users.company_id', 'users.deleted_at','users.activated'))
->with('assets', 'accessories', 'consumables', 'licenses', 'manager', 'groups', 'userloc', 'company');
->with('assets', 'accessories', 'consumables', 'licenses', 'manager', 'groups', 'userloc', 'company','throttle');
$users = Company::scopeCompanyables($users);
switch ($status) {
@@ -923,32 +923,39 @@ class UsersController extends Controller
$group_names .= '<a href="' . config('app.url') . '/admin/groups/' . $group->id . '/edit" class="label label-default">' . $group->name . '</a> ';
}
if (Gate::allows('users:edit')) {
if (!is_null($user->deleted_at)) {
$actions .= '<a href="' . route('restore/user',
$user->id) . '" class="btn btn-warning btn-sm"><i class="fa fa-share icon-white"></i></a> ';
if (!is_null($user->deleted_at)) {
if (Gate::allows('users.delete')) {
$actions .= '<a href="' . route('restore/user',
$user->id) . '" class="btn btn-warning btn-sm"><i class="fa fa-share icon-white"></i></a> ';
}
} else {
if ($user->accountStatus() == 'suspended') {
$actions .= '<a href="' . route('unsuspend/user',
$user->id) . '" class="btn btn-default btn-sm"><span class="fa fa-clock-o"></span></a> ';
if (Gate::allows('users.delete')) {
if ($user->accountStatus() == 'suspended') {
$actions .= '<a href="' . route('unsuspend/user',
$user->id) . '" class="btn btn-default btn-sm"><span class="fa fa-clock-o"></span></a> ';
}
}
if (Gate::allows('users.edit')) {
$actions .= '<a href="' . route('update/user',
$user->id) . '" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> ';
$actions .= '<a href="' . route('update/user',
$user->id) . '" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> ';
$actions .= '<a href="' . route('clone/user',
$user->id) . '" class="btn btn-info btn-sm"><i class="fa fa-clone"></i></a>';
if ((Auth::user()->id !== $user->id) && (!config('app.lock_passwords'))) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/user',
$user->id) . '" data-content="Are you sure you wish to delete this user?" data-title="Delete ' . htmlspecialchars($user->first_name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a> ';
$actions .= '<a href="' . route('clone/user',
$user->id) . '" class="btn btn-info btn-sm"><i class="fa fa-clone"></i></a>';
}
if (Gate::allows('users.delete')) {
if ((Auth::user()->id !== $user->id) && (!config('app.lock_passwords'))) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/user',
$user->id) . '" data-content="Are you sure you wish to delete this user?" data-title="Delete ' . htmlspecialchars($user->first_name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a> ';
} else {
$actions .= ' <span class="btn delete-asset btn-danger btn-sm disabled"><i class="fa fa-trash icon-white"></i></span>';
}
} else {
$actions .= ' <span class="btn delete-asset btn-danger btn-sm disabled"><i class="fa fa-trash icon-white"></i></span>';
$actions.='foo';
}
}
}
$actions .= '</nobr>';
$rows[] = array(
@@ -1142,7 +1149,6 @@ class UsersController extends Controller
protected $ldapValidationRules = array(
'firstname' => 'required|string|min:2',
'lastname' => 'required|string|min:2',
'employee_number' => 'string',
'username' => 'required|min:2|unique:users,username',
'email' => 'email|unique:users,email',
@@ -1155,7 +1161,7 @@ class UsersController extends Controller
* @since [v1.8]
* @return Redirect
*/
public function postLDAP()
public function postLDAP(Request $request)
{
ini_set('max_execution_time', 600); //600 seconds = 10 minutes
ini_set('memory_limit', '500M');
@@ -1168,9 +1174,6 @@ class UsersController extends Controller
$ldap_result_emp_num = Setting::getSettings()->ldap_emp_num;
$ldap_result_email = Setting::getSettings()->ldap_email;
$location_id = e(Input::get('location_id'));
try {
$ldapconn = Ldap::connectToLdap();
} catch (\Exception $e) {
@@ -1218,7 +1221,9 @@ class UsersController extends Controller
$user->email = e($item["email"]);
$user->employee_num = e($item["employee_number"]);
$user->activated = 1;
$user->location_id = e($location_id);
if ($request->input('location_id')!='') {
$user->location_id = e($request->input('location_id'));
}
$user->notes = 'Imported from LDAP';
$user->ldap_import = 1;
@@ -1228,9 +1233,7 @@ class UsersController extends Controller
$item["note"] = $item["createorupdate"];
$item["status"]='success';
} else {
//$errors_array = array($user->getErrors());
foreach ($user->getErrors()->getMessages() as $key => $err) {
//echo $user->getErrors();
$errors .='<li>'.$err[0];
}
$item["note"] = $errors;
+183 -94
View File
@@ -184,79 +184,125 @@ Route::group([ 'prefix' => 'api', 'middleware' => 'auth' ], function () {
Route::group(
[ 'prefix' => 'hardware',
'middleware' => ['web',
'auth',
'authorize:assets.view']],
'auth']],
function () {
Route::get('create/{model?}', [
'as' => 'create/hardware',
'middleware' => 'authorize:assets.create',
'uses' => 'AssetsController@getCreate'
]);
Route::post('create', [
'as' => 'savenew/hardware',
'middleware' => 'authorize:assets.create',
'uses' => 'AssetsController@postCreate'
]);
Route::get('{assetId}/edit', [
'as' => 'update/hardware',
'middleware' => 'authorize:assets.edit',
'uses' => 'AssetsController@getEdit'
]);
Route::get('/bytag', [
'as' => 'findbytag/hardware',
'middleware' => 'authorize:assets.view',
'uses' => 'AssetsController@getAssetByTag'
]);
Route::get('{assetId}/clone', [ 'as' => 'clone/hardware', 'uses' => 'AssetsController@getClone' ]);
Route::get('{assetId}/clone', [
'as' => 'clone/hardware',
'middleware' => 'authorize:assets.create',
'uses' => 'AssetsController@getClone'
]);
Route::post('{assetId}/clone', 'AssetsController@postCreate');
Route::get('{assetId}/delete', [ 'as' => 'delete/hardware', 'uses' => 'AssetsController@getDelete' ]);
Route::get(
'{assetId}/checkout',
[ 'as' => 'checkout/hardware', 'uses' => 'AssetsController@getCheckout' ]
);
Route::post('{assetId}/checkout', 'AssetsController@postCheckout');
Route::get(
'{assetId}/checkin/{backto?}',
[ 'as' => 'checkin/hardware', 'uses' => 'AssetsController@getCheckin' ]
);
Route::post('{assetId}/checkin/{backto?}', 'AssetsController@postCheckin');
Route::get('{assetId}/view', [ 'as' => 'view/hardware', 'uses' => 'AssetsController@getView' ]);
Route::get('{assetId}/delete', [
'as' => 'delete/hardware',
'middleware' => 'authorize:assets.delete',
'uses' => 'AssetsController@getDelete'
]);
Route::get('{assetId}/checkout', [
'as' => 'checkout/hardware',
'middleware' => 'authorize:assets.checkout',
'uses' => 'AssetsController@getCheckout'
]);
Route::post('{assetId}/checkout', [
'as' => 'checkout/hardware',
'middleware' => 'authorize:assets.checkout',
'uses' => 'AssetsController@postCheckout'
]);
Route::get('{assetId}/checkin/{backto?}', [
'as' => 'checkin/hardware',
'middleware' => 'authorize:assets.checkin',
'uses' => 'AssetsController@getCheckin'
]);
Route::post('{assetId}/checkin/{backto?}', [
'as' => 'checkin/hardware',
'middleware' => 'authorize:assets.checkin',
'uses' => 'AssetsController@postCheckin'
]);
Route::get('{assetId}/view', [
'as' => 'view/hardware',
'middleware' => ['authorize:assets.view'],
'uses' => 'AssetsController@getView'
]);
Route::get('{assetId}/qr-view', [ 'as' => 'qr-view/hardware', 'uses' => 'AssetsController@getView' ]);
Route::get('{assetId}/qr_code', [ 'as' => 'qr_code/hardware', 'uses' => 'AssetsController@getQrCode' ]);
Route::get('{assetId}/barcode', [ 'as' => 'barcode/hardware', 'uses' => 'AssetsController@getBarCode' ]);
Route::get('{assetId}/restore', [ 'as' => 'restore/hardware', 'uses' => 'AssetsController@getRestore' ]);
Route::post('{assetId}/upload', [ 'as' => 'upload/asset', 'uses' => 'AssetsController@postUpload' ]);
Route::get(
'{assetId}/deletefile/{fileId}',
[ 'as' => 'delete/assetfile', 'uses' => 'AssetsController@getDeleteFile' ]
);
Route::get(
'{assetId}/showfile/{fileId}',
[ 'as' => 'show/assetfile', 'uses' => 'AssetsController@displayFile' ]
);
Route::get('{assetId}/restore', [
'as' => 'restore/hardware',
'middleware' => 'authorize:assets.delete',
'uses' => 'AssetsController@getRestore'
]);
Route::post('{assetId}/upload', [
'as' => 'upload/asset',
'middleware' => 'authorize:assets.edit',
'uses' => 'AssetsController@postUpload'
]);
Route::get(
'import/delete-import/{filename}',
[ 'as' => 'assets/import/delete-file', 'uses' => 'AssetsController@getDeleteImportFile' ]
);
Route::get('{assetId}/deletefile/{fileId}', [
'as' => 'delete/assetfile',
'middleware' => 'authorize:assets.edit',
'uses' => 'AssetsController@getDeleteFile'
]);
Route::get(
'import/process/{filename}',
[ 'as' => 'assets/import/process-file', 'uses' => 'AssetsController@getProcessImportFile' ]
);
Route::get('{assetId}/showfile/{fileId}', [
'as' => 'show/assetfile',
'middleware' => 'authorize:assets.view',
'uses' => 'AssetsController@displayFile'
]);
Route::get(
'import',
[ 'as' => 'assets/import', 'uses' => 'AssetsController@getImportUpload' ]
);
Route::get('import/delete-import/{filename}', [
'as' => 'assets/import/delete-file',
'middleware' => 'authorize:assets.create',
'uses' => 'AssetsController@getDeleteImportFile'
]);
Route::get( 'import/process/{filename}', [ 'as' => 'assets/import/process-file',
'middleware' => 'authorize:assets.create',
'uses' => 'AssetsController@getProcessImportFile'
]);
Route::get('import',[
'as' => 'assets/import',
'middleware' => 'authorize:assets.create',
'uses' => 'AssetsController@getImportUpload'
]);
Route::post('{assetId}/edit', 'AssetsController@postEdit');
Route::post('{assetId}/edit',[
'as' => 'assets/import',
'middleware' => 'authorize:assets.edit',
'uses' => 'AssetsController@postEdit'
]);
Route::post(
'bulkedit',
[
'as' => 'hardware/bulkedit',
'middleware' => 'authorize:assets.edit',
'uses' => 'AssetsController@postBulkEdit'
]
);
@@ -264,6 +310,7 @@ Route::group(
'bulkdelete',
[
'as' => 'hardware/bulkdelete',
'middleware' => 'authorize:assets.delete',
'uses' => 'AssetsController@postBulkDelete'
]
);
@@ -271,16 +318,22 @@ Route::group(
'bulksave',
[
'as' => 'hardware/bulksave',
'middleware' => 'authorize:assets.edit',
'uses' => 'AssetsController@postBulkSave'
]
);
# Bulk checkout / checkin
Route::get(
'bulkcheckout',
[ 'as' => 'hardware/bulkcheckout', 'uses' => 'AssetsController@getBulkCheckout' ]
);
Route::post('bulkcheckout', 'AssetsController@postBulkCheckout');
Route::get( 'bulkcheckout', [
'as' => 'hardware/bulkcheckout',
'middleware' => 'authorize:assets.checkout',
'uses' => 'AssetsController@getBulkCheckout'
]);
Route::post( 'bulkcheckout', [
'as' => 'hardware/bulkcheckout',
'middleware' => 'authorize:assets.checkout',
'uses' => 'AssetsController@postBulkCheckout'
]);
# Asset Model Management
Route::group([ 'prefix' => 'models', 'middleware' => 'auth' ], function () {
@@ -300,6 +353,7 @@ Route::group(
Route::get('/', [
'as' => 'hardware',
'middleware' => 'authorize:assets.view',
'uses' => 'AssetsController@getIndex'
]);
@@ -320,41 +374,57 @@ Route::group([ 'prefix' => 'admin','middleware' => ['web','auth']], function ()
# Licenses
Route::group([ 'prefix' => 'licenses', 'middleware'=>'authorize:licenses.view' ], function () {
Route::get('create', [ 'as' => 'create/licenses', 'uses' => 'LicensesController@getCreate' ]);
Route::post('create', 'LicensesController@postCreate');
Route::get('{licenseId}/edit', [ 'as' => 'update/license', 'uses' => 'LicensesController@getEdit' ]);
Route::post('{licenseId}/edit', 'LicensesController@postEdit');
Route::get('{licenseId}/clone', [ 'as' => 'clone/license', 'uses' => 'LicensesController@getClone' ]);
Route::post('{licenseId}/clone', 'LicensesController@postCreate');
Route::get('{licenseId}/delete', [ 'as' => 'delete/license', 'uses' => 'LicensesController@getDelete' ]);
Route::get(
'{licenseId}/freecheckout',
[ 'as' => 'freecheckout/license', 'uses' => 'LicensesController@getFreeLicense' ]
);
Route::get('create', [ 'as' => 'create/licenses', 'middleware' => 'authorize:licenses.create','uses' => 'LicensesController@getCreate' ]);
Route::post('create', [ 'as' => 'create/licenses', 'middleware' => 'authorize:licenses.create','uses' => 'LicensesController@postCreate' ]);
Route::get('{licenseId}/edit', [ 'as' => 'update/license', 'middleware' => 'authorize:licenses.edit', 'uses' => 'LicensesController@getEdit' ]);
Route::post('{licenseId}/edit', [ 'as' => 'update/license', 'middleware' => 'authorize:licenses.edit', 'uses' => 'LicensesController@postEdit' ]);
Route::get('{licenseId}/clone', [ 'as' => 'clone/license', 'middleware' => 'authorize:licenses.create', 'uses' => 'LicensesController@getClone' ]);
Route::post('{licenseId}/clone', [ 'as' => 'clone/license', 'middleware' => 'authorize:licenses.create', 'uses' => 'LicensesController@postCreate' ]);
Route::get('{licenseId}/delete', [ 'as' => 'delete/license', 'middleware' => 'authorize:licenses.delete', 'uses' => 'LicensesController@getDelete' ]);
Route::get('{licenseId}/freecheckout', [
'as' => 'freecheckout/license',
'middleware' => 'authorize:licenses.checkout',
'uses' => 'LicensesController@getFreeLicense'
]);
Route::get(
'{licenseId}/checkout',
[ 'as' => 'checkout/license', 'uses' => 'LicensesController@getCheckout' ]
[ 'as' => 'checkout/license', 'middleware' => 'authorize:licenses.checkout','uses' => 'LicensesController@getCheckout' ]
);
Route::post('{licenseId}/checkout', 'LicensesController@postCheckout');
Route::get(
'{licenseId}/checkin/{backto?}',
[ 'as' => 'checkin/license', 'uses' => 'LicensesController@getCheckin' ]
Route::post(
'{licenseId}/checkout',
[ 'as' => 'checkout/license', 'middleware' => 'authorize:licenses.checkout','uses' => 'LicensesController@postCheckout' ]
);
Route::post('{licenseId}/checkin/{backto?}', 'LicensesController@postCheckin');
Route::get('{licenseId}/view', [ 'as' => 'view/license', 'uses' => 'LicensesController@getView' ]);
Route::get('{licenseId}/checkin/{backto?}', [
'as' => 'checkin/license',
'middleware' => 'authorize:licenses.checkin',
'uses' => 'LicensesController@getCheckin'
]);
Route::post('{licenseId}/checkin/{backto?}', [
'as' => 'checkin/license',
'middleware' => 'authorize:licenses.checkin',
'uses' => 'LicensesController@postCheckin'
]);
Route::get('{licenseId}/view', [
'as' => 'view/license',
'middleware' => 'authorize:licenses.view',
'uses' => 'LicensesController@getView'
]);
Route::post(
'{licenseId}/upload',
[ 'as' => 'upload/license', 'uses' => 'LicensesController@postUpload' ]
[ 'as' => 'upload/license', 'middleware' => 'authorize:licenses.edit','uses' => 'LicensesController@postUpload' ]
);
Route::get(
'{licenseId}/deletefile/{fileId}',
[ 'as' => 'delete/licensefile', 'uses' => 'LicensesController@getDeleteFile' ]
[ 'as' => 'delete/licensefile', 'middleware' => 'authorize:licenses.edit', 'uses' => 'LicensesController@getDeleteFile' ]
);
Route::get(
'{licenseId}/showfile/{fileId}',
[ 'as' => 'show/licensefile', 'uses' => 'LicensesController@displayFile' ]
[ 'as' => 'show/licensefile', 'middleware' => 'authorize:licenses.view','uses' => 'LicensesController@displayFile' ]
);
Route::get('/', [ 'as' => 'licenses', 'uses' => 'LicensesController@getIndex' ]);
Route::get('/', [ 'as' => 'licenses', 'middleware' => 'authorize:licenses.view','uses' => 'LicensesController@getIndex' ]);
});
# Asset Maintenances
@@ -384,84 +454,103 @@ Route::group([ 'prefix' => 'admin','middleware' => ['web','auth']], function ()
# Accessories
Route::group([ 'prefix' => 'accessories', 'middleware'=>'authorize:accessories.view' ], function () {
Route::get('create', [ 'as' => 'create/accessory', 'uses' => 'AccessoriesController@getCreate' ]);
Route::get('create', [ 'as' => 'create/accessory', 'middleware' => 'authorize:accessories.create','uses' => 'AccessoriesController@getCreate' ]);
Route::post('create', 'AccessoriesController@postCreate');
Route::get(
'{accessoryID}/edit',
[ 'as' => 'update/accessory', 'uses' => 'AccessoriesController@getEdit' ]
[ 'as' => 'update/accessory', 'middleware' => 'authorize:accessories.edit','uses' => 'AccessoriesController@getEdit' ]
);
Route::post('{accessoryID}/edit', 'AccessoriesController@postEdit');
Route::get(
'{accessoryID}/delete',
[ 'as' => 'delete/accessory', 'uses' => 'AccessoriesController@getDelete' ]
[ 'as' => 'delete/accessory', 'middleware' => 'authorize:accessories.delete','uses' => 'AccessoriesController@getDelete' ]
);
Route::get('{accessoryID}/view', [ 'as' => 'view/accessory', 'uses' => 'AccessoriesController@getView' ]);
Route::get('{accessoryID}/view', [ 'as' => 'view/accessory', 'middleware' => 'authorize:accessories.view','uses' => 'AccessoriesController@getView' ]);
Route::get(
'{accessoryID}/checkout',
[ 'as' => 'checkout/accessory', 'uses' => 'AccessoriesController@getCheckout' ]
[ 'as' => 'checkout/accessory', 'middleware' => 'authorize:accessories.checkout','uses' => 'AccessoriesController@getCheckout' ]
);
Route::post('{accessoryID}/checkout', 'AccessoriesController@postCheckout');
Route::post(
'{accessoryID}/checkout',
[ 'as' => 'checkout/accessory', 'middleware' => 'authorize:accessories.checkout','uses' => 'AccessoriesController@postCheckout' ]
);
Route::get(
'{accessoryID}/checkin/{backto?}',
[ 'as' => 'checkin/accessory', 'uses' => 'AccessoriesController@getCheckin' ]
[ 'as' => 'checkin/accessory', 'middleware' => 'authorize:accessories.checkin','uses' => 'AccessoriesController@getCheckin' ]
);
Route::post(
'{accessoryID}/checkin/{backto?}',
[ 'as' => 'checkin/accessory', 'middleware' => 'authorize:accessories.checkin','uses' => 'AccessoriesController@postCheckin' ]
);
Route::post('{accessoryID}/checkin/{backto?}', 'AccessoriesController@postCheckin');
Route::get('/', [ 'as' => 'accessories', 'uses' => 'AccessoriesController@getIndex' ]);
Route::get('/', [ 'as' => 'accessories', 'middleware'=>'authorize:accessories.view', 'uses' => 'AccessoriesController@getIndex' ]);
});
# Consumables
Route::group([ 'prefix' => 'consumables', 'middleware'=>'authorize:consumables.view' ], function () {
Route::get('create', [ 'as' => 'create/consumable', 'uses' => 'ConsumablesController@getCreate' ]);
Route::post('create', 'ConsumablesController@postCreate');
Route::get('create', [ 'as' => 'create/consumable','middleware'=>'authorize:consumables.create', 'uses' => 'ConsumablesController@getCreate' ]);
Route::post('create', [ 'as' => 'create/consumable','middleware'=>'authorize:consumables.create', 'uses' => 'ConsumablesController@postCreate' ]);
Route::get(
'{consumableID}/edit',
[ 'as' => 'update/consumable', 'uses' => 'ConsumablesController@getEdit' ]
[ 'as' => 'update/consumable', 'middleware'=>'authorize:consumables.edit', 'uses' => 'ConsumablesController@getEdit' ]
);
Route::post(
'{consumableID}/edit',
[ 'as' => 'update/consumable', 'middleware'=>'authorize:consumables.edit', 'uses' => 'ConsumablesController@postEdit' ]
);
Route::post('{consumableID}/edit', 'ConsumablesController@postEdit');
Route::get(
'{consumableID}/delete',
[ 'as' => 'delete/consumable', 'uses' => 'ConsumablesController@getDelete' ]
[ 'as' => 'delete/consumable', 'middleware'=>'authorize:consumables.delete','uses' => 'ConsumablesController@getDelete' ]
);
Route::get(
'{consumableID}/view',
[ 'as' => 'view/consumable', 'uses' => 'ConsumablesController@getView' ]
[ 'as' => 'view/consumable', 'middleware'=>'authorize:consumables.view','uses' => 'ConsumablesController@getView' ]
);
Route::get(
'{consumableID}/checkout',
[ 'as' => 'checkout/consumable', 'uses' => 'ConsumablesController@getCheckout' ]
[ 'as' => 'checkout/consumable', 'middleware'=>'authorize:consumables.checkout','uses' => 'ConsumablesController@getCheckout' ]
);
Route::post('{consumableID}/checkout', 'ConsumablesController@postCheckout');
Route::get('/', [ 'as' => 'consumables', 'uses' => 'ConsumablesController@getIndex' ]);
Route::post(
'{consumableID}/checkout',
[ 'as' => 'checkout/consumable', 'middleware'=>'authorize:consumables.checkout','uses' => 'ConsumablesController@postCheckout' ]
);
Route::get('/', [ 'as' => 'consumables', 'middleware'=>'authorize:consumables.view','uses' => 'ConsumablesController@getIndex' ]);
});
# Components
Route::group([ 'prefix' => 'components', 'middleware'=>'authorize:components.view' ], function () {
Route::get('create', [ 'as' => 'create/component', 'uses' => 'ComponentsController@getCreate' ]);
Route::post('create', 'ComponentsController@postCreate');
Route::get('create', [ 'as' => 'create/component', 'middleware'=>'authorize:components.create','uses' => 'ComponentsController@getCreate' ]);
Route::post('create', [ 'as' => 'create/component', 'middleware'=>'authorize:components.create','uses' => 'ComponentsController@postCreate' ]);
Route::get(
'{componentID}/edit',
[ 'as' => 'update/component', 'uses' => 'ComponentsController@getEdit' ]
[ 'as' => 'update/component', 'middleware'=>'authorize:components.edit','uses' => 'ComponentsController@getEdit' ]
);
Route::post(
'{componentID}/edit',
[ 'as' => 'update/component', 'middleware'=>'authorize:components.edit','uses' => 'ComponentsController@postEdit' ]
);
Route::post('{componentID}/edit', 'ComponentsController@postEdit');
Route::get(
'{componentID}/delete',
[ 'as' => 'delete/component', 'uses' => 'ComponentsController@getDelete' ]
[ 'as' => 'delete/component', 'middleware'=>'authorize:components.delete','uses' => 'ComponentsController@getDelete' ]
);
Route::get(
'{componentID}/view',
[ 'as' => 'view/component', 'uses' => 'ComponentsController@getView' ]
[ 'as' => 'view/component', 'middleware'=>'authorize:components.view','uses' => 'ComponentsController@getView' ]
);
Route::get(
'{componentID}/checkout',
[ 'as' => 'checkout/component', 'uses' => 'ComponentsController@getCheckout' ]
[ 'as' => 'checkout/component', 'middleware'=>'authorize:components.checkout','uses' => 'ComponentsController@getCheckout' ]
);
Route::post('{componentID}/checkout', 'ComponentsController@postCheckout');
Route::post('bulk', [ 'as' => 'component/bulk-form', 'uses' => 'ComponentsController@postBulk' ]);
Route::post('bulksave', [ 'as' => 'component/bulk-save', 'uses' => 'ComponentsController@postBulkSave' ]);
Route::get('/', [ 'as' => 'components', 'uses' => 'ComponentsController@getIndex' ]);
Route::post(
'{componentID}/checkout',
[ 'as' => 'checkout/component', 'middleware'=>'authorize:components.checkout','uses' => 'ComponentsController@postCheckout' ]
);
Route::post('bulk', [ 'as' => 'component/bulk-form', 'middleware'=>'authorize:components.checkout','uses' => 'ComponentsController@postBulk' ]);
Route::post('bulksave', [ 'as' => 'component/bulk-save', 'middleware'=>'authorize:components.edit','uses' => 'ComponentsController@postBulkSave' ]);
Route::get('/', [ 'as' => 'components', 'middleware'=>'authorize:components.view','uses' => 'ComponentsController@getIndex' ]);
});
# Admin Settings Routes (for categories, maufactureres, etc)
+7
View File
@@ -85,6 +85,13 @@ class Actionlog extends Model implements ICompanyableChild
->withTrashed();
}
public function userasassetlog()
{
return $this->belongsTo('\App\Models\User', 'asset_id')
->withTrashed();
}
public function childlogs()
{
+5
View File
@@ -35,6 +35,11 @@ class Ldap extends Model
putenv('LDAPTLS_REQCERT=never');
}
// If the user specifies where CA Certs are, make sure to use them
if(env("LDAPTLS_CACERT")) {
putenv("LDAPTLS_CACERT=".env("LDAPTLS_CACERT"));
}
$connection = @ldap_connect($ldap_host);
if (!$connection) {
+4 -4
View File
@@ -232,10 +232,10 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
public function accountStatus()
{
if ($this->sentryThrottle) {
if ($this->sentryThrottle->suspended==1) {
if ($this->throttle) {
if ($this->throttle->suspended==1) {
return 'suspended';
} elseif ($this->sentryThrottle->banned==1) {
} elseif ($this->throttle->banned==1) {
return 'banned';
} else {
return false;
@@ -262,7 +262,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
->orderBy('created_at', 'desc');
}
public function sentryThrottle()
public function throttle()
{
return $this->hasOne('\App\Models\Throttle');
}
+35
View File
@@ -91,6 +91,13 @@ class AuthServiceProvider extends ServiceProvider
}
});
// Checks for some level of management
$gate->define('assets.manage', function ($user) {
if (($user->hasAccess('assets.checkin')) || ($user->hasAccess('assets.edit')) || ($user->hasAccess('assets.delete')) || ($user->hasAccess('assets.checkout')) || ($user->hasAccess('admin'))) {
return true;
}
});
# -----------------------------------------
# Accessories
@@ -131,6 +138,13 @@ class AuthServiceProvider extends ServiceProvider
}
});
// Checks for some level of management
$gate->define('accessories.manage', function ($user) {
if (($user->hasAccess('accessories.checkin')) || ($user->hasAccess('accessories.edit')) || ($user->hasAccess('accessories.checkout')) || ($user->hasAccess('admin'))) {
return true;
}
});
# -----------------------------------------
# Consumables
# -----------------------------------------
@@ -170,6 +184,13 @@ class AuthServiceProvider extends ServiceProvider
}
});
// Checks for some level of management
$gate->define('consumables.manage', function ($user) {
if (($user->hasAccess('consumables.checkin')) || ($user->hasAccess('consumables.edit')) || ($user->hasAccess('consumables.delete')) || ($user->hasAccess('consumables.checkout')) || ($user->hasAccess('admin'))) {
return true;
}
});
# -----------------------------------------
@@ -228,6 +249,13 @@ class AuthServiceProvider extends ServiceProvider
}
});
// Checks for some level of management
$gate->define('components.manage', function ($user) {
if (($user->hasAccess('components.edit')) || ($user->hasAccess('components.delete')) || ($user->hasAccess('components.checkout')) || ($user->hasAccess('admin'))) {
return true;
}
});
# -----------------------------------------
# Licenses
@@ -274,6 +302,13 @@ class AuthServiceProvider extends ServiceProvider
}
});
// Checks for some level of management
$gate->define('licenses.manage', function ($user) {
if (($user->hasAccess('licenses.checkin')) || ($user->hasAccess('licenses.edit')) || ($user->hasAccess('licenses.delete')) || ($user->hasAccess('licenses.checkout')) || ($user->hasAccess('admin'))) {
return true;
}
});
}
}
+43 -35
View File
@@ -46,19 +46,19 @@ return array(
'permission' => 'assets.create',
'label' => 'Create ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'assets.edit',
'label' => 'Edit ',
'label' => 'Edit ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'assets.delete',
'label' => 'Delete ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'assets.checkout',
@@ -71,7 +71,14 @@ return array(
'permission' => 'assets.checkin',
'label' => 'Checkin ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'assets.checkout',
'label' => 'Checkout ',
'note' => '',
'display' => true,
),
array(
@@ -88,6 +95,7 @@ return array(
'note' => '',
'display' => true,
),
),
'Accessories' => array(
@@ -101,31 +109,31 @@ return array(
'permission' => 'accessory.create',
'label' => 'Create ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'accessories.edit',
'label' => 'Edit ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'accessories.delete',
'label' => 'Delete ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'accessories.checkout',
'label' => 'Checkout ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'accessories.checkin',
'label' => 'Checkin ',
'note' => '',
'display' => false,
'display' => true,
),
),
@@ -140,25 +148,25 @@ return array(
'permission' => 'consumables.create',
'label' => 'Create ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'consumables.edit',
'label' => 'Edit ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'consumables.delete',
'label' => 'Delete ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'consumables.checkout',
'label' => 'Checkout ',
'note' => '',
'display' => false,
'display' => true,
),
),
@@ -172,27 +180,27 @@ return array(
),
array(
'permission' => 'licenses.create',
'label' => 'Create Licenses',
'label' => 'Create ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'licenses.edit',
'label' => 'Edit Licenses',
'label' => 'Edit ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'licenses.delete',
'label' => 'Delete Licenses',
'label' => 'Delete ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'licenses.checkout',
'label' => 'Checkout Licenses',
'label' => 'Checkout ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'licenses.keys',
@@ -212,33 +220,33 @@ return array(
),
array(
'permission' => 'components.create',
'label' => 'Create Components',
'label' => 'Create ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'components.edit',
'label' => 'Edit Components',
'label' => 'Edit ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'components.delete',
'label' => 'Delete Components',
'label' => 'Delete ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'components.checkout',
'label' => 'Checkout Components',
'label' => 'Checkout ',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'components.checkin',
'label' => 'Checkin Components',
'label' => 'Checkin ',
'note' => '',
'display' => false,
'display' => true,
),
),
@@ -254,19 +262,19 @@ return array(
'permission' => 'users.create',
'label' => 'Create Users',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'users.edit',
'label' => 'Edit Users',
'note' => '',
'display' => false,
'display' => true,
),
array(
'permission' => 'users.delete',
'label' => 'Delete Users',
'note' => '',
'display' => false,
'display' => true,
),
),
+2 -2
View File
@@ -1,5 +1,5 @@
<?php
return array (
'app_version' => 'v3.1',
'hash_version' => 'v3.1-84-g139325d',
'app_version' => 'v3.2.0',
'hash_version' => 'v3.2.0-53-gfff2bce',
);
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddColorToStatuslabel extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('status_labels', function (Blueprint $table) {
$table->string('color', 10)->nullable()->default(NULL);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('status_labels', function ($table) {
$table->dropColumn('color');
});
}
}
+1 -1
View File
@@ -38,7 +38,7 @@ elixir(function(mix) {
mix.version(['assets/css/app.css','assets/js/all.js']);
// mix.codeception();
mix.codeception();
+1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -34248,7 +34248,7 @@ var pieOptions = {
//String - A tooltip template
tooltipTemplate: "<%=value %> <%=label%> "
};
console.dir(pieOptions);
//console.dir(pieOptions);
//Create pie or douhnut chart
// You can switch between pie and douhnut using the method below.
//pieChart.Doughnut(PieData, pieOptions);
File diff suppressed because one or more lines are too long
+11
View File
File diff suppressed because one or more lines are too long
@@ -34248,7 +34248,7 @@ var pieOptions = {
//String - A tooltip template
tooltipTemplate: "<%=value %> <%=label%> "
};
console.dir(pieOptions);
//console.dir(pieOptions);
//Create pie or douhnut chart
// You can switch between pie and douhnut using the method below.
//pieChart.Doughnut(PieData, pieOptions);
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,4 +1,4 @@
{
"assets/css/app.css": "assets/css/app-de75b6d10a.css",
"assets/js/all.js": "assets/js/all-edd914620a.js"
"assets/js/all.js": "assets/js/all-5ba6978224.js"
}
View File
+1 -1
View File
@@ -35,7 +35,7 @@ var pieOptions = {
//String - A tooltip template
tooltipTemplate: "<%=value %> <%=label%> "
};
console.dir(pieOptions);
//console.dir(pieOptions);
//Create pie or douhnut chart
// You can switch between pie and douhnut using the method below.
//pieChart.Doughnut(PieData, pieOptions);
@@ -4,6 +4,7 @@ return array(
'about' => 'About Status Labels',
'archived' => 'Archived',
'create' => 'Create Status Label',
'color' => 'Chart Color',
'deployable' => 'Deployable',
'info' => 'Status labels are used to describe the various states your assets could be in. They may be out for repair, lost/stolen, etc. You can create new status labels for deployable, pending and archived assets.',
'name' => 'Status Name',
+3 -1
View File
@@ -7,7 +7,9 @@
@stop
@section('header_right')
<a href="{{ route('create/accessory') }}" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
@can('accessories.create')
<a href="{{ route('create/accessory') }}" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
@endcan
@stop
{{-- Page content --}}
+23 -13
View File
@@ -10,20 +10,28 @@
{{-- Right header --}}
@section('header_right')
<div class="dropdown pull-right">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dropdownMenu1">
@if ($accessory->assigned_to != '')
<li role="presentation"><a href="{{ route('checkin/accessory', $accessory->id) }}">{{ trans('admin/accessories/general.checkin') }}</a></li>
@else
<li role="presentation"><a href="{{ route('checkout/accessory', $accessory->id) }}">{{ trans('admin/accessories/general.checkout') }}</a></li>
@endif
<li role="presentation"><a href="{{ route('update/accessory', $accessory->id) }}">{{ trans('admin/accessories/general.edit') }}</a></li>
@can('accessories.manage')
<div class="dropdown pull-right">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dropdownMenu1">
@if ($accessory->assigned_to != '')
@can('accessories.checkin')
<li role="presentation"><a href="{{ route('checkin/accessory', $accessory->id) }}">{{ trans('admin/accessories/general.checkin') }}</a></li>
@endcan
@else
@can('accessories.checkout')
<li role="presentation"><a href="{{ route('checkout/accessory', $accessory->id) }}">{{ trans('admin/accessories/general.checkout') }}</a></li>
@endcan
@endif
@can('accessories.edit')
<li role="presentation"><a href="{{ route('update/accessory', $accessory->id) }}">{{ trans('admin/accessories/general.edit') }}</a></li>
@endcan
</ul>
</div>
</ul>
</div>
@endcan
@stop
{{-- Page content --}}
@@ -64,7 +72,9 @@
<h4>{{ trans('admin/accessories/general.about_accessories_title') }}</h4>
<p>{{ trans('admin/accessories/general.about_accessories_text') }} </p>
<div class="text-center">
@can('accessories.checkout')
<a href="{{ route('checkout/accessory', $accessory->id) }}" style="margin-right:5px;" class="btn btn-info btn-sm" {{ (($accessory->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a>
@endcan
</div>
</div>
@@ -12,7 +12,7 @@
<div class="col-md-4 col-md-offset-4">
<div class="box login-box">
<div class="box login-box" style="width: 100%">
<div class="box-header">
<h3 class="box-title"> {{ trans('auth/general.send_password_link') }}</h3>
</div>
@@ -13,7 +13,7 @@
<div class="col-md-4 col-md-offset-4">
<div class="col-md-6 col-md-offset-3">
<div class="box login-box" style="width: 100%">
<div class="box-header">
+3 -1
View File
@@ -7,7 +7,9 @@
@stop
@section('header_right')
<a href="{{ route('create/component') }}" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
@can('components.create')
<a href="{{ route('create/component') }}" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
@endcan
@stop
{{-- Page content --}}
@@ -10,20 +10,28 @@
{{-- Right header --}}
@section('header_right')
@can('components.manage')
<div class="dropdown pull-right">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dropdownMenu1">
@if ($component->assigned_to != '')
@can('components.checkin')
<li role="presentation"><a href="{{ route('checkin/component', $component->id) }}">{{ trans('admin/components/general.checkin') }}</a></li>
@endcan
@else
@can('components.checkout')
<li role="presentation"><a href="{{ route('checkout/component', $component->id) }}">{{ trans('admin/components/general.checkout') }}</a></li>
@endcan
@endif
@can('components.edit')
<li role="presentation"><a href="{{ route('update/component', $component->id) }}">{{ trans('admin/components/general.edit') }}</a></li>
@endcan
</ul>
</div>
@endcan
@stop
+3 -1
View File
@@ -7,7 +7,9 @@
@stop
@section('header_right')
<a href="{{ route('create/consumable') }}" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
@can('consumables.create')
<a href="{{ route('create/consumable') }}" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
@endcan
@stop
{{-- Page content --}}
+19 -10
View File
@@ -24,7 +24,9 @@
<div class="icon">
<i class="fa fa-barcode"></i>
</div>
<a href="{{ route('hardware') }}" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
@can('assets.view')
<a href="{{ route('hardware') }}" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
@endcan
</div>
</div><!-- ./col -->
@@ -38,7 +40,9 @@
<div class="icon">
<i class="fa fa-floppy-o"></i>
</div>
<a href="{{ route('licenses') }}" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
@can('licenses.view')
<a href="{{ route('licenses') }}" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
@endcan
</div>
</div><!-- ./col -->
@@ -52,7 +56,9 @@
<div class="icon">
<i class="fa fa-keyboard-o"></i>
</div>
<a href="{{ route('accessories') }}" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
@can('accessories.view')
<a href="{{ route('accessories') }}" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
@endcan
</div>
</div><!-- ./col -->
@@ -66,7 +72,9 @@
<div class="icon">
<i class="fa fa-tint"></i>
</div>
<a href="{{ route('consumables') }}" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
@can('consumables.view')
<a href="{{ route('consumables') }}" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
@endcan
</div>
</div><!-- ./col -->
@@ -132,7 +140,7 @@
{{ strtolower(trans('general.'.str_replace(' ','_',$activity->action_type))) }}
</td>
<td>
@if (($activity->assetlog) && ($activity->asset_type=="hardware"))
@if (($activity->assetlog) && ($activity->asset_type=="hardware"))
<a href="{{ route('view/hardware', $activity->asset_id) }}">{{ $activity->assetlog->showAssetName() }}</a>
@elseif (($activity->licenselog) && ($activity->asset_type=="software"))
<a href="{{ route('view/license', $activity->asset_id) }}">{{ $activity->licenselog->name }}</a>
@@ -142,16 +150,17 @@
<a href="{{ route('view/accessory', $activity->accessory_id) }}">{{ $activity->accessorylog->name }}</a>
@elseif (($activity->componentlog) && ($activity->asset_type=="component"))
<a href="{{ route('view/component', $activity->component_id) }}">{{ $activity->componentlog->name }}</a>
@elseif (($activity->assetlog) && ($activity->action_type=="uploaded"))
@elseif (($activity->assetlog) && ($activity->action_type=="uploaded") && ($activity->asset_type=="hardware"))
<a href="{{ route('view/hardware', $activity->asset_id) }}">{{ $activity->assetlog->showAssetName() }}</a>
@else
{{ trans('general.bad_data') }}
@endif
</td>
<td>
@if (($activity->componentlog) && ($activity->asset_type=="component"))
@if (($activity->userasassetlog) && ($activity->action_type=="uploaded") && ($activity->asset_type=="user"))
<a href="{{ route('view/user', $activity->asset_id) }}">{{ $activity->userasassetlog->fullName() }}</a>
@elseif (($activity->componentlog) && ($activity->asset_type=="component"))
<a href="{{ route('view/hardware', $activity->asset_id) }}">{{ $activity->assetlog->showAssetName() }}</a>
@elseif($activity->action_type=='requested')
@if ($activity->adminlog)
@@ -179,7 +188,7 @@
<div class="col-md-3">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('general.status') }}</h3>
<h3 class="box-title">{{ trans('general.assets') }}</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
+1 -1
View File
@@ -215,7 +215,7 @@
</span>
<input class="col-md-2 form-control" type="text" name="purchase_cost" id="purchase_cost" value="{{ Input::old('purchase_cost', number_format($asset->purchase_cost,2)) }}" />
<input class="col-md-2 form-control" type="text" name="purchase_cost" id="purchase_cost" value="{{ Input::old('purchase_cost', number_format($asset->purchase_cost,2, '.', '')) }}" />
{!! $errors->first('purchase_cost', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
</div>
</div>
+16 -8
View File
@@ -11,6 +11,7 @@
{{-- Right header --}}
@section('header_right')
@can('assets.manage')
<div class="dropdown pull-right">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
<span class="caret"></span>
@@ -27,6 +28,7 @@
<li role="presentation"><a href="{{ route('clone/hardware', $asset->id) }}">{{ trans('admin/hardware/general.clone') }}</a></li>
</ul>
</div>
@endcan
@stop
@@ -285,7 +287,7 @@
<ul class="list-unstyled">
@if (isset($asset->assigneduser->email))
@if ((isset($asset->assigneduser->email)) && ($asset->assigneduser->email!=''))
<li><i class="fa fa-envelope-o"></i> <a href="mailto:{{ $asset->assigneduser->email }}">{{ $asset->assigneduser->email }}</a></li>
@endif
@@ -474,22 +476,28 @@
<tr>
<td>{{ $log->created_at }}</td>
<td>
@if (isset($log->user_id))
@if (isset($log->adminlog))
{{ $log->adminlog->fullName() }}
@else
Deleted Admin
@endif
</td>
<td>{{ $log->action_type }}</td>
<td>
@if ((isset($log->checkedout_to)) && ($log->checkedout_to!=0) && ($log->checkedout_to!=''))
@if ($log->userlog->deleted_at=='')
@if ($log->userlog)
@if ($log->userlog->deleted_at=='')
<a href="{{ route('view/user', $log->checkedout_to) }}">
{{ $log->userlog->fullName() }}
</a>
@else
<del>{{ $log->userlog->fullName() }}</del>
@endif
@else
<del>{{ $log->userlog->fullName() }}</del>
@endif
@else
Deleted User
@endif
@endif
</td>
<td>
@@ -506,7 +514,7 @@
@if ($asset->adminuser)
{{ $asset->adminuser->fullName() }}
@else
@trans('general.unknown_admin')
{{ trans('general.unknown_admin') }}
@endif
</td>
+24
View File
@@ -33,12 +33,36 @@
<link rel="stylesheet" href="{{ asset('assets/css/bootstrap-table.css') }}">
<link rel="stylesheet" href="{{ elixir('assets/css/app.css') }}">
<link rel="shortcut icon" type="image/ico" href="{{ asset('favicon.ico') }}">
@if (\App\Models\Setting::getSettings()->header_color)
<style>
.main-header .navbar, .main-header .logo {
background-color: {{ \App\Models\Setting::getSettings()->header_color }};
background: -webkit-linear-gradient(top, {{ \App\Models\Setting::getSettings()->header_color }} 0%,{{ \App\Models\Setting::getSettings()->header_color }} 100%);
background: linear-gradient(to bottom, {{ \App\Models\Setting::getSettings()->header_color }} 0%,{{ \App\Models\Setting::getSettings()->header_color }} 100%);
border-color: {{ \App\Models\Setting::getSettings()->header_color }};
}
.skin-blue .sidebar-menu > li:hover > a, .skin-blue .sidebar-menu > li.active > a {
border-left-color: {{ \App\Models\Setting::getSettings()->header_color }};
}
.btn-primary {
background-color: {{ \App\Models\Setting::getSettings()->header_color }};
border-color: {{ \App\Models\Setting::getSettings()->header_color }};
}
</style>
@endif
</head>
<body class="hold-transition login-page">
@if (\App\Models\Setting::getSettings()->logo!='')
<center><img class="logo" style="padding-top: 20px; padding-bottom: 10px;" src="{{ config('app.url') }}/uploads/{{ \App\Models\Setting::getSettings()->logo }}"></center>
@endif
<!-- Content -->
@yield('content')
+17 -2
View File
@@ -32,6 +32,8 @@
<link rel="stylesheet" href="{{ asset(elixir('assets/css/app.css')) }}">
<link rel="shortcut icon" type="image/ico" href="{{ asset('favicon.ico') }}">
<style>
@if (\App\Models\Setting::getSettings()->header_color)
.main-header .navbar, .main-header .logo {
@@ -166,6 +168,7 @@
</div>
</form>
@endcan
@can('admin')
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
@@ -173,36 +176,48 @@
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
@can('assets.create')
<li {!! (Request::is('hardware/create') ? 'class="active>"' : '') !!}>
<a href="{{ route('create/hardware') }}">
<i class="fa fa-barcode fa-fw"></i>
@lang('general.asset')</a>
</li>
@endcan
@can('licenses.create')
<li {!! (Request::is('admin/licenses/create') ? 'class="active"' : '') !!}>
<a href="{{ route('create/licenses') }}">
<i class="fa fa-floppy-o fa-fw"></i>
@lang('general.license')</a>
</li>
@endcan
@can('accessories.create')
<li {!! (Request::is('admin/accessories/create') ? 'class="active"' : '') !!}>
<a href="{{ route('create/accessory') }}">
<i class="fa fa-keyboard-o fa-fw"></i>
@lang('general.accessory')</a>
</li>
@endcan
@can('consumables.create')
<li {!! (Request::is('admin/consumables/create') ? 'class="active"' : '') !!}>
<a href="{{ route('create/consumable') }}">
<i class="fa fa-tint fa-fw"></i>
@lang('general.consumable')</a>
</li>
@endcan
@can('users.create')
<li {!! (Request::is('admin/users/create') ? 'class="active"' : '') !!}>
<a href="{{ route('create/user') }}">
<i class="fa fa-user fa-fw"></i>
@lang('general.user')</a>
</li>
@endcan
@can('components.create')
<li {!! (Request::is('admin/components/create') ? 'class="active"' : '') !!}>
<a href="{{ route('create/component') }}">
<i class="fa fa-hdd-o"></i>
@lang('general.component')</a>
</li>
@endcan
</ul>
</li>
@endcan
@@ -400,8 +415,8 @@
</li>
<li{!! (Request::query('status') == 'Pending' ? ' class="active"' : '') !!}><a href="{{ URL::to('hardware?status=Pending') }}">@lang('general.pending')</a></li>
<li{!! (Request::query('status') == 'Undeployable' ? ' class="active"' : '') !!} ><a href="{{ URL::to('hardware?status=Undeployable') }}">@lang('general.undeployable')</a></li>
<li{!! (Request::query('status') == 'Archived' ? ' class="active"' : '') !!} >@lang('admin/hardware/general.archived')</a></li>
<li><a href="{{ URL::to('hardware?status=Requestable') }}" {!! (Request::query('status') == 'Requestable' ? ' class="active"' : '') !!}><a href="{{ URL::to('hardware?status=Archived') }}" >@lang('admin/hardware/general.requestable')</a></li>
<li{!! (Request::query('status') == 'Archived' ? ' class="active"' : '') !!}><a href="{{ URL::to('hardware?status=Archived') }}">@lang('admin/hardware/general.archived')</a></li>
<li{!! (Request::query('status') == 'Requestable' ? ' class="active"' : '') !!}><a href="{{ URL::to('hardware?status=Requestable') }}"><a href="{{ URL::to('hardware?status=Requestable') }}" >@lang('admin/hardware/general.requestable')</a></li>
<li class="divider">&nbsp;</li>
<li{!! (Request::is('hardware/bulkcheckout') ? ' class="active>"' : '') !!}>
+5 -3
View File
@@ -8,9 +8,11 @@
@section('header_right')
<a href="{{ route('create/licenses') }}" class="btn btn-primary pull-right">
{{ trans('general.create') }}
</a>
@can('licenses.create')
<a href="{{ route('create/licenses') }}" class="btn btn-primary pull-right">
{{ trans('general.create') }}
</a>
@endcan
@stop
{{-- Page content --}}
+17
View File
@@ -101,6 +101,14 @@
{{ trans('admin/licenses/table.assigned_to') }}
</label>
</div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('username', '1') }}
{{ trans('admin/users/table.username') }}
</label>
</div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('status', '1') }}
@@ -119,6 +127,15 @@
{{ trans('general.depreciation') }}
</label>
</div>
@foreach ($customfields as $customfield)
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox($customfield->db_column_name(), '1') }}
{{ $customfield->name }}
</label>
</div>
@endforeach
</div>
+4 -2
View File
@@ -15,9 +15,11 @@
.checkbox label {
padding-right: 40px;
}
.input-group {
padding-left: 15px;
.input-group-addon {
width: 30px;
}
</style>
<!-- Bootstrap Color Picker -->
+1 -1
View File
@@ -151,7 +151,7 @@
@if ($setting->ldap_enabled == 1)
<td>
{{ $setting->ldap_server }}:{{ $setting->ldap_port }}
{{ $setting->ldap_server }}
@if ($setting->is_ad == '1')
(Active Directory)
@endif
+29 -2
View File
@@ -19,6 +19,14 @@
{{-- Page content --}}
@section('content')
<style>
.input-group-addon {
width: 30px;
}
</style>
<!-- Bootstrap Color Picker -->
<link rel="stylesheet" href="{{ asset('assets/js/plugins/colorpicker/bootstrap-colorpicker.min.css') }}">
<div class="row">
<div class="col-md-9">
@@ -43,13 +51,26 @@
<div class="form-group {{ $errors->has('statuslabel_types') ? 'has-error' : '' }}">
<label for="statuslabel_types" class="col-md-3 control-label">{{ trans('admin/statuslabels/table.status_type') }}
</label>
</label>
<div class="col-md-7 required">
{{ Form::select('statuslabel_types', $statuslabel_types, $statuslabel->getStatuslabelType(), array('class'=>'select2', 'style'=>'min-width:400px')) }}
{!! $errors->first('statuslabel_types', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
</div>
</div>
<!-- Chart color -->
<div class="form-group{{ $errors->has('color') ? ' has-error' : '' }}">
{{ Form::label('color', trans('admin/statuslabels/table.color'), ['class' => 'col-md-3 control-label']) }}
<div class="col-md-2">
<div class="input-group color">
{{ Form::text('color', Input::old('color', $statuslabel->color), array('class' => 'form-control', 'style' => 'width: 100px;', 'maxlength'=>'10')) }}
<div class="input-group-addon"><i></i></div>
</div><!-- /.input group -->
{!! $errors->first('header_color', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
<!-- Note -->
<div class="form-group {{ $errors->has('notes') ? 'has-error' : '' }}">
<label for="notes" class="col-md-3 control-label">{{ trans('admin/hardware/form.notes') }}</label>
@@ -77,5 +98,11 @@
</div>
</div>
@section('moar_scripts')
<!-- bootstrap color picker -->
<script>
//color picker with addon
$(".color").colorpicker();
</script>
@stop
@stop
@@ -31,6 +31,7 @@
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-sortable="true" data-field="name">{{ trans('admin/statuslabels/table.name') }}</th>
<th data-sortable="false" data-field="type">{{ trans('admin/statuslabels/table.status_type') }}</th>
<th data-sortable="false" data-field="color">{{ trans('admin/statuslabels/table.color') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions">{{ trans('table.actions') }}</th>
</tr>
</thead>
+58 -6
View File
@@ -251,7 +251,7 @@ input[type='text'][disabled], input[disabled], textarea[disabled], input[readonl
<div class="col-md-5">
<div class="controls">
<select name="groups[]" id="groups[]" multiple="multiple" class="form-control" {{ ((Config::get('app.lock_passwords') && ($user->id)) ? ' disabled' : '') }}>
<select name="groups[]" id="groups[]" multiple="multiple" class="form-control" {{ ((Config::get('app.lock_passwords') || ($user->id==Auth::user()->id) || (!Auth::user()->isSuperUser())) ? ' disabled' : '') }}>
@foreach ($groups as $id => $group)
<option value="{{ $id }}"
@@ -291,38 +291,77 @@ input[type='text'][disabled], input[disabled], textarea[disabled], input[readonl
<div class="tab-pane" id="tab_2">
<div class="col-md-10 col-md-offset-2">
@if (!Auth::user()->isSuperUser())
<p class="alert alert-warning">Only superadmins may grant a user superadmin access.</p>
@endif
<?php $counter = 1; ?>
@foreach ($permissions as $area => $permission)
@for ($i = 0; $i < count($permission); $i++)
<?php
$permission_name = $permission[$i]['permission'];
?>
@if ($counter == 2)
<div id="nonadmin">
@endif
@if ($permission[$i]['display'])
<h3>{{ $area }}: {{ $permission[$i]['label'] }}</h3>
<p>{{ $permission[$i]['note'] }}</p>
<!-- radio -->
<div class="form-group" style="padding-left: 15px;">
<label class="radio-padding">
{{ Form::radio('permission['.$permission_name.']', '1', $userPermissions[$permission_name] == '1', ['class' => 'minimal']) }}
@if (($permission_name == 'superuser') && (!Auth::user()->isSuperUser()))
{{ Form::radio('permission['.$permission_name.']', '1', $userPermissions[$permission_name] == '1', ['disabled'=>'disabled']) }}
@else
{{ Form::radio('permission['.$permission_name.']', '1', $userPermissions[$permission_name] == '1', ['class' => "$permission_name"]) }}
@endif
Grant</label>
<label class="radio-padding">
{{ Form::radio('permission['.$permission_name.']', '-1', $userPermissions[$permission_name] == '-1', ['class' => 'minimal']) }}
@if (($permission_name == 'superuser') && (!Auth::user()->isSuperUser()))
{{ Form::radio('permission['.$permission_name.']', '-1', $userPermissions[$permission_name] == '-1', ['disabled'=>'disabled']) }}
@else
{{ Form::radio('permission['.$permission_name.']', '-1', $userPermissions[$permission_name] == '-1', ['class' => "$permission_name"]) }}
@endif
Deny</label>
<label class="radio-padding">
{{ Form::radio('permission['.$permission_name.']', '0', $userPermissions[$permission_name] =='0', ['class' => 'minimal']) }}
Inherit</label>
@if (($permission_name == 'superuser') && (!Auth::user()->isSuperUser()))
{{ Form::radio('permission['.$permission_name.']', '0', $userPermissions[$permission_name] =='0', ['disabled'=>'disabled']) }}
@else
{{ Form::radio('permission['.$permission_name.']', '0', $userPermissions[$permission_name] =='0', ['class' => "$permission_name"]) }}
@endif
Inherit</label>
</div>
<hr>
@endif
@endfor
@if ($counter == count($permissions))
</div>
@endif
<?php $counter++; ?>
@endforeach
</div>
</div><!-- /.tab-pane -->
</div><!-- /.tab-content -->
<div class="box-footer text-right">
@@ -354,8 +393,21 @@ $(document).ready(function() {
<script src="{{ asset('assets/js/pGenerator.jquery.js') }}"></script>
<script>
$(document).ready(function(){
$(".superuser").change(function() {
var perms = $(this).val();
if (perms =='1') {
$("#nonadmin").hide();
} else {
$("#nonadmin").show();
}
});
console.dir($('.superuser'));
$('#genPassword').pGenerator({
'bind': 'click',
'passwordElement': '#password',
+16 -10
View File
@@ -15,16 +15,20 @@
@stop
@section('header_right')
@if (\App\Models\Setting::getSettings()->ldap_enabled == 1)
<a href="{{ route('ldap/user') }}" class="btn btn-default pull-right"><span class="fa fa-upload"></span> LDAP</a>
@endif
<a href="{{ route('import/user') }}" class="btn btn-default pull-right" style="margin-right: 5px;"><span class="fa fa-upload"></span> {{ trans('general.import') }}</a>
<a href="{{ route('create/user') }}" class="btn btn-primary pull-right" style="margin-right: 5px;"> {{ trans('general.create') }}</a>
@if (Input::get('status')=='deleted')
<a class="btn btn-default pull-right" href="{{ URL::to('admin/users') }}" style="margin-right: 5px;">{{ trans('admin/users/table.show_current') }}</a>
@else
<a class="btn btn-default pull-right" href="{{ URL::to('admin/users?status=deleted') }}" style="margin-right: 5px;">{{ trans('admin/users/table.show_deleted') }}</a>
@endif
@can('users.create')
@if (\App\Models\Setting::getSettings()->ldap_enabled == 1)
<a href="{{ route('ldap/user') }}" class="btn btn-default pull-right"><span class="fa fa-upload"></span> LDAP</a>
@endif
<a href="{{ route('import/user') }}" class="btn btn-default pull-right" style="margin-right: 5px;"><span class="fa fa-upload"></span> {{ trans('general.import') }}</a>
<a href="{{ route('create/user') }}" class="btn btn-primary pull-right" style="margin-right: 5px;"> {{ trans('general.create') }}</a>
@endcan
@if (Input::get('status')=='deleted')
<a class="btn btn-default pull-right" href="{{ URL::to('admin/users') }}" style="margin-right: 5px;">{{ trans('admin/users/table.show_current') }}</a>
@else
<a class="btn btn-default pull-right" href="{{ URL::to('admin/users?status=deleted') }}" style="margin-right: 5px;">{{ trans('admin/users/table.show_deleted') }}</a>
@endif
@stop
{{-- Page content --}}
@@ -43,12 +47,14 @@
'class' => 'form-inline' ]) }}
@if (Input::get('status')!='deleted')
@can('users.delete')
<div id="toolbar">
<select name="bulk_actions" class="form-control select2" style="width: 200px;">
<option value="delete">Bulk Checkin &amp; Delete</option>
</select>
<button class="btn btn-default" id="bulkEdit" disabled>Go</button>
</div>
@endcan
@endif
+12 -1
View File
@@ -442,7 +442,18 @@
@endif
</td>
<td>{{ $log->adminlog->fullName() }}</td>
<td>@if ($log->adminlog)
@if ($log->adminlog->deleted_at=='')
<a href="{{ route('view/user', $log->checkedout_to) }}">
{{ $log->adminlog->fullName() }}
</a>
@else
<del>{{ $log->adminlog->fullName() }}</del>
@endif
@else
Deleted User
@endif</td>
</tr>
@endforeach
</tbody>
+1 -1
View File
@@ -51,7 +51,7 @@ elif [ -f /etc/os-release ]; then
#Order is important here. If /etc/os-release and /etc/centos-release exist, we're on centos 7.
#If only /etc/centos-release exist, we're on centos6(or earlier). Centos-release is less parsable,
#so lets assume that it's version 6 (Plus, who would be doing a new install of anything on centos5 at this point..)
elif [ -f /etc/centos-release]; then
elif [ -f /etc/centos-release ]; then
distro="Centos"
version="6"
else
+3 -3
View File
@@ -5,8 +5,8 @@ $I->am('logged in user');
$I->wantTo('ensure that the categories listing page loads without errors');
$I->lookForwardTo('seeing it load without errors');
$I->amOnPage('/admin/settings/categories');
$I->waitForElement('.table', 5); // secs
$I->seeNumberOfElements('tr', [1,30]);
$I->waitForElement('.table', 10); // secs
$I->seeNumberOfElements('tr', [1,100]);
$I->seeInTitle('Categories');
$I->see('Categories');
$I->seeInPageSource('admin/settings/categories/create');
@@ -22,7 +22,7 @@ $I->dontSee('Create Category', '.page-header');
$I->see('Create Category', 'h1.pull-left');
$I->dontSee('&lt;span class=&quot;');
$I->fillField('name', 'testcategory');
$I->fillField('name', \App\Helpers\Helper::generateRandomString(15));
$I->selectOption('form select[name=category_type]', 'Asset');
$I->click('Save');
$I->dontSee('&lt;span class=&quot;');
+1 -2
View File
@@ -6,14 +6,13 @@ $I->wantTo('ensure that the users listing page loads without errors');
$I->lookForwardTo('seeing it load without errors');
$I->amOnPage('/admin/users');
//$I->waitForJS("return $.active == 0;", 60);
//$I->waitForElement('.table', 5); // secs
$I->waitForElement('.table', 5); // secs
//$I->seeNumberOfElements('tr', [1,10]);
$I->seeInTitle('Users');
$I->see('Users');
$I->seeInPageSource('admin/users/create');
$I->dontSee('Users', '.page-header');
$I->see('Users', 'h1.pull-left');
$I->seeLink('Create New','/admin/users/create'); // matches <a href="/logout">Logout</a>
/* Create form */