Compare commits

...

65 Commits

Author SHA1 Message Date
snipe 750c376725 Set item to null so it doesn’t get merged automatically 2025-09-29 13:29:00 +01:00
snipe 08630d948f Remove radio buttons - they don’t work correctly yet 2025-09-29 12:43:19 +01:00
snipe dc6ee342c5 Revert custom field name text box for now 2025-09-29 10:42:40 +01:00
snipe eea1922841 Added checkbox and radios 2025-09-25 13:22:52 +01:00
snipe 57824848e9 Update resources/views/blade/form-row.blade.php
Co-authored-by: Marcus Moore <mmoore@grokability.com>
2025-09-24 17:08:00 +01:00
snipe 235dcbc7d9 Updated more views 2025-09-24 16:58:35 +01:00
snipe f0561475cc Update resources/views/blade/input/text.blade.php
Co-authored-by: Marcus Moore <mmoore@grokability.com>
2025-09-24 16:41:56 +01:00
snipe 3b4c51bab6 Use slot instead of label 2025-09-24 14:52:29 +01:00
snipe 150c205615 Added checkboxes to status labels page 2025-09-23 21:37:17 +01:00
snipe cde22977b0 More checkbox changes 2025-09-23 21:23:03 +01:00
snipe 1c09657631 Handle checkboxes 2025-09-23 20:57:33 +01:00
snipe 02a4268180 Switched more fields to blade compaonents 2025-09-23 19:52:58 +01:00
snipe f8362f4a45 handled text fields in status labels 2025-09-23 18:44:06 +01:00
snipe 682c1a8fa7 Make required false 2025-09-23 18:43:50 +01:00
snipe 3863e82dcc Handle text and date fields on license edit 2025-09-23 18:43:39 +01:00
snipe b766f6e2b5 Made edit screen narrower on wide screens 2025-09-23 18:43:14 +01:00
snipe a3bad98096 Added date and tooltip components 2025-09-23 18:43:02 +01:00
snipe 33e7425dee Account for tooltips 2025-09-23 18:42:46 +01:00
snipe 2554b50b38 Updated suppliers 2025-09-23 17:04:49 +01:00
snipe 433a3e11fd Fixed field type 2025-09-23 17:00:03 +01:00
snipe c3efdd0c8d Updated company 2025-09-23 16:59:09 +01:00
snipe d2e3a13043 Added ability to mark fields as disabled 2025-09-23 16:58:53 +01:00
snipe c4923fa971 Updated address 2025-09-23 16:53:52 +01:00
snipe 253026de5d Updated locations edit 2025-09-23 16:51:55 +01:00
snipe a59914e9f9 Added placeholder back in 2025-09-23 16:38:12 +01:00
snipe 671e79f01b Sorry, this shouldn’t have been in there :( 2025-09-23 16:35:04 +01:00
snipe 5c716c3f24 Updated notes maxlength 2025-09-23 16:31:20 +01:00
snipe e138c9307e Added maxlength default for text 2025-09-23 16:30:18 +01:00
snipe 7c0c3b2bb8 Use shorthand for errors 2025-09-23 16:26:28 +01:00
snipe 514711ddbb Label blade component 2025-09-23 16:18:00 +01:00
snipe 9023eda66f Changed class 2025-09-23 14:25:52 +01:00
snipe 8ce3001ef9 First stab 2025-09-23 14:25:40 +01:00
snipe 25ce63f00b Merge pull request #17904 from grokability/#17804-searchable-columns
Fixed #17804 - make columns searchable in column picker
2025-09-19 12:43:46 +01:00
snipe 2462bc05b3 Added column search to additional views 2025-09-19 12:41:30 +01:00
snipe c3748da0b1 Fixed #17804 - make columns searchable in column picker 2025-09-19 12:16:56 +01:00
snipe 90c242a441 Merge pull request #17897 from marcusmoore/fixes/17896-prevent-bulk-checkout-of-checked-out-assets
Fixed #17896 - Prevent assigned assets from being bulk checked out
2025-09-19 07:03:43 +01:00
Marcus Moore 52239a88b5 Improve test name 2025-09-18 17:27:17 -07:00
Marcus Moore 7a3596c86d Test against other types 2025-09-18 17:21:27 -07:00
Marcus Moore ac8a9e38f0 Implement fix 2025-09-18 17:18:27 -07:00
Marcus Moore 5c08f3a27e Add failing test 2025-09-18 17:14:33 -07:00
snipe 5216dd75bf Bumped version 2025-09-18 14:49:15 +01:00
snipe b8b45d2d81 Merge pull request #17892 from grokability/#17891-fixes-maintenance-file-route
Fixed #17891 - missing maintenance file deletion route
2025-09-18 13:59:10 +01:00
snipe 4b2b2cb68e Fixed #17891 - missing maintenance file deletion route 2025-09-18 13:58:30 +01:00
snipe be4ace293e Use trans_choice for user acceptance 2025-09-18 13:51:57 +01:00
snipe 764b363bbc A few small tweaks to acceptance screen design 2025-09-18 13:38:37 +01:00
snipe 9da9166442 Merge pull request #17886 from grokability/small-tweaks-to-acceptance-pdf
Small adjustments for acceptance PDF layout
2025-09-17 22:01:41 +01:00
snipe 8ea339f0ef More small tweaks 2025-09-17 22:00:49 +01:00
snipe 89b36ba63f Derp. Uncomment the acceptance. 2025-09-17 21:43:40 +01:00
snipe 1d3dfa1fa4 Pull the acceptance stuff into the model 2025-09-17 21:43:17 +01:00
snipe ca567eec8a Small adjustments for layout 2025-09-17 21:08:13 +01:00
snipe 41da31c379 Merge pull request #17885 from grokability/#8859-show-cost-footer-on-models
Fixed #8859 - adds purchase sums on model view
2025-09-17 14:04:38 +01:00
snipe e81f63f46b Fixed #8859 - adds purchase sums on model view 2025-09-17 14:03:48 +01:00
snipe ade03e4827 Merge pull request #17882 from Godmartinz/add-total-cost-columns
Adds total cost to Accessories, Consumables, Components
2025-09-17 13:56:08 +01:00
snipe 33a4c88c3a Added table to deleted_at clauses to resolve ambiguity 2025-09-17 11:44:28 +01:00
snipe 1f79776b8f Pull HTML tags out before converting markdown 2025-09-16 19:21:39 +01:00
Godfrey M 11e5f851f0 typo 2025-09-16 10:49:33 -07:00
Godfrey M 4ca1db8a1b remove footer formatter from consumable purchase cost 2025-09-16 10:43:02 -07:00
Godfrey M 14b829aa30 add total cost to components and consumables 2025-09-16 10:37:32 -07:00
Godfrey M 384652b3df add total cost to accessories 2025-09-16 10:10:49 -07:00
snipe 9db65c6ae9 Merge pull request #17881 from grokability/#17873-eula-tab-on-users
Fixed #17873 - Added EULA tab to user view
2025-09-16 14:28:50 +01:00
snipe 1346e33e99 Check that the person trying to download can see both the user and the target 2025-09-16 14:21:03 +01:00
snipe ab9cc447aa Use more specific filename 2025-09-16 14:20:20 +01:00
snipe fe9e0444b4 Added EULA tab to user view 2025-09-16 13:20:50 +01:00
snipe a18957dbe9 Include output even if there is nothing to send 2025-09-16 12:33:06 +01:00
snipe 13d5b724ee Fixed tests 2025-09-16 12:16:18 +01:00
82 changed files with 1625 additions and 755 deletions
+33 -1
View File
@@ -67,6 +67,38 @@ body:
- Safari
- Microsoft Edge
- Other
- type: dropdown
id: on-demo
attributes:
label: Can you reproduce this on the public demo?
description: You can check this at https://demo.snipeitapp.com.
options:
- 'Yes'
- 'No'
- N/A
validations:
required: true
- type: dropdown
id: fmcs
attributes:
label: Do you have full multiple company support enabled?
description: You can check this in your Snipe-IT installation at `Admin Settings > General Settings > Scoping`.
options:
- 'Yes'
- 'No'
validations:
required: true
- type: dropdown
id: fmcs-location
attributes:
label: If you have full multiple company support enabled, do you have location scoping to company enabled?
description: You can check this in your Snipe-IT installation at `Admin Settings > General Settings > Scoping`.
options:
- 'Yes'
- 'No'
- I do not have full multiple company support enabled
validations:
required: true
- type: textarea
id: server-logs
attributes:
@@ -102,4 +134,4 @@ body:
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/grokability/snipe-it/blob/master/CODE_OF_CONDUCT.md).
options:
- label: I agree to follow this project's Code of Conduct
required: true
required: true
@@ -56,7 +56,7 @@ class SendExpirationAlerts extends Command
$assets = Asset::getExpiringWarrantyOrEol($alert_interval);
if ($assets->count() > 0) {
$this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $alert_interval]));
Mail::to($recipients)->send(new ExpiringAssetsMail($assets, $alert_interval));
$this->table(
@@ -68,7 +68,6 @@ class SendExpirationAlerts extends Command
// Expiring licenses
$licenses = License::getExpiringLicenses($alert_interval);
if ($licenses->count() > 0) {
$this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $alert_interval]));
Mail::to($recipients)->send(new ExpiringLicenseMail($licenses, $alert_interval));
$this->table(
@@ -77,6 +76,10 @@ class SendExpirationAlerts extends Command
);
}
// Send a message even if the count is 0
$this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $alert_interval]));
$this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $alert_interval]));
} else {
+2 -2
View File
@@ -95,7 +95,7 @@ class Helper
$Parsedown->setSafeMode(true);
if ($str) {
return $Parsedown->text($str);
return $Parsedown->text(strip_tags($str));
}
}
@@ -105,7 +105,7 @@ class Helper
$Parsedown->setSafeMode(true);
if ($str) {
return $Parsedown->line($str);
return $Parsedown->line(strip_tags($str));
}
}
@@ -13,11 +13,6 @@ use App\Models\Company;
use App\Models\Contracts\Acceptable;
use App\Models\Setting;
use App\Models\User;
use App\Models\AssetModel;
use App\Models\Accessory;
use App\Models\License;
use App\Models\Component;
use App\Models\Consumable;
use App\Notifications\AcceptanceAssetAcceptedNotification;
use App\Notifications\AcceptanceAssetAcceptedToUserNotification;
use App\Notifications\AcceptanceAssetDeclinedNotification;
@@ -26,12 +21,9 @@ use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use App\Http\Controllers\SettingsController;
use Carbon\Carbon;
use \Illuminate\Contracts\View\View;
use \Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Log;
use TCPDF;
use App\Helpers\Helper;
class AcceptanceController extends Controller
@@ -83,6 +75,11 @@ class AcceptanceController extends Controller
public function store(Request $request, $id) : RedirectResponse
{
$acceptance = CheckoutAcceptance::find($id);
$assigned_user = User::find($acceptance->assigned_to_id);
$settings = Setting::getSettings();
$path_logo = '';
$sig_filename='';
if (is_null($acceptance)) {
return redirect()->route('account.accept')->with('error', trans('admin/hardware/message.does_not_exist'));
@@ -118,136 +115,62 @@ class AcceptanceController extends Controller
Storage::makeDirectory('private_uploads/eula-pdfs', 775);
}
$item = $acceptance->checkoutable_type::find($acceptance->checkoutable_id);
$display_model = '';
$pdf_view_route = '';
$pdf_filename = 'accepted-eula-'.date('Y-m-d-h-i-s').'.pdf';
$sig_filename='';
// If signatures are required, make sure we have one
if (Setting::getSettings()->require_accept_signature == '1') {
// The item was accepted, check for a signature
if ($request->filled('signature_output')) {
$sig_filename = 'siglog-' . Str::uuid() . '-' . date('Y-m-d-his') . '.png';
$data_uri = $request->input('signature_output');
$encoded_image = explode(',', $data_uri);
$decoded_image = base64_decode($encoded_image[1]);
Storage::put('private_uploads/signatures/' . $sig_filename, (string)$decoded_image);
// No image data is present, kick them back.
// This mostly only applies to users on super-duper crapola browsers *cough* IE *cough*
} else {
return redirect()->back()->with('error', trans('general.shitty_browser'));
}
}
// Get the data array ready for the notifications and PDF generation
$data = [
'item_tag' => $item->asset_tag,
'item_name' => $item->name, // this handles licenses seats, which don't have a 'name' field
'item_model' => $item->model?->name,
'item_serial' => $item->serial,
'item_status' => $item->assetstatus?->name,
'eula' => $item->getEula(),
'note' => $request->input('note'),
'check_out_date' => Helper::getFormattedDateObject($acceptance->created_at, 'datetime', false),
'accepted_date' => Helper::getFormattedDateObject(now()->format('Y-m-d H:i:s'), 'datetime', false),
'declined_date' => Helper::getFormattedDateObject(now()->format('Y-m-d H:i:s'), 'datetime', false),
'assigned_to' => $assigned_user->display_name,
'site_name' => $settings->site_name,
'company_name' => $item->company?->name?? $settings->site_name,
'signature' => ($sig_filename) ? storage_path() . '/private_uploads/signatures/' . $sig_filename : null,
'logo' => ($settings->acceptance_pdf_logo) ? public_path() . '/uploads/' . $settings->acceptance_pdf_logo : null,
'date_settings' => $settings->date_display_format,
'admin' => auth()->user()->present()?->fullName,
'qty' => $acceptance->qty ?? 1,
];
if ($request->input('asset_acceptance') == 'accepted') {
if (Setting::getSettings()->require_accept_signature == '1') {
// The item was accepted, check for a signature
if ($request->filled('signature_output')) {
$sig_filename = 'siglog-' . Str::uuid() . '-' . date('Y-m-d-his') . '.png';
$data_uri = $request->input('signature_output');
$encoded_image = explode(',', $data_uri);
$decoded_image = base64_decode($encoded_image[1]);
Storage::put('private_uploads/signatures/' . $sig_filename, (string)$decoded_image);
// No image data is present, kick them back.
// This mostly only applies to users on super-duper crapola browsers *cough* IE *cough*
} else {
return redirect()->back()->with('error', trans('general.shitty_browser'));
}
}
$assigned_user = User::find($acceptance->assigned_to_id);
/**
* Gather the data for the PDF. We fire this whether there is a signature required or not,
* since we want the moment-in-time proof of what the EULA was when they accepted it.
*/
$branding_settings = SettingsController::getPDFBranding();
$path_logo = "";
// Check for the PDF logo path and use that, otherwise use the regular logo path
if (!is_null($branding_settings->acceptance_pdf_logo)) {
$path_logo = public_path() . '/uploads/' . $branding_settings->acceptance_pdf_logo;
} elseif (!is_null($branding_settings->logo)) {
$path_logo = public_path() . '/uploads/' . $branding_settings->logo;
}
$data = [
'item_tag' => $item->asset_tag,
'item_model' => $display_model,
'item_serial' => $item->serial,
'item_status' => $item->assetstatus?->name,
'eula' => $item->getEula(),
'note' => $request->input('note'),
'check_out_date' => Carbon::parse($acceptance->created_at)->format('Y-m-d H:i:s'),
'accepted_date' => Carbon::parse($acceptance->accepted_at)->format('Y-m-d H:i:s'),
'assigned_to' => $assigned_user->display_name,
'company_name' => $branding_settings->site_name,
'signature' => ($sig_filename) ? storage_path() . '/private_uploads/signatures/' . $sig_filename : null,
'logo' => $path_logo,
'date_settings' => $branding_settings->date_display_format,
'admin' => auth()->user()->present()?->fullName,
'qty' => $acceptance->qty ?? 1,
];
// set some language dependent data:
$lg = Array();
$lg['a_meta_charset'] = 'UTF-8';
$lg['w_page'] = 'page';
$pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->setRTL(false);
$pdf->setLanguageArray($lg);
$pdf->SetFontSubsetting(true);
$pdf->SetCreator('Snipe-IT');
$pdf->SetAuthor($data['assigned_to']);
$pdf->SetTitle('Asset Acceptance: '.$data['item_tag']);
$pdf->SetSubject('Asset Acceptance: '.$data['item_tag']);
$pdf->SetKeywords('Snipe-IT, assets, acceptance, eula', 'tos');
$pdf->SetFont('dejavusans', '', 8, '', true);
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->AddPage();
$pdf->writeHTML('<img src="'.$path_logo.'" height="30">', true, 0, true, 0, '');
if ($data['item_serial']) {
$pdf->writeHTML("<strong>" . trans('general.asset_tag') . '</strong>: ' . $data['item_tag'], true, 0, true, 0, '');
}
$pdf->writeHTML("<strong>".trans('general.asset_model').'</strong>: '.$data['item_model'], true, 0, true, 0, '');
if ($data['item_serial']) {
$pdf->writeHTML("<strong>".trans('admin/hardware/form.serial').'</strong>: '.$data['item_serial'], true, 0, true, 0, '');
}
$pdf->writeHTML("<strong>".trans('general.assigned_date').'</strong>: '.$data['check_out_date'], true, 0, true, 0, '');
$pdf->writeHTML("<strong>".trans('general.assignee').'</strong>: '.$data['assigned_to'], true, 0, true, 0, '');
$pdf->Ln();
// Break the EULA into lines based on newlines, and check each line for RTL or CJK characters
$eula_lines = preg_split("/\r\n|\n|\r/", $item->getEula());
foreach ($eula_lines as $eula_line) {
Helper::hasRtl($eula_line) ? $pdf->setRTL(true) : $pdf->setRTL(false);
Helper::isCjk($eula_line) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true);
$pdf->writeHTML(Helper::parseEscapedMarkedown($eula_line), true, 0, true, 0, '');
}
$pdf->Ln();
$pdf->Ln();
$pdf->setRTL(false);
$pdf->writeHTML('<br><br>', true, 0, true, 0, '');
if ($data['note'] != null) {
Helper::isCjk($data['note']) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true);
$pdf->writeHTML("<strong>".trans('general.notes') . '</strong>: ' . $data['note'], true, 0, true, 0, '');
$pdf->Ln();
}
if ($data['signature'] != null) {
$pdf->writeHTML('<img src="'.$data['signature'].'" style="max-width: 600px;">', true, 0, true, 0, '');
$pdf->writeHTML('<hr>', true, 0, true, 0, '');
}
$pdf->writeHTML("<strong>".trans('general.accepted_date').'</strong>: '.$data['accepted_date'], true, 0, true, 0, '');
$pdf_content = $pdf->Output($pdf_filename, 'S');
$pdf_filename = 'accepted-'.$acceptance->checkoutable_id.'-'.$acceptance->display_checkoutable_type.'-eula-'.date('Y-m-d-h-i-s').'.pdf';
// Generate the PDF content
$pdf_content = $acceptance->generateAcceptancePdf($data, $acceptance);
Storage::put('private_uploads/eula-pdfs/' .$pdf_filename, $pdf_content);
// Log the acceptance
$acceptance->accept($sig_filename, $item->getEula(), $pdf_filename, $request->input('note'));
// Send the PDF to the signing user
@@ -270,45 +193,9 @@ class AcceptanceController extends Controller
$return_msg = trans('admin/users/message.accepted');
// Item was not accepted
// Item was declined
} else {
if (Setting::getSettings()->require_accept_signature == '1') {
// The item was declined, check for a signature
if ($request->filled('signature_output')) {
$sig_filename = 'siglog-' . Str::uuid() . '-' . date('Y-m-d-his') . '.png';
$data_uri = $request->input('signature_output');
$encoded_image = explode(',', $data_uri);
$decoded_image = base64_decode($encoded_image[1]);
Storage::put('private_uploads/signatures/' . $sig_filename, (string)$decoded_image);
// No image data is present, kick them back.
// This mostly only applies to users on super-duper crapola browsers *cough* IE *cough*
} else {
return redirect()->back()->with('error', trans('general.shitty_browser'));
}
}
// Format the data to send the declined notification
$branding_settings = SettingsController::getPDFBranding();
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
$data = [
'item_tag' => $item->asset_tag,
'item_model' => $item->model ? $item->model->name : $item->display_name,
'item_serial' => $item->serial,
'item_status' => $item->assetstatus?->name,
'note' => $request->input('note'),
'declined_date' => Carbon::parse($acceptance->declined_at)->format('Y-m-d'),
'signature' => ($sig_filename) ? storage_path() . '/private_uploads/signatures/' . $sig_filename : null,
'assigned_to' => $assigned_to,
'company_name' => $branding_settings->site_name,
'date_settings' => $branding_settings->date_display_format,
'qty' => $acceptance->qty ?? 1,
];
for ($i = 0; $i < ($acceptance->qty ?? 1); $i++) {
$acceptance->decline($sig_filename, $request->input('note'));
}
@@ -319,6 +206,8 @@ class AcceptanceController extends Controller
$return_msg = trans('admin/users/message.declined');
}
// Send an email notification if one is requested
if ($acceptance->alert_on_response_id) {
try {
$recipient = User::find($acceptance->alert_on_response_id);
@@ -337,9 +226,10 @@ class AcceptanceController extends Controller
Log::warning($e);
}
}
return redirect()->to('account/accept')->with('success', $return_msg);
}
}
+24 -10
View File
@@ -3,11 +3,13 @@
namespace App\Http\Controllers;
use App\Helpers\Helper;
use App\Models\Actionlog;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use \Illuminate\Http\Response;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use \Illuminate\Http\Response;
class ActionlogController extends Controller
{
public function displaySig($filename) : RedirectResponse | Response | bool
@@ -39,17 +41,29 @@ class ActionlogController extends Controller
public function getStoredEula($filename) : Response | BinaryFileResponse | RedirectResponse
{
$this->authorize('view', \App\Models\Asset::class);
if (config('filesystems.default') == 's3_private') {
return redirect()->away(Storage::disk('s3_private')->temporaryUrl('private_uploads/eula-pdfs/'.$filename, now()->addMinutes(5)));
if ($actionlog = Actionlog::where('filename', $filename)->with('user')->with('target')->firstOrFail()) {
$this->authorize('view', $actionlog->target);
$this->authorize('view', $actionlog->user);
if (config('filesystems.default') == 's3_private') {
return redirect()->away(Storage::disk('s3_private')->temporaryUrl('private_uploads/eula-pdfs/' . $filename, now()->addMinutes(5)));
}
if (Storage::exists('private_uploads/eula-pdfs/' . $filename)) {
if (request()->input('inline') == 'true') {
return response()->file(config('app.private_uploads') . '/eula-pdfs/' . $filename);
}
return response()->download(config('app.private_uploads') . '/eula-pdfs/' . $filename);
}
return redirect()->back()->with('error', trans('general.file_does_not_exist'));
}
if (Storage::exists('private_uploads/eula-pdfs/'.$filename)) {
return response()->download(config('app.private_uploads').'/eula-pdfs/'.$filename);
}
return redirect()->back()->with('error', trans('general.file_does_not_exist'));
return redirect()->back()->with('error', trans('general.record_not_found'));
}
}
@@ -647,6 +647,15 @@ class BulkAssetsController extends Controller
$assets = Asset::findOrFail($asset_ids);
// Prevent checking out assets that are already checked out
if ($assets->pluck('assigned_to')->unique()->filter()->isNotEmpty()) {
// re-add the asset ids so the assets select is re-populated
$request->session()->flashInput(['selected_assets' => $asset_ids]);
return redirect(route('hardware.bulkcheckout.show'))
->with('error', trans('general.error_assets_already_checked_out'));
}
if (request('checkout_to_type') == 'asset') {
foreach ($asset_ids as $asset_id) {
if ($target->id == $asset_id) {
@@ -36,6 +36,7 @@ class AccessoriesTransformer
'qty' => ($accessory->qty) ? (int) $accessory->qty : null,
'purchase_date' => ($accessory->purchase_date) ? Helper::getFormattedDateObject($accessory->purchase_date, 'date') : null,
'purchase_cost' => Helper::formatCurrencyOutput($accessory->purchase_cost),
'total_cost' => Helper::formatCurrencyOutput($accessory->totalCostSum()),
'order_number' => ($accessory->order_number) ? e($accessory->order_number) : null,
'min_qty' => ($accessory->min_amt) ? (int) $accessory->min_amt : null, // Legacy - should phase out - replaced by below, for the bootstrap table formatter
'min_amt' => ($accessory->min_amt) ? (int) $accessory->min_amt : null,
@@ -147,7 +147,7 @@ class ActionlogsTransformer
[
'url' => $actionlog->uploads_file_url(),
'filename' => $actionlog->filename,
'inlineable' => StorageHelper::allowSafeInline($actionlog->uploads_file_url()),
'inlineable' => StorageHelper::allowSafeInline($actionlog->uploads_file_path()),
'exists_on_disk' => Storage::exists($actionlog->uploads_file_path()) ? true : false,
] : null,
@@ -43,6 +43,7 @@ class ComponentsTransformer
'order_number' => e($component->order_number),
'purchase_date' => Helper::getFormattedDateObject($component->purchase_date, 'date'),
'purchase_cost' => Helper::formatCurrencyOutput($component->purchase_cost),
'total_cost' => Helper::formatCurrencyOutput($component->totalCostSum()),
'remaining' => (int) $component->numRemaining(),
'company' => ($component->company) ? [
'id' => (int) $component->company->id,
@@ -37,6 +37,7 @@ class ConsumablesTransformer
'remaining' => $consumable->numRemaining(),
'order_number' => e($consumable->order_number),
'purchase_cost' => Helper::formatCurrencyOutput($consumable->purchase_cost),
'total_cost' => Helper::formatCurrencyOutput($consumable->totalCostSum()),
'purchase_date' => Helper::getFormattedDateObject($consumable->purchase_date, 'date'),
'qty' => (int) $consumable->qty,
'notes' => ($consumable->notes) ? Helper::parseEscapedMarkedownInline($consumable->notes) : null,
+4
View File
@@ -357,6 +357,10 @@ class Accessory extends SnipeModel
$accessory_checkout->limit(1)->delete();
}
public function totalCostSum() {
return $this->purchase_cost !== null ? $this->qty * $this->purchase_cost : null;
}
/**
* -----------------------------------------------
+100 -3
View File
@@ -2,11 +2,14 @@
namespace App\Models;
use App\Helpers\Helper;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Notifications\Notifiable;
use TCPDF;
class CheckoutAcceptance extends Model
{
@@ -129,8 +132,7 @@ class CheckoutAcceptance extends Model
/**
* Filter checkout acceptences by the user
*
* @param Illuminate\Database\Eloquent\Builder $query
* @param User $user
* @param User $user
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeForUser(Builder $query, User $user)
@@ -141,7 +143,6 @@ class CheckoutAcceptance extends Model
/**
* Filter to only get pending acceptances
*
* @param Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopePending(Builder $query)
@@ -153,4 +154,100 @@ class CheckoutAcceptance extends Model
{
return $query->whereNull('accepted_at')->whereNotNull('declined_at');
}
protected function displayCheckoutableType(): Attribute
{
return Attribute:: make(
get: fn(mixed $value) => strtolower(str_replace('App\Models\\', '', $this->checkoutable_type)),
);
}
public function generateAcceptancePdf($data, $pdf_filename) {
// set some language dependent data:
$lg = Array();
$lg['a_meta_charset'] = 'UTF-8';
$lg['w_page'] = 'page';
$pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->setRTL(false);
$pdf->setLanguageArray($lg);
$pdf->SetFontSubsetting(true);
$pdf->SetCreator('Snipe-IT Asset Management System');
$pdf->SetAuthor($data['assigned_to']);
$pdf->SetTitle('Asset Acceptance: '.$data['item_tag']);
$pdf->SetSubject('Asset Acceptance: '.$data['item_tag']);
$pdf->SetKeywords('Snipe-IT, assets, acceptance, eula, tos');
$pdf->SetFont('dejavusans', '', 8, '', true);
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage();
if ($data['logo'] != null) {
$pdf->writeHTML('<img src="'.$data['logo'].'">', true, 0, true, 0, '');
} else {
$pdf->writeHTML('<h3>'.$data['site_name'].'</h3><br /><br />', true, 0, true, 0, 'C');
}
$pdf->Ln();
$pdf->writeHTML(trans('general.date') . ': ' . Helper::getFormattedDateObject(now(), 'datetime', false), true, 0, true, 0, '');
if ($data['company_name'] != null) {
$pdf->writeHTML(trans('general.company') . ': ' . e($data['company_name']), true, 0, true, 0, '');
}
if ($data['item_tag'] != null) {
$pdf->writeHTML(trans('general.asset_tag') . ': ' . e($data['item_tag']), true, 0, true, 0, '');
}
if ($data['item_name'] != null) {
$pdf->writeHTML(trans('general.name') . ': ' . e($data['item_name']), true, 0, true, 0, '');
}
if ($data['item_model'] != null) {
$pdf->writeHTML(trans('general.asset_model') . ': ' . e($data['item_model']), true, 0, true, 0, '');
}
if ($data['item_serial'] != null) {
$pdf->writeHTML(trans('admin/hardware/form.serial').': '.e($data['item_serial']), true, 0, true, 0, '');
}
if (($data['qty'] != null) && ($data['qty'] > 1)) {
$pdf->writeHTML(trans('general.qty').': '.e($data['qty']), true, 0, true, 0, '');
}
$pdf->writeHTML(trans('general.assignee').': '.e($data['assigned_to']), true, 0, true, 0, '');
$pdf->Ln();
$pdf->writeHTML('<hr>', true, 0, true, 0, '');
// Break the EULA into lines based on newlines, and check each line for RTL or CJK characters
$eula_lines = preg_split("/\r\n|\n|\r/", $data['eula']);
foreach ($eula_lines as $eula_line) {
Helper::hasRtl($eula_line) ? $pdf->setRTL(true) : $pdf->setRTL(false);
Helper::isCjk($eula_line) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true);
$pdf->writeHTML(Helper::parseEscapedMarkedown($eula_line), true, 0, true, 0, '');
}
$pdf->Ln();
$pdf->Ln();
$pdf->setRTL(false);
$pdf->Ln();
if ($data['signature'] != null) {
$pdf->writeHTML('<img src="'.$data['signature'].'">', true, 0, true, 0, '');
$pdf->writeHTML('<hr>', true, 0, true, 0, '');
$pdf->writeHTML(e($data['assigned_to']), true, 0, true, 0, 'C');
$pdf->Ln();
}
if ($data['note'] != null) {
Helper::isCjk($data['note']) ? $pdf->SetFont('cid0cs', '', 9) : $pdf->SetFont('dejavusans', '', 8, '', true);
$pdf->writeHTML(trans('general.notes') . ': ' . e($data['note']), true, 0, true, 0, '');
$pdf->Ln();
}
$pdf->writeHTML(trans('general.assigned_date').': '.e($data['check_out_date']), true, 0, true, 0, '');
$pdf->writeHTML(trans('general.accepted_date').': '.e($data['accepted_date']), true, 0, true, 0, '');
return $pdf->Output($pdf_filename, 'S');
}
}
+3
View File
@@ -288,7 +288,10 @@ class Component extends SnipeModel
return $this->qty - $this->numCheckedOut();
}
public function totalCostSum() {
return $this->purchase_cost !== null ? $this->qty * $this->purchase_cost : null;
}
/**
* -----------------------------------------------
* BEGIN MUTATORS
+3
View File
@@ -312,7 +312,10 @@ class Consumable extends SnipeModel
return $remaining;
}
public function totalCostSum() {
return $this->purchase_cost !== null ? $this->qty * $this->purchase_cost : null;
}
/**
* -----------------------------------------------
* BEGIN MUTATORS
+3 -3
View File
@@ -724,7 +724,7 @@ class License extends Depreciable
public static function getExpiringLicenses($days = 60)
{
return self::whereNull('deleted_at')
return self::whereNull('licenses.deleted_at')
// The termination date is null or within range
->where(function ($query) use ($days) {
@@ -752,7 +752,7 @@ class License extends Depreciable
public function scopeActiveLicenses($query)
{
return $query->whereNull('deleted_at')
return $query->whereNull('licenses.deleted_at')
// The termination date is null or within range
->where(function ($query) {
@@ -768,7 +768,7 @@ class License extends Depreciable
public function scopeExpiredLicenses($query)
{
return $query->whereNull('deleted_at')
return $query->whereNull('licenses.deleted_at')
// The termination date is null or within range
->where(function ($query) {
+16
View File
@@ -7,6 +7,7 @@ use App\Models\Traits\CompanyableChildTrait;
use App\Notifications\CheckinLicenseNotification;
use App\Notifications\CheckoutLicenseNotification;
use App\Presenters\Presentable;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -64,6 +65,21 @@ class LicenseSeat extends SnipeModel implements ICompanyableChild
return $this->license->getEula();
}
protected function name(): Attribute
{
return Attribute:: make(
get: fn(mixed $value) => $this->license->name,
);
}
protected function displayName(): Attribute
{
return Attribute:: make(
get: fn(mixed $value) => $this->license->name,
);
}
/**
* Establishes the seat -> license relationship
*
@@ -2,6 +2,7 @@
namespace App\Notifications;
use AllowDynamicProperties;
use App\Helpers\Helper;
use App\Models\Setting;
use Illuminate\Bus\Queueable;
@@ -10,7 +11,7 @@ use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Messages\SlackMessage;
use Illuminate\Notifications\Notification;
class AcceptanceAssetAcceptedNotification extends Notification
#[AllowDynamicProperties] class AcceptanceAssetAcceptedNotification extends Notification
{
use Queueable;
@@ -22,16 +23,18 @@ class AcceptanceAssetAcceptedNotification extends Notification
public function __construct($params)
{
$this->item_tag = $params['item_tag'];
$this->item_name = $params['item_name'];
$this->item_model = $params['item_model'];
$this->item_serial = $params['item_serial'];
$this->item_status = $params['item_status'];
$this->accepted_date = Helper::getFormattedDateObject($params['accepted_date'], 'date', false);
$this->accepted_date = Helper::getFormattedDateObject($params['accepted_date'], 'datetime', false);
$this->assigned_to = $params['assigned_to'];
$this->note = $params['note'];
$this->company_name = $params['company_name'];
$this->admin = $params['admin'] ?? null;
$this->settings = Setting::getSettings();
$this->file = $params['file'] ?? null;
$this->qty = $params['qty'] ?? null;
$this->note = $params['note'] ?? null;
$this->admin = $params['admin'] ?? null;
}
@@ -66,6 +69,7 @@ class AcceptanceAssetAcceptedNotification extends Notification
$message = (new MailMessage)->markdown('notifications.markdown.asset-acceptance',
[
'item_tag' => $this->item_tag,
'item_name' => $this->item_name,
'item_model' => $this->item_model,
'item_serial' => $this->item_serial,
'item_status' => $this->item_status,
@@ -73,9 +77,9 @@ class AcceptanceAssetAcceptedNotification extends Notification
'accepted_date' => $this->accepted_date,
'assigned_to' => $this->assigned_to,
'company_name' => $this->company_name,
'admin' => $this->admin,
'qty' => $this->qty,
'intro_text' => trans('mail.acceptance_asset_accepted'),
'admin' => $this->admin,
])
->subject(trans('mail.acceptance_asset_accepted'));
@@ -2,13 +2,14 @@
namespace App\Notifications;
use AllowDynamicProperties;
use App\Helpers\Helper;
use App\Models\Setting;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class AcceptanceAssetAcceptedToUserNotification extends Notification
#[AllowDynamicProperties] class AcceptanceAssetAcceptedToUserNotification extends Notification
{
use Queueable;
@@ -20,16 +21,18 @@ class AcceptanceAssetAcceptedToUserNotification extends Notification
public function __construct($params)
{
$this->item_tag = $params['item_tag'];
$this->item_name = $params['item_name'];
$this->item_model = $params['item_model'];
$this->item_serial = $params['item_serial'];
$this->item_status = $params['item_status'];
$this->accepted_date = Helper::getFormattedDateObject($params['accepted_date'], 'date', false);
$this->accepted_date = Helper::getFormattedDateObject($params['accepted_date'], 'datetime', false);
$this->assigned_to = $params['assigned_to'];
$this->note = $params['note'];
$this->note = $params['note'] ?? null;
$this->company_name = $params['company_name'];
$this->settings = Setting::getSettings();
$this->file = $params['file'] ?? null;
$this->qty = $params['qty'] ?? null;
$this->admin = $params['admin'] ?? null;
}
/**
@@ -59,6 +62,7 @@ class AcceptanceAssetAcceptedToUserNotification extends Notification
$message = (new MailMessage)->markdown('notifications.markdown.asset-acceptance',
[
'item_tag' => $this->item_tag,
'item_name' => $this->item_name,
'item_model' => $this->item_model,
'item_serial' => $this->item_serial,
'item_status' => $this->item_status,
@@ -66,11 +70,12 @@ class AcceptanceAssetAcceptedToUserNotification extends Notification
'accepted_date' => $this->accepted_date,
'assigned_to' => $this->assigned_to,
'company_name' => $this->company_name,
'admin' => $this->admin,
'qty' => $this->qty,
'intro_text' => trans('mail.acceptance_asset_accepted_to_user', ['site_name' => $this->company_name ?? $this->settings->site_name]),
'intro_text' => trans_choice('mail.acceptance_asset_accepted_to_user', $this->qty, ['qty' => $this->qty, 'site_name' => $this->settings->site_name]),
])
->attach($pdf_path)
->subject(trans('mail.acceptance_asset_accepted_to_user', ['site_name' => $this->settings->site_name]));
->subject(trans_choice('mail.acceptance_asset_accepted_to_user', $this->qty, ['qty' => $this->qty, 'site_name' => $this->settings->site_name]));
return $message;
}
+6
View File
@@ -121,6 +121,12 @@ class AccessoryPresenter extends Presenter
'searchable' => true,
'sortable' => true,
'title' => trans('general.unit_cost'),
'class' => 'text-right text-padding-number-cell',
], [
'field' => 'total_cost',
'searchable' => true,
'sortable' => true,
'title' => trans('general.total_cost'),
'footerFormatter' => 'sumFormatterQuantity',
'class' => 'text-right text-padding-number-cell',
], [
+26 -20
View File
@@ -79,6 +79,25 @@ class ComponentPresenter extends Presenter
'title' => trans('general.manufacturer'),
'visible' => false,
'formatter' => 'manufacturersLinkObjFormatter',
], [
'field' => 'location',
'searchable' => true,
'sortable' => true,
'title' => trans('general.location'),
'formatter' => 'locationsLinkObjFormatter',
], [
'field' => 'order_number',
'searchable' => true,
'sortable' => true,
'title' => trans('general.order_number'),
'visible' => true,
], [
'field' => 'purchase_date',
'searchable' => true,
'sortable' => true,
'title' => trans('general.purchase_date'),
'visible' => true,
'formatter' => 'dateDisplayFormatter',
], [
'field' => 'min_amt',
'searchable' => false,
@@ -103,33 +122,20 @@ class ComponentPresenter extends Presenter
'visible' => true,
'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter',
], [
'field' => 'location',
'searchable' => true,
'sortable' => true,
'title' => trans('general.location'),
'formatter' => 'locationsLinkObjFormatter',
], [
'field' => 'order_number',
'searchable' => true,
'sortable' => true,
'title' => trans('general.order_number'),
'visible' => true,
], [
'field' => 'purchase_date',
'searchable' => true,
'sortable' => true,
'title' => trans('general.purchase_date'),
'visible' => true,
'formatter' => 'dateDisplayFormatter',
], [
'field' => 'purchase_cost',
'searchable' => true,
'sortable' => true,
'title' => trans('general.unit_cost'),
'visible' => true,
'footerFormatter' => 'sumFormatterQuantity',
'class' => 'text-right',
], [
'field' => 'total_cost',
'searchable' => true,
'sortable' => true,
'title' => trans('general.total_cost'),
'footerFormatter' => 'sumFormatterQuantity',
'class' => 'text-right text-padding-number-cell',
], [
'field' => 'notes',
'searchable' => true,
+36 -29
View File
@@ -67,35 +67,6 @@ class ConsumablePresenter extends Presenter
'searchable' => true,
'sortable' => true,
'title' => trans('general.model_no'),
], [
'field' => 'item_no',
'searchable' => true,
'sortable' => true,
'title' => trans('admin/consumables/general.item_no'),
], [
'field' => 'qty',
'searchable' => false,
'sortable' => true,
'title' => trans('admin/components/general.total'),
'visible' => true,
'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter',
], [
'field' => 'remaining',
'searchable' => false,
'sortable' => true,
'title' => trans('admin/components/general.remaining'),
'visible' => true,
'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter',
], [
'field' => 'min_amt',
'searchable' => false,
'sortable' => true,
'title' => trans('general.min_amt'),
'visible' => true,
'formatter' => 'minAmtFormatter',
'class' => 'text-right text-padding-number-cell',
], [
'field' => 'location',
'searchable' => true,
@@ -103,6 +74,12 @@ class ConsumablePresenter extends Presenter
'title' => trans('general.location'),
'formatter' => 'locationsLinkObjFormatter',
], [
'field' => 'item_no',
'searchable' => true,
'sortable' => true,
'title' => trans('admin/consumables/general.item_no'),
], [
'field' => 'manufacturer',
'searchable' => true,
'sortable' => true,
@@ -122,12 +99,42 @@ class ConsumablePresenter extends Presenter
'title' => trans('general.purchase_date'),
'visible' => true,
'formatter' => 'dateDisplayFormatter',
], [
'field' => 'min_amt',
'searchable' => false,
'sortable' => true,
'title' => trans('general.min_amt'),
'visible' => true,
'formatter' => 'minAmtFormatter',
'class' => 'text-right text-padding-number-cell',
], [
'field' => 'qty',
'searchable' => false,
'sortable' => true,
'title' => trans('admin/components/general.total'),
'visible' => true,
'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter',
], [
'field' => 'remaining',
'searchable' => false,
'sortable' => true,
'title' => trans('admin/components/general.remaining'),
'visible' => true,
'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter',
], [
'field' => 'purchase_cost',
'searchable' => true,
'sortable' => true,
'title' => trans('general.unit_cost'),
'visible' => true,
'class' => 'text-right text-padding-number-cell',
], [
'field' => 'total_cost',
'searchable' => true,
'sortable' => true,
'title' => trans('general.total_cost'),
'footerFormatter' => 'sumFormatterQuantity',
'class' => 'text-right text-padding-number-cell',
], [
+5 -5
View File
@@ -1,10 +1,10 @@
<?php
return array (
'app_version' => 'v8.3.1',
'full_app_version' => 'v8.3.1 - build 19577-g7dd493da3',
'build_version' => '19577',
'app_version' => 'v8.3.2',
'full_app_version' => 'v8.3.2 - build 19905-g028b4e7b7',
'build_version' => '19905',
'prerelease_version' => '',
'hash_version' => 'g7dd493da3',
'full_hash' => 'v8.3.1-15-g7dd493da3',
'hash_version' => 'g028b4e7b7',
'full_hash' => 'v8.3.2-319-g028b4e7b7',
'branch' => 'develop',
);
+3
View File
@@ -1501,6 +1501,9 @@ caption.tableCaption {
white-space: preserve;
display: inline-block;
}
input[name="columnsSearch"] {
width: 120px;
}
/*# sourceMappingURL=app.css.map*/
File diff suppressed because one or more lines are too long
+3
View File
@@ -1125,6 +1125,9 @@ caption.tableCaption {
white-space: preserve;
display: inline-block;
}
input[name="columnsSearch"] {
width: 120px;
}
/*# sourceMappingURL=overrides.css.map*/
File diff suppressed because one or more lines are too long
+6
View File
@@ -22837,6 +22837,9 @@ caption.tableCaption {
white-space: preserve;
display: inline-block;
}
input[name="columnsSearch"] {
width: 120px;
}
/*# sourceMappingURL=app.css.map*/
@@ -24449,6 +24452,9 @@ caption.tableCaption {
white-space: preserve;
display: inline-block;
}
input[name="columnsSearch"] {
width: 120px;
}
/*# sourceMappingURL=overrides.css.map*/
+3 -3
View File
@@ -2,8 +2,8 @@
"/js/dist/all.js": "/js/dist/all.js?id=76d88f0f91b852f7eecbce357ab5858b",
"/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=42f97cd5b9ee7521b04a448e7fc16ac9",
"/css/dist/skins/_all-skins.css": "/css/dist/skins/_all-skins.css?id=d81a7ed323f68a7c5e3e9115f7fb5404",
"/css/build/overrides.css": "/css/build/overrides.css?id=d8bef2b8ef03ee8dbb120749211eafc0",
"/css/build/app.css": "/css/build/app.css?id=1bf6a5e78cbccff6e6d32640c28c54b8",
"/css/build/overrides.css": "/css/build/overrides.css?id=d6ec1f1e36c57f8cd96218d2a59a2580",
"/css/build/app.css": "/css/build/app.css?id=d591faf82795dc8151a6d3f84c26f5a4",
"/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=ee0ed88465dd878588ed044eefb67723",
"/css/dist/skins/skin-yellow.css": "/css/dist/skins/skin-yellow.css?id=3d8a3d2035ea28aaad4a703c2646f515",
"/css/dist/skins/skin-yellow-dark.css": "/css/dist/skins/skin-yellow-dark.css?id=3979929a3423ff35b96b1fc84299fdf3",
@@ -19,7 +19,7 @@
"/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=b2cd9f59d7e8587939ce27b2d3363d82",
"/css/dist/skins/skin-blue-dark.css": "/css/dist/skins/skin-blue-dark.css?id=7277edd636cf46aa7786a4449ce0ead7",
"/css/dist/skins/skin-black.css": "/css/dist/skins/skin-black.css?id=cbd06cc1d58197ccc81d4376bbaf0d28",
"/css/dist/all.css": "/css/dist/all.css?id=dd5f7ab27ec80569b90d63a883718ff9",
"/css/dist/all.css": "/css/dist/all.css?id=ff957e6cef08b72d32cf28fe50da645a",
"/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7",
"/css/dist/signature-pad.min.css": "/css/dist/signature-pad.min.css?id=6a89d3cd901305e66ced1cf5f13147f7",
"/js/select2/i18n/af.js": "/js/select2/i18n/af.js?id=4f6fcd73488ce79fae1b7a90aceaecde",
+4
View File
@@ -1260,4 +1260,8 @@ caption.tableCaption {
clip: rect(0,0,0,0);
white-space: preserve;
display: inline-block;
}
input[name="columnsSearch"] {
width: 120px;
}
+2
View File
@@ -309,6 +309,7 @@ return [
'total_licenses' => 'total licenses',
'total_accessories' => 'total accessories',
'total_consumables' => 'total consumables',
'total_cost' => 'Total Cost',
'type' => 'Type',
'undeployable' => 'Un-deployable',
'unknown_admin' => 'Unknown Admin',
@@ -519,6 +520,7 @@ return [
'item_name_var' => ':item Name',
'error_user_company' => 'Checkout target company and asset company do not match',
'error_user_company_accept_view' => 'An Asset assigned to you belongs to a different company so you can\'t accept nor deny it, please check with your manager',
'error_assets_already_checked_out' => 'One or more of the assets are already checked out',
'importer' => [
'checked_out_to_fullname' => 'Checked Out to: Full Name',
'checked_out_to_first_name' => 'Checked Out to: First Name',
+1 -1
View File
@@ -31,7 +31,7 @@ return [
'Low_Inventory_Report' => 'Low Inventory Report',
'a_user_canceled' => 'A user has canceled an item request on the website',
'a_user_requested' => 'A user has requested an item on the website',
'acceptance_asset_accepted_to_user' => 'You have accepted an item assigned to you by :site_name',
'acceptance_asset_accepted_to_user' => 'You have accepted an item assigned to you by :site_name|You have accepted :qty items assigned to you by :site_name',
'acceptance_asset_accepted' => 'A user has accepted an item',
'acceptance_asset_declined' => 'A user has declined an item',
'send_pdf_copy' => 'Send a copy of this acceptance to my email address',
+76 -10
View File
@@ -16,19 +16,85 @@
@section('inputFields')
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/accessories/general.accessory_name')])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
:$errors
name="name"
/>
@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id', 'required' => 'true','category_type' => 'accessory'])
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
@include ('partials.forms.edit.model_number')
@include ('partials.forms.edit.order_number')
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.purchase_date'),'fieldname' => 'purchase_date'])
@include ('partials.forms.edit.purchase_cost', ['currency_type' => $item->location->currency ?? null, 'unit_cost' => trans('general.unit_cost')])
@include ('partials.forms.edit.quantity')
@include ('partials.forms.edit.minimum_quantity')
@include ('partials.forms.edit.notes')
<!-- Model Number -->
<x-form-row
:label="trans('general.model_no')"
:$item
name="model_number"
/>
<!-- Order number -->
<x-form-row
:label="trans('general.order_number')"
:$item
name="order_number"
input_div_class="col-md-5 col-sm-12"
/>
<!-- Purchase date -->
<x-form-row
:label="trans('general.purchase_date')"
:$item
name="purchase_date"
type="date"
input_div_class="col-md-4 col-sm-12"
:value="old('purchase_date', (($item->purchase_date && $item->purchase_date->format('Y-m-d')) ?? ''))"
/>
<!-- Purchase cost -->
<x-form-row
:label="trans('general.unit_cost')"
:$item
name="purchase_cost"
type="number"
maxlength="25"
min="0.00"
max="99999999999999999.000"
step="0.001"
input_div_class="col-md-4 col-sm-12"
/>
<!-- QTY -->
<x-form-row
:label="trans('general.quantity')"
:$item
input_div_class="col-md-2"
name="qty"
/>
<!-- Min Amount -->
<x-form-row
:label="trans('general.min_amt')"
:$item
name="min_amt"
input_div_class="col-md-2"
minlength="1"
maxlength="5"
type="number"
:info_tooltip_text="trans('general.min_amt_help')"
/>
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>
@include ('partials.forms.edit.image-upload', ['image_path' => app('accessories_upload_path')])
@stop
@@ -244,6 +244,18 @@
</div>
</div>
@endif
@if ($accessory->purchase_cost)
<div class="row">
<div class="col-md-3" style="padding-bottom: 10px;">
<strong>
{{ trans('general.total_cost') }}
</strong>
</div>
<div class="col-md-9" style="word-wrap: break-word;">
{{ Helper::formatCurrencyOutput($accessory->totalCostSum()) }}
</div>
</div>
@endif
<div class="row">
<div class="col-md-3" style="padding-bottom: 10px;">
+33 -16
View File
@@ -20,11 +20,21 @@
}
.m-signature-pad--body {
border-style: solid;
border-style: dashed;
border-color: grey;
border-width: thin;
border-width: thick;
padding-top: 0px;
}
.m-signature-pad {
box-shadow: none;
background-color: inherit;
border: none;
}
</style>
@@ -90,30 +100,37 @@
<canvas style="width:100%;"></canvas>
<input type="hidden" name="signature_output" id="signature_output">
</div>
<div class="col-md-12 col-sm-12 col-lg-12 col-xs-12 text-center">
<div class="col-md-12 col-sm-12 col-lg-12 col-xs-12 text-left">
<button type="button" class="btn btn-sm btn-default clear" data-action="clear" id="clear_button">{{trans('general.clear_signature')}}</button>
</div>
</div>
</div>
@endif
@if (auth()->user()->email!='')
<div class="col-md-12" style="padding-top: 20px; display: none;" id="showEmailBox">
<label class="form-control">
<input type="checkbox" value="1" name="send_copy" id="send_copy" checked="checked" aria-label="send_copy">
{{ trans('mail.send_pdf_copy') }} ({{ auth()->user()->email }})
</label>
</div>
@endif
</div> <!-- / box-body -->
<div class="box-footer text-right" style="display: none;" id="showSubmit">
<button type="submit" class="btn btn-success" id="submit-button">
<i class="fa fa-check icon-white" aria-hidden="true" id="submitIcon"></i>
<span id="buttonText">
<div class="box-footer" style="display: none;" id="showSubmit">
<div class="row">
<div class="col-md-7">
@if (auth()->user()->email!='')
<div class="col-md-12" style="display: none;" id="showEmailBox">
<label class="form-control">
<input type="checkbox" value="1" name="send_copy" id="send_copy" checked="checked" aria-label="send_copy">
{{ trans('mail.send_pdf_copy') }} ({{ auth()->user()->email }})
</label>
</div>
@endif
</div>
<div class="col-md-5 text-right">
<button type="submit" class="btn btn-success" id="submit-button">
<i class="fa fa-check icon-white" aria-hidden="true" id="submitIcon"></i>
<span id="buttonText">
{{ trans_choice('general.i_accept_item', $acceptance->qty ?? null) }}
</span>
</button>
</button>
</div>
</div>
</div><!-- /.box-footer -->
</div> <!-- / box-default -->
</div> <!-- / col -->
-3
View File
@@ -1,3 +0,0 @@
<p>
Hi.
</p>
+2 -4
View File
@@ -4,7 +4,7 @@
'object_type' => '',
])
<!-- begin non-ajaxed file listing table -->
<!-- begin ajaxed file listing table -->
<div class="table-responsive">
<table
data-columns="{{ \App\Presenters\UploadedFilesPresenter::dataTableLayout() }}"
@@ -30,6 +30,4 @@
</div>
<!-- end non-ajaxed file listing table -->
<!-- end ajaxed file listing table -->
@@ -0,0 +1,5 @@
<!-- form-label blade component -->
<label {{ $attributes->merge(['class' => 'control-label']) }}>
{{ $slot }}
</label>
+107
View File
@@ -0,0 +1,107 @@
<!-- form-row blade component -->
@props([
'checkbox_value' => null,
'disabled' => false,
'div_style' => null,
'error_offset_class' => 'col-md-7 col-md-offset-3',
'errors',
'help_text' => null,
'info_tooltip_text' => null,
'input_class' => null,
'input_div_class' => 'col-md-8 col-sm-12',
'input_group_addon' => null,
'input_style' => null,
'item' => null,
'label' => null,
'label_class' => 'col-md-3 col-sm-12 col-xs-12',
'label_style' => null,
'max' => null,
'maxlength' => 191,
'min' => null,
'minlength' => null,
'name' => null,
'placeholder' => null,
'step' => null,
'type' => 'text',
'value' => null,
'value_text' => null,
])
<div {{ $attributes->merge(['class' => 'form-group']) }}>
@if (isset($label))
<x-form-label
:for="$name"
:style="$label_style ?? null"
class="{{ $label_class }}"
>
{{ $label }}
</x-form-label>
@else
@php
$input_div_class = $input_div_class . ' ' . $error_offset_class;
@endphp
@endif
<div {{ $attributes->merge(['class' => $input_div_class, 'style' => $div_style]) }}>
@php
$blade_type = in_array($type, ['text', 'email', 'url', 'tel', 'number', 'password']) ? 'text' : $type;
@endphp
<x-dynamic-component
:$checkbox_value
:$disabled
:$input_group_addon
:$input_style
:$item
:$max
:$maxlength
:$min
:$minlength
:$name
:$placeholder
:$step
:$type
:$value_text
:aria-label="$name"
:class="$input_class"
:component="'input.'.$blade_type"
:id="$name"
:required="Helper::checkIfRequired($item, $name)"
:value="old($name, $item->{$name})"
/>
</div>
@if ($info_tooltip_text)
<!-- Info Tooltip -->
<div class="col-md-1 text-left" style="padding-left:0; margin-top: 5px;">
<x-input.info-tooltip>
{{ $info_tooltip_text }}
</x-input.info-tooltip>
</div>
@endif
@error($name)
<!-- Form Error -->
<div {{ $attributes->merge(['class' => $error_offset_class]) }}>
<span class="alert-msg" role="alert">
<i class="fas fa-times" aria-hidden="true"></i>
{{ $message }}
</span>
</div>
@enderror
@if ($help_text)
<!-- Help Text -->
<div {{ $attributes->merge(['class' => $error_offset_class]) }}>
<p class="help-block">
{!! $help_text !!}
</p>
</div>
@endif
</div>
@@ -0,0 +1,16 @@
@props([
'item' => null,
'field_name' => null,
'input_style' => null,
'required' => false,
'disabled' => false,
'checkbox_value' => null,
'name' => null,
'label' => null,
'value_text' => null,
])
<label class="form-control{{ $disabled ? ' form-control--disabled' : '' }}">
<input type="checkbox" name="{{ $name }}" aria-label="{{ $name }}" value="{{ $checkbox_value }}" @checked(old($name, $item->$name)) {!! $disabled ? 'class="disabled" disabled' : '' !!}>
{{ $value_text ?? $label }}
</label>
@@ -0,0 +1,12 @@
@props([
'item' => null,
'input_style' => null,
'end_date' => null,
])
<!-- Datepicker -->
<div {{ $attributes->merge(['class' => 'input-group date']) }} data-provide="datepicker" data-date-today-highlight="true" data-date-language="{{ auth()->user()->locale }}" data-date-locale="{{ auth()->user()->locale }}" data-date-format="yyyy-mm-dd" data-date-autoclose="true" data-date-clear-btn="true"{{ $end_date ? ' data-date-end-date=' . $end_date : '' }}>
<input type="text" {{ $attributes->merge(['class' => 'form-control']) }}>
<span class="input-group-addon"><x-icon type="calendar" /></span>
</div>
@@ -0,0 +1,4 @@
<a href="#" data-tooltip="true" title="{{ $slot }}" style="padding-left: 0px;">
<x-icon type="more-info" style="font-size: 20px;" />
<span class="sr-only">{{ $slot }}</span>
</a>
@@ -0,0 +1,15 @@
@props([
'item' => null,
'field_name' => null,
'input_style' => null,
'required' => false,
'disabled' => false,
'name' => null,
'label' => null,
'value_text' => null,
])
<label class="form-control{{ $disabled ? ' form-control--disabled' : '' }}">
<input type="radio" name="{{ $name }}" aria-label="{{ $name }}" @checked(old($name)) {!! $disabled ? 'class="disabled" disabled' : '' !!}>
{{ $value_text ?? $label }}
</label>
@@ -0,0 +1,15 @@
@props([
'input_style' => null,
'input_group_addon' => null,
'required' => false,
'item' => null,
])
<!-- input-text blade component -->
<input
{{ $attributes->merge(['class' => 'form-control', 'style' => $input_style]) }}
@required($required)
/>
@if ($input_group_addon)
<span class="input-group-addon">{{ $input_group_addon }}</span>
@endif
+6 -1
View File
@@ -9,7 +9,12 @@
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/categories/general.name')])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
<!-- Type -->
<div class="form-group {{ $errors->has('category_type') ? ' has-error' : '' }}">
@@ -61,6 +61,7 @@
@if ($category->category_type=='asset')
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-show-columns-search="true"
data-cookie-id-table="categoryAssetsTable"
id="categoryAssetsTable"
data-buttons="assetButtons"
+41 -19
View File
@@ -8,26 +8,48 @@
{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/companies/table.name')])
@include ('partials.forms.edit.phone')
@include ('partials.forms.edit.fax')
@include ('partials.forms.edit.email')
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
<!-- Phone -->
<x-form-row
:label="trans('general.phone')"
:$item
name="phone"
type="tel"
/>
<!-- Fax -->
<x-form-row
:label="trans('general.fax')"
:$item
name="fax"
type="tel"
/>
<!-- Email -->
<x-form-row
:label="trans('general.email')"
:$item
name="fax"
type="email"
/>
@include ('partials.forms.edit.image-upload', ['image_path' => app('companies_upload_path')])
<div class="form-group{!! $errors->has('notes') ? ' has-error' : '' !!}">
<label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>
<div class="col-md-8">
<x-input.textarea
name="notes"
id="notes"
:value="old('notes', $item->notes)"
placeholder="{{ trans('general.placeholders.notes') }}"
aria-label="notes"
rows="5"
/>
</div>
</div>
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>
@stop
+1
View File
@@ -94,6 +94,7 @@
data-cookie-id-table="assetsListingTable"
data-id-table="assetsListingTable"
data-side-pagination="server"
data-show-columns-search="true"
data-sort-order="asc"
data-toolbar="#assetsBulkEditToolbar"
data-bulk-button-id="#bulkAssetEditButton"
+90 -10
View File
@@ -16,20 +16,100 @@
{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/components/table.title')])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id','category_type' => 'component'])
@include ('partials.forms.edit.quantity')
@include ('partials.forms.edit.minimum_quantity')
@include ('partials.forms.edit.serial', ['fieldname' => 'serial'])
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])
@include ('partials.forms.edit.model_number')
<!-- QTY -->
<x-form-row
:label="trans('general.quantity')"
:$item
name="qty"
input_div_class="col-md-2"
minlength="1"
maxlength="5"
type="number"
/>
<!-- Min Amount -->
<x-form-row
:label="trans('general.min_amt')"
:$item
name="min_amt"
input_div_class="col-md-2"
minlength="1"
maxlength="5"
type="number"
:info_tooltip_text="trans('general.min_amt_help')"
/>
<x-form-row
:label="trans('admin/hardware/form.serial')"
:$item
name="serial"
type="text"
/>
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])
<!-- Model Number -->
<x-form-row
:label="trans('general.model_no')"
:$item
name="model_number"
input_div_class="col-md-5 col-sm-12"
/>
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
@include ('partials.forms.edit.order_number')
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.purchase_date'),'fieldname' => 'purchase_date'])
@include ('partials.forms.edit.purchase_cost', ['unit_cost' => trans('general.unit_cost')])
@include ('partials.forms.edit.notes')
<!-- Order number -->
<x-form-row
:label="trans('general.order_number')"
:$item
name="order_number"
input_div_class="col-md-5 col-sm-12"
/>
<!-- Purchase date -->
<x-form-row
:label="trans('general.purchase_date')"
:$item
name="purchase_date"
type="date"
input_div_class="col-md-4 col-sm-12"
:value="old('purchase_date', (($item->purchase_date && $item->purchase_date->format('Y-m-d')) ?? ''))"
/>
<!-- Purchase cost -->
<x-form-row
:label="trans('general.unit_cost')"
:$item
name="purchase_cost"
type="number"
maxlength="25"
min="0.00"
max="99999999999999999.000"
step="0.001"
input_div_class="col-md-4 col-sm-12"
/>
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>
@include ('partials.forms.edit.image-upload', ['image_path' => app('components_upload_path')])
@@ -207,6 +207,13 @@
{{ Helper::formatCurrencyOutput($component->purchase_cost) }} </div>
@endif
@if ($component->purchase_cost)
<div class="col-md-12" style="padding-bottom: 5px;"><strong>{{ trans('general.total_cost') }}:</strong>
{{ $snipeSettings->default_currency }}
{{ Helper::formatCurrencyOutput($component->totalCostSum()) }} </div>
@endif
@if ($component->order_number)
<div class="col-md-12" style="padding-bottom: 5px;"><strong>{{ trans('general.order_number') }}:</strong>
{{ $component->order_number }} </div>
+88 -9
View File
@@ -15,19 +15,98 @@
@section('inputFields')
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/consumables/table.title')])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'consumable'])
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
@include ('partials.forms.edit.model_number')
@include ('partials.forms.edit.item_number')
@include ('partials.forms.edit.order_number')
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.purchase_date'),'fieldname' => 'purchase_date'])
@include ('partials.forms.edit.purchase_cost', [ 'unit_cost' => trans('general.unit_cost')])
@include ('partials.forms.edit.quantity')
@include ('partials.forms.edit.minimum_quantity')
@include ('partials.forms.edit.notes')
<!-- Model Number -->
<x-form-row
:label="trans('general.model_no')"
:$item
name="model_number"
input_div_class="col-md-5 col-sm-12"
/>
<!-- Model Number -->
<x-form-row
:label="trans('admin/consumables/general.item_no')"
:$item
name="item_no"
input_div_class="col-md-5 col-sm-12"
/>
<!-- Order number -->
<x-form-row
:label="trans('general.order_number')"
:$item
name="order_number"
input_div_class="col-md-5 col-sm-12"
/>
<!-- Purchase date -->
<x-form-row
:label="trans('general.purchase_date')"
:$item
name="purchase_date"
type="date"
input_div_class="col-md-4 col-sm-12"
:value="old('purchase_date', (($item->purchase_date && $item->purchase_date->format('Y-m-d')) ?? ''))"
/>
<!-- Purchase cost -->
<x-form-row
:label="trans('general.unit_cost')"
:$item
name="purchase_cost"
type="number"
maxlength="25"
min="0.00"
max="99999999999999999.000"
step="0.001"
input_div_class="col-md-4 col-sm-12"
/>
<!-- QTY -->
<x-form-row
:label="trans('general.quantity')"
:$item
name="qty"
input_div_class="col-md-2"
/>
<!-- Min Amount -->
<x-form-row
:label="trans('general.min_amt')"
:$item
name="min_amt"
input_div_class="col-md-2"
minlength="1"
maxlength="5"
type="number"
:info_tooltip_text="trans('general.min_amt_help')"
/>
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>
@include ('partials.forms.edit.image-upload', ['image_path' => app('consumables_upload_path')])
@stop
@@ -281,6 +281,18 @@
</div>
@endif
@if ($consumable->purchase_cost)
<div class="row">
<div class="col-md-3">
{{ trans('general.total_cost') }}
</div>
<div class="col-md-9">
{{ $snipeSettings->default_currency }}
{{ Helper::formatCurrencyOutput($consumable->totalCostSum()) }}
</div>
</div>
@endif
@if ($consumable->order_number)
<div class="row">
<div class="col-md-3">
@@ -40,16 +40,16 @@
<div class="col-md-8">
<!-- Name -->
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-3 control-label">
{{ trans('admin/custom_fields/general.field_name') }}
</label>
<div class="col-md-8 required">
<input class="form-control" aria-label="name" name="name" type="text" required value="{{ old('name', $field->name) }}">
{!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<!-- Name -->
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-3 control-label">
{{ trans('admin/custom_fields/general.field_name') }}
</label>
<div class="col-md-8 required">
<input class="form-control" aria-label="name" name="name" type="text" required value="{{ old('name', $field->name) }}">
{!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<!-- Element Type -->
<div class="form-group {{ $errors->has('element') ? ' has-error' : '' }}">
@@ -11,7 +11,12 @@
@stop
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('general.name')])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
@stop
+30 -17
View File
@@ -7,7 +7,12 @@
{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/departments/table.name')])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
<!-- Company -->
@if (\App\Models\Company::canManageUsersCompanies())
@@ -16,8 +21,21 @@
<input id="hidden_company_id" type="hidden" name="company_id" value="{{ Auth::user()->company_id }}">
@endif
@include ('partials.forms.edit.phone')
@include ('partials.forms.edit.fax')
<!-- Phone -->
<x-form-row
:label="trans('general.phone')"
:$item
name="phone"
type="tel"
/>
<!-- Fax -->
<x-form-row
:label="trans('general.fax')"
:$item
name="fax"
type="tel"
/>
<!-- Manager -->
@include ('partials.forms.edit.user-select', ['translated_name' => trans('admin/users/table.manager'), 'fieldname' => 'manager_id'])
@@ -26,20 +44,15 @@
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
@include ('partials.forms.edit.image-upload', ['image_path' => app('departments_upload_path')])
<div class="form-group{!! $errors->has('notes') ? ' has-error' : '' !!}">
<label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>
<div class="col-md-8">
<x-input.textarea
name="notes"
id="notes"
:value="old('notes', $item->notes)"
placeholder="{{ trans('general.placeholders.notes') }}"
aria-label="notes"
rows="5"
/>
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>
@stop
+17 -11
View File
@@ -9,17 +9,23 @@
{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/depreciations/general.depreciation_name')])
<!-- Months -->
<div class="form-group {{ $errors->has('months') ? ' has-error' : '' }}">
<label for="months" class="col-md-3 control-label">
{{ trans('admin/depreciations/general.number_of_months') }}
</label>
<div class="col-md-9 col-sm-12">
<input class="form-control" type="number" min="0" max="3600" name="months" id="months" value="{{ old('months', $item->months) }}" style="width: 90px;"{!! (\App\Helpers\Helper::checkIfRequired($item, 'months')) ? ' required' : '' !!} />
{!! $errors->first('months', '<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
<!-- Months -->
<x-form-row
:label="'admin/depreciations/general.number_of_months'"
:$item
name="months"
type="number"
min="0"
max="3600"
/>
<!-- Depreciation Minimum -->
<div class="form-group {{ $errors->has('depreciation_min') ? ' has-error' : '' }}">
@@ -65,6 +65,7 @@
<table
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-show-columns-search="true"
data-cookie-id-table="depreciationsAssetTable"
data-id-table="depreciationsAssetTable"
id="depreciationsAssetTable"
@@ -49,6 +49,7 @@
<table
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-show-columns-search="true"
data-cookie-id-table="dueAssetcheckinListing"
data-id-table="dueAssetcheckinListing"
data-side-pagination="server"
+18 -3
View File
@@ -70,7 +70,16 @@
@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/hardware/form.checkout_to'), 'fieldname' => 'assigned_location', 'style' => 'display:none;', 'required' => 'false'])
@endif
@include ('partials.forms.edit.notes')
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
:$errors
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>
@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/hardware/form.default_location'), 'fieldname' => 'rtd_location_id', 'help_text' => trans('general.rtd_location_help')])
@include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/hardware/general.requestable')])
@@ -111,8 +120,14 @@
</legend>
<div id="optional_details" class="col-md-12" style="display:none">
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/hardware/form.name')])
@include ('partials.forms.edit.warranty')
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
:$errors
name="name"
/> @include ('partials.forms.edit.warranty')
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('admin/hardware/form.expected_checkin'),'fieldname' => 'expected_checkin'])
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.next_audit_date'),'fieldname' => 'next_audit_date', 'help_text' => trans('general.next_audit_date_help')])
<!-- byod checkbox -->
+3
View File
@@ -47,6 +47,8 @@
{{-- Page content --}}
@section('content')
<div class="row">
<div class="col-md-12">
<div class="box">
@@ -66,6 +68,7 @@
data-show-footer="true"
data-sort-order="asc"
data-sort-name="name"
data-show-columns-search="true"
data-toolbar="#assetsBulkEditToolbar"
data-bulk-button-id="#bulkAssetEditButton"
data-bulk-form-id="#assetsBulkForm"
+1
View File
@@ -1285,6 +1285,7 @@
<table
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-show-columns-search="true"
data-cookie-id-table="assetsTable"
data-id-table="assetsTable"
data-side-pagination="server"
+6 -1
View File
@@ -6,5 +6,10 @@
{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('general.name')])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
@stop
-5
View File
@@ -25,12 +25,7 @@
<table
data-cookie-id-table="kitModelsTable"
data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableModels() }}"
data-side-pagination="server"
data-sort-order="asc"
data-sort-name="name"
id="kitModelsTable"
+2 -2
View File
@@ -23,8 +23,8 @@
<!-- row -->
<div class="row">
<!-- col-md-8 -->
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0">
<!-- col-md-7 -->
<div class="col-lg-6 col-lg-offset-3 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0">
<form id="create-form" class="form-horizontal" method="post" action="{{ (isset($formAction)) ? $formAction : \Request::url() }}" autocomplete="off" role="form" enctype="multipart/form-data">
+140 -97
View File
@@ -13,124 +13,167 @@
{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/licenses/form.name')])
@include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'license'])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
<!-- Seats -->
<div class="form-group {{ $errors->has('seats') ? ' has-error' : '' }}">
<label for="seats" class="col-md-3 control-label">{{ trans('admin/licenses/form.seats') }}</label>
<div class="col-md-7 col-sm-12">
<div class="col-md-12" style="padding-left:0px">
<input class="form-control" type="text" name="seats" id="seats" value="{{ old('seats', $item->seats) }}" minlength="1" required style="width: 97px;">
</div>
</div>
{!! $errors->first('seats', '<div class="col-md-8 col-md-offset-3"><span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span></div>') !!}
</div>
@include ('partials.forms.edit.minimum_quantity')
@include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'license'])
<!-- Seats -->
<x-form-row
:label="trans('admin/licenses/form.seats')"
:$item
name="seats"
input_div_class="col-md-2"
minlength="1"
maxlength="10000"
type="number"
/>
<!-- Min Seats -->
<x-form-row
:label="trans('general.min_amt')"
:$item
name="seats"
input_div_class="col-md-2"
minlength="1"
maxlength="5"
type="number"
:info_tooltip_text="trans('general.min_amt_help')"
/>
<!-- Product Key -->
@can('viewKeys', $item)
<x-form-row
:label="trans('admin/licenses/form.license_key')"
:$item
name="serial"
type="textarea"
maxlength="65000"
/>
@endcan
<!-- Serial-->
@can('viewKeys', $item)
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="serial" class="col-md-3 control-label">{{ trans('admin/licenses/form.license_key') }}</label>
<div class="col-md-7">
<textarea class="form-control" type="text" name="serial" id="serial" rows="5"{{ (Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}>{{ old('serial', $item->serial) }}</textarea>
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
@endcan
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id',])
<!-- Licensed to name -->
<div class="form-group {{ $errors->has('license_name') ? ' has-error' : '' }}">
<label for="license_name" class="col-md-3 control-label">{{ trans('admin/licenses/form.to_name') }}</label>
<div class="col-md-7">
<input class="form-control" type="text" name="license_name" id="license_name" value="{{ old('license_name', $item->license_name) }}" />
{!! $errors->first('license_name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<!-- Licensed to name -->
<x-form-row
:label="trans('admin/licenses/form.to_name')"
:$item
name="license_name"
/>
<!-- Licensed to email -->
<div class="form-group {{ $errors->has('license_email') ? ' has-error' : '' }}">
<label for="license_email" class="col-md-3 control-label">{{ trans('admin/licenses/form.to_email') }}</label>
<div class="col-md-7">
<input class="form-control" type="email" name="license_email" id="license_email" value="{{ old('license_email', $item->license_email) }}" />
{!! $errors->first('license_email', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<!-- Reassignable -->
<div class="form-group {{ $errors->has('reassignable') ? ' has-error' : '' }}">
<div class="col-md-3 control-label">
<strong>{{ trans('admin/licenses/form.reassignable') }}</strong>
</div>
<div class="col-md-7">
<label class="form-control">
<input type="checkbox" name="reassignable" value="1" aria-label="reassignable" @checked(old('reassignable', $item->id ? $item->reassignable : '1'))>
{{ trans('general.yes') }}
</label>
</div>
</div>
<!-- Licensed to email -->
<x-form-row
:label="trans('admin/licenses/form.to_email')"
:$item
name="license_email"
type="email"
/>
<!-- Reassignable -->
<x-form-row
:label="trans('admin/licenses/form.reassignable')"
:$item
name="reassignable"
type="checkbox"
checkbox_value="1"
:value_text="trans('general.yes')"
/>
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
@include ('partials.forms.edit.order_number')
@include ('partials.forms.edit.purchase_cost')
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.purchase_date'),'fieldname' => 'purchase_date'])
<!-- Expiration Date -->
<div class="form-group {{ $errors->has('expiration_date') ? ' has-error' : '' }}">
<label for="expiration_date" class="col-md-3 control-label">{{ trans('admin/licenses/form.expiration') }}</label>
<!-- Order number -->
<x-form-row
:label="trans('general.order_number')"
:$item
name="order_number"
input_div_class="col-md-5 col-sm-12"
/>
<div class="input-group col-md-4">
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true" data-date-clear-btn="true">
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="expiration_date" id="expiration_date" value="{{ old('expiration_date', ($item->expiration_date) ? $item->expiration_date->format('Y-m-d') : '') }}" maxlength="10">
<span class="input-group-addon"><x-icon type="calendar" /></span>
</div>
{!! $errors->first('expiration_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
<!-- Purchase Order -->
<x-form-row
:label="trans('admin/licenses/form.purchase_order')"
:$item
name="purchase_order"
input_div_class="col-md-5 col-sm-12"
/>
<!-- Purchase cost -->
<x-form-row
:label="trans('general.purchase_cost')"
:$item
name="purchase_cost"
type="number"
maxlength="25"
min="0.00"
max="99999999999999999.000"
step="0.001"
input_div_class="col-md-4 col-sm-12"
/>
<!-- Purchase date -->
<x-form-row
:label="trans('general.purchase_date')"
:$item
name="purchase_date"
type="date"
input_div_class="col-md-4 col-sm-12"
:value="old('purchase_date', (($item->purchase_date && $item->purchase_date->format('Y-m-d')) ?? ''))"
/>
<!-- Expiration Date -->
<x-form-row
:label="trans('admin/licenses/form.expiration')"
:$item
name="expiration_date"
type="date"
input_div_class="col-md-4 col-sm-12"
:value="old('expiration_date', (($item->expiration_date && $item->expiration_date->format('Y-m-d')) ?? ''))"
/>
</div>
<!-- Termination Date -->
<div class="form-group {{ $errors->has('termination_date') ? ' has-error' : '' }}">
<label for="termination_date" class="col-md-3 control-label">{{ trans('admin/licenses/form.termination_date') }}</label>
<x-form-row
:label="trans('admin/licenses/form.termination_date')"
:$item
name="termination_date"
type="date"
input_div_class="col-md-4 col-sm-12"
:value="old('termination_date', (($item->termination_date && $item->termination_date->format('Y-m-d')) ?? ''))"
/>
<div class="input-group col-md-4">
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true" data-date-clear-btn="true">
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="termination_date" id="termination_date" value="{{ old('termination_date', ($item->termination_date) ? $item->termination_date->format('Y-m-d') : '') }}" maxlength="10">
<span class="input-group-addon"><x-icon type="calendar" /></span>
</div>
{!! $errors->first('termination_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
{{-- @TODO How does this differ from Order #? --}}
<!-- Purchase Order -->
<div class="form-group {{ $errors->has('purchase_order') ? ' has-error' : '' }}">
<label for="purchase_order" class="col-md-3 control-label">{{ trans('admin/licenses/form.purchase_order') }}</label>
<div class="col-md-3">
<input class="form-control" type="text" name="purchase_order" id="purchase_order" value="{{ old('purchase_order', $item->purchase_order) }}" maxlength="191" />
{!! $errors->first('purchase_order', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.depreciation')
<!-- Maintained -->
<div class="form-group {{ $errors->has('maintained') ? ' has-error' : '' }}">
<div class="col-md-3 control-label"><strong>{{ trans('admin/licenses/form.maintained') }}</strong></div>
<div class="col-md-7">
<label class="form-control">
<input type="checkbox" name="maintained" value="1" aria-label="maintained" @checked(old('maintained', $item->maintained))>
{{ trans('general.yes') }}
</label>
</div>
</div>
<!-- Maintained -->
<x-form-row
:label="trans('admin/licenses/form.maintained')"
:$item
:value_text="trans('general.yes')"
name="maintained"
type="checkbox"
checkbox_value="1"
/>
@include ('partials.forms.edit.notes')
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>
@stop
+39 -33
View File
@@ -9,7 +9,13 @@
{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/locations/table.name')])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
<!-- parent -->
@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/locations/table.parent'), 'fieldname' => 'parent_id'])
@@ -20,25 +26,30 @@
<!-- Company -->
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
@include ('partials.forms.edit.phone')
@include ('partials.forms.edit.fax')
<!-- Phone -->
<x-form-row
:label="trans('general.phone')"
:$item
name="phone"
type="tel"
/>
<!-- Currency -->
<div class="form-group {{ $errors->has('currency') ? ' has-error' : '' }}">
<label for="currency" class="col-md-3 control-label">
{{ trans('admin/locations/table.currency') }}
</label>
<div class="col-md-7">
<input class="form-control" style="width:100px" type="text" name="currency" aria-label="currency" id="currency" value="{{ old('currency', $item->currency) }}"{!! (Helper::checkIfRequired($item, 'currency')) ? ' required' : '' !!} maxlength="3" />
@error('currency')
<span class="alert-msg">
<x-icon type="x" />
{{ $message }}
</span>
@enderror
<!-- Fax -->
<x-form-row
:label="trans('general.fax')"
:$item
name="fax"
type="tel"
/>
</div>
</div>
<!-- Currency -->
<x-form-row
:label="trans('admin/locations/table.currency')"
:$item
name="currency"
maxlength="3"
input_div_class="col-md-2 col-sm-6 col-xs-6"
/>
@include ('partials.forms.edit.address')
@@ -61,22 +72,17 @@
@endif
@include ('partials.forms.edit.image-upload', ['image_path' => app('locations_upload_path')])
@include ('partials.forms.edit.image-upload', ['image_path' => app('locations_upload_path')])
<div class="form-group{!! $errors->has('notes') ? ' has-error' : '' !!}">
<label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>
<div class="col-md-8">
<x-input.textarea
name="notes"
id="notes"
:value="old('notes', $item->notes)"
placeholder="{{ trans('general.placeholders.notes') }}"
aria-label="notes"
rows="5"
/>
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>
@stop
+3
View File
@@ -210,6 +210,7 @@
@include('partials.asset-bulk-actions')
<table
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-show-columns-search="true"
data-cookie-id-table="assetsListingTable"
data-id-table="assetsListingTable"
data-side-pagination="server"
@@ -237,6 +238,7 @@
<table
role="table"
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-show-columns-search="true"
data-cookie-id-table="assetsAssignedListingTable"
data-id-table="assetsAssignedListingTable"
data-side-pagination="server"
@@ -262,6 +264,7 @@
<table
role="table"
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-show-columns-search="true"
data-cookie-id-table="RTDassetsListingTable"
data-id-table="RTDassetsListingTable"
data-side-pagination="server"
+6 -1
View File
@@ -43,7 +43,12 @@
<div class="box-body">
@include ('partials.forms.edit.name', ['translated_name' => trans('general.name'), 'required' => 'true'])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
<!-- This is a new maintenance -->
@if (!$item->id)
+50 -57
View File
@@ -9,75 +9,68 @@
{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/manufacturers/table.name')])
<!-- Name -->
<x-form-row
:label="trans('admin/manufacturers/table.name')"
:$item
name="name"
/>
<!-- URL -->
<div class="form-group {{ $errors->has('url') ? ' has-error' : '' }}">
<label for="url" class="col-md-3 control-label">{{ trans('general.url') }}
</label>
<div class="col-md-6">
<input class="form-control" type="text" name="url" id="url" value="{{ old('url', $item->url) }}" />
{!! $errors->first('url', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('general.url')"
:$item
name="url"
type="url"
/>
<!-- Support URL -->
<div class="form-group {{ $errors->has('support_url') ? ' has-error' : '' }}">
<label for="support_url" class="col-md-3 control-label">{{ trans('admin/manufacturers/table.support_url') }}
</label>
<div class="col-md-6">
<input class="form-control" type="url" name="support_url" id="support_url" value="{{ old('support_url', $item->support_url) }}" />
{!! $errors->first('support_url', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('admin/manufacturers/table.support_url')"
:$item
name="support_url"
type="url"
/>
<!-- Warranty Lookup URL -->
<div class="form-group {{ $errors->has('warranty_lookup_url') ? ' has-error' : '' }}">
<label for="support_url" class="col-md-3 control-label">{{ trans('admin/manufacturers/table.warranty_lookup_url') }}
</label>
<div class="col-md-6">
<input class="form-control" type="url" name="warranty_lookup_url" id="warranty_lookup_url" value="{{ old('warranty_lookup_url', $item->warranty_lookup_url) }}" />
<p class="help-block">{!! trans('admin/manufacturers/message.support_url_help') !!}</p>
{!! $errors->first('warranty_lookup_url', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('admin/manufacturers/table.warranty_lookup_url')"
:$item
help_text="{!! trans('admin/manufacturers/message.support_url_help') !!}"
name="warranty_lookup_url"
type="url"
/>
<!-- Support Phone -->
<div class="form-group {{ $errors->has('support_phone') ? ' has-error' : '' }}">
<label for="support_phone" class="col-md-3 control-label">{{ trans('admin/manufacturers/table.support_phone') }}
</label>
<div class="col-md-6">
<input class="form-control" type="text" name="support_phone" id="support_phone" value="{{ old('support_phone', $item->support_phone) }}" />
{!! $errors->first('support_phone', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('admin/manufacturers/table.support_phone')"
:$item
name="support_phone"
type="tel"
/>
<!-- Support Email -->
<div class="form-group {{ $errors->has('support_email') ? ' has-error' : '' }}">
<label for="support_email" class="col-md-3 control-label">{{ trans('admin/manufacturers/table.support_email') }}
</label>
<div class="col-md-6">
<input class="form-control" type="email" name="support_email" id="support_email" value="{{ old('support_email', $item->support_email) }}" />
{!! $errors->first('support_email', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('admin/manufacturers/table.support_email')"
:$item
name="support_email"
type="email"
input_div_class="col-md-6 col-sm-12 col-xs-12"
/>
@include ('partials.forms.edit.image-upload', ['image_path' => app('manufacturers_upload_path')])
<div class="form-group{!! $errors->has('notes') ? ' has-error' : '' !!}">
<label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>
<div class="col-md-8">
<x-input.textarea
name="notes"
id="notes"
:value="old('notes', $item->notes)"
placeholder="{{ trans('general.placeholders.notes') }}"
aria-label="notes"
rows="5"
/>
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.image-upload', ['image_path' => app('manufacturers_upload_path')])
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>
@stop
@@ -104,6 +104,7 @@
<div class="table table-responsive">
<table
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-show-columns-search="true"
data-cookie-id-table="assetsListingTable"
data-id-table="assetsListingTable"
data-toolbar="#assetsBulkEditToolbar"
+38 -4
View File
@@ -9,12 +9,37 @@
{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/models/table.name'), 'required' => 'true'])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
@include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'asset'])
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])
@include ('partials.forms.edit.model_number')
<!-- Model Number -->
<x-form-row
:label="trans('general.model_no')"
:$item
name="model_number"
/>
@include ('partials.forms.edit.depreciation')
@include ('partials.forms.edit.minimum_quantity')
<!-- Min Amount -->
<x-form-row
:label="trans('general.min_amt')"
:$item
name="min_amt"
input_div_class="col-md-2"
minlength="1"
maxlength="5"
type="number"
:info_tooltip_text="trans('general.min_amt_help')"
/>
<!-- require serial boolean -->
<div class="form-group">
@@ -58,7 +83,16 @@
<!-- If $item->id is null we are cloning the model and we need the $model_id variable -->
@livewire('custom-field-set-default-values-for-model', ["model_id" => $item->id ?? $model_id ?? null])
@include ('partials.forms.edit.notes')
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>
@include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/models/general.requestable')])
@include ('partials.forms.edit.image-upload', ['image_path' => app('models_upload_path')])
+2
View File
@@ -87,9 +87,11 @@
<table
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-show-columns-search="true"
data-cookie-id-table="assetListingTable"
data-id-table="assetListingTable"
data-side-pagination="server"
data-show-footer="true"
data-toolbar="#assetsBulkEditToolbar"
data-bulk-button-id="#bulkAssetEditButton"
data-bulk-form-id="#assetsBulkForm"
@@ -6,6 +6,9 @@
@component('mail::table')
| | |
| ------------- | ------------- |
@if (isset($item_name))
| **{{ trans('general.name') }}** | {{ $item_name }} |
@endif
| **{{ trans('mail.user') }}** | {{ $assigned_to }} |
@if (isset($user->location))
| **{{ trans('general.location') }}** | {{ $user->location->name }} |
@@ -1,35 +1,31 @@
<div class="form-group {{ $errors->has('address') ? ' has-error' : '' }}">
<label for="address" class="col-md-3 control-label">{{ trans('general.address') }}</label>
<div class="col-md-7">
<input class="form-control" aria-label="address" maxlength="191" name="address" type="text" id="address" value="{{ old('address', $item->address) }}">
{!! $errors->first('address', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('general.address')"
:$item
:$errors
name="address"
/>
<div class="form-group {{ $errors->has('address2') ? ' has-error' : '' }}">
<label class="sr-only " for="address2">{{ trans('general.address') }}</label>
<div class="col-md-7 col-md-offset-3">
<input class="form-control" aria-label="address2" maxlength="191" name="address2" type="text" value="{{ old('address2', $item->address2) }}">
{!! $errors->first('address2', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('general.address')"
:$item
:$errors
name="address2"
/>
<div class="form-group {{ $errors->has('city') ? ' has-error' : '' }}">
<label for="city" class="col-md-3 control-label">{{ trans('general.city') }}</label>
<div class="col-md-7">
<input class="form-control" aria-label="city" maxlength="191" name="city" type="text" id="city" value="{{ old('city', $item->city) }}">
{!! $errors->first('city', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('general.city')"
:$item
:$errors
name="city"
/>
<div class="form-group {{ $errors->has('state') ? ' has-error' : '' }}">
<label for="state" class="col-md-3 control-label">{{ trans('general.state') }}</label>
<div class="col-md-7">
<input class="form-control" aria-label="state" maxlength="191" name="state" type="text" id="state" value="{{ old('state', $item->state) }}">
{!! $errors->first('state', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('general.state')"
:$item
:$errors
name="state"
/>
<div class="form-group {{ $errors->has('country') ? ' has-error' : '' }}">
<label for="country" class="col-md-3 control-label">{{ trans('general.country') }}</label>
@@ -40,10 +36,11 @@
</div>
</div>
<div class="form-group {{ $errors->has('zip') ? ' has-error' : '' }}">
<label for="zip" class="col-md-3 control-label" maxlength="10">{{ trans('general.zip') }}</label>
<div class="col-md-7">
<input class="form-control" name="zip" type="text" id="zip" value="{{ old('zip', $item->zip) }}">
{!! $errors->first('zip', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('general.zip')"
:$item
:$errors
name="zip"
maxlength="10"
input_div_class="col-md-3"
/>
+95 -98
View File
@@ -47,24 +47,22 @@
</legend>
<!-- Menu Alerts Enabled -->
<div class="form-group {{ $errors->has('show_alerts_in_menu') ? 'error' : '' }}">
<div class="col-md-9 col-md-offset-3">
<label class="form-control">
<input type="checkbox" name="show_alerts_in_menu" value="1" @checked(old('show_alerts_in_menu', $setting->show_alerts_in_menu))>
{{ trans('admin/settings/general.show_alerts_in_menu') }}
</label>
</div>
</div>
<x-form-row
:item="$setting"
name="show_alerts_in_menu"
type="checkbox"
checkbox_value="1"
:value_text="trans('admin/settings/general.show_alerts_in_menu')"
/>
<!-- Alerts Enabled -->
<div class="form-group {{ $errors->has('alerts_enabled') ? 'error' : '' }}">
<div class="col-md-9 col-md-offset-3">
<label class="form-control">
<input type="checkbox" name="alerts_enabled" value="1" @checked(old('alerts_enabled', $setting->alerts_enabled))>
{{ trans('admin/settings/general.alerts_enabled') }}
</label>
</div>
</div>
<x-form-row
:item="$setting"
type="checkbox"
name="alerts_enabled"
checkbox_value="1"
:value_text="trans('admin/settings/general.alerts_enabled')"
/>
</fieldset>
@@ -74,30 +72,24 @@
</legend>
<!-- Alert Email -->
<div class="form-group {{ $errors->has('alert_email') ? 'error' : '' }}">
<div class="col-md-3">
<label for="alert_email">{{ trans('admin/settings/general.alert_email') }}</label>
</div>
<div class="col-md-7">
<input type="text" name="alert_email" value="{{ old('alert_email', $setting->alert_email) }}" class="form-control" placeholder="admin@yourcompany.com,it@yourcompany.com" maxlength="191">
{!! $errors->first('alert_email', '<span class="alert-msg" aria-hidden="true">:message</span><br>') !!}
<p class="help-block">{{ trans('admin/settings/general.alert_email_help') }}</p>
</div>
</div>
<x-form-row
:label="trans('admin/settings/general.alert_email')"
:item="$setting"
name="alert_email"
:help_text="trans('admin/settings/general.alert_email_help')"
placeholder="admin@yourcompany.com,it@yourcompany.com"
/>
<!-- Admin CC Email -->
<div class="form-group {{ $errors->has('admin_cc_email') ? 'error' : '' }}">
<div class="col-md-3">
<label for="admin_cc_email">{{ trans('admin/settings/general.admin_cc_email') }}</label>
</div>
<div class="col-md-7">
<input type="email" name="admin_cc_email" value="{{ old('admin_cc_email', $setting->admin_cc_email) }}" class="form-control" placeholder="admin@yourcompany.com" maxlength="191">
{!! $errors->first('admin_cc_email', '<span class="alert-msg" aria-hidden="true">:message</span><br>') !!}
<p class="help-block">{{ trans('admin/settings/general.admin_cc_email_help') }}</p>
</div>
</div>
<x-form-row
:label="trans('admin/settings/general.admin_cc_email')"
:item="$setting"
name="admin_cc_email"
:help_text="trans('admin/settings/general.admin_cc_email_help')"
placeholder="admin@yourcompany.com"
/>
<!-- Always CC Admins -->
<div class="form-group">
<div class="col-md-9 col-md-offset-3">
<label class="form-control">
@@ -129,72 +121,77 @@
<!-- Alert interval -->
<div class="form-group {{ $errors->has('alert_interval') ? 'error' : '' }}">
<div class="col-md-3">
<label for="alert_interval">{{ trans('admin/settings/general.alert_interval') }}</label>
</div>
<div class="col-md-9">
<input class="form-control" placeholder="30" maxlength="3" style="width: 70px;" name="alert_interval" type="number" value="{{ old('alert_interval', $setting->alert_interval) }}" id="alert_interval">
{!! $errors->first('alert_interval', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
<!-- Alert threshold -->
<div class="form-group {{ $errors->has('alert_threshold') ? 'error' : '' }}">
<div class="col-md-3">
<label for="alert_threshold">{{ trans('admin/settings/general.alert_inv_threshold') }}</label>
</div>
<div class="col-md-8">
<input class="form-control" placeholder="5" maxlength="3" style="width: 70px;" name="alert_threshold" type="number" value="{{ old('alert_threshold', $setting->alert_threshold) }}" id="alert_threshold">
{!! $errors->first('alert_threshold', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
<x-form-row
:label="trans('admin/settings/general.alert_interval')"
:item="$setting"
name="alert_interval"
type="number"
maxlength="3"
min="0"
max="999"
step="1"
input_div_class="col-md-2 col-sm-6"
/>
<!-- Audit interval -->
<div class="form-group {{ $errors->has('audit_interval') ? 'error' : '' }}">
<div class="col-md-3">
<label for="audit_interval">{{ trans('admin/settings/general.audit_interval') }}</label>
</div>
<div class="input-group col-xs-10 col-sm-6 col-md-6 col-lg-3 col-xl-3">
<input class="form-control" placeholder="12" maxlength="3" name="audit_interval" type="number" id="audit_interval" value="{{ old('audit_interval', $setting->audit_interval) }}">
<span class="input-group-addon">{{ trans('general.months') }}</span>
</div>
<div class="col-md-8 col-md-offset-3">
{!! $errors->first('audit_interval', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
<p class="help-block">{{ trans('admin/settings/general.audit_interval_help') }}</p>
</div>
</div>
<x-form-row
:label="trans('admin/settings/general.alert_inv_threshold')"
:item="$setting"
name="alert_threshold"
type="number"
maxlength="3"
min="0"
max="999"
step="1"
input_div_class="col-md-2 col-sm-6"
/>
<!-- Alert threshold -->
<div class="form-group {{ $errors->has('audit_warning_days') ? 'error' : '' }}">
<div class="col-md-3">
<label for="audit_warning_days">{{ trans('admin/settings/general.audit_warning_days') }}</label>
</div>
<div class="input-group col-xs-10 col-sm-6 col-md-4 col-lg-3 col-xl-3">
<input class="form-control" placeholder="14" maxlength="3" name="audit_warning_days" type="number" id="audit_warning_days" value="{{ old('audit_warning_days', $setting->audit_warning_days) }}">
<span class="input-group-addon">{{ trans('general.days') }}</span>
</div>
<div class="col-md-8 col-md-offset-3">
{!! $errors->first('audit_warning_days', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
<p class="help-block">{{ trans('admin/settings/general.audit_warning_days_help') }}</p>
</div>
</div>
<x-form-row
:label="trans('admin/settings/general.audit_interval')"
:item="$setting"
:help_text="trans('admin/settings/general.audit_interval_help')"
:input_group_addon="trans('general.months')"
name="audit_interval"
type="number"
maxlength="3"
min="0"
max="999"
step="1"
input_div_class="col-md-2 col-sm-6 input-group"
/>
<x-form-row
:label="trans('admin/settings/general.audit_warning_days')"
:item="$setting"
:help_text="trans('admin/settings/general.audit_warning_days_help')"
:input_group_addon="trans('general.days')"
name="audit_warning_days"
type="number"
maxlength="3"
min="0"
max="999"
step="1"
input_div_class="col-md-2 col-sm-6 input-group"
/>
<!-- Due for checkin days -->
<div class="form-group {{ $errors->has('due_checkin_days') ? 'error' : '' }}">
<div class="col-md-3">
<label for="due_checkin_days">{{ trans('admin/settings/general.due_checkin_days') }}</label>
</div>
<div class="input-group col-xs-10 col-sm-6 col-md-4 col-lg-3 col-xl-3">
<input class="form-control" placeholder="14" maxlength="3" name="due_checkin_days" type="number" id="due_checkin_days" value="{{ old('due_checkin_days', $setting->due_checkin_days) }}">
<span class="input-group-addon">{{ trans('general.days') }}</span>
</div>
<div class="col-md-8 col-md-offset-3">
{!! $errors->first('due_checkin_days', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
<p class="help-block">{{ trans('admin/settings/general.due_checkin_days_help') }}</p>
</div>
</div>
<x-form-row
:label="trans('admin/settings/general.due_checkin_days')"
:item="$setting"
:help_text="trans('admin/settings/general.due_checkin_days_help')"
:input_group_addon="trans('general.days')"
name="due_checkin_days"
type="number"
maxlength="3"
min="0"
max="999"
step="1"
input_div_class="col-md-2 col-sm-6 input-group"
placeholder="14"
/>
</fieldset>
</div>
+32 -19
View File
@@ -19,7 +19,12 @@
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('general.name')])
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
<!-- Label type -->
<div class="form-group{{ $errors->has('statuslabel_types') ? ' has-error' : '' }}">
@@ -27,6 +32,7 @@
{{ trans('admin/statuslabels/table.status_type') }}
</label>
<div class="col-md-7 required">
<x-input.select
name="statuslabel_types"
:options="$statuslabel_types"
@@ -50,28 +56,35 @@
</div>
</div>
@include ('partials.forms.edit.notes')
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>
<!-- Show in Nav -->
<div class="form-group{{ $errors->has('notes') ? ' has-error' : '' }}">
<div class="col-md-9 col-md-offset-3">
<label class="form-control">
<input type="checkbox" value="1" name="show_in_nav" id="show_in_nav" {{ old('show_in_nav', $item->show_in_nav) == '1' ? ' checked="checked"' : '' }}> {{ trans('admin/statuslabels/table.show_in_nav') }}
</label>
</div>
</div>
<x-form-row
:label="trans('admin/statuslabels/table.show_in_nav')"
:$item
:value_text="trans('general.yes')"
name="show_in_nav"
type="checkbox"
checkbox_value="1"
/>
<!-- Set as Default -->
<div class="form-group{{ $errors->has('default_label') ? ' has-error' : '' }}">
<div class="col-md-9 col-md-offset-3">
<label class="form-control">
<input type="checkbox" value="1" name="default_label" id="default_label" {{ old('default_label', $item->default_label) == '1' ? ' checked="checked"' : '' }}>
{{ trans('admin/statuslabels/table.default_label') }}
</label>
<p class="help-block"> {{ trans('admin/statuslabels/table.default_label_help') }}</p>
</div>
</div>
<x-form-row
:$item
:value_text="trans('general.yes')"
name="default_label"
checkbox_value="1"
type="checkbox"
help_text="{!! trans('admin/statuslabels/table.default_label_help') !!}"
/>
@stop
@@ -24,6 +24,7 @@
data-bulk-button-id="#bulkAssetEditButton"
data-bulk-form-id="#assetsBulkForm"
id="assetsListingTable"
data-show-columns-search="true"
data-buttons="assetButtons"
class="table table-striped snipe-table"
data-url="{{route('api.assets.index', ['status_id' => $statuslabel->id]) }}"
+57 -21
View File
@@ -10,30 +10,66 @@
{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/suppliers/table.name')])
@include ('partials.forms.edit.address')
<!-- Name -->
<x-form-row
:label="trans('general.name')"
:$item
name="name"
/>
<div class="form-group {{ $errors->has('contact') ? ' has-error' : '' }}">
<label for="contact" class="col-md-3 control-label">{{ trans('admin/suppliers/table.contact') }}</label>
<div class="col-md-7">
<input class="form-control" name="contact" type="text" id="contact" value="{{ old('contact', $item->contact) }}">
{!! $errors->first('contact', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.address')
@include ('partials.forms.edit.phone')
@include ('partials.forms.edit.fax')
@include ('partials.forms.edit.email')
<!-- Contact -->
<x-form-row
:label="trans('admin/suppliers/table.contact')"
:$item
name="contact"
/>
<div class="form-group {{ $errors->has('url') ? ' has-error' : '' }}">
<label for="url" class="col-md-3 control-label">{{ trans('general.url') }}</label>
<div class="col-md-7">
<input class="form-control" name="url" type="url" id="url" value="{{ old('url', $item->url) }}">
{!! $errors->first('url', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.notes')
@include ('partials.forms.edit.image-upload', ['image_path' => app('suppliers_upload_path')])
<!-- Phone -->
<x-form-row
:label="trans('general.phone')"
:$item
name="phone"
type="tel"
/>
<!-- Fax -->
<x-form-row
:label="trans('general.fax')"
:$item
name="fax"
type="tel"
/>
<!-- Email -->
<x-form-row
:label="trans('general.email')"
:$item
name="email"
type="email"
/>
<!-- URL -->
<x-form-row
:label="trans('general.url')"
:$item
name="url"
type="url"
/>
@include ('partials.forms.edit.image-upload', ['image_path' => app('suppliers_upload_path')])
<!-- Notes -->
<x-form-row
:label="trans('general.notes')"
:$item
name="notes"
type="textarea"
maxlength="65000"
placeholder="{{ trans('general.placeholders.notes') }}"
/>
@stop
+1
View File
@@ -114,6 +114,7 @@
<table
data-cookie-id-table="suppliersAssetsTable"
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-show-columns-search="true"
data-id-table="suppliersAssetsTable"
data-show-footer="true"
data-side-pagination="server"
+41
View File
@@ -94,6 +94,17 @@
</a>
</li>
<li>
<a href="#eulas" data-toggle="tab">
<span class="hidden-lg hidden-md" aria-hidden="true">
<x-icon type="files" class="fa-2x" />
</span>
<span class="hidden-xs hidden-sm">{{ trans('general.eula') }}
{!! ($user->eulas->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($user->eulas->count()).'</span>' : '' !!}
</span>
</a>
</li>
<li>
<a href="#history" data-toggle="tab">
<span class="hidden-lg hidden-md">
@@ -825,6 +836,7 @@
<table
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-show-columns-search="true"
data-cookie-id-table="userAssetsListingTable"
data-id-table="userAssetsListingTable"
data-side-pagination="server"
@@ -1001,6 +1013,35 @@
</div> <!--/ROW-->
</div><!--/FILES-->
<div class="tab-pane" id="eulas">
<table
data-toolbar="#userEULAToolbar"
data-cookie-id-table="userEULATable"
data-id-table="userEULATable"
id="userEULATable"
data-side-pagination="client"
data-show-footer="true"
data-show-refresh="false"
data-sort-order="asc"
data-sort-name="name"
class="table table-striped snipe-table table-hover"
data-url="{{ route('api.user.eulas', $user) }}"
data-export-options='{
"fileName": "export-eula-{{ str_slug($user->username) }}-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","delete","purchasecost", "icon"]
}'>
<thead>
<tr>
<th data-visible="true" data-field="icon" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter">{{ trans('admin/hardware/table.icon') }}</th>
<th data-visible="true" data-field="item.name">{{ trans('general.item') }}</th>
<th data-visible="true" data-field="created_at" data-sortable="true" data-formatter="dateDisplayFormatter">{{ trans('general.accepted_date') }}</th>
<th data-field="note">{{ trans('general.notes') }}</th>
<th data-field="url" data-formatter="fileDownloadButtonsFormatter">{{ trans('general.download') }}</th>
</tr>
</thead>
</table>
</div><!-- /eulas-tab -->
<div class="tab-pane" id="history">
<div class="table-responsive">
+1 -1
View File
@@ -725,7 +725,7 @@ Route::group(['middleware' => 'web'], function () {
'destroy'
]
)->name('ui.files.destroy')
->where(['object_type' => 'assets|hardware|models|users|locations|accessories|consumables|licenses|components']);
->where(['object_type' => 'assets|maintenances|hardware|models|users|locations|accessories|consumables|licenses|components']);
});
@@ -4,8 +4,10 @@ namespace Tests\Feature\Checkouts\Ui;
use App\Mail\CheckoutAssetMail;
use App\Models\Asset;
use App\Models\Location;
use App\Models\User;
use Illuminate\Support\Facades\Mail;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\ExpectationFailedException;
use Tests\TestCase;
@@ -89,4 +91,63 @@ class BulkAssetCheckoutTest extends TestCase
$this->fail('Asset checkout email was sent when the entire checkout failed.');
}
}
public static function checkoutTargets()
{
yield 'Checkout to user' => [
function () {
return [
'type' => 'user',
'target' => User::factory()->forCompany()->create(),
];
}
];
yield 'Checkout to asset' => [
function () {
return [
'type' => 'asset',
'target' => Asset::factory()->forCompany()->create(),
];
}
];
yield 'Checkout to location' => [
function () {
return [
'type' => 'location',
'target' => Location::factory()->forCompany()->create(),
];
}
];
}
#[DataProvider('checkoutTargets')]
public function test_prevents_checkouts_of_checked_out_items($data)
{
['type' => $type, 'target' => $target] = $data();
$asset = Asset::factory()->create();
$checkedOutAsset = Asset::factory()->assignedToUser()->create();
$existingUserId = $checkedOutAsset->assigned_to;
$response = $this->actingAs(User::factory()->superuser()->create())
->post(route('hardware.bulkcheckout.store'), [
'selected_assets' => [
$asset->id,
$checkedOutAsset->id,
],
'checkout_to_type' => $type,
"assigned_$type" => $target->id,
]);
$this->assertEquals(
$existingUserId,
$checkedOutAsset->fresh()->assigned_to,
'Asset was checked out when it should have been prevented.'
);
// ensure redirected back
$response->assertRedirectToRoute('hardware.bulkcheckout.show');
}
}
@@ -57,13 +57,10 @@ class ExpiringAlertsNotificationTest extends TestCase
$this->artisan('snipeit:expiring-alerts')->assertExitCode(0);
Mail::assertSent(ExpiringAssetsMail::class, function($mail) use ($alert_email, $expiringWarrantyAsset) {
return $mail->hasTo($alert_email) && $mail->assets->contains($expiringWarrantyAsset);
});
Mail::assertSent(ExpiringAssetsMail::class, function($mail) use ($alert_email, $expiringEOLAsset) {
return $mail->hasTo($alert_email) && $mail->assets->contains($expiringEOLAsset);
Mail::assertSent(ExpiringAssetsMail::class, function($mail) use ($alert_email, $expiringWarrantyAsset, $expiringEOLAsset) {
return $mail->hasTo($alert_email) && ($mail->assets->contains($expiringEOLAsset) || $mail->assets->contains($expiringWarrantyAsset));
});
Mail::assertNotSent(ExpiringAssetsMail::class, function($mail) use ($alert_email, $notExpiringAsset, $alreadyExpiredAsset) {
return $mail->assets->contains($alert_email) || ($mail->assets->contains($alreadyExpiredAsset) && ($mail->assets->contains($notExpiringAsset)));