mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Merge remote-tracking branch 'origin/develop'
Some checks are pending
CodeQL Security Scan / CodeQL Security Scan (javascript) (push) Waiting to run
Codacy Security Scan / Codacy Security Scan (push) Waiting to run
Docker images (Alpine) / docker (push) Waiting to run
Docker images / docker (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.1) (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.2) (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.3) (push) Waiting to run
Tests in SQLite / PHP ${{ matrix.php-version }} (8.1.1) (push) Waiting to run
Some checks are pending
CodeQL Security Scan / CodeQL Security Scan (javascript) (push) Waiting to run
Codacy Security Scan / Codacy Security Scan (push) Waiting to run
Docker images (Alpine) / docker (push) Waiting to run
Docker images / docker (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.1) (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.2) (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.3) (push) Waiting to run
Tests in SQLite / PHP ${{ matrix.php-version }} (8.1.1) (push) Waiting to run
This commit is contained in:
commit
5d5e999384
3
.github/workflows/stale.yml
vendored
3
.github/workflows/stale.yml
vendored
|
@ -14,7 +14,8 @@ jobs:
|
||||||
- uses: actions/stale@v9
|
- uses: actions/stale@v9
|
||||||
with:
|
with:
|
||||||
debug-only: true
|
debug-only: true
|
||||||
operations-per-run: 100 # just while we're debugging
|
ascending: true
|
||||||
|
operations-per-run: 1000 # just while we're debugging
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
days-before-stale: 60
|
days-before-stale: 60
|
||||||
days-before-close: 7
|
days-before-close: 7
|
||||||
|
|
|
@ -11,6 +11,7 @@ use App\Models\Consumable;
|
||||||
use App\Models\LicenseSeat;
|
use App\Models\LicenseSeat;
|
||||||
use App\Models\Recipients\AdminRecipient;
|
use App\Models\Recipients\AdminRecipient;
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
|
use App\Models\User;
|
||||||
use App\Notifications\CheckinAccessoryNotification;
|
use App\Notifications\CheckinAccessoryNotification;
|
||||||
use App\Notifications\CheckinAssetNotification;
|
use App\Notifications\CheckinAssetNotification;
|
||||||
use App\Notifications\CheckinLicenseSeatNotification;
|
use App\Notifications\CheckinLicenseSeatNotification;
|
||||||
|
@ -43,29 +44,30 @@ class CheckoutableListener
|
||||||
* Make a checkout acceptance and attach it in the notification
|
* Make a checkout acceptance and attach it in the notification
|
||||||
*/
|
*/
|
||||||
$acceptance = $this->getCheckoutAcceptance($event);
|
$acceptance = $this->getCheckoutAcceptance($event);
|
||||||
|
$notifiables = $this->getNotifiables($event);
|
||||||
|
|
||||||
|
// Send email notifications
|
||||||
try {
|
try {
|
||||||
if (! $event->checkedOutTo->locale) {
|
foreach ($notifiables as $notifiable) {
|
||||||
Notification::locale(Setting::getSettings()->locale)->send(
|
if ($notifiable instanceof User && $notifiable->email != '') {
|
||||||
$this->getNotifiables($event),
|
if (! $event->checkedOutTo->locale){
|
||||||
$this->getCheckoutNotification($event, $acceptance)
|
Notification::locale(Setting::getSettings()->locale)->send($notifiable, $this->getCheckoutNotification($event, $acceptance));
|
||||||
);
|
}
|
||||||
} else {
|
else {
|
||||||
Notification::send(
|
Notification::send($notifiable, $this->getCheckoutNotification($event, $acceptance));
|
||||||
$this->getNotifiables($event),
|
}
|
||||||
$this->getCheckoutNotification($event, $acceptance)
|
}
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Send Webhook notification
|
||||||
if ($this->shouldSendWebhookNotification()) {
|
if ($this->shouldSendWebhookNotification()) {
|
||||||
|
// Slack doesn't include the URL in its messaging format, so this is needed to hit the endpoint
|
||||||
//slack doesn't include the url in its messaging format so this is needed to hit the endpoint
|
if (Setting::getSettings()->webhook_selected === 'slack' || Setting::getSettings()->webhook_selected === 'general') {
|
||||||
|
|
||||||
if(Setting::getSettings()->webhook_selected =='slack' || Setting::getSettings()->webhook_selected =='general') {
|
|
||||||
|
|
||||||
|
|
||||||
Notification::route('slack', Setting::getSettings()->webhook_endpoint)
|
Notification::route('slack', Setting::getSettings()->webhook_endpoint)
|
||||||
->notify($this->getCheckoutNotification($event));
|
->notify($this->getCheckoutNotification($event, $acceptance));
|
||||||
|
} else {
|
||||||
|
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
|
||||||
|
->notify($this->getCheckoutNotification($event, $acceptance));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (ClientException $e) {
|
} catch (ClientException $e) {
|
||||||
|
@ -75,6 +77,7 @@ class CheckoutableListener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify the user and post to webhook about the checked in checkoutable
|
* Notify the user and post to webhook about the checked in checkoutable
|
||||||
*/
|
*/
|
||||||
|
@ -101,25 +104,28 @@ class CheckoutableListener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$notifiables = $this->getNotifiables($event);
|
||||||
|
// Send email notifications
|
||||||
try {
|
try {
|
||||||
// Use default locale
|
foreach ($notifiables as $notifiable) {
|
||||||
if (! $event->checkedOutTo->locale) {
|
if ($notifiable instanceof User && $notifiable->email != '') {
|
||||||
Notification::locale(Setting::getSettings()->locale)->send(
|
if (! $event->checkedOutTo->locale){
|
||||||
$this->getNotifiables($event),
|
Notification::locale(Setting::getSettings()->locale)->send($notifiable, $this->getCheckoutNotification($event, $acceptance));
|
||||||
$this->getCheckinNotification($event)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
Notification::send(
|
|
||||||
$this->getNotifiables($event),
|
|
||||||
$this->getCheckinNotification($event)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
//slack doesn't include the url in its messaging format so this is needed to hit the endpoint
|
else {
|
||||||
if(Setting::getSettings()->webhook_selected =='slack' || Setting::getSettings()->webhook_selected =='general') {
|
Notification::send($notifiable, $this->getCheckinNotification($event));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Send Webhook notification
|
||||||
if ($this->shouldSendWebhookNotification()) {
|
if ($this->shouldSendWebhookNotification()) {
|
||||||
|
// Slack doesn't include the URL in its messaging format, so this is needed to hit the endpoint
|
||||||
|
if (Setting::getSettings()->webhook_selected === 'slack' || Setting::getSettings()->webhook_selected === 'general') {
|
||||||
Notification::route('slack', Setting::getSettings()->webhook_endpoint)
|
Notification::route('slack', Setting::getSettings()->webhook_endpoint)
|
||||||
->notify($this->getCheckinNotification($event));
|
->notify($this->getCheckinNotification($event));
|
||||||
|
} else {
|
||||||
|
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
|
||||||
|
->notify($this->getCheckinNotification($event));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ class DepreciationReportPresenter extends Presenter
|
||||||
], [
|
], [
|
||||||
"field" => "book_value",
|
"field" => "book_value",
|
||||||
"searchable" => true,
|
"searchable" => true,
|
||||||
"sortable" => true,
|
"sortable" => false,
|
||||||
"visible" => true,
|
"visible" => true,
|
||||||
"title" => trans('admin/hardware/table.book_value'),
|
"title" => trans('admin/hardware/table.book_value'),
|
||||||
"footerFormatter" => 'sumFormatter',
|
"footerFormatter" => 'sumFormatter',
|
||||||
|
|
|
@ -41,9 +41,9 @@
|
||||||
<!-- Checkout selector -->
|
<!-- Checkout selector -->
|
||||||
@include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true'])
|
@include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true'])
|
||||||
|
|
||||||
@include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_user', 'required'=>'true'])
|
@include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_user'])
|
||||||
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.asset'), 'fieldname' => 'assigned_asset', 'unselect' => 'true', 'style' => 'display:none;', 'required'=>'true'])
|
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.asset'), 'fieldname' => 'assigned_asset', 'unselect' => 'true', 'style' => 'display:none;'])
|
||||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'style' => 'display:none;', 'required'=>'true'])
|
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'style' => 'display:none;'])
|
||||||
|
|
||||||
<!-- Checkout/Checkin Date -->
|
<!-- Checkout/Checkin Date -->
|
||||||
<div class="form-group {{ $errors->has('checkout_at') ? 'error' : '' }}">
|
<div class="form-group {{ $errors->has('checkout_at') ? 'error' : '' }}">
|
||||||
|
|
Loading…
Reference in a new issue