Skip to content

Commit

Permalink
Merge branch '1.0' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanjeev Papnoi committed Mar 17, 2020
2 parents b3743ca + 636c627 commit 506826c
Show file tree
Hide file tree
Showing 29 changed files with 357 additions and 64 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG-1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ CHANGELOG for 1.0.x

This changelog references any relevant changes introduced in 1.0 minor versions.

* 1.0.5 (2020-03-17)
* **Misc. Updates:**
* Added Missing translations.

* **Bug. Fixes:**
* **Issue #99:** Getting exception when collaborator login to support panel.

* 1.0.4 (2020-02-12)
* **Misc. Updates:**
* Included Github issue templates.
Expand Down
10 changes: 5 additions & 5 deletions Controller/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function articleXhr(Request $request)
if ($article) {

if (strlen($data['name']) > 200) {
$json['errors']['name'] = 'Name length must not be greater than 200 !!';
$json['errors']['name'] = $this->get('translator')->trans('Name length must not be greater than 200 !!');
}

if (!$json['errors']) {
Expand Down Expand Up @@ -253,7 +253,7 @@ public function articleXhr(Request $request)

} else {
$json['alertClass'] = 'danger';
$json['alertMessage'] ='Warning! Correct all field values first!';
$json['alertMessage'] = $this->get('translator')->trans('Warning! Correct all field values first!');
}
} else {
$json['alertClass'] = 'danger';
Expand Down Expand Up @@ -349,7 +349,7 @@ public function articleXhr(Request $request)

if (count($relatedArticles)) {
$json['alertClass'] = 'success';
$json['alertMessage'] ='Success ! Article Related is already added.';
$json['alertMessage'] = $this->get('translator')->trans('Success ! Article Related is already added.');

} elseif ($data['ids'][0] == $data['entityId']) {
$json['alertClass'] = 'danger';
Expand Down Expand Up @@ -410,7 +410,7 @@ public function articleXhr(Request $request)
$entityManager->flush();
}
$json['alertClass'] = 'success';
$json['alertMessage'] ='Success ! Article star updated successfully.';
$json['alertMessage'] = $this->get('translator')->trans('Success ! Article star updated successfully.');
break;
case "update":
$articleBase = $this->getDoctrine()
Expand All @@ -420,7 +420,7 @@ public function articleXhr(Request $request)
if ($articleBase) {
if (isset($data['name']) && strlen($data['name']) > 200) {
$json['alertClass'] = 'danger';
$json['alertMessage'] = 'Name length must not be greater than 200 !!';
$json['alertMessage'] = $this->get('translator')->trans('Name length must not be greater than 200 !!');

} else {
$articleBase->setName($this->get('uvdesk.service')->htmlfilter($data['name']));
Expand Down
2 changes: 1 addition & 1 deletion Controller/Branding.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function spam(Request $request)
$entityManager->persist($configuration);
$entityManager->flush();

$this->addFlash('success', 'Spam setting saved successfully.');
$this->addFlash('success', $this->get('translator')->trans('Spam setting saved successfully.'));

return $this->redirect($this->generateUrl('helpdesk_member_knowledgebase_spam'));
}
Expand Down
2 changes: 1 addition & 1 deletion Controller/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public function categoryXhr(Request $request)
$em->flush();

$json['alertClass'] = 'success';
$json['alertMessage'] ='Success ! Category updated successfully.';
$json['alertMessage'] = $this->get('translator')->trans('Success ! Category updated successfully.');
} else {
$json['alertClass'] = 'danger';
$json['errors'] = json_encode($this->getFormErrors($form));
Expand Down
3 changes: 2 additions & 1 deletion Controller/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ public function updateFolder($folderId)
$entityManager->persist($knowledgebaseFolder);
$entityManager->flush();

$this->addFlash('success', 'Folder updated successfully.');
$this->addFlash('success', $this->get('translator')->trans('Folder updated successfully.'));

return $this->redirect($this->generateUrl('helpdesk_member_knowledgebase_folders_collection'));
}

Expand Down
4 changes: 2 additions & 2 deletions Controller/KnowledgebaseXHR.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function updateFolderXHR(Request $request)
$entityManager->flush();

$json['alertClass'] = 'success';
$json['alertMessage'] ='Success ! Folder updated successfully.';
$json['alertMessage'] = $this->get('translator')->trans('Success ! Folder updated successfully.');


} else {
Expand All @@ -90,7 +90,7 @@ public function updateFolderXHR(Request $request)
}else{

$json['alertClass'] = 'error';
$json['alertMessage'] = "Warning ! Folder doesn't exists!";
$json['alertMessage'] = $this->get('translator')->trans('Warning ! Folder does not exists.');
}
break;
default:
Expand Down
14 changes: 4 additions & 10 deletions Controller/Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,18 +272,12 @@ public function saveReply(int $id, Request $request)

$this->get('event_dispatcher')->dispatch('uvdesk.automation.workflow.execute', $event);

$this->addFlash('success', "Success ! Reply added successfully.");
$this->addFlash('success', $this->get('translator')->trans('Success ! Reply added successfully.'));
} else {
$this->addFlash(
'warning',
$this->get('translator')->trans("Warning ! Reply field can not be blank.")
);
$this->addFlash('warning', $this->get('translator')->trans('Warning ! Reply field can not be blank.'));
}
} else {
$this->addFlash(
'warning',
$this->get('translator')->trans("Warning ! Post size can not exceed 25MB")
);
$this->addFlash('warning', $this->get('translator')->trans('Warning ! Post size can not exceed 25MB'));
}

return $this->redirect($this->generateUrl('helpdesk_customer_ticket',array(
Expand Down Expand Up @@ -353,7 +347,7 @@ public function ticketView($id, Request $request)

$entityManager = $this->getDoctrine()->getManager();
$user = $this->get('user.service')->getSessionUser();
$ticket = $entityManager->getRepository(TicketEntity::class)->findOneBy(['id' => $id, 'customer' => $user]);
$ticket = $entityManager->getRepository(TicketEntity::class)->findOneBy(['id' => $id]);

if (empty($ticket)) {
throw new NotFoundHttpException('Page Not Found!');
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Knowledgebase/customerAccount.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@
if(value != undefined && value !== '') {
[{
pattern: /^[A-Za-z][A-Za-z]*[\sA-Za-z]*$/,
msg: 'This field must have characters only'
msg: '{{ "This field must have characters only"|trans }}'
},{
maxLength:40,
msg:'Maximum character length is 40'
msg: '{{ "Maximum character length is 40"|trans }}'
}]
}
},
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Knowledgebase/login.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<section>
<h1>{{ 'Sign In to %websitename%'|trans({ '%websitename%': '<span class="uv-brand">' ~ websiteDetails.name|e ~ '</span>' })|raw }}</h1>
<div class="uv-element-block">
<p>{{ 'If you\'ve ever contacted our support previously, your account would have already been created.'|trans }}</p>
<p>{{ 'If you have ever contacted our support previously, your account would have already been created.'|trans }}</p>
</div>

<div class="uv-form">
Expand Down
13 changes: 5 additions & 8 deletions Resources/views/Staff/Articles/articleAddForm.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<div class="uv-field-block">
<input name="metaTitle" class="uv-field" type="text" value="{{ article.metaTitle }}">
</div>
<span class="uv-field-info">{{"Title tags and meta descriptions are bits of HTML code in the header of a web page. They help search engines understand the content on a page. A page's title tag and meta description are usually shown whenever that page appears in search engine results"|trans}}</span>
<span class="uv-field-info">{{"Title tags and meta descriptions are bits of HTML code in the header of a web page. They help search engines understand the content on a page. A pages title tag and meta description are usually shown whenever that page appears in search engine results"|trans}}</span>
</div>
<!-- //Field -->

Expand Down Expand Up @@ -224,13 +224,13 @@
validation: {
'name': [{
required: true,
msg: 'This field is mandatory'
msg: '{{ "This field is mandatory"|trans }}'
},{
maxLength:200,
msg: 'This field contain maximum 200 charecters only'
msg: '{{ "This field contain maximum 200 charecters only"|trans }}'
}, {
pattern: '^((?![$%<]).)*$',
msg: 'This field must have valid characters only'
msg: '{{ "This field must have valid characters only"|trans }}'
}],
'slug': function(val, attr, computed) {
var elSlug = $("[name=" + attr + "]");
Expand All @@ -242,9 +242,7 @@
}
if(elSlugValue.length > 100) {
console.log("invalid lenth");
return "This field slug contains maximum 100 charecters only.";
return '{{ "This field slug contains maximum 100 charecters only."|trans }}';
}
}
},
Expand All @@ -260,7 +258,6 @@
el: '.uv-paper',
model : articlemodel
});
});
</script>

Expand Down
16 changes: 8 additions & 8 deletions Resources/views/Staff/Articles/articleForm.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@

<span class="uv-action-buttons">
<a href="{{path('helpdesk_knowledgebase_read_slug_article', {'slug': article.slug })}}" target="_blank" type="button" class="uv-btn-action uv-margin-right-5 uv-button-preview" {{ article.status ? '' : 'disabled="disabled"'}} id="preview-link">
<span class="uv-icon-eye-light"></span> {{'view'|trans}}
<span class="uv-icon-eye-light"></span> {{'View'|trans}}
</a>

<a href="#" type="button" class="uv-btn-action uv-margin-right-5" id="preview-article">
<span class="uv-icon-eye-light"></span> {{'preview'|trans}}
<span class="uv-icon-eye-light"></span> {{'Preview'|trans}}
</a>

<a href="#" type="button" class="uv-btn-action update-btn">
Expand Down Expand Up @@ -659,21 +659,21 @@
validation: {
'name': [{
required: true,
msg: 'This field is mandatory'
msg: '{{ "This field is mandatory"|trans }}'
},{
maxLength:200,
msg: 'This field contain maximum 200 charecters only'
msg: '{{ "This field contain maximum 200 charecters only"|trans }}'
}, {
pattern: '^((?![$%<]).)*$',
msg: 'This field must have valid characters only'
msg: '{{ "This field must have valid characters only"|trans }}'
}],
'metaTitle':[{
maxLength:200,
msg: 'This field contain mata title maximum 200 charecters only'
msg: '{{ "This field contain mata title maximum 200 charecters only"|trans }}'
}],
'keywords':[{
maxLength:200,
msg: 'This field contain keywords maximum 200 charecters only'
msg: '{{ "This field contain keywords maximum 200 charecters only"|trans }}'
}],
'slug': function(val, attr, computed) {
var elSlug = $("[name=" + attr + "]");
Expand All @@ -685,7 +685,7 @@
}
if(elSlugValue.length > 100) {
return "This field slug contains maximum 100 charecters only.";
return '{{ "This field slug contains maximum 100 charecters only."|trans }}';
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Staff/Category/categoryForm.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
msg: "{{ 'This field must have valid characters only'|trans }}"
},{
maxLength:50,
msg:"This field contain maximum 50 charectures."
msg: "{{ 'This field contain maximum 50 charectures.'|trans }}"
}],
'sortOrder': {
pattern: '^[0-9]*$',
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Staff/Folders/createFolder.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
msg: "{{ 'This field must have valid characters only'|trans }}"
},{
maxLength:40,
msg:"This field contain maximum 40 charectures."
msg: "{{ 'This field contain maximum 40 charectures.'|trans }}"
}],
'description': {
required: true,
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Staff/Folders/listFolders.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@
<img class="uv-app-splash-image" src="{{ asset('bundles/uvdesksupportcenter/images/splash/knowledgebase-splash.png') }}" alt="Folders">
<% if(!window.location.hash) { %>
<h2 class="uv-margin-top-10">{{"Create Knowledgebase Folder"|trans}}</h2>
<p>{{"You didn't add any folder to your Knowledgebase yet, Create your first Folder and start adding Categories/Articles to make your customers help themselves."|trans}}</p>
<p>{{"You did not add any folder to your Knowledgebase yet, Create your first Folder and start adding Categories/Articles to make your customers help themselves."|trans}}</p>
<% } else { %>
<p>
{{ "You didn't have any folder for current filter(s)."|trans }}
{{ "You did not have any folder for current filter(s)."|trans }}
<a href="#">{{ 'Clear Filters'|trans }}</a>
</p>
<% } %>
Expand Down
8 changes: 4 additions & 4 deletions Resources/views/Staff/Folders/updateFolder.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@
validation: {
'name': [{
required: true,
msg: 'This field is mandatory'
msg: "{{ 'This field is mandatory'|trans }}"
}, {
pattern: '^((?![$%<]).)*$',
msg: 'This field must have valid characters only'
msg: "{{ 'This field must have valid characters only'|trans }}"
},
{
maxLength:40,
msg:"This field contain maximum 40 charectures."
msg: "{{ 'This field contain maximum 40 charectures.'|trans }}"
}],
'description': {
required: true,
msg:'This field is mandatory'
msg: "{{ 'This field is mandatory'|trans }}"
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Staff/branding.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@
{% endfor %}
</select>
</div>
<span class="uv-field-info">{{ "Choose a default company's timezone"|trans }}</span>
<span class="uv-field-info">{{ "Choose a default company timezone"|trans }}</span>
</div>
<!-- //Field -->

Expand Down
6 changes: 3 additions & 3 deletions Resources/views/Templates/footer.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<div class="uv-footer-wrapper">
<div class="uv-footer-lt">
<ul>
<li><a href="{{ path('helpdesk_knowledgebase_folder') }}">Home</a></li>
<li><a href="#" class="uv-open-popup" data-target="cookie-dialog-modal">Cookie Policy</a></li>
<li><a href="{{ path('helpdesk_knowledgebase_folder') }}">{{ 'Home'|trans }}</a></li>
<li><a href="#" class="uv-open-popup" data-target="cookie-dialog-modal">{{ 'Cookie Policy'|trans }}</a></li>
{% for footerLink in websiteConfiguration.footerLinks %}
<li><a href="{{ footerLink.url }}" target="_blank">{{ footerLink.label }}</a></li>
{% endfor %}
</ul>
</div>
</div>
<div class="uv-footer-credit">
<span class="uv-credit-text">Powered by <a href="https://www.uvdesk.com" target="_blank">UVdesk</a></span>
<span class="uv-credit-text">{{ 'Powered by'|trans }} <a href="https://www.uvdesk.com" target="_blank">UVdesk</a></span>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion Resources/views/Themes/cookiePolicy.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h2 style="text-align: center; margin-bottom: 30px;">{{ 'Cookie Usage Policy'|trans }}</h2>
<div class="uv-element-block" style="line-height: 1.8em;">
<p>{{ 'Some of our site pages utilize %cookies% and other tracking technologies. A %cookie% is a small text file that may be used, for example, to collect information about site activity. Some cookies and other technologies may serve to recall personal information previously indicated by a site user. You may block cookies, or delete existing cookies, by adjusting the appropriate setting on your browser. Please consult the %help% menu of your browser to learn how to do this. If you block or delete %cookies% you may find the usefulness of our site to be impaired.'|trans({'%cookie%': '<em>' ~ 'cookie'|trans ~ '</em>', '%cookies%': '<em>' ~ 'cookies'|trans ~ '</em>', '%help%': '<b>' ~ 'HELP'|trans ~ '</b>'})|raw }}</p>
<p>{{ "To know more about how our privacy policy works, please %websiteLink%."|trans({'%websiteLink%': '<a href="https://www.uvdesk.com/en/privacy-policy/" target="_blank">' ~ 'visit our website' ~ '</a>'})|raw }}</p>
<p>{{ "To know more about how our privacy policy works, please %websiteLink%."|trans({'%websiteLink%': '<a href="https://www.uvdesk.com/en/privacy-policy/" target="_blank">' ~ 'visit our website'|trans ~ '</a>'})|raw }}</p>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion UIComponents/Dashboard/Homepage/Items/Articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function getIcon() : string

public static function getTitle() : string
{
return "Articles";
return self::dynamicTranslation("Articles");
}

public static function getRouteName() : string
Expand Down
2 changes: 1 addition & 1 deletion UIComponents/Dashboard/Homepage/Items/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function getIcon() : string

public static function getTitle() : string
{
return "Categories";
return self::dynamicTranslation("Categories");
}

public static function getRouteName() : string
Expand Down
2 changes: 1 addition & 1 deletion UIComponents/Dashboard/Homepage/Items/Folders.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function getIcon() : string

public static function getTitle() : string
{
return "Folders";
return self::dynamicTranslation("Folders");
}

public static function getRouteName() : string
Expand Down
2 changes: 1 addition & 1 deletion UIComponents/Dashboard/Homepage/Items/SpamSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function getIcon() : string

public static function getTitle() : string
{
return "Spam Settings";
return self::dynamicTranslation("Spam Settings");
}

public static function getRouteName() : string
Expand Down
4 changes: 2 additions & 2 deletions UIComponents/Dashboard/Homepage/Sections/Knowledgebase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ class Knowledgebase extends HomepageSection
{
public static function getTitle() : string
{
return "Knowledgebase";
return self::dynamicTranslation("Knowledgebase");
}

public static function getDescription() : string
{
return "Knowledgebase is a source of rigid and complex information which helps Customers to help themselves";
return self::dynamicTranslation("Knowledgebase is a source of rigid and complex information which helps Customers to help themselves");
}

public static function getRoles() : array
Expand Down
Loading

0 comments on commit 506826c

Please sign in to comment.