mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
portal dev
This commit is contained in:
@@ -46,17 +46,6 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->getContainer()->get('portal')) {
|
||||
foreach ($this->getContainer()->get('portal')->getSettingsAttributeList() as $attribute) {
|
||||
$data[$attribute] = $this->getContainer()->get('portal')->get($attribute);
|
||||
}
|
||||
if (empty($data['language'])) {
|
||||
$data['language'] = $this->getConfig()->get('language');
|
||||
}
|
||||
if (empty($data['theme'])) {
|
||||
$data['theme'] = $this->getConfig()->get('theme');
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,39 @@ class Container extends \Espo\Core\Container
|
||||
public function setPortal(\Espo\Entities\Portal $portal)
|
||||
{
|
||||
$this->set('portal', $portal);
|
||||
|
||||
$data = array();
|
||||
foreach ($this->get('portal')->getSettingsAttributeList() as $attribute) {
|
||||
$data[$attribute] = $this->get('portal')->get($attribute);
|
||||
}
|
||||
if (empty($data['language'])) {
|
||||
unset($data['language']);
|
||||
}
|
||||
if (empty($data['theme'])) {
|
||||
unset($data['theme']);
|
||||
}
|
||||
if (empty($data['timeZone'])) {
|
||||
unset($data['timeZone']);
|
||||
}
|
||||
if (empty($data['dateFormat'])) {
|
||||
unset($data['dateFormat']);
|
||||
}
|
||||
if (empty($data['timeFormat'])) {
|
||||
unset($data['timeFormat']);
|
||||
}
|
||||
if (isset($data['weekStart']) && $data['weekStart'] === -1) {
|
||||
unset($data['weekStart']);
|
||||
}
|
||||
if (is_null($data['weekStart'])) {
|
||||
unset($data['weekStart']);
|
||||
}
|
||||
if (empty($data['defaultCurrency'])) {
|
||||
unset($data['defaultCurrency']);
|
||||
}
|
||||
|
||||
foreach ($data as $attribute => $value) {
|
||||
$this->get('config')->set($attribute, $value, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ class Config
|
||||
* @param string $value
|
||||
* @return bool
|
||||
*/
|
||||
public function set($name, $value = '')
|
||||
public function set($name, $value = null, $dontMarkDirty = false)
|
||||
{
|
||||
if (!is_array($name)) {
|
||||
$name = array($name => $value);
|
||||
@@ -125,7 +125,9 @@ class Config
|
||||
|
||||
foreach ($name as $key => $value) {
|
||||
$this->data[$key] = $value;
|
||||
$this->changedData[$key] = $value;
|
||||
if (!$dontMarkDirty) {
|
||||
$this->changedData[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +84,16 @@ class DateTime
|
||||
}
|
||||
|
||||
public function convertSystemDateToGlobal($string)
|
||||
{
|
||||
return $this->convertSystemDate($string);
|
||||
}
|
||||
|
||||
public function convertSystemDateTimeToGlobal($string)
|
||||
{
|
||||
return $this->convertSystemDateTime($string);
|
||||
}
|
||||
|
||||
public function convertSystemDate($string)
|
||||
{
|
||||
$dateTime = \DateTime::createFromFormat('Y-m-d', $string);
|
||||
if ($dateTime) {
|
||||
@@ -92,20 +102,6 @@ class DateTime
|
||||
return null;
|
||||
}
|
||||
|
||||
public function convertSystemDateTimeToGlobal($string)
|
||||
{
|
||||
$dateTime = \DateTime::createFromFormat('Y-m-d H:i:s', $string);
|
||||
if ($dateTime) {
|
||||
return $dateTime->setTimezone($this->timezone)->format($this->getPhpDateTimeFormat());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function convertSystemDate($string)
|
||||
{
|
||||
return $this->convertSystemDateToGlobal($string);
|
||||
}
|
||||
|
||||
public function convertSystemDateTime($string, $timezone = null)
|
||||
{
|
||||
$dateTime = \DateTime::createFromFormat('Y-m-d H:i:s', $string);
|
||||
|
||||
@@ -43,7 +43,7 @@ return array (
|
||||
'version' => '@@version',
|
||||
'timeZone' => 'UTC',
|
||||
'dateFormat' => 'MM/DD/YYYY',
|
||||
'timeFormat' => 'HH:mm',
|
||||
'timeFormat' => 'hh:mm a',
|
||||
'weekStart' => 0,
|
||||
'thousandSeparator' => ',',
|
||||
'decimalMark' => '.',
|
||||
|
||||
@@ -31,7 +31,20 @@ namespace Espo\Entities;
|
||||
|
||||
class Portal extends \Espo\Core\ORM\Entity
|
||||
{
|
||||
protected $settingsAttributeList = ['companyLogoId', 'tabList', 'quickCreateList', 'theme', 'language', 'dashboardLayout', 'dashletsOptions'];
|
||||
protected $settingsAttributeList = [
|
||||
'companyLogoId',
|
||||
'tabList',
|
||||
'quickCreateList',
|
||||
'dashboardLayout',
|
||||
'dashletsOptions',
|
||||
'theme',
|
||||
'language',
|
||||
'timeZone',
|
||||
'dateFormat',
|
||||
'timeFormat',
|
||||
'weekStart',
|
||||
'defaultCurrency'
|
||||
];
|
||||
|
||||
public function getSettingsAttributeList()
|
||||
{
|
||||
|
||||
@@ -68,17 +68,17 @@ class Invitations
|
||||
protected function parseInvitationTemplate($contents, $entity, $invitee = null, $uid = null)
|
||||
{
|
||||
|
||||
$contents = str_replace('{eventType}', strtolower($this->language->translate($entity->getEntityName(), 'scopeNames')), $contents);
|
||||
$contents = str_replace('{eventType}', strtolower($this->language->translate($entity->getEntityType(), 'scopeNames')), $contents);
|
||||
|
||||
foreach ($entity->getFields() as $field => $d) {
|
||||
foreach ($entity->getAttributes() as $field => $d) {
|
||||
if (empty($d['type'])) continue;
|
||||
$key = '{'.$field.'}';
|
||||
switch ($d['type']) {
|
||||
case 'datetime':
|
||||
$contents = str_replace($key, $this->dateTime->convertSystemDateTimeToGlobal($entity->get($field)), $contents);
|
||||
$contents = str_replace($key, $this->dateTime->convertSystemDateTime($entity->get($field)), $contents);
|
||||
break;
|
||||
case 'date':
|
||||
$contents = str_replace($key, $this->dateTime->convertSystemDateToGlobal($entity->get($field)), $contents);
|
||||
$contents = str_replace($key, $this->dateTime->convertSystemDate($entity->get($field)), $contents);
|
||||
break;
|
||||
case 'jsonArray':
|
||||
break;
|
||||
@@ -95,10 +95,10 @@ class Invitations
|
||||
|
||||
$siteUrl = rtrim($this->config->get('siteUrl'), '/');
|
||||
|
||||
$url = $siteUrl . '/#' . $entity->getEntityName() . '/view/' . $entity->id;
|
||||
$url = $siteUrl . '/#' . $entity->getEntityType() . '/view/' . $entity->id;
|
||||
$contents = str_replace('{url}', $url, $contents);
|
||||
|
||||
if ($invitee && $invitee->getEntityName() != 'User') {
|
||||
if ($invitee && $invitee->getEntityType() != 'User') {
|
||||
$contents = preg_replace('/\{#userOnly\}(.*?)\{\/userOnly\}/s', '', $contents);
|
||||
}
|
||||
|
||||
@@ -135,10 +135,10 @@ class Invitations
|
||||
{
|
||||
$uid = $this->getEntityManager()->getEntity('UniqueId');
|
||||
$uid->set('data', array(
|
||||
'eventType' => $entity->getEntityName(),
|
||||
'eventType' => $entity->getEntityType(),
|
||||
'eventId' => $entity->id,
|
||||
'inviteeId' => $invitee->id,
|
||||
'inviteeType' => $invitee->getEntityName(),
|
||||
'inviteeType' => $invitee->getEntityType(),
|
||||
'link' => $link
|
||||
));
|
||||
$this->getEntityManager()->saveEntity($uid);
|
||||
@@ -164,7 +164,7 @@ class Invitations
|
||||
$email->set('isHtml', true);
|
||||
$this->getEntityManager()->saveEntity($email);
|
||||
|
||||
$attachmentName = ucwords($this->language->translate($entity->getEntityName(), 'scopeNames')).'.ics';
|
||||
$attachmentName = ucwords($this->language->translate($entity->getEntityType(), 'scopeNames')).'.ics';
|
||||
$attachment = $this->getEntityManager()->getEntity('Attachment');
|
||||
$attachment->set(array(
|
||||
'name' => $attachmentName,
|
||||
|
||||
@@ -74,7 +74,7 @@ class EmailReminder
|
||||
$contents = str_replace($key, $this->dateTime->convertSystemDateTime($entity->get($field), $timezone), $contents);
|
||||
break;
|
||||
case 'date':
|
||||
$contents = str_replace($key, $this->dateTime->convertSystemDateToGlobal($entity->get($field)), $contents);
|
||||
$contents = str_replace($key, $this->dateTime->convertSystemDate($entity->get($field)), $contents);
|
||||
break;
|
||||
default:
|
||||
$contents = str_replace($key, $entity->get($field), $contents);
|
||||
|
||||
@@ -42,13 +42,8 @@ class Preferences extends \Espo\Core\ORM\Repository
|
||||
);
|
||||
|
||||
protected $defaultAttributeListFromSettings = array(
|
||||
'defaultCurrency',
|
||||
'dateFormat',
|
||||
'timeFormat',
|
||||
'decimalMark',
|
||||
'thousandSeparator',
|
||||
'weekStart',
|
||||
'timeZone',
|
||||
'exportDelimiter'
|
||||
);
|
||||
|
||||
|
||||
@@ -587,7 +587,7 @@
|
||||
"themes": {
|
||||
"Espo": "Espo",
|
||||
"Sakura": "Sakura",
|
||||
"EspoVertical": "Espo (Vertical)",
|
||||
"SakuraVertical": "Sakura (Vertical)"
|
||||
"EspoVertical": "Espo Vertical",
|
||||
"SakuraVertical": "Sakura Vertical"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,12 @@
|
||||
"companyLogo": "Logo",
|
||||
"theme": "Theme",
|
||||
"language": "Language",
|
||||
"dashboardLayout": "Dashboard Layout"
|
||||
"dashboardLayout": "Dashboard Layout",
|
||||
"dateFormat": "Date Format",
|
||||
"timeFormat": "Time Format",
|
||||
"timeZone": "Time Zone",
|
||||
"weekStart": "First Day of Week",
|
||||
"defaultCurrency": "Default Currency"
|
||||
},
|
||||
"links": {
|
||||
"users": "Users",
|
||||
@@ -24,6 +29,7 @@
|
||||
"labels": {
|
||||
"Create Portal": "Create Portal",
|
||||
"User Interface": "User Interface",
|
||||
"General": "General"
|
||||
"General": "General",
|
||||
"Settings": "Settings"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,14 @@
|
||||
[{"name": "portalRoles"}, {"name": "language"}]
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Settings",
|
||||
"rows": [
|
||||
[{"name": "dateFormat"}, {"name": "timeZone"}],
|
||||
[{"name": "timeFormat"}, {"name": "weekStart"}],
|
||||
[{"name": "defaultCurrency"}, false]
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "User Interface",
|
||||
"rows": [
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
{
|
||||
"label": "Locale",
|
||||
"rows": [
|
||||
[{"name": "dateFormat"}, {"name": "timeFormat"}],
|
||||
[{"name": "timeZone"}, {"name": "weekStart"}],
|
||||
[{"name": "defaultCurrency"}, false],
|
||||
[{"name": "thousandSeparator"}, {"name": "decimalMark"}],
|
||||
[{"name": "dateFormat"}, {"name": "timeZone"}],
|
||||
[{"name": "timeFormat"}, {"name": "weekStart"}],
|
||||
[{"name": "defaultCurrency"}, {"name": "thousandSeparator"}],
|
||||
[false, {"name": "decimalMark"}],
|
||||
[{"name": "language"}, false]
|
||||
]
|
||||
},
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
{
|
||||
"label": "Locale",
|
||||
"rows": [
|
||||
[{"name": "dateFormat"}, {"name": "timeFormat"}],
|
||||
[{"name": "timeZone"}, {"name": "weekStart"}],
|
||||
[{"name": "defaultCurrency"}, false],
|
||||
[{"name": "thousandSeparator"}, {"name": "decimalMark"}],
|
||||
[{"name": "dateFormat"}, {"name": "timeZone"}],
|
||||
[{"name": "timeFormat"}, {"name": "weekStart"}],
|
||||
[{"name": "defaultCurrency"}, {"name": "thousandSeparator"}],
|
||||
[false, {"name": "decimalMark"}],
|
||||
[{"name": "language"}, false]
|
||||
]
|
||||
},
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
"rows": [
|
||||
[{"name": "dateFormat"}, {"name": "timeZone"}],
|
||||
[{"name": "timeFormat"}, {"name": "weekStart"}],
|
||||
[{"name": "thousandSeparator"}, {"name": "decimalMark"}],
|
||||
[{"name": "language"}, false]
|
||||
[false, {"name": "thousandSeparator"}],
|
||||
[{"name": "language"}, {"name": "decimalMark"}]
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -46,9 +46,37 @@
|
||||
},
|
||||
"language": {
|
||||
"type": "enum",
|
||||
"view": "views/portal/fields/language",
|
||||
"view": "views/preferences/fields/language",
|
||||
"default": ""
|
||||
},
|
||||
"timeZone": {
|
||||
"type": "enum",
|
||||
"detault": "",
|
||||
"view": "views/preferences/fields/time-zone"
|
||||
},
|
||||
"dateFormat": {
|
||||
"type": "enum",
|
||||
"options": ["MM/DD/YYYY", "YYYY-MM-DD", "DD.MM.YYYY", "DD/MM/YYYY"],
|
||||
"default": "",
|
||||
"view": "views/preferences/fields/date-format"
|
||||
},
|
||||
"timeFormat": {
|
||||
"type": "enum",
|
||||
"options": ["HH:mm", "hh:mma", "hh:mmA", "hh:mm A", "hh:mm a"],
|
||||
"default": "",
|
||||
"view": "views/preferences/fields/time-format"
|
||||
},
|
||||
"weekStart": {
|
||||
"type": "enumInt",
|
||||
"options": [0, 1],
|
||||
"default": -1,
|
||||
"view": "views/preferences/fields/week-start"
|
||||
},
|
||||
"defaultCurrency": {
|
||||
"type": "enum",
|
||||
"default": "",
|
||||
"view": "views/preferences/fields/default-currency"
|
||||
},
|
||||
"dashboardLayout": {
|
||||
"type": "jsonArray",
|
||||
"view": "views/settings/fields/dashboard-layout"
|
||||
|
||||
@@ -2,22 +2,31 @@
|
||||
"fields": {
|
||||
"timeZone": {
|
||||
"type": "enum",
|
||||
"detault": "UTC"
|
||||
"detault": "",
|
||||
"view": "views/preferences/fields/time-zone"
|
||||
},
|
||||
"dateFormat": {
|
||||
"type": "enum",
|
||||
"options": ["MM/DD/YYYY", "YYYY-MM-DD", "DD.MM.YYYY", "DD/MM/YYYY"],
|
||||
"default": "MM/DD/YYYY"
|
||||
"default": "",
|
||||
"view": "views/preferences/fields/date-format"
|
||||
},
|
||||
"timeFormat": {
|
||||
"type": "enum",
|
||||
"options": ["HH:mm", "hh:mma", "hh:mmA", "hh:mm A", "hh:mm a"],
|
||||
"default": "HH:mm"
|
||||
"default": "",
|
||||
"view": "views/preferences/fields/time-format"
|
||||
},
|
||||
"weekStart": {
|
||||
"type": "enumInt",
|
||||
"options": [0, 1],
|
||||
"default": 0
|
||||
"default": -1,
|
||||
"view": "views/preferences/fields/week-start"
|
||||
},
|
||||
"defaultCurrency": {
|
||||
"type": "enum",
|
||||
"default": "",
|
||||
"view": "views/preferences/fields/default-currency"
|
||||
},
|
||||
"thousandSeparator": {
|
||||
"type": "varchar",
|
||||
@@ -31,10 +40,6 @@
|
||||
"required": true,
|
||||
"maxLength": 1
|
||||
},
|
||||
"defaultCurrency": {
|
||||
"type": "enum",
|
||||
"default": "USD"
|
||||
},
|
||||
"dashboardLayout": {
|
||||
"type": "jsonArray"
|
||||
},
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
"type": "varchar",
|
||||
"default": ",",
|
||||
"maxLength": 1,
|
||||
"view": "Settings.Fields.ThousandSeparator"
|
||||
"view": "views/settings/fields/thousand-separator"
|
||||
},
|
||||
"decimalMark": {
|
||||
"type": "varchar",
|
||||
@@ -61,16 +61,18 @@
|
||||
"defaultCurrency": {
|
||||
"type": "enum",
|
||||
"default": "USD",
|
||||
"required": true
|
||||
"required": true,
|
||||
"view": "views/settings/fields/default-currency"
|
||||
},
|
||||
"baseCurrency": {
|
||||
"type": "enum",
|
||||
"default": "USD",
|
||||
"required": true
|
||||
"required": true,
|
||||
"view": "views/settings/fields/default-currency"
|
||||
},
|
||||
"currencyRates": {
|
||||
"type": "base",
|
||||
"view": "Settings.Fields.CurrencyRates"
|
||||
"view": "views/settings/fields/currency-rates"
|
||||
},
|
||||
"outboundEmailIsShared": {
|
||||
"type": "bool",
|
||||
|
||||
@@ -179,9 +179,9 @@ class EmailTemplate extends Record
|
||||
$value = $this->getLanguage()->translateOption($value, $field, $entity->getEntityType());
|
||||
} else {
|
||||
if ($entity->fields[$field]['type'] == 'date') {
|
||||
$value = $this->getDateTime()->convertSystemDateToGlobal($value);
|
||||
$value = $this->getDateTime()->convertSystemDate($value);
|
||||
} else if ($entity->fields[$field]['type'] == 'datetime') {
|
||||
$value = $this->getDateTime()->convertSystemDateTimeToGlobal($value);
|
||||
$value = $this->getDateTime()->convertSystemDateTime($value);
|
||||
}
|
||||
}
|
||||
$text = str_replace('{' . $type . '.' . $field . '}', $value, $text);
|
||||
|
||||
@@ -152,7 +152,6 @@ Espo.define('date-time', [], function () {
|
||||
},
|
||||
|
||||
setSettingsAndPreferences: function (settings, preferences) {
|
||||
|
||||
if (settings.has('dateFormat')) {
|
||||
this.dateFormat = settings.get('dateFormat');
|
||||
}
|
||||
@@ -170,10 +169,18 @@ Espo.define('date-time', [], function () {
|
||||
}
|
||||
|
||||
preferences.on('change', function (model) {
|
||||
this.dateFormat = model.get('dateFormat');
|
||||
this.timeFormat = model.get('timeFormat');
|
||||
this.timeZone = model.get('timeZone');
|
||||
this.weekStart = model.get('weekStart');
|
||||
if (model.has('dateFormat') && model.get('dateFormat') !== '') {
|
||||
this.dateFormat = model.get('dateFormat');
|
||||
}
|
||||
if (model.has('timeFormat') && model.get('timeFormat') !== '') {
|
||||
this.timeFormat = model.get('timeFormat');
|
||||
}
|
||||
if (model.has('timeZone') && model.get('timeZone') !== '') {
|
||||
this.timeZone = model.get('timeZone');
|
||||
}
|
||||
if (model.has('weekStart') && model.get('weekStart') !== -1) {
|
||||
this.weekStart = model.get('weekStart');
|
||||
}
|
||||
if (this.timeZone == 'UTC') {
|
||||
this.timeZone = null;
|
||||
}
|
||||
|
||||
@@ -33,28 +33,10 @@ Espo.define('models/preferences', 'model', function (Dep) {
|
||||
|
||||
settings: null,
|
||||
|
||||
getTimeZoneOptions: function () {
|
||||
if (this.settings) {
|
||||
return this.settings.getFieldParam('timeZone', 'options');
|
||||
}
|
||||
},
|
||||
|
||||
getLanguageOptions: function () {
|
||||
if (this.settings) {
|
||||
return this.settings.getFieldParam('language', 'options');
|
||||
}
|
||||
},
|
||||
|
||||
getDefaultCurrencyOptions: function () {
|
||||
if (this.settings) {
|
||||
return this.settings.getDefaultCurrencyOptions();
|
||||
}
|
||||
},
|
||||
|
||||
getDashletOptions: function (id) {
|
||||
var value = this.get('dashletsOptions') || {};
|
||||
return value[id] || false;
|
||||
},
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -31,14 +31,6 @@ Espo.define('models/settings', 'model-offline', function (Dep) {
|
||||
|
||||
name: 'Settings',
|
||||
|
||||
getDefaultCurrencyOptions: function () {
|
||||
return this.get('currencyList') || [];
|
||||
},
|
||||
|
||||
getBaseCurrencyOptions: function () {
|
||||
return this.get('currencyList') || [];
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
41
frontend/client/src/views/preferences/fields/date-format.js
Normal file
41
frontend/client/src/views/preferences/fields/date-format.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
Espo.define('views/preferences/fields/date-format', 'views/fields/enum', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
setupOptions: function () {
|
||||
this.params.options.unshift('');
|
||||
|
||||
this.translatedOptions = this.translatedOptions || {};
|
||||
this.translatedOptions[''] = this.translate('Default') + ' (' + this.getConfig().get('dateFormat') +')';
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
@@ -25,18 +25,16 @@
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
Espo.define('views/portal/fields/language', 'views/fields/enum', function (Dep) {
|
||||
Espo.define('views/preferences/fields/default-currency', 'views/fields/enum', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
setupOptions: function () {
|
||||
this.params.options = Espo.Utils.clone(this.getConfig().get('languageList'));
|
||||
|
||||
this.params.options = Espo.Utils.clone(this.getConfig().get('currencyList') || []);
|
||||
this.params.options.unshift('');
|
||||
|
||||
this.translatedOptions = Espo.Utils.clone(this.getLanguage().translate('language', 'options') || {});
|
||||
|
||||
this.translatedOptions[''] = this.translate('Default');
|
||||
this.translatedOptions = this.translatedOptions || {};
|
||||
this.translatedOptions[''] = this.translate('Default') + ' (' + this.getConfig().get('defaultCurrency') +')';
|
||||
},
|
||||
|
||||
});
|
||||
@@ -36,7 +36,9 @@ Espo.define('views/preferences/fields/language', 'views/fields/enum', function (
|
||||
|
||||
this.translatedOptions = Espo.Utils.clone(this.getLanguage().translate('language', 'options') || {});
|
||||
|
||||
this.translatedOptions[''] = this.translate('Default');
|
||||
var defaultTranslated = this.translatedOptions[this.getConfig().get('language')] || this.getConfig().get('language');
|
||||
|
||||
this.translatedOptions[''] = this.translate('Default') + ' (' + defaultTranslated + ')';
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
@@ -39,7 +39,10 @@ Espo.define('views/preferences/fields/theme', 'views/fields/enum', function (Dep
|
||||
Dep.prototype.setup.call(this);
|
||||
|
||||
this.translatedOptions = this.translatedOptions || {};
|
||||
this.translatedOptions[''] = this.translate('Default');
|
||||
|
||||
var defaultTranslated = this.translatedOptions[this.getConfig().get('theme')] || this.getConfig().get('theme');
|
||||
|
||||
this.translatedOptions[''] = this.translate('Default') + ' (' + defaultTranslated + ')';
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
41
frontend/client/src/views/preferences/fields/time-format.js
Normal file
41
frontend/client/src/views/preferences/fields/time-format.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
Espo.define('views/preferences/fields/time-format', 'views/fields/enum', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
setupOptions: function () {
|
||||
this.params.options.unshift('');
|
||||
|
||||
this.translatedOptions = this.translatedOptions || {};
|
||||
this.translatedOptions[''] = this.translate('Default') + ' (' + this.getConfig().get('timeFormat') +')';
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
42
frontend/client/src/views/preferences/fields/time-zone.js
Normal file
42
frontend/client/src/views/preferences/fields/time-zone.js
Normal file
@@ -0,0 +1,42 @@
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
Espo.define('views/preferences/fields/time-zone', 'views/fields/enum', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
setupOptions: function () {
|
||||
this.params.options = Espo.Utils.clone(this.getConfig().getFieldParam('timeZone', 'options') || []);
|
||||
this.params.options.unshift('');
|
||||
|
||||
this.translatedOptions = this.translatedOptions || {};
|
||||
this.translatedOptions[''] = this.translate('Default') + ' (' + this.getConfig().get('timeZone') +')';
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
42
frontend/client/src/views/preferences/fields/week-start.js
Normal file
42
frontend/client/src/views/preferences/fields/week-start.js
Normal file
@@ -0,0 +1,42 @@
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
Espo.define('views/preferences/fields/week-start', 'views/fields/enum-int', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
setupOptions: function () {
|
||||
Dep.prototype.setupOptions.call(this);
|
||||
this.params.options.unshift(-1);
|
||||
|
||||
this.translatedOptions = Espo.Utils.clone(this.getLanguage().translate('weekStart', 'options', 'Settings') || {});
|
||||
this.translatedOptions[-1] = this.translate('Default') + ' (' + this.getLanguage().translateOption(this.getConfig().get('weekStart'), 'weekStart', 'Settings') +')';
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
@@ -25,7 +25,7 @@
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
Espo.define('Views.Settings.Fields.AssignmentEmailNotificationsEntityList', 'Views.Fields.MultiEnum', function (Dep) {
|
||||
Espo.define('views/settings/fields/assignment-email-notifications-entity-list', 'views/fields/multi-enum', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
Espo.define('Views.Settings.Fields.AssignmentNotificationsEntityList', 'Views.Fields.MultiEnum', function (Dep) {
|
||||
Espo.define('views/settings/fields/assignment-notifications-entity-list', 'views/fields/multi-enum', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
Espo.define('views/settings/fields/default-currency', 'views/fields/enum', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
setupOptions: function () {
|
||||
this.params.options = Espo.Utils.clone(this.getConfig().get('currencyList') || []);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
@@ -24,22 +24,22 @@
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
Espo.define('Views.Settings.Fields.ThousandSeparator', 'Views.Fields.Varchar', function (Dep) {
|
||||
************************************************************************/
|
||||
Espo.define('views/settings/fields/thousand-separator', 'views/fields/varchar', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
validations: ['required', 'thousandSeparator'],
|
||||
|
||||
|
||||
validations: ['required', 'thousandSeparator'],
|
||||
|
||||
validateThousandSeparator: function () {
|
||||
if (this.model.get('thousandSeparator') == this.model.get('decimalMark')) {
|
||||
var msg = this.translate('thousandSeparatorEqualsDecimalMark', 'messages', 'Admin');
|
||||
this.showValidationMessage(msg);
|
||||
return true;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user