BUG 8765 "Problema al descargar documentos del Processmaker cuando..." SOLVED

- When the plugin is enabled Knowledgetree displays an error when you download the file
- Was added the necessary code to download the file when the plugin Knowledgetree is enabled
- Also added code in the plugin Knowledgetree, for this change to work properly
This commit is contained in:
Victor Saisa Lopez
2012-04-05 17:11:50 -04:00
parent 9a1c3d0b39
commit dbaa10be2d
2 changed files with 68 additions and 2 deletions

View File

@@ -336,7 +336,7 @@ if($limit != 0){
break;
case "INPUT" :
$oInputDocument = new InputDocument ( );
$oInputDocument = new InputDocument();
if ($docUid != - 1) {
if ($oInputDocument->InputExists ( $docUid )) {
$row4 = $oInputDocument->load ( $docUid );
@@ -357,7 +357,42 @@ if($limit != 0){
$downloadLabel = G::LoadTranslation ( 'ID_DOWNLOAD' );
$downloadLabel1 = "";
}
///////
if (!empty($row1["APP_DOC_PLUGIN"])) {
$pluginRegistry = &PMPluginRegistry::getSingleton();
$addonName = $row1["APP_DOC_PLUGIN"];
$fieldValue = "";
if (file_exists(PATH_PLUGINS . $addonName . ".php")) {
$addonDetails = $pluginRegistry->getPluginDetails($addonName . ".php");
if ($addonDetails) {
if ($addonDetails->enabled) {
require_once (PATH_PLUGINS . $addonName . PATH_SEP . "class." . $addonName . ".php");
$addonNameClass = $addonName . "Class";
$objClass = new $addonNameClass();
if (method_exists($objClass, "getNameMethodGetUrlDownload")) {
$addonDetails->sMethodGetUrlDownload = $objClass->getNameMethodGetUrlDownload();
if (!empty($addonDetails->sMethodGetUrlDownload)) {
eval("\$url = \$objClass->" . $addonDetails->sMethodGetUrlDownload . "(\"" . $row1["APP_DOC_UID"] . "\");");
$downloadLink = $url;
$fieldValue = $row1["APP_DOC_PLUGIN"];
}
}
}
}
}
$row1["APP_DOC_PLUGIN"] = $fieldValue;
}
break;
default :
$row4 = array ();
$versioningEnabled = false;

View File

@@ -420,7 +420,33 @@ function openActionDialog( caller, action ) {
fileName=ext_itemgrid.getSelectionModel().getSelected().get('name');
// alert(ext_itemgrid.getSelectionModel().getSelected().get('downloadLink'));
// alert(ext_itemgrid.getSelectionModel().getSelected().get('downloadLabel'));
streamFilefromPM(ext_itemgrid.getSelectionModel().getSelected().get('downloadLink'));
var urlDownload = ext_itemgrid.getSelectionModel().getSelected().get("downloadLink");
if (ext_itemgrid.getSelectionModel().getSelected().get("appDocPlugin") != "") {
messageText = TRANSLATIONS.ID_DOWNLOADING_FILE + " " + ext_itemgrid.getSelectionModel().getSelected().get("name");
statusBarMessage(messageText, true, true);
try {
Ext.destroy(Ext.get("downloadIframe"));
}
catch (e) {
}
Ext.DomHelper.append(document.body, {
tag: "iframe",
id: "downloadIframe",
frameBorder: 0,
width: 0,
height: 0,
css: "display: none; visibility: hidden; height: 0px;",
src: urlDownload
});
}
else {
streamFilefromPM(urlDownload);
}
/*
* if(document.location =
* ext_itemgrid.getSelectionModel().getSelected().get('downloadLink')){
@@ -730,6 +756,8 @@ datastore = new Ext.data.Store({
name : "appDocType"
}, {
name : "appDocCreateDate"
}, {
name : "appDocPlugin"
}, {
name : "appLabel"
}, {
@@ -1128,6 +1156,9 @@ var cm = new Ext.grid.ColumnModel([{
hidden:true
// align : 'right'
// renderer : renderType
}, {
dataIndex: "appDocPlugin",
hidden: true
}, {
header : TRANSLATIONS.ID_TYPE,
dataIndex : 'type',