Adding some updates to the ajax function and also, the Ajax call to the variable picker form
This commit is contained in:
@@ -111,7 +111,7 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field
|
|||||||
tinyMCE.baseURL = "/js/tinymce/jscripts/tiny_mce"
|
tinyMCE.baseURL = "/js/tinymce/jscripts/tiny_mce"
|
||||||
tinyMCE.init({
|
tinyMCE.init({
|
||||||
theme : "advanced",
|
theme : "advanced",
|
||||||
plugins : "fullpage, pmSimpleUploader, pmVariablePicker",
|
plugins : "fullpage, pmSimpleUploader, pmVariablePicker, inlinepopups",
|
||||||
mode : "specific_textareas",
|
mode : "specific_textareas",
|
||||||
editor_selector : "tmceEditor",
|
editor_selector : "tmceEditor",
|
||||||
width : "770",
|
width : "770",
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
var getValue = function (list) {
|
||||||
|
console.log(list.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
var getVariableList = function (queryText, proUid, varType){
|
||||||
|
varType = varType.toLowerCase();
|
||||||
|
var response
|
||||||
|
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||||
|
url : "../processes/processes_Ajax",
|
||||||
|
async : false,
|
||||||
|
method: "POST",
|
||||||
|
args : "action=getVariableList&process="+proUid+"&queryText="+queryText+"&type="+varType
|
||||||
|
});
|
||||||
|
oRPC.callback = function(rpc){
|
||||||
|
console.log(rpc.xmlhttp.responseText);
|
||||||
|
response = eval(rpc.xmlhttp.responseText);
|
||||||
|
}.extend(this);
|
||||||
|
|
||||||
|
oRPC.make();
|
||||||
|
console.log(response);
|
||||||
|
}
|
||||||
|
|
||||||
leimnud.event.add(document.getElementById('type_variables'), 'change', function(event) {
|
leimnud.event.add(document.getElementById('type_variables'), 'change', function(event) {
|
||||||
console.log('Dropdown Type of Variables');
|
console.log('Dropdown Type of Variables');
|
||||||
});
|
});
|
||||||
@@ -11,6 +33,11 @@ leimnud.event.add(document.getElementById('search'), 'keypress', function(event)
|
|||||||
var tecla = event.keyCode;
|
var tecla = event.keyCode;
|
||||||
if(tecla == '13')
|
if(tecla == '13')
|
||||||
{
|
{
|
||||||
|
var list = getVariableList('nuev','2527075735085b447a58523099748463','system');
|
||||||
|
console.log(list);
|
||||||
|
for (var i in list){
|
||||||
|
console.log(list[i]);
|
||||||
|
}
|
||||||
console.log('Has pulsado enter');
|
console.log('Has pulsado enter');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -20,6 +47,3 @@ leimnud.event.add(document.getElementById('type_variables'), 'change', function(
|
|||||||
console.log('Dropdown Type of Variables');
|
console.log('Dropdown Type of Variables');
|
||||||
});
|
});
|
||||||
|
|
||||||
function getValue(list) {
|
|
||||||
console.log(list.value);
|
|
||||||
}
|
|
||||||
@@ -41,6 +41,14 @@ $html .= '<label for="variables_label">Search</label>';
|
|||||||
$html .= '</td>';
|
$html .= '</td>';
|
||||||
$html .= '</tr>';
|
$html .= '</tr>';
|
||||||
|
|
||||||
|
$html = '<form action="uploader.php?'.$_SERVER["QUERY_STRING"].'&q=upload" method="post" enctype="multipart/form-data" onsubmit="">';
|
||||||
|
|
||||||
|
$html .= '<div id="d_variables">';
|
||||||
|
$html .= '<table width="90%" align="center">';
|
||||||
|
$html .= '<tr>';
|
||||||
|
$html .= '<td width="50%">';
|
||||||
|
$html .= '<label for="type_label">Type Variable</label>';
|
||||||
|
$html .= '</td>';
|
||||||
|
|
||||||
$html .= '<tr>';
|
$html .= '<tr>';
|
||||||
$html .= '<td width="25%">';
|
$html .= '<td width="25%">';
|
||||||
@@ -148,7 +156,7 @@ echo $alll;
|
|||||||
/*
|
/*
|
||||||
$sHTML = '<select name="_Var_Form_" id="_Var_Form_" size="' . count( $aFields ) . '" style="width:100%;' . (! isset( $_POST['sNoShowLeyend'] ) ? 'height:50%;' : '') . '" ondblclick="insertFormVar(\'' . $_POST['sFieldName'] . '\', this.value);">';
|
$sHTML = '<select name="_Var_Form_" id="_Var_Form_" size="' . count( $aFields ) . '" style="width:100%;' . (! isset( $_POST['sNoShowLeyend'] ) ? 'height:50%;' : '') . '" ondblclick="insertFormVar(\'' . $_POST['sFieldName'] . '\', this.value);">';
|
||||||
foreach ($aFields as $aField) {
|
foreach ($aFields as $aField) {
|
||||||
$sHTML .= '<option value="' . $_POST['sSymbol'] . $aField['sName'] . '">' . $_POST['sSymbol'] . $aField['sName'] . ' (' . $aField['sType'] . ')</option>';
|
$html .= '<option value="' . $_POST['sSymbol'] . $aField['sName'] . '">' . $_POST['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'
|
||||||
@@ -158,118 +166,40 @@ foreach ($aFields as $aField) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sHTML .= '</select>';
|
$html .= '</select>';
|
||||||
$sHTML = '';
|
|
||||||
|
|
||||||
if (! isset( $_POST['sNoShowLeyend'] )) {
|
$html .= '</td>';
|
||||||
$sHTML = '<table width="100%">';
|
$html .= '</tr>';
|
||||||
$sHTML .= '<tr><td align="center" class="module_app_input___gray" colspan="2"><b>Variables cast prefix</b></td></tr>';
|
$html .= '</table>';
|
||||||
if (isset( $_POST['sType'] )) {
|
$html .= '</div>';
|
||||||
$sHTML .= '<tr><td class="module_app_input___gray">' . G::LoadTranslation( 'ID_ESC' ) . '</td></tr>';
|
|
||||||
$sHTML .= '<tr><td class="module_app_input___gray">' . G::LoadTranslation( 'ID_NONEC' ) . '</td></tr>';
|
|
||||||
//$sHTML .= '<tr><td class="module_app_input___gray">' . G::LoadTranslation('ID_EURL') . '</td></tr>';
|
|
||||||
//$sHTML .= '<tr><td class="module_app_input___gray">' . G::LoadTranslation('ID_EVAL') . '</td></tr>';
|
|
||||||
//$sHTML .= '<tr><td class="module_app_input___gray">' . G::LoadTranslation('ID_ESCJS') . '</td></tr>';
|
|
||||||
//$sHTML .= '<tr><td class="module_app_input___gray">' . G::LoadTranslation('ID_ESCSJS') . '</td></tr>';
|
|
||||||
//$sHTML .= '<tr><td class="module_app_input___gray">' . G::LoadTranslation('ID_FUNCTION') . '</td></tr>';
|
|
||||||
} else {
|
|
||||||
$sHTML .= '<tr><td class="module_app_input___gray" width="5%">@@</td><td class="module_app_input___gray">' . G::LoadTranslation( 'ID_TO_STRING' ) . '</td></tr>';
|
|
||||||
$sHTML .= '<tr><td class="module_app_input___gray" width="5%">@#</td><td class="module_app_input___gray">' . G::LoadTranslation( 'ID_TO_FLOAT' ) . '</td></tr>';
|
|
||||||
$sHTML .= '<tr><td class="module_app_input___gray" width="5%">@%</td><td class="module_app_input___gray">' . G::LoadTranslation( 'ID_TO_INTEGER' ) . '</td></tr>';
|
|
||||||
$sHTML .= '<tr><td class="module_app_input___gray" width="5%">@?</td><td class="module_app_input___gray">' . G::LoadTranslation( 'ID_TO_URL' ) . '</td></tr>';
|
|
||||||
$sHTML .= '<tr><td class="module_app_input___gray" width="5%">@$</td><td class="module_app_input___gray">' . G::LoadTranslation( 'ID_SQL_ESCAPE' ) . '</td></tr>';
|
|
||||||
$sHTML .= '<tr><td class="module_app_input___gray" width="5%">@=</td><td class="module_app_input___gray">' . G::LoadTranslation( 'ID_REPLACE_WITHOUT_CHANGES' ) . '</td></tr>';
|
|
||||||
}
|
|
||||||
$sHTML .= '<tr><td align="center" class="module_app_input___gray" colspan="2"> </td></tr>';
|
|
||||||
//$sHTML .= '<tr><td align="center" class="module_app_input___gray" colspan="2">' . G::LoadTranslation('ID_DOCLICK') . '</td></tr>';
|
|
||||||
$sHTML .= '</table>';
|
|
||||||
} else {
|
|
||||||
// please don't remove this definition if there isn't some sort of html tags before the css styles aren't loaded in IE
|
|
||||||
$sHTML = '<table width="100%">';
|
|
||||||
$sHTML .= '</table>';
|
|
||||||
}
|
|
||||||
$sStyle = " <style type=\"text/css\">
|
|
||||||
|
|
||||||
.pm__dynavars a#dynalink{color:#000000;}
|
$html .= '<br>';
|
||||||
|
$html .= '<div id="desc_variables">';
|
||||||
|
$html .= '<table border="1" width="90%" align="center">';
|
||||||
|
$html .= '<tr width="40%">';
|
||||||
|
$html .= '<td>Result</td>';
|
||||||
|
$html .= '<td>@#SYS_LANG</td>';
|
||||||
|
$html .= '</tr>';
|
||||||
|
$html .= '<tr width="60%">';
|
||||||
|
$html .= '<td>Description</td>';
|
||||||
|
$html .= '<td>Description @#SYS_LANG</td>';
|
||||||
|
$html .= '</tr>';
|
||||||
|
$html .= '</table>';
|
||||||
|
$html .= '</div>';
|
||||||
|
$html .= '<br>';
|
||||||
|
$html .= '<div id="desc_variables">';
|
||||||
|
$html .= '<table width="90%" align="center">';
|
||||||
|
$html .= '<tr><td>';
|
||||||
|
$html .= '<label for="desc_prefix">' . G::LoadTranslation( 'ID_TO_FLOAT' ) . '</label>';
|
||||||
|
$html .= '</td></tr>';
|
||||||
|
$html .= '</div>';
|
||||||
|
|
||||||
// begin css tabs
|
$html .= '</form>';
|
||||||
ul#tabnav { // general settings
|
|
||||||
text-align: left; // set to left, right or center
|
|
||||||
margin: 1em 0 1em 0; // set margins as desired
|
|
||||||
font: bold 11px verdana, arial, sans-serif; // set font as desired
|
|
||||||
border-bottom: 1px solid #ccc; // set border COLOR as desired
|
|
||||||
list-style-type: none;
|
|
||||||
padding: 3px 10px 3px 10px; // THIRD number must change with respect to padding-top (X) below
|
|
||||||
}
|
|
||||||
|
|
||||||
ul#tabnav li { // do not change
|
echo $html;
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#all li.all, div#system li.system, div#process li.process, div#tab4 li.tab4 { // settings for selected tab
|
|
||||||
border-bottom: 1px solid #fff; // set border color to page background color
|
|
||||||
background-color: #fff; // set background color to match above border color
|
|
||||||
}
|
|
||||||
|
|
||||||
div#all li.all a, div#system li.system a, div#process li.process a, div#tab4 li.tab4 a { // settings for selected tab link
|
|
||||||
background-color: #fff; // set selected tab background color as desired
|
|
||||||
color: #000; // set selected tab link color as desired
|
|
||||||
position: relative;
|
|
||||||
top: 1px;
|
|
||||||
padding-top: 4px; // must change with respect to padding (X) above and below
|
|
||||||
}
|
|
||||||
|
|
||||||
ul#tabnav li a { // settings for all tab links
|
|
||||||
padding: 3px 4px; // set padding (tab size) as desired; FIRST number must change with respect to padding-top (X) above
|
|
||||||
border: 1px solid #aaa; // set border COLOR as desired; usually matches border color specified in #tabnav
|
|
||||||
background-color: #ccc; // set unselected tab background color as desired
|
|
||||||
color: #666; // set unselected tab link color as desired
|
|
||||||
margin-right: 10px; // set additional spacing between tabs as desired
|
|
||||||
text-decoration: none;
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul#tabnav a:hover { // settings for hover effect
|
|
||||||
background: #fff; // set desired hover color
|
|
||||||
}
|
|
||||||
|
|
||||||
// end css tabs
|
|
||||||
|
|
||||||
</style>";
|
|
||||||
$cssTabs = "<div id=\"all\">
|
|
||||||
<ul id=\"tabnav\">
|
|
||||||
<li class=\"all\"><a href=\"#\" onclick=\"changeVariables('all','" . $_POST['sProcess'] . "','" . $_POST['sFieldName'] . "','" . $_POST['sSymbol'] . "','processVariablesContent');\">All variables</a></li>
|
|
||||||
<li class=\"system\"><a href=\"#\" onclick=\"changeVariables('system','" . $_POST['sProcess'] . "','" . $_POST['sFieldName'] . "','" . $_POST['sSymbol'] . "','processVariablesContent');\">System</a></li>
|
|
||||||
<li class=\"process\"><a href=\"#\" onclick=\"changeVariables('process','" . $_POST['sProcess'] . "','" . $_POST['sFieldName'] . "','" . $_POST['sSymbol'] . "','processVariablesContent');\">Process</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
";
|
|
||||||
echo $sHTML;
|
|
||||||
echo $sStyle;
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
echo "<div id=\"processVariablesContent\">";
|
|
||||||
//echo $cssTabs;
|
|
||||||
G::LoadClass( 'ArrayPeer' );
|
|
||||||
|
|
||||||
global $_DBArray;
|
|
||||||
//$_DBArray['dynavars'] = $aRows;
|
|
||||||
$_SESSION['_DBArray'] = $_DBArray;
|
|
||||||
|
|
||||||
G::LoadClass( 'ArrayPeer' );
|
|
||||||
$oCriteria = new Criteria( 'dbarray' );
|
|
||||||
$oCriteria->setDBArrayTable( 'dynavars' );
|
|
||||||
|
|
||||||
$aFields = array ();
|
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$oHeadPublisher = & headPublisher::getSingleton();
|
|
||||||
$oHeadPublisher->addScriptFile( "/jscore/controls/varsAjax.js" );
|
|
||||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'triggers/dynavars', $oCriteria );
|
|
||||||
G::RenderPage( 'publish', 'raw' );
|
G::RenderPage( 'publish', 'raw' );
|
||||||
|
|
||||||
echo "</div>";
|
/*$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'triggers/dynavars', $oCriteria );
|
||||||
|
G::RenderPage( 'publish', 'raw' );
|
||||||
*/
|
*/
|
||||||
@@ -519,6 +519,20 @@ try {
|
|||||||
case 'events':
|
case 'events':
|
||||||
$oProcessMap->eventsList( $oData->pro_uid, $oData->type );
|
$oProcessMap->eventsList( $oData->pro_uid, $oData->type );
|
||||||
break;
|
break;
|
||||||
|
case 'getVariableList':
|
||||||
|
G::LoadClass( 'xmlfield_InputPM' );
|
||||||
|
$proUid= isset($_REQUEST['process'])?$_REQUEST['process']:'';
|
||||||
|
$aFields = getDynaformsVars( $proUid, true, isset( $_REQUEST['bIncMulSelFields'] ) ? $_REQUEST['bIncMulSelFields'] : 0 );
|
||||||
|
$_REQUEST['queryString'] = 'SYS';
|
||||||
|
$aVariables = array();
|
||||||
|
foreach ($aFields as $key => $value) {
|
||||||
|
if(stristr($aFields[$key]['sName'], $_REQUEST['queryString'])){
|
||||||
|
$aVariables[] = $aFields[$key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$oJSON = new Services_JSON();
|
||||||
|
echo $oJSON->encode($aFields);
|
||||||
|
break;
|
||||||
/*
|
/*
|
||||||
case 'saveFile':
|
case 'saveFile':
|
||||||
global $G_PUBLISH;
|
global $G_PUBLISH;
|
||||||
|
|||||||
Reference in New Issue
Block a user