The variable picker in the event section is now the same as the rest of ProcessMaker
This commit is contained in:
@@ -75,11 +75,12 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field
|
||||
*/
|
||||
public function attachEvents ($element)
|
||||
{
|
||||
//cleaning the conflictive prototype functions
|
||||
$editorDefinition = 'tinyMCE.baseURL = "/js/tinymce/jscripts/tiny_mce"';
|
||||
|
||||
$editorDefinition = 'tinyMCE.baseURL = "/js/tinymce/jscripts/tiny_mce"; ';
|
||||
|
||||
switch ($this->editorType){
|
||||
case 'EMAIL_TEMPLATE':
|
||||
$editorDefinition = '
|
||||
$editorDefinition .= '
|
||||
tinyMCE.init({
|
||||
theme : "advanced",
|
||||
plugins : "advhr,advimage,advlink,advlist,autolink,autoresize,autosave,contextmenu,directionality,emotions,example,example_dependency,fullpage,fullscreen,iespell,inlinepopups,insertdatetime,layer,legacyoutput,lists,media,nonbreaking,noneditable,pagebreak,paste,preview,print,save,searchreplace,spellchecker,style,tabfocus,table,template,visualblocks,visualchars,wordcount,xhtmlxtras,pmSimpleUploader,pmVariablePicker",
|
||||
@@ -110,7 +111,7 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field
|
||||
break;
|
||||
case 'OUTPUT_DOCUMENT':
|
||||
|
||||
$editorDefinition = '
|
||||
$editorDefinition .= '
|
||||
tinyMCE.baseURL = "/js/tinymce/jscripts/tiny_mce"
|
||||
tinyMCE.init({
|
||||
theme : "advanced",
|
||||
@@ -136,7 +137,7 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field
|
||||
break;
|
||||
|
||||
case 'DYNAFORM_TEMPLATE':
|
||||
$editorDefinition = '
|
||||
$editorDefinition .= '
|
||||
tinyMCE.init({
|
||||
theme : "advanced",
|
||||
plugins : "advhr,advimage,advlink,advlist,autolink,autoresize,autosave,contextmenu,directionality,emotions,example,example_dependency,fullpage,fullscreen,iespell,inlinepopups,insertdatetime,layer,legacyoutput,lists,media,nonbreaking,noneditable,pagebreak,paste,preview,print,save,searchreplace,spellchecker,style,tabfocus,table,template,visualblocks,visualchars,wordcount,xhtmlxtras",
|
||||
@@ -168,12 +169,11 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field
|
||||
return true;
|
||||
}
|
||||
});
|
||||
alert("new");
|
||||
alert(tinyMCE.execCommand("mceRmoveControl", false, "form[HTML]"));
|
||||
|
||||
';
|
||||
break;
|
||||
default:
|
||||
$editorDefinition = '
|
||||
$editorDefinition .= '
|
||||
tinyMCE.init({
|
||||
theme : "advanced",
|
||||
plugins : "fullpage",
|
||||
@@ -192,7 +192,6 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field
|
||||
';
|
||||
break;
|
||||
}
|
||||
|
||||
return $editorDefinition;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
var setVariablePickerJS = function(){
|
||||
|
||||
document.getElementById('_Var_Form_').addEventListener('dblclick', function(){
|
||||
if (this.getAttribute('displayOption')=='event'){
|
||||
e.insertFormVar(this.value.substring(2), this.value.substring(2), 'dyn' );
|
||||
} else {
|
||||
insertFormVar(document.getElementById('selectedField').value, this.value);
|
||||
}
|
||||
});
|
||||
|
||||
var getVariableList = function (queryText, proUid, varType){
|
||||
|
||||
@@ -161,8 +161,10 @@ var EventCompose = function(t){
|
||||
oPanel.make();
|
||||
oPanel.loader.show();
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : '../events/eventsAjax',
|
||||
args: 'request=showDynavars'
|
||||
// url : '../events/eventsAjax',
|
||||
// args: 'request=showDynavars',
|
||||
url : '../controls/varsAjax',
|
||||
args: 'sSymbol=@@&displayOption=event'
|
||||
});
|
||||
oRPC.callback = function(rpc) {
|
||||
oPanel.loader.hide();
|
||||
@@ -197,6 +199,26 @@ var EventCompose = function(t){
|
||||
newOption.selected=true;
|
||||
o.options[o.options.length] = newOption;
|
||||
}
|
||||
this.insertFormVar= function(id, value, prefix){
|
||||
|
||||
if(this.exists(id)) {
|
||||
new leimnud.module.app.alert().make({label: G_STRINGS.EVENT_EMAILEXISTS});
|
||||
return false;
|
||||
}
|
||||
|
||||
this.deselectAll();
|
||||
o = getField(this.target);
|
||||
|
||||
if(prefix == 'dyn'){
|
||||
var newOption = new Option('@#'+value, prefix+"|"+id);
|
||||
} else {
|
||||
var newOption = new Option(value, prefix+"|"+id);
|
||||
}
|
||||
|
||||
newOption.selected=true;
|
||||
o.options[o.options.length] = newOption;
|
||||
oPanel.remove();
|
||||
}
|
||||
this.dropSel= function(){
|
||||
var o = getField(this.target);
|
||||
c=0;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
$_SERVER["QUERY_STRING"] = isset($_SERVER["QUERY_STRING"])?$_SERVER["QUERY_STRING"]:'';
|
||||
$_POST["sProcess"] = isset($_POST["sProcess"])?$_POST["sProcess"]:'';
|
||||
$_POST["sProcess"] = isset($_POST["sProcess"])?$_POST["sProcess"]:$_SESSION['process'];
|
||||
$_POST["sFieldName"] = isset($_POST["sFieldName"])?$_POST["sFieldName"]:'';
|
||||
$_POST['sSymbol']= isset($_POST["sSymbol"])?$_POST["sSymbol"]:'';
|
||||
|
||||
@@ -98,7 +98,13 @@ $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="8" style="width:100%;' . (! isset( $_POST['sNoShowLeyend'] ) ? 'height:170;' : '') . '" >';
|
||||
$displayOption = '';
|
||||
if (isset($_REQUEST['displayOption'])){
|
||||
$displayOption = 'displayOption="'.$_REQUEST['displayOption'].'"';
|
||||
} else {
|
||||
$displayOption = 'displayOption="normal"' ;
|
||||
}
|
||||
$html .= '<select name="_Var_Form_" id="_Var_Form_" size="8" style="width:100%;' . (! isset( $_POST['sNoShowLeyend'] ) ? 'height:170;' : '') . '" '.$displayOption.'>';
|
||||
|
||||
foreach ($aFields as $aField) {
|
||||
$html .= '<option value="' . $_REQUEST['sSymbol'] . $aField['sName'] . '">' . $_REQUEST['sSymbol'] . $aField['sName'] . ' (' . $aField['sType'] . ')</option>';
|
||||
|
||||
Reference in New Issue
Block a user