本文整理汇总了PHP中Application::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::Load方法的具体用法?PHP Application::Load怎么用?PHP Application::Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::Load方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reassignCase
public function reassignCase($sApplicationUID, $iDelegation, $sUserUID, $newUserUID, $sType = 'REASSIGN')
{
$this->CloseCurrentDelegation($sApplicationUID, $iDelegation);
$oAppDelegation = new AppDelegation();
$aFieldsDel = $oAppDelegation->Load($sApplicationUID, $iDelegation);
$iIndex = $oAppDelegation->createAppDelegation(
$aFieldsDel['PRO_UID'], $aFieldsDel['APP_UID'], $aFieldsDel['TAS_UID'], $aFieldsDel['USR_UID'], $aFieldsDel['DEL_THREAD']
);
$aData = array();
$aData['APP_UID'] = $aFieldsDel['APP_UID'];
$aData['DEL_INDEX'] = $iIndex;
$aData['DEL_PREVIOUS'] = $aFieldsDel['DEL_PREVIOUS'];
$aData['DEL_TYPE'] = $aFieldsDel['DEL_TYPE'];
$aData['DEL_PRIORITY'] = $aFieldsDel['DEL_PRIORITY'];
$aData['DEL_DELEGATE_DATE'] = $aFieldsDel['DEL_DELEGATE_DATE'];
$aData['USR_UID'] = $newUserUID;
$aData['DEL_INIT_DATE'] = null;
$aData['DEL_FINISH_DATE'] = null;
$oAppDelegation->update($aData);
$oAppThread = new AppThread();
$oAppThread->update(
array(
'APP_UID' => $sApplicationUID,
'APP_THREAD_INDEX' => $aFieldsDel['DEL_THREAD'],
'DEL_INDEX' => $iIndex)
);
//Save in APP_DELAY
$oApplication = new Application();
$aFields = $oApplication->Load($sApplicationUID);
$aData['PRO_UID'] = $aFieldsDel['PRO_UID'];
$aData['APP_UID'] = $sApplicationUID;
$aData['APP_THREAD_INDEX'] = $aFieldsDel['DEL_THREAD'];
$aData['APP_DEL_INDEX'] = $iDelegation;
$aData['APP_TYPE'] = ($sType != '' ? $sType : 'REASSIGN');
$aData['APP_STATUS'] = $aFields['APP_STATUS'];
$aData['APP_DELEGATION_USER'] = $sUserUID;
$aData['APP_ENABLE_ACTION_USER'] = $sUserUID;
$aData['APP_ENABLE_ACTION_DATE'] = date('Y-m-d H:i:s');
$oAppDelay = new AppDelay();
$oAppDelay->create($aData);
//update searchindex
if ($this->appSolr != null) {
$this->appSolr->updateApplicationSearchIndex($sApplicationUID);
}
/*----------------------------------********---------------------------------*/
$this->getExecuteTriggerProcess($sApplicationUID, 'REASSIGNED');
return true;
//.........这里部分代码省略.........
示例2: appTitleByTaskCaseLabelUpdate
public function appTitleByTaskCaseLabelUpdate($taskUid, $lang, $cron = 0)
{
$taskDefTitle = null;
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add(ContentPeer::CON_CATEGORY, "TAS_DEF_TITLE");
$criteria->add(ContentPeer::CON_ID, $taskUid);
$criteria->add(ContentPeer::CON_LANG, $lang);
$rsCriteria = ContentPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$taskDefTitle = $row["CON_VALUE"];
}
//Get cases
$criteriaAPPCV = new Criteria("workflow");
$criteriaAPPCV->setDistinct();
$criteriaAPPCV->addSelectColumn(AppCacheViewPeer::APP_UID);
$criteriaAPPCV->add(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN");
$criteriaAPPCV->add(AppCacheViewPeer::TAS_UID, $taskUid);
$rsCriteriaAPPCV = AppCacheViewPeer::doSelectRS($criteriaAPPCV);
$rsCriteriaAPPCV->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteriaAPPCV->next()) {
if ($cron == 1) {
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
$arrayCron["processcTimeStart"] = time();
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
}
$row = $rsCriteriaAPPCV->getRow();
$appcvAppUid = $row["APP_UID"];
//Current task?
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(AppCacheViewPeer::APP_UID);
$criteria->add(AppCacheViewPeer::APP_UID, $appcvAppUid);
$criteria->add(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN");
$criteria->add(AppCacheViewPeer::TAS_UID, $taskUid);
$rsCriteria = AppCacheViewPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
$appTitle = $taskDefTitle;
$app = new Application();
$arrayAppField = $app->Load($appcvAppUid);
$appTitle = !empty($appTitle) ? $appTitle : "#" . $arrayAppField["APP_NUMBER"];
$appTitleNew = G::replaceDataField($appTitle, unserialize($arrayAppField["APP_DATA"]));
if (isset($arrayAppField["APP_TITLE"]) && $arrayAppField["APP_TITLE"] != $appTitleNew) {
//Updating the value in content, where...
$criteria1 = new Criteria("workflow");
$criteria1->add(ContentPeer::CON_CATEGORY, "APP_TITLE");
$criteria1->add(ContentPeer::CON_ID, $appcvAppUid);
$criteria1->add(ContentPeer::CON_LANG, $lang);
//Update set
$criteria2 = new Criteria("workflow");
$criteria2->add(ContentPeer::CON_VALUE, $appTitleNew);
BasePeer::doUpdate($criteria1, $criteria2, Propel::getConnection("workflow"));
}
}
}
}
示例3: pathinfo
$aInfo = pathinfo($oAppDocument->getAppDocFilename());
$sExtension = isset($aInfo["extension"]) ? $aInfo["extension"] : "";
$pathUID = G::getPathFromUID($_SESSION["APPLICATION"]);
$sPathName = PATH_DOCUMENT . $pathUID . PATH_SEP;
$sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $sExtension;
/*----------------------------------********---------------------------------*/
$licensedFeatures =& PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
G::LoadClass("pmDrive");
$pmDrive = new PMDrive();
if ($pmDrive->getStatusService()) {
$app = new Application();
$user = new Users();
$dataUser = $user->load($_SESSION['USER_LOGGED']);
$pmDrive->setDriveUser($dataUser['USR_EMAIL']);
$appData = $app->Load($_SESSION['APPLICATION']);
if ($appData['APP_DRIVE_FOLDER_UID'] == null) {
$process = new Process();
$process->setProUid($appData['PRO_UID']);
$result = $pmDrive->createFolder($process->getProTitle() . ' - ' . G::LoadTranslation("ID_CASE") . ' #' . $appData['APP_NUMBER'], $pmDrive->getFolderIdPMDrive($_SESSION['USER_LOGGED']));
$appData['APP_DRIVE_FOLDER_UID'] = $result->id;
$app->update($appData);
}
$result = $pmDrive->uploadFile('application/' . $sExtension, $arrayFileTmpName[$i], $arrayFileName[$i], $appData['APP_DRIVE_FOLDER_UID']);
$oAppDocument->setDriveDownload('ATTACHED', $result->webContentLink);
$fileIdDrive = $result->id;
$aFields['DOC_VERSION'] = $iDocVersion;
$aFields['APP_DOC_UID'] = $sAppDocUid;
$oAppDocument->update($aFields);
//add permissions
$criteria = new Criteria('workflow');
示例4: parseTags
/**
*
* @param string $fileTags
* @param string(32) $sessionID Application ID
* @return string
*/
public function parseTags ($fileTags, $sessionID = "")
{
if ($sessionID == "") {
$sessionID = $_SESSION['APPLICATION'];
//Get current Application Fields
}
$oApplication = new Application();
$appFields = $oApplication->Load( $sessionID );
$fileTagsParsed = G::replaceDataField( $fileTags, $appFields );
$fileTagsParsed = G::replaceDataField( $fileTags, unserialize( $appFields['APP_DATA'] ) );
return $fileTagsParsed;
}
示例5: array
$aFields = array("APP_UID" => $_POST["APPLICATION"], "DEL_INDEX" => $_POST["INDEX"], "USR_UID" => $_POST["USR_UID"], "DOC_UID" => $_POST["DOC_UID"], "APP_DOC_TYPE" => $_POST["APP_DOC_TYPE"], "APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"), "APP_DOC_COMMENT" => isset($_POST["COMMENT"]) ? $_POST["COMMENT"] : "", "APP_DOC_TITLE" => isset($_POST["TITLE"]) ? $_POST["TITLE"] : "", "APP_DOC_FILENAME" => isset($_FILES["ATTACH_FILE"]["name"]) ? $_FILES["ATTACH_FILE"]["name"] : "", "FOLDER_UID" => $folderId, "APP_DOC_TAGS" => $fileTags, "APP_DOC_FIELDNAME" => $_POST["APP_DOC_FIELDNAME"]);
}
$oAppDocument->create($aFields);
$sAppUid = $oAppDocument->getAppUid();
$sAppDocUid = $oAppDocument->getAppDocUid();
$iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo($oAppDocument->getAppDocFilename());
$ext = isset($info["extension"]) ? $info["extension"] : "";
//Save the file
echo $sPathName = PATH_DOCUMENT . $sAppUid . PATH_SEP;
echo $sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $ext;
print G::uploadFile($_FILES["ATTACH_FILE"]["tmp_name"], $sPathName, $sFileName);
print "* The file " . $_FILES["ATTACH_FILE"]["name"] . " was uploaded successfully in case " . $sAppUid . " as input document..\n";
//Get current Application Fields
$application = new Application();
$appFields = $application->Load($_POST["APPLICATION"]);
$appFields = unserialize($appFields["APP_DATA"]);
$_SESSION["APPLICATION"] = $appFields["APPLICATION"];
$_SESSION["PROCESS"] = $appFields["PROCESS"];
$_SESSION["TASK"] = $appFields["TASK"];
$_SESSION["INDEX"] = $appFields["INDEX"];
$_SESSION["USER_LOGGED"] = $appFields["USER_LOGGED"];
//$_POST["USR_UID"]
//$_SESSION["USR_USERNAME"] = $appFields["USR_USERNAME"];
//$_SESSION["STEP_POSITION"] = 0;
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if ($oPluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists("uploadDocumentData")) {
$triggerDetail = $oPluginRegistry->getTriggerInfo(PM_UPLOAD_DOCUMENT);
$documentData = new uploadDocumentData($_POST["APPLICATION"], $_POST["USR_UID"], $sPathName . $sFileName, $aFields["APP_DOC_FILENAME"], $sAppDocUid, $iDocVersion);
$uploadReturn = $oPluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData);
示例6: rand
$t->isa_ok($e, 'Exception', 'update() returns error when APP_UID is not defined');
//#24
$t->is($e->getMessage(), "The row '' in table APPLICATION doesn't exist!", "update() This row doesn't exist!");
}
//update with $fields
$newTitle = 'new title';
$Fields['APP_UID'] = $appUid;
$Fields['APP_TITLE'] = $newTitle;
$Fields['APP_PARENT'] = rand(1000, 5000);
$Fields['APP_INIT_DATE'] = 'now';
try {
$obj = new Application();
$res = $obj->update($Fields);
//#25
$t->is($res, 1, "update() update 1 row");
$Fields = $obj->Load($appUid);
//#26
$t->is($obj->getAppUid(), $appUid, "update() APP_UID = " . $appUid);
//#27
$t->is($obj->getAppTitle(), $newTitle, "update() getAppTitle");
//#28
$t->is($Fields['APP_TITLE'], $newTitle, "update() APP_TITLE= " . $newTitle);
//#29
$t->is($Fields['APP_INIT_DATE'], date('Y-m-d H:i:s'), "update() APP_INIT_DATE= " . date('Y-m-d H:i:s'));
} catch (Exception $e) {
//#14
// $t->isa_ok( $e, 'PropelException', 'update() return error ' . $e->getMessage() );
$t->isa_ok($e, 'Exception', 'update() return error ' . $e->getMessage());
}
//remove with empty
try {
示例7: array
$aFields = array('APP_UID' => $_POST['APPLICATION'], 'DEL_INDEX' => $_POST['INDEX'], 'USR_UID' => $_POST['USR_UID'], 'DOC_UID' => $_POST['DOC_UID'], 'APP_DOC_TYPE' => $_POST['APP_DOC_TYPE'], 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), 'APP_DOC_COMMENT' => isset($_POST['COMMENT']) ? $_POST['COMMENT'] : '', 'APP_DOC_TITLE' => isset($_POST['TITLE']) ? $_POST['TITLE'] : '', 'APP_DOC_FILENAME' => isset($_FILES['ATTACH_FILE']['name']) ? $_FILES['ATTACH_FILE']['name'] : '', 'FOLDER_UID' => $folderId, 'APP_DOC_TAGS' => $fileTags);
}
$oAppDocument->create($aFields);
$sAppUid = $oAppDocument->getAppUid();
$sAppDocUid = $oAppDocument->getAppDocUid();
$iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo($oAppDocument->getAppDocFilename());
$ext = isset($info['extension']) ? $info['extension'] : '';
//Save the file
echo $sPathName = PATH_DOCUMENT . $sAppUid . PATH_SEP;
echo $sFileName = $sAppDocUid . '_' . $iDocVersion . '.' . $ext;
print G::uploadFile($_FILES['ATTACH_FILE']['tmp_name'], $sPathName, $sFileName);
print "* The file {$_FILES['ATTACH_FILE']['name']} was uploaded successfully in case {$sAppUid} as input document..\n";
//Get current Application Fields
$application = new Application();
$appFields = $application->Load($_POST['APPLICATION']);
$appFields = unserialize($appFields['APP_DATA']);
$_SESSION['APPLICATION'] = $appFields['APPLICATION'];
$_SESSION['PROCESS'] = $appFields['PROCESS'];
$_SESSION['TASK'] = $appFields['TASK'];
$_SESSION['INDEX'] = $appFields['INDEX'];
$_SESSION['USER_LOGGED'] = $appFields['USER_LOGGED'];
//$_POST['USR_UID']
//$_SESSION['USR_USERNAME'] = $appFields['USR_USERNAME'];
//$_SESSION['STEP_POSITION'] = 0;
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if ($oPluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists("uploadDocumentData")) {
$triggerDetail = $oPluginRegistry->getTriggerInfo(PM_UPLOAD_DOCUMENT);
$documentData = new uploadDocumentData($_POST["APPLICATION"], $_POST["USR_UID"], $sPathName . $sFileName, $aFields["APP_DOC_FILENAME"], $sAppDocUid, $iDocVersion);
$uploadReturn = $oPluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData);
示例8: getTasks
/**
* Get all Tasks of Case
* Based in: processmaker/workflow/engine/classes/class.processMap.php
* Method: processMap::load()
*
* @param string $applicationUid Unique id of Case
*
* return array Return an array with all Tasks of Case
*/
public function getTasks($applicationUid)
{
try {
$arrayTask = array();
//Verify data
$this->throwExceptionIfNotExistsCase($applicationUid, 0, $this->getFieldNameByFormatFieldName("APP_UID"));
//Set variables
$process = new \Process();
$application = new \Application();
$conf = new \Configurations();
$arrayApplicationData = $application->Load($applicationUid);
$processUid = $arrayApplicationData["PRO_UID"];
$confEnvSetting = $conf->getFormats();
$taskUid = "";
//Get data
//SQL
$delimiter = \DBAdapter::getStringDelimiter();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\TaskPeer::TAS_UID);
$criteria->addAsColumn("TAS_TITLE", "CT.CON_VALUE");
$criteria->addAsColumn("TAS_DESCRIPTION", "CD.CON_VALUE");
$criteria->addSelectColumn(\TaskPeer::TAS_START);
$criteria->addSelectColumn(\TaskPeer::TAS_TYPE);
$criteria->addSelectColumn(\TaskPeer::TAS_DERIVATION);
$criteria->addSelectColumn(\TaskPeer::TAS_ASSIGN_TYPE);
$criteria->addSelectColumn(\UsersPeer::USR_UID);
$criteria->addSelectColumn(\UsersPeer::USR_USERNAME);
$criteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
$criteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
$criteria->addAlias("CT", \ContentPeer::TABLE_NAME);
$criteria->addAlias("CD", \ContentPeer::TABLE_NAME);
$arrayCondition = array();
$arrayCondition[] = array(\TaskPeer::TAS_UID, "CT.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "TAS_TITLE" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$arrayCondition = array();
$arrayCondition[] = array(\TaskPeer::TAS_UID, "CD.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_CATEGORY", $delimiter . "TAS_DESCRIPTION" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$criteria->addJoin(\TaskPeer::TAS_LAST_ASSIGNED, \UsersPeer::USR_UID, \Criteria::LEFT_JOIN);
$criteria->add(\TaskPeer::PRO_UID, $processUid, \Criteria::EQUAL);
$rsCriteria = \TaskPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
//Task
if ($row["TAS_TYPE"] == "NORMAL") {
if (($row["TAS_TITLE"] . "" == "")) {
//There is no Label in Current SYS_LANG language so try to find in English - by default
$task = new \Task();
$task->setTasUid($row["TAS_UID"]);
$row["TAS_TITLE"] = $task->getTasTitle();
}
} else {
$criteria2 = new \Criteria("workflow");
$criteria2->addSelectColumn(\SubProcessPeer::PRO_UID);
$criteria2->addAsColumn("TAS_TITLE", "CT.CON_VALUE");
$criteria2->addAsColumn("TAS_DESCRIPTION", "CD.CON_VALUE");
$criteria2->addAlias("CT", \ContentPeer::TABLE_NAME);
$criteria2->addAlias("CD", \ContentPeer::TABLE_NAME);
$arrayCondition = array();
$arrayCondition[] = array(\SubProcessPeer::TAS_PARENT, "CT.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "TAS_TITLE" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria2->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$arrayCondition = array();
$arrayCondition[] = array(\SubProcessPeer::TAS_PARENT, "CD.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_CATEGORY", $delimiter . "TAS_DESCRIPTION" . $delimiter, \Criteria::EQUAL);
//.........这里部分代码省略.........
示例9: sendEmail
/**
* Send email using appUid and mail
*
* @param string $app_uid Unique id of the app
* @param string $mail
*
* return uid
*
*/
public function sendEmail($app_uid, $mail, $index)
{
require_once PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Application.php";
$oApplication = new \Application();
$formData = $oApplication->Load($app_uid);
$frmData = unserialize($formData['APP_DATA']);
$dataFormToShowString = "";
foreach ($frmData as $field => $value) {
if ($field != 'SYS_LANG' && $field != 'SYS_SKIN' && $field != 'SYS_SYS' && $field != 'APPLICATION' && $field != 'PROCESS' && $field != 'TASK' && $field != 'INDEX' && $field != 'USER_LOGGED' && $field != 'USR_USERNAME' && $field != 'DYN_CONTENT_HISTORY' && $field != 'PIN') {
$dataFormToShowString .= " " . $field . " " . $value;
}
}
$appData = $this->getDraftApp($app_uid, $index);
foreach ($appData as $application) {
$appNumber = $application['APP_NUMBER'];
$appStatus = $application['APP_STATUS'];
$index = $application['DEL_INDEX'];
$prvUsr = $application['APP_DEL_PREVIOUS_USER'];
$delegateDate = $application['DEL_DELEGATE_DATE'];
$nextUsr = $application['USR_UID'];
$proUid = $application['PRO_UID'];
$proName = $application['APP_PRO_TITLE'];
$tasName = $application['APP_TAS_TITLE'];
$threadStatus = $application['DEL_THREAD_STATUS'];
$tasUid = $application['TAS_UID'];
$lastIndex = $application['DEL_LAST_INDEX'];
if ($appStatus == "DRAFT") {
$labelID = "PMDRFT";
} else {
$labelID = "PMIBX";
}
if ($mail == "") {
require_once PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php";
$oUsers = new \Users();
if ($nextUsr == "") {
//Unassigned:
$mail = "";
require_once PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "TaskUser.php";
$oTaskUsers = new \TaskUser();
$taskUsers = $oTaskUsers->getAllUsersTask($tasUid);
foreach ($taskUsers as $user) {
$usrData = $oUsers->loadDetails($user['USR_UID']);
$nextMail = $usrData['USR_EMAIL'];
$mail .= $mail == '' ? $nextMail : ',' . $nextMail;
}
$labelID = "PMUASS";
} else {
$usrData = $oUsers->loadDetails($nextUsr);
$mail = $usrData['USR_EMAIL'];
}
}
//first template
$pathTemplate = PATH_DATA_SITE . "mailTemplates" . PATH_SEP . "pmGmail.html";
if (!file_exists($pathTemplate)) {
$file = @fopen($pathTemplate, "w");
fwrite($file, '<div>');
fwrite($file, '<span style="display: none !important;">');
fwrite($file, '-**- Process Name: @#proName<br/>');
fwrite($file, '-**- Case Number: @#appNumber<br/>');
fwrite($file, '-**- Case UID: @#caseUid<br/>');
fwrite($file, '-**- Task Name: @#taskName<br/>');
fwrite($file, '-**- Index: @#index<br/>');
fwrite($file, '-**- Action: @#action<br/>');
fwrite($file, '-**- Previous User: @#prevUser<br/>');
fwrite($file, '-**- Delegate Date: @#delDate<br/>');
fwrite($file, '-**- Process Id: @#proUid<br/>');
fwrite($file, '-**- Type: @#type<br/>');
fwrite($file, '-**- FormFields: @@oform<br/>');
fwrite($file, '</span>');
fwrite($file, '</div>');
fclose($file);
}
$change = array('[', ']', '"');
$fdata = str_replace($change, ' ', $dataFormToShowString);
$aFields = array('proName' => $proName, 'appNumber' => $appNumber, 'caseUid' => $app_uid, 'taskName' => $tasName, 'index' => $index, 'action' => $appStatus, 'prevUser' => $prvUsr, 'delDate' => $delegateDate, 'proUid' => $proUid, 'type' => $labelID, 'oform' => $fdata);
$subject = "[PM] " . $proName . " (" . $index . ") Case: " . $appNumber;
require_once PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "class.wsBase.php";
$ws = new \wsBase();
$resultMail = $ws->sendMessage($app_uid, 'inbox.pm@processmaker.com', $mail, '', '', $subject, 'pmGmail.html', $aFields, array(), true, 0, array(), 1);
return $resultMail;
}
return 'The appUid cant be founded';
}
示例10: 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();
//.........这里部分代码省略.........
示例11: unset
unset($Fields['APP_PROC_CODE']);
unset($Fields['APP_PIN']);
$oCase->updateCase($_SESSION['APPLICATION'], $Fields);
//Save data - End
/*----------------------------------********---------------------------------*/
$licensedFeatures =& PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
G::LoadClass("pmDrive");
$pmDrive = new PMDrive();
if ($pmDrive->getStatusService()) {
$app = new Application();
$user = new Users();
$dataUser = $user->load($_SESSION['USER_LOGGED']);
$pmDrive->setDriveUser($dataUser['USR_EMAIL']);
$applicationUid = $_SESSION['APPLICATION'];
$appData = $app->Load($applicationUid);
if ($appData['APP_DRIVE_FOLDER_UID'] == null) {
$process = new Process();
$process->setProUid($appData['PRO_UID']);
$result = $pmDrive->createFolder($process->getProTitle() . ' - ' . G::LoadTranslation("ID_CASE") . ' #' . $appData['APP_NUMBER'], $pmDrive->getFolderIdPMDrive($_SESSION['USER_LOGGED']));
$appData['APP_DRIVE_FOLDER_UID'] = $result->id;
$app->update($appData);
}
$fileIdDriveDoc = '';
$fileIdDrivePdf = '';
switch ($aOD['OUT_DOC_GENERATE']) {
case "BOTH":
$result = $pmDrive->uploadFile('application/pdf', $pathOutput . $sFilename . '.pdf', $sFilenameOriginal . '.pdf', $appData['APP_DRIVE_FOLDER_UID']);
$oAppDocument->setDriveDownload('OUTPUT_PDF', $result->webContentLink);
$fileIdDrivePdf = $result->id;
$result = $pmDrive->uploadFile('application/doc', $pathOutput . $sFilename . '.doc', $sFilenameOriginal . '.doc', $appData['APP_DRIVE_FOLDER_UID']);