本文整理汇总了PHP中Cases::thisIsTheCurrentUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Cases::thisIsTheCurrentUser方法的具体用法?PHP Cases::thisIsTheCurrentUser怎么用?PHP Cases::thisIsTheCurrentUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cases
的用法示例。
在下文中一共展示了Cases::thisIsTheCurrentUser方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addCasesInputDocument
/**
* Get data of Cases InputDocument
*
* @param string $applicationUid
* @param string $taskUid
* @param string $appDocComment
* @param string $inputDocumentUid
* @param string $userUid
*
* return array Return an array with data of an InputDocument
*/
public function addCasesInputDocument($applicationUid, $taskUid, $appDocComment, $inputDocumentUid, $userUid)
{
try {
if ((isset( $_FILES['form'] )) && ($_FILES['form']['error'] != 0)) {
$code = $_FILES['form']['error'];
switch ($code) {
case UPLOAD_ERR_INI_SIZE:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_INI_SIZE' );
break;
case UPLOAD_ERR_FORM_SIZE:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_FORM_SIZE' );
break;
case UPLOAD_ERR_PARTIAL:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_PARTIAL' );
break;
case UPLOAD_ERR_NO_FILE:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_NO_FILE' );
break;
case UPLOAD_ERR_NO_TMP_DIR:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_NO_TMP_DIR' );
break;
case UPLOAD_ERR_CANT_WRITE:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_CANT_WRITE' );
break;
case UPLOAD_ERR_EXTENSION:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_EXTENSION' );
break;
default:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_UNKNOWN' );
break;
}
\G::SendMessageText( $message, "ERROR" );
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
\G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
die();
}
\G::LoadClass("case");
$appDocUid = \G::generateUniqueID();
$docVersion = '';
$appDocType = 'INPUT';
$case = new \Cases();
$delIndex = \AppDelegation::getCurrentIndex($applicationUid);
$case->thisIsTheCurrentUser($applicationUid, $delIndex, $userUid, "REDIRECT", "casesListExtJs");
//Load the fields
$arrayField = $case->loadCase($applicationUid);
$arrayField["APP_DATA"] = array_merge($arrayField["APP_DATA"], \G::getSystemConstants());
//Triggers
$arrayTrigger = $case->loadTriggers($taskUid, "INPUT_DOCUMENT", $inputDocumentUid, "AFTER");
//Add Input Document
if (empty($_FILES)) {
throw new \Exception(\G::LoadTranslation("ID_CASES_INPUT_FILENAME_DOES_NOT_EXIST"));
}
if (!$_FILES["form"]["error"]) {
$_FILES["form"]["error"] = 0;
}
if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) {
$appDocUid = $case->addInputDocument($inputDocumentUid,
$appDocUid,
$docVersion,
$appDocType,
$appDocComment,
'',
$applicationUid,
$delIndex,
$taskUid,
$userUid,
"xmlform",
$_FILES["form"]["name"],
$_FILES["form"]["error"],
$_FILES["form"]["tmp_name"]);
}
//Trigger - Execute after - Start
$arrayField["APP_DATA"] = $case->executeTriggers ($taskUid,
"INPUT_DOCUMENT",
$inputDocumentUid,
"AFTER",
$arrayField["APP_DATA"]);
//Trigger - Execute after - End
//Save data
$arrayData = array();
$arrayData["APP_NUMBER"] = $arrayField["APP_NUMBER"];
//$arrayData["APP_PROC_STATUS"] = $arrayField["APP_PROC_STATUS"];
$arrayData["APP_DATA"] = $arrayField["APP_DATA"];
$arrayData["DEL_INDEX"] = $delIndex;
$arrayData["TAS_UID"] = $taskUid;
$case->updateCase($applicationUid, $arrayData);
return($this->getCasesInputDocument($applicationUid, $userUid, $appDocUid));
} catch (\Exception $e) {
throw $e;
//.........这里部分代码省略.........
示例2: explode
}
G::SendMessageText($message, "ERROR");
$backUrlObj = explode("sys" . SYS_SYS, $_SERVER['HTTP_REFERER']);
G::header("location: " . "/sys" . SYS_SYS . $backUrlObj[1]);
die;
}
G::LoadClass("case");
$inputDocumentUid = $_GET["UID"];
//$_POST["form"]["DOC_UID"]
$appDocUid = $_POST["form"]["APP_DOC_UID"];
$docVersion = intval($_POST["form"]["docVersion"]);
$appDocType = $_POST["form"]["APP_DOC_TYPE"];
$appDocComment = isset($_POST["form"]["APP_DOC_COMMENT"]) ? $_POST["form"]["APP_DOC_COMMENT"] : "";
$actionType = $_POST["form"]["actionType"];
$case = new Cases();
$case->thisIsTheCurrentUser($_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs");
//Load the fields
$arrayField = $case->loadCase($_SESSION["APPLICATION"]);
$arrayField["APP_DATA"] = array_merge($arrayField["APP_DATA"], G::getSystemConstants());
//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);
示例3: 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);
//.........这里部分代码省略.........
示例4: explode
$message = G::LoadTranslation('ID_UPLOAD_ERR_UNKNOWN');
break;
}
G::SendMessageText($message, "ERROR");
$backUrlObj = explode("sys" . SYS_SYS, $_SERVER['HTTP_REFERER']);
G::header("location: " . "/sys" . SYS_SYS . $backUrlObj[1]);
die;
}
$docUid = $_POST['form']['DOC_UID'];
$appDocUid = $_POST['form']['APP_DOC_UID'];
$docVersion = $_POST['form']['docVersion'];
$actionType = $_POST['form']['actionType'];
//load the variables
G::LoadClass('case');
$oCase = new Cases();
$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List');
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
$Fields['APP_DATA'] = array_merge($Fields['APP_DATA'], G::getSystemConstants());
#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();
$triggers = $oCase->loadTriggers($_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER');
$_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count($triggers);
$_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER';
if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames($triggers);
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers;
}
示例5: 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';
}
//.........这里部分代码省略.........
示例6: 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'], (bool) $aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'], $aProperties, $applicationUid);
/*----------------------------------********---------------------------------*/
$licensedFeatures =& \PMLicensedFeatures::getSingleton();
//.........这里部分代码省略.........