Merge remote branch 'upstream/master'
This commit is contained in:
@@ -2118,6 +2118,42 @@ function _()
|
||||
return trn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Translator function for internationalization to plugins
|
||||
*/
|
||||
function __()
|
||||
{
|
||||
var argv = __.arguments;
|
||||
var argc = argv.length;
|
||||
|
||||
//argv[0] => NAME PLUGIN
|
||||
//argv[1] => ID
|
||||
//argv[2] => VARIABLES
|
||||
|
||||
var existTranslations = true;
|
||||
var existIdLabel = true;
|
||||
eval("if( typeof TRANSLATIONS_" + argv[0] + " != 'undefined' && TRANSLATIONS_" + argv[0] + ") { existTranslations = true; } else { existTranslations = false; }");
|
||||
if (existTranslations) {
|
||||
eval("if( typeof TRANSLATIONS_" + argv[0] + "[argv[1]] != 'undefined' ) { existIdLabel = true; } else { existIdLabel = false; }");
|
||||
if (existIdLabel) {
|
||||
if (argc > 2) {
|
||||
eval("trn = TRANSLATIONS_" + argv[0] + "[argv[0]];");
|
||||
for (i = 2; i < argv.length; i++) {
|
||||
trn = trn.replace('{'+(i-2)+'}', argv[i]);
|
||||
}
|
||||
} else {
|
||||
eval("trn = TRANSLATIONS_" + argv[0] + "[argv[0]];");
|
||||
}
|
||||
} else {
|
||||
trn = '**' + argv[1] + '**';
|
||||
}
|
||||
} else {
|
||||
PMExt.error('Processmaker JS Core Error', 'The TRANSLATIONS ' + argv[0] + ' global object is not loaded!');
|
||||
trn = '';
|
||||
}
|
||||
return trn;
|
||||
}
|
||||
|
||||
/**
|
||||
* String Replace function, if strSearch has special characters "(", "[", must be escape "\\(", "\\[".
|
||||
*
|
||||
|
||||
@@ -36,6 +36,9 @@ else{trn=TRANSLATIONS[argv[0]];}}
|
||||
else{trn='**'+argv[0]+'**';}}
|
||||
else{PMExt.error('Processmaker JS Core Error','The TRANSLATIONS global object is not loaded!');trn='';}
|
||||
return trn;}
|
||||
function __()
|
||||
{var argv=__.arguments;var argc=argv.length;var existTranslations=true;var existIdLabel=true;eval("if( typeof TRANSLATIONS_"+argv[0]+" != 'undefined' && TRANSLATIONS_"+argv[0]+") { existTranslations = true; } else { existTranslations = false; }");if(existTranslations){eval("if( typeof TRANSLATIONS_"+argv[0]+"[argv[1]] != 'undefined' ) { existIdLabel = true; } else { existIdLabel = false; }");if(existIdLabel){if(argc>2){eval("trn = TRANSLATIONS_"+argv[0]+"[argv[0]];");for(i=2;i<argv.length;i++){trn=trn.replace('{'+(i-2)+'}',argv[i]);}}else{eval("trn = TRANSLATIONS_"+argv[0]+"[argv[0]];");}}else{trn='**'+argv[1]+'**';}}else{PMExt.error('Processmaker JS Core Error','The TRANSLATIONS '+argv[0]+' global object is not loaded!');trn='';}
|
||||
return trn;}
|
||||
function _FNF(USER_NAME,FIRST_NAME,LAST_NAME,FN_FORMAT)
|
||||
{if(USER_NAME==null){USER_NAME='';}
|
||||
if(FIRST_NAME==null){FIRST_NAME='';}
|
||||
|
||||
@@ -349,6 +349,42 @@ function _()
|
||||
return trn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Translator function for internationalization to plugins
|
||||
*/
|
||||
function __()
|
||||
{
|
||||
var argv = __.arguments;
|
||||
var argc = argv.length;
|
||||
|
||||
//argv[0] => NAME PLUGIN
|
||||
//argv[1] => ID
|
||||
//argv[2] => VARIABLES
|
||||
|
||||
var existTranslations = true;
|
||||
var existIdLabel = true;
|
||||
eval("if( typeof TRANSLATIONS_" + argv[0] + " != 'undefined' && TRANSLATIONS_" + argv[0] + ") { existTranslations = true; } else { existTranslations = false; }");
|
||||
if (existTranslations) {
|
||||
eval("if( typeof TRANSLATIONS_" + argv[0] + "[argv[1]] != 'undefined' ) { existIdLabel = true; } else { existIdLabel = false; }");
|
||||
if (existIdLabel) {
|
||||
if (argc > 2) {
|
||||
eval("trn = TRANSLATIONS_" + argv[0] + "[argv[0]];");
|
||||
for (i = 2; i < argv.length; i++) {
|
||||
trn = trn.replace('{'+(i-2)+'}', argv[i]);
|
||||
}
|
||||
} else {
|
||||
eval("trn = TRANSLATIONS_" + argv[0] + "[argv[0]];");
|
||||
}
|
||||
} else {
|
||||
trn = '**' + argv[1] + '**';
|
||||
}
|
||||
} else {
|
||||
PMExt.error('Processmaker JS Core Error', 'The TRANSLATIONS ' + argv[0] + ' global object is not loaded!');
|
||||
trn = '';
|
||||
}
|
||||
return trn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Environment Formats function for full name
|
||||
*/
|
||||
|
||||
@@ -791,6 +791,9 @@ else{trn=TRANSLATIONS[argv[0]];}}
|
||||
else{trn='**'+argv[0]+'**';}}
|
||||
else{PMExt.error('Processmaker JS Core Error','The TRANSLATIONS global object is not loaded!');trn='';}
|
||||
return trn;}
|
||||
function __()
|
||||
{var argv=__.arguments;var argc=argv.length;var existTranslations=true;var existIdLabel=true;eval("if( typeof TRANSLATIONS_"+argv[0]+" != 'undefined' && TRANSLATIONS_"+argv[0]+") { existTranslations = true; } else { existTranslations = false; }");if(existTranslations){eval("if( typeof TRANSLATIONS_"+argv[0]+"[argv[1]] != 'undefined' ) { existIdLabel = true; } else { existIdLabel = false; }");if(existIdLabel){if(argc>2){eval("trn = TRANSLATIONS_"+argv[0]+"[argv[0]];");for(i=2;i<argv.length;i++){trn=trn.replace('{'+(i-2)+'}',argv[i]);}}else{eval("trn = TRANSLATIONS_"+argv[0]+"[argv[0]];");}}else{trn='**'+argv[1]+'**';}}else{PMExt.error('Processmaker JS Core Error','The TRANSLATIONS '+argv[0]+' global object is not loaded!');trn='';}
|
||||
return trn;}
|
||||
function stringReplace(strSearch,strReplace,str)
|
||||
{var expression=eval("/"+strSearch+"/g");return str.replace(expression,strReplace);}
|
||||
var mb_strlen=function(str){str=str||'';var len=0;for(var i=0;i<str.length;i++){len+=str.charCodeAt(i)<0||str.charCodeAt(i)>255?2:1;}
|
||||
|
||||
@@ -2052,7 +2052,41 @@ class G
|
||||
}
|
||||
return $untranslatedMark . $msgID . $untranslatedMark;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function LoadTranslation
|
||||
*
|
||||
* @author Brayan Osmar Pereyra Suxo "Cochalo". <brayan@colosa.com>
|
||||
* @access public
|
||||
* @param eter string name plugin
|
||||
* @param eter string id msg
|
||||
* @param eter array data
|
||||
* @return string
|
||||
*/
|
||||
public function LoadTranslationPlugin ($namePlugin, $msgID, $data = null)
|
||||
{
|
||||
eval('global $translation' . $namePlugin . ';');
|
||||
|
||||
$existId = false;
|
||||
eval('if (isset( $translation' . $namePlugin . '[$msgID])) { $existId = true; }');
|
||||
if ($existId) {
|
||||
eval('$translationString = preg_replace( "[\n|\r|\n\r]", " ", $translation' . $namePlugin . '[$msgID] );');
|
||||
if (isset( $data ) && is_array( $data )) {
|
||||
foreach ($data as $label => $value) {
|
||||
$translationString = str_replace( '{' . $label . '}', $value, $translationString );
|
||||
}
|
||||
}
|
||||
|
||||
return $translationString;
|
||||
} else {
|
||||
if (defined( "UNTRANSLATED_MARK" )) {
|
||||
$untranslatedMark = strip_tags( UNTRANSLATED_MARK );
|
||||
} else {
|
||||
$untranslatedMark = "**";
|
||||
}
|
||||
return $untranslatedMark . $msgID . $untranslatedMark;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3583,23 +3583,19 @@ class XmlForm_Field_Listbox extends XmlForm_Field
|
||||
$html .= $this->renderHint();
|
||||
return $html;
|
||||
} elseif ($this->mode === 'view') {
|
||||
$html = '<select multiple id="form[' . $this->name . ']" name="form[' . $this->name . '][]" size="' . $this->size . '" ' . $this->NSFieldType() . ' disabled>'; //disabled>';
|
||||
$html = '<select multiple="multiple" id="form[' . $this->name . ']" name="form[' . $this->name . '][]" size="' . $this->size . '" ' . $this->NSFieldType() . ' style="background: none;" disabled="disabled">';
|
||||
foreach ($this->option as $optionName => $option) {
|
||||
if ((in_array( $optionName, $value )) == 1) {
|
||||
$html .= ' <option class="module_ListBoxView" value="' . $optionName . '" ' . ((in_array( $optionName, $value )) ? 'selected' : '') . '>' . $option . '</option>';
|
||||
} else {
|
||||
$html .= '<option value="' . $optionName . '" ' . ((in_array( $optionName, $value )) ? 'selected' : '') . '>' . $option . '</option>';
|
||||
}
|
||||
$html .= '<option value="' . $optionName . '" ' . ((in_array( $optionName, $value )) ? 'class="module_ListBoxView" selected="selected"' : '') . '>' . $option . '</option>';
|
||||
}
|
||||
foreach ($this->sqlOption as $optionName => $option) {
|
||||
$html .= '<option value="' . $optionName . '" ' . ((in_array( $optionName, $value )) ? 'selected' : '') . '>' . $option . '</option>';
|
||||
$html .= '<option value="' . $optionName . '" ' . ((in_array( $optionName, $value )) ? 'class="module_ListBoxView" selected="selected"' : '') . '>' . $option . '</option>';
|
||||
}
|
||||
$html .= '</select>';
|
||||
foreach ($this->option as $optionName => $option) {
|
||||
$html .= '<input style="color:white;" type="hidden" id="form[' . $this->name . ']" name="form[' . $this->name . '][]" value="' . ((in_array( $optionName, $value )) ? $optionName : '') . '">';
|
||||
$html .= '<input type="hidden" id="form[' . $this->name . ']" name="form[' . $this->name . '][]" value="' . ((in_array( $optionName, $value )) ? $optionName : '') . '">';
|
||||
}
|
||||
foreach ($this->sqlOption as $optionName => $option) {
|
||||
$html .= '<input type="hidden" id="form[' . $this->name . ']" name="form[' . $this->name . '][]" value="' . ((in_array( $optionName, $value )) ? $optionName : '') . '">';
|
||||
$html .= '<input type="hidden" id="form[' . $this->name . ']" name="form[' . $this->name . '][]" value="' . ((in_array( $optionName, $value )) ? $optionName : '') . '">';
|
||||
}
|
||||
return $html;
|
||||
} else {
|
||||
|
||||
@@ -587,14 +587,8 @@ INPUT {
|
||||
}
|
||||
.module_ListBoxView
|
||||
{
|
||||
|
||||
color: white;
|
||||
background:#CCDDFF;
|
||||
padding:1px;
|
||||
border:1px solid #AAA;
|
||||
padding-left:3px;
|
||||
background-position:0px 0px;
|
||||
font :normal 8pt sans-serif;
|
||||
background: #0A246A;
|
||||
}
|
||||
.module_app_inputHover___gray
|
||||
{
|
||||
|
||||
@@ -587,14 +587,8 @@ INPUT {
|
||||
}
|
||||
.module_ListBoxView
|
||||
{
|
||||
|
||||
color: white;
|
||||
background:#CCDDFF;
|
||||
padding:1px;
|
||||
border:1px solid #AAA;
|
||||
padding-left:3px;
|
||||
background-position:0px 0px;
|
||||
font :normal 8pt sans-serif;
|
||||
background: #0A246A;
|
||||
}
|
||||
.module_app_inputHover___gray
|
||||
{
|
||||
|
||||
@@ -617,14 +617,8 @@
|
||||
}
|
||||
.module_ListBoxView
|
||||
{
|
||||
|
||||
color: white;
|
||||
background:#CCDDFF;
|
||||
padding:1px;
|
||||
border:1px solid #AAA;
|
||||
padding-left:3px;
|
||||
background-position:0px 0px;
|
||||
font :normal 8pt sans-serif;
|
||||
background: #0A246A;
|
||||
}
|
||||
.module_app_inputHover___gray
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user