本文整理汇总了PHP中OutputDocument::load方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputDocument::load方法的具体用法?PHP OutputDocument::load怎么用?PHP OutputDocument::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputDocument
的用法示例。
在下文中一共展示了OutputDocument::load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadTest
function loadTest($aTestData, $aFields)
{
$oOutputDocument = new OutputDocument();
try {
return $oOutputDocument->load($aFields['OUT_DOC_UID']);
} catch (Exception $oError) {
return $oError;
}
}
示例2: getAllGeneratedDocumentsCriteria
//.........这里部分代码省略.........
'DOC_UID' => 'char',
'APP_DOC_COMMENT' => 'char',
'APP_DOC_FILENAME' => 'char',
'APP_DOC_INDEX' => 'integer'
);
$oUser = new Users();
while ($aRow = $oDataset->getRow()) {
$oCriteria2 = new Criteria('workflow');
$oCriteria2->add(AppDelegationPeer::APP_UID, $sApplicationUID);
$oCriteria2->add(AppDelegationPeer::DEL_INDEX, $aRow['DEL_INDEX']);
$oDataset2 = AppDelegationPeer::doSelectRS($oCriteria2);
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset2->next();
$aRow2 = $oDataset2->getRow();
$oTask = new Task();
if ($oTask->taskExists($aRow2['TAS_UID'])) {
$aTask = $oTask->load($aRow2['TAS_UID']);
} else {
$aTask = array('TAS_TITLE' => '(TASK DELETED)');
}
$lastVersion = $oAppDocument->getLastDocVersion($aRow['DOC_UID'], $sApplicationUID);
if ($lastVersion == $aRow['DOC_VERSION']) {
//Only show last document Version
$aAux = $oAppDocument->load($aRow['APP_DOC_UID'], $aRow['DOC_VERSION']);
//Get output Document information
$oOutputDocument = new OutputDocument();
$aGields = $oOutputDocument->load($aRow['DOC_UID']);
//OUTPUTDOCUMENT
$outDocTitle = $aGields['OUT_DOC_TITLE'];
switch ($aGields['OUT_DOC_GENERATE']) {
//G::LoadTranslation(ID_DOWNLOAD)
case "PDF":
$fileDoc = 'javascript:alert("NO DOC")';
示例3: OutputDocument
$result['data'] = $rows;
print G::json_encode($result);
break;
case 'editObjectPermission':
$rows = $oProcessMap->editExtObjectPermission($_GET['pid'], $_GET['op_uid']);
//array_shift($rows);
$tmpData = G::json_encode($rows);
$tmpData = str_replace("\\/", "/", '{success:true,data:' . $tmpData . '}');
// unescape the slashes
$result = $tmpData;
echo $result;
break;
case 'editOutputDocument':
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
$rows = $oOutputDocument->load($_GET['tid']);
$tmpData = G::json_encode($rows);
$tmpData = str_replace("\\/", "/", '{success:true,data:' . $tmpData . '}');
// unescape the slashes
$result = $tmpData;
echo $result;
break;
case 'getReportTables':
$rows = $oProcessMap->getExtReportTables($start, $limit, $_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllReportTableCount();
$result['data'] = $rows;
print G::json_encode($result);
break;
case 'editReportTables':
require_once 'classes/model/ReportTable.php';
$oReportTable = new ReportTable();
示例4: getExtCaseTrackerObjectsCriteria
/**
* getCaseTrackerObjectsCriteria
*
* @param string $sProcessUID
* @return object(Criteria) $oCriteria
*/
public function getExtCaseTrackerObjectsCriteria($start, $limit, $sProcessUID)
{
$aObjects = array();
$aObjects[] = array('CTO_TITLE' => 'char', 'CTO_UID' => 'char', 'CTO_TYPE_OBJ' => 'char', 'CTO_UID_OBJ' => 'char', 'CTO_CONDITION' => 'char', 'CTO_POSITION' => 'integer');
$oCriteria = new Criteria('workflow');
$oCriteria->add(CaseTrackerObjectPeer::PRO_UID, $sProcessUID);
$oCriteria->addAscendingOrderByColumn(CaseTrackerObjectPeer::CTO_POSITION);
$this->tmpCriteria = clone $oCriteria;
if ($start != '') {
$oCriteria->setOffset($start);
}
if ($limit != '') {
$oCriteria->setLimit($limit);
}
$oDataset = CaseTrackerObjectPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
try {
switch ($aRow['CTO_TYPE_OBJ']) {
case 'DYNAFORM':
$oDynaform = new Dynaform();
$aFields = $oDynaform->load($aRow['CTO_UID_OBJ']);
$sTitle = $aFields['DYN_TITLE'];
break;
case 'INPUT_DOCUMENT':
$oInputDocument = new InputDocument();
$aFields = $oInputDocument->load($aRow['CTO_UID_OBJ']);
$sTitle = $aFields['INP_DOC_TITLE'];
break;
case 'OUTPUT_DOCUMENT':
$oOutputDocument = new OutputDocument();
$aFields = $oOutputDocument->load($aRow['CTO_UID_OBJ']);
$sTitle = $aFields['OUT_DOC_TITLE'];
break;
}
$aObjects[] = array('CTO_TITLE' => $sTitle, 'CTO_UID' => $aRow['CTO_UID'], 'CTO_TYPE_OBJ' => $aRow['CTO_TYPE_OBJ'], 'CTO_UID_OBJ' => $aRow['CTO_UID_OBJ'], 'CTO_CONDITION' => $aRow['CTO_CONDITION'], 'CTO_POSITION' => $aRow['CTO_POSITION']);
} catch (Exception $oError) {
//Nothing
}
$oDataset->next();
}
// return $aObjects;
global $_DBArray;
$_DBArray = isset($_SESSION['_DBArray']) ? $_SESSION['_DBArray'] : '';
$_DBArray['objects'] = $aObjects;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('objects');
$oCriteria->addAscendingOrderByColumn('CTO_POSITION');
return $aObjects;
}
示例5: addCasesOutputDocument
/**
* Get data of Cases OutputDocument
*
* @param string $applicationUid
* @param string $outputDocumentUid
* @param string $userUid
*
* return object Return an object with data of an OutputDocument
*/
public function addCasesOutputDocument($applicationUid, $outputDocumentUid, $userUid)
{
try {
$sApplication = $applicationUid;
$index = \AppDelegation::getCurrentIndex($applicationUid);
$sUserLogged = $userUid;
$outputID = $outputDocumentUid;
$g = new \G();
$g->sessionVarSave();
\G::LoadClass( 'case' );
$oCase = new \Cases();
$oCase->thisIsTheCurrentUser( $sApplication, $index, $sUserLogged, '', 'casesListExtJs' );
//require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new \OutputDocument();
$aOD = $oOutputDocument->load( $outputID );
$Fields = $oCase->loadCase( $sApplication );
$sFilename = preg_replace( '[^A-Za-z0-9_]', '_', \G::replaceDataField( $aOD['OUT_DOC_FILENAME'], $Fields['APP_DATA'] ) );
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "AppFolder.php");
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "AppDocument.php");
//Get the Custom Folder ID (create if necessary)
$oFolder = new \AppFolder();
$folderId = $oFolder->createFromPath( $aOD['OUT_DOC_DESTINATION_PATH'], $sApplication );
//Tags
$fileTags = $oFolder->parseTags( $aOD['OUT_DOC_TAGS'], $sApplication );
//Get last Document Version and apply versioning if is enabled
$oAppDocument = new \AppDocument();
$lastDocVersion = $oAppDocument->getLastDocVersion( $outputID, $sApplication );
$oCriteria = new \Criteria( 'workflow' );
$oCriteria->add( \AppDocumentPeer::APP_UID, $sApplication );
$oCriteria->add( \AppDocumentPeer::DOC_UID, $outputID );
$oCriteria->add( \AppDocumentPeer::DOC_VERSION, $lastDocVersion );
$oCriteria->add( \AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT' );
$oDataset = \AppDocumentPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
if (($aOD['OUT_DOC_VERSIONING']) && ($lastDocVersion != 0)) {
//Create new Version of current output
$lastDocVersion ++;
if ($aRow = $oDataset->getRow()) {
$aFields = array ('APP_DOC_UID' => $aRow['APP_DOC_UID'],'APP_UID' => $sApplication,'DEL_INDEX' => $index,'DOC_UID' => $outputID,'DOC_VERSION' => $lastDocVersion + 1,'USR_UID' => $sUserLogged,'APP_DOC_TYPE' => 'OUTPUT','APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_FILENAME' => $sFilename,'FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags);
$oAppDocument = new \AppDocument();
$oAppDocument->create( $aFields );
$sDocUID = $aRow['APP_DOC_UID'];
}
} else {
////No versioning so Update a current Output or Create new if no exist
if ($aRow = $oDataset->getRow()) {
//Update
$aFields = array ('APP_DOC_UID' => $aRow['APP_DOC_UID'],'APP_UID' => $sApplication,'DEL_INDEX' => $index,'DOC_UID' => $outputID,'DOC_VERSION' => $lastDocVersion,'USR_UID' => $sUserLogged,'APP_DOC_TYPE' => 'OUTPUT','APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_FILENAME' => $sFilename,'FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
);
$oAppDocument = new \AppDocument();
$oAppDocument->update( $aFields );
$sDocUID = $aRow['APP_DOC_UID'];
} else {
//we are creating the appdocument row
//create
if ($lastDocVersion == 0) {
$lastDocVersion ++;
}
$aFields = array ('APP_UID' => $sApplication,'DEL_INDEX' => $index,'DOC_UID' => $outputID,'DOC_VERSION' => $lastDocVersion,'USR_UID' => $sUserLogged,'APP_DOC_TYPE' => 'OUTPUT','APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_FILENAME' => $sFilename,'FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
);
$oAppDocument = new \AppDocument();
$aFields['APP_DOC_UID'] = $sDocUID = $oAppDocument->create( $aFields );
}
}
$sFilename = $aFields['APP_DOC_UID'] . "_" . $lastDocVersion;
$pathOutput = PATH_DOCUMENT . \G::getPathFromUID($sApplication) . PATH_SEP . 'outdocs' . PATH_SEP; //G::pr($sFilename);die;
\G::mk_dir( $pathOutput );
$aProperties = array ();
if (! isset( $aOD['OUT_DOC_MEDIA'] )) {
$aOD['OUT_DOC_MEDIA'] = 'Letter';
}
if (! isset( $aOD['OUT_DOC_LEFT_MARGIN'] )) {
$aOD['OUT_DOC_LEFT_MARGIN'] = '15';
}
if (! isset( $aOD['OUT_DOC_RIGHT_MARGIN'] )) {
$aOD['OUT_DOC_RIGHT_MARGIN'] = '15';
}
if (! isset( $aOD['OUT_DOC_TOP_MARGIN'] )) {
$aOD['OUT_DOC_TOP_MARGIN'] = '15';
}
if (! isset( $aOD['OUT_DOC_BOTTOM_MARGIN'] )) {
$aOD['OUT_DOC_BOTTOM_MARGIN'] = '15';
}
$aProperties['media'] = $aOD['OUT_DOC_MEDIA'];
$aProperties['margins'] = array ('left' => $aOD['OUT_DOC_LEFT_MARGIN'],'right' => $aOD['OUT_DOC_RIGHT_MARGIN'],'top' => $aOD['OUT_DOC_TOP_MARGIN'],'bottom' => $aOD['OUT_DOC_BOTTOM_MARGIN']
);
if (isset($aOD['OUT_DOC_REPORT_GENERATOR'])) {
$aProperties['report_generator'] = $aOD['OUT_DOC_REPORT_GENERATOR'];
}
$this->generate( $outputID, $Fields['APP_DATA'], $pathOutput, $sFilename, $aOD['OUT_DOC_TEMPLATE'], (boolean) $aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'], $aProperties , $applicationUid);
//.........这里部分代码省略.........
示例6: getCompleteDocumentInfo
public function getCompleteDocumentInfo ($appUid, $appDocUid, $docVersion, $docUid, $usrId)
{
//require_once ("classes/model/AppDocument.php");
//require_once ("classes/model/InputDocument.php");
//require_once ("classes/model/OutputDocument.php");
//require_once ("classes/model/Users.php");
//**** start get Doc Info
$oApp = new Application();
$oAppDocument = new AppDocument();
G::LoadClass( 'case' );
$oCase = new Cases();
G::LoadClass( 'process' );
$oProcess = new Process();
if (($oApp->exists( $appUid )) || ($appUid == "00000000000000000000000000000000")) {
if ($appUid == "00000000000000000000000000000000") {
//External Files
$row1 = $oAppDocument->load( $appDocUid, $docVersion );
$row2 = array ('PRO_TITLE' => G::LoadTranslation( 'ID_NOT_PROCESS_RELATED' ));
$row3 = array ('APP_TITLE' => G::LoadTranslation( 'ID_NOT_PROCESS_RELATED' ));
} else {
$row1 = $oAppDocument->load( $appDocUid, $docVersion );
$row2 = $oCase->loadCase( $appUid );
$row3 = $oProcess->Load( $row2['PRO_UID'] );
}
$lastVersion = $oAppDocument->getLastAppDocVersion( $appDocUid, $appUid );
switch ($row1['APP_DOC_TYPE']) {
case "OUTPUT":
$oOutputDocument = new OutputDocument();
$row4 = array();
$swOutDocExists = 0;
if ($oOutputDocument->OutputExists($docUid)) {
$row4 = $oOutputDocument->load($docUid);
$swOutDocExists = 1;
}
if ($swOutDocExists == 0) {
$swpdf = 0;
$swdoc = 0;
$info = pathinfo($oAppDocument->getAppDocFilename());
$version = (!empty($docVersion))? "_" . $docVersion : "_1";
$outDocPath = PATH_DOCUMENT . G::getPathFromUID($row1["APP_UID"]) . PATH_SEP . "outdocs" . PATH_SEP;
if (file_exists($outDocPath . $appDocUid . $version . ".pdf") ||
file_exists($outDocPath . $info["basename"] . $version . ".pdf") ||
file_exists($outDocPath . $info["basename"] . ".pdf")
) {
$swpdf = 1;
}
if (file_exists($outDocPath . $appDocUid . $version . ".doc") ||
file_exists($outDocPath . $info["basename"] . $version . ".doc") ||
file_exists($outDocPath . $info["basename"] . ".doc")
) {
$swdoc = 1;
}
if ($swpdf == 1 && $swdoc == 1) {
$row4["OUT_DOC_GENERATE"] = "BOTH";
} else {
if ($swpdf == 1) {
$row4["OUT_DOC_GENERATE"] = "PDF";
} else {
if ($swdoc == 1) {
$row4["OUT_DOC_GENERATE"] = "DOC";
} else {
$row4["OUT_DOC_GENERATE"] = "NOFILE";
}
}
}
}
$versioningEnabled = false; //$row4['OUT_DOC_VERSIONING']; //Only enabled for Input or Attached documents. Need to study the best way for Output docs.
switch ($row4['OUT_DOC_GENERATE']) {
case "PDF":
$downloadLink = "../cases/cases_ShowOutputDocument?a=" . $appDocUid . "&v=" . $docVersion . "&ext=pdf" . "&random=" . rand();
$downloadLink1 = "";
$downloadLabel = ".pdf";
$downloadLabel1 = "";
break;
case "DOC":
$downloadLink = "../cases/cases_ShowOutputDocument?a=" . $appDocUid . "&v=" . $docVersion . "&ext=doc" . "&random=" . rand();
$downloadLink1 = "";
$downloadLabel = ".doc";
$downloadLabel1 = "";
break;
case "BOTH":
$downloadLink = "../cases/cases_ShowOutputDocument?a=" . $appDocUid . "&v=" . $docVersion . "&ext=pdf" . "&random=" . rand();
$downloadLink1 = "../cases/cases_ShowOutputDocument?a=" . $appDocUid . "&v=" . $docVersion . "&ext=doc" . "&random=" . rand();
$downloadLabel = ".pdf";
$downloadLabel1 = ".doc";
break;
case "NOFILE":
$downloadLink = "../cases/cases_ShowDocument?a=" . $appDocUid . "&v=" . $docVersion;
//.........这里部分代码省略.........
示例7: OutputDocument
<?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);
示例8: foreach
$i = 0;
$GRID = $APP_DATA['REPORT_GRID'];
foreach ($GRID as $row) {
$i++;
$cadena = $cadena . '<tr><td class="FormCellTable"><font size="7">' . $i . '</font></td>';
foreach ($row as $key => $dato) {
if (strpos($key, "label") == false) {
$cadena = $cadena . '<td class="FormCellTable"><font size="7">' . $dato . '</font></td>';
}
}
$cadena = $cadena . '</tr>';
}
$APP_DATA['GRID_TABLE'] = $cadena;
################################## Generate documents####################################################################
$oOutputDocument = new OutputDocument();
$aOD = $oOutputDocument->load($uidOuput);
$sFilename = ereg_replace('[^A-Za-z0-9_]', '_', G::replaceDataField($aOD['OUT_DOC_FILENAME'], $APP_DATA));
if ($sFilename == '') {
$sFilename = '_';
}
$pathOutput = PATH_DOCUMENT . $appuid . PATH_SEP . 'outdocs' . PATH_SEP;
G::mk_dir($pathOutput);
$aProperties = array();
if (!isset($aOD['OUT_DOC_MEDIA'])) {
$aOD['OUT_DOC_MEDIA'] = 'Letter';
}
if (!isset($aOD['OUT_DOC_LEFT_MARGIN'])) {
$aOD['OUT_DOC_LEFT_MARGIN'] = '10';
}
if (!isset($aOD['OUT_DOC_RIGHT_MARGIN'])) {
$aOD['OUT_DOC_RIGHT_MARGIN'] = '10';
示例9: OutputDocument
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
require_once 'classes/model/OutputDocument.php';
require_once 'classes/model/ObjectPermission.php';
require_once 'classes/model/Step.php';
G::LoadClass('processMap');
$oOutputDocument = new OutputDocument();
$fields = $oOutputDocument->load($_POST['OUT_DOC_UID']);
$oOutputDocument->remove($_POST['OUT_DOC_UID']);
$oStep = new Step();
$oStep->removeStep('OUTPUT_DOCUMENT', $_POST['OUT_DOC_UID']);
$oOP = new ObjectPermission();
$oOP->removeByObject('OUTPUT', $_POST['OUT_DOC_UID']);
//refresh dbarray with the last change in outputDocument
$oMap = new processMap();
$oCriteria = $oMap->getOutputDocumentsCriteria($fields['PRO_UID']);
$result->success = true;
$result->msg = G::LoadTranslation('ID_OUTPUTDOCUMENT_REMOVED');
} catch (Exception $e) {
$result->success = false;
$result->msg = $e->getMessage();
//die($oException->getMessage());
}
示例10: PMFGenerateOutputDocument
/**
*
* @method
*
* Generates an Output Document
*
* @name PMFGenerateOutputDocument
* @label PMF Generate Output Document
*
* @param string(32) | $outputID | Output ID | Output Document ID
* @return none | $none | None | None
*
*/
function PMFGenerateOutputDocument($outputID, $sApplication = null, $index = null, $sUserLogged = null)
{
$g = new G();
$g->sessionVarSave();
if ($sApplication) {
$_SESSION["APPLICATION"] = $sApplication;
} else {
$sApplication = $_SESSION["APPLICATION"];
}
if ($index) {
$_SESSION["INDEX"] = $index;
} else {
$index = $_SESSION["INDEX"];
}
if ($sUserLogged) {
$_SESSION["USER_LOGGED"] = $sUserLogged;
} else {
$sUserLogged = $_SESSION["USER_LOGGED"];
}
G::LoadClass('case');
$oCase = new Cases();
$oCase->thisIsTheCurrentUser($sApplication, $index, $sUserLogged, '', 'casesListExtJs');
//require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
$aOD = $oOutputDocument->load($outputID);
$Fields = $oCase->loadCase($sApplication);
//The $_GET['UID'] variable is used when a process executes.
//$_GET['UID']=($aOD['OUT_DOC_VERSIONING'])?$_GET['UID']:$aOD['OUT_DOC_UID'];
//$sUID = ($aOD['OUT_DOC_VERSIONING'])?$_GET['UID']:$aOD['OUT_DOC_UID'];
$sFilename = preg_replace('[^A-Za-z0-9_]', '_', G::replaceDataField($aOD['OUT_DOC_FILENAME'], $Fields['APP_DATA']));
require_once 'classes/model/AppFolder.php';
require_once 'classes/model/AppDocument.php';
//Get the Custom Folder ID (create if necessary)
$oFolder = new AppFolder();
//$aOD['OUT_DOC_DESTINATION_PATH'] = ($aOD['OUT_DOC_DESTINATION_PATH']=='')?PATH_DOCUMENT
// . $_SESSION['APPLICATION'] . PATH_SEP . 'outdocs'. PATH_SEP:$aOD['OUT_DOC_DESTINATION_PATH'];
$folderId = $oFolder->createFromPath($aOD['OUT_DOC_DESTINATION_PATH'], $sApplication);
//Tags
$fileTags = $oFolder->parseTags($aOD['OUT_DOC_TAGS'], $sApplication);
//Get last Document Version and apply versioning if is enabled
$oAppDocument = new AppDocument();
$lastDocVersion = $oAppDocument->getLastDocVersion($outputID, $sApplication);
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDocumentPeer::APP_UID, $sApplication);
//$oCriteria->add(AppDocumentPeer::DEL_INDEX, $index);
$oCriteria->add(AppDocumentPeer::DOC_UID, $outputID);
$oCriteria->add(AppDocumentPeer::DOC_VERSION, $lastDocVersion);
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT');
$oDataset = AppDocumentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
if ($aOD['OUT_DOC_VERSIONING'] && $lastDocVersion != 0) {
//Create new Version of current output
$lastDocVersion++;
if ($aRow = $oDataset->getRow()) {
$aFields = array('APP_DOC_UID' => $aRow['APP_DOC_UID'], 'APP_UID' => $sApplication, 'DEL_INDEX' => $index, 'DOC_UID' => $outputID, 'DOC_VERSION' => $lastDocVersion + 1, 'USR_UID' => $sUserLogged, 'APP_DOC_TYPE' => 'OUTPUT', 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), 'APP_DOC_FILENAME' => $sFilename, 'FOLDER_UID' => $folderId, 'APP_DOC_TAGS' => $fileTags);
$oAppDocument = new AppDocument();
$oAppDocument->create($aFields);
$sDocUID = $aRow['APP_DOC_UID'];
}
} else {
////No versioning so Update a current Output or Create new if no exist
if ($aRow = $oDataset->getRow()) {
//Update
$aFields = array('APP_DOC_UID' => $aRow['APP_DOC_UID'], 'APP_UID' => $sApplication, 'DEL_INDEX' => $index, 'DOC_UID' => $outputID, 'DOC_VERSION' => $lastDocVersion, 'USR_UID' => $sUserLogged, 'APP_DOC_TYPE' => 'OUTPUT', 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), 'APP_DOC_FILENAME' => $sFilename, 'FOLDER_UID' => $folderId, 'APP_DOC_TAGS' => $fileTags);
$oAppDocument = new AppDocument();
$oAppDocument->update($aFields);
$sDocUID = $aRow['APP_DOC_UID'];
} else {
//we are creating the appdocument row
//create
if ($lastDocVersion == 0) {
$lastDocVersion++;
}
$aFields = array('APP_UID' => $sApplication, 'DEL_INDEX' => $index, 'DOC_UID' => $outputID, 'DOC_VERSION' => $lastDocVersion, 'USR_UID' => $sUserLogged, 'APP_DOC_TYPE' => 'OUTPUT', 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), 'APP_DOC_FILENAME' => $sFilename, 'FOLDER_UID' => $folderId, 'APP_DOC_TAGS' => $fileTags);
$oAppDocument = new AppDocument();
$aFields['APP_DOC_UID'] = $sDocUID = $oAppDocument->create($aFields);
}
}
$sFilename = $aFields['APP_DOC_UID'] . "_" . $lastDocVersion;
$pathOutput = PATH_DOCUMENT . G::getPathFromUID($sApplication) . PATH_SEP . 'outdocs' . PATH_SEP;
//G::pr($sFilename);die;
G::mk_dir($pathOutput);
$aProperties = array();
if (!isset($aOD['OUT_DOC_MEDIA'])) {
$aOD['OUT_DOC_MEDIA'] = 'Letter';
}
//.........这里部分代码省略.........
示例11: create
/**
* Create the application document registry
*
* @param array $aData
* @return string
*
*/
public function create ($aData)
{
$oConnection = Propel::getConnection( AppDocumentPeer::DATABASE_NAME );
try {
$oAppDocument = new AppDocument();
if (! isset( $aData['APP_DOC_UID'] )) {
$sUID = G::generateUniqueID();
$docVersion = 1;
} else {
$sUID = $aData['APP_DOC_UID'];
$docVersion = $this->getLastAppDocVersion( $aData['APP_DOC_UID'], $oAppDocument->getAppUid() );
$oAppDocument->load( $aData['APP_DOC_UID'], $docVersion );
switch ($oAppDocument->getAppDocType()) {
case "OUTPUT": //Output versioning
$o = new OutputDocument();
$oOutputDocument = $o->load( $oAppDocument->getDocUid() );
if (! $oOutputDocument['OUT_DOC_VERSIONING']) {
throw (new Exception( 'The Output document has not versioning enabled!' ));
}
break;
case "INPUT": // Input versioning
$o = new InputDocument();
$oInputDocument = $o->load( $oAppDocument->getDocUid() );
if (! $oInputDocument['INP_DOC_VERSIONING']) {
throw (new Exception( 'This Input document does not have the versioning enabled, for this reason this operation cannot be completed' ));
}
break;
default: //Not a valid type
throw (new Exception( 'The document is not of a valid Type' ));
break;
}
$docVersion ++;
}
$oAppDocument->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
$oAppDocument->setDocVersion( $docVersion );
$oAppDocument->setAppDocUid( $sUID );
$oAppDocument->setAppDocIndex( $this->getLastIndex( $oAppDocument->getAppUid() ) + 1 );
if ($oAppDocument->validate()) {
$oConnection->begin();
if (isset( $aData['APP_DOC_TITLE'] )) {
$oAppDocument->setAppDocTitle( $aData['APP_DOC_TITLE'] );
}
if (isset( $aData['APP_DOC_COMMENT'] )) {
$oAppDocument->setAppDocComment( $aData['APP_DOC_COMMENT'] );
}
if (isset( $aData['APP_DOC_FILENAME'] )) {
$oAppDocument->setAppDocFilename( $aData['APP_DOC_FILENAME'] );
}
$iResult = $oAppDocument->save();
$oConnection->commit();
$this->fromArray( $oAppDocument->toArray( BasePeer::TYPE_FIELDNAME ), BasePeer::TYPE_FIELDNAME );
return $sUID;
} else {
$sMessage = '';
$aValidationFailures = $oAppDocument->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw (new Exception( 'The registry cannot be created!<br />' . $sMessage ));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
示例12: Dynaform
case 'DYNAFORM':
require_once 'classes/model/Dynaform.php';
$oObject = new Dynaform();
$aFields = $oObject->load($aRow['STEP_UID_OBJ']);
$aRow['STEP_NAME'] = $aFields['DYN_TITLE'];
break;
case 'INPUT_DOCUMENT':
require_once 'classes/model/InputDocument.php';
$oObject = new InputDocument();
$aFields = $oObject->load($aRow['STEP_UID_OBJ']);
$aRow['STEP_NAME'] = $aFields['INP_DOC_TITLE'];
break;
case 'OUTPUT_DOCUMENT':
require_once 'classes/model/OutputDocument.php';
$oObject = new OutputDocument();
$aFields = $oObject->load($aRow['STEP_UID_OBJ']);
$aRow['STEP_NAME'] = $aFields['OUT_DOC_TITLE'];
break;
case 'EXTERNAL':
$aRow['STEP_NAME'] = 'unknown ' . $aRow['STEP_UID'];
foreach ($externalSteps as $key => $val) {
if ($val->sStepId == $aRow['STEP_UID_OBJ']) {
$aRow['STEP_NAME'] = $val->sStepTitle;
}
}
break;
}
$oCriteria = $oProcessMap->getStepTriggersCriteria($aRow['STEP_UID'], $_SESSION['TASK'], 'BEFORE');
$iCantidad1 = StepTriggerPeer::doCount($oCriteria);
$oCriteria = $oProcessMap->getStepTriggersCriteria($aRow['STEP_UID'], $_SESSION['TASK'], 'AFTER');
$iCantidad2 = StepTriggerPeer::doCount($oCriteria);
示例13: getDynaformHistory
public function getDynaformHistory($PRO_UID, $TAS_UID, $APP_UID, $DYN_UID = "")
{
G::LoadClass('case');
$oCase = new Cases();
$oCase->verifyTable();
$aObjectPermissions = $oCase->getAllObjects($PRO_UID, $APP_UID, $TAS_UID, $_SESSION['USER_LOGGED']);
if (!is_array($aObjectPermissions)) {
$aObjectPermissions = array('DYNAFORMS' => array(-1), 'INPUT_DOCUMENTS' => array(-1), 'OUTPUT_DOCUMENTS' => array(-1));
}
if (!isset($aObjectPermissions['DYNAFORMS'])) {
$aObjectPermissions['DYNAFORMS'] = array(-1);
} else {
if (!is_array($aObjectPermissions['DYNAFORMS'])) {
$aObjectPermissions['DYNAFORMS'] = array(-1);
}
}
if (!isset($aObjectPermissions['INPUT_DOCUMENTS'])) {
$aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
} else {
if (!is_array($aObjectPermissions['INPUT_DOCUMENTS'])) {
$aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
}
}
if (!isset($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
$aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
} else {
if (!is_array($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
$aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
}
}
$appDocument = new AppDocument();
foreach (array("INPUT_DOCUMENTS", "OUTPUT_DOCUMENTS") as $value) {
$key = $value;
if ($aObjectPermissions[$key]) {
foreach ($aObjectPermissions[$key] as $key2 => $value2) {
$appDocumentUid = $value2;
try {
$arrayAppDocumentData = $appDocument->load($appDocumentUid);
$aObjectPermissions[$key][$key2] = $arrayAppDocumentData["DOC_UID"];
} catch (Exception $e) {
}
}
}
}
$dynaForm = new Dynaform();
$inputDocument = new InputDocument();
$outputDocument = new OutputDocument();
$c = new Criteria('workflow');
$c->addSelectColumn(AppHistoryPeer::APP_UID);
$c->addSelectColumn(AppHistoryPeer::DEL_INDEX);
$c->addSelectColumn(AppHistoryPeer::PRO_UID);
$c->addSelectColumn(AppHistoryPeer::TAS_UID);
$c->addSelectColumn(AppHistoryPeer::DYN_UID);
$c->addSelectColumn(AppHistoryPeer::OBJ_TYPE);
$c->addSelectColumn(AppHistoryPeer::USR_UID);
$c->addSelectColumn(AppHistoryPeer::APP_STATUS);
$c->addSelectColumn(AppHistoryPeer::HISTORY_DATE);
$c->addSelectColumn(AppHistoryPeer::HISTORY_DATA);
$c->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$c->addSelectColumn(UsersPeer::USR_LASTNAME);
$c->addAsColumn('USR_NAME', "CONCAT(USR_LASTNAME, ' ', USR_FIRSTNAME)");
$c->addJoin(AppHistoryPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
//WHERE
$c->add($c->getNewCriterion(AppHistoryPeer::DYN_UID, $aObjectPermissions["DYNAFORMS"], Criteria::IN)->addOr($c->getNewCriterion(AppHistoryPeer::DYN_UID, $aObjectPermissions["INPUT_DOCUMENTS"], Criteria::IN))->addOr($c->getNewCriterion(AppHistoryPeer::DYN_UID, $aObjectPermissions["OUTPUT_DOCUMENTS"], Criteria::IN)));
$c->add(AppHistoryPeer::PRO_UID, $PRO_UID);
$c->add(AppHistoryPeer::APP_UID, $APP_UID);
$c->add(AppHistoryPeer::TAS_UID, $TAS_UID);
if (isset($DYN_UID) && $DYN_UID != "") {
$c->add(AppHistoryPeer::DYN_UID, $DYN_UID);
}
//Execute
$oDataset = AppHistoryPeer::doSelectRS($c);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$aDynHistory = array();
$aDynHistory[] = array('DYN_TITLE' => 'char');
while ($oDataset->next()) {
$aRow = $oDataset->getRow();
$title = "";
switch ($aRow["OBJ_TYPE"]) {
case "DYNAFORM":
$arrayDynaFormData = $dynaForm->Load($aRow["DYN_UID"]);
$title = $arrayDynaFormData["DYN_TITLE"] . " (" . G::LoadTranslation("ID_DYNAFORM") . ")";
break;
case "INPUT_DOCUMENT":
$arrayInputDocumentData = $inputDocument->load($aRow["DYN_UID"]);
$title = $arrayInputDocumentData["INP_DOC_TITLE"] . " (" . G::LoadTranslation("ID_INPUT_DOCUMENT") . ")";
break;
case "OUTPUT_DOCUMENT":
$arrayOutputDocumentData = $outputDocument->load($aRow["DYN_UID"]);
$title = $arrayOutputDocumentData["OUT_DOC_TITLE"] . " (" . G::LoadTranslation("ID_OUTPUT_DOCUMENT") . ")";
break;
case "ASSIGN_TASK":
$title = G::LoadTranslation("ID_ASSIGN_TASK") . " (" . G::LoadTranslation("ID_TRIGGERS") . ")";
break;
}
$aRow["DYN_TITLE"] = $title;
$changedValues = unserialize($aRow['HISTORY_DATA']);
$html = "<table border='0' cellpadding='0' cellspacing='0'>";
$sw_add = false;
foreach ($changedValues as $key => $value) {
//.........这里部分代码省略.........
示例14: maborak
var leimnud = new maborak();
leimnud.make();
leimnud.Package.Load("rpc,drag,drop,panel,app,validator,fx,dom,abbr",{Instance:leimnud,Type:"module"});
leimnud.Package.Load("json",{Type:"file"});
leimnud.Package.Load("cases",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases.js"});
leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases_Step.js"});
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){
' . (isset($_SESSION['showCasesWindow']) ? 'try{' . $_SESSION['showCasesWindow'] . '}catch(e){}' : '') . '});
');
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
//
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
$aOD = $oOutputDocument->load($_GET['UID']);
require_once 'classes/model/AppDocument.php';
$oAppDocument = new AppDocument();
$aFields = $oAppDocument->load($_GET['DOC']);
$aFields['VIEW'] = G::LoadTranslation('ID_OPEN');
switch ($aOD['OUT_DOC_GENERATE']) {
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;
示例15: OutputDocument
G::header('location: ../login/login');
die;
break;
}
require_once 'classes/model/OutputDocument.php';
$ooutputDocument = new OutputDocument();
if (isset($_GET['OUT_DOC_UID'])) {
$aFields = $ooutputDocument->load($_GET['OUT_DOC_UID']);
} else {
$aFields = array();
$aFields['PRO_UID'] = $_GET['PRO_UID'];
}
require_once 'classes/model/OutputDocument.php';
$ooutputDocument = new OutputDocument();
if (isset($_GET['OUT_DOC_UID'])) {
$aFields = $ooutputDocument->load($_GET['OUT_DOC_UID']);
} else {
$aFields = array();
$aFields['PRO_UID'] = $_GET['PRO_UID'];
}
$type = isset($aFields['OUT_DOC_TYPE']) ? $aFields['OUT_DOC_TYPE'] : 'HTML';
G::LoadClass('xmlfield_InputPM');
$G_PUBLISH = new Publisher();
switch ($type) {
case 'HTML':
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'outputdocs/outputdocs_Edit', '', $aFields , '../outputdocs/outputdocs_Save');
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->assign('OUT_DOC_UID', $_GET['OUT_DOC_UID']);
$translations = G::getTranslations(array('ID_FILE', 'ID_OUT_PUT_DOC_UPLOAD_TITLE', 'ID_UPLOADING_FILE', 'ID_UPLOAD', 'ID_CANCEL', 'ID_SAVE', 'ID_LOAD_FROM_FILE', 'ID_SELECT_TEMPLATE_FILE', 'ID_ALERT_MESSAGE', 'ID_INVALID_FILE'));
// $oHeadPublisher->assign('TRANSLATIONS', $translations);
$oHeadPublisher->addExtJsScript('outputdocs/htmlEditor', false);