Merge remote-tracking branch 'upstream/3.0.1.7' into 3.0.1.7-Gmail
This commit is contained in:
@@ -5392,7 +5392,21 @@ class Cases
|
||||
$fileTemplate = $pathEmail . $conf["TAS_DEF_MESSAGE_TEMPLATE"];
|
||||
|
||||
if (!file_exists($fileTemplate)) {
|
||||
throw (new Exception("Template file \"$fileTemplate\" does not exist."));
|
||||
$tempale = PATH_CORE."templates".PATH_SEP."mails".PATH_SEP."alert_message.html";
|
||||
$copied = @copy($tempale,$fileTemplate);
|
||||
if($copied) {
|
||||
$dataTemplate = array("prf_filename"=>$conf["TAS_DEF_MESSAGE_TEMPLATE"],
|
||||
"prf_path"=>$fileTemplate,
|
||||
"pro_uid"=>$aTaskInfo["PRO_UID"],
|
||||
"usr_uid"=>"00000000000000000000000000000001",
|
||||
"prf_uid"=>G::generateUniqueID(),
|
||||
"prf_type"=>"file",
|
||||
"prf_create_date"=>date("Y-m-d H:i:s"));
|
||||
$filesManager = new ProcessMaker\BusinessModel\FilesManager();
|
||||
$filesManager->addProcessFilesManagerInDb($dataTemplate);
|
||||
} else {
|
||||
throw (new Exception("Template file \"$fileTemplate\" does not exist."));
|
||||
}
|
||||
}
|
||||
|
||||
$sBody = G::replaceDataGridField(file_get_contents($fileTemplate), $aFields, false);
|
||||
|
||||
@@ -1063,6 +1063,9 @@ class Derivation
|
||||
$this->case->closeAllDelegations( $currentDelegation['APP_UID'] );
|
||||
$this->case->closeAllThreads( $currentDelegation['APP_UID'] );
|
||||
//I think we need to change the APP_STATUS to completed,
|
||||
if (!isset($nextDel['ROU_CONDITION'])) {
|
||||
$nextDel['ROU_CONDITION'] = '';
|
||||
}
|
||||
if (isset($nextDel["TAS_UID_DUMMY"]) ) {
|
||||
$taskDummy = TaskPeer::retrieveByPK($nextDel["TAS_UID_DUMMY"]);
|
||||
if (preg_match("/^(?:END-MESSAGE-EVENT|END-EMAIL-EVENT)$/", $taskDummy->getTasType())) {
|
||||
|
||||
@@ -1743,6 +1743,9 @@ function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = nu
|
||||
$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 ($aOD['OUT_DOC_PDF_SECURITY_ENABLED'] == '1') {
|
||||
$aProperties['pdfSecurity'] = array('openPassword' => $aOD['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'], 'ownerPassword' => $aOD['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'], 'permissions' => $aOD['OUT_DOC_PDF_SECURITY_PERMISSIONS']);
|
||||
}
|
||||
if (isset($aOD['OUT_DOC_REPORT_GENERATOR'])) {
|
||||
$aProperties['report_generator'] = $aOD['OUT_DOC_REPORT_GENERATOR'];
|
||||
}
|
||||
|
||||
@@ -553,6 +553,15 @@ class ReportTables
|
||||
public function updateTables ($sProcessUid, $sApplicationUid, $iApplicationNumber, $aFields)
|
||||
{
|
||||
try {
|
||||
$c = new Criteria('workflow');
|
||||
$c->addSelectColumn(BpmnProjectPeer::PRJ_UID);
|
||||
$c->add(BpmnProjectPeer::PRJ_UID, $sProcessUid, Criteria::EQUAL);
|
||||
$ds = ProcessPeer::doSelectRS($c);
|
||||
$ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$ds->next();
|
||||
$row = $ds->getRow();
|
||||
$isBpmn = isset($row['PRJ_UID']);
|
||||
|
||||
if (!class_exists('ReportTablePeer')) {
|
||||
require_once 'classes/model/ReportTablePeer.php';
|
||||
}
|
||||
@@ -583,7 +592,7 @@ class ReportTables
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= '`' . $aField['sFieldName'] . '` = ';
|
||||
|
||||
if(!isset($aFields[$aField['sFieldName']])){
|
||||
if(!$isBpmn && !isset($aFields[$aField['sFieldName']])){
|
||||
foreach($aFields as $row){
|
||||
if(is_array($row) && isset($row[count($row)])){
|
||||
$aFields = $row[count($row)];
|
||||
|
||||
@@ -970,10 +970,10 @@ class wsBase
|
||||
$oCase = new Cases();
|
||||
|
||||
$oldFields = $oCase->loadCase( $caseId );
|
||||
if($gmail == 1){
|
||||
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP;
|
||||
}else {
|
||||
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP . $oldFields['PRO_UID'] . PATH_SEP;
|
||||
if($gmail == 1){
|
||||
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP;
|
||||
}else {
|
||||
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP . $oldFields['PRO_UID'] . PATH_SEP;
|
||||
}
|
||||
$fileTemplate = $pathEmail . $sTemplate;
|
||||
G::mk_dir( $pathEmail, 0777, true );
|
||||
@@ -2512,7 +2512,8 @@ class wsBase
|
||||
$oLight = new \ProcessMaker\BusinessModel\Light();
|
||||
$nextIndex = $oLight->getInformationDerivatedCase($appFields['APP_UID'], $delIndex);
|
||||
$notificationMobile = new \ProcessMaker\BusinessModel\Light\NotificationDevice();
|
||||
$notificationMobile->routeCaseNotification($userId, $_SESSION["PROCESS"], $appdel['TAS_UID'], $appFields, $nextDelegations, $nextIndex);
|
||||
$notificationMobile->routeCaseNotification($userId, $_SESSION["PROCESS"], $appdel['TAS_UID'],
|
||||
$appFields, $nextDelegations, $nextIndex, $delIndex);
|
||||
} catch (Exception $e) {
|
||||
\G::log(G::loadTranslation( 'ID_NOTIFICATION_ERROR' ) . '|' . $e->getMessage() , PATH_DATA, "mobile.log");
|
||||
}
|
||||
|
||||
@@ -196,4 +196,22 @@ class NotificationDevice extends BaseNotificationDevice {
|
||||
return (( get_class ($oRow) == 'NotificationDevice' )&&(!is_null($oRow)));
|
||||
}
|
||||
|
||||
public function isExistNextNotification($app_uid, $del_index)
|
||||
{
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::APP_UID);
|
||||
$oCriteria->add(AppDelegationPeer::APP_UID, $app_uid);
|
||||
$oCriteria->add(AppDelegationPeer::DEL_PREVIOUS, $del_index);
|
||||
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
|
||||
$oCriteria->setLimit(1);
|
||||
//execute the query
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
if ($oDataset->next()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
} // NotificationDevice
|
||||
|
||||
Reference in New Issue
Block a user