本文整理汇总了PHP中InputDocument类的典型用法代码示例。如果您正苦于以下问题:PHP InputDocument类的具体用法?PHP InputDocument怎么用?PHP InputDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InputDocument类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
//Triggers
$arrayTrigger = $case->loadTriggers($_SESSION["TASK"], "INPUT_DOCUMENT", $inputDocumentUid, "AFTER");
//Trigger debug routines
//Cleaning debug variables
$_SESSION["TRIGGER_DEBUG"]["ERRORS"] = array();
$_SESSION["TRIGGER_DEBUG"]["DATA"] = array();
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_NAMES"] = array();
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_VALUES"] = array();
$_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] = count($arrayTrigger);
$_SESSION["TRIGGER_DEBUG"]["TIME"] = "AFTER";
if ($_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] > 0) {
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_NAMES"] = $case->getTriggerNames($arrayTrigger);
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_VALUES"] = $arrayTrigger;
}
//***Validating the file allowed extensions***
$oInputDocument = new InputDocument();
$InpDocData = $oInputDocument->load($inputDocumentUid);
if (isset($_FILES["form"]["name"]["APP_DOC_FILENAME"]) && isset($_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"])) {
$res = G::verifyInputDocExtension($InpDocData['INP_DOC_TYPE_FILE'], $_FILES["form"]["name"]["APP_DOC_FILENAME"], $_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"]);
} else {
$res = new stdclass();
$res->status = false;
$res->message = G::LoadTranslation('ID_UPLOAD_ERR_INI_SIZE');
}
if ($res->status == 0) {
$message = $res->message;
G::SendMessageText($message, "ERROR");
$backUrlObj = explode("sys" . SYS_SYS, $_SERVER['HTTP_REFERER']);
G::header("location: " . "/sys" . SYS_SYS . $backUrlObj[1]);
die;
}
示例2: getInputDocumentDataFromRecord
/**
* Get data of an InputDocument from a record
*
* @param array $record Record
*
* return array Return an array with data InputDocument
*/
public function getInputDocumentDataFromRecord($record)
{
try {
if ($record["INP_DOC_TITLE"] . "" == "") {
//Load InputDocument
$inputDocument = new \InputDocument();
$arrayInputDocumentData = $inputDocument->load($record["INP_DOC_UID"]);
//There is no transaltion for this Document name, try to get/regenerate the label
$record["INP_DOC_TITLE"] = $arrayInputDocumentData["INP_DOC_TITLE"];
$record["INP_DOC_DESCRIPTION"] = $arrayInputDocumentData["INP_DOC_DESCRIPTION"];
}
return array($this->getFieldNameByFormatFieldName("INP_DOC_UID") => $record["INP_DOC_UID"], $this->getFieldNameByFormatFieldName("INP_DOC_TITLE") => $record["INP_DOC_TITLE"], $this->getFieldNameByFormatFieldName("INP_DOC_DESCRIPTION") => $record["INP_DOC_DESCRIPTION"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_FORM_NEEDED") => $record["INP_DOC_FORM_NEEDED"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_ORIGINAL") => $record["INP_DOC_ORIGINAL"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_PUBLISHED") => $record["INP_DOC_PUBLISHED"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_VERSIONING") => (int) $record["INP_DOC_VERSIONING"], $this->getFieldNameByFormatFieldName("INP_DOC_DESTINATION_PATH") => $record["INP_DOC_DESTINATION_PATH"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_TAGS") => $record["INP_DOC_TAGS"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_TYPE_FILE") => $record["INP_DOC_TYPE_FILE"] . "", $this->getFieldNameByFormatFieldName("INP_DOC_MAX_FILESIZE") => (int) $record["INP_DOC_MAX_FILESIZE"], $this->getFieldNameByFormatFieldName("INP_DOC_MAX_FILESIZE_UNIT") => $record["INP_DOC_MAX_FILESIZE_UNIT"] . "");
} catch (\Exception $e) {
throw $e;
}
}
示例3: Cases
break;
case 'showUploadedDocuments':
$oCase = new Cases();
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_AllInputdocsList', $oCase->getAllUploadedDocumentsCriteria($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED']));
G::RenderPage('publish', 'raw');
break;
case 'showUploadedDocument':
//require_once 'classes/model/AppDocument.php';
//require_once 'classes/model/AppDelegation.php';
//require_once 'classes/model/InputDocument.php';
//require_once 'classes/model/Users.php';
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_POST['APP_DOC_UID']);
$oInputDocument = new InputDocument();
if ($oAppDocument->Fields['DOC_UID'] != -1) {
$Fields = $oInputDocument->load($oAppDocument->Fields['DOC_UID']);
} else {
$Fields = array('INP_DOC_FORM_NEEDED' => '', 'FILENAME' => $oAppDocument->Fields['APP_DOC_FILENAME']);
}
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDelegationPeer::APP_UID, $oAppDocument->Fields['APP_UID']);
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $oAppDocument->Fields['DEL_INDEX']);
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$oTask = new Task();
try {
$aTask = $oTask->load($aRow['TAS_UID']);
示例4: create
/**
* Create the application document registry
* @param array $aData
* @return string
**/
public function create($aData)
{
$oConnection = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
try {
if (isset($aData['INP_DOC_UID']) && $aData['INP_DOC_UID'] == '') {
unset($aData['INP_DOC_UID']);
}
if (!isset($aData['INP_DOC_UID'])) {
$aData['INP_DOC_UID'] = G::generateUniqueID();
}
$oInputDocument = new InputDocument();
$oInputDocument->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oInputDocument->validate()) {
$oConnection->begin();
if (isset($aData['INP_DOC_TITLE'])) {
$oInputDocument->setInpDocTitle($aData['INP_DOC_TITLE']);
}
if (isset($aData['INP_DOC_DESCRIPTION'])) {
$oInputDocument->setInpDocDescription($aData['INP_DOC_DESCRIPTION']);
}
$iResult = $oInputDocument->save();
$oConnection->commit();
return $aData['INP_DOC_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oInputDocument->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: isset
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
$docUid = $_POST['form']['DOC_UID'];
$appDocUid = $_POST['form']['APP_DOC_UID'];
$docVersion = $_POST['form']['docVersion'];
$actionType = $_POST['form']['actionType'];
$appId = $_GET['appId'];
$docType = isset($_GET['docType']) ? $_GET['docType'] : "";
//save info
require_once "classes/model/AppDocument.php";
require_once 'classes/model/AppFolder.php';
require_once 'classes/model/InputDocument.php';
$oInputDocument = new InputDocument();
if ($_GET['UID'] != -1) {
$aID = $oInputDocument->load($_GET['UID']);
} else {
$oFolder = new AppFolder();
$folderStructure = $oFolder->getFolderStructure(isset($_GET['folderId']) ? $_GET['folderId'] : "/");
$aID = array('INP_DOC_DESTINATION_PATH' => $folderStructure['PATH']);
}
$oAppDocument = new AppDocument();
//Get the Custom Folder ID (create if necessary)
$oFolder = new AppFolder();
if ($_GET['UID'] != -1) {
//krumo("jhl");
$folderId = $oFolder->createFromPath($aID['INP_DOC_DESTINATION_PATH'], $appId);
//Tags
$fileTags = $oFolder->parseTags($aID['INP_DOC_TAGS'], $appId);
示例6: count
case 'getAdditionalTables':
$rows = $oProcessMap->getExtAdditionalTablesList();
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode($result);
break;
case 'getInputDocumentList':
$rows = $oProcessMap->getExtInputDocumentsCriteria($start, $limit, $_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllInputDocumentCount();
array_shift($rows);
$result['data'] = $rows;
print G::json_encode($result);
break;
case 'editInputDocument':
require_once 'classes/model/InputDocument.php';
$oInputDocument = new InputDocument();
$rows = $oInputDocument->load($_GET['INP_DOC_UID']);
$tmpData = G::json_encode($rows);
$tmpData = str_replace("\\/", "/", '{success:true,data:' . $tmpData . '}');
// unescape the slashes
$result = $tmpData;
echo $result;
break;
case 'getOutputDocument':
$rows = $oProcessMap->getExtOutputDocumentsCriteria($start, $limit, $_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllOutputDocumentCount();
array_shift($rows);
$result['data'] = $rows;
print G::json_encode($result);
break;
case 'editObjectPermission':
示例7: addInputDocument
/**
* Add a input document
*
* Return the application document ID
*
* @param string $inputDocumentUid Input document ID
* @param string $appDocUid Application document ID
* @param int $docVersion Document version
* @param string $appDocType Document type
* @param string $appDocComment Document comment
* @param string $inputDocumentAction Action, posible values: null or empty (Add), "R" (Replace), "NV" (New Version)
* @param string $applicationUid Application ID
* @param int $delIndex Delegation index
* @param string $taskUid Task ID
* @param string $userUid User ID
* @param string $option Option, posible values: "xmlform", "file"
* @param string $file File ($_FILES["form"]["name"]["APP_DOC_FILENAME"] or path to file)
* @param int $fileError File error ($_FILES["form"]["error"]["APP_DOC_FILENAME"] or 0)
* @param string $fileTmpName File temporal name ($_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"] or null)
* @param string $fileSize File size ($_FILES["form"]["size"]["APP_DOC_FILENAME"] or 0)
* @return string Return application document ID
*/
public function addInputDocument($inputDocumentUid, $appDocUid, $docVersion, $appDocType, $appDocComment, $inputDocumentAction, $applicationUid, $delIndex, $taskUid, $userUid, $option, $file, $fileError = 0, $fileTmpName = null, $fileSize = 0)
{
$appDocFileName = null;
$sw = 0;
switch ($option) {
case "xmlform":
$appDocFileName = $file;
if ($fileError == 0) {
$sw = 1;
}
break;
case "file":
$appDocFileName = basename($file);
if (file_exists($file) && is_file($file)) {
$sw = 1;
}
break;
}
if ($sw == 0) {
return null;
}
//Info
$inputDocument = new InputDocument();
//.........这里部分代码省略.........
示例8: 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);
}
}
示例9: getCaseTrackerObjects
/**
* Get all Case Tracker Objects of a Process
*
* @param string $processUid Unique id of Process
*
* return array Return an array with all Case Tracker Objects of a Process
*/
public function getCaseTrackerObjects($processUid)
{
try {
$arrayCaseTrackerObject = array();
//Verify data
$process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfNotExistsProcess($processUid, "prj_uid");
$dynaform = new \Dynaform();
$inputDocument = new \InputDocument();
$outputDocument = new \OutputDocument();
$arrayCaseTrackerObject = array();
$criteria = new \Criteria("workflow");
$criteria->add(\CaseTrackerObjectPeer::PRO_UID, $processUid, \Criteria::EQUAL);
$rsCriteria = \CaseTrackerObjectPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($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;
}
$arrayCaseTrackerObject[] = 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);
}
$arrayCaseTrackerObject = \ProcessMaker\Util\ArrayUtil::sort($arrayCaseTrackerObject, array("cto_position"), SORT_ASC);
return $arrayCaseTrackerObject;
} catch (\Exception $e) {
throw $e;
}
}
示例10: doValidate
/**
* Validates all modified columns of given InputDocument 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 InputDocument $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(InputDocument $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(InputDocumentPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(InputDocumentPeer::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(InputDocumentPeer::INP_DOC_UID)) {
$columns[InputDocumentPeer::INP_DOC_UID] = $obj->getInpDocUid();
}
if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::PRO_UID)) {
$columns[InputDocumentPeer::PRO_UID] = $obj->getProUid();
}
if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_FORM_NEEDED)) {
$columns[InputDocumentPeer::INP_DOC_FORM_NEEDED] = $obj->getInpDocFormNeeded();
}
if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_ORIGINAL)) {
$columns[InputDocumentPeer::INP_DOC_ORIGINAL] = $obj->getInpDocOriginal();
}
if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_PUBLISHED)) {
$columns[InputDocumentPeer::INP_DOC_PUBLISHED] = $obj->getInpDocPublished();
}
}
return BasePeer::doValidate(InputDocumentPeer::DATABASE_NAME, InputDocumentPeer::TABLE_NAME, $columns);
}
示例11: Publisher
//Bytes
$Fields["INP_DOC_SUPPORTED_EXTENSIONS_FILENAME_LABEL"] = "[" . $InpDocData["INP_DOC_TYPE_FILE"] . "]";
$Fields["INP_DOC_MAX_FILESIZE"] = $inpDocMaxFilesize;
$Fields["INP_DOC_MAX_FILESIZE_LABEL"] = $inpDocMaxFilesize > 0 ? "[" . $InpDocData["INP_DOC_MAX_FILESIZE"] . " " . $InpDocData["INP_DOC_MAX_FILESIZE_UNIT"] . "]" : "";
$Fields['fileTypes'] = $InpDocData['INP_DOC_TYPE_FILE'];
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'cases_SaveDocument?UID=' . $_POST['docID']);
G::RenderPage('publish', 'raw');
break;
case "uploadToReviseInputDocument":
//krumo($_POST);
$G_PUBLISH = new Publisher();
$Fields['DOC_UID'] = $_POST['docID'];
$Fields['APP_DOC_UID'] = $_POST['appDocId'];
$Fields['actionType'] = $_POST['actionType'];
$Fields["docVersion"] = (int) $_POST["docVersion"];
$oInputDocument = new InputDocument();
$InpDocData = $oInputDocument->load($Fields['DOC_UID']);
$inpDocMaxFilesize = $InpDocData["INP_DOC_MAX_FILESIZE"];
$inpDocMaxFilesizeUnit = $InpDocData["INP_DOC_MAX_FILESIZE_UNIT"];
$inpDocMaxFilesize = $inpDocMaxFilesize * ($inpDocMaxFilesizeUnit == "MB" ? 1024 * 1024 : 1024);
//Bytes
$Fields["INP_DOC_SUPPORTED_EXTENSIONS_FILENAME_LABEL"] = "[" . $InpDocData["INP_DOC_TYPE_FILE"] . "]";
$Fields["INP_DOC_MAX_FILESIZE"] = $inpDocMaxFilesize;
$Fields["INP_DOC_MAX_FILESIZE_LABEL"] = $inpDocMaxFilesize > 0 ? "[" . $InpDocData["INP_DOC_MAX_FILESIZE"] . " " . $InpDocData["INP_DOC_MAX_FILESIZE_UNIT"] . "]" : "";
$Fields['fileTypes'] = $InpDocData['INP_DOC_TYPE_FILE'];
if ($_POST['actionType'] == 'NV') {
$appDocument = new AppDocument();
$arrayAppDocumentData = $appDocument->load($_POST["appDocId"]);
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'cases_SupervisorSaveDocument?APP_DOC_UID=' . $_POST['appDocId'] . "&DOC_VERSION=" . ($Fields['docVersion'] + 1) . '&APP_UID=' . $arrayAppDocumentData["APP_UID"] . '&UID=' . $_POST['docID']);
} else {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'cases_SupervisorSaveDocument?UID=' . $_POST['docID'] . '&APP_UID=' . $_POST['appDocId']);
示例12: while
$oCriteria->addAscendingOrderByColumn(StepPeer::STEP_POSITION);
$oDataset = StepPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$i = 0;
while ($aRow = $oDataset->getRow()) {
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;
}
示例13: create
/**
* Create the application document registry
*
* @param array $aData
* @return string
*
*/
public function create($aData)
{
$oConnection = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
try {
if (isset($aData['INP_DOC_UID']) && $aData['INP_DOC_UID'] == '') {
unset($aData['INP_DOC_UID']);
}
if (!isset($aData['INP_DOC_UID'])) {
$aData['INP_DOC_UID'] = G::generateUniqueID();
}
$oInputDocument = new InputDocument();
$oInputDocument->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oInputDocument->validate()) {
$oConnection->begin();
if (isset($aData['INP_DOC_TITLE'])) {
$oInputDocument->setInpDocTitle($aData['INP_DOC_TITLE']);
}
if (isset($aData['INP_DOC_DESCRIPTION'])) {
$oInputDocument->setInpDocDescription($aData['INP_DOC_DESCRIPTION']);
}
$iResult = $oInputDocument->save();
$oConnection->commit();
//Add Audit Log
switch ($aData['INP_DOC_FORM_NEEDED']) {
case 'VIRTUAL':
$docType = 'Digital';
break;
case 'REAL':
$docType = 'Printed';
break;
case 'VREAL':
$docType = 'Digital/Printed';
break;
}
if (isset($aData['INP_DOC_VERSIONING']) && $aData['INP_DOC_VERSIONING'] == 1) {
$enableVersion = 'Yes';
} else {
$enableVersion = 'No';
}
$description = "Input Document Title: " . $aData['INP_DOC_TITLE'] . ", Input Document Uid: " . $aData['INP_DOC_UID'] . ", Document Type: " . $docType;
if (!empty($aData['INP_DOC_DESCRIPTION'])) {
$description .= ", Description: " . $aData['INP_DOC_DESCRIPTION'];
}
if (!empty($aData['INP_DOC_DESTINATION_PATH'])) {
$description .= ", Destination Path: " . $aData['INP_DOC_DESTINATION_PATH'];
}
$inputDocMaxFileSize = "";
if (!empty($aData['INP_DOC_MAX_FILESIZE'])) {
$inputDocMaxFileSize = $aData['INP_DOC_MAX_FILESIZE'] ? $aData['INP_DOC_MAX_FILESIZE'] . ' ' . $aData['INP_DOC_MAX_FILESIZE_UNIT'] : "256 MB";
$inputDocMaxFileSize = ", Maximum Input Document file size: " . $inputDocMaxFileSize;
}
if (!empty($aData['INP_DOC_MAX_FILESIZE'])) {
$description .= ", Extensions: " . $aData['INP_DOC_TYPE_FILE'];
}
$description .= $inputDocMaxFileSize;
G::auditLog("CreateInputDocument", $description);
return $aData['INP_DOC_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oInputDocument->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;
}
}
示例14: 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) {
//.........这里部分代码省略.........
示例15: render
/**
* Function render
* @author David S. Callizaya S. <davidsantos@colosa.com>
* @access public
* @param string value
* @return string
*/
function render($value = NULL)
{
$mode = $this->mode == 'view' ? ' disabled="disabled"' : '';
if ($this->mode == 'view') {
$displayStyle = 'display:none;';
$html = $value . '<input class="module_app_input___gray_file" ' . $mode . 'style=' . $displayStyle . ' id="form[' . $this->name . ']" name="form[' . $this->name . ']" type=\'file\' value=\'' . $value . '\' />';
} else {
$html = '<input class="module_app_input___gray_file" ' . $mode . 'id="form[' . $this->name . ']" name="form[' . $this->name . ']" type=\'file\' value=\'' . $value . '\'/>';
}
if (isset($this->input) && $this->input != '') {
require_once 'classes/model/InputDocument.php';
$oiDoc = new InputDocument();
try {
$aDoc = $oiDoc->load($this->input);
$aDoc['INP_DOC_TITLE'] = isset($aDoc['INP_DOC_TITLE']) ? $aDoc['INP_DOC_TITLE'] : '';
$html .= '<label><img src="/images/inputdocument.gif" width="22px" width="22px"/><font size="1">(' . trim($aDoc['INP_DOC_TITLE']) . ')</font></label>';
} catch (Exception $e) {
// then the input document doesn't exits, id referencial broken
$html .= ' <font color="red"><img src="/images/alert_icon.gif" width="16px" width="16px"/><font size="1">(' . G::loadTranslation('ID_INPUT_DOC_DOESNT_EXIST') . ')</font></font>';
}
}
$html .= $this->renderHint();
return $html;
}