Merged in bugfix/PMC-1094 (pull request #7042)

PMC-1094

Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
Julio Cesar Laura Avendaño
2019-08-26 13:53:07 +00:00
13 changed files with 213 additions and 492 deletions

View File

@@ -67,6 +67,9 @@ workflow/engine/methods/cases/saveFormSupervisor.php
workflow/engine/methods/controls/buscador.php workflow/engine/methods/controls/buscador.php
workflow/engine/methods/dbConnections/genericDbConnections.php workflow/engine/methods/dbConnections/genericDbConnections.php
workflow/engine/methods/login/dbInfo.php workflow/engine/methods/login/dbInfo.php
workflow/engine/methods/messages/messages_List.php
workflow/engine/methods/outputdocs/downloadFile.php
workflow/engine/methods/outputdocs/outputdocs_List.php
workflow/engine/methods/services/processHeartBeat_Ajax.php workflow/engine/methods/services/processHeartBeat_Ajax.php
workflow/engine/methods/services/soap.php workflow/engine/methods/services/soap.php
workflow/engine/methods/services/wsdl.php workflow/engine/methods/services/wsdl.php
@@ -109,5 +112,7 @@ workflow/engine/templates/cases/cases_Step_Pmdynaform_View.html
workflow/engine/templates/login/init.js workflow/engine/templates/login/init.js
workflow/engine/templates/reportTables/mainLoad.php workflow/engine/templates/reportTables/mainLoad.php
workflow/engine/test workflow/engine/test
workflow/engine/xmlform/messages/messages_List.xml
workflow/engine/xmlform/outputdocs/outputdocs_List.xml
workflow/public_html/skins/JSForms.js workflow/public_html/skins/JSForms.js
workflow/public_html/skins/ajax.js workflow/public_html/skins/ajax.js

View File

@@ -38487,60 +38487,6 @@ msgstr "Content"
msgid "[messages/messages_Edit.xml?ACCEPT] Save" msgid "[messages/messages_Edit.xml?ACCEPT] Save"
msgstr "Save" msgstr "Save"
# messages/messages_List.xml?fMESS_TITLE
# messages/messages_List.xml
#: text - fMESS_TITLE
msgid "[messages/messages_List.xml?fMESS_TITLE] Output document"
msgstr "Output document"
# messages/messages_List.xml?MESS_TYPE
# messages/messages_List.xml
#: dropdown - MESS_TYPE
msgid "[messages/messages_List.xml?MESS_TYPE] Type"
msgstr "Type"
# messages/messages_List.xml?MESS_TYPE-HTML
# messages/messages_List.xml
#: dropdown - MESS_TYPE - HTML
msgid "[messages/messages_List.xml?MESS_TYPE-HTML]"
msgstr "HTML"
# messages/messages_List.xml?MESS_TYPE-TEXT
# messages/messages_List.xml
#: dropdown - MESS_TYPE - TEXT
msgid "[messages/messages_List.xml?MESS_TYPE-TEXT]"
msgstr "Plain text"
# messages/messages_List.xml?MESS_TYPE-SMS
# messages/messages_List.xml
#: dropdown - MESS_TYPE - SMS
msgid "[messages/messages_List.xml?MESS_TYPE-SMS]"
msgstr "SMS"
# messages/messages_List.xml?fMESS_DESCRIPTION
# messages/messages_List.xml
#: textarea - fMESS_DESCRIPTION
msgid "[messages/messages_List.xml?fMESS_DESCRIPTION] Content"
msgstr "Content"
# messages/messages_List.xml?EDIT
# messages/messages_List.xml
#: link - EDIT
msgid "[messages/messages_List.xml?EDIT] "
msgstr ""
# messages/messages_List.xml?DELETE
# messages/messages_List.xml
#: link - DELETE
msgid "[messages/messages_List.xml?DELETE] "
msgstr ""
# messages/messages_List.xml?SEARCH
# messages/messages_List.xml
#: button - SEARCH
msgid "[messages/messages_List.xml?SEARCH] Apply Filter"
msgstr "Apply Filter"
# messages/messages_Options.xml?MNU_ADD # messages/messages_Options.xml?MNU_ADD
# messages/messages_Options.xml # messages/messages_Options.xml
#: link - MNU_ADD #: link - MNU_ADD
@@ -38643,42 +38589,6 @@ msgstr "Save"
msgid "[outputdocs/outputdocs_Edit.xml?BTN_CANCEL] Cancel" msgid "[outputdocs/outputdocs_Edit.xml?BTN_CANCEL] Cancel"
msgstr "Cancel" msgstr "Cancel"
# outputdocs/outputdocs_List.xml?OUT_DOC_TITLE
# outputdocs/outputdocs_List.xml
#: text - OUT_DOC_TITLE
msgid "[outputdocs/outputdocs_List.xml?OUT_DOC_TITLE] Output document"
msgstr "Output document"
# outputdocs/outputdocs_List.xml?OUT_DOC_FILENAME
# outputdocs/outputdocs_List.xml
#: text - OUT_DOC_FILENAME
msgid "[outputdocs/outputdocs_List.xml?OUT_DOC_FILENAME] Filename"
msgstr "Filename"
# outputdocs/outputdocs_List.xml?OUT_DOC_DESCRIPTION
# outputdocs/outputdocs_List.xml
#: textarea - OUT_DOC_DESCRIPTION
msgid "[outputdocs/outputdocs_List.xml?OUT_DOC_DESCRIPTION] Description"
msgstr "Description"
# outputdocs/outputdocs_List.xml?EDIT
# outputdocs/outputdocs_List.xml
#: link - EDIT
msgid "[outputdocs/outputdocs_List.xml?EDIT] "
msgstr ""
# outputdocs/outputdocs_List.xml?DELETE
# outputdocs/outputdocs_List.xml
#: link - DELETE
msgid "[outputdocs/outputdocs_List.xml?DELETE] "
msgstr ""
# outputdocs/outputdocs_List.xml?SEARCH
# outputdocs/outputdocs_List.xml
#: button - SEARCH
msgid "[outputdocs/outputdocs_List.xml?SEARCH] Apply Filter"
msgstr "Apply Filter"
# outputdocs/outputdocs_New.xml?TITLE # outputdocs/outputdocs_New.xml?TITLE
# outputdocs/outputdocs_New.xml # outputdocs/outputdocs_New.xml
#: title - TITLE #: title - TITLE

View File

@@ -15,7 +15,7 @@ set_include_path(PATH_PM_ENTERPRISE . PATH_SEPARATOR . get_include_path());
class enterprisePlugin extends PMPlugin class enterprisePlugin extends PMPlugin
{ {
public function enterprisePlugin($sNamespace, $sFilename = null) public function __construct($sNamespace, $sFilename = null)
{ {
$pathPluginTrunk = PATH_CORE . "enterprise"; $pathPluginTrunk = PATH_CORE . "enterprise";

View File

@@ -1,45 +0,0 @@
<?php
/**
* messages_List.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
return $RBAC_Response;
}
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'processes';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_ID_SUB_MENU_SELECTED = 'MESSAGES';
$dbc = new DBConnection();
$ses = new DBSession( $dbc );
//Hardcode: UID of the library by default
$PRO_UID = '746B734DC23311';
$G_PUBLISH = new Publisher();
$Fields = array ('SYS_LANG' => SYS_LANG,'PRO_UID' => $PRO_UID);
$G_PUBLISH->AddContent( 'pagedtable', 'paged-table', 'messages/messages_List', '', $Fields, 'messages_Save' );
G::RenderPage( "publish" );

View File

@@ -1,23 +0,0 @@
<?php
require_once 'classes/model/OutputDocument.php';
$uid = $_SERVER['QUERY_STRING'];
$oOutputDocument = new OutputDocument();
$aFields = $oOutputDocument->load( $uid );
$type = $aFields['OUT_DOC_TYPE'];
if ($type == 'JRXML') {
$extension = 'jrxml';
}
if ($type == 'ACROFORM') {
$extension = 'pdf';
}
$fileJrxml = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension;
$bDownload = true;
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
// $downFileName = ereg_replace('[^A-Za-z0-9_]', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
$downFileName = preg_replace( '/[^A-Za-z0-9_]/i', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
G::streamFile( $fileJrxml, $bDownload, $downFileName );

View File

@@ -86,31 +86,6 @@ try {
G::RenderPage( 'publish', 'blank' ); G::RenderPage( 'publish', 'blank' );
die(); die();
break; break;
case 'JRXML':
break;
case 'ACROFORM':
$type = $aFields['OUT_DOC_TYPE'];
if ($type == 'JRXML') {
$extension = 'jrxml';
}
if ($type == 'ACROFORM') {
$extension = 'pdf';
}
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
// $downFileName = ereg_replace('[^A-Za-z0-9_]', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
$downFileName = preg_replace( '/[^A-Za-z0-9_]/i', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
$filename = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension;
if (file_exists( $filename )) {
$aFields['FILENAME'] = $downFileName;
} else {
$aFields['FILENAME'] = '';
}
$aFields['FILELINK'] = '../outputdocs/downloadFile?' . $aFields['OUT_DOC_UID'];
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'outputdocs/outputdocsUploadFile', '', $aFields, '../outputdocs/uploadFile' );
$G_PUBLISH->AddContent( 'view', 'outputdocs/editJrxml' );
break;
} }
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
} catch (Exception $oException) { } catch (Exception $oException) {

View File

@@ -1,42 +0,0 @@
<?php
/**
* outputdocs_List.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
return $RBAC_Response;
}
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'processes';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_ID_SUB_MENU_SELECTED = 'OUTPUTDOCS';
$dbc = new DBConnection();
$ses = new DBSession( $dbc );
$G_PUBLISH = new Publisher();
$Fields = array ('SYS_LANG' => SYS_LANG);
$G_PUBLISH->AddContent( 'pagedtable', 'paged-table', 'outputdocs/outputdocs_List', '', $Fields, 'outputdocs_Save' );
G::RenderPage( "publish" );

View File

@@ -76,20 +76,20 @@ try {
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower); $G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
$oHeadPublisher = headPublisher::getSingleton(); $oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addScriptCode(' $oHeadPublisher->addScriptCode('
var pb=leimnud.dom.capture("tag.body 0"); var pb=leimnud.dom.capture("tag.body 0");
Sm=new stagesmap(); Sm=new stagesmap();
Sm.options = { Sm.options = {
target : "sm_target", target : "sm_target",
dataServer: "../tracker/tracker_Ajax", dataServer: "../tracker/tracker_Ajax",
uid : "' . $_POST['PRO_UID'] . '", uid : "' . $_POST['PRO_UID'] . '",
lang : "' . SYS_LANG . '", lang : "' . SYS_LANG . '",
theme : "processmaker", theme : "processmaker",
size : {w:"780",h:"540"}, size : {w:"780",h:"540"},
images_dir: "/jscore/processmap/core/images/", images_dir: "/jscore/processmap/core/images/",
rw : true, rw : true,
hideMenu : false hideMenu : false
}; };
Sm.make();'); Sm.make();');
G::RenderPage('publish', 'raw'); G::RenderPage('publish', 'raw');
break; break;
@@ -197,13 +197,13 @@ try {
break; break;
case 'load': case 'load':
$oConnection = Propel::getConnection('workflow'); $oConnection = Propel::getConnection('workflow');
$oStatement = $oConnection->prepareStatement("CREATE TABLE IF NOT EXISTS `STAGE` ( $oStatement = $oConnection->prepareStatement("CREATE TABLE IF NOT EXISTS `STAGE` (
`STG_UID` VARCHAR( 32 ) NOT NULL , `STG_UID` VARCHAR( 32 ) NOT NULL ,
`PRO_UID` VARCHAR( 32 ) NOT NULL , `PRO_UID` VARCHAR( 32 ) NOT NULL ,
`STG_POSX` INT( 11 ) NOT NULL DEFAULT '0', `STG_POSX` INT( 11 ) NOT NULL DEFAULT '0',
`STG_POSY` INT( 11 ) NOT NULL DEFAULT '0', `STG_POSY` INT( 11 ) NOT NULL DEFAULT '0',
`STG_INDEX` INT( 11 ) NOT NULL DEFAULT '0', `STG_INDEX` INT( 11 ) NOT NULL DEFAULT '0',
PRIMARY KEY ( `STG_UID` ) PRIMARY KEY ( `STG_UID` )
);"); );");
$oStatement->executeQuery(); $oStatement->executeQuery();
/** /**

View File

@@ -1,28 +1,27 @@
<?php <?php
if (isset( $_POST['form'] )) if (isset( $_POST['form'] ))
$sValue = $_POST['form']; //For old processmap $sValue = $_POST['form']; //For old processmap
else else
$sValue = $_POST; $sValue = $_POST;
unset( $sValue['SAVE'] ); unset( $sValue['SAVE'] );
if (! isset( $sValue['CT_DERIVATION_HISTORY'] )) { if (! isset( $sValue['CT_DERIVATION_HISTORY'] )) {
$sValue['CT_DERIVATION_HISTORY'] = 0; $sValue['CT_DERIVATION_HISTORY'] = 0;
} }
if (! isset( $sValue['CT_MESSAGE_HISTORY'] )) { if (! isset( $sValue['CT_MESSAGE_HISTORY'] )) {
$sValue['CT_MESSAGE_HISTORY'] = 0; $sValue['CT_MESSAGE_HISTORY'] = 0;
} }
require_once 'classes/model/CaseTracker.php'; require_once 'classes/model/CaseTracker.php';
$oCaseTracker = new CaseTracker(); $oCaseTracker = new CaseTracker();
$oCaseTracker->update( $sValue ); $oCaseTracker->update( $sValue );
$infoProcess = new Process(); $infoProcess = new Process();
$resultProcess = $infoProcess->load($sValue['PRO_UID']); $resultProcess = $infoProcess->load($sValue['PRO_UID']);
if($sValue['CT_DERIVATION_HISTORY'] == 1) { if($sValue['CT_DERIVATION_HISTORY'] == 1) {
$type[] = "Routing History"; $type[] = "Routing History";
} }
if($sValue['CT_MESSAGE_HISTORY'] == 1) { if($sValue['CT_MESSAGE_HISTORY'] == 1) {
$type[] = "Messages History"; $type[] = "Messages History";
} }
G::auditLog('CaseTrackers','Save Case Tracker Properties ('.$sValue['CT_MAP_TYPE'].' - '.implode(', ',$type).') in Process "'.$resultProcess['PRO_TITLE'].'"'); G::auditLog('CaseTrackers','Save Case Tracker Properties ('.$sValue['CT_MAP_TYPE'].' - '.implode(', ',$type).') in Process "'.$resultProcess['PRO_TITLE'].'"');

View File

@@ -1,82 +1,81 @@
<?php <?php
/** /**
* tracker_ShowDocument.php * tracker_ShowDocument.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/ */
require_once ("classes/model/AppDocumentPeer.php"); require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
if (! isset( $_GET['v'] )) { //Load last version of the document if (! isset( $_GET['v'] )) { //Load last version of the document
$docVersion = $oAppDocument->getLastAppDocVersion( $_GET['a'] ); $docVersion = $oAppDocument->getLastAppDocVersion( $_GET['a'] );
} else { } else {
$docVersion = $_GET['v']; $docVersion = $_GET['v'];
} }
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], $docVersion ); $oAppDocument->Fields = $oAppDocument->load( $_GET['a'], $docVersion );
$sAppDocUid = $oAppDocument->getAppDocUid(); $sAppDocUid = $oAppDocument->getAppDocUid();
$iDocVersion = $oAppDocument->getDocVersion(); $iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo( $oAppDocument->getAppDocFilename() ); $info = pathinfo( $oAppDocument->getAppDocFilename() );
$ext = $info['extension']; $ext = $info['extension'];
if (isset( $_GET['b'] )) { if (isset( $_GET['b'] )) {
if ($_GET['b'] == '0') { if ($_GET['b'] == '0') {
$bDownload = false; $bDownload = false;
} else { } else {
$bDownload = true; $bDownload = true;
} }
} else { } else {
$bDownload = true; $bDownload = true;
} }
$realPath = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/' . $sAppDocUid . '_' . $iDocVersion . '.' . $ext; $realPath = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/' . $sAppDocUid . '_' . $iDocVersion . '.' . $ext;
$realPath1 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/' . $sAppDocUid . '.' . $ext; $realPath1 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/' . $sAppDocUid . '.' . $ext;
$sw_file_exists = false; $sw_file_exists = false;
if (file_exists( $realPath )) { if (file_exists( $realPath )) {
$sw_file_exists = true; $sw_file_exists = true;
} elseif (file_exists( $realPath1 )) { } elseif (file_exists( $realPath1 )) {
$sw_file_exists = true; $sw_file_exists = true;
$realPath = $realPath1; $realPath = $realPath1;
} }
if (! $sw_file_exists) { if (! $sw_file_exists) {
$error_message = "'" . $oAppDocument->Fields['APP_DOC_FILENAME'] . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' ); $error_message = "'" . $oAppDocument->Fields['APP_DOC_FILENAME'] . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) { if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
$res['success'] = 'failure'; $res['success'] = 'failure';
$res['message'] = $error_message; $res['message'] = $error_message;
print G::json_encode( $res ); print G::json_encode( $res );
} else { } else {
G::SendMessageText( $error_message, "ERROR" ); G::SendMessageText( $error_message, "ERROR" );
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] ); $backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] ); G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
die(); die();
} }
} else { } else {
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) { if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
$res['success'] = 'success'; $res['success'] = 'success';
$res['message'] = $oAppDocument->Fields['APP_DOC_FILENAME']; $res['message'] = $oAppDocument->Fields['APP_DOC_FILENAME'];
print G::json_encode( $res ); print G::json_encode( $res );
} else { } else {
G::streamFile( $realPath, $bDownload, $oAppDocument->Fields['APP_DOC_FILENAME'] ); G::streamFile( $realPath, $bDownload, $oAppDocument->Fields['APP_DOC_FILENAME'] );
} }
} }

View File

@@ -1,86 +1,85 @@
<?php <?php
/** /**
* cases_ShowOutputDocument.php * cases_ShowOutputDocument.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/ */
/* /*
* Created on 13-02-2008 * Created on 13-02-2008
* *
* @author David Callizaya <davidsantos@colosa.com> * @author David Callizaya <davidsantos@colosa.com>
*/ */
require_once ("classes/model/AppDocumentPeer.php"); require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : NULL ); $oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : NULL );
$sAppDocUid = $oAppDocument->getAppDocUid(); $sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() ); $info = pathinfo( $oAppDocument->getAppDocFilename() );
if (! isset( $_GET['ext'] )) { if (! isset( $_GET['ext'] )) {
$ext = $info['extension']; $ext = $info['extension'];
} else { } else {
if ($_GET['ext'] != '') { if ($_GET['ext'] != '') {
$ext = $_GET['ext']; $ext = $_GET['ext'];
} else { } else {
$ext = $info['extension']; $ext = $info['extension'];
} }
} }
$ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : ''; $ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
if (! $ver) //This code is in the case the outputdocument won't be versioned if (! $ver) //This code is in the case the outputdocument won't be versioned
$ver = '_1'; $ver = '_1';
$realPath = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext; $realPath = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext;
$realPath1 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $info['basename'] . $ver . '.' . $ext; $realPath1 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $info['basename'] . $ver . '.' . $ext;
$realPath2 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $info['basename'] . '.' . $ext; $realPath2 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $info['basename'] . '.' . $ext;
$sw_file_exists = false; $sw_file_exists = false;
if (file_exists( $realPath )) { if (file_exists( $realPath )) {
$sw_file_exists = true; $sw_file_exists = true;
} elseif (file_exists( $realPath1 )) { } elseif (file_exists( $realPath1 )) {
$sw_file_exists = true; $sw_file_exists = true;
$realPath = $realPath1; $realPath = $realPath1;
} elseif (file_exists( $realPath2 )) { } elseif (file_exists( $realPath2 )) {
$sw_file_exists = true; $sw_file_exists = true;
$realPath = $realPath2; $realPath = $realPath2;
} }
if (! $sw_file_exists) { if (! $sw_file_exists) {
$error_message = "'" . $info['basename'] . $ver . '.' . $ext . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' ); $error_message = "'" . $info['basename'] . $ver . '.' . $ext . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) { if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
$res['success'] = 'failure'; $res['success'] = 'failure';
$res['message'] = $error_message; $res['message'] = $error_message;
print G::json_encode( $res ); print G::json_encode( $res );
} else { } else {
G::SendMessageText( $error_message, "ERROR" ); G::SendMessageText( $error_message, "ERROR" );
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] ); $backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] ); G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
die(); die();
} }
} else { } else {
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) { if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
$res['success'] = 'success'; $res['success'] = 'success';
$res['message'] = $info['basename'] . $ver . '.' . $ext; $res['message'] = $info['basename'] . $ver . '.' . $ext;
print G::json_encode( $res ); print G::json_encode( $res );
} else { } else {
G::streamFile( $realPath, true, $info['basename'] . $ver . '.' . $ext ); G::streamFile( $realPath, true, $info['basename'] . $ver . '.' . $ext );
} }
} }
//G::streamFile ( $realPath, true); //G::streamFile ( $realPath, true);

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="dynaforms_List" type="filterform" sql="SELECT *, T.CON_VALUE AS fMESS_TITLE, D.CON_VALUE AS fMESS_DESCRIPTION FROM MESSAGE LEFT JOIN CONTENT as T ON (T.CON_ID=MESS_UID AND T.CON_CATEGORY='MESS_TITLE') LEFT JOIN CONTENT AS D ON (D.CON_ID=MESS_UID AND D.CON_CATEGORY='MESS_DESCRIPTION') WHERE PRO_UID=@@PRO_UID" sqlConnection="" menu="messages/messages_Options" filterForm="messages/messages_List" searchBy="T.CON_VALUE | D.CON_VALUE" width="100%">
<MESS_UID type="hidden" showInTable="0"/>
<fMESS_TITLE type="text" colWidth="200" titleAlign="left" align="left" dataCompareField="T.CON_VALUE" dataCompareType="contains">
<en><![CDATA[Output document]]></en>
</fMESS_TITLE>
<MESS_TYPE type="dropdown" colWidth="120" titleAlign="left" align="left" dataCompareField="TYPE" dataCompareType="=">
<en><![CDATA[Type]]><option name="HTML"><![CDATA[HTML]]></option><option name="TEXT"><![CDATA[Plain text]]></option><option name="SMS"><![CDATA[SMS]]></option></en>
</MESS_TYPE>
<fMESS_DESCRIPTION type="textarea" rows="3" cols="32" colWidth="200" titleAlign="left" align="left" dataCompareField="D.CON_VALUE" dataCompareType="contains">
<en><![CDATA[Content]]></en>
</fMESS_DESCRIPTION>
<EDIT type="link" colWidth="40" value="@G::LoadTranslation(ID_EDIT)" link="#" onclick="messagesEdit(@QMESS_UID);return false;">
<en><![CDATA[]]></en>
</EDIT>
<DELETE type="link" colWidth="40" value="@G::LoadTranslation(ID_DELETE)" link="#" onclick="if (confirm('@G::LoadTranslation(ID_MSG_CONFIRM_DELETE_MESSAGE)')) messagesDelete(@QMESS_UID);return false;">
<en><![CDATA[]]></en>
</DELETE>
<SEARCH type="button" onclick="pagedTableFilter( this.form );" showInTable="0">
<en><![CDATA[Apply Filter]]></en>
</SEARCH>
<PAGED_TABLE_ID type="private" showInTable="0"/>
<JSFILTER type="javascript" replaceTags="1" showInTable="0">
function pagedTableFilter( form ) {
@#PAGED_TABLE_ID.doFilter( form );
}
</JSFILTER>
</dynaForm>

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="dynaforms_List" type="filterform" sql="SELECT *, T.CON_VALUE AS OUT_DOC_TITLE, D.CON_VALUE AS OUT_DOC_DESCRIPTION FROM OUTPUT_DOCUMENT LEFT JOIN CONTENT as T ON (T.CON_ID=OUT_DOC_UID AND T.CON_CATEGORY='OUT_DOC_TITLE') LEFT JOIN CONTENT AS D ON (D.CON_ID=OUT_DOC_UID AND D.CON_CATEGORY='OUT_DOC_DESCRIPTION')" sqlConnection="" menu="outputdocs/outputdocs_Options" filterForm="outputdocs/outputdocs_List" width="100%">
<OUT_DOC_UID type="hidden" showInTable="0"/>
<OUT_DOC_TITLE type="text" colWidth="200" titleAlign="left" align="left" dataCompareField="T.CON_VALUE" dataCompareType="contains">
<en><![CDATA[Output document]]></en>
</OUT_DOC_TITLE>
<OUT_DOC_FILENAME type="text" colWidth="200" titleAlign="left" align="left" dataCompareField="OUT_DOC_FILENAME" dataCompareType="contains">
<en><![CDATA[Filename]]></en>
</OUT_DOC_FILENAME>
<OUT_DOC_DESCRIPTION type="textarea" rows="3" cols="32" colWidth="200" titleAlign="left" align="left" dataCompareField="D.CON_VALUE" dataCompareType="contains">
<en><![CDATA[Description]]></en>
</OUT_DOC_DESCRIPTION>
<EDIT type="link" colWidth="40" value="@G::LoadTranslation(ID_EDIT)" link="#" onclick="outputdocsEdit(@QOUT_DOC_UID);return false;">
<en><![CDATA[]]></en>
</EDIT>
<DELETE type="link" colWidth="40" value="@G::LoadTranslation(ID_DELETE)" link="#" onclick="if (confirm('@G::LoadTranslation(ID_MSG_CONFIRM_DELETE_OUTDOC)')) outputdocsDelete(@QOUT_DOC_UID);return false;">
<en><![CDATA[]]></en>
</DELETE>
<SEARCH type="button" onclick="pagedTableFilter( this.form );" showInTable="0">
<en><![CDATA[Apply Filter]]></en>
</SEARCH>
<PAGED_TABLE_ID type="private" showInTable="0"/>
<JSFILTER type="javascript" replaceTags="1" showInTable="0">
function pagedTableFilter( form ) {
@#PAGED_TABLE_ID.doFilter( form );
}
</JSFILTER>
</dynaForm>