本文整理汇总了PHP中AppDocument::load方法的典型用法代码示例。如果您正苦于以下问题:PHP AppDocument::load方法的具体用法?PHP AppDocument::load怎么用?PHP AppDocument::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppDocument
的用法示例。
在下文中一共展示了AppDocument::load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadTest
function loadTest($aTestData, $aFields)
{
$oAppDocument = new AppDocument();
try {
return $oAppDocument->load($aFields['APP_DOC_UID']);
} catch (Exception $oError) {
return $oError;
}
}
示例2: casesShowOuputDocumentExist
function casesShowOuputDocumentExist($url)
{
$urlArray = explode("?", $url);
$urlParametroString = $urlArray[1];
parse_str($urlParametroString, $_GET);
require_once "classes/model/AppDocumentPeer.php";
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['a'], isset($_GET['v']) ? $_GET['v'] : null);
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo($oAppDocument->getAppDocFilename());
if (!isset($_GET['ext'])) {
$ext = $info['extension'];
} else {
if ($_GET['ext'] != '') {
$ext = $_GET['ext'];
} else {
$ext = $info['extension'];
}
}
$ver = isset($_GET['v']) && $_GET['v'] != '' ? '_' . $_GET['v'] : '';
if (!$ver) {
//This code is in the case the outputdocument won't be versioned
$ver = '_1';
}
$realPath = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext;
$realPath1 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $info['basename'] . $ver . '.' . $ext;
$realPath2 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $info['basename'] . '.' . $ext;
$sw_file_exists = false;
if (file_exists($realPath)) {
$sw_file_exists = true;
} elseif (file_exists($realPath1)) {
$sw_file_exists = true;
$realPath = $realPath1;
} elseif (file_exists($realPath2)) {
$sw_file_exists = true;
$realPath = $realPath2;
}
$swFileExist = 0;
if ($sw_file_exists) {
$swFileExist = 1;
}
return $swFileExist;
}
示例3: Cases
}
if ((int) $_SESSION['INDEX'] < 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ' . $_SERVER['HTTP_REFERER']);
die;
}
/* Includes */
G::LoadClass('case');
G::LoadClass('derivation');
/* GET , POST & $_SESSION Vars */
//$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION'];
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
require_once 'classes/model/AppDocument.php';
require_once 'classes/model/Users.php';
$G_PUBLISH = new Publisher();
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['DOC']);
$oo = $oAppDocument->load($_GET['DOC']);
$oUser = new Users();
$aUser = $oUser->load($oAppDocument->Fields['USR_UID']);
$Fields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
$oAppDocument->Fields['VIEW'] = G::LoadTranslation('ID_OPEN');
$oAppDocument->Fields['FILE'] = 'cases_ShowDocument?a=' . $_GET['DOC'] . '&r=' . rand();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewInputDocumentToRevise', '', G::array_merges($Fields, $oAppDocument->Fields), '');
G::RenderPage('publish');
示例4: AppDocument
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/*
* Created on 13-02-2008
*
* @author David Callizaya <davidsantos@colosa.com>
*/
if (!isset($_SESSION['PROCESS'])) {
G::header('location: login');
}
require_once "classes/model/AppDocumentPeer.php";
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['a']);
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo($oAppDocument->getAppDocFilename());
if (!isset($_GET['ext'])) {
$ext = $info['extension'];
} else {
if ($_GET['ext'] != '') {
$ext = $_GET['ext'];
} else {
$ext = $info['extension'];
}
}
$realPath = PATH_DOCUMENT . $_SESSION['APPLICATION'] . '/outdocs/' . $info['basename'] . '.' . $ext;
G::streamFile($realPath, true);
示例5: getAllObjectsFromProcess
public function getAllObjectsFromProcess($PRO_UID, $OBJ_TYPE = '%')
{
$RESULT = Array();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(AppDocumentPeer::APP_DOC_UID);
$oCriteria->addSelectColumn(AppDocumentPeer::APP_UID);
$oCriteria->addSelectColumn(AppDocumentPeer::DEL_INDEX);
$oCriteria->addSelectColumn(AppDocumentPeer::DOC_UID);
$oCriteria->addSelectColumn(AppDocumentPeer::USR_UID);
$oCriteria->addSelectColumn(AppDocumentPeer::APP_DOC_TYPE);
$oCriteria->addSelectColumn(AppDocumentPeer::APP_DOC_CREATE_DATE);
$oCriteria->addSelectColumn(AppDocumentPeer::APP_DOC_INDEX);
$oCriteria->addSelectColumn(AppDocumentPeer::DOC_VERSION);
$oCriteria->add(ApplicationPeer::PRO_UID, $PRO_UID);
$oCriteria->addJoin(ApplicationPeer::APP_UID, AppDocumentPeer::APP_UID);
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, $OBJ_TYPE, Criteria::LIKE);
$oDataset = DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($oDataset->next()) {
$row = $oDataset->getRow();
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($row['APP_DOC_UID'], $row['DOC_VERSION']);
$row['APP_DOC_FILENAME'] = $oAppDocument->Fields['APP_DOC_FILENAME'];
array_push($RESULT, $row);
}
return $RESULT;
}
示例6: getCasesInputDocuments
/**
* Get data of Cases InputDocument
*
* @param string $applicationUid
* @param string $userUid
*
* return array Return an array with data of an InputDocument
*/
public function getCasesInputDocuments($applicationUid, $userUid)
{
try {
//Verify data inbox
$case = new \ProcessMaker\BusinessModel\Cases();
$arrayResult = $case->getStatusInfo($applicationUid, 0, $userUid);
$flagInbox = true;
if (empty($arrayResult) || !preg_match("/^(?:TO_DO|DRAFT)\$/", $arrayResult["APP_STATUS"])) {
$flagInbox = false;
}
$user = new \Users();
$appDocument = new \AppDocument();
$configuraction = new \Configurations();
$confEnvSetting = $configuraction->getFormats();
$arrayInputDocument = array();
//Query
$criteria = $this->getAppDocumentCriteriaByData($applicationUid);
if (!$flagInbox) {
$criteria->add(\AppDocumentPeer::USR_UID, $userUid, \Criteria::EQUAL);
}
$rsCriteria = \AppDocumentPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
/*----------------------------------********---------------------------------*/
$licensedFeatures =& \PMLicensedFeatures::getSingleton();
$enablePMGmail = false;
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
\G::LoadClass("pmDrive");
$pmDrive = new \PMDrive();
$enablePMGmail = $pmDrive->getStatusService();
}
/*----------------------------------********---------------------------------*/
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$arrayUserData = $user->load($row["USR_UID"]);
$arrayAppDocument = $appDocument->load($row["APP_DOC_UID"], $row["DOC_VERSION"]);
$row["APP_DOC_FILENAME"] = $arrayAppDocument["APP_DOC_FILENAME"];
$row["APP_DOC_CREATE_USER"] = $configuraction->usersNameFormatBySetParameters($confEnvSetting["format"], $arrayUserData["USR_USERNAME"], $arrayUserData["USR_FIRSTNAME"], $arrayUserData["USR_LASTNAME"]);
$row["APP_DOC_LINK"] = "cases/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
/*----------------------------------********---------------------------------*/
//change donwload link - drive
$driveDownload = @unserialize($arrayAppDocument['APP_DOC_DRIVE_DOWNLOAD']);
if ($driveDownload !== false && is_array($driveDownload) && $enablePMGmail) {
if (array_key_exists('INPUT', $driveDownload)) {
$row['APP_DOC_LINK'] = $driveDownload['INPUT'];
} else {
if (array_key_exists('ATTACHED', $driveDownload)) {
$row['APP_DOC_LINK'] = $driveDownload['ATTACHED'];
}
}
}
/*----------------------------------********---------------------------------*/
$arrayInputDocument[] = $this->getAppDocumentDataFromRecord($row);
}
//Return
return $arrayInputDocument;
} catch (\Exception $e) {
throw $e;
}
}
示例7: 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;
//.........这里部分代码省略.........
示例8: getCasesInputDocuments
/**
* Get data of Cases InputDocument
*
* @param string $applicationUid
* @param string $userUid
*
* return array Return an array with data of an InputDocument
*/
public function getCasesInputDocuments($applicationUid, $userUid)
{
try {
//Verify data inbox
$case = new \ProcessMaker\BusinessModel\Cases();
$arrayResult = $case->getStatusInfo($applicationUid, 0, $userUid);
$flagInbox = true;
if (empty($arrayResult) || !preg_match("/^(?:TO_DO|DRAFT)$/", $arrayResult["APP_STATUS"])) {
$flagInbox = false;
}
$user = new \Users();
$appDocument = new \AppDocument();
$configuraction = new \Configurations();
$confEnvSetting = $configuraction->getFormats();
$arrayInputDocument = array();
//Query
$criteria = $this->getAppDocumentCriteriaByData($applicationUid);
if (!$flagInbox) {
$criteria->add(\AppDocumentPeer::USR_UID, $userUid, \Criteria::EQUAL);
}
$rsCriteria = \AppDocumentPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$arrayUserData = $user->load($row["USR_UID"]);
$arrayAppDocument = $appDocument->load($row["APP_DOC_UID"], $row["DOC_VERSION"]);
$row["APP_DOC_FILENAME"] = $arrayAppDocument["APP_DOC_FILENAME"];
$row["APP_DOC_CREATE_USER"] = $configuraction->usersNameFormatBySetParameters($confEnvSetting["format"], $arrayUserData["USR_USERNAME"], $arrayUserData["USR_FIRSTNAME"], $arrayUserData["USR_LASTNAME"]);
$row["APP_DOC_LINK"] = "cases/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
$arrayInputDocument[] = $this->getAppDocumentDataFromRecord($row);
}
//Return
return $arrayInputDocument;
} catch (\Exception $e) {
throw $e;
}
}
示例9: isset
$dateFormat = "";
$varFlag = isset($generalConfCasesList['casesListDateFormat']);
if ($varFlag && !empty($generalConfCasesList['casesListDateFormat'])) {
$dateFormat = $generalConfCasesList['casesListDateFormat'];
}
$r = new stdclass();
$r->data = $aProcesses;
$r->totalCount = $totalCount;
$r->dataFormat = $dateFormat;
echo Bootstrap::json_encode($r);
break;
case 'showGeneratedDocument':
//require_once 'classes/model/AppDocument.php';
//require_once 'classes/model/AppDelegation.php';
$oAppDocument = new AppDocument();
$aFields = $oAppDocument->load($_POST['APP_DOC_UID']);
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
$aOD = $oOutputDocument->load($aFields['DOC_UID']);
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDelegationPeer::APP_UID, $aFields['APP_UID']);
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $aFields['DEL_INDEX']);
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$oTask = new Task();
$aTask = $oTask->load($aRow['TAS_UID']);
$aFields['ORIGIN'] = $aTask['TAS_TITLE'];
require_once 'classes/model/Users.php';
$oUser = new Users();
示例10: InputDocument
$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']);
}
G::RenderPage('publish', 'raw');
break;
case "inputDocumentVersionHistory":
//krumo($_POST);
$G_PUBLISH = new Publisher();
$Fields['DOC_UID'] = $_POST['docID'];
$Fields['APP_DOC_UID'] = $_POST['appDocId'];
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_InputdocsListHistory', $oCase->getInputDocumentsCriteria($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_POST['docID'], $_POST['appDocId']), array());
//$aFields
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral',
// '', $Fields, 'cases_SaveDocument?UID=' . $_POST['docID']);
示例11: 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) {
//.........这里部分代码省略.........
示例12: documentUploadFiles
/**
* second step for upload file
* upload file in foler app_uid
*
* @param $userUid
* @param $Fields
* @param $type
* @throws \Exception
*/
public function documentUploadFiles($userUid, $app_uid, $app_doc_uid, $request_data)
{
$response = array("status" => "fail");
if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
$arrayField = array ();
$arrayFileName = array ();
$arrayFileTmpName = array ();
$arrayFileError = array ();
$i = 0;
foreach ($_FILES["form"]["name"] as $fieldIndex => $fieldValue) {
if (is_array( $fieldValue )) {
foreach ($fieldValue as $index => $value) {
if (is_array( $value )) {
foreach ($value as $grdFieldIndex => $grdFieldValue) {
$arrayField[$i]["grdName"] = $fieldIndex;
$arrayField[$i]["grdFieldName"] = $grdFieldIndex;
$arrayField[$i]["index"] = $index;
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex][$index][$grdFieldIndex];
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex][$index][$grdFieldIndex];
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex][$index][$grdFieldIndex];
$i = $i + 1;
}
}
}
} else {
$arrayField[$i] = $fieldIndex;
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex];
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex];
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex];
$i = $i + 1;
}
}
if (count( $arrayField ) > 0) {
for ($i = 0; $i <= count( $arrayField ) - 1; $i ++) {
if ($arrayFileError[$i] == 0) {
$indocUid = null;
$fieldName = null;
$fileSizeByField = 0;
$oAppDocument = new \AppDocument();
$aAux = $oAppDocument->load($app_doc_uid);
$iDocVersion = $oAppDocument->getDocVersion();
$sAppDocUid = $oAppDocument->getAppDocUid();
$aInfo = pathinfo( $oAppDocument->getAppDocFilename() );
$sExtension = ((isset( $aInfo["extension"] )) ? $aInfo["extension"] : "");
$pathUID = G::getPathFromUID($app_uid);
$sPathName = PATH_DOCUMENT . $pathUID . PATH_SEP;
$sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $sExtension;
G::uploadFile( $arrayFileTmpName[$i], $sPathName, $sFileName );
$response = array("status" => "ok");
}
}
}
}
return $response;
}
示例13: getAllGeneratedDocumentsCriteria
public function getAllGeneratedDocumentsCriteria($sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID)
{
\G::LoadClass("configuration");
$conf = new \Configurations();
$confEnvSetting = $conf->getFormats();
//verifica si la tabla OBJECT_PERMISSION
$cases = new \cases();
$cases->verifyTable();
$listing = false;
$oPluginRegistry = & \PMPluginRegistry::getSingleton();
if ($oPluginRegistry->existsTrigger(PM_CASE_DOCUMENT_LIST)) {
$folderData = new \folderData(null, null, $sApplicationUID, null, $sUserUID);
$folderData->PMType = "OUTPUT";
$folderData->returnList = true;
//$oPluginRegistry = & PMPluginRegistry::getSingleton();
$listing = $oPluginRegistry->executeTriggers(PM_CASE_DOCUMENT_LIST, $folderData);
}
$aObjectPermissions = $cases->getAllObjects($sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID);
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);
}
}
$aDelete = $cases->getAllObjectsFrom($sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID, 'DELETE');
$oAppDocument = new \AppDocument();
$oCriteria = new \Criteria('workflow');
$oCriteria->add(\AppDocumentPeer::APP_UID, $sApplicationUID);
$oCriteria->add(\AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT');
$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();
$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")';
$fileDocLabel = " ";
$filePdf = 'cases_ShowOutputDocument?a=' .
//.........这里部分代码省略.........
示例14: uploadExternalDocument
function uploadExternalDocument()
{
$response['action']=$_POST['action']. " - ".$_POST['option'];
$response['error']="error";
$response['message']="error";
$response['success']=false;
$overwrite = (isset($_REQUEST['overwrite_files'])) ? $_REQUEST['overwrite_files'] : false;
if (isset($_POST["confirm"]) && $_POST["confirm"] == "true") {
if (isset($_FILES['uploadedFile'])) {
$uploadedInstances=count($_FILES['uploadedFile']['name']);
$sw_error=false;
$sw_error_exists=isset($_FILES['uploadedFile']['error']);
$emptyInstances=0;
$quequeUpload=array();
//overwrite files
if ($overwrite) {
for ($i=0; $i<$uploadedInstances; $i++) {
overwriteFile($_REQUEST['dir'], stripslashes($_FILES['uploadedFile']['name'][$i]));
}
}
// upload files & check for errors
for ($i=0; $i<$uploadedInstances; $i++) {
$errors[$i] = null;
$tmp = $_FILES['uploadedFile']['tmp_name'][$i];
$items[$i] = stripslashes($_FILES['uploadedFile']['name'][$i]);
if ($sw_error_exists) {
$up_err = $_FILES['uploadedFile']['error'][$i];
} else {
$up_err=(file_exists($tmp)?0:4);
}
if ($items[$i]=="" || $up_err==4) {
$emptyInstances++;
continue;
}
if ($up_err==1 || $up_err==2) {
$errors[$i]='miscfilesize';
$sw_error = true;
continue;
}
if ($up_err==3) {
$errors[$i]='miscfilepart';
$sw_error=true;
continue;
}
if (!@is_uploaded_file($tmp)) {
$errors[$i]='uploadfile';
$sw_error=true;
continue;
}
//The uplaoded files seems to be correct and ready to be uploaded. Add to the Queque
$fileInfo=array("tempName"=>$tmp,"fileName"=>$items[$i]);
$quequeUpload[]=$fileInfo;
}
} elseif (isset($_POST['selitems'])) {
$response="";
$response['msg']= "correct reload";
$response['success']=true;
if (isset($_REQUEST['option']) && isset($_REQUEST['copyMove'])) {
if ($_REQUEST['option'] == 'directory' && $_REQUEST['copyMove'] == 'all') {
$response['action'] = $_POST['action']. " - ".$_POST['option'];
$response['error'] = "Complete";
$response['message']= str_replace("Execute", "", $_POST['action']). " ". "Complete";
$response['success']= 'success';
$response['node'] = '';
$_POST ['node'] = "";
$newFolderUid = checkTree($_REQUEST['dir'], $_REQUEST['new_dir']);
}
$_POST['selitems'] = array();
} else {
require_once ("classes/model/AppDocument.php");
$oAppDocument = new AppDocument();
if (isset($_POST['selitems']) && is_array($_POST['selitems'])) {
foreach ($_POST['selitems'] as $docId) {
$arrayDocId = explode ('_',$docId);
$docInfo=$oAppDocument->load($arrayDocId[0]);
$docInfo['FOLDER_UID'] = $_POST['new_dir'];
$docInfo['APP_DOC_CREATE_DATE'] = date('Y-m-d H:i:s');
$oAppDocument->update($docInfo);
}
}
}
}
//G::pr($quequeUpload);
//Read. Instance Document classes
if (!empty($quequeUpload)) {
$docUid=$_POST['docUid'];
$appDocUid=isset($_POST['APP_DOC_UID'])?$_POST['APP_DOC_UID']:"";
$docVersion=isset($_POST['docVersion'])?$_POST['docVersion']:"";
$actionType=isset($_POST['actionType'])?$_POST['actionType']:"";
$folderId=$_POST['dir']==""?"/":$_POST['dir'];
$appId=$_POST['appId'];
$docType=isset($_POST['docType'])?$_GET['docType']:"INPUT";
//save info
require_once ("classes/model/AppDocument.php");
require_once ('classes/model/AppFolder.php');
require_once ('classes/model/InputDocument.php');
$oInputDocument = new InputDocument();
//.........这里部分代码省略.........
示例15: Criteria
$sOptions .= '</tr></table>';
$oCri = new Criteria();
$oCri->add(AppDocumentPeer::APP_UID, $_SESSION['APPLICATION']);
$oCri->add(AppDocumentPeer::DEL_INDEX, $_SESSION['INDEX']);
$oCri->add(AppDocumentPeer::DOC_UID, $aRow->getStepUidObj());
$oCri->add(AppDocumentPeer::APP_DOC_TYPE, 'INPUT');
$oCri->addAscendingOrderByColumn(AppDocumentPeer::APP_DOC_INDEX);
$aDocuments = AppDocumentPeer::doSelect($oCri);
if (sizeof($aDocuments) !== 0) {
$i = 1;
$sOptions .= '<table width="90%" align="center" cellpadding="0" cellspacing="0" border="0">';
reset($aDocuments);
while ($oDocument = current($aDocuments)) {
$aRow2 = $oDocument->toArray(BasePeer::TYPE_FIELDNAME);
$oAux1 = new AppDocument();
$aAux = $oAux1->load($aRow2['APP_DOC_UID']);
$sOptions .= '<tr>';
if ($aAux['APP_DOC_FILENAME'] != '') {
$sAux = $aAux['APP_DOC_FILENAME'];
} else {
$sAux = $aAux['APP_DOC_COMMENT'];
}
$sOptions .= '<td width="5%">' . $i . '.</td><td width="55%" class="treeNodeAlternate"><input type="text" readonly="readonly" style="font:inherit;border:none;width:100%;" value="' . htmlentities($sAux, ENT_QUOTES, "utf-8") . '" title="' . $sAux . '" /></td>';
global $oPluginRegistry;
if (!$oPluginRegistry->existsTrigger(PM_CASE_DOCUMENT_LIST)) {
if (isset($_GET['DOC'])) {
$sOptions .= '<td width="20%" class="treeNode" align="center"><a style="' . ($_GET['TYPE'] == 'INPUT_DOCUMENT' && ($_GET['UID'] == $aRow->getStepUidObj() && $_GET['ACTION'] == 'VIEW' && $_GET['DOC'] == $aRow2['APP_DOC_UID']) ? 'background-color:orange;color:shite;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=VIEW&DOC=' . $aRow2['APP_DOC_UID'] . '&VERSION=' . $aRow2['DOC_VERSION'] . '">' . G::LoadTranslation('ID_VIEW') . '</a></td>';
} else {
$sOptions .= '<td width="20%" class="treeNode" align="center"><a style="" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=VIEW&DOC=' . $aRow2['APP_DOC_UID'] . '&VERSION=' . $aRow2['DOC_VERSION'] . '">' . G::LoadTranslation('ID_VIEW') . '</a></td>';
}
$sOptions .= '<td width="20%" class="treeNode" align="center"><a href="../cases/cases_DeleteDocument?TYPE=INPUT&DOC=' . $aRow2['APP_DOC_UID'] . '" onclick="return confirm(\'' . G::LoadTranslation('ID_CONFIRM_DELETE_ELEMENT') . '\');">' . G::LoadTranslation('ID_DELETE') . '</a></td>';