本文整理汇总了PHP中OutputDocument::OutputExists方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputDocument::OutputExists方法的具体用法?PHP OutputDocument::OutputExists怎么用?PHP OutputDocument::OutputExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputDocument
的用法示例。
在下文中一共展示了OutputDocument::OutputExists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
//.........这里部分代码省略.........
示例2: removeProcessRows
//.........这里部分代码省略.........
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
if ($oInputDocument->InputExists( $aRow['INP_DOC_UID'] )) {
$oInputDocument->remove( $aRow['INP_DOC_UID'] );
}
$oDataset->next();
}
//Delete the output documents of process
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( OutputDocumentPeer::PRO_UID, $sProUid );
$oDataset = OutputDocumentPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
if ($oOutputDocument->OutputExists( $aRow['OUT_DOC_UID'] )) {
$oOutputDocument->remove( $aRow['OUT_DOC_UID'] );
}
$oDataset->next();
}
//Delete the steps
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( StepPeer::PRO_UID, $sProUid );
$oDataset = StepPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
//Delete the steptrigger of process
/*$oCriteria = new Criteria('workflow');
$oCriteria->add(StepTriggerPeer::STEP_UID, $aRow['STEP_UID']);
$oDataseti = StepTriggerPeer::doSelectRS($oCriteria);
示例3: existsObjectUid
/**
* Verify if exists the "Object UID" in the corresponding table
*
* @param string $type Type of Step (DYNAFORM, INPUT_DOCUMENT, OUTPUT_DOCUMENT)
* @param string $objectUid Unique id of Object
* @param string $fieldNameForException Field name for the exception
*
* return strin Return empty string if $objectUid exists in the corresponding table, return string with data if $objectUid doesn't exist
*/
public function existsObjectUid($type, $objectUid, $fieldNameForException)
{
try {
$msg = "";
switch ($type) {
case "DYNAFORM":
$dynaform = new \Dynaform();
if (!$dynaform->dynaformExists($objectUid)) {
$msg = \G::LoadTranslation("ID_DYNAFORM_DOES_NOT_EXIST", array($fieldNameForException, $objectUid));
}
break;
case "INPUT_DOCUMENT":
$inputdoc = new \InputDocument();
if (!$inputdoc->InputExists($objectUid)) {
$msg = \G::LoadTranslation("ID_INPUT_DOCUMENT_DOES_NOT_EXIST", array($fieldNameForException, $objectUid));
}
break;
case "OUTPUT_DOCUMENT":
$outputdoc = new \OutputDocument();
if (!$outputdoc->OutputExists($objectUid)) {
$msg = \G::LoadTranslation("ID_OUTPUT_DOCUMENT_DOES_NOT_EXIST", array($fieldNameForException, $objectUid));
}
break;
}
return $msg;
} catch (\Exception $e) {
throw $e;
}
}