本文整理汇总了PHP中AppDocument::getLastAppDocVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP AppDocument::getLastAppDocVersion方法的具体用法?PHP AppDocument::getLastAppDocVersion怎么用?PHP AppDocument::getLastAppDocVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppDocument
的用法示例。
在下文中一共展示了AppDocument::getLastAppDocVersion方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AppDocument
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* 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.
*/
require_once "classes/model/AppDocumentPeer.php";
$oAppDocument = new AppDocument();
if (!isset($_GET['v'])) {
//Load last version of the document
$docVersion = $oAppDocument->getLastAppDocVersion($_GET['a']);
} else {
$docVersion = $_GET['v'];
}
$oAppDocument->Fields = $oAppDocument->load($_GET['a'], $docVersion);
$sAppDocUid = $oAppDocument->getAppDocUid();
$iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo($oAppDocument->getAppDocFilename());
$ext = $info['extension'];
if (isset($_GET['b'])) {
if ($_GET['b'] == '0') {
$bDownload = false;
} else {
$bDownload = true;
}
} else {
示例2: unlink
unlink($pathOutput . $sFilename . '.doc');
}
break;
}
}
$outputNextStep = 'cases_Step?TYPE=OUTPUT_DOCUMENT&UID=' . $_GET['UID'] . '&POSITION=' . $_SESSION['STEP_POSITION'] . '&ACTION=VIEW&DOC=' . $sDocUID;
G::header('location: ' . $outputNextStep);
die;
break;
case 'VIEW':
if ($noShowTitle == 0) {
$G_PUBLISH->AddContent('smarty', 'cases/cases_title', '', '', $array);
}
require_once 'classes/model/AppDocument.php';
$oAppDocument = new AppDocument();
$lastVersion = $oAppDocument->getLastAppDocVersion($_GET['DOC'], $_SESSION['APPLICATION']);
$aFields = $oAppDocument->load($_GET['DOC'], $lastVersion);
$listing = false;
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if ($oPluginRegistry->existsTrigger(PM_CASE_DOCUMENT_LIST)) {
$folderData = new folderData(null, null, $_SESSION['APPLICATION'], null, $_SESSION['USER_LOGGED']);
$folderData->PMType = "OUTPUT";
$folderData->returnList = true;
$listing = $oPluginRegistry->executeTriggers(PM_CASE_DOCUMENT_LIST, $folderData);
}
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
$aGields = $oOutputDocument->load($aFields['DOC_UID']);
if (isset($aGields['OUT_DOC_VERSIONING']) && $aGields['OUT_DOC_VERSIONING'] != 0) {
$oAppDocument = new AppDocument();
$lastDocVersion = $oAppDocument->getLastDocVersion($_GET['UID'], $_SESSION['APPLICATION']);
示例3: getAllUploadedDocumentsCriteria
//.........这里部分代码省略.........
$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)');
}
$aAux = $oAppDocument->load($aRow['APP_DOC_UID'], $aRow['DOC_VERSION']);
$lastVersion = $oAppDocument->getLastAppDocVersion($aRow['APP_DOC_UID'], $sApplicationUID);
try {
$aAux1 = $oUser->load($aAux['USR_UID']);
$sUser = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $aAux1["USR_USERNAME"], $aAux1["USR_FIRSTNAME"], $aAux1["USR_LASTNAME"]);
} catch (Exception $oException) {
//$sUser = '(USER DELETED)';
$sUser = '***';
}
$aFields = array(
'APP_DOC_UID' => $aAux['APP_DOC_UID'],
'DOC_UID' => $aAux['DOC_UID'],
'APP_DOC_COMMENT' => $aAux['APP_DOC_COMMENT'],
'APP_DOC_FILENAME' => $aAux['APP_DOC_FILENAME'],
'APP_DOC_INDEX' => $aAux['APP_DOC_INDEX'],
示例4: removeOutputDocument
/**
* Delete OutputDocument
*
* @param string $applicationDocumentUid
*
*/
public function removeOutputDocument($applicationDocumentUid)
{
try {
$oAppDocumentVersion = new \AppDocument();
$lastDocVersion = $oAppDocumentVersion->getLastAppDocVersion($applicationDocumentUid);
$oAppDocument = \AppDocumentPeer::retrieveByPK( $applicationDocumentUid, $lastDocVersion);
if (is_null( $oAppDocument ) || $oAppDocument->getAppDocStatus() == 'DELETED') {
throw new \Exception(\G::LoadTranslation("ID_CASES_OUTPUT_DOES_NOT_EXIST", array($applicationDocumentUid)));
}
$aFields = array ('APP_DOC_UID' => $applicationDocumentUid,'DOC_VERSION' => $lastDocVersion,'APP_DOC_STATUS' => 'DELETED');
$oAppDocument->update( $aFields );
} catch (\Exception $e) {
throw $e;
}
}
示例5: 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;
//.........这里部分代码省略.........
示例6: downloadFile
/**
* Download files and resize dimensions in file type image
* if not type image return content file
*
* return array Return an array with Task Case
*/
public function downloadFile($app_uid, $request_data)
{
try {
$oAppDocument = new \AppDocument();
$arrayFiles = array();
foreach ($request_data as $key => $fileData) {
if (! isset( $fileData['version'] )) {
//Load last version of the document
$docVersion = $oAppDocument->getLastAppDocVersion( $fileData['fileId'] );
} else {
$docVersion = $fileData['version'];
}
$oAppDocument->Fields = $oAppDocument->load( $fileData['fileId'], $docVersion );
$sAppDocUid = $oAppDocument->getAppDocUid();
$iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
$ext = (isset($info['extension'])?$info['extension']:'');//BUG fix: must handle files without any extension
//$app_uid = \G::getPathFromUID($oAppDocument->Fields['APP_UID']);
$file = \G::getPathFromFileUID($oAppDocument->Fields['APP_UID'], $sAppDocUid);
$realPath = PATH_DOCUMENT . G::getPathFromUID($app_uid) . '/' . $file[0] . $file[1] . '_' . $iDocVersion . '.' . $ext;
$realPath1 = PATH_DOCUMENT . G::getPathFromUID($app_uid) . '/' . $file[0] . $file[1] . '.' . $ext;
$width = isset($fileData['width']) ? $fileData['width']:null;
$height = isset($fileData['height']) ? $fileData['height']:null;
if (file_exists( $realPath )) {
switch($ext){
case 'jpg':
case 'jpeg':
case 'gif':
case 'png':
$arrayFiles[$key]['fileId'] = $fileData['fileId'];
$arrayFiles[$key]['fileContent'] = base64_encode($this->imagesThumbnails($realPath, $ext, $width, $height));
break;
default:
$fileTmp = fopen($realPath, "r");
$content = fread($fileTmp, filesize($realPath));
$arrayFiles[$key]['fileId'] = $fileData['fileId'];
$arrayFiles[$key]['fileContent'] = base64_encode($content);
fclose($fileTmp);
break;
}
} elseif (file_exists( $realPath1 )) {
switch($ext){
case 'jpg':
case 'jpeg':
case 'gif':
case 'png':
$arrayFiles[$key]['fileId'] = $fileData['fileId'];
$arrayFiles[$key]['fileContent'] = $this->imagesThumbnails($realPath1, $ext, $width, $height);
break;
default:
$fileTmp = fopen($realPath, "r");
$content = fread($fileTmp, filesize($realPath));
$arrayFiles[$key]['fileId'] = $fileData['fileId'];
$arrayFiles[$key]['fileContent'] = base64_encode($content);
fclose($fileTmp);
break;
}
}
}
} catch (\Exception $e) {
throw $e;
}
return $arrayFiles;
}
示例7: isset
<?php
$actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : null;
if ($actionAjax == "streaming") {
$app_uid = isset($_REQUEST['a']) ? $_REQUEST['a'] : null;
$inp_doc_uid = isset($_REQUEST['d']) ? $_REQUEST['d'] : null;
$oAppDocument = new \AppDocument();
if (!isset($fileData['version'])) {
$docVersion = $oAppDocument->getLastAppDocVersion($inp_doc_uid);
} else {
$docVersion = $fileData['version'];
}
$oAppDocument->Fields = $oAppDocument->load($inp_doc_uid, $docVersion);
$sAppDocUid = $oAppDocument->getAppDocUid();
$iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo($oAppDocument->getAppDocFilename());
$ext = isset($info['extension']) ? $info['extension'] : '';
$file = \G::getPathFromFileUID($oAppDocument->Fields['APP_UID'], $sAppDocUid);
$realPath = PATH_DOCUMENT . G::getPathFromUID($app_uid) . '/' . $file[0] . $file[1] . '_' . $iDocVersion . '.' . $ext;
$realPath1 = PATH_DOCUMENT . G::getPathFromUID($app_uid) . '/' . $file[0] . $file[1] . '.' . $ext;
if (file_exists($realPath)) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mimeType = finfo_file($finfo, $realPath);
finfo_close($finfo);
if ($ext == "mp3") {
$mimeType = "audio/mpeg";
}
rangeDownload($realPath, $mimeType);
} elseif (file_exists($realPath1)) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mimeType = finfo_file($finfo, $realPath1);