From 2d25e00d762147e7d286cfa11f6eb265d71ec363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kv=C3=A1=C4=8Dek?= Date: Mon, 4 Apr 2016 20:26:51 +0200 Subject: [PATCH] FEATURE: add second email into contact form This commit adds second email into contact form - this one may be different from email used for delivering messages. --- modules/ContactForm/Handlers/ContactForm.php | 28 ++++++----- .../Providers/ContactFormServiceProvider.php | 2 +- .../Resources/lang/en/admin/content.php | 1 + .../Resources/lang/en/admin/history.php | 1 + .../views/admin/form/basicInfo.blade.php | 47 +++++++++++-------- 5 files changed, 45 insertions(+), 34 deletions(-) diff --git a/modules/ContactForm/Handlers/ContactForm.php b/modules/ContactForm/Handlers/ContactForm.php index 4cf594ae..f2316480 100644 --- a/modules/ContactForm/Handlers/ContactForm.php +++ b/modules/ContactForm/Handlers/ContactForm.php @@ -43,12 +43,13 @@ class ContactForm extends Handler public static function createNew(Content &$content, Request $request) { $settings = [ - 'phone' => $request->phone, - 'email' => $request->email, - 'companyName' => $request->companyName, - 'address' => $request->address, - 'gpsLat' => $request->gpsLat, - 'gpsLng' => $request->gpsLng, + 'phone' => $request->phone, + 'email' => $request->email, + 'contactEmail' => $request->ContactEmail, + 'companyName' => $request->companyName, + 'address' => $request->address, + 'gpsLat' => $request->gpsLat, + 'gpsLng' => $request->gpsLng, ]; // save settings @@ -70,12 +71,13 @@ class ContactForm extends Handler public static function edit(Content &$content, Request $request, $revisionID) { $fields = [ - 'phone' => 'phone', - 'email' => 'email', - 'companyName' => 'companyName', - 'address' => 'address', - 'gpsLat' => 'gpsLat', - 'gpsLng' => 'gpsLng', + 'phone' => 'phone', + 'email' => 'email', + 'contactEmail' => 'contactEmail', + 'companyName' => 'companyName', + 'address' => 'address', + 'gpsLat' => 'gpsLat', + 'gpsLng' => 'gpsLng', ]; // get data and try to save them @@ -146,7 +148,7 @@ class ContactForm extends Handler $menu->dropdown(trans('contactform::admin/adminMenu.contactForm'), function ($submenu) use ($user) { $submenu->route('content.new', trans('contactform::admin/adminMenu.new'), ['moduleId' => self::getModuleId()], 10, ['icon' => 'fa fa-plus']); $submenu->route('content.overview', trans('contactform::admin/adminMenu.overview'), ['moduleId' => self::getModuleId()], 20, ['icon' => 'fa fa-list']); -// $submenu->route('emails.sent', trans('contactform::admin/adminMenu.sentMessages'), [], 30, ['icon' => 'fa fa-send']); + // $submenu->route('emails.sent', trans('contactform::admin/adminMenu.sentMessages'), [], 30, ['icon' => 'fa fa-send']); }, 25, ['icon' => 'fa fa-envelope-o']); } diff --git a/modules/ContactForm/Providers/ContactFormServiceProvider.php b/modules/ContactForm/Providers/ContactFormServiceProvider.php index 395675b3..88beeaae 100644 --- a/modules/ContactForm/Providers/ContactFormServiceProvider.php +++ b/modules/ContactForm/Providers/ContactFormServiceProvider.php @@ -61,7 +61,7 @@ class ContactFormServiceProvider extends ServiceProvider $sourcePath = __DIR__ . '/../Resources/views'; - $this->publishes([$sourcePath => $viewPath]); + $this->publishes([$sourcePath => $viewPath], 'module-views'); $this->loadViewsFrom(array_merge(array_map(function ($path) { return $path . '/modules/contactform'; diff --git a/modules/ContactForm/Resources/lang/en/admin/content.php b/modules/ContactForm/Resources/lang/en/admin/content.php index bf6a8e02..ec01d7fc 100644 --- a/modules/ContactForm/Resources/lang/en/admin/content.php +++ b/modules/ContactForm/Resources/lang/en/admin/content.php @@ -7,6 +7,7 @@ return [ 'gpsLng' => 'GPS longitude', 'compName' => 'Name displayed above address', 'phone' => 'Contact phone', + 'email' => 'E-mail', 'contactEmail' => 'E-mail, where messages from this form will be delivered', 'contactInformation' => 'Contact information' ]; \ No newline at end of file diff --git a/modules/ContactForm/Resources/lang/en/admin/history.php b/modules/ContactForm/Resources/lang/en/admin/history.php index 59a94453..87225107 100644 --- a/modules/ContactForm/Resources/lang/en/admin/history.php +++ b/modules/ContactForm/Resources/lang/en/admin/history.php @@ -3,6 +3,7 @@ return [ 'columnPhone' => 'Phone', 'columnAddress' => 'Address', 'columnEmail' => 'E-mail', + 'columnContactEmail' => 'Contact E-mail', 'columnCompanyName' => 'Company name', 'columnGpsLat' => 'GPS Latitude', 'columnGpsLng' => 'Gps Longitude', diff --git a/modules/ContactForm/Resources/views/admin/form/basicInfo.blade.php b/modules/ContactForm/Resources/views/admin/form/basicInfo.blade.php index 50a32f3d..dc7d4a8f 100644 --- a/modules/ContactForm/Resources/views/admin/form/basicInfo.blade.php +++ b/modules/ContactForm/Resources/views/admin/form/basicInfo.blade.php @@ -67,24 +67,18 @@
+ + + -
- -
- -
-
- -
-
+
- +
+
+ +
+
+ +
+
-
\ No newline at end of file +