Changes to the variable picker feature before revision meeting with the CTO
This commit is contained in:
@@ -44,12 +44,12 @@ function pmVariablePicker(field_name, url, type, win) {
|
|||||||
strUploaderURL = strUploaderURL + "&type=" + type + "&d=" + strUploadPath + "&subs=" + strSubstitutePath;
|
strUploaderURL = strUploaderURL + "&type=" + type + "&d=" + strUploadPath + "&subs=" + strSubstitutePath;
|
||||||
}
|
}
|
||||||
tinyMCE.activeEditor.windowManager.open({ // open the plugin popup
|
tinyMCE.activeEditor.windowManager.open({ // open the plugin popup
|
||||||
//file : strUploaderURL,
|
file : '/sysworkflow/en/classic/controls/varsAjax?displayOption=tinyMCE&sSymbol=@@',
|
||||||
file : strPluginPath + '/VariablePicker.html',
|
|
||||||
title : 'Upload Variable',
|
title : 'Upload Variable',
|
||||||
width : '600px',
|
width : '400px',
|
||||||
height : '150px',
|
height : '350px',
|
||||||
resizable : "yes",
|
resizable : "yes",
|
||||||
|
overflow : false,
|
||||||
inline : 1, // This parameter only has an effect if you use the inlinepopups plugin!
|
inline : 1, // This parameter only has an effect if you use the inlinepopups plugin!
|
||||||
close_previous : "no"
|
close_previous : "no"
|
||||||
}, {
|
}, {
|
||||||
@@ -69,3 +69,8 @@ function closePluginPopup(){
|
|||||||
function updateEditorContent(serializedHTML){
|
function updateEditorContent(serializedHTML){
|
||||||
tinyMCE.activeEditor.execCommand('mceInsertContent', false, serializedHTML);
|
tinyMCE.activeEditor.execCommand('mceInsertContent', false, serializedHTML);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function insertFormVar(fieldName,serializedHTML){
|
||||||
|
tinyMCE.activeEditor.execCommand('mceInsertContent', false, serializedHTML);
|
||||||
|
closePluginPopup();
|
||||||
|
}
|
||||||
@@ -1,13 +1,8 @@
|
|||||||
//function onLoad(){
|
var setVariablePickerJS = function(){
|
||||||
// generateListValues(document.getElementById('prefix').value);
|
|
||||||
//}
|
|
||||||
//window.onload=function(){
|
|
||||||
//generateListValues(document.getElementById('prefix').value);
|
|
||||||
//};
|
|
||||||
|
|
||||||
var getValue = function (list) {
|
document.getElementById('_Var_Form_').addEventListener('dblclick', function(){
|
||||||
insertFormVar(document.getElementById('selectedField').value,list.value);
|
insertFormVar(document.getElementById('selectedField').value, this.value);
|
||||||
}
|
});
|
||||||
|
|
||||||
var getVariableList = function (queryText, proUid, varType){
|
var getVariableList = function (queryText, proUid, varType){
|
||||||
varType = varType.toLowerCase();
|
varType = varType.toLowerCase();
|
||||||
@@ -98,7 +93,7 @@ function generateListValues (prefix){
|
|||||||
for(i=0; i<list.length; i++)
|
for(i=0; i<list.length; i++)
|
||||||
{
|
{
|
||||||
option = document.createElement("OPTION");
|
option = document.createElement("OPTION");
|
||||||
option.value = list[i].sName;
|
option.value = prefix+list[i].sName;
|
||||||
option.text = prefix+list[i].sName+' ('+list[i].sLabel+')';
|
option.text = prefix+list[i].sName+' ('+list[i].sLabel+')';
|
||||||
combo.add(option);
|
combo.add(option);
|
||||||
}
|
}
|
||||||
@@ -109,3 +104,10 @@ function generateListValues (prefix){
|
|||||||
combo.add(option);
|
combo.add(option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (document.readyState == 'complete'){
|
||||||
|
setVariablePickerJS();
|
||||||
|
} else {
|
||||||
|
document.body.onload = setVariablePickerJS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,10 +95,10 @@ $aFields = getDynaformsVars( $_POST['sProcess'], true, isset( $_POST['bIncMulSel
|
|||||||
|
|
||||||
//$html .= '<select name="_Var_Form_" id="_Var_Form_" size="' . count( $aFields ) . '" style="width:100%;' . (! isset( $_POST['sNoShowLeyend'] ) ? 'height:50%;' : '') . '" ondblclick="insertFormVar(\'' . $_POST['sFieldName'] . '\', this.value);">';
|
//$html .= '<select name="_Var_Form_" id="_Var_Form_" size="' . count( $aFields ) . '" style="width:100%;' . (! isset( $_POST['sNoShowLeyend'] ) ? 'height:50%;' : '') . '" ondblclick="insertFormVar(\'' . $_POST['sFieldName'] . '\', this.value);">';
|
||||||
|
|
||||||
$html .= '<select name="_Var_Form_" id="_Var_Form_" size="8" style="width:100%;' . (! isset( $_POST['sNoShowLeyend'] ) ? 'height:170;' : '') . '" ondblclick="getValue(this);">';
|
$html .= '<select name="_Var_Form_" id="_Var_Form_" size="8" style="width:100%;' . (! isset( $_POST['sNoShowLeyend'] ) ? 'height:170;' : '') . '" >';
|
||||||
|
|
||||||
foreach ($aFields as $aField) {
|
foreach ($aFields as $aField) {
|
||||||
$html .= '<option value="' . $_POST['sSymbol'] . $aField['sName'] . '">' . $_POST['sSymbol'] . $aField['sName'] . ' (' . $aField['sType'] . ')</option>';
|
$html .= '<option value="' . $_REQUEST['sSymbol'] . $aField['sName'] . '">' . $_REQUEST['sSymbol'] . $aField['sName'] . ' (' . $aField['sType'] . ')</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$aRows[0] = Array ('fieldname' => 'char','variable' => 'char','type' => 'type','label' => 'char');
|
$aRows[0] = Array ('fieldname' => 'char','variable' => 'char','type' => 'type','label' => 'char');
|
||||||
@@ -134,13 +134,20 @@ $html .= '</div>';
|
|||||||
|
|
||||||
$html .= '</form>';
|
$html .= '</form>';
|
||||||
|
|
||||||
|
$display = 'raw';
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
$oHeadPublisher = & headPublisher::getSingleton();
|
$oHeadPublisher = & headPublisher::getSingleton();
|
||||||
$oHeadPublisher->addScriptFile('/jscore/controls/variablePicker.js');
|
$oHeadPublisher->addScriptFile('/jscore/controls/variablePicker.js');
|
||||||
|
if($_REQUEST['displayOption']=='tinyMCE'){
|
||||||
|
$display = 'blank';
|
||||||
|
$oHeadPublisher->addScriptFile('/js/tinymce/jscripts/tiny_mce/tiny_mce_popup.js');
|
||||||
|
$oHeadPublisher->addScriptFile('/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/editor_plugin_src.js');
|
||||||
|
}
|
||||||
|
|
||||||
echo $html;
|
echo $html;
|
||||||
|
|
||||||
G::RenderPage( 'publish', 'raw' );
|
G::RenderPage( 'publish', $display );
|
||||||
/*
|
/*
|
||||||
$alll = '<script type="text/javascript" language="javascript">';
|
$alll = '<script type="text/javascript" language="javascript">';
|
||||||
$alll .= 'function Seleccionar(combo){';
|
$alll .= 'function Seleccionar(combo){';
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<en><![CDATA[<div align="center">Edit @#filename email template</div>]]></en>
|
<en><![CDATA[<div align="center">Edit @#filename email template</div>]]></en>
|
||||||
</TITLE>
|
</TITLE>
|
||||||
|
|
||||||
<fcontent type="wysiwyg_editor" editorType="EMAIL_TEMPLATE" height="420" width="720" defaultValue="">
|
<fcontent type="wysiwyg_editor" editorType="EMAIL_TEMPLATE" height="380" width="720" defaultValue="">
|
||||||
<en/>
|
<en/>
|
||||||
</fcontent>
|
</fcontent>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user