Merge pull request #1129 from julceslauhub/master
BUG 9549 Changes reverted
This commit is contained in:
@@ -265,50 +265,6 @@ var dynaformEditor={
|
||||
url='dynaforms_Saveas';
|
||||
popupWindow('Save as', url+'?DYN_UID='+this.dynUid+'&AA='+this.A , 500, 350);
|
||||
},
|
||||
importForm:function(){
|
||||
panelImportDyna = new leimnud.module.panel();
|
||||
panelImportDyna.options={
|
||||
limit : true,
|
||||
size : {w:650,h:160},
|
||||
position : {x:0,y:0,center:true},
|
||||
title : '',
|
||||
theme : 'processmaker',
|
||||
statusBar: false,
|
||||
control : {drag:false,resize:true,close:false},
|
||||
fx : {opacity:true,rolled:false,modal:true}
|
||||
};
|
||||
panelImportDyna.setStyle = {modal: {
|
||||
backgroundColor: 'white'
|
||||
}};
|
||||
panelImportDyna.make();
|
||||
panelImportDyna.addContent('<div id="importAjax" align="center"><img src="/images/ext/default/grid/loading.gif" /></div>');
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : '../dynaforms/fieldsHandlerAjax',
|
||||
async : false,
|
||||
method: 'POST',
|
||||
args : 'request=showImportForm' + '&DYN_UID=' + this.dynUid
|
||||
});
|
||||
oRPC.make();
|
||||
document.getElementById('importAjax').style.display = 'none';
|
||||
panelImportDyna.addContent(oRPC.xmlhttp.responseText);
|
||||
},
|
||||
importation:function(uidDynaSelect){
|
||||
document.getElementById('importAjax').style.display = 'block';
|
||||
document.getElementById('importForm').style.display = 'none';
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : '../dynaforms/fieldsHandlerAjax',
|
||||
async : false,
|
||||
method: 'POST',
|
||||
args : 'request=importation' + '&DYN_UID=' + this.dynUid + '&FILE=' + uidDynaSelect
|
||||
});
|
||||
oRPC.make();
|
||||
resp = oRPC.xmlhttp.responseText;
|
||||
if (resp == 'success') {
|
||||
location.reload(true);
|
||||
} else {
|
||||
alert("Error: " + resp);
|
||||
}
|
||||
},
|
||||
close:function()
|
||||
{
|
||||
if (!sessionPersits()) {
|
||||
|
||||
@@ -94,118 +94,6 @@ switch ($request) {
|
||||
$o->remove( '___pm_boot_strap___' );
|
||||
}
|
||||
break;
|
||||
case 'showImportForm':
|
||||
require_once 'classes/model/Dynaform.php';
|
||||
require_once 'classes/model/Content.php';
|
||||
$uidDynafom = $_POST['DYN_UID'];
|
||||
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->clearSelectColumns();
|
||||
$oCriteria->addSelectColumn( DynaformPeer::DYN_FILENAME );
|
||||
$oCriteria->addAsColumn( 'DYNA_NAME', 'C_DYNA.CON_VALUE' );
|
||||
$oCriteria->addAsColumn( 'PROC_NAME', 'C_PROC.CON_VALUE' );
|
||||
|
||||
$oCriteria->addAlias("C_DYNA", "CONTENT");
|
||||
$oCriteria->addAlias("C_PROC", "CONTENT");
|
||||
|
||||
$arrayCondition = array();
|
||||
$arrayCondition[] = array(DynaformPeer::DYN_UID, "C_DYNA.CON_ID");
|
||||
$oCriteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
|
||||
|
||||
$arrayCondition = array();
|
||||
$arrayCondition[] = array(DynaformPeer::PRO_UID, "C_PROC.CON_ID");
|
||||
$oCriteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
|
||||
|
||||
$oCriteria->add( 'C_DYNA.CON_LANG', SYS_LANG );
|
||||
$oCriteria->add( 'C_DYNA.CON_CATEGORY', 'DYN_TITLE' );
|
||||
|
||||
$oCriteria->add( 'C_PROC.CON_LANG', SYS_LANG );
|
||||
$oCriteria->add( 'C_PROC.CON_CATEGORY', 'PRO_TITLE' );
|
||||
|
||||
$oCriteria->add( DynaformPeer::DYN_UID, $uidDynafom, Criteria::NOT_EQUAL);
|
||||
|
||||
$oCriteria->addAscendingOrderByColumn ('PROC_NAME');
|
||||
$oCriteria->addAscendingOrderByColumn ('DYNA_NAME');
|
||||
$oDataset = DynaformPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
|
||||
$select = '<select name="form[IMPORT_DYNA]" id="form[IMPORT_DYNA]" width="600" style="width: 600px" class="module_app_input___gray">';
|
||||
$selectGroup = '';
|
||||
while (is_array( $aRow )) {
|
||||
if ($selectGroup != $aRow['PROC_NAME']) {
|
||||
if ($selectGroup != '') {
|
||||
$select .= '</optgroup>';
|
||||
}
|
||||
$selectGroup = $aRow['PROC_NAME'];
|
||||
$select .= '<optgroup label="' . $aRow['PROC_NAME'] . '">';
|
||||
}
|
||||
$select .= '<option value="' . $aRow['DYN_FILENAME'] . '">' . $aRow['DYNA_NAME'] . '</option>';
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
}
|
||||
|
||||
$select .= '</optgroup></select>';
|
||||
$html = '<div id="importForm"><table width="100%" cellspacing="3" cellpadding="3" border="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="" colspan="2" style="background: none repeat scroll 0 0 #E0E7EF; border-bottom: 1px solid #C3D1DF;
|
||||
color: #000000; font-weight: bold; padding-left: 5px; text-shadow: 0 1px 0 #FFFFFF;
|
||||
font: 8px">
|
||||
<span>' . G::LoadTranslation('ID_SELECT_DYNAFORM_IMPORT') . '</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="font: 11px/180% sans-serif,MiscFixed; color: #808080; text-align: right;">
|
||||
<label for="form[IMPORT_DYNA]">' . G::LoadTranslation('ID_DYNAFORM') . '</label>
|
||||
</td>
|
||||
<td width="75%" class="FormFieldContent">' . $select . '
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan="2" class="FormButton">
|
||||
<input type="button" onclick="if (confirm('' . G::LoadTranslation('ID_CONFIRM_IMPORT_DYNAFORM') . '')) { dynaformEditor.importation(document.getElementById('form[IMPORT_DYNA]').value); }" value="' . G::LoadTranslation('ID_IMPORT') . '" class="module_app_button___gray " style="">
|
||||
<input type="button" onclick="panelImportDyna.remove();" value="' . G::LoadTranslation('ID_CANCEL') . '" class="module_app_button___gray " style="">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table><div>';
|
||||
echo $html;
|
||||
break;
|
||||
case 'importation':
|
||||
require_once 'classes/model/Dynaform.php';
|
||||
$uidDynafom = $_POST['DYN_UID'];
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->clearSelectColumns();
|
||||
$oCriteria->addSelectColumn( DynaformPeer::DYN_FILENAME );
|
||||
$oCriteria->add( DynaformPeer::DYN_UID, $uidDynafom, Criteria::EQUAL);
|
||||
$oDataset = DynaformPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
$dynaFile = PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml';
|
||||
$importFile = PATH_DYNAFORM . $_POST['FILE'] . '.xml';
|
||||
|
||||
$importFp = fopen ($importFile, "r+");
|
||||
$fileText = fread($importFp, filesize($importFile));
|
||||
fclose ( $importFp );
|
||||
$newFile = str_replace($_POST['FILE'], $aRow['DYN_FILENAME'], $fileText);
|
||||
|
||||
$dynaFileTmp = PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '_tmp0.xml';
|
||||
$dynafmFp = fopen ($dynaFileTmp,"w+");
|
||||
fwrite ( $dynafmFp, $newFile);
|
||||
fclose ( $dynafmFp );
|
||||
|
||||
/*
|
||||
$dynafmFp = fopen ($dynaFile,"w+");
|
||||
fwrite ( $dynafmFp, $newFile);
|
||||
fclose ( $dynafmFp );
|
||||
*/
|
||||
echo 'success';
|
||||
break;
|
||||
default:
|
||||
echo 'no request param.';
|
||||
}
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
<saveasDyna type="toolButton" class="ss_sprite button_toolbar ss_disk_multiple" onclick="dynaformEditor.save_as()" buttonType="class">
|
||||
<en>Save as</en>
|
||||
</saveasDyna>
|
||||
<importDyna type="toolButton" class="ss_sprite button_toolbar ss_application_side_expand" onclick="dynaformEditor.importForm()" buttonType="class">
|
||||
<en>Import</en>
|
||||
</importDyna>
|
||||
<!--.-->
|
||||
<separator2 type="toolButton" file="images/dynamicForm/separatorTable.gif" home="public_html" buttonStyle=""/>
|
||||
<text type="toolButton" class="ss_sprite button_toolbar ss_textfield" onclick="fieldsAdd('text')" buttonType="class">
|
||||
|
||||
Reference in New Issue
Block a user