diff --git a/app/Http/Controllers/AccessoriesController.php b/app/Http/Controllers/AccessoriesController.php index 5c57e1da2a..c651ab3390 100755 --- a/app/Http/Controllers/AccessoriesController.php +++ b/app/Http/Controllers/AccessoriesController.php @@ -12,7 +12,6 @@ use DB; use Gate; use Input; use Lang; -use Mail; use Redirect; use Illuminate\Http\Request; use Slack; @@ -313,16 +312,6 @@ class AccessoriesController extends Controller $data['expected_checkin'] = ''; $data['note'] = $logaction->note; $data['require_acceptance'] = $accessory->requireAcceptance(); - // TODO: Port this to new mail notifications - - if ((($accessory->requireAcceptance()=='1') || ($accessory->getEula())) && ($user->email!='')) { - - Mail::send('emails.accept-accessory', $data, function ($m) use ($user) { - $m->to($user->email, $user->first_name . ' ' . $user->last_name); - $m->replyTo(config('mail.reply_to.address'), config('mail.reply_to.name')); - $m->subject(trans('mail.Confirm_accessory_delivery')); - }); - } // Redirect to the new accessory page return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.checkout.success')); @@ -393,15 +382,6 @@ class AccessoriesController extends Controller $data['item_tag'] = ''; $data['note'] = e($logaction->note); - if ((($accessory->checkin_email()=='1')) && ($user->email!='')) { - - Mail::send('emails.checkin-asset', $data, function ($m) use ($user) { - $m->to($user->email, $user->first_name . ' ' . $user->last_name); - $m->replyTo(config('mail.reply_to.address'), config('mail.reply_to.name')); - $m->subject(trans('mail.Confirm_Accessory_Checkin')); - }); - } - if ($backto=='user') { return redirect()->route("users.show", $return_to)->with('success', trans('admin/accessories/message.checkin.success')); } diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 9bf8ff645d..a46e841302 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -668,7 +668,7 @@ class AssetsController extends Controller $asset->assigned_to = null; $asset->assignedTo()->disassociate($asset); $asset->accepted = null; - $asset->name = e(Input::get('name')); + $asset->name = Input::get('name'); $asset->location_id = $asset->rtd_location_id; if ($request->has('location_id')) { @@ -676,32 +676,11 @@ class AssetsController extends Controller } if (Input::has('status_id')) { - $asset->status_id = e(Input::get('status_id')); + $asset->status_id = Input::get('status_id'); } - // Was the asset updated? if ($asset->save()) { - $logaction = $asset->logCheckin($target, e(request('note'))); - - $data['log_id'] = $logaction->id; - $data['first_name'] = get_class($target) == User::class ? $target->first_name : ''; - $data['item_name'] = $asset->present()->name(); - $data['checkin_date'] = $logaction->created_at; - $data['item_tag'] = $asset->asset_tag; - $data['item_serial'] = $asset->serial; - $data['note'] = $logaction->note; - $data['manufacturer_name'] = $asset->model->manufacturer->name; - $data['model_name'] = $asset->model->name; - $data['model_number'] = $asset->model->model_number; - - if ((($asset->checkin_email()=='1')) && (isset($user)) && (!config('app.lock_passwords'))) { - Mail::send('emails.checkin-asset', $data, function ($m) use ($user) { - $m->to($user->email, $user->first_name . ' ' . $user->last_name); - $m->replyTo(config('mail.reply_to.address'), config('mail.reply_to.name')); - $m->subject(trans('mail.Confirm_Asset_Checkin')); - }); - } - + $asset->logCheckin($target, e(request('note'))); return response()->json(Helper::formatStandardApiResponse('success', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkin.success'))); } diff --git a/app/Http/Controllers/Api/ConsumablesController.php b/app/Http/Controllers/Api/ConsumablesController.php index 3c1184d38b..db8d5ce4d1 100644 --- a/app/Http/Controllers/Api/ConsumablesController.php +++ b/app/Http/Controllers/Api/ConsumablesController.php @@ -179,7 +179,7 @@ class ConsumablesController extends Controller foreach ($consumable->consumableAssignments as $consumable_assignment) { $rows[] = [ 'name' => ($consumable_assignment->user) ? $consumable_assignment->user->present()->nameUrl() : 'Deleted User', - 'created_at' => ($consumable_assignment->created_at->format('Y-m-d H:i:s')=='-0001-11-30 00:00:00') ? '' : $consumable_assignment->created_at->format('Y-m-d H:i:s'), + 'created_at' => Helper::getFormattedDateObject($consumable_assignment->created_at, 'datetime'), 'admin' => ($consumable_assignment->admin) ? $consumable_assignment->admin->present()->nameUrl() : '', ]; } diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index dff70ebbe4..7a5dcf1a4d 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -591,14 +591,6 @@ class AssetsController extends Controller $data['model_name'] = $asset->model->name; $data['model_number'] = $asset->model->model_number; - if ((($asset->checkin_email()=='1')) && (isset($user)) && (!empty($user->email)) && (!config('app.lock_passwords'))) { - Mail::send('emails.checkin-asset', $data, function ($m) use ($user) { - $m->to($user->email, $user->first_name . ' ' . $user->last_name); - $m->replyTo(config('mail.reply_to.address'), config('mail.reply_to.name')); - $m->subject(trans('mail.Confirm_Asset_Checkin')); - }); - } - if ($backto=='user') { return redirect()->route("users.show", $user->id)->with('success', trans('admin/hardware/message.checkin.success')); } diff --git a/app/Http/Controllers/ConsumablesController.php b/app/Http/Controllers/ConsumablesController.php index b67f41f235..92f3752968 100644 --- a/app/Http/Controllers/ConsumablesController.php +++ b/app/Http/Controllers/ConsumablesController.php @@ -7,13 +7,11 @@ use App\Models\Company; use App\Models\Consumable; use App\Models\Setting; use App\Models\User; -use App\Notifications\CheckoutNotification; use Auth; use Config; use DB; use Input; use Lang; -use Mail; use Redirect; use Slack; use Str; @@ -279,14 +277,6 @@ class ConsumablesController extends Controller $data['note'] = $logaction->note; $data['require_acceptance'] = $consumable->requireAcceptance(); - if ((($consumable->requireAcceptance()=='1') || ($consumable->getEula())) && $user->email!='') { - - Mail::send('emails.accept-asset', $data, function ($m) use ($user) { - $m->to($user->email, $user->first_name . ' ' . $user->last_name); - $m->replyTo(config('mail.reply_to.address'), config('mail.reply_to.name')); - $m->subject(trans('mail.Confirm_consumable_delivery')); - }); - } // Redirect to the new consumable page return redirect()->route('consumables.index')->with('success', trans('admin/consumables/message.checkout.success')); diff --git a/app/Http/Controllers/CustomFieldsController.php b/app/Http/Controllers/CustomFieldsController.php index 790b06d39c..d73f544af4 100644 --- a/app/Http/Controllers/CustomFieldsController.php +++ b/app/Http/Controllers/CustomFieldsController.php @@ -78,6 +78,7 @@ class CustomFieldsController extends Controller "help_text" => $request->get("help_text"), "field_values" => $request->get("field_values"), "field_encrypted" => $request->get("field_encrypted", 0), + "show_in_email" => $request->get("show_in_email", 0), "user_id" => Auth::user()->id ]); diff --git a/app/Http/Controllers/LicensesController.php b/app/Http/Controllers/LicensesController.php index bfbcbb3b69..5abd75a923 100755 --- a/app/Http/Controllers/LicensesController.php +++ b/app/Http/Controllers/LicensesController.php @@ -419,6 +419,8 @@ class LicensesController extends Controller if (!$return_to) { $return_to = Asset::find($licenseSeat->asset_id); } + + \Log::debug($licenseSeat->assigned_to); // Update the asset data $licenseSeat->assigned_to = null; $licenseSeat->asset_id = null; diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 261655775c..591de90d81 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -335,6 +335,7 @@ class SettingsController extends Controller $setting->full_multiple_companies_support = $request->input('full_multiple_companies_support', '0'); $setting->load_remote = $request->input('load_remote', '0'); + $setting->show_images_in_email = $request->input('show_images_in_email', '0'); $setting->show_archived_in_list = $request->input('show_archived_in_list', '0'); $setting->dashboard_message = $request->input('dashboard_message'); $setting->email_domain = $request->input('email_domain'); @@ -577,8 +578,11 @@ class SettingsController extends Controller $alert_email = rtrim($request->input('alert_email'), ','); $alert_email = trim($alert_email); + $admin_cc_email = rtrim($request->input('admin_cc_email'), ','); + $admin_cc_email = trim($admin_cc_email); $setting->alert_email = $alert_email; + $setting->admin_cc_email = $admin_cc_email; $setting->alerts_enabled = $request->input('alerts_enabled', '0'); $setting->alert_interval = $request->input('alert_interval'); $setting->alert_threshold = $request->input('alert_threshold'); diff --git a/app/Http/Controllers/ViewAssetsController.php b/app/Http/Controllers/ViewAssetsController.php index 2aa5286757..96f893042e 100755 --- a/app/Http/Controllers/ViewAssetsController.php +++ b/app/Http/Controllers/ViewAssetsController.php @@ -297,10 +297,12 @@ class ViewAssetsController extends Controller $user = Auth::user(); - if ($user->id != $findlog->item->assigned_to) { + // TODO - Fix this for non-assets + if (($findlog->item_type==Asset::class) && ($user->id != $findlog->item->assigned_to)) { return redirect()->to('account/view-assets')->with('error', trans('admin/users/message.error.incorrect_user_accepted')); } + $item = $findlog->item; // Check if the asset exists @@ -336,7 +338,7 @@ class ViewAssetsController extends Controller $user = Auth::user(); - if ($user->id != $findlog->item->assigned_to) { + if (($findlog->item_type==Asset::class) && ($user->id != $findlog->item->assigned_to)) { return redirect()->to('account/view-assets')->with('error', trans('admin/users/message.error.incorrect_user_accepted')); } @@ -388,9 +390,11 @@ class ViewAssetsController extends Controller ->where('id', $findlog->id) ->update(array('accepted_id' => $logaction->id)); + if (($findlog->item_id!='') && ($findlog->item_type==Asset::class)) { $affected_asset = $logaction->item; $affected_asset->accepted = $accepted; $affected_asset->save(); + } if ($update_checkout) { return redirect()->to('account/view-assets')->with('success', $return_msg); diff --git a/app/Models/Accessory.php b/app/Models/Accessory.php index e006b24c3e..1c78b03a58 100755 --- a/app/Models/Accessory.php +++ b/app/Models/Accessory.php @@ -4,6 +4,8 @@ namespace App\Models; use App\Presenters\Presentable; use Illuminate\Database\Eloquent\SoftDeletes; use Watson\Validating\ValidatingTrait; +use App\Notifications\CheckinAccessoryNotification; +use App\Notifications\CheckoutAccessoryNotification; /** * Model for Accessories. @@ -23,6 +25,13 @@ class Accessory extends SnipeModel 'requestable' => 'boolean' ]; + /** + * Set static properties to determine which checkout/checkin handlers we should use + */ + public static $checkoutClass = CheckoutAccessoryNotification::class; + public static $checkinClass = CheckinAccessoryNotification::class; + + /** * Accessory validation rules */ @@ -68,6 +77,8 @@ class Accessory extends SnipeModel ]; + + public function supplier() { return $this->belongsTo('\App\Models\Supplier', 'supplier_id'); @@ -106,6 +117,13 @@ class Accessory extends SnipeModel return $this->hasMany('\App\Models\Actionlog', 'item_id')->where('item_type', Accessory::class)->orderBy('created_at', 'desc')->withTrashed(); } + public function getImageUrl() { + if ($this->image) { + return url('/').'/uploads/accessories/'.$this->image; + } + return false; + + } public function users() { diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 51dd6b8572..0e5121dd83 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -13,6 +13,8 @@ use Log; use Watson\Validating\ValidatingTrait; use Illuminate\Notifications\Notifiable; use DB; +use App\Notifications\CheckinAssetNotification; +use App\Notifications\CheckoutAssetNotification; /** * Model for Assets. @@ -27,20 +29,28 @@ class Asset extends Depreciable const LOCATION = 'location'; const ASSET = 'asset'; const USER = 'user'; - /** - * The database table used by the model. - * - * @var string - */ + + /** + * Set static properties to determine which checkout/checkin handlers we should use + */ + public static $checkoutClass = CheckoutAssetNotification::class; + public static $checkinClass = CheckinAssetNotification::class; + + + /** + * The database table used by the model. + * + * @var string + */ protected $table = 'assets'; - /** - * Whether the model should inject it's identifier to the unique - * validation rules before attempting validation. If this property - * is not set in the model it will default to true. - * - * @var boolean - */ + /** + * Whether the model should inject it's identifier to the unique + * validation rules before attempting validation. If this property + * is not set in the model it will default to true. + * + * @var boolean + */ protected $injectUniqueIdentifier = true; // We set these as protected dates so that they will be easily accessible via Carbon diff --git a/app/Models/Consumable.php b/app/Models/Consumable.php index 26c8b615fa..b4addc7f87 100644 --- a/app/Models/Consumable.php +++ b/app/Models/Consumable.php @@ -4,6 +4,7 @@ namespace App\Models; use App\Presenters\Presentable; use Illuminate\Database\Eloquent\SoftDeletes; use Watson\Validating\ValidatingTrait; +use App\Notifications\CheckoutConsumableNotification; class Consumable extends SnipeModel { @@ -18,6 +19,11 @@ class Consumable extends SnipeModel 'requestable' => 'boolean' ]; + /** + * Set static properties to determine which checkout/checkin handlers we should use + */ + public static $checkoutClass = CheckoutConsumableNotification::class; + public static $checkinClass = null; /** @@ -109,6 +115,14 @@ class Consumable extends SnipeModel return $this->hasMany('\App\Models\Actionlog', 'item_id')->where('item_type', Consumable::class)->orderBy('created_at', 'desc')->withTrashed(); } + public function getImageUrl() { + if ($this->image) { + return url('/').'/uploads/consumables/'.$this->image; + } + return false; + + } + public function users() { diff --git a/app/Models/LicenseSeat.php b/app/Models/LicenseSeat.php index 1f1660f90e..17703ad2c6 100755 --- a/app/Models/LicenseSeat.php +++ b/app/Models/LicenseSeat.php @@ -4,6 +4,8 @@ namespace App\Models; use App\Models\Loggable; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +use App\Notifications\CheckoutLicenseNotification; +use App\Notifications\CheckinLicenseNotification; class LicenseSeat extends Model implements ICompanyableChild { @@ -15,6 +17,12 @@ class LicenseSeat extends Model implements ICompanyableChild protected $guarded = 'id'; protected $table = 'license_seats'; + /** + * Set static properties to determine which checkout/checkin handlers we should use + */ + public static $checkoutClass = CheckoutLicenseNotification::class; + public static $checkinClass = CheckinLicenseNotification::class; + public function getCompanyableParents() { return ['asset', 'license']; diff --git a/app/Models/Loggable.php b/app/Models/Loggable.php index 38f1619d32..cd392f51b7 100644 --- a/app/Models/Loggable.php +++ b/app/Models/Loggable.php @@ -6,11 +6,17 @@ use App\Models\Actionlog; use App\Models\Asset; use App\Models\CheckoutRequest; use App\Models\User; -use App\Notifications\CheckinNotification; +use App\Notifications\CheckinAssetNotification; use App\Notifications\AuditNotification; -use App\Notifications\CheckoutNotification; +use App\Notifications\CheckoutAssetNotification; +use App\Notifications\CheckoutAccessoryNotification; +use App\Notifications\CheckinAccessoryNotification; +use App\Notifications\CheckoutConsumableNotification; +use App\Notifications\CheckoutLicenseNotification; +use App\Notifications\CheckinLicenseNotification; use Illuminate\Support\Facades\Auth; + trait Loggable { @@ -32,6 +38,7 @@ trait Loggable */ public function logCheckout($note, $target /* What are we checking out to? */) { + $settings = Setting::getSettings(); $log = new Actionlog; $log = $this->determineLogItemType($log); $log->user_id = Auth::user()->id; @@ -43,13 +50,11 @@ trait Loggable $log->target_type = get_class($target); $log->target_id = $target->id; - $target_class = get_class($target); // Figure out what the target is - if ($target_class == Location::class) { - // We can checkout to a location + if ($log->target_type == Location::class) { $log->location_id = $target->id; - } elseif ($target_class== Asset::class) { + } elseif ($log->target_type == Asset::class) { $log->location_id = $target->rtd_location_id; } else { $log->location_id = $target->location_id; @@ -60,18 +65,25 @@ trait Loggable $params = [ 'item' => $log->item, + 'target_type' => $log->target_type, 'target' => $target, 'admin' => $log->user, 'note' => $note, - 'log_id' => $log->id + 'log_id' => $log->id, + 'settings' => $settings, ]; - if ($settings = Setting::getSettings()) { - // $settings->notify(new CheckoutNotification($params)); - } + + // Send to the admin, if settings dictate + $recipient = new \App\Models\Recipients\AdminRecipient(); + if (method_exists($target, 'notify')) { - $target->notify(new CheckoutNotification($params)); + $target->notify(new static::$checkoutClass($params)); + } + + if ($settings->admin_cc_email!='') { + $recipient->notify(new static::$checkoutClass($params)); } return $log; @@ -100,9 +112,11 @@ trait Loggable */ public function logCheckin($target, $note) { + $settings = Setting::getSettings(); $log = new Actionlog; $log->target_type = get_class($target); $log->target_id = $target->id; + if (static::class == LicenseSeat::class) { $log->item_type = License::class; $log->item_id = $this->license_id; @@ -110,17 +124,34 @@ trait Loggable $log->item_type = static::class; $log->item_id = $this->id; } + + $log->location_id = null; $log->note = $note; $log->user_id = Auth::user()->id; $log->logaction('checkin from'); $params = [ + 'target' => $target, 'item' => $log->item, 'admin' => $log->user, - 'note' => $note + 'note' => $note, + 'target_type' => $log->target_type, + 'settings' => $settings, ]; - Setting::getSettings()->notify(new CheckinNotification($params)); + + // Send to the admin, if settings dictate + $recipient = new \App\Models\Recipients\AdminRecipient(); + + $checkoutClass = null; + + if (method_exists($target, 'notify')) { + $target->notify(new static::$checkinClass($params)); + } + + if ($settings->admin_cc_email!='') { + $recipient->notify(new static::$checkinClass($params)); + } return $log; } diff --git a/app/Models/Recipients/AdminRecipient.php b/app/Models/Recipients/AdminRecipient.php new file mode 100644 index 0000000000..a5311bbcda --- /dev/null +++ b/app/Models/Recipients/AdminRecipient.php @@ -0,0 +1,14 @@ +email = $settings->admin_cc_email; + } + +} diff --git a/app/Models/Recipients/AlertRecipient.php b/app/Models/Recipients/AlertRecipient.php new file mode 100644 index 0000000000..af9e3a012e --- /dev/null +++ b/app/Models/Recipients/AlertRecipient.php @@ -0,0 +1,14 @@ +email = $settings->alert_email; + } + +} diff --git a/app/Models/Recipients/Recipient.php b/app/Models/Recipients/Recipient.php new file mode 100644 index 0000000000..888dd8e611 --- /dev/null +++ b/app/Models/Recipients/Recipient.php @@ -0,0 +1,12 @@ + 'max:31|nullable', 'logo_img' => 'mimes:jpeg,bmp,png,gif', 'alert_email' => 'email_array|nullable', + 'admin_cc_email' => 'email|nullable', 'default_currency' => 'required', 'locale' => 'required', 'slack_endpoint' => 'url|required_with:slack_channel|nullable', diff --git a/app/Models/User.php b/app/Models/User.php index d26d5d9401..4c014f9cea 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -149,6 +149,18 @@ class User extends SnipeModel implements AuthenticatableContract, CanResetPasswo return $this->last_name . ", " . $this->first_name . " (" . $this->username . ")"; } + /** + * The url for slack notifications. + * Used by Notifiable trait. + * @return mixed + */ + public function routeNotificationForSlack() + { + // At this point the endpoint is the same for everything. + // In the future this may want to be adapted for individual notifications. + $this->endpoint = \App\Models\Setting::getSettings()->slack_endpoint; + return $this->endpoint; + } /** diff --git a/app/Notifications/CheckinAccessoryNotification.php b/app/Notifications/CheckinAccessoryNotification.php new file mode 100644 index 0000000000..8907dcbde6 --- /dev/null +++ b/app/Notifications/CheckinAccessoryNotification.php @@ -0,0 +1,127 @@ +target = $params['target']; + $this->item = $params['item']; + $this->admin = $params['admin']; + $this->note = ''; + $this->target_type = $params['target']; + $this->settings = $params['settings']; + + if (array_key_exists('note', $params)) { + $this->note = $params['note']; + } + + + + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via() + { + + $notifyBy = []; + + if (Setting::getSettings()->slack_endpoint) { + $notifyBy[] = 'slack'; + } + + // Make sure the target is a user and that its appropriate to send them an email + if (($this->target_type == \App\Models\User::class) && (($this->item->requireAcceptance() == '1') || ($this->item->getEula()))) + { + $notifyBy[] = 'mail'; + } + + return $notifyBy; + } + + public function toSlack() + { + + $target = $this->target; + $admin = $this->admin; + $item = $this->item; + $note = $this->note; + $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot' ; + + + $fields = [ + 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', + 'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', + ]; + + + + return (new SlackMessage) + ->content(':arrow_down: :keyboard: Accessory Checked In') + ->from($botname) + ->attachment(function ($attachment) use ($item, $note, $admin, $fields) { + $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) + ->fields($fields) + ->content($note); + }); + } + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + + + return (new MailMessage)->markdown('notifications.markdown.checkin-accessory', + [ + 'item' => $this->item, + 'admin' => $this->admin, + 'note' => $this->note, + 'target' => $this->target, + ]) + ->subject('Accessory checked in'); + + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/app/Notifications/CheckinAssetNotification.php b/app/Notifications/CheckinAssetNotification.php new file mode 100644 index 0000000000..a22ccae7cf --- /dev/null +++ b/app/Notifications/CheckinAssetNotification.php @@ -0,0 +1,126 @@ +target = $params['target']; + $this->item = $params['item']; + $this->admin = $params['admin']; + $this->note = ''; + $this->expected_checkin = ''; + $this->target_type = $params['target_type']; + $this->settings = $params['settings']; + + if (array_key_exists('note', $params)) { + $this->note = $params['note']; + } + + if ($this->item->expected_checkin) { + $this->expected_checkin = \App\Helpers\Helper::getFormattedDateObject($this->item->expected_checkin, 'date', + false); + } + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via() + { + + $notifyBy = []; + + if (Setting::getSettings()->slack_endpoint!='') { + \Log::debug('use slack'); + $notifyBy[] = 'slack'; + } + + // Make sure the target is a user and that its appropriate to send them an email + if ((($this->target->email!='') && ($this->target_type == 'App\Models\User')) && (($this->item->requireAcceptance() == '1') || ($this->item->getEula()))) + { + \Log::debug('use email'); + $notifyBy[] = 'mail'; + } + + return $notifyBy; + } + + public function toSlack() + { + + $admin = $this->admin; + $item = $this->item; + $note = $this->note; + $botname = ($this->settings->slack_botname!='') ? $this->settings->slack_botname : 'Snipe-Bot' ; + + $fields = [ + trans('general.administrator') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', + trans('general.status') => $item->assetstatus->name, + trans('general.location') => $item->location->name, + ]; + + return (new SlackMessage) + ->content(':arrow_down: :computer: Asset Checked In') + ->from($botname) + ->attachment(function ($attachment) use ($item, $note, $admin, $fields) { + $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) + ->fields($fields) + ->content($note); + }); + + + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail() + { + + + $fields = []; + + // Check if the item has custom fields associated with it + if (($this->item->model) && ($this->item->model->fieldset)) { + $fields = $this->item->model->fieldset->fields; + } + + $message = (new MailMessage)->markdown('notifications.markdown.checkin-asset', + [ + 'item' => $this->item, + 'admin' => $this->admin, + 'note' => $this->note, + 'target' => $this->target, + 'fields' => $fields, + 'expected_checkin' => $this->expected_checkin, + ]) + ->subject('Asset checked in'); + + + return $message; + } + +} diff --git a/app/Notifications/CheckinLicenseNotification.php b/app/Notifications/CheckinLicenseNotification.php new file mode 100644 index 0000000000..6f5edcffb6 --- /dev/null +++ b/app/Notifications/CheckinLicenseNotification.php @@ -0,0 +1,119 @@ +target = $params['target']; + $this->item = $params['item']; + $this->admin = $params['admin']; + $this->note = ''; + $this->settings = $params['settings']; + + if (array_key_exists('note', $params)) { + $this->note = $params['note']; + } + + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + $notifyBy = []; + + if (Setting::getSettings()->slack_endpoint!='') { + $notifyBy[] = 'slack'; + } + + + $notifyBy[] = 'mail'; + + return $notifyBy; + } + + public function toSlack($notifiable) + { + + $target = $this->target; + $admin = $this->admin; + $item = $this->item; + $note = $this->note; + $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot' ; + + + $fields = [ + 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', + 'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', + ]; + + + + return (new SlackMessage) + ->content(':arrow_down: :floppy_disk: License Checked In') + ->from($botname) + ->attachment(function ($attachment) use ($item, $note, $admin, $fields) { + $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) + ->fields($fields) + ->content($note); + }); + } + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + + return (new MailMessage)->markdown('notifications.markdown.checkin-license', + [ + 'item' => $this->item, + 'admin' => $this->admin, + 'note' => $this->note, + 'target' => $this->target, + ]) + ->subject('License checked in'); + + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/app/Notifications/CheckinNotification.php b/app/Notifications/CheckinNotification.php deleted file mode 100644 index a74c27b1d0..0000000000 --- a/app/Notifications/CheckinNotification.php +++ /dev/null @@ -1,97 +0,0 @@ -params = $params; - } - - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * @return array - */ - public function via($notifiable) - { - $notifyBy = []; - if (Setting::getSettings()->slack_endpoint) { - $notifyBy[] = 'slack'; - } - $item = $this->params['item']; - if (class_basename(get_class($this->params['item']))=='Asset') { - if ((method_exists($item, 'requireAcceptance') && ($item->requireAcceptance() == '1')) - || (method_exists($item, 'getEula') && ($item->getEula())) - ) { - // $notifyBy[] = 'mail'; - } - } - return $notifyBy; - } - - public function toSlack($notifiable) - { - return (new SlackMessage) - ->success() - ->content(class_basename(get_class($this->params['item'])) . " Checked In") - ->attachment(function ($attachment) use ($notifiable) { - $item = $this->params['item']; - $admin_user = $this->params['admin']; - $fields = [ - 'By' => '<'.$admin_user->present()->viewUrl().'|'.$admin_user->present()->fullName().'>', - ]; - array_key_exists('note', $this->params) && $fields['Notes'] = $this->params['note']; - - $attachment->title($item->name, $item->present()->viewUrl()) - ->fields($fields); - }); - } - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * @return \Illuminate\Notifications\sMessages\MailMessage - */ - public function toMail($notifiable) - { - return (new MailMessage) - ->line('The introduction to the notification.') - ->action('Notification Action', 'https://laravel.com') - ->line('Thank you for using our application!'); - } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } -} diff --git a/app/Notifications/CheckoutAccessoryNotification.php b/app/Notifications/CheckoutAccessoryNotification.php new file mode 100644 index 0000000000..1ffb1a1ed4 --- /dev/null +++ b/app/Notifications/CheckoutAccessoryNotification.php @@ -0,0 +1,136 @@ +target = $params['target']; + $this->item = $params['item']; + $this->admin = $params['admin']; + $this->log_id = $params['log_id']; + $this->note = ''; + $this->last_checkout = ''; + $this->expected_checkin = ''; + $this->target_type = $params['target_type']; + $this->settings = $params['settings']; + + if (array_key_exists('note', $params)) { + $this->note = $params['note']; + } + + + + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + + $notifyBy = []; + + if (Setting::getSettings()->slack_endpoint!='') { + $notifyBy[] = 'slack'; + } + + // Make sure the target is a user and that its appropriate to send them an email + if ((($this->target->email!='') && ($this->target_type == 'App\Models\User')) && (($this->item->requireAcceptance() == '1') || ($this->item->getEula()))) + { + $notifyBy[] = 'mail'; + } + + return $notifyBy; + } + + public function toSlack($notifiable) + { + + + $target = $this->target; + $admin = $this->admin; + $item = $this->item; + $note = $this->note; + $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot' ; + + $fields = [ + 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', + 'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', + ]; + + + + return (new SlackMessage) + ->content(':arrow_up: :keyboard: Accessory Checked Out') + ->from($botname) + ->attachment(function ($attachment) use ($item, $note, $admin, $fields) { + $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) + ->fields($fields) + ->content($note); + }); + } + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + + \Log::debug($this->item->getImageUrl()); + $eula = $this->item->getEula(); + $req_accept = $this->item->requireAcceptance(); + + return (new MailMessage)->markdown('notifications.markdown.checkout-accessory', + [ + 'item' => $this->item, + 'admin' => $this->admin, + 'note' => $this->note, + 'target' => $this->target, + 'eula' => $eula, + 'req_accept' => $req_accept, + 'accept_url' => url('/').'/account/accept-asset/'.$this->log_id, + ]) + ->subject(trans('mail.Confirm_accessory_delivery')); + + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/app/Notifications/CheckoutAssetNotification.php b/app/Notifications/CheckoutAssetNotification.php new file mode 100644 index 0000000000..15c9f21987 --- /dev/null +++ b/app/Notifications/CheckoutAssetNotification.php @@ -0,0 +1,146 @@ +target = $params['target']; + $this->item = $params['item']; + $this->admin = $params['admin']; + $this->log_id = $params['log_id']; + $this->note = ''; + $this->last_checkout = ''; + $this->expected_checkin = ''; + $this->target_type = $params['target_type']; + $this->settings = $params['settings']; + + if (array_key_exists('note', $params)) { + $this->note = $params['note']; + } + + if ($this->item->last_checkout) { + $this->last_checkout = \App\Helpers\Helper::getFormattedDateObject($this->item->last_checkout, 'date', + false); + } + + if ($this->item->expected_checkin) { + $this->expected_checkin = \App\Helpers\Helper::getFormattedDateObject($this->item->expected_checkin, 'date', + false); + } + + + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via() + { + + $notifyBy = []; + + if (Setting::getSettings()->slack_endpoint!='') { + \Log::debug('use slack'); + $notifyBy[] = 'slack'; + } + + // Make sure the target is a user and that its appropriate to send them an email + if (($this->target_type == \App\Models\User::class) && (($this->item->requireAcceptance() == '1') || ($this->item->getEula()))) + { + $notifyBy[] = 'mail'; + } + return $notifyBy; + } + + public function toSlack() + { + + $target = $this->target; + $admin = $this->admin; + $item = $this->item; + $note = $this->note; + $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot' ; + + $fields = [ + 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', + 'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', + ]; + + if (($this->expected_checkin) && ($this->expected_checkin!='')) { + $fields['Expected Checkin'] = $this->expected_checkin; + } + + return (new SlackMessage) + ->content(':arrow_up: :computer: Asset Checked Out') + ->from($botname) + ->attachment(function ($attachment) use ($item, $note, $admin, $fields) { + $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) + ->fields($fields) + ->content($note); + }); + } + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail() + { + + $eula = method_exists($this->item, 'getEula') ? $this->item->getEula() : ''; + $req_accept = method_exists($this->item, 'requireAcceptance') ? $this->item->requireAcceptance() : 0; + + $fields = []; + + // Check if the item has custom fields associated with it + if (($this->item->model) && ($this->item->model->fieldset)) { + $fields = $this->item->model->fieldset->fields; + } + + $message = (new MailMessage)->markdown('notifications.markdown.checkout-asset', + [ + 'item' => $this->item, + 'admin' => $this->admin, + 'note' => $this->note, + 'log_id' => $this->note, + 'target' => $this->target, + 'fields' => $fields, + 'eula' => $eula, + 'req_accept' => $req_accept, + 'accept_url' => url('/').'/account/accept-asset/'.$this->log_id, + 'last_checkout' => $this->last_checkout, + 'expected_checkin' => $this->expected_checkin, + ]) + ->subject(trans('mail.Confirm_asset_delivery')); + + + return $message; + + + } + +} diff --git a/app/Notifications/CheckoutConsumableNotification.php b/app/Notifications/CheckoutConsumableNotification.php new file mode 100644 index 0000000000..2fcc0f67da --- /dev/null +++ b/app/Notifications/CheckoutConsumableNotification.php @@ -0,0 +1,130 @@ +target = $params['target']; + $this->item = $params['item']; + $this->admin = $params['admin']; + $this->log_id = $params['log_id']; + $this->note = ''; + $this->last_checkout = ''; + $this->expected_checkin = ''; + $this->target_type = $params['target_type']; + $this->settings = $params['settings']; + + if (array_key_exists('note', $params)) { + $this->note = $params['note']; + } + + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + $notifyBy = []; + + if (Setting::getSettings()->slack_endpoint!='') { + $notifyBy[] = 'slack'; + } + + // Make sure the target is a user and that its appropriate to send them an email + if ((($this->target->email!='') && ($this->target_type == 'App\Models\User')) && (($this->item->requireAcceptance() == '1') || ($this->item->getEula()))) + { + $notifyBy[] = 'mail'; + } + + return $notifyBy; + } + + public function toSlack($notifiable) + { + $target = $this->target; + $admin = $this->admin; + $item = $this->item; + $note = $this->note; + $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot' ; + + $fields = [ + 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', + 'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', + ]; + + return (new SlackMessage) + ->content(':arrow_up: :paperclip: Consumable Checked Out') + ->from($botname) + ->attachment(function ($attachment) use ($item, $note, $admin, $fields) { + $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) + ->fields($fields) + ->content($note); + }); + } + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + + \Log::debug($this->item->getImageUrl()); + $eula = $this->item->getEula(); + $req_accept = $this->item->requireAcceptance(); + + return (new MailMessage)->markdown('notifications.markdown.checkout-consumable', + [ + 'item' => $this->item, + 'admin' => $this->admin, + 'note' => $this->note, + 'log_id' => $this->note, + 'target' => $this->target, + 'eula' => $eula, + 'req_accept' => $req_accept, + 'accept_url' => url('/').'/account/accept-asset/'.$this->log_id, + ]) + ->subject(trans('mail.Confirm_consumable_delivery')); + + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/app/Notifications/CheckoutLicenseNotification.php b/app/Notifications/CheckoutLicenseNotification.php new file mode 100644 index 0000000000..961ee10a3c --- /dev/null +++ b/app/Notifications/CheckoutLicenseNotification.php @@ -0,0 +1,123 @@ +target = $params['target']; + $this->item = $params['item']; + $this->admin = $params['admin']; + $this->log_id = $params['log_id']; + $this->note = ''; + $this->target_type = $params['target_type']; + $this->settings = $params['settings']; + + if (array_key_exists('note', $params)) { + $this->note = $params['note']; + } + + + + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via() + { + $notifyBy = []; + + if (Setting::getSettings()->slack_endpoint!='') { + $notifyBy[] = 'slack'; + } + + if ($this->target_type == \App\Models\User::class) { + $notifyBy[] = 'mail'; + } + + + + return $notifyBy; + } + + public function toSlack($notifiable) + { + + $target = $this->target; + $admin = $this->admin; + $item = $this->item; + $note = $this->note; + $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot' ; + + $fields = [ + 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', + 'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', + ]; + + return (new SlackMessage) + ->content(':arrow_up: :floppy_disk: License Checked Out') + ->from($botname) + ->attachment(function ($attachment) use ($item, $note, $admin, $fields) { + $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) + ->fields($fields) + ->content($note); + }); + } + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + + return (new MailMessage)->markdown('notifications.markdown.checkout-license', + [ + 'item' => $this->item, + 'admin' => $this->admin, + 'note' => $this->note, + 'target' => $this->target, + ]) + ->subject(trans('mail.Confirm_license_delivery')); + + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/app/Notifications/CheckoutNotification.php b/app/Notifications/CheckoutNotification.php deleted file mode 100644 index 30dc6fcc5e..0000000000 --- a/app/Notifications/CheckoutNotification.php +++ /dev/null @@ -1,133 +0,0 @@ -params = $params; - } - - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * @return array - */ - public function via($notifiable) - { - $notifyBy = []; - if (Setting::getSettings()->slack_endpoint) { - $notifyBy[] = 'slack'; - } - $item = $this->params['item']; - - if (class_basename(get_class($this->params['item']))=='Asset') { - if ((method_exists($item, 'requireAcceptance') && ($item->requireAcceptance() == '1')) - || (method_exists($item, 'getEula') && ($item->getEula())) - ) { - $notifyBy[] = 'mail'; - } - } - return $notifyBy; - } - - public function toSlack($notifiable) - { - - return (new SlackMessage) - ->success() - ->content(class_basename(get_class($this->params['item'])) . " Checked Out") - ->attachment(function ($attachment) use ($notifiable) { - $item = $this->params['item']; - $admin_user = $this->params['admin']; - $target = $this->params['target']; - $fields = [ - 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', - 'By' => '<'.$admin_user->present()->viewUrl().'|'.$admin_user->present()->fullName().'>' - ]; - array_key_exists('note', $this->params) && $fields['Notes'] = $this->params['note']; - - $attachment->title($item->name, $item->present()->viewUrl()) - ->fields($fields); - }); - } - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) - { - if (class_basename(get_class($this->params['item']))=='Asset') { - - //TODO: Expand for non assets. - $item = $this->params['item']; - $admin_user = $this->params['admin']; - $target = $this->params['target']; - $data = [ - 'eula' => method_exists($item, 'getEula') ? $item->getEula() : '', - 'first_name' => $target->present()->fullName(), - 'item_name' => $item->present()->name(), - 'checkout_date' => $item->last_checkout, - 'expected_checkin' => ($item->expected_checkin) ? $item->expected_checkin->format('Y-m-d') : '', - 'item_tag' => $item->asset_tag, - 'note' => $this->params['note'], - 'item_serial' => $item->serial, - 'require_acceptance' => method_exists($item, 'requireAcceptance') ? $item->requireAcceptance() : '', - 'log_id' => $this->params['log_id'], - 'manufacturer_name' => $item->model->manufacturer->name, - 'model_name' => $item->model->name, - 'model_number' => $item->model->model_number, - ]; - - if ((method_exists($item, 'requireAcceptance') && ($item->requireAcceptance() == '1')) - || (method_exists($item, 'getEula') && ($item->getEula())) - ) { - return (new MailMessage) - ->view('emails.accept-asset', $data) - ->subject(trans('mail.Confirm_asset_delivery')); - } - } - - - - - } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } -} diff --git a/database/migrations/2018_03_23_212048_add_display_in_email_to_custom_fields.php b/database/migrations/2018_03_23_212048_add_display_in_email_to_custom_fields.php new file mode 100644 index 0000000000..59771eb4ae --- /dev/null +++ b/database/migrations/2018_03_23_212048_add_display_in_email_to_custom_fields.php @@ -0,0 +1,32 @@ +boolean('show_in_email')->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('custom_fields', function (Blueprint $table) { + $table->dropColumn('show_in_email'); + }); + } +} diff --git a/database/migrations/2018_03_24_030738_add_show_images_in_email_setting.php b/database/migrations/2018_03_24_030738_add_show_images_in_email_setting.php new file mode 100644 index 0000000000..ad362801e0 --- /dev/null +++ b/database/migrations/2018_03_24_030738_add_show_images_in_email_setting.php @@ -0,0 +1,32 @@ +boolean('show_images_in_email')->default(1); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('settings', function (Blueprint $table) { + $table->dropColumn('show_images_in_email'); + }); + } +} diff --git a/database/migrations/2018_03_24_050108_add_cc_alerts.php b/database/migrations/2018_03_24_050108_add_cc_alerts.php new file mode 100644 index 0000000000..44b942116f --- /dev/null +++ b/database/migrations/2018_03_24_050108_add_cc_alerts.php @@ -0,0 +1,32 @@ +char('admin_cc_email')->nullable()->default(null); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('settings', function (Blueprint $table) { + $table->dropColumn('admin_cc_email'); + }); + } +} diff --git a/resources/lang/en/admin/custom_fields/general.php b/resources/lang/en/admin/custom_fields/general.php index 564a9617d9..c8d2a70a71 100644 --- a/resources/lang/en/admin/custom_fields/general.php +++ b/resources/lang/en/admin/custom_fields/general.php @@ -28,4 +28,5 @@ return array( 'create_fieldset' => 'New Fieldset', 'create_field' => 'New Custom Field', 'value_encrypted' => 'The value of this field is encrypted in the database. Only admin users will be able to view the decrypted value', + 'show_in_email' => 'Include the value of this field in checkout emails sent to the user? Encrypted fields cannot be included in emails.', ); diff --git a/resources/lang/en/admin/settings/general.php b/resources/lang/en/admin/settings/general.php index 415fed83c5..6c6ac54672 100644 --- a/resources/lang/en/admin/settings/general.php +++ b/resources/lang/en/admin/settings/general.php @@ -4,6 +4,8 @@ return array( 'ad' => 'Active Directory', 'ad_domain' => 'Active Directory domain', 'ad_domain_help' => 'This is sometimes the same as your email domain, but not always.', + 'admin_cc_email' => 'CC Email', + 'admin_cc_email_help' => 'If you would like to send a copy of checkin/checkout emails that are sent to users to an additional email account, enter it here. Otherwise leave this field blank.', 'is_ad' => 'This is an Active Directory server', 'alert_email' => 'Send alerts to', 'alerts_enabled' => 'Email Alerts Enabled', @@ -107,6 +109,8 @@ return array( 'show_alerts_in_menu' => 'Show alerts in top menu', 'show_archived_in_list' => 'Archived Assets', 'show_archived_in_list_text' => 'Show archived assets in the "all assets" listing', + 'show_images_in_email' => 'Show images in emails', + 'show_images_in_email_help' => 'Uncheck this box if your Snipe-IT installation is behind a VPN or closed network and users outside the network will not be able to load images served from this installation in their emails.', 'site_name' => 'Site Name', 'slack_botname' => 'Slack Botname', 'slack_channel' => 'Slack Channel', diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index abd1fe4e55..ff78b8cfb9 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -9,6 +9,7 @@ 'activity_report' => 'Activity Report', 'address' => 'Address', 'admin' => 'Admin', + 'administrator' => 'Administrator', 'add_seats' => 'Added seats', 'all_assets' => 'All Assets', 'all' => 'All', diff --git a/resources/views/accessories/checkin.blade.php b/resources/views/accessories/checkin.blade.php index 075f72720d..fed09d8d23 100755 --- a/resources/views/accessories/checkin.blade.php +++ b/resources/views/accessories/checkin.blade.php @@ -50,16 +50,15 @@
{{ trans('admin/categories/general.required_acceptance') }}
-{{ trans('admin/categories/general.required_eula') }}
-