From ade4f0bb2534310da90be3c3c2c4aa43c5694316 Mon Sep 17 00:00:00 2001
From: akshay kumar
Date: Mon, 7 Oct 2019 09:21:12 +0530
Subject: [PATCH 01/23] Reset branch alias to 1.0
---
composer.json | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/composer.json b/composer.json
index 11838e04c..491b46b29 100644
--- a/composer.json
+++ b/composer.json
@@ -26,7 +26,10 @@
"psr-4": { "Webkul\\UVDesk\\CoreFrameworkBundle\\": "" }
},
"extra": {
- "uvdesk-package-extension": "Webkul\\UVDesk\\CoreFrameworkBundle\\Package\\Composer"
+ "uvdesk-package-extension": "Webkul\\UVDesk\\CoreFrameworkBundle\\Package\\Composer",
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
},
"minimum-stability": "dev"
}
From a12a66dc88a0e7d622c4db26587a06f2262d7e42 Mon Sep 17 00:00:00 2001
From: papnoisanjeev
Date: Mon, 7 Oct 2019 17:35:39 +0530
Subject: [PATCH 02/23] change fileSystem non secure path to http
---
FileSystem/FileSystem.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/FileSystem/FileSystem.php b/FileSystem/FileSystem.php
index 93b0bbd53..5f61ca90b 100644
--- a/FileSystem/FileSystem.php
+++ b/FileSystem/FileSystem.php
@@ -121,7 +121,7 @@ public function getFileTypeAssociations(Attachment $attachment, $firewall = 'mem
if ($request->isSecure()) {
$baseURL = "https:////" . $request->getHttpHost() . '/';
} else {
- $baseURL = "https:////" . $request->getHttpHost() . '/';
+ $baseURL = "http:////" . $request->getHttpHost() . '/';
}
$assetDetails = [
From 7815d44cab79d15251ab3c5dd519d8c3200728eb Mon Sep 17 00:00:00 2001
From: piyushwebkul <50818826+piyushwebkul@users.noreply.github.com>
Date: Mon, 14 Oct 2019 14:45:11 +0530
Subject: [PATCH 03/23] Forgt Pass Cont Mail User Eml Temp fg User wrkflw
---
Controller/Password.php | 97 +++++++++++++++++++
Fixtures/EmailTemplates.php | 1 +
Resources/config/routes/public.yaml | 18 +++-
Resources/views/login.html.twig | 2 +-
Services/EmailService.php | 4 +-
.../Email/Resources/User/ForgotPassword.php | 60 ++++++++++++
Workflow/Actions/User/MailUser.php | 63 ++++++++++++
Workflow/Events/User/ForgotPassword.php | 25 +++++
8 files changed, 267 insertions(+), 3 deletions(-)
create mode 100644 Controller/Password.php
create mode 100644 Templates/Email/Resources/User/ForgotPassword.php
create mode 100644 Workflow/Actions/User/MailUser.php
create mode 100644 Workflow/Events/User/ForgotPassword.php
diff --git a/Controller/Password.php b/Controller/Password.php
new file mode 100644
index 000000000..b78f78031
--- /dev/null
+++ b/Controller/Password.php
@@ -0,0 +1,97 @@
+userService = $userService;
+ $this->eventDispatcher = $eventDispatcher;
+ $this->passwordEncoder = $passwordEncoder;
+ }
+
+ public function forgotPassword(Request $request)
+ {
+ $session = $request->getSession();
+ $entityManager = $this->getDoctrine()->getManager();
+
+ if ($request->getMethod() == 'POST') {
+ $user = new User();
+ $form = $this->createFormBuilder($user,['csrf_protection' => false])
+ ->add('email',EmailType::class)
+ ->getForm();
+
+ $form->submit(['email' => $request->request->get('forgot_password_form')['email']]);
+ $form->handleRequest($request);
+
+ if ($form->isValid()) {
+ $repository = $this->getDoctrine()->getRepository('UVDeskCoreFrameworkBundle:User');
+ $user = $entityManager->getRepository('UVDeskCoreFrameworkBundle:User')->findOneBy(array('email' => $form->getData()->getEmail()));
+
+ if ($user) {
+ $session->getFlashBag()->set('success','Please check your mail for password update.');
+
+ // Trigger agent forgot password event
+ $event = new GenericEvent(CoreWorkflowEvents\User\ForgotPassword::getId(), [
+ 'entity' => $user,
+ ]);
+ $this->eventDispatcher->dispatch('uvdesk.automation.workflow.execute', $event);
+ } else {
+ $session->getFlashBag()->set('warning', 'This Email address is not registered with us.');
+ }
+ }
+ }
+
+ return $this->render("@UVDeskCoreFramework//forgotPassword.html.twig");
+ }
+
+ public function resetPassword(Request $request, $email, $verificationCode)
+ {
+ $session = $request->getSession();
+ $entityManager = $this->getDoctrine()->getManager();
+ $user = $entityManager->getRepository('UVDeskCoreFrameworkBundle:User')->findOneByEmail($email);
+
+ if (empty($user) || $user->getVerificationCode() != $verificationCode) {
+ $session->getFlashBag()->set('warning', 'Invalid Credentials.');
+
+ return $this->render("@UVDeskCoreFramework//resetPassword.html.twig");
+ }
+
+ if ($request->getMethod() == 'POST') {
+ $updatedCredentials = $request->request->all();
+
+ if ($updatedCredentials['password'] === $updatedCredentials['confirmPassword']) {
+ $user->setPassword($this->passwordEncoder->encodePassword($user, $updatedCredentials['password']));
+ $user->setVerificationCode(TokenGenerator::generateToken());
+
+ $entityManager->persist($user);
+ $entityManager->flush();
+
+ $session->getFlashBag()->set('success', 'Your password has been updated successfully.');
+ } else {
+ $session->getFlashBag()->set(
+ 'warning',
+ $this->get('translator')->trans('Password don\'t match.')
+ );
+ }
+ }
+
+ return $this->render("@UVDeskCoreFramework//resetPassword.html.twig");
+ }
+}
diff --git a/Fixtures/EmailTemplates.php b/Fixtures/EmailTemplates.php
index d299f3d44..dd16a4af9 100644
--- a/Fixtures/EmailTemplates.php
+++ b/Fixtures/EmailTemplates.php
@@ -19,6 +19,7 @@ class EmailTemplates extends DoctrineFixture
CoreEmailTemplates\Customer\TicketCreated::class,
CoreEmailTemplates\Customer\AccountCreated::class,
CoreEmailTemplates\Customer\ForgotPassword::class,
+ CoreEmailTemplates\User\ForgotPassword::class,
];
public function load(ObjectManager $entityManager)
diff --git a/Resources/config/routes/public.yaml b/Resources/config/routes/public.yaml
index 3c0d16f66..0a4d40cb0 100644
--- a/Resources/config/routes/public.yaml
+++ b/Resources/config/routes/public.yaml
@@ -1 +1,17 @@
-# Add public routing resources here ...
\ No newline at end of file
+helpdesk_forgot_account_password:
+ path: /{_locale}/forgot-password
+ controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Password::forgotPassword
+ requirements:
+ _locale: '%app_locales%'
+ defaults:
+ _locale: '%locale%'
+
+helpdesk_reset_account_password:
+ path: /{_locale}/reset-password/{email}/{verificationCode}
+ controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Password::resetPassword
+ requirements:
+ _locale: '%app_locales%'
+ defaults:
+ email: ''
+ verificationCode: ''
+ _locale: '%locale%'
\ No newline at end of file
diff --git a/Resources/views/login.html.twig b/Resources/views/login.html.twig
index 2b2a2cd22..6fb98e060 100644
--- a/Resources/views/login.html.twig
+++ b/Resources/views/login.html.twig
@@ -40,7 +40,7 @@
diff --git a/Services/EmailService.php b/Services/EmailService.php
index 28e845105..e9485f43b 100644
--- a/Services/EmailService.php
+++ b/Services/EmailService.php
@@ -342,7 +342,7 @@ public function getEmailPlaceholderValues(User $user, $userType = 'member')
}
// Link to update account login credentials
- $updateCredentialsURL = $router->generate(('customer' == $userType) ? 'helpdesk_customer_update_account_credentials' : 'helpdesk_member_update_account_credentials', [
+ $updateCredentialsURL = $router->generate( 'helpdesk_reset_account_password', [
'email' => $user->getEmail(),
'verificationCode' => $user->getVerificationCode(),
], UrlGeneratorInterface::ABSOLUTE_URL);
@@ -527,6 +527,8 @@ public function sendMail($subject, $content, $recipient, array $headers = [], $m
return "<$messageId>";
} catch (\Exception $e) {
// @TODO: Log exception
+ dump($e->getMessage());
+ die;
}
return null;
diff --git a/Templates/Email/Resources/User/ForgotPassword.php b/Templates/Email/Resources/User/ForgotPassword.php
new file mode 100644
index 000000000..b9b4fc2f2
--- /dev/null
+++ b/Templates/Email/Resources/User/ForgotPassword.php
@@ -0,0 +1,60 @@
+
+
+
+
+ {%global.companyLogo%}
+
+
+
+ Hi {%user.userName%},
+
+
+
+
+
+ You recently requested to reset your password for your {%global.companyName%} account. Click the link to reset it {%user.forgotPasswordLink%}
+
+
+
+ If you did not request a password reset, please ignore this mail or revert back to let us know.
+
+
+
+ Thanks and Regards
+ {%global.companyName%}
+
+
+MESSAGE;
+
+ public static function getName()
+ {
+ return self::$name;
+ }
+
+ public static function getTemplateType()
+ {
+ return self::$type;
+ }
+
+ public static function getSubject()
+ {
+ return self::$subject;
+ }
+
+ public static function getMessage()
+ {
+ return self::$message;
+ }
+}
\ No newline at end of file
diff --git a/Workflow/Actions/User/MailUser.php b/Workflow/Actions/User/MailUser.php
new file mode 100644
index 000000000..615135375
--- /dev/null
+++ b/Workflow/Actions/User/MailUser.php
@@ -0,0 +1,63 @@
+get('doctrine.orm.entity_manager');
+
+ return array_map(function ($emailTemplate) {
+ return [
+ 'id' => $emailTemplate->getId(),
+ 'name' => $emailTemplate->getName(),
+ ];
+ }, $entityManager->getRepository('UVDeskCoreFrameworkBundle:EmailTemplates')->findAll());
+ }
+
+ public static function applyAction(ContainerInterface $container, $entity, $value = null)
+ {
+ $entityManager = $container->get('doctrine.orm.entity_manager');
+
+ switch (true) {
+ case $entity instanceof CoreEntities\User:
+ $emailTemplate = $entityManager->getRepository('UVDeskCoreFrameworkBundle:EmailTemplates')->findOneById($value);
+
+ if (empty($emailTemplate)) {
+ // @TODO: Send default email template
+ return;
+ }
+
+ $emailPlaceholders = $container->get('email.service')->getEmailPlaceholderValues($entity);
+ $subject = $container->get('email.service')->processEmailSubject($emailTemplate->getSubject(), $emailPlaceholders);
+ $message = $container->get('email.service')->processEmailContent($emailTemplate->getMessage(), $emailPlaceholders);
+
+ $messageId = $container->get('email.service')->sendMail($subject, $message, $entity->getEmail());
+ break;
+ default:
+ break;
+ }
+ }
+}
diff --git a/Workflow/Events/User/ForgotPassword.php b/Workflow/Events/User/ForgotPassword.php
new file mode 100644
index 000000000..374371146
--- /dev/null
+++ b/Workflow/Events/User/ForgotPassword.php
@@ -0,0 +1,25 @@
+
Date: Tue, 15 Oct 2019 12:53:12 +0530
Subject: [PATCH 04/23] forgot password reduntant code removed
---
Controller/Authentication.php | 81 -------------------
Fixtures/EmailTemplates.php | 2 -
Resources/config/routes/private.yaml | 9 ---
Resources/views/Templates/layout.html.twig | 2 +-
.../Email/Resources/Agent/ForgotPassword.php | 68 ----------------
.../Resources/Customer/ForgotPassword.php | 60 --------------
Workflow/Events/Agent/ForgotPassword.php | 25 ------
Workflow/Events/Customer/ForgotPassword.php | 25 ------
8 files changed, 1 insertion(+), 271 deletions(-)
delete mode 100644 Templates/Email/Resources/Agent/ForgotPassword.php
delete mode 100644 Templates/Email/Resources/Customer/ForgotPassword.php
delete mode 100644 Workflow/Events/Agent/ForgotPassword.php
delete mode 100644 Workflow/Events/Customer/ForgotPassword.php
diff --git a/Controller/Authentication.php b/Controller/Authentication.php
index 40fbd91ae..3de5990a3 100644
--- a/Controller/Authentication.php
+++ b/Controller/Authentication.php
@@ -29,85 +29,4 @@ public function logout(Request $request)
{
return;
}
-
- public function forgotPassword(Request $request)
- {
- if (null == $this->get('user.service')->getSessionUser()) {
- $entityManager = $this->getDoctrine()->getManager();
-
- if ($request->getMethod() == 'POST') {
- $user = new User();
- $form = $this->createFormBuilder($user,['csrf_protection' => false])
- ->add('email',EmailType::class)
- ->getForm();
-
- $form->submit(['email' => $request->request->get('forgot_password_form')['email']]);
- $form->handleRequest($request);
-
- if ($form->isValid()) {
- $repository = $this->getDoctrine()->getRepository('UVDeskCoreFrameworkBundle:User');
- $user = $entityManager->getRepository('UVDeskCoreFrameworkBundle:User')->findOneBy(array('email' => $form->getData()->getEmail()));
-
- if ($user && $user->getAgentInstance()) {
- // Trigger agent forgot password event
- $event = new GenericEvent(CoreWorkflowEvents\Agent\ForgotPassword::getId(), [
- 'entity' => $user,
- ]);
-
- $this->get('event_dispatcher')->dispatch('uvdesk.automation.workflow.execute', $event);
- $request->getSession()->getFlashBag()->set('success','Please check your mail for password update.');
-
- return $this->redirect($this->generateUrl('helpdesk_member_update_account_credentials')."/".$form->getData()->getEmail());
- } else {
- $request->getSession()->getFlashBag()->set('warning', 'This Email address is not registered with us.');
- }
- }
- }
-
- return $this->render("@UVDeskCoreFramework//forgotPassword.html.twig");
- }
-
- return $this->redirect($this->generateUrl('helpdesk_member_dashboard'));
- }
-
- public function updateCredentials($email, $verificationCode)
- {
- if (empty($email) || empty($verificationCode)) {
- return $this->redirect($this->generateUrl('helpdesk_member_handle_login'));
- }
-
- $entityManager = $this->getDoctrine()->getManager();
- $request = $this->container->get('request_stack')->getCurrentRequest();
-
- // Validate request
- $user = $entityManager->getRepository('UVDeskCoreFrameworkBundle:User')->findOneByEmail($email);
-
- if (empty($user) || null == $user->getAgentInstance() || $user->getVerificationCode() != $verificationCode) {
- return $this->redirect($this->generateUrl('helpdesk_member_handle_login'));
- }
-
- if ($request->getMethod() == 'POST') {
- $updatedCredentials = $request->request->all();
-
- if ($updatedCredentials['password'] === $updatedCredentials['confirmPassword']) {
- $user->setPassword($this->encodePassword($user, $updatedCredentials['password']));
- $user->setVerificationCode(TokenGenerator::generateToken());
-
- $entityManager->persist($user);
- $entityManager->flush();
-
- $request->getSession()->getFlashBag()->set('success', 'Your password has been updated successfully.');
- return $this->redirect($this->generateUrl('helpdesk_member_handle_login'));
- } else {
- $request->getSession()->getFlashBag()->set('warning', "Password don't match.");
- }
- }
-
- return $this->render("@UVDeskCoreFramework//resetPassword.html.twig");
- }
-
- protected function encodePassword(User $user, $plainPassword)
- {
- return $encodedPassword = $this->container->get('security.password_encoder')->encodePassword($user, $plainPassword);
- }
}
diff --git a/Fixtures/EmailTemplates.php b/Fixtures/EmailTemplates.php
index dd16a4af9..0fa25bbc6 100644
--- a/Fixtures/EmailTemplates.php
+++ b/Fixtures/EmailTemplates.php
@@ -13,12 +13,10 @@ class EmailTemplates extends DoctrineFixture
CoreEmailTemplates\Agent\TicketReply::class,
CoreEmailTemplates\Agent\TicketCreated::class,
CoreEmailTemplates\Agent\AccountCreated::class,
- CoreEmailTemplates\Agent\ForgotPassword::class,
CoreEmailTemplates\Agent\TicketAssigned::class,
CoreEmailTemplates\Customer\TicketReply::class,
CoreEmailTemplates\Customer\TicketCreated::class,
CoreEmailTemplates\Customer\AccountCreated::class,
- CoreEmailTemplates\Customer\ForgotPassword::class,
CoreEmailTemplates\User\ForgotPassword::class,
];
diff --git a/Resources/config/routes/private.yaml b/Resources/config/routes/private.yaml
index f77a27ebc..386b9e416 100644
--- a/Resources/config/routes/private.yaml
+++ b/Resources/config/routes/private.yaml
@@ -7,15 +7,6 @@ helpdesk_member_handle_logout:
path: /logout
controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Authentication::logout
-helpdesk_member_forgot_account_password:
- path: /forgot-password
- controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Authentication::forgotPassword
-
-helpdesk_member_update_account_credentials:
- path: /update-credentials/{email}/{verificationCode}
- controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Authentication::updateCredentials
- defaults: { email: '', verificationCode: '' }
-
# Agent Panel Resources
helpdesk_member_dashboard:
path: /dashboard
diff --git a/Resources/views/Templates/layout.html.twig b/Resources/views/Templates/layout.html.twig
index cbb6f2308..e0b302fca 100644
--- a/Resources/views/Templates/layout.html.twig
+++ b/Resources/views/Templates/layout.html.twig
@@ -78,7 +78,7 @@
{% set currentUser = user_service.getSessionUser() %}
- {% if currentUser is not empty %}
+ {% if currentUser is not empty and currentUser.getAgentInstance() is not empty %}
{% set currentUserDetails = currentUser.getAgentInstance().getPartialDetails() %}
{% endif %}
diff --git a/Templates/Email/Resources/Agent/ForgotPassword.php b/Templates/Email/Resources/Agent/ForgotPassword.php
deleted file mode 100644
index da16c9167..000000000
--- a/Templates/Email/Resources/Agent/ForgotPassword.php
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
- {%global.companyLogo%}
-
-
-
-
-
- Forgot password, this is it!!
-
-
-
-
-
- Hi {%user.userName%},
-
-
-
-
-
- You recently requested to reset your password for your {%global.companyName%} account. Click the link to reset it {%user.forgotPasswordLink%}
-
-
-
- If you did not request a password reset, please ignore this mail or revert back to let us know.
-
-
-
- Thanks and Regards
- {%global.companyName%}
-
-
-MESSAGE;
-
- public static function getName()
- {
- return self::$name;
- }
-
- public static function getTemplateType()
- {
- return self::$type;
- }
-
- public static function getSubject()
- {
- return self::$subject;
- }
-
- public static function getMessage()
- {
- return self::$message;
- }
-}
\ No newline at end of file
diff --git a/Templates/Email/Resources/Customer/ForgotPassword.php b/Templates/Email/Resources/Customer/ForgotPassword.php
deleted file mode 100644
index 789746b36..000000000
--- a/Templates/Email/Resources/Customer/ForgotPassword.php
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
- {%global.companyLogo%}
-
-
-
- Hi {%user.userName%},
-
-
-
-
-
- You recently requested to reset your password for your {%global.companyName%} account. Click the link to reset it {%user.forgotPasswordLink%}
-
-
-
- If you did not request a password reset, please ignore this mail or revert back to let us know.
-
-
-
- Thanks and Regards
- {%global.companyName%}
-
-
-MESSAGE;
-
- public static function getName()
- {
- return self::$name;
- }
-
- public static function getTemplateType()
- {
- return self::$type;
- }
-
- public static function getSubject()
- {
- return self::$subject;
- }
-
- public static function getMessage()
- {
- return self::$message;
- }
-}
\ No newline at end of file
diff --git a/Workflow/Events/Agent/ForgotPassword.php b/Workflow/Events/Agent/ForgotPassword.php
deleted file mode 100644
index f4fbcd707..000000000
--- a/Workflow/Events/Agent/ForgotPassword.php
+++ /dev/null
@@ -1,25 +0,0 @@
-
Date: Tue, 15 Oct 2019 19:31:54 +0530
Subject: [PATCH 05/23] attac.twg tkt serv twig glob uvdesk.php conf.yml
---
.../views/Templates/attachment.html.twig | 60 +++++++++++++++----
Services/TicketService.php | 13 ++--
Templates/config.yaml | 5 ++
Templates/twig.yaml | 3 +
Templates/uvdesk.php | 5 ++
5 files changed, 68 insertions(+), 18 deletions(-)
diff --git a/Resources/views/Templates/attachment.html.twig b/Resources/views/Templates/attachment.html.twig
index ab3893ada..d2219e99d 100644
--- a/Resources/views/Templates/attachment.html.twig
+++ b/Resources/views/Templates/attachment.html.twig
@@ -7,37 +7,77 @@
$(function () {
var FileView = Backbone.View.extend({
fileCounter: 0,
+ max_post_size: {{ default_max_post_size }},
+ max_file_uploads: {{ default_max_file_uploads }},
+ upload_max_filesize: {{ default_upload_max_filesize }},
el: '.attachment-block',
events : {
'click .uv-file-label': 'createFileType',
'change .attachment': 'selectFile',
- 'click .uv-added-attachment span': 'removeFile'
+ 'click .uv-added-attachment span': 'removeFile',
+ 'click .uv-field-message': 'removeError',
},
createFileType: function(e) {
- currentElement = Backbone.$(e.currentTarget)
+ this.removeError(e)
+ var currentElement = Backbone.$(e.currentTarget),
+ attachmentBlock = currentElement.parents('.attachment-block')
+ if (attachmentBlock.children('.uv-added-attachment').length + 1 > this.max_file_uploads) {
+ attachmentBlock.append(this.getDefaultErrorMessage())
+ return;
+ }
this.fileCounter += 1;
- currentElement.parents('.attachment-block').append('')
+ attachmentBlock.append('')
$('#file-' + this.fileCounter).find('.attachment').trigger('click')
},
labelTemplate: _.template('
'),
selectFile: function(e) {
- currentElement = Backbone.$(e.currentTarget)
- var attachmentBlock = currentElement.parents(".uv-added-attachment");
+ var currentElement = Backbone.$(e.currentTarget)
+ attachmentBlock = currentElement.parents(".uv-added-attachment"),
+ isError = false
if(currentElement.length) {
- files = currentElement[0].files;
- if(files.length) {
+ files = currentElement[0].files;
+ if(files.length) {
for (var i = 0; i < files.length; i++) {
var fileName = files[i].name;
+ if (files[i].size > this.upload_max_filesize) {
+ isError = true;
+ break;
+ }
+ // Validating Form Size
+ var formSize = 0
+ var formData = new FormData(currentElement.parents('form')[0])
+ for (var pair of formData.entries()) {
+ if (pair[1] instanceof Blob) {
+ formSize += pair[1].size
+ } else {
+ formSize += pair[1].length
+ }
+ }
+ if (formSize > this.max_post_size) {
+ isError = true
+ }
attachmentBlock.append(this.labelTemplate({'fileName': fileName}));
}
- }
+ }
+ }
+
+ if (isError) {
+ attachmentBlock.parents('.attachment-block').append(this.getDefaultErrorMessage())
+ attachmentBlock.remove()
+ return
}
-
attachmentBlock.show()
},
removeFile: function(e) {
+ this.removeError(e)
Backbone.$(e.currentTarget).parents('.uv-added-attachment').remove()
- }
+ },
+ getDefaultErrorMessage: function() {
+ return 'You can send up to ' + Math.floor(this.upload_max_filesize/(1024*1024)) + ' MB in attachments. If you have more than one attachment, they can\'t add up to more than ' + Math.floor(this.max_post_size/(1024*1024)) + ' MB and ' + this.max_file_uploads + ' attachments in total.'
+ },
+ removeError: function(e) {
+ Backbone.$(e.currentTarget).parents('.attachment-block').find('.uv-field-message').remove()
+ }
});
var fileView = new FileView();
diff --git a/Services/TicketService.php b/Services/TicketService.php
index 64c5fb8c1..56c25e5fb 100644
--- a/Services/TicketService.php
+++ b/Services/TicketService.php
@@ -1359,17 +1359,14 @@ public function fomatTimeByPreference($dbTime,$timeZone,$timeFormat,$agentTimeZo
public function isTicketAccessGranted(Ticket $ticket, User $user = null, $firewall = 'members')
{
// @TODO: Take current firewall into consideration (access check on behalf of agent/customer)
+ $user = $user ?? $user = $this->container->get('user.service')->getSessionUser();
if (empty($user)) {
- $user = $this->container->get('user.service')->getSessionUser();
+ return false;
+ } else {
+ $agentInstance = $this->getUser()->getAgentInstance();
- if (empty($user)) {
+ if (empty($agentInstance)) {
return false;
- } else {
- $agentInstance = $this->getUser()->getAgentInstance();
-
- if (empty($agentInstance)) {
- return false;
- }
}
}
diff --git a/Templates/config.yaml b/Templates/config.yaml
index d64417502..94d1fae41 100644
--- a/Templates/config.yaml
+++ b/Templates/config.yaml
@@ -9,6 +9,11 @@ parameters:
uvdesk_site_path.member_prefix: member
uvdesk_site_path.knowledgebase_customer_prefix: customer
+ # File uploads constraints
+ default_max_post_size: 8388608
+ default_max_file_uploads: 20
+ default_upload_max_filesize: 2097152
+
uvdesk:
site_url: 'localhost:8000'
upload_manager:
diff --git a/Templates/twig.yaml b/Templates/twig.yaml
index 1fb0aa3c0..d97f63089 100644
--- a/Templates/twig.yaml
+++ b/Templates/twig.yaml
@@ -3,6 +3,9 @@ twig:
default_agent_image_path: '%assets_default_agent_profile_image_path%'
default_customer_image_path: '%assets_default_customer_profile_image_path%'
default_helpdesk_image_path: '%assets_default_helpdesk_profile_image_path%'
+ default_max_post_size: '%default_max_post_size%'
+ default_max_file_uploads: '%default_max_file_uploads%'
+ default_upload_max_filesize: '%default_upload_max_filesize%'
user_service: "@user.service"
uvdesk_service: "@uvdesk.service"
ticket_service: "@ticket.service"
diff --git a/Templates/uvdesk.php b/Templates/uvdesk.php
index 6951e4a9b..5784270b0 100644
--- a/Templates/uvdesk.php
+++ b/Templates/uvdesk.php
@@ -12,6 +12,11 @@
uvdesk_site_path.member_prefix: member
uvdesk_site_path.knowledgebase_customer_prefix: customer
+
+ # File uploads constraints
+ default_max_post_size: 8388608
+ default_max_file_uploads: 20
+ default_upload_max_filesize: 2097152
uvdesk:
site_url: '{{ SITE_URL }}'
From 77a6d43116ebbe0d9a573281b9cb9e2b7fd0c3a4 Mon Sep 17 00:00:00 2001
From: princewebkul
Date: Wed, 16 Oct 2019 18:33:57 +0530
Subject: [PATCH 06/23] 1.0-issue-234
---
Repository/ThreadRepository.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Repository/ThreadRepository.php b/Repository/ThreadRepository.php
index db95849a9..5a97c29c9 100644
--- a/Repository/ThreadRepository.php
+++ b/Repository/ThreadRepository.php
@@ -137,7 +137,7 @@ public function getAllCustomerThreads($ticketId,\Symfony\Component\HttpFoundatio
'reply' => html_entity_decode($thread['message']),
'source' => $thread['source'],
'threadType' => $thread['threadType'],
- 'userType' => 'customer',
+ 'userType' => $thread['createdBy'],
'formatedCreatedAt' => $userService->getLocalizedFormattedTime($userService->getSessionUser(), $thread['createdAt']),
'timestamp' => $userService->convertToDatetimeTimezoneTimestamp($thread['createdAt']),
'cc' => $thread['cc'],
From 9d7cee3b6f77f3e69b16b9cb5507e0115edbba28 Mon Sep 17 00:00:00 2001
From: The Gitter Badger
Date: Thu, 17 Oct 2019 06:15:32 +0000
Subject: [PATCH 07/23] Add Gitter badge
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 56d8570e1..6d1195967 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,8 @@
CoreFrameworkBundle
--------------
+[![Join the chat at https://gitter.im/uvdesk/core-framework](https://badges.gitter.im/uvdesk/core-framework.svg)](https://gitter.im/uvdesk/core-framework?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
The standalone **CoreFrameworkBundle** lies at the heart of the [UVDesk Community][1] helpdesk, providing the core essential functionalities and integration tools to easily integrate any other community helpdesk packages, furhter extending the capabilities of the helpdesk system.
The core framework bundle comes loaded with the following features:
From 07e3e92c03ea81ca3334bcbb388f765f60f4394c Mon Sep 17 00:00:00 2001
From: ANmol Rathi
Date: Mon, 21 Oct 2019 16:28:55 +0530
Subject: [PATCH 08/23] Issue #240, When last name is DB is null, agent's
entire becomes empty, but is now fixed
---
Resources/views/ticket.html.twig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Resources/views/ticket.html.twig b/Resources/views/ticket.html.twig
index 3e51c9e80..fd0ac0f33 100755
--- a/Resources/views/ticket.html.twig
+++ b/Resources/views/ticket.html.twig
@@ -415,7 +415,7 @@
{% for agent in user_service.getAgentPartialDataCollection() %}
-
- {{ agent.name }}
+ {{ agentName }}
{% endfor %}
From 3deebd10f11ddc3d91388e50da8dc3bb8aaac31d Mon Sep 17 00:00:00 2001
From: akshay kumar
Date: Mon, 21 Oct 2019 22:10:58 +0530
Subject: [PATCH 09/23] Misc. changes to updates from pull request #232
---
Controller/Authentication.php | 80 ++++++++++++++-
Controller/Password.php | 97 -------------------
Fixtures/EmailTemplates.php | 2 +-
Resources/config/routes/public.yaml | 43 +++++---
Services/EmailService.php | 4 +-
...gotPassword.php => UserForgotPassword.php} | 6 +-
Workflow/Actions/{User => }/MailUser.php | 6 +-
Workflow/Events/{User => }/ForgotPassword.php | 6 +-
8 files changed, 115 insertions(+), 129 deletions(-)
delete mode 100644 Controller/Password.php
rename Templates/Email/Resources/{User/ForgotPassword.php => UserForgotPassword.php} (91%)
rename Workflow/Actions/{User => }/MailUser.php (97%)
rename Workflow/Events/{User => }/ForgotPassword.php (75%)
diff --git a/Controller/Authentication.php b/Controller/Authentication.php
index 3de5990a3..cd9180887 100644
--- a/Controller/Authentication.php
+++ b/Controller/Authentication.php
@@ -3,15 +3,17 @@
namespace Webkul\UVDesk\CoreFrameworkBundle\Controller;
use Symfony\Component\Form\FormError;
-use Webkul\UVDesk\CoreFrameworkBundle\Entity\User;
use Symfony\Component\HttpFoundation\Request;
-use Webkul\UVDesk\CoreFrameworkBundle\Utils\TokenGenerator;
+use Symfony\Component\HttpFoundation\Response;
+use Webkul\UVDesk\CoreFrameworkBundle\Entity\User;
use Symfony\Component\EventDispatcher\GenericEvent;
-use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
+use Webkul\UVDesk\CoreFrameworkBundle\Utils\TokenGenerator;
+use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
+use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
use Webkul\UVDesk\CoreFrameworkBundle\Workflow\Events as CoreWorkflowEvents;
-class Authentication extends Controller
+class Authentication extends AbstractController
{
public function login(Request $request)
{
@@ -29,4 +31,74 @@ public function logout(Request $request)
{
return;
}
+
+ public function forgotPassword(Request $request)
+ {
+ if (null != $this->get('user.service')->getSessionUser()) {
+ return new Response('How did you land here? :/', 404);
+ }
+
+ $entityManager = $this->getDoctrine()->getManager();
+
+ if ($request->getMethod() == 'POST') {
+ $user = new User();
+ $form = $this->createFormBuilder($user,['csrf_protection' => false])
+ ->add('email',EmailType::class)
+ ->getForm();
+
+ $form->submit(['email' => $request->request->get('forgot_password_form')['email']]);
+ $form->handleRequest($request);
+
+ if ($form->isValid()) {
+ $repository = $this->getDoctrine()->getRepository('UVDeskCoreFrameworkBundle:User');
+ $user = $entityManager->getRepository('UVDeskCoreFrameworkBundle:User')->findOneByEmail($form->getData()->getEmail());
+
+ if (!empty($user)) {
+ // Trigger agent forgot password event
+ $event = new GenericEvent(CoreWorkflowEvents\UserForgotPassword::getId(), [
+ 'entity' => $user,
+ ]);
+
+ $this->get('event_dispatcher')->dispatch('uvdesk.automation.workflow.execute', $event);
+ $request->getSession()->getFlashBag()->set('success', 'Please check your mail for password update.');
+ } else {
+ $request->getSession()->getFlashBag()->set('warning', 'This email address is not registered with us.');
+ }
+ }
+ }
+
+ return $this->render("@UVDeskCoreFramework//forgotPassword.html.twig");
+ }
+
+ public function updateCredentials($email, $verificationCode, Request $request, UserPasswordEncoderInterface $encoder)
+ {
+ if (empty($email) || empty($verificationCode)) {
+ return new Response('How did you land here? :/', 404);
+ } else {
+ $entityManager = $this->getDoctrine()->getManager();
+ $user = $entityManager->getRepository('UVDeskCoreFrameworkBundle:User')->findOneByEmail($email);
+
+ if (empty($user) || $user->getVerificationCode() != $verificationCode) {
+ return new Response('How did you land here? :/', 404);
+ }
+ }
+
+ if ($request->getMethod() == 'POST') {
+ $updatedCredentials = $request->request->all();
+
+ if ($updatedCredentials['password'] === $updatedCredentials['confirmPassword']) {
+ $user->setPassword($encoder->encodePassword($user, $updatedCredentials['password']));
+ $user->setVerificationCode(TokenGenerator::generateToken());
+
+ $entityManager->persist($user);
+ $entityManager->flush();
+
+ $request->getSession()->getFlashBag()->set('success', 'Your password has been updated successfully.');
+ } else {
+ $request->getSession()->getFlashBag()->set('warning', "Please try again. The passwords do not match.");
+ }
+ }
+
+ return $this->render("@UVDeskCoreFramework//resetPassword.html.twig");
+ }
}
diff --git a/Controller/Password.php b/Controller/Password.php
deleted file mode 100644
index b78f78031..000000000
--- a/Controller/Password.php
+++ /dev/null
@@ -1,97 +0,0 @@
-userService = $userService;
- $this->eventDispatcher = $eventDispatcher;
- $this->passwordEncoder = $passwordEncoder;
- }
-
- public function forgotPassword(Request $request)
- {
- $session = $request->getSession();
- $entityManager = $this->getDoctrine()->getManager();
-
- if ($request->getMethod() == 'POST') {
- $user = new User();
- $form = $this->createFormBuilder($user,['csrf_protection' => false])
- ->add('email',EmailType::class)
- ->getForm();
-
- $form->submit(['email' => $request->request->get('forgot_password_form')['email']]);
- $form->handleRequest($request);
-
- if ($form->isValid()) {
- $repository = $this->getDoctrine()->getRepository('UVDeskCoreFrameworkBundle:User');
- $user = $entityManager->getRepository('UVDeskCoreFrameworkBundle:User')->findOneBy(array('email' => $form->getData()->getEmail()));
-
- if ($user) {
- $session->getFlashBag()->set('success','Please check your mail for password update.');
-
- // Trigger agent forgot password event
- $event = new GenericEvent(CoreWorkflowEvents\User\ForgotPassword::getId(), [
- 'entity' => $user,
- ]);
- $this->eventDispatcher->dispatch('uvdesk.automation.workflow.execute', $event);
- } else {
- $session->getFlashBag()->set('warning', 'This Email address is not registered with us.');
- }
- }
- }
-
- return $this->render("@UVDeskCoreFramework//forgotPassword.html.twig");
- }
-
- public function resetPassword(Request $request, $email, $verificationCode)
- {
- $session = $request->getSession();
- $entityManager = $this->getDoctrine()->getManager();
- $user = $entityManager->getRepository('UVDeskCoreFrameworkBundle:User')->findOneByEmail($email);
-
- if (empty($user) || $user->getVerificationCode() != $verificationCode) {
- $session->getFlashBag()->set('warning', 'Invalid Credentials.');
-
- return $this->render("@UVDeskCoreFramework//resetPassword.html.twig");
- }
-
- if ($request->getMethod() == 'POST') {
- $updatedCredentials = $request->request->all();
-
- if ($updatedCredentials['password'] === $updatedCredentials['confirmPassword']) {
- $user->setPassword($this->passwordEncoder->encodePassword($user, $updatedCredentials['password']));
- $user->setVerificationCode(TokenGenerator::generateToken());
-
- $entityManager->persist($user);
- $entityManager->flush();
-
- $session->getFlashBag()->set('success', 'Your password has been updated successfully.');
- } else {
- $session->getFlashBag()->set(
- 'warning',
- $this->get('translator')->trans('Password don\'t match.')
- );
- }
- }
-
- return $this->render("@UVDeskCoreFramework//resetPassword.html.twig");
- }
-}
diff --git a/Fixtures/EmailTemplates.php b/Fixtures/EmailTemplates.php
index 0fa25bbc6..3d88c675f 100644
--- a/Fixtures/EmailTemplates.php
+++ b/Fixtures/EmailTemplates.php
@@ -10,6 +10,7 @@
class EmailTemplates extends DoctrineFixture
{
private static $seeds = [
+ CoreEmailTemplates\UserForgotPassword::class,
CoreEmailTemplates\Agent\TicketReply::class,
CoreEmailTemplates\Agent\TicketCreated::class,
CoreEmailTemplates\Agent\AccountCreated::class,
@@ -17,7 +18,6 @@ class EmailTemplates extends DoctrineFixture
CoreEmailTemplates\Customer\TicketReply::class,
CoreEmailTemplates\Customer\TicketCreated::class,
CoreEmailTemplates\Customer\AccountCreated::class,
- CoreEmailTemplates\User\ForgotPassword::class,
];
public function load(ObjectManager $entityManager)
diff --git a/Resources/config/routes/public.yaml b/Resources/config/routes/public.yaml
index 0a4d40cb0..5b693e41c 100644
--- a/Resources/config/routes/public.yaml
+++ b/Resources/config/routes/public.yaml
@@ -1,17 +1,30 @@
+# Add public routing resources here ...
+# helpdesk_forgot_account_password:
+# path: /{_locale}/forgot-password
+# controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Password::forgotPassword
+# requirements:
+# _locale: '%app_locales%'
+# defaults:
+# _locale: '%locale%'
+
+# helpdesk_reset_account_password:
+# path: /{_locale}/reset-password/{email}/{verificationCode}
+# controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Password::resetPassword
+# requirements:
+# _locale: '%app_locales%'
+# defaults:
+# email: ''
+# verificationCode: ''
+# _locale: '%locale%'
+
helpdesk_forgot_account_password:
- path: /{_locale}/forgot-password
- controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Password::forgotPassword
- requirements:
- _locale: '%app_locales%'
- defaults:
- _locale: '%locale%'
+ path: /{_locale}/forgot-password
+ controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Authentication::forgotPassword
+ requirements: { _locale: '%app_locales%' }
+ defaults: { _locale: '%locale%' }
-helpdesk_reset_account_password:
- path: /{_locale}/reset-password/{email}/{verificationCode}
- controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Password::resetPassword
- requirements:
- _locale: '%app_locales%'
- defaults:
- email: ''
- verificationCode: ''
- _locale: '%locale%'
\ No newline at end of file
+helpdesk_update_account_credentials:
+ path: /{_locale}/update-credentials/{email}/{verificationCode}
+ controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Authentication::updateCredentials
+ requirements: { _locale: '%app_locales%' }
+ defaults: { _locale: '%locale%', email: '', verificationCode: '' }
diff --git a/Services/EmailService.php b/Services/EmailService.php
index e9485f43b..f2cd52607 100644
--- a/Services/EmailService.php
+++ b/Services/EmailService.php
@@ -342,7 +342,7 @@ public function getEmailPlaceholderValues(User $user, $userType = 'member')
}
// Link to update account login credentials
- $updateCredentialsURL = $router->generate( 'helpdesk_reset_account_password', [
+ $updateCredentialsURL = $router->generate( 'helpdesk_update_account_credentials', [
'email' => $user->getEmail(),
'verificationCode' => $user->getVerificationCode(),
], UrlGeneratorInterface::ABSOLUTE_URL);
@@ -527,8 +527,6 @@ public function sendMail($subject, $content, $recipient, array $headers = [], $m
return "<$messageId>";
} catch (\Exception $e) {
// @TODO: Log exception
- dump($e->getMessage());
- die;
}
return null;
diff --git a/Templates/Email/Resources/User/ForgotPassword.php b/Templates/Email/Resources/UserForgotPassword.php
similarity index 91%
rename from Templates/Email/Resources/User/ForgotPassword.php
rename to Templates/Email/Resources/UserForgotPassword.php
index b9b4fc2f2..37b6c2ea9 100644
--- a/Templates/Email/Resources/User/ForgotPassword.php
+++ b/Templates/Email/Resources/UserForgotPassword.php
@@ -1,13 +1,13 @@
diff --git a/Workflow/Actions/User/MailUser.php b/Workflow/Actions/MailUser.php
similarity index 97%
rename from Workflow/Actions/User/MailUser.php
rename to Workflow/Actions/MailUser.php
index 615135375..b925e7be8 100644
--- a/Workflow/Actions/User/MailUser.php
+++ b/Workflow/Actions/MailUser.php
@@ -1,11 +1,11 @@
Date: Tue, 22 Oct 2019 09:54:59 +0530
Subject: [PATCH 10/23] Misc. changes to updates from pull request #233
---
.../views/Templates/attachment.html.twig | 24 ++++++++++++-------
Services/TicketService.php | 15 +++++-------
Templates/config.yaml | 7 +++---
Templates/twig.yaml | 6 ++---
Templates/uvdesk.php | 7 +++---
5 files changed, 33 insertions(+), 26 deletions(-)
diff --git a/Resources/views/Templates/attachment.html.twig b/Resources/views/Templates/attachment.html.twig
index d2219e99d..a8a0dce6d 100644
--- a/Resources/views/Templates/attachment.html.twig
+++ b/Resources/views/Templates/attachment.html.twig
@@ -7,9 +7,9 @@
$(function () {
var FileView = Backbone.View.extend({
fileCounter: 0,
- max_post_size: {{ default_max_post_size }},
- max_file_uploads: {{ default_max_file_uploads }},
- upload_max_filesize: {{ default_upload_max_filesize }},
+ max_post_size: {{ max_post_size }},
+ max_file_uploads: {{ max_file_uploads }},
+ upload_max_filesize: {{ upload_max_filesize }},
el: '.attachment-block',
events : {
'click .uv-file-label': 'createFileType',
@@ -31,21 +31,26 @@
},
labelTemplate: _.template('
'),
selectFile: function(e) {
- var currentElement = Backbone.$(e.currentTarget)
- attachmentBlock = currentElement.parents(".uv-added-attachment"),
- isError = false
- if(currentElement.length) {
+ var currentElement = Backbone.$(e.currentTarget);
+ var attachmentBlock = currentElement.parents(".uv-added-attachment");
+ var isError = false;
+
+ if (currentElement.length) {
files = currentElement[0].files;
- if(files.length) {
+
+ if (files.length) {
for (var i = 0; i < files.length; i++) {
var fileName = files[i].name;
+
if (files[i].size > this.upload_max_filesize) {
isError = true;
break;
}
+
// Validating Form Size
var formSize = 0
var formData = new FormData(currentElement.parents('form')[0])
+
for (var pair of formData.entries()) {
if (pair[1] instanceof Blob) {
formSize += pair[1].size
@@ -53,9 +58,11 @@
formSize += pair[1].length
}
}
+
if (formSize > this.max_post_size) {
isError = true
}
+
attachmentBlock.append(this.labelTemplate({'fileName': fileName}));
}
}
@@ -66,6 +73,7 @@
attachmentBlock.remove()
return
}
+
attachmentBlock.show()
},
removeFile: function(e) {
diff --git a/Services/TicketService.php b/Services/TicketService.php
index 1b3c20b7a..f6d600b42 100644
--- a/Services/TicketService.php
+++ b/Services/TicketService.php
@@ -1359,23 +1359,20 @@ public function fomatTimeByPreference($dbTime,$timeZone,$timeFormat,$agentTimeZo
public function isTicketAccessGranted(Ticket $ticket, User $user = null, $firewall = 'members')
{
// @TODO: Take current firewall into consideration (access check on behalf of agent/customer)
- $user = $user ?? $user = $this->container->get('user.service')->getSessionUser();
+ if (empty($user)) {
+ $user = $this->container->get('user.service')->getSessionUser();
+ }
+
if (empty($user)) {
return false;
} else {
- $agentInstance = $this->getUser()->getAgentInstance();
-
+ $agentInstance = $user->getAgentInstance();
+
if (empty($agentInstance)) {
return false;
}
}
- $agentInstance = $user->getAgentInstance();
-
- if (empty($agentInstance)) {
- return false;
- }
-
if ($agentInstance->getSupportRole()->getId() == 3 && in_array($agentInstance->getTicketAccessLevel(), [2, 3, 4])) {
$accessLevel = $agentInstance->getTicketAccessLevel();
diff --git a/Templates/config.yaml b/Templates/config.yaml
index 94d1fae41..a3e1f6948 100644
--- a/Templates/config.yaml
+++ b/Templates/config.yaml
@@ -10,9 +10,10 @@ parameters:
uvdesk_site_path.knowledgebase_customer_prefix: customer
# File uploads constraints
- default_max_post_size: 8388608
- default_max_file_uploads: 20
- default_upload_max_filesize: 2097152
+ # @TODO: Set these parameters via compilers
+ max_post_size: 8388608
+ max_file_uploads: 20
+ upload_max_filesize: 2097152
uvdesk:
site_url: 'localhost:8000'
diff --git a/Templates/twig.yaml b/Templates/twig.yaml
index d97f63089..d423bf860 100644
--- a/Templates/twig.yaml
+++ b/Templates/twig.yaml
@@ -3,9 +3,9 @@ twig:
default_agent_image_path: '%assets_default_agent_profile_image_path%'
default_customer_image_path: '%assets_default_customer_profile_image_path%'
default_helpdesk_image_path: '%assets_default_helpdesk_profile_image_path%'
- default_max_post_size: '%default_max_post_size%'
- default_max_file_uploads: '%default_max_file_uploads%'
- default_upload_max_filesize: '%default_upload_max_filesize%'
+ max_post_size: '%max_post_size%'
+ max_file_uploads: '%max_file_uploads%'
+ upload_max_filesize: '%upload_max_filesize%'
user_service: "@user.service"
uvdesk_service: "@uvdesk.service"
ticket_service: "@ticket.service"
diff --git a/Templates/uvdesk.php b/Templates/uvdesk.php
index 5784270b0..6a50b5600 100644
--- a/Templates/uvdesk.php
+++ b/Templates/uvdesk.php
@@ -14,9 +14,10 @@
uvdesk_site_path.knowledgebase_customer_prefix: customer
# File uploads constraints
- default_max_post_size: 8388608
- default_max_file_uploads: 20
- default_upload_max_filesize: 2097152
+ # @TODO: Set these parameters via compilers
+ max_post_size: 8388608
+ max_file_uploads: 20
+ upload_max_filesize: 2097152
uvdesk:
site_url: '{{ SITE_URL }}'
From 03fe618fb230709c1f9241936bb526844638f89a Mon Sep 17 00:00:00 2001
From: akshay kumar
Date: Tue, 22 Oct 2019 10:20:19 +0530
Subject: [PATCH 11/23] Update CHANGELOG-1.0.md
---
CHANGELOG-1.0.md | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/CHANGELOG-1.0.md b/CHANGELOG-1.0.md
index 861f62eb8..0669cadd2 100644
--- a/CHANGELOG-1.0.md
+++ b/CHANGELOG-1.0.md
@@ -3,6 +3,14 @@ CHANGELOG for 1.0.x
This changelog references any relevant changes introduced in 1.0 minor versions.
+* 1.0.2 (2019-10-22)
+ * **Issue #230:** Custom field privilege issue
+ * **Issue #29:** File attachment limit exceed
+ * **Issue #234:** Agent profile issue while thread added at customer panel
+ * **Issue #240:** Super admin name is not showing when set via terminal
+ * **Misc. Updates:**
+ * Both agents and customers now share a common password reset page
+
* 1.0.1 (2019-10-15)
* **Issue #223:** Custom field privilege issue
* **Issue #224:** Email template privilege issue
From 79ecdf126eb0fc468d40cb2dc7c389c4c414c651 Mon Sep 17 00:00:00 2001
From: akshay kumar
Date: Tue, 22 Oct 2019 10:24:03 +0530
Subject: [PATCH 12/23] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 56d8570e1..6d1195967 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,8 @@
CoreFrameworkBundle
--------------
+[![Join the chat at https://gitter.im/uvdesk/core-framework](https://badges.gitter.im/uvdesk/core-framework.svg)](https://gitter.im/uvdesk/core-framework?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
The standalone **CoreFrameworkBundle** lies at the heart of the [UVDesk Community][1] helpdesk, providing the core essential functionalities and integration tools to easily integrate any other community helpdesk packages, furhter extending the capabilities of the helpdesk system.
The core framework bundle comes loaded with the following features:
From e06a3e950397ff2ae440051d6dd5b36c0ec298ea Mon Sep 17 00:00:00 2001
From: akshay kumar
Date: Tue, 22 Oct 2019 10:24:15 +0530
Subject: [PATCH 13/23] Update CHANGELOG-1.0.md
---
CHANGELOG-1.0.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG-1.0.md b/CHANGELOG-1.0.md
index 0669cadd2..946440946 100644
--- a/CHANGELOG-1.0.md
+++ b/CHANGELOG-1.0.md
@@ -10,6 +10,7 @@ This changelog references any relevant changes introduced in 1.0 minor versions.
* **Issue #240:** Super admin name is not showing when set via terminal
* **Misc. Updates:**
* Both agents and customers now share a common password reset page
+ * Updated README.md with link to the official gitter chat for uvdesk/core-framework
* 1.0.1 (2019-10-15)
* **Issue #223:** Custom field privilege issue
From dde06b5322cd3f255071d384cab3f1b8b47ac651 Mon Sep 17 00:00:00 2001
From: akshay kumar
Date: Tue, 22 Oct 2019 10:26:35 +0530
Subject: [PATCH 14/23] Misc. changes
---
Resources/config/routes/public.yaml | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/Resources/config/routes/public.yaml b/Resources/config/routes/public.yaml
index 5b693e41c..ba7cdb9d0 100644
--- a/Resources/config/routes/public.yaml
+++ b/Resources/config/routes/public.yaml
@@ -1,22 +1,4 @@
# Add public routing resources here ...
-# helpdesk_forgot_account_password:
-# path: /{_locale}/forgot-password
-# controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Password::forgotPassword
-# requirements:
-# _locale: '%app_locales%'
-# defaults:
-# _locale: '%locale%'
-
-# helpdesk_reset_account_password:
-# path: /{_locale}/reset-password/{email}/{verificationCode}
-# controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Password::resetPassword
-# requirements:
-# _locale: '%app_locales%'
-# defaults:
-# email: ''
-# verificationCode: ''
-# _locale: '%locale%'
-
helpdesk_forgot_account_password:
path: /{_locale}/forgot-password
controller: Webkul\UVDesk\CoreFrameworkBundle\Controller\Authentication::forgotPassword
From 8fc3af9434a7a7942f2c9ca6f5d47e3eb35e6091 Mon Sep 17 00:00:00 2001
From: ANmol Rathi
Date: Tue, 22 Oct 2019 11:45:37 +0530
Subject: [PATCH 15/23] Issue 240 - Mistake Solved - In the previous
'correction', the agent name displayed was that of the current logged in
agent, not the list of all agent, now I have made appropriate correction to
the sql query inside user service to handle null value of last name for the
agent.
---
Resources/views/ticket.html.twig | 2 +-
Services/UserService.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Resources/views/ticket.html.twig b/Resources/views/ticket.html.twig
index fd0ac0f33..3e51c9e80 100755
--- a/Resources/views/ticket.html.twig
+++ b/Resources/views/ticket.html.twig
@@ -415,7 +415,7 @@
{% for agent in user_service.getAgentPartialDataCollection() %}
-
- {{ agentName }}
+ {{ agent.name }}
{% endfor %}
diff --git a/Services/UserService.php b/Services/UserService.php
index 904ba07bd..f167d91e5 100644
--- a/Services/UserService.php
+++ b/Services/UserService.php
@@ -228,7 +228,7 @@ public function createUserInstance($email, $name, SupportRole $role, array $extr
public function getAgentPartialDataCollection(Request $request = null)
{
$queryBuilder = $this->entityManager->createQueryBuilder()
- ->select("user.id, user.email, CONCAT(user.firstName, ' ', user.lastName) as name, userInstance.profileImagePath as smallThumbnail")
+ ->select("user.id, user.email, CONCAT(user.firstName, ' ',COALESCE( user.lastName, '')) as name, userInstance.profileImagePath as smallThumbnail")
->from('UVDeskCoreFrameworkBundle:User', 'user')
->leftJoin('user.userInstance', 'userInstance')
->leftJoin('userInstance.supportRole', 'supportRole')
From 9b9a5f1e050b402fae31097a753a4c901d01e543 Mon Sep 17 00:00:00 2001
From: Anmol Rathi <50818610+anmol107@users.noreply.github.com>
Date: Tue, 22 Oct 2019 11:47:49 +0530
Subject: [PATCH 16/23] Update composer.json
---
composer.json | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/composer.json b/composer.json
index 491b46b29..88d271575 100644
--- a/composer.json
+++ b/composer.json
@@ -27,9 +27,7 @@
},
"extra": {
"uvdesk-package-extension": "Webkul\\UVDesk\\CoreFrameworkBundle\\Package\\Composer",
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
+
},
"minimum-stability": "dev"
}
From c5e3ed111dce215258e1fe1dd23ce5fd05066453 Mon Sep 17 00:00:00 2001
From: Anmol Rathi <50818610+anmol107@users.noreply.github.com>
Date: Tue, 22 Oct 2019 11:53:29 +0530
Subject: [PATCH 17/23] Update composer.json
---
composer.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/composer.json b/composer.json
index 88d271575..df2c3b72d 100644
--- a/composer.json
+++ b/composer.json
@@ -26,7 +26,7 @@
"psr-4": { "Webkul\\UVDesk\\CoreFrameworkBundle\\": "" }
},
"extra": {
- "uvdesk-package-extension": "Webkul\\UVDesk\\CoreFrameworkBundle\\Package\\Composer",
+ "uvdesk-package-extension": "Webkul\\UVDesk\\CoreFrameworkBundle\\Package\\Composer"
},
"minimum-stability": "dev"
From 07e125113c78db0d043149378dce200e94d24d07 Mon Sep 17 00:00:00 2001
From: akshay kumar
Date: Tue, 22 Oct 2019 12:10:41 +0530
Subject: [PATCH 18/23] Update CHANGELOG-1.0.md
---
README.md | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index 6d1195967..25e78d129 100644
--- a/README.md
+++ b/README.md
@@ -2,12 +2,12 @@
-[UVDesk Community Edition][1] is an easy-to-use, highly customizable open-source **helpdesk solution** built on top of the reliable [Symfony][2] **PHP framework**, enabling organizations to provide their customers with the best level of support solution possible.
-
-CoreFrameworkBundle
---------------
-
-[![Join the chat at https://gitter.im/uvdesk/core-framework](https://badges.gitter.im/uvdesk/core-framework.svg)](https://gitter.im/uvdesk/core-framework?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+
+
+
+
+
The standalone **CoreFrameworkBundle** lies at the heart of the [UVDesk Community][1] helpdesk, providing the core essential functionalities and integration tools to easily integrate any other community helpdesk packages, furhter extending the capabilities of the helpdesk system.
From f83cc8c94e37fb58ac889d2e3df92758e3421564 Mon Sep 17 00:00:00 2001
From: akshay kumar
Date: Tue, 22 Oct 2019 12:45:14 +0530
Subject: [PATCH 19/23] Misc. changes to updates from pull request #244
---
Services/UserService.php | 2 +-
composer.json | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/Services/UserService.php b/Services/UserService.php
index f167d91e5..a5e69cba4 100644
--- a/Services/UserService.php
+++ b/Services/UserService.php
@@ -228,7 +228,7 @@ public function createUserInstance($email, $name, SupportRole $role, array $extr
public function getAgentPartialDataCollection(Request $request = null)
{
$queryBuilder = $this->entityManager->createQueryBuilder()
- ->select("user.id, user.email, CONCAT(user.firstName, ' ',COALESCE( user.lastName, '')) as name, userInstance.profileImagePath as smallThumbnail")
+ ->select("user.id, user.email, CONCAT(user.firstName, ' ', COALESCE(user.lastName, '')) as name, userInstance.profileImagePath as smallThumbnail")
->from('UVDeskCoreFrameworkBundle:User', 'user')
->leftJoin('user.userInstance', 'userInstance')
->leftJoin('userInstance.supportRole', 'supportRole')
diff --git a/composer.json b/composer.json
index df2c3b72d..11838e04c 100644
--- a/composer.json
+++ b/composer.json
@@ -27,7 +27,6 @@
},
"extra": {
"uvdesk-package-extension": "Webkul\\UVDesk\\CoreFrameworkBundle\\Package\\Composer"
-
},
"minimum-stability": "dev"
}
From 4d481d6f8e6b076313cef25a212cc6e19e0c08c6 Mon Sep 17 00:00:00 2001
From: akshay kumar
Date: Tue, 22 Oct 2019 15:48:23 +0530
Subject: [PATCH 20/23] Misc. fixes
---
Workflow/Events/{ForgotPassword.php => UserForgotPassword.php} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename Workflow/Events/{ForgotPassword.php => UserForgotPassword.php} (100%)
diff --git a/Workflow/Events/ForgotPassword.php b/Workflow/Events/UserForgotPassword.php
similarity index 100%
rename from Workflow/Events/ForgotPassword.php
rename to Workflow/Events/UserForgotPassword.php
From c2c4dfb88b225bc2a58aa18f0770145625ee66ce Mon Sep 17 00:00:00 2001
From: akshay kumar
Date: Tue, 22 Oct 2019 18:55:59 +0530
Subject: [PATCH 21/23] Misc. fixes
---
Controller/Authentication.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Controller/Authentication.php b/Controller/Authentication.php
index cd9180887..ca70eccd5 100644
--- a/Controller/Authentication.php
+++ b/Controller/Authentication.php
@@ -8,12 +8,12 @@
use Webkul\UVDesk\CoreFrameworkBundle\Entity\User;
use Symfony\Component\EventDispatcher\GenericEvent;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Webkul\UVDesk\CoreFrameworkBundle\Utils\TokenGenerator;
-use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
use Webkul\UVDesk\CoreFrameworkBundle\Workflow\Events as CoreWorkflowEvents;
-class Authentication extends AbstractController
+class Authentication extends Controller
{
public function login(Request $request)
{
From 617b720b273061f9fdb496874be429d255238507 Mon Sep 17 00:00:00 2001
From: akshay kumar
Date: Wed, 23 Oct 2019 15:54:40 +0530
Subject: [PATCH 22/23] Backwards compatibility patch - Workflow agent/customer
forgot password event proxies
---
Workflow/Events/Agent/ForgotPassword.php | 19 +++++++++++++++++++
Workflow/Events/Customer/ForgotPassword.php | 19 +++++++++++++++++++
2 files changed, 38 insertions(+)
create mode 100644 Workflow/Events/Agent/ForgotPassword.php
create mode 100644 Workflow/Events/Customer/ForgotPassword.php
diff --git a/Workflow/Events/Agent/ForgotPassword.php b/Workflow/Events/Agent/ForgotPassword.php
new file mode 100644
index 000000000..99785a54c
--- /dev/null
+++ b/Workflow/Events/Agent/ForgotPassword.php
@@ -0,0 +1,19 @@
+
Date: Wed, 23 Oct 2019 16:03:14 +0530
Subject: [PATCH 23/23] Update CHANGELOG-1.0.md
---
CHANGELOG-1.0.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG-1.0.md b/CHANGELOG-1.0.md
index 946440946..1c0be30a8 100644
--- a/CHANGELOG-1.0.md
+++ b/CHANGELOG-1.0.md
@@ -3,13 +3,14 @@ CHANGELOG for 1.0.x
This changelog references any relevant changes introduced in 1.0 minor versions.
-* 1.0.2 (2019-10-22)
+* 1.0.3 (2019-10-23)
* **Issue #230:** Custom field privilege issue
* **Issue #29:** File attachment limit exceed
* **Issue #234:** Agent profile issue while thread added at customer panel
* **Issue #240:** Super admin name is not showing when set via terminal
* **Misc. Updates:**
- * Both agents and customers now share a common password reset page
+ * Added patch to support previously configured workflows with deprecated events
+ * Both agents and customers now share a common password reset page (events agent.forgot_password & customer.forgot_password deprecated)
* Updated README.md with link to the official gitter chat for uvdesk/core-framework
* 1.0.1 (2019-10-15)