BUG 8835 In all browsers to choose an output only. Doc or. Pdf Displa... SOLVED
- It was verified that no distinction was being the type of file that was downloaded. - Added code to identify the Tido powerful file so just download and display the correct download link.
This commit is contained in:
@@ -76,8 +76,20 @@ require_once 'classes/model/AppDocument.php';
|
|||||||
$oAppDocument = new AppDocument();
|
$oAppDocument = new AppDocument();
|
||||||
$aFields = $oAppDocument->load($_GET['DOC']);
|
$aFields = $oAppDocument->load($_GET['DOC']);
|
||||||
$aFields['VIEW'] = G::LoadTranslation('ID_OPEN');
|
$aFields['VIEW'] = G::LoadTranslation('ID_OPEN');
|
||||||
$aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
|
switch ($aOD ['OUT_DOC_GENERATE']) {
|
||||||
$aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
|
case 'DOC':
|
||||||
|
$aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
|
||||||
|
break;
|
||||||
|
case 'PDF':
|
||||||
|
$aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
|
||||||
|
break;
|
||||||
|
case 'BOTH':
|
||||||
|
$aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
|
||||||
|
$aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher;
|
$G_PUBLISH = new Publisher;
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewOutputDocumentToRevise', '', G::array_merges($aOD, $aFields), '');
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewOutputDocumentToRevise', '', G::array_merges($aOD, $aFields), '');
|
||||||
//
|
//
|
||||||
@@ -90,53 +102,53 @@ if(!isset($_GET['ex'])) $_GET['ex']=0;
|
|||||||
/*------------------------------ To Revise Routines ---------------------------*/
|
/*------------------------------ To Revise Routines ---------------------------*/
|
||||||
function setSelect()
|
function setSelect()
|
||||||
{
|
{
|
||||||
var ex=<?=$_GET['ex']?>;
|
var ex=<?=$_GET['ex']?>;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
for(i=1; i<50; i++)
|
for(i=1; i<50; i++)
|
||||||
{
|
{
|
||||||
if(i == ex){
|
if(i == ex){
|
||||||
document.getElementById('focus'+i).innerHTML = '<img src="/images/bulletButton.gif" />';
|
document.getElementById('focus'+i).innerHTML = '<img src="/images/bulletButton.gif" />';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
document.getElementById('focus'+i).innerHTML = '';
|
document.getElementById('focus'+i).innerHTML = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e){
|
} catch (e){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toRevisePanel(APP_UID,DEL_INDEX)
|
function toRevisePanel(APP_UID,DEL_INDEX)
|
||||||
{
|
{
|
||||||
oPanel = new leimnud.module.panel();
|
oPanel = new leimnud.module.panel();
|
||||||
oPanel.options = {
|
oPanel.options = {
|
||||||
size :{w:250,h:450},
|
size :{w:250,h:450},
|
||||||
position:{x:0,y:100},
|
position:{x:0,y:100},
|
||||||
title :'',
|
title :'',
|
||||||
theme :"processmaker",
|
theme :"processmaker",
|
||||||
statusBar:false,
|
statusBar:false,
|
||||||
control :{resize:false,roll:false,close:false,drag:true},
|
control :{resize:false,roll:false,close:false,drag:true},
|
||||||
fx :{modal:false,opacity:true,blinkToFront:false,fadeIn:false,drag:true}
|
fx :{modal:false,opacity:true,blinkToFront:false,fadeIn:false,drag:true}
|
||||||
};
|
};
|
||||||
oPanel.events = {
|
oPanel.events = {
|
||||||
remove: function() { delete(oPanel); }.extend(this)
|
remove: function() { delete(oPanel); }.extend(this)
|
||||||
};
|
};
|
||||||
oPanel.make();
|
oPanel.make();
|
||||||
oPanel.loader.show();
|
oPanel.loader.show();
|
||||||
|
|
||||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||||
url : 'cases_Ajax',
|
url : 'cases_Ajax',
|
||||||
method:'post',
|
method:'post',
|
||||||
args: 'action=toRevisePanel&APP_UID='+APP_UID+'&DEL_INDEX='+DEL_INDEX
|
args: 'action=toRevisePanel&APP_UID='+APP_UID+'&DEL_INDEX='+DEL_INDEX
|
||||||
});
|
});
|
||||||
oRPC.callback = function(rpc) {
|
oRPC.callback = function(rpc) {
|
||||||
oPanel.loader.hide();
|
oPanel.loader.hide();
|
||||||
oPanel.addContent(rpc.xmlhttp.responseText);
|
oPanel.addContent(rpc.xmlhttp.responseText);
|
||||||
setSelect();
|
setSelect();
|
||||||
|
|
||||||
}.extend(this);
|
}.extend(this);
|
||||||
oRPC.make();
|
oRPC.make();
|
||||||
}
|
}
|
||||||
|
|
||||||
toRevisePanel('<?=$_SESSION['APPLICATION']?>','<?=$_SESSION['INDEX']?>');
|
toRevisePanel('<?=$_SESSION['APPLICATION']?>','<?=$_SESSION['INDEX']?>');
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
<FILE2 type="phpVariable"/>
|
<FILE2 type="phpVariable"/>
|
||||||
|
|
||||||
|
|
||||||
<APP_DOC_FILENAME1 type="link" value="@#VIEW" link="@#FILE1" target="_blank">
|
<APP_DOC_FILENAME1 type="link" value="@#VIEW" link="@#FILE1" target="_blank">
|
||||||
<en>File (.doc)</en>
|
<en>File (.doc)</en>
|
||||||
</APP_DOC_FILENAME1>
|
</APP_DOC_FILENAME1>
|
||||||
@@ -30,5 +31,15 @@
|
|||||||
<BACK type="button" onclick="history.go(-1);return false;">
|
<BACK type="button" onclick="history.go(-1);return false;">
|
||||||
<en>Back</en>
|
<en>Back</en>
|
||||||
</BACK>
|
</BACK>
|
||||||
|
<JS type="javascript"><![CDATA[
|
||||||
|
if (@@FILE1 == '')
|
||||||
|
{
|
||||||
|
hideRowById('APP_DOC_FILENAME1');
|
||||||
|
}
|
||||||
|
if (@@FILE2 == '')
|
||||||
|
{
|
||||||
|
hideRowById('APP_DOC_FILENAME2');
|
||||||
|
}
|
||||||
|
|
||||||
</dynaForm>
|
]]></JS>
|
||||||
|
</dynaForm>
|
||||||
Reference in New Issue
Block a user