Refresh Adjustments, change in DropDown, save the code to javascript
This commit is contained in:
@@ -263,12 +263,12 @@ class DBTable
|
|||||||
$iskey = in_array( $field, $this->table_keys ) && strtoupper(substr(trim($val),0,7) ) == "NEXTVAL";
|
$iskey = in_array( $field, $this->table_keys ) && strtoupper(substr(trim($val),0,7) ) == "NEXTVAL";
|
||||||
|
|
||||||
$dbcType = isset ( $this->_dbc->type ) ? $this->_dbc->type : $DBEngine;
|
$dbcType = isset ( $this->_dbc->type ) ? $this->_dbc->type : $DBEngine;
|
||||||
|
// Commented by new format of textarea
|
||||||
if( ! $iskey )
|
if( ! $iskey )
|
||||||
$val = "'" . G::sqlEscape( $val , $dbcType ) . "'";
|
$val = "'" . $val . "'";
|
||||||
$strValues .= " $val ,";
|
///-- $val = "'" . G::sqlEscape( $val , $dbcType ) . "'";
|
||||||
|
$strValues .= $val .", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
$strFields = substr( $strFields , 0, strlen($strFields)-1 );
|
$strFields = substr( $strFields , 0, strlen($strFields)-1 );
|
||||||
$strValues = substr( $strValues , 0, strlen($strValues)-1 );
|
$strValues = substr( $strValues , 0, strlen($strValues)-1 );
|
||||||
|
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ var dynaformEditor={
|
|||||||
if( ! jsEditor )
|
if( ! jsEditor )
|
||||||
{
|
{
|
||||||
clientWinSize = getClientWindowSize();
|
clientWinSize = getClientWindowSize();
|
||||||
//startJSCodePress(); //
|
startJSCodePress();
|
||||||
jsEditor = CodeMirror.fromTextArea('form[JS]', {
|
jsEditor = CodeMirror.fromTextArea('form[JS]', {
|
||||||
height: (clientWinSize.height - 120) + "px",
|
height: (clientWinSize.height - 120) + "px",
|
||||||
width: (_BROWSER.name == 'msie' ? '100%' : '98%'),
|
width: (_BROWSER.name == 'msie' ? '100%' : '98%'),
|
||||||
@@ -293,7 +293,8 @@ var dynaformEditor={
|
|||||||
case "htmlcode":this.refresh_htmlcode();break;
|
case "htmlcode":this.refresh_htmlcode();break;
|
||||||
case "xmlcode":this.refresh_xmlcode();break;
|
case "xmlcode":this.refresh_xmlcode();break;
|
||||||
case "fieldslist":this.refreshFieldsList();break;
|
case "fieldslist":this.refreshFieldsList();break;
|
||||||
case "javascripts":this.refreshJavascripts();break;
|
case "javascripts": this.changeJavascriptCode();
|
||||||
|
this.refreshJavascripts();break;
|
||||||
case "properties":this.refreshProperties();break;
|
case "properties":this.refreshProperties();break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -398,7 +399,9 @@ var dynaformEditor={
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xmlEditor.save();
|
if (xmlEditor) {
|
||||||
|
xmlEditor.save();
|
||||||
|
}
|
||||||
return getField("JS","dynaforms_JSEditor").value;
|
return getField("JS","dynaforms_JSEditor").value;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -449,7 +452,6 @@ var dynaformEditor={
|
|||||||
field.remove(j);
|
field.remove(j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.currentJS=field.value;
|
this.currentJS=field.value;
|
||||||
var res=this.ajax.get_javascripts(this.A,field.value);
|
var res=this.ajax.get_javascripts(this.A,field.value);
|
||||||
if(field.value == ''){
|
if(field.value == ''){
|
||||||
@@ -489,10 +491,10 @@ var dynaformEditor={
|
|||||||
hideRowById('JS_TITLE');
|
hideRowById('JS_TITLE');
|
||||||
showRowById('JS');
|
showRowById('JS');
|
||||||
showRowById('JS_LIST');
|
showRowById('JS_LIST');
|
||||||
//if (this.loadPressLoaded && !JSCodePress)
|
if (this.loadPressLoaded && !JSCodePress)
|
||||||
//{
|
{
|
||||||
//startJSCodePress();
|
startJSCodePress();
|
||||||
//}
|
}
|
||||||
}else{
|
}else{
|
||||||
showRowById('JS_TITLE');hideRowById('JS_LIST');hideRowById('JS');}
|
showRowById('JS_TITLE');hideRowById('JS_LIST');hideRowById('JS');}
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,13 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons
|
|||||||
$_POST['form']['PME_SAVELABEL'] = 0;
|
$_POST['form']['PME_SAVELABEL'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($_POST['form']['PME_SAVELABEL'])){
|
||||||
|
$pmeCode = $_POST['form']['PME_CODE'];
|
||||||
|
$pmeCode = str_replace("'", "''", $pmeCode);
|
||||||
|
$pmeCode = str_replace('"', '""', $pmeCode);
|
||||||
|
$_POST['form']['PME_CODE'] = $pmeCode;
|
||||||
|
}
|
||||||
|
|
||||||
$file = G::decrypt( $_POST['form']['PME_A'] , URL_KEY );
|
$file = G::decrypt( $_POST['form']['PME_A'] , URL_KEY );
|
||||||
define('DB_XMLDB_HOST', PATH_DYNAFORM . $file . '.xml' );
|
define('DB_XMLDB_HOST', PATH_DYNAFORM . $file . '.xml' );
|
||||||
define('DB_XMLDB_USER','');
|
define('DB_XMLDB_USER','');
|
||||||
|
|||||||
@@ -33,14 +33,16 @@ resizeJSEditor();
|
|||||||
var JSCodePress=false;
|
var JSCodePress=false;
|
||||||
function startJSCodePress()
|
function startJSCodePress()
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
var code=getField("JS").value;
|
var code=getField("JS").value;
|
||||||
getField("JS").className="codepress javascript linenumbers-on";
|
getField("JS").className="codepress javascript linenumbers-on";
|
||||||
JSCodePress=new CodePress(getField("JS"));
|
JSCodePress=new CodePress(getField("JS"));
|
||||||
getField("JS").parentNode.insertBefore(JSCodePress,getField("JS"));
|
getField("JS").parentNode.insertBefore(JSCodePress,getField("JS"));
|
||||||
JSCodePress.edit(code,'javascript');
|
JSCodePress.edit(code,'javascript');
|
||||||
|
*/
|
||||||
getField("JS_LIST").onchange=function(){
|
getField("JS_LIST").onchange=function(){
|
||||||
dynaformEditor.changeJavascriptCode();
|
dynaformEditor.changeJavascriptCode();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
</PME_RESIZE_JS>
|
</PME_RESIZE_JS>
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,12 @@
|
|||||||
<tr style="display: none">
|
<tr style="display: none">
|
||||||
<td colspan="2">{$form.PME_VALIDATE_NAME}</td>
|
<td colspan="2">{$form.PME_VALIDATE_NAME}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr >
|
||||||
<td class='FormLabel' width="{$form_labelWidth}">{$PME_CODE}</td>
|
<td class='FormLabel' width="90%" align="left" colspan="2">{$PME_CODE}</td>
|
||||||
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.PME_CODE} </td> //-->
|
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.PME_CODE} </td> //-->
|
||||||
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.PME_CODE}</td>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width='90%' colspan="2">{$form.PME_CODE}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='FormButton' colspan="2" align="center"> {$form.PME_ACCEPT} {$form.BTN_CANCEL} </td>
|
<td class='FormButton' colspan="2" align="center"> {$form.PME_ACCEPT} {$form.BTN_CANCEL} </td>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<dynaForm name="javascript" type="xmlform" width="100%" enableTemplate="1">
|
<dynaForm name="javascript" type="xmlform" width="100%" enableTemplate="1">
|
||||||
<PME_A type="hidden"/>
|
<PME_A type="hidden"/>
|
||||||
<PME_TYPE type="hidden"/>
|
<PME_TYPE type="hidden"/>
|
||||||
|
<A type="hidden" showInTable="0"/>
|
||||||
<PME_TITLE type="title" enableHTML="1">
|
<PME_TITLE type="title" enableHTML="1">
|
||||||
<en>Properties</en>
|
<en>Properties</en>
|
||||||
</PME_TITLE>
|
</PME_TITLE>
|
||||||
@@ -21,7 +22,7 @@ SELECT XMLNODE_NAME, TYPE FROM dynaForm WHERE XMLNODE_NAME = @@PME_XMLNODE_NAME
|
|||||||
<en>Cancel</en>
|
<en>Cancel</en>
|
||||||
</BTN_CANCEL>
|
</BTN_CANCEL>
|
||||||
|
|
||||||
<PME_ACCEPT type="button" onclick="fieldsSave( this.form );">
|
<PME_ACCEPT type="button" onclick="saveJavascript(); fieldsSave( this.form );">
|
||||||
<en>Save</en>
|
<en>Save</en>
|
||||||
</PME_ACCEPT>
|
</PME_ACCEPT>
|
||||||
|
|
||||||
@@ -38,5 +39,22 @@ leimnud.event.add(fieldName, 'change', {method:dynaformVerifyFieldName, instance
|
|||||||
function cancel(){
|
function cancel(){
|
||||||
currentPopupWindow.remove();
|
currentPopupWindow.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var jsEditorPrompt = CodeMirror.fromTextArea('form[PME_CODE]', {
|
||||||
|
height: "200px",
|
||||||
|
width: "440px",
|
||||||
|
parserfile: ["tokenizejavascript.js", "parsejavascript.js"],
|
||||||
|
stylesheet: ["css/jscolors.css"],
|
||||||
|
path: "js/",
|
||||||
|
lineNumbers: true,
|
||||||
|
continuousScanning: 500
|
||||||
|
});
|
||||||
|
|
||||||
|
function saveJavascript()
|
||||||
|
{
|
||||||
|
jsEditorPrompt.setCode(jsEditorPrompt.getCode());
|
||||||
|
jsEditorPrompt.save();
|
||||||
|
}
|
||||||
|
|
||||||
]]></PME_JS>
|
]]></PME_JS>
|
||||||
</dynaForm>
|
</dynaForm>
|
||||||
Reference in New Issue
Block a user