Skip to content

Commit

Permalink
feat(Email) EMail_CustomCurrentDate_Format global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
joebordes committed Sep 8, 2017
1 parent 99d5a65 commit 44308dd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions build/changeSets/DefineGlobalVariables.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ function applyChange() {
'EMail_OpenTrackingEnabled',
'Email_Attachments_Folder',
'EMail_Maximum_Number_Attachments',
'EMail_CustomCurrentDate_Format',
'ToolTip_MaxFieldValueLength',
'HelpDesk_Support_EMail',
'HelpDesk_Support_Name',
Expand Down
11 changes: 8 additions & 3 deletions include/utils/CommonUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -2237,9 +2237,14 @@ function getMergedDescriptionCustomVars($fields, $description) {
$token_value = '';
switch ($columnname) {
case 'currentdate':
$mes = date('m')-1;
$mesi18n = $lang['MONTH_STRINGS'][$mes];
$token_value = $mesi18n.date(' j, Y');
$dtformat = GlobalVariable::getVariable('EMail_CustomCurrentDate_Format','',$currentModule);
if ($dtformat=='') {
$mes = date('m')-1;
$mesi18n = $lang['MONTH_STRINGS'][$mes];
$token_value = $mesi18n.date(' j, Y');
} else {
$token_value = date($dtformat);
}
break;
case 'currenttime': $token_value = date("G:i:s T");
break;
Expand Down
7 changes: 7 additions & 0 deletions modules/GlobalVariable/language/en_us.gvdefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,13 @@
'values' => '',
'definition' => 'The maximum number of attachments that can be uploaded to an email. The default is 6.',
),
'EMail_CustomCurrentDate_Format' => array(
'status' => 'Implemented',
'valuetype' => 'String',
'category' => 'Aplicación',
'values' => 'valid PHP date format string',
'definition' => 'Format to apply to $custom-currentdate$ variable in email templates. Accepts any valid date format string from PHP. By default leave it empty to get the month in text, day and year.',
),
'Workflow_Send_Email_ToCCBCC' => array(
'status' => 'Implemented',
'valuetype' => 'Email CSV',
Expand Down
7 changes: 7 additions & 0 deletions modules/GlobalVariable/language/es_es.gvdefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,13 @@
'values' => '',
'definition' => 'El número máximo de archivos adjuntos que se pueden cargar en un correo electrónico. El valor predeterminado es 6.',
),
'EMail_CustomCurrentDate_Format' => array(
'status' => 'Implementada',
'valuetype' => 'Texto',
'category' => 'Aplicación',
'values' => 'Cadena de formato de fecha PHP válida',
'definition' => 'Formato a aplicar a la variable $custom-currentdate$ en las plantillas de email. Acepta cualquier cadena de formato de fecha válida de PHP. Por defecto dejar vacio para obtener el mes en texto, dia y año.',
),
'Workflow_Send_Email_ToCCBCC' => array(
'status' => 'Implementada',
'valuetype' => 'Email CSV',
Expand Down

0 comments on commit 44308dd

Please sign in to comment.