本文整理汇总了PHP中OutputDocument类的典型用法代码示例。如果您正苦于以下问题:PHP OutputDocument类的具体用法?PHP OutputDocument怎么用?PHP OutputDocument使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OutputDocument类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: maborak
Cse.panels = {};
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();
示例2: getStep
/**
* Get data of a Step
*
* @param string $stepUid Unique id of Step
*
* return array Return an array with data of a Step
*/
public function getStep($stepUid)
{
try {
$arrayStep = array();
//Verify data
$this->throwExceptionIfNotExistsStep($stepUid);
//Get data
//Call plugin
$pluginRegistry = &\PMPluginRegistry::getSingleton();
$externalSteps = $pluginRegistry->getSteps();
$criteria = new \Criteria("workflow");
$criteria->add(\StepPeer::STEP_UID, $stepUid, \Criteria::EQUAL);
$rsCriteria = \StepPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
$row = $rsCriteria->getRow();
$titleObj = "";
$descriptionObj = "";
switch ($row["STEP_TYPE_OBJ"]) {
case "DYNAFORM":
$dynaform = new \Dynaform();
$arrayData = $dynaform->load($row["STEP_UID_OBJ"]);
$titleObj = $arrayData["DYN_TITLE"];
$descriptionObj = $arrayData["DYN_DESCRIPTION"];
break;
case "INPUT_DOCUMENT":
$inputDocument = new \InputDocument();
$arrayData = $inputDocument->getByUid($row["STEP_UID_OBJ"]);
if ($arrayData === false) {
return $arrayStep;
}
$titleObj = $arrayData["INP_DOC_TITLE"];
$descriptionObj = $arrayData["INP_DOC_DESCRIPTION"];
break;
case "OUTPUT_DOCUMENT":
$outputDocument = new \OutputDocument();
$arrayData = $outputDocument->getByUid($row["STEP_UID_OBJ"]);
if ($arrayData === false) {
return $arrayStep;
}
$titleObj = $arrayData["OUT_DOC_TITLE"];
$descriptionObj = $arrayData["OUT_DOC_DESCRIPTION"];
break;
case "EXTERNAL":
$titleObj = "unknown " . $row["STEP_UID"];
if (is_array($externalSteps) && count($externalSteps) > 0) {
foreach ($externalSteps as $key => $value) {
if ($value->sStepId == $row["STEP_UID_OBJ"]) {
$titleObj = $value->sStepTitle;
}
}
}
break;
}
//Return
$arrayStep = array(
$this->getFieldNameByFormatFieldName("STEP_UID") => $stepUid,
$this->getFieldNameByFormatFieldName("STEP_TYPE_OBJ") => $row["STEP_TYPE_OBJ"],
$this->getFieldNameByFormatFieldName("STEP_UID_OBJ") => $row["STEP_UID_OBJ"],
$this->getFieldNameByFormatFieldName("STEP_CONDITION") => $row["STEP_CONDITION"],
$this->getFieldNameByFormatFieldName("STEP_POSITION") => (int)($row["STEP_POSITION"]),
$this->getFieldNameByFormatFieldName("STEP_MODE") => $row["STEP_MODE"],
$this->getFieldNameByFormatFieldName("OBJ_TITLE") => $titleObj,
$this->getFieldNameByFormatFieldName("OBJ_DESCRIPTION") => $descriptionObj
);
return $arrayStep;
} catch (\Exception $e) {
throw $e;
}
}
示例3: removeProcessRows
/**
* this function remove all Process except the PROCESS ROW
*
* @param string $sProUid
* @return boolean
*/
public function removeProcessRows ($sProUid)
{
try {
//Instance all classes necesaries
$oProcess = new Process();
$oDynaform = new Dynaform();
$oInputDocument = new InputDocument();
$oOutputDocument = new OutputDocument();
$oTrigger = new Triggers();
$oStepTrigger = new StepTrigger();
$oRoute = new Route();
$oStep = new Step();
$oSubProcess = new SubProcess();
$oCaseTracker = new CaseTracker();
$oCaseTrackerObject = new CaseTrackerObject();
$oObjectPermission = new ObjectPermission();
$oSwimlaneElement = new SwimlanesElements();
$oConnection = new DbSource();
$oStage = new Stage();
$oEvent = new Event();
$oCaseScheduler = new CaseScheduler();
$oConfig = new Configuration();
//Delete the tasks of process
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( TaskPeer::PRO_UID, $sProUid );
$oDataset = TaskPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$oTask = new Task();
while ($aRow = $oDataset->getRow()) {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( StepTriggerPeer::TAS_UID, $aRow['TAS_UID'] );
StepTriggerPeer::doDelete( $oCriteria );
if ($oTask->taskExists( $aRow['TAS_UID'] )) {
$oTask->remove( $aRow['TAS_UID'] );
}
$oDataset->next();
}
//Delete the dynaforms of process
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( DynaformPeer::PRO_UID, $sProUid );
$oDataset = DynaformPeer::doSelectRS( $oCriteria );
//.........这里部分代码省略.........
示例4: create
/**
* Create the application document registry
* @param array $aData
* @return string
* */
public function create($aData)
{
$oConnection = Propel::getConnection(OutputDocumentPeer::DATABASE_NAME);
try {
if (isset($aData['OUT_DOC_UID']) && $aData['OUT_DOC_UID'] == '') {
unset($aData['OUT_DOC_UID']);
}
if (!isset($aData['OUT_DOC_UID'])) {
$aData['OUT_DOC_UID'] = G::generateUniqueID();
}
if (!isset($aData['OUT_DOC_GENERATE'])) {
$aData['OUT_DOC_GENERATE'] = 'BOTH';
} else {
if ($aData['OUT_DOC_GENERATE'] == '') {
$aData['OUT_DOC_GENERATE'] = 'BOTH';
}
}
$oOutputDocument = new OutputDocument();
$oOutputDocument->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oOutputDocument->validate()) {
$oConnection->begin();
if (isset($aData['OUT_DOC_TITLE'])) {
$oOutputDocument->setOutDocTitle($aData['OUT_DOC_TITLE']);
}
if (isset($aData['OUT_DOC_DESCRIPTION'])) {
$oOutputDocument->setOutDocDescription($aData['OUT_DOC_DESCRIPTION']);
}
$oOutputDocument->setOutDocFilename($aData['OUT_DOC_FILENAME']);
if (isset($aData['OUT_DOC_TEMPLATE'])) {
$oOutputDocument->setOutDocTemplate($aData['OUT_DOC_TEMPLATE']);
}
$iResult = $oOutputDocument->save();
$oConnection->commit();
return $aData['OUT_DOC_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oOutputDocument->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;
}
}
示例5: 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;
}
示例6: getAllGeneratedDocumentsCriteria
//.........这里部分代码省略.........
$oCriteria->add(AppDocumentPeer::APP_DOC_STATUS, array('ACTIVE'), Criteria::IN);
//$oCriteria->add(AppDocumentPeer::APP_DOC_UID, $aObjectPermissions['OUTPUT_DOCUMENTS'], Criteria::IN);
$oCriteria->add(
$oCriteria->getNewCriterion(
AppDocumentPeer::APP_DOC_UID, $aObjectPermissions['OUTPUT_DOCUMENTS'], Criteria::IN)->addOr($oCriteria->getNewCriterion(AppDocumentPeer::USR_UID, $sUserUID, Criteria::EQUAL))
);
$aConditions = array();
$aConditions[] = array(AppDocumentPeer::APP_UID, AppDelegationPeer::APP_UID);
$aConditions[] = array(AppDocumentPeer::DEL_INDEX, AppDelegationPeer::DEL_INDEX);
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->add(AppDelegationPeer::PRO_UID, $sProcessUID);
$oCriteria->addAscendingOrderByColumn(AppDocumentPeer::APP_DOC_INDEX);
$oDataset = AppDocumentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aOutputDocuments = array();
$aOutputDocuments[] = array(
'APP_DOC_UID' => 'char',
'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();
示例7: 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);
}
}
示例8: doValidate
/**
* Validates all modified columns of given OutputDocument object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param OutputDocument $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(OutputDocument $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(OutputDocumentPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(OutputDocumentPeer::TABLE_NAME);
if (!is_array($cols)) {
$cols = array($cols);
}
foreach ($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->{$get}();
}
}
} else {
if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::OUT_DOC_UID)) {
$columns[OutputDocumentPeer::OUT_DOC_UID] = $obj->getOutDocUid();
}
if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::PRO_UID)) {
$columns[OutputDocumentPeer::PRO_UID] = $obj->getProUid();
}
if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::OUT_DOC_GENERATE)) {
$columns[OutputDocumentPeer::OUT_DOC_GENERATE] = $obj->getOutDocGenerate();
}
if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::OUT_DOC_TYPE)) {
$columns[OutputDocumentPeer::OUT_DOC_TYPE] = $obj->getOutDocType();
}
}
return BasePeer::doValidate(OutputDocumentPeer::DATABASE_NAME, OutputDocumentPeer::TABLE_NAME, $columns);
}
示例9: 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) {
//.........这里部分代码省略.........
示例10: switch
switch ($aRow['STEP_TYPE_OBJ']) {
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');
示例11: getCaseTrackerObject
/**
* Get data of a Case Tracker Object
*
* @param string $caseTrackerObjectUid Unique id of Case Tracker Object
*
* return array Return an array with data of a Case Tracker Object
*/
public function getCaseTrackerObject($caseTrackerObjectUid)
{
try {
//Verify data
$caseTrackerObject = new \CaseTrackerObject();
if (!$caseTrackerObject->caseTrackerObjectExists($caseTrackerObjectUid)) {
throw new \Exception(\G::LoadTranslation("ID_CASE_TRACKER_OBJECT_DOES_NOT_EXIST", array(strtolower("CTO_UID"), $caseTrackerObjectUid)));
}
//Get data
$dynaform = new \Dynaform();
$inputDocument = new \InputDocument();
$outputDocument = new \OutputDocument();
$criteria = new \Criteria("workflow");
$criteria->add(\CaseTrackerObjectPeer::CTO_UID, $caseTrackerObjectUid, \Criteria::EQUAL);
$rsCriteria = \CaseTrackerObjectPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
$row = $rsCriteria->getRow();
$titleObj = "";
$descriptionObj = "";
switch ($row["CTO_TYPE_OBJ"]) {
case "DYNAFORM":
$arrayData = $dynaform->load($row["CTO_UID_OBJ"]);
$titleObj = $arrayData["DYN_TITLE"];
$descriptionObj = $arrayData["DYN_DESCRIPTION"];
break;
case "INPUT_DOCUMENT":
$arrayData = $inputDocument->getByUid($row["CTO_UID_OBJ"]);
$titleObj = $arrayData["INP_DOC_TITLE"];
$descriptionObj = $arrayData["INP_DOC_DESCRIPTION"];
break;
case "OUTPUT_DOCUMENT":
$arrayData = $outputDocument->getByUid($row["CTO_UID_OBJ"]);
$titleObj = $arrayData["OUT_DOC_TITLE"];
$descriptionObj = $arrayData["OUT_DOC_DESCRIPTION"];
break;
}
return array("cto_uid" => $row["CTO_UID"], "cto_type_obj" => $row["CTO_TYPE_OBJ"], "cto_uid_obj" => $row["CTO_UID_OBJ"], "cto_condition" => $row["CTO_CONDITION"], "cto_position" => (int) $row["CTO_POSITION"], "obj_title" => $titleObj, "obj_description" => $descriptionObj);
} catch (\Exception $e) {
throw $e;
}
}
示例12: create
/**
* Create the application document registry
* @param array $aData
* @return string
* */
public function create($aData)
{
$oConnection = Propel::getConnection(OutputDocumentPeer::DATABASE_NAME);
try {
if (isset($aData['OUT_DOC_UID']) && $aData['OUT_DOC_UID'] == '') {
unset($aData['OUT_DOC_UID']);
}
if (!isset($aData['OUT_DOC_UID'])) {
$aData['OUT_DOC_UID'] = G::generateUniqueID();
}
if (!isset($aData['OUT_DOC_GENERATE'])) {
$aData['OUT_DOC_GENERATE'] = 'BOTH';
} else {
if ($aData['OUT_DOC_GENERATE'] == '') {
$aData['OUT_DOC_GENERATE'] = 'BOTH';
}
}
$oOutputDocument = new OutputDocument();
$oOutputDocument->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oOutputDocument->validate()) {
$oConnection->begin();
if (isset($aData['OUT_DOC_TITLE'])) {
$oOutputDocument->setOutDocTitle($aData['OUT_DOC_TITLE']);
}
if (isset($aData['OUT_DOC_DESCRIPTION'])) {
$oOutputDocument->setOutDocDescription($aData['OUT_DOC_DESCRIPTION']);
}
$oOutputDocument->setOutDocFilename($aData['OUT_DOC_FILENAME']);
if (isset($aData['OUT_DOC_TEMPLATE'])) {
$oOutputDocument->setOutDocTemplate($aData['OUT_DOC_TEMPLATE']);
}
$iResult = $oOutputDocument->save();
$oConnection->commit();
//Add Audit Log
$description = "Output Document Name: ".$aData['OUT_DOC_TITLE'].", Output Document Uid: ".$aData['OUT_DOC_UID'].", Filename generated: ".$aData['OUT_DOC_FILENAME'];
if(!empty($aData['OUT_DOC_DESCRIPTION'])){
$description .= ", Description: ".$aData['OUT_DOC_DESCRIPTION'];
}
if(!empty($aData['OUT_DOC_REPORT_GENERATOR'])){
$description .= ", Report Generator: ". $aData['OUT_DOC_REPORT_GENERATOR'];
}
if(!empty($aData['OUT_DOC_GENERATE'])){
$description .= ", Output Document to Generate: ".$aData['OUT_DOC_GENERATE'];
}
if($aData['OUT_DOC_PDF_SECURITY_ENABLED']==0){
$pdfSecurity = 'Disabled';
}else{
$pdfSecurity = 'Enabled';
}
$description .= ", PDF Security: ".$pdfSecurity;
if(!empty($aData['OUT_DOC_VERSIONING'])){
$description .= ", Enable Versioning: Yes";
}
if(!empty($aData['OUT_DOC_DESTINATION_PATH'])){
$description .= ", Destination Path: ".$aData['OUT_DOC_DESTINATION_PATH'];
}
if(!empty($aData['OUT_DOC_TAGS'])){
$description .= ", Tags: ".$aData['OUT_DOC_TAGS'];
}
if(!empty($aData['OUT_DOC_OPEN_TYPE'])){
if($aData['OUT_DOC_OPEN_TYPE']==0){
$genLink = 'Open the file';
}else{
$genLink = 'Download the file';
}
$description .= ", By clicking on the generated file link: ".$genLink;
}
G::auditLog("CreateOutputDocument", $description);
return $aData['OUT_DOC_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oOutputDocument->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);
}
//.........这里部分代码省略.........
示例13: removeTest
function removeTest($aTestData, $aFields)
{
$oOutputDocument = new OutputDocument();
try {
return $oOutputDocument->remove($aFields['OUT_DOC_UID']);
} catch (Exception $oError) {
return $oError;
}
}
示例14: deleteProcess
public function deleteProcess($sProcessUID, $flagRemoveCases = true)
{
try {
//G::LoadClass('case');
//G::LoadClass('reportTables');
//Instance all classes necesaries
$oProcess = new \Process();
$oDynaform = new \Dynaform();
$oInputDocument = new \InputDocument();
$oOutputDocument = new \OutputDocument();
$oTrigger = new \Triggers();
$oRoute = new \Route();
$oGateway = new \Gateway();
$oEvent = new \Event();
$oSwimlaneElement = new \SwimlanesElements();
$oConfiguration = new \Configuration();
$oDbSource = new \DbSource();
$oReportTable = new \ReportTables();
$oCaseTracker = new \CaseTracker();
$oCaseTrackerObject = new \CaseTrackerObject();
//Update PROCESS_FILES_CHECKED
$configuration = \ConfigurationPeer::retrieveByPK("PROCESS_FILES_CHECKED", "", "", "", "");
if (!is_null($configuration)) {
$arrayProjectUid = unserialize($configuration->getCfgValue());
unset($arrayProjectUid[$sProcessUID]);
$conf = new \Configuration();
$result = $conf->update(array("CFG_UID" => "PROCESS_FILES_CHECKED", "OBJ_UID" => "", "CFG_VALUE" => serialize($arrayProjectUid), "PRO_UID" => "", "USR_UID" => "", "APP_UID" => ""));
}
//Delete the applications of process
if ($flagRemoveCases) {
$case = new \Cases();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ApplicationPeer::APP_UID);
$criteria->add(\ApplicationPeer::PRO_UID, $sProcessUID, \Criteria::EQUAL);
$rsCriteria = \ApplicationPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$result = $case->removeCase($row["APP_UID"]);
}
}
//Delete the tasks of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\TaskPeer::PRO_UID, $sProcessUID);
$oDataset = \TaskPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
//$this->deleteTask($aRow['TAS_UID']);
$oTasks = new \Tasks();
$oTasks->deleteTask($aRow['TAS_UID']);
$oDataset->next();
}
//Delete the dynaforms of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\DynaformPeer::PRO_UID, $sProcessUID);
$oDataset = \DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oDynaform->remove($aRow['DYN_UID']);
$oDataset->next();
}
//Delete the input documents of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\InputDocumentPeer::PRO_UID, $sProcessUID);
$oDataset = \InputDocumentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oInputDocument->remove($aRow['INP_DOC_UID']);
$oDataset->next();
}
//Delete the output documents of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\OutputDocumentPeer::PRO_UID, $sProcessUID);
$oDataset = \OutputDocumentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oOutputDocument->remove($aRow['OUT_DOC_UID']);
$oDataset->next();
}
//Delete the triggers of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\TriggersPeer::PRO_UID, $sProcessUID);
$oDataset = \TriggersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oTrigger->remove($aRow['TRI_UID']);
$oDataset->next();
}
//Delete the routes of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\RoutePeer::PRO_UID, $sProcessUID);
$oDataset = \RoutePeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
//.........这里部分代码省略.........
示例15: 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';
}
//.........这里部分代码省略.........