Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Jun 21, 2018
2 parents 087e114 + e9901f5 commit aa5003d
Show file tree
Hide file tree
Showing 19 changed files with 235 additions and 121 deletions.
4 changes: 4 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ exemptLabels:
- :woman_technologist: ready for dev
- :moneybag: bounty
- :hand: bug
- "🔐 security"
- "👩‍💻 ready for dev"
- "💰 bounty"
- "✋ bug"
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ patch \
curl \
vim \
git \
cron \
mysql-client \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
8 changes: 8 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ SNIPEIT_SH_URL= "https://raw.githubusercontent.com/snipe/snipe-it/master/snipeit
NETWORK_BRIDGE= "en0: Wi-Fi (AirPort)"

Vagrant.configure("2") do |config|
config.vm.define "bionic" do |bionic|
bionic.vm.box = "ubuntu/bionic64"
bionic.vm.hostname = 'bionic'
bionic.vm.network "public_network", bridge: NETWORK_BRIDGE
bionic.vm.provision :shell, :inline => "wget #{SNIPEIT_SH_URL}"
bionic.vm.provision :shell, :inline => "chmod 755 snipeit.sh"
end

config.vm.define "xenial" do |xenial|
xenial.vm.box = "ubuntu/xenial64"
xenial.vm.hostname = 'xenial'
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ public function postBranding(ImageUploadRequest $request)
$setting->brand = $request->input('brand', '1');
$setting->header_color = $request->input('header_color');
$setting->support_footer = $request->input('support_footer');
$setting->version_footer = $request->input('version_footer');
$setting->footer_text = $request->input('footer_text');
$setting->skin = $request->input('skin');
$setting->show_url_in_emails = $request->input('show_url_in_emails', '0');
Expand Down
6 changes: 4 additions & 2 deletions app/Importer/UserImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,21 @@ public function createUserIfNotExists(array $row)
$this->item['phone'] = $this->findCsvMatch($row, 'phone_number');
$this->item['jobtitle'] = $this->findCsvMatch($row, 'jobtitle');
$this->item['employee_num'] = $this->findCsvMatch($row, 'employee_num');
$this->item['password'] = $this->tempPassword;
$user = User::where('username', $this->item['username'])->first();
if ($user) {
if (!$this->updating) {
$this->log('A matching User ' . $this->item["name"] . ' already exists. ');
return;
}
$this->log('Updating User');
// $user = $this->users[$userId];
$user->update($this->sanitizeItemForUpdating($user));
$user->save();
return;
}
// This needs to be applied after the update logic, otherwise we'll overwrite user passwords
// Issue #5408
$this->item['password'] = $this->tempPassword;

$this->log("No matching user, creating one");
$user = new User();
$user->fill($this->sanitizeItemForStoring($user));
Expand Down
2 changes: 1 addition & 1 deletion app/Models/AssetModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function scopeInCategory($query, array $categoryIdListing)
* @param $query
*
* @return $query
* @author Daniel Meltzer <parallelgrapefruit@gmail.com
* @author Daniel Meltzer <dmeltzer.devel@gmail.com>
* @version v3.5
*/
public function scopeRequestableModels($query)
Expand Down
10 changes: 5 additions & 5 deletions app/Models/Loggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait Loggable
{

/**
* @author Daniel Meltzer <parallelgrapefruit@gmail.com
* @author Daniel Meltzer <dmeltzer.devel@gmail.com>
* @since [v3.4]
* @return \App\Models\Actionlog
*/
Expand All @@ -32,7 +32,7 @@ public function log()
}

/**
* @author Daniel Meltzer <parallelgrapefruit@gmail.com
* @author Daniel Meltzer <dmeltzer.devel@gmail.com>
* @since [v3.4]
* @return \App\Models\Actionlog
*/
Expand Down Expand Up @@ -106,7 +106,7 @@ private function determineLogItemType($log)
return $log;
}
/**
* @author Daniel Meltzer <parallelgrapefruit@gmail.com
* @author Daniel Meltzer <dmeltzer.devel@gmail.com>
* @since [v3.4]
* @return \App\Models\Actionlog
*/
Expand Down Expand Up @@ -204,7 +204,7 @@ public function logAudit($note, $location_id, $filename = null)


/**
* @author Daniel Meltzer <parallelgrapefruit@gmail.com
* @author Daniel Meltzer <dmeltzer.devel@gmail.com>
* @since [v3.5]
* @return \App\Models\Actionlog
*/
Expand All @@ -231,7 +231,7 @@ public function logCreate($note = null)
}

/**
* @author Daniel Meltzer <parallelgrapefruit@gmail.com
* @author Daniel Meltzer <dmeltzer.devel@gmail.com>
* @since [v3.4]
* @return \App\Models\Actionlog
*/
Expand Down
7 changes: 0 additions & 7 deletions app/Presenters/AccessoryPresenter.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: parallelgrapefruit
* Date: 12/23/16
* Time: 11:51 AM
*/

namespace App\Presenters;

use App\Helpers\Helper;
Expand Down
6 changes: 0 additions & 6 deletions app/Presenters/AssetMaintenancesPresenter.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: parallelgrapefruit
* Date: 12/23/16
* Time: 12:15 PM
*/

namespace App\Presenters;

Expand Down
6 changes: 0 additions & 6 deletions app/Presenters/AssetModelPresenter.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: parallelgrapefruit
* Date: 12/23/16
* Time: 12:15 PM
*/

namespace App\Presenters;

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true,
"process-timeout":3000,
"platform": {
"php": "5.6.4"
}
Expand Down
29 changes: 29 additions & 0 deletions database/migrations/2018_06_21_134622_add_version_footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddVersionFooter extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->char('version_footer', 5)->nullable()->default('on');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
$table->dropColumn('version_footer');
});
}
}
4 changes: 3 additions & 1 deletion resources/lang/en/admin/settings/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@
'slack_test_help' => 'Test whether your Slack integration is configured correctly. YOU MUST SAVE YOUR UPDATED SLACK SETTINGS FIRST.',
'snipe_version' => 'Snipe-IT version',
'support_footer' => 'Support Footer Links ',
'support_footer_help' => 'Specify who sees the links to the Snipe-IT Support info and Users Manual',
'support_footer_help' => 'Specify who sees the links to the Snipe-IT Support info and Users Manual.',
'version_footer' => 'Version in Footer ',
'version_footer_help' => 'Specify who sees the Snipe-IT version and build number.',
'system' => 'System Information',
'update' => 'Update Settings',
'value' => 'Value',
Expand Down
4 changes: 3 additions & 1 deletion resources/macros/macros.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,14 @@
'd M, Y',
'm/d/Y',
'n/d/y',
'd/m/Y',
'm/j/Y',
'd.m.Y',
];

foreach ($formats as $format) {
$date_display_formats[$format] = Carbon::now()->format($format);

$date_display_formats[$format] = Carbon::parse(date('Y').'-'.date('m').'-25')->format($format);
}
$select = '<select name="'.$name.'" class="'.$class.'" style="min-width:250px">';
foreach ($date_display_formats as $format => $date_display_format) {
Expand Down
4 changes: 2 additions & 2 deletions resources/views/account/view-assets.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class="table table-striped snipe-table"
<td>{{ $license->name }}</td>
<td>
@can('viewKeys', $license)
{{ mb_strimwidth($license->serial, 0, 50, "...") }}
{{ $license->serial }}
@else
------------
@endcan
Expand Down Expand Up @@ -205,7 +205,7 @@ class="table table-striped snipe-table"
@endif

<div class="box-body">
<!-- checked out licenses table -->
<!-- checked out Accessories table -->

<div class="table-responsive">
<table
Expand Down
7 changes: 6 additions & 1 deletion resources/views/hardware/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,16 @@
<tbody>
<?php $totalCost = 0; ?>
@foreach ($asset->components as $component)


@if (is_null($component->deleted_at))
<tr>
<td>
<a href="{{ route('components.show', $component->id) }}">{{ $component->name }}</a>
</td>
<td>{{ $component->pivot->assigned_qty }}</td>
<td>{{ $component->purchase_cost }}</td>
<?php $totalCost = $totalCost + $component->purchase_cost ;?>

</tr>
@endif
Expand All @@ -620,7 +623,9 @@

<tfoot>
<tr>
<td colspan="7" class="text-right">{{ $use_currency.$totalCost }}</td>
<td colspan="2">
</td>
<td>{{ $totalCost }}</td>
</tr>
</tfoot>
</table>
Expand Down
6 changes: 5 additions & 1 deletion resources/views/layouts/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,11 @@
<footer class="main-footer hidden-print">

<div class="pull-right hidden-xs">
<b>Version</b> {{ config('version.app_version') }} - build {{ config('version.build_version') }} ({{ config('version.branch') }})
@if ($snipeSettings->version_footer!='off')
@if (($snipeSettings->version_footer=='on') || (($snipeSettings->version_footer=='admin') && (Auth::user()->isSuperUser()=='1')))
<b>Version</b> {{ config('version.app_version') }} - build {{ config('version.build_version') }} ({{ config('version.branch') }})
@endif
@endif

@if ($snipeSettings->support_footer!='off')
@if (($snipeSettings->support_footer=='on') || (($snipeSettings->support_footer=='admin') && (Auth::user()->isSuperUser()=='1')))
Expand Down
18 changes: 18 additions & 0 deletions resources/views/settings/branding.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,24 @@
</div>
</div>


<!-- Version Footer -->
<div class="form-group {{ $errors->has('version_footer') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('version_footer', trans('admin/settings/general.version_footer')) }}
</div>
<div class="col-md-9">
@if (config('app.lock_passwords')===true)
{!! Form::select('version_footer', array('on'=>'Enabled','off'=>'Disabled','admin'=>'Superadmin Only'), Input::old('version_footer', $setting->version_footer), ['class' => 'form-control disabled', 'style'=>'width: 150px ;', 'disabled' => 'disabled']) !!}
@else
{!! Form::select('version_footer', array('on'=>'Enabled','off'=>'Disabled','admin'=>'Superadmin Only'), Input::old('version_footer', $setting->version_footer), array('class' => 'form-control', 'style'=>'width: 150px ;')) !!}
@endif

<p class="help-block">{{ trans('admin/settings/general.version_footer_help') }}</p>
{!! $errors->first('version_footer', '<span class="alert-msg">:message</span>') !!}
</div>
</div>

<!-- Additional footer -->
<div class="form-group {{ $errors->has('footer_text') ? 'error' : '' }}">
<div class="col-md-3">
Expand Down
Loading

0 comments on commit aa5003d

Please sign in to comment.