Merge branch 'develop'

This commit is contained in:
snipe 2017-09-29 17:39:09 -07:00
commit f00dcb57cf
11 changed files with 374 additions and 302 deletions

View file

@ -78,12 +78,7 @@ class ObjectImportCommand extends Command
$logFile = $this->option('logfile');
\Log::useFiles($logFile);
if ($this->option('testrun')) {
$this->comment('====== TEST ONLY Item Import for '.$filename.' ====');
$this->comment('============== NO DATA WILL BE WRITTEN ==============');
} else {
$this->comment('======= Importing Items from '.$filename.' =========');
}
$this->comment('======= Importing Items from '.$filename.' =========');
$importer->import();
$this->bar = null;

View file

@ -490,7 +490,7 @@ class LicensesController extends Controller
* @param int $licenseId
* @return \Illuminate\Http\RedirectResponse
*/
public function postUpload($licenseId = null)
public function postUpload(Request $request, $licenseId = null)
{
$license = License::find($licenseId);
// the license is valid

View file

@ -179,13 +179,14 @@ class Asset extends Depreciable
public function getDetailedNameAttribute()
{
if ($this->assignedTo) {
$user_name = $this->assignedTo->present()->name();
if ($this->assignedto) {
$user_name = $this->assignedto->present()->name();
} else {
$user_name = "Unassigned";
}
return $this->asset_tag . ' - ' . $this->name . ' (' . $user_name . ') ' . $this->model->name;
}
public function validationRules($id = '0')
{
return $this->rules;

View file

@ -41,10 +41,12 @@ class CheckinNotification extends Notification
$notifyBy[] = 'slack';
}
$item = $this->params['item'];
if ((method_exists($item, 'requireAcceptance') && ($item->requireAcceptance()=='1'))
|| (method_exists($item, 'getEula') && ($item->getEula()))
) {
$notifyBy[] = 'mail';
if (class_basename(get_class($this->params['item']))=='Asset') {
if ((method_exists($item, 'requireAcceptance') && ($item->requireAcceptance() == '1'))
|| (method_exists($item, 'getEula') && ($item->getEula()))
) {
$notifyBy[] = 'mail';
}
}
return $notifyBy;
}

View file

@ -44,7 +44,7 @@ class CheckoutNotification extends Notification
}
$item = $this->params['item'];
if (class_basename(get_class($this->params['item']))!='License') {
if (class_basename(get_class($this->params['item']))=='Asset') {
$notifyBy[] = 'mail';
}
// if ((method_exists($item, 'requireAcceptance') && ($item->requireAcceptance()=='1'))

View file

@ -10,12 +10,12 @@
"barryvdh/laravel-debugbar": "^2.4",
"doctrine/cache": "^1.6",
"doctrine/common": "^2.7",
"doctrine/dbal": "v2.4.2",
"doctrine/dbal": "v2.5.13",
"erusev/parsedown": "^1.6",
"fideloper/proxy": "^3.1",
"intervention/image": "^2.3",
"javiereguiluz/easyslugger": "^1.0",
"laravel/framework": "5.4.20",
"laravel/framework": "5.4.*",
"laravel/passport": "^1.0",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.3",
@ -29,15 +29,15 @@
"tecnickcom/tc-lib-barcode": "^1.15",
"unicodeveloper/laravel-password": "^1.0",
"watson/validating": "^3.0",
"doctrine/instantiator": "1.0.5",
"doctrine/inflector": "1.0.*"
"doctrine/instantiator": "1.0.*",
"doctrine/inflector": "1.2.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~5.7",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*",
"codeception/codeception": "2.2.9",
"codeception/codeception": "2.3.6",
"squizlabs/php_codesniffer": "*",
"phpunit/php-token-stream": "1.4.11"

612
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -13,7 +13,8 @@
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d

View file

@ -20,6 +20,13 @@ return array(
'confirm' => 'Are you sure you wish to delete this Status Label?',
'error' => 'There was an issue deleting the Status Label. Please try again.',
'success' => 'The Status Label was deleted successfully.'
)
),
'help' => array(
'undeployable' => 'These assets cannot be assigned to anyone.',
'deployable' => 'These assets can be checked out. Once they are assigned, they will assume a meta status of <i class="fa fa-circle text-blue"></i> <strong>Deployed</strong>.',
'archived' => 'These assets cannot be checked out, and will only show up in the Archived view. This is useful for retaining information about assets for budgeting/historic purposes but keeping them out of the day-to-day asset list.',
'pending' => 'These assets can not yet be assigned to anyone, often used for items that are out for repair, but are expected to return to circulation.',
),
);

View file

@ -205,26 +205,34 @@ $('.snipe-table').bootstrapTable({
function polymorphicItemFormatter(value) {
var item_destination = '';
var item_icon;
if ((value) && (value.type)) {
if (value.type == 'asset') {
item_destination = 'hardware';
item_icon = 'fa-barcode';
} else if (value.type == 'accessory') {
item_destination = 'accessories';
item_icon = 'fa-keyboard-o';
} else if (value.type == 'component') {
item_destination = 'components';
item_icon = 'fa-hdd-o';
} else if (value.type == 'consumable') {
item_destination = 'consumables';
item_icon = 'fa-tint';
} else if (value.type == 'license') {
item_destination = 'licenses';
item_icon = 'fa-floppy-o';
} else if (value.type == 'user') {
item_destination = 'users';
item_icon = 'fa-user';
} else if (value.type == 'location') {
item_destination = 'locations'
item_icon = 'fa-map-marker';
}
return '<a href="{{ url('/') }}/' + item_destination +'/' + value.id + '"> ' + value.name + '</a>';
return '<a href="{{ url('/') }}/' + item_destination +'/' + value.id + '" data-tooltip="true" title="' + value.type + '"><i class="fa ' + item_icon + ' text-blue"></i> ' + value.name + '</a>';
} else {
return '';

View file

@ -46,6 +46,12 @@
<div class="col-md-3">
<h4>{{ trans('admin/statuslabels/table.about') }}</h4>
<p>{{ trans('admin/statuslabels/table.info') }}</p>
<p><i class="fa fa-circle text-green"></i> <strong>{{ trans('admin/statuslabels/table.deployable') }}</strong>: {!! trans('admin/statuslabels/message.help.deployable') !!}</p>
<p><i class="fa fa-circle text-orange"></i> <strong>Pending</strong>{{ trans('admin/statuslabels/message.help.pending') }}</p>
<p><i class="fa fa-times text-red"></i> <strong>Undeployable</strong>: {{ trans('admin/statuslabels/message.help.undeployable') }}</p>
<p><i class="fa fa-times text-red"></i> <strong>Archived</strong>: {{ trans('admin/statuslabels/message.help.archived') }}</p>
</div>
</div>