Skip to content

A free open source IT asset/license management system

rename declined message to note, increased width of textarea

Godfrey M21c3b1fbd2e6
diff --git a/app/Http/Controllers/Account/AcceptanceController.php b/app/Http/Controllers/Account/AcceptanceController.php
index 9a59858ccd..e020be41f3 100644
--- a/app/Http/Controllers/Account/AcceptanceController.php
+++ b/app/Http/Controllers/Account/AcceptanceController.php
@@ -311,7 +311,7 @@ class AcceptanceController extends Controller
'item_tag' => $item->asset_tag,
'item_model' => $display_model,
'item_serial' => $item->serial,
- 'declined_message' => $request->input('declined_message'),
+ '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,
@@ -325,7 +325,7 @@ class AcceptanceController extends Controller
Storage::put('private_uploads/eula-pdfs/' .$pdf_filename, $pdf->output());
}
- $acceptance->decline($sig_filename, $request->input('declined_message'));
+ $acceptance->decline($sig_filename, $request->input('note'));
$acceptance->notify(new AcceptanceAssetDeclinedNotification($data));
event(new CheckoutDeclined($acceptance));
$return_msg = trans('admin/users/message.declined');
diff --git a/app/Listeners/LogListener.php b/app/Listeners/LogListener.php
index 3cb0929ebb..96b2607d89 100644
--- a/app/Listeners/LogListener.php
+++ b/app/Listeners/LogListener.php
@@ -78,7 +78,7 @@ class LogListener
$logaction->item()->associate($event->acceptance->checkoutable);
$logaction->target()->associate($event->acceptance->assignedTo);
$logaction->accept_signature = $event->acceptance->signature_filename;
- $logaction->note = $event->acceptance->declined_message;
+ $logaction->note = $event->acceptance->note;
$logaction->action_type = 'declined';
// TODO: log the actual license seat that was checked out
diff --git a/app/Models/CheckoutAcceptance.php b/app/Models/CheckoutAcceptance.php
index 0a9db7d74c..06d414efa1 100644
--- a/app/Models/CheckoutAcceptance.php
+++ b/app/Models/CheckoutAcceptance.php
@@ -99,10 +99,10 @@ class CheckoutAcceptance extends Model
*
* @param string $signature_filename
*/
- public function decline($signature_filename, $declined_message = null)
+ public function decline($signature_filename, $note = null)
{
$this->declined_at = now();
- $this->declined_message = $declined_message;
+ $this->note = $note;
$this->signature_filename = $signature_filename;
$this->save();
diff --git a/app/Notifications/AcceptanceAssetDeclinedNotification.php b/app/Notifications/AcceptanceAssetDeclinedNotification.php
index 37f9f9763d..abdfbbf0c0 100644
--- a/app/Notifications/AcceptanceAssetDeclinedNotification.php
+++ b/app/Notifications/AcceptanceAssetDeclinedNotification.php
@@ -25,7 +25,7 @@ class AcceptanceAssetDeclinedNotification extends Notification
$this->item_model = $params['item_model'];
$this->item_serial = $params['item_serial'];
$this->declined_date = Helper::getFormattedDateObject($params['declined_date'], 'date', false);
- $this->declined_message = $params['declined_message'];
+ $this->note = $params['note'];
$this->assigned_to = $params['assigned_to'];
$this->company_name = $params['company_name'];
$this->settings = Setting::getSettings();
@@ -63,7 +63,7 @@ class AcceptanceAssetDeclinedNotification extends Notification
'item_tag' => $this->item_tag,
'item_model' => $this->item_model,
'item_serial' => $this->item_serial,
- 'declined_message' => $this->declined_message,
+ 'note' => $this->note,
'declined_date' => $this->declined_date,
'assigned_to' => $this->assigned_to,
'company_name' => $this->company_name,
diff --git a/database/migrations/2024_03_18_164714_add_decline_msg_to_checkout_acceptance_table.php b/database/migrations/2024_03_18_164714_add_decline_msg_to_checkout_acceptance_table.php
index dd47d172be..428d32a580 100644
--- a/database/migrations/2024_03_18_164714_add_decline_msg_to_checkout_acceptance_table.php
+++ b/database/migrations/2024_03_18_164714_add_decline_msg_to_checkout_acceptance_table.php
@@ -14,7 +14,7 @@ class AddDeclineMsgToCheckoutAcceptanceTable extends Migration
public function up()
{
Schema::table('checkout_acceptances', function (Blueprint $table) {
- $table->text('declined_message')->after('signature_filename')->nullable();
+ $table->text('note')->after('signature_filename')->nullable();
});
}
@@ -26,7 +26,7 @@ class AddDeclineMsgToCheckoutAcceptanceTable extends Migration
public function down()
{
Schema::table('checkout_acceptances', function (Blueprint $table) {
- $table->dropColumn('declined_message');
+ $table->dropColumn('note');
});
}
}
diff --git a/resources/views/account/accept/create.blade.php b/resources/views/account/accept/create.blade.php
index 47190bb8e5..a1936eb2df 100644
--- a/resources/views/account/accept/create.blade.php
+++ b/resources/views/account/accept/create.blade.php
@@ -67,10 +67,10 @@
<div class="col-md-12">
<br>
<div class="col-md-12" style="display:block;">
- <label id="declined_message_label" for="declined_message" style="text-align:center;" >{{trans('admin/settings/general.decline_message')}}</label>
+ <label id="note_label" for="note" style="text-align:center;" >{{trans('admin/settings/general.decline_message')}}</label>
</div>
<div class="col-md-12">
- <textarea id="declined_message" name="declined_message" rows="4" cols="50" value="declined_message" ></textarea>
+ <textarea id="note" name="note" rows="4" cols="50" value="note" style="width:100%" ></textarea>
</div>
</div>
@@ -105,19 +105,19 @@
<script nonce="{{ csrf_token() }}">
$(document).ready(function(){
- $('#declined_message').hide();
- $('#declined_message_label').hide();
+ $('#note').hide();
+ $('#note_label').hide();
$('input[id="declined"]').change(function(){
if($(this).is(':checked')){
- $('#declined_message_label').show();
- $('#declined_message').show();
+ $('#note_label').show();
+ $('#note').show();
}
else {
- $('#declined_message_label').hide();
- $('#declined_message').hide();
+ $('#note_label').hide();
+ $('#note').hide();
}
});
});
diff --git a/resources/views/notifications/markdown/asset-acceptance.blade.php b/resources/views/notifications/markdown/asset-acceptance.blade.php
index ab767c821c..de44967b11 100644
--- a/resources/views/notifications/markdown/asset-acceptance.blade.php
+++ b/resources/views/notifications/markdown/asset-acceptance.blade.php
@@ -13,8 +13,8 @@
@if (isset($declined_date))
| **{{ ucfirst(trans('general.declined')) }}** | {{ $declined_date }} |
@endif
-@if (isset($declined_msg))
-| **{{ trans('general.declined_note') }}** | {{ $declined_msg }} |
+@if (isset($note))
+| **{{ trans('general.declined_note') }}** | {{ $note }} |
@endif
@if ((isset($item_tag)) && ($item_tag!=''))
| **{{ trans('mail.asset_tag') }}** | {{ $item_tag }} |