Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -807,7 +807,7 @@ class XmlForm_Field
|
|||||||
|
|
||||||
public function NSGridLabel ($show = false)
|
public function NSGridLabel ($show = false)
|
||||||
{
|
{
|
||||||
$idv = 'pm:label="' . $this->pmLabel . '"';
|
$idv = 'pm:label="' . htmlentities($this->pmLabel, ENT_COMPAT, 'utf-8') . '"';
|
||||||
if ($show) {
|
if ($show) {
|
||||||
return $idv;
|
return $idv;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1530,7 +1530,7 @@ function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = nu
|
|||||||
|
|
||||||
G::LoadClass( 'case' );
|
G::LoadClass( 'case' );
|
||||||
$oCase = new Cases();
|
$oCase = new Cases();
|
||||||
$oCase->thisIsTheCurrentUser( $sApplication, $index, $sUserLogged, '', 'cases_List' );
|
$oCase->thisIsTheCurrentUser( $sApplication, $index, $sUserLogged, '', 'casesListExtJs' );
|
||||||
|
|
||||||
//require_once 'classes/model/OutputDocument.php';
|
//require_once 'classes/model/OutputDocument.php';
|
||||||
$oOutputDocument = new OutputDocument();
|
$oOutputDocument = new OutputDocument();
|
||||||
@@ -2109,7 +2109,7 @@ function jumping ($caseId, $delIndex)
|
|||||||
} catch (Exception $oException) {
|
} catch (Exception $oException) {
|
||||||
G::SendTemporalMessage( 'ID_NOT_DERIVATED', 'error', 'labels' );
|
G::SendTemporalMessage( 'ID_NOT_DERIVATED', 'error', 'labels' );
|
||||||
}
|
}
|
||||||
G::header( 'Location: cases_List' );
|
G::header( 'Location: casesListExtJs' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -120,5 +120,13 @@ class AppMessage extends BaseAppMessage
|
|||||||
return $this->getAppMsgUid();
|
return $this->getAppMsgUid();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateStatus($msgUid, $msgStatus)
|
||||||
|
{
|
||||||
|
$message = AppMessagePeer::retrieveByPk( $msgUid );
|
||||||
|
$message->fromArray( $message, BasePeer::TYPE_FIELDNAME );
|
||||||
|
$message->setAppMsgStatus($msgStatus);
|
||||||
|
$message->save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,5 +85,6 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1) {
|
|||||||
$G_TMP_MENU->AddIdRawOption('EVENT', '../events/eventList', G::LoadTranslation('ID_EVENTS'), '', '', 'logs');
|
$G_TMP_MENU->AddIdRawOption('EVENT', '../events/eventList', G::LoadTranslation('ID_EVENTS'), '', '', 'logs');
|
||||||
$G_TMP_MENU->AddIdRawOption('LOG_CASE_SCHEDULER', '../cases/cases_Scheduler_Log', G::LoadTranslation('ID_CASE_SCHEDULER'), "icon-logs-list.png",'', 'logs');
|
$G_TMP_MENU->AddIdRawOption('LOG_CASE_SCHEDULER', '../cases/cases_Scheduler_Log', G::LoadTranslation('ID_CASE_SCHEDULER'), "icon-logs-list.png",'', 'logs');
|
||||||
$G_TMP_MENU->AddIdRawOption("CRON", "../setup/cron", G::LoadTranslation("ID_CRON_ACTIONS"), null, null, "logs");
|
$G_TMP_MENU->AddIdRawOption("CRON", "../setup/cron", G::LoadTranslation("ID_CRON_ACTIONS"), null, null, "logs");
|
||||||
|
$G_TMP_MENU->AddIdRawOption('EMAILS', '../mails/emailList', ucfirst (strtolower ( G::LoadTranslation('ID_EMAILS'))), '', '', 'logs');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ G::LoadClass( 'case' );
|
|||||||
|
|
||||||
//load the variables
|
//load the variables
|
||||||
$oCase = new Cases();
|
$oCase = new Cases();
|
||||||
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
|
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'casesListExtJs' );
|
||||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||||
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
|
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
|
||||||
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], (array) $_POST['form'] );
|
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], (array) $_POST['form'] );
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ G::LoadClass( 'case' );
|
|||||||
$oAppDocument = new AppDocument();
|
$oAppDocument = new AppDocument();
|
||||||
$oAppDocument->remove( $_GET['DOC'] );
|
$oAppDocument->remove( $_GET['DOC'] );
|
||||||
$oCase = new Cases();
|
$oCase = new Cases();
|
||||||
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
|
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'casesListExtJs' );
|
||||||
if ($_GET['TYPE'] == 'INPUT') {
|
if ($_GET['TYPE'] == 'INPUT') {
|
||||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 );
|
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ try {
|
|||||||
//load data
|
//load data
|
||||||
$oCase = new Cases();
|
$oCase = new Cases();
|
||||||
//warning: we are not using the result value of function thisIsTheCurrentUser, so I'm commenting to optimize speed.
|
//warning: we are not using the result value of function thisIsTheCurrentUser, so I'm commenting to optimize speed.
|
||||||
//$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List');
|
//$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'casesListExtJs');
|
||||||
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||||
$appFields['APP_DATA'] = array_merge( $appFields['APP_DATA'], G::getSystemConstants() );
|
$appFields['APP_DATA'] = array_merge( $appFields['APP_DATA'], G::getSystemConstants() );
|
||||||
//cleaning debug variables
|
//cleaning debug variables
|
||||||
|
|||||||
@@ -1,182 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
G::header('Location: ../cases/casesListExtJs');
|
||||||
* cases_List.php
|
die();
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cases list (Refactored)
|
|
||||||
* By Erik A.
|
|
||||||
* O. <erik@colosa.com, aortiz.erik@gmail.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Permissions */
|
|
||||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_CASES" )) != 1) {
|
|
||||||
return $RBAC_Response;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Includes */
|
|
||||||
G::LoadClass( 'case' );
|
|
||||||
G::LoadClass( 'configuration' );
|
|
||||||
|
|
||||||
// $_GET['l'] has the type of cases list like todo,pause,cancel, all
|
|
||||||
|
|
||||||
|
|
||||||
$conf = new Configurations();
|
|
||||||
if (! isset( $_GET['l'] )) {
|
|
||||||
$confCasesList = $conf->loadObject( 'ProcessMaker', 'cases_List', '', $_SESSION['USER_LOGGED'], '' );
|
|
||||||
if (is_array( $confCasesList )) {
|
|
||||||
$sTypeList = $confCasesList['sTypeList'];
|
|
||||||
} else {
|
|
||||||
$sTypeList = 'to_do';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$sTypeList = $_GET['l'];
|
|
||||||
$confCasesList = array ('sTypeList' => $sTypeList
|
|
||||||
);
|
|
||||||
$conf->saveObject( $confCasesList, 'ProcessMaker', 'cases_List', '', $_SESSION['USER_LOGGED'], '' );
|
|
||||||
}
|
|
||||||
|
|
||||||
$sUIDUserLogged = $_SESSION['USER_LOGGED'];
|
|
||||||
$_SESSION['CASES_MENU_OPTION'] = $sTypeList;
|
|
||||||
|
|
||||||
$oCases = new Cases();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* here we verify if there is a any case with a unpause on this day
|
|
||||||
*/
|
|
||||||
if ($sTypeList === 'to_do' or $sTypeList === 'draft' or $sTypeList === 'paused') {
|
|
||||||
$oCases->ThrowUnpauseDaemon( date( 'Y-m-d' ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* *
|
|
||||||
* Prepare the addtional filters before to show
|
|
||||||
* By Erik
|
|
||||||
*/
|
|
||||||
|
|
||||||
$aAdditionalFilter = Array ();
|
|
||||||
|
|
||||||
if (isset( $_GET['PROCESS_UID'] ) and $_GET['PROCESS_UID'] != "0" && $_GET['PROCESS_UID'] != "") {
|
|
||||||
$PRO_UID = $_GET['PROCESS_UID'];
|
|
||||||
$aAdditionalFilter['PRO_UID'] = $PRO_UID;
|
|
||||||
} else {
|
|
||||||
$PRO_UID = "0";
|
|
||||||
}
|
|
||||||
if (isset( $_GET['READ'] ) and $_GET['READ'] == "1") {
|
|
||||||
$aAdditionalFilter['READ'] = $_GET['READ'];
|
|
||||||
}
|
|
||||||
if (isset( $_GET['UNREAD'] ) and $_GET['UNREAD'] == "1") {
|
|
||||||
$aAdditionalFilter['UNREAD'] = $_GET['UNREAD'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset( $_GET['APP_STATUS_FILTER'] ) and $_GET['APP_STATUS_FILTER'] != "ALL") {
|
|
||||||
$aAdditionalFilter['APP_STATUS_FILTER'] = $_GET['APP_STATUS_FILTER'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset( $_GET['MINE'] ) and $_GET['MINE'] == "1") {
|
|
||||||
$aAdditionalFilter['MINE'] = $_GET['MINE'];
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($sTypeList) {
|
|
||||||
case 'to_do':
|
|
||||||
if (defined( 'ENABLE_CASE_LIST_OPTIMIZATION' )) {
|
|
||||||
$aCriteria = $oCases->prepareCriteriaForToDo( $sUIDUserLogged );
|
|
||||||
$xmlfile = 'cases/cases_ListTodoNew';
|
|
||||||
} else {
|
|
||||||
list ($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
list ($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
$rs = ApplicationPeer::doSelectRS($aCriteria);
|
|
||||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$aRows1 = Array();
|
|
||||||
while($rs->next()) {
|
|
||||||
$aRows1[] = $rs->getRow();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
g::pr($aRows1);die;*/
|
|
||||||
/* GET , POST & $_SESSION Vars */
|
|
||||||
|
|
||||||
if (! isset( $_GET['PROCESS_UID'] )) {
|
|
||||||
$oCase = new Cases();
|
|
||||||
$rs = ApplicationPeer::doSelectRS( $aCriteria );
|
|
||||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
|
||||||
|
|
||||||
$aProcess = Array ();
|
|
||||||
while ($rs->next()) {
|
|
||||||
$aRow = $rs->getRow();
|
|
||||||
//g::pr($aRow); die;
|
|
||||||
if (! InAssocArray( $aRow, 'PRO_UID', $aRow['PRO_UID'] )) {
|
|
||||||
array_push( $aProcess, Array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['APP_PRO_TITLE'] ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$_DBArray['_PROCESSES'] = array_merge( Array (Array ('PRO_UID' => 'char','PRO_TITLE' => 'char' ) ), $aProcess );
|
|
||||||
$_SESSION['_DBArray'] = $_DBArray;
|
|
||||||
} else {
|
|
||||||
$_DBArray = $_SESSION['_DBArray'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Render page */
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$G_PUBLISH->ROWS_PER_PAGE = 12;
|
|
||||||
|
|
||||||
if ($sTypeList == 'to_reassign') {
|
|
||||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignBy', '', array ('REASSIGN_BY' => 1 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
$aData = Array ('PROCESS_FILTER' => $PRO_UID,'APP_STATUS_FILTER' => (isset( $_GET['APP_STATUS_FILTER'] ) ? $_GET['APP_STATUS_FILTER'] : '0')
|
|
||||||
);
|
|
||||||
|
|
||||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', $xmlfile, $aCriteria, $aData );
|
|
||||||
|
|
||||||
G::RenderPage( 'publish', 'blank' );
|
|
||||||
|
|
||||||
function InAssocArray ($a, $k, $v)
|
|
||||||
{
|
|
||||||
foreach ($a as $item) {
|
|
||||||
if (isset( $item[$k] ) && $v == $item[$k]) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
<script>
|
|
||||||
try{
|
|
||||||
oPropelTable = document.getElementById('publisherContent[0]');
|
|
||||||
oTable = oPropelTable.getElementsByTagName('table');
|
|
||||||
oTable[0].style.width = '98%';
|
|
||||||
oTable[1].style.width = '98%';
|
|
||||||
|
|
||||||
parent.outerLayout.hide('east');
|
|
||||||
parent.PANEL_EAST_OPEN = false;
|
|
||||||
if(parent.refreshCountFolders) parent.refreshCountFolders();
|
|
||||||
}catch(e){}
|
|
||||||
</script>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
@@ -93,11 +93,11 @@ try {
|
|||||||
$oTasks = new Tasks();
|
$oTasks = new Tasks();
|
||||||
$oGroups = new Groups();
|
$oGroups = new Groups();
|
||||||
$oUser = new Users();
|
$oUser = new Users();
|
||||||
G::LoadClass( 'case' );
|
|
||||||
$oCases = new Cases();
|
|
||||||
|
|
||||||
list ($oCriteriaToDo, $sXMLFile) = $oCases->getConditionCasesList( 'to_do', $sUserToReassign );
|
$oAppCache = new AppCacheView();
|
||||||
list ($oCriteriaDraft, $sXMLFile) = $oCases->getConditionCasesList( 'draft', $sUserToReassign );
|
|
||||||
|
$oCriteriaToDo = $oAppCache->getToDoListCriteria($sUserToReassign);
|
||||||
|
$oCriteriaDraft = $oAppCache->getDraftListCriteria($sUserToReassign);
|
||||||
|
|
||||||
$aCasesList = Array ();
|
$aCasesList = Array ();
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ try {
|
|||||||
|
|
||||||
//Load the variables
|
//Load the variables
|
||||||
$oCase = new Cases();
|
$oCase = new Cases();
|
||||||
$oCase->thisIsTheCurrentUser( $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "cases_List" );
|
$oCase->thisIsTheCurrentUser( $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs" );
|
||||||
$Fields = $oCase->loadCase( $_SESSION["APPLICATION"] );
|
$Fields = $oCase->loadCase( $_SESSION["APPLICATION"] );
|
||||||
|
|
||||||
$Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], G::getSystemConstants() );
|
$Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], G::getSystemConstants() );
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ $appDocComment = (isset($_POST["form"]["APP_DOC_COMMENT"]))? $_POST["form"]["APP
|
|||||||
$actionType = $_POST["form"]["actionType"];
|
$actionType = $_POST["form"]["actionType"];
|
||||||
|
|
||||||
$case = new Cases();
|
$case = new Cases();
|
||||||
$case->thisIsTheCurrentUser($_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "cases_List");
|
$case->thisIsTheCurrentUser($_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs");
|
||||||
|
|
||||||
//Load the fields
|
//Load the fields
|
||||||
$arrayField = $case->loadCase($_SESSION["APPLICATION"]);
|
$arrayField = $case->loadCase($_SESSION["APPLICATION"]);
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ if (isset( $_GET['breakpoint'] )) {
|
|||||||
#end trigger debug session.......
|
#end trigger debug session.......
|
||||||
|
|
||||||
|
|
||||||
//$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List');
|
//$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'casesListExtJs');
|
||||||
|
|
||||||
|
|
||||||
//Save data - Start
|
//Save data - Start
|
||||||
|
|||||||
@@ -36,16 +36,17 @@ try {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sfunction = '';
|
||||||
if (isset( $_POST['function'] )) {
|
if (isset( $_POST['function'] )) {
|
||||||
$sfunction = $_POST['function'];
|
$sfunction = $_POST['function'];
|
||||||
} else {
|
} elseif (isset( $_POST['functions'] )){
|
||||||
$sfunction = $_POST['functions'];
|
$sfunction = $_POST['functions'];
|
||||||
}
|
}
|
||||||
|
// Bootstrap::mylog("post:".$_POST['function']);
|
||||||
switch ($sfunction) {
|
switch ($sfunction) {
|
||||||
case 'lookForNameInput':
|
case 'lookForNameInput':
|
||||||
require_once ('classes/model/Content.php');
|
//require_once ('classes/model/Content.php');
|
||||||
require_once ("classes/model/InputDocument.php");
|
//require_once ("classes/model/InputDocument.php");
|
||||||
|
|
||||||
$snameInput = urldecode( $_POST['NAMEINPUT'] );
|
$snameInput = urldecode( $_POST['NAMEINPUT'] );
|
||||||
$sPRO_UID = urldecode( $_POST['proUid'] );
|
$sPRO_UID = urldecode( $_POST['proUid'] );
|
||||||
@@ -77,7 +78,7 @@ try {
|
|||||||
print $flag;
|
print $flag;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
require_once 'classes/model/InputDocument.php';
|
//require_once 'classes/model/InputDocument.php';
|
||||||
G::LoadClass( 'processMap' );
|
G::LoadClass( 'processMap' );
|
||||||
|
|
||||||
$oInputDocument = new InputDocument();
|
$oInputDocument = new InputDocument();
|
||||||
|
|||||||
90
workflow/engine/methods/mails/emailList.php
Normal file
90
workflow/engine/methods/mails/emailList.php
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* emailList.php
|
||||||
|
*
|
||||||
|
* ProcessMaker Open Source Edition
|
||||||
|
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
global $RBAC;
|
||||||
|
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||||
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||||
|
G::header( 'location: ../login/login' );
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
|
G::LoadClass( 'configuration' );
|
||||||
|
$c = new Configurations();
|
||||||
|
$configPage = $c->getConfiguration( 'eventList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||||
|
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
|
||||||
|
|
||||||
|
$G_MAIN_MENU = 'processmaker';
|
||||||
|
$G_SUB_MENU = 'logs';
|
||||||
|
$G_ID_MENU_SELECTED = 'logs';
|
||||||
|
$G_ID_SUB_MENU_SELECTED = 'EMAILS';
|
||||||
|
|
||||||
|
//get values for the comboBoxes
|
||||||
|
$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
||||||
|
$status = array (
|
||||||
|
array ('',G::LoadTranslation( 'ID_ALL' )),
|
||||||
|
array ("sent", "Sent"),
|
||||||
|
array ("pending", "Pending")
|
||||||
|
);
|
||||||
|
|
||||||
|
$processes = getProcessArray( $userUid );
|
||||||
|
|
||||||
|
$G_PUBLISH = new Publisher();
|
||||||
|
|
||||||
|
$oHeadPublisher = & headPublisher::getSingleton();
|
||||||
|
$oHeadPublisher->addExtJsScript( 'mails/emailList', false ); //adding a javascript file .js
|
||||||
|
$oHeadPublisher->addContent( 'mails/emailList' ); //adding a html file .html.
|
||||||
|
//sending the columns to display in grid
|
||||||
|
$oHeadPublisher->assign( 'statusValues', $status );
|
||||||
|
$oHeadPublisher->assign( 'processValues', $processes );
|
||||||
|
|
||||||
|
function getProcessArray ($userUid)
|
||||||
|
{
|
||||||
|
global $oAppCache;
|
||||||
|
require_once ("classes/model/AppCacheView.php");
|
||||||
|
|
||||||
|
$processes = Array ();
|
||||||
|
$processes[] = array ('',G::LoadTranslation( 'ID_ALL_PROCESS' ));
|
||||||
|
|
||||||
|
$cProcess = new Criteria( 'workflow' );
|
||||||
|
$cProcess->clearSelectColumns();
|
||||||
|
$cProcess->addSelectColumn( AppCacheViewPeer::PRO_UID );
|
||||||
|
$cProcess->addSelectColumn( AppCacheViewPeer::APP_PRO_TITLE );
|
||||||
|
$cProcess->setDistinct( AppCacheViewPeer::PRO_UID );
|
||||||
|
|
||||||
|
$cProcess->addAscendingOrderByColumn( AppCacheViewPeer::APP_PRO_TITLE );
|
||||||
|
|
||||||
|
$oDataset = AppCacheViewPeer::doSelectRS( $cProcess );
|
||||||
|
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
|
$oDataset->next();
|
||||||
|
|
||||||
|
while ($aRow = $oDataset->getRow()) {
|
||||||
|
$processes[] = array ($aRow['PRO_UID'],$aRow['APP_PRO_TITLE']);
|
||||||
|
$oDataset->next();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $processes;
|
||||||
|
}
|
||||||
|
|
||||||
|
G::RenderPage( 'publish', 'extJs' );
|
||||||
|
|
||||||
154
workflow/engine/methods/mails/emailsAjax.php
Normal file
154
workflow/engine/methods/mails/emailsAjax.php
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
<?php
|
||||||
|
$req = (isset($_POST['request']))? $_POST['request']:((isset($_REQUEST['request']))? $_REQUEST['request'] : 'No hayyy tal');
|
||||||
|
|
||||||
|
require_once 'classes/model/Content.php';
|
||||||
|
require_once 'classes/model/AppMessage.php';
|
||||||
|
require_once 'classes/model/AppDelegation.php';
|
||||||
|
require_once 'classes/model/Application.php';
|
||||||
|
switch($req){
|
||||||
|
case 'MessageList':
|
||||||
|
$start = (isset($_REQUEST['start']))? $_REQUEST['start'] : '0';
|
||||||
|
$limit = (isset($_REQUEST['limit']))? $_REQUEST['limit'] : '25';
|
||||||
|
$proUid = (isset($_REQUEST['process']))? $_REQUEST['process'] : '';
|
||||||
|
$eventype = (isset($_REQUEST['type']))? $_REQUEST['type'] : '';
|
||||||
|
$emailStatus = (isset($_REQUEST['status']))? $_REQUEST['status'] : '';
|
||||||
|
$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : '';
|
||||||
|
$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'ASC';
|
||||||
|
$dateFrom = isset( $_POST["dateFrom"] ) ? substr( $_POST["dateFrom"], 0, 10 ) : "";
|
||||||
|
$dateTo = isset( $_POST["dateTo"] ) ? substr( $_POST["dateTo"], 0, 10 ) : "";
|
||||||
|
|
||||||
|
$response = new stdclass();
|
||||||
|
$response->status = 'OK';
|
||||||
|
|
||||||
|
$criteria = new Criteria();
|
||||||
|
$criteria->addJoin(AppMessagePeer::APP_UID, ApplicationPeer::APP_UID);
|
||||||
|
if ($emailStatus != '') {
|
||||||
|
$criteria->add( AppMessagePeer::APP_MSG_STATUS, $emailStatus, Criteria::LESS_EQUAL );
|
||||||
|
}
|
||||||
|
if ($proUid != '') {
|
||||||
|
$criteria->add( ApplicationPeer::PRO_UID, $proUid);
|
||||||
|
}
|
||||||
|
if ($dateFrom != '') {
|
||||||
|
if ($dateTo != '') {
|
||||||
|
$criteria->add( $criteria->getNewCriterion( AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL )->addAnd( $criteria->getNewCriterion( AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL ) ) );
|
||||||
|
} else {
|
||||||
|
$criteria->add( AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL );
|
||||||
|
}
|
||||||
|
} elseif ($dateTo != '') {
|
||||||
|
$criteria->add( AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = AppMessagePeer::doSelectRS($criteria);
|
||||||
|
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$data = Array();
|
||||||
|
while ( $result->next() ) {
|
||||||
|
$data[] = $result->getRow();
|
||||||
|
}
|
||||||
|
$totalCount = count($data);
|
||||||
|
|
||||||
|
$criteria = new Criteria();
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_UID);
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_UID);
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::DEL_INDEX);
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_TYPE);
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SUBJECT);
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_FROM);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_TO);
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_BODY);
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_STATUS);
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_DATE);
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SEND_DATE);
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SHOW_MESSAGE);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||||
|
|
||||||
|
$criteria->addAsColumn('PRO_TITLE', 'C2.CON_VALUE');
|
||||||
|
$criteria->addAlias('C2', 'CONTENT');
|
||||||
|
|
||||||
|
if ($emailStatus != '') {
|
||||||
|
$criteria->add( AppMessagePeer::APP_MSG_STATUS, $emailStatus, Criteria::LESS_EQUAL );
|
||||||
|
}
|
||||||
|
if ($proUid != '') {
|
||||||
|
$criteria->add( ApplicationPeer::PRO_UID, $proUid);
|
||||||
|
}
|
||||||
|
if ($dateFrom != '') {
|
||||||
|
if ($dateTo != '') {
|
||||||
|
$criteria->add( $criteria->getNewCriterion( AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL )->addAnd( $criteria->getNewCriterion( AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL ) ) );
|
||||||
|
} else {
|
||||||
|
$criteria->add( AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL );
|
||||||
|
}
|
||||||
|
} elseif ($dateTo != '') {
|
||||||
|
$criteria->add( AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($sort != '') {
|
||||||
|
if ($dir == 'ASC') {
|
||||||
|
$criteria->addAscendingOrderByColumn($sort);
|
||||||
|
} else {
|
||||||
|
$criteria->addDescendingOrderByColumn($sort);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$oCriteria->addDescendingOrderByColumn(AppMessagePeer::APP_MSG_SEND_DATE );
|
||||||
|
}
|
||||||
|
if ($limit != '') {
|
||||||
|
$criteria->setLimit($limit);
|
||||||
|
$criteria->setOffset($start);
|
||||||
|
}
|
||||||
|
$criteria->addJoin(AppMessagePeer::APP_UID, ApplicationPeer::APP_UID);
|
||||||
|
|
||||||
|
$conditions = array();
|
||||||
|
$conditions[] = array(ApplicationPeer::PRO_UID, 'C2.CON_ID');
|
||||||
|
$conditions[] = array(
|
||||||
|
'C2.CON_CATEGORY', DBAdapter::getStringDelimiter() . 'PRO_TITLE' . DBAdapter::getStringDelimiter()
|
||||||
|
);
|
||||||
|
$conditions[] = array(
|
||||||
|
'C2.CON_LANG', DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter()
|
||||||
|
);
|
||||||
|
$criteria->addJoinMC($conditions, Criteria::LEFT_JOIN);
|
||||||
|
$result = AppMessagePeer::doSelectRS($criteria);
|
||||||
|
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$data = Array();
|
||||||
|
$dataPro = array();
|
||||||
|
$index = 0;
|
||||||
|
$content = new Content();
|
||||||
|
$tasTitleDefault = G::LoadTranslation('ID_TASK_NOT_RELATED');
|
||||||
|
while ( $result->next() ) {
|
||||||
|
|
||||||
|
$row = $result->getRow();
|
||||||
|
$row['APP_MSG_FROM'] =htmlentities($row['APP_MSG_FROM'], ENT_QUOTES, "UTF-8");
|
||||||
|
$row['APP_MSG_STATUS'] = ucfirst ( $row['APP_MSG_STATUS']);
|
||||||
|
$row['TAS_TITLE'] = $tasTitleDefault;
|
||||||
|
if ($row['DEL_INDEX'] != 0) {
|
||||||
|
$criteria = new Criteria();
|
||||||
|
$criteria->addSelectColumn(AppDelegationPeer::PRO_UID);
|
||||||
|
$criteria->addSelectColumn(AppDelegationPeer::TAS_UID);
|
||||||
|
$criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||||
|
$criteria->add(AppDelegationPeer::APP_UID, $row['APP_UID']);
|
||||||
|
$resultDelegation = AppDelegationPeer::doSelectRS($criteria);
|
||||||
|
$resultDelegation->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$row['TAS_TITLE'] = '-';
|
||||||
|
while ($resultDelegation->next()) {
|
||||||
|
$rowDelegation = $resultDelegation->getRow();
|
||||||
|
if ($row['DEL_INDEX'] == $rowDelegation['DEL_INDEX']) {
|
||||||
|
$row['TAS_TITLE'] = $content->load( 'TAS_TITLE', '', $rowDelegation['TAS_UID'], SYS_LANG );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$data[] = $row;
|
||||||
|
}
|
||||||
|
$response = array();
|
||||||
|
$response['totalCount'] = $totalCount;
|
||||||
|
$response['data'] = $data;
|
||||||
|
die(G::json_encode($response));
|
||||||
|
break;
|
||||||
|
case 'updateStatusMessage':
|
||||||
|
if (isset($_REQUEST['APP_MSG_UID']) && isset($_REQUEST['APP_MSG_STATUS'])) {
|
||||||
|
$message = new AppMessage();
|
||||||
|
$result = $message->updateStatus($_REQUEST['APP_MSG_UID'], $_REQUEST['APP_MSG_STATUS']);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -118,8 +118,8 @@ function chDir( directory, loadGridOnly ) {
|
|||||||
if( directory == '' || conn && !conn.isLoading()) {
|
if( directory == '' || conn && !conn.isLoading()) {
|
||||||
datastore.load({
|
datastore.load({
|
||||||
params:{
|
params:{
|
||||||
start:0,
|
start: 0,
|
||||||
limit:25,
|
limit: 100,
|
||||||
dir: directory,
|
dir: directory,
|
||||||
node: directory,
|
node: directory,
|
||||||
option:'gridDocuments',
|
option:'gridDocuments',
|
||||||
@@ -737,8 +737,8 @@ datastore = new Ext.data.Store({
|
|||||||
url : "../appFolder/appFolderAjax.php",
|
url : "../appFolder/appFolderAjax.php",
|
||||||
directory : "/",
|
directory : "/",
|
||||||
params : {
|
params : {
|
||||||
start : 0,
|
start: 0,
|
||||||
limit : 25,
|
limit: 100,
|
||||||
dir : this.directory,
|
dir : this.directory,
|
||||||
node : this.directory,
|
node : this.directory,
|
||||||
option : "gridDocuments",
|
option : "gridDocuments",
|
||||||
@@ -1082,11 +1082,11 @@ function filterDataStore(btn, e) {
|
|||||||
}
|
}
|
||||||
// add a paging toolbar to the grid's footer
|
// add a paging toolbar to the grid's footer
|
||||||
var gridbb = new Ext.PagingToolbar({
|
var gridbb = new Ext.PagingToolbar({
|
||||||
store : datastore,
|
store: datastore,
|
||||||
pageSize : 25 ,
|
pageSize: 100,
|
||||||
displayInfo : true,
|
displayInfo: true,
|
||||||
// displayMsg : '% % %',
|
displayMsg: _("ID_DISPLAY_TOTAL"),
|
||||||
emptyMsg : TRANSLATIONS.ID_DISPLAY_EMPTY,
|
emptyMsg: _("ID_DISPLAY_EMPTY"),
|
||||||
beforePageText : TRANSLATIONS.ID_PAGE,
|
beforePageText : TRANSLATIONS.ID_PAGE,
|
||||||
// afterPageText : 'of %',
|
// afterPageText : 'of %',
|
||||||
firstText : TRANSLATIONS.ID_FIRST,
|
firstText : TRANSLATIONS.ID_FIRST,
|
||||||
@@ -1299,8 +1299,8 @@ function loadDir() {
|
|||||||
// console.trace();
|
// console.trace();
|
||||||
datastore.load({
|
datastore.load({
|
||||||
params : {
|
params : {
|
||||||
start : 0,
|
start: 0,
|
||||||
limit : 25,
|
limit: 100,
|
||||||
dir : datastore.directory,
|
dir : datastore.directory,
|
||||||
node : datastore.directory,
|
node : datastore.directory,
|
||||||
option : 'gridDocuments',
|
option : 'gridDocuments',
|
||||||
|
|||||||
3
workflow/engine/templates/mails/emailList.html
Normal file
3
workflow/engine/templates/mails/emailList.html
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<div style="padding: 15px">
|
||||||
|
<div id="list-panel"></div>
|
||||||
|
</div>
|
||||||
352
workflow/engine/templates/mails/emailList.js
Normal file
352
workflow/engine/templates/mails/emailList.js
Normal file
@@ -0,0 +1,352 @@
|
|||||||
|
/*
|
||||||
|
* @author: Marco Antonio
|
||||||
|
* Agos 17st, 2012
|
||||||
|
*/
|
||||||
|
new Ext.KeyMap(document, [{
|
||||||
|
key: Ext.EventObject.F5,
|
||||||
|
fn: function(keycode, e) {
|
||||||
|
if (! e.ctrlKey) {
|
||||||
|
if (Ext.isIE) {
|
||||||
|
// IE6 doesn't allow cancellation of the F5 key, so trick it into
|
||||||
|
// thinking some other key was pressed (backspace in this case)
|
||||||
|
e.browserEvent.keyCode = 8;
|
||||||
|
}
|
||||||
|
e.stopEvent();
|
||||||
|
document.location = document.location;
|
||||||
|
} else {
|
||||||
|
Ext.Msg.alert('Refresh', 'You clicked: CTRL-F5');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
var store;
|
||||||
|
var cmodel;
|
||||||
|
var emailsGrid;
|
||||||
|
var actions;
|
||||||
|
var filterStatus = '';
|
||||||
|
|
||||||
|
Ext.onReady(function(){
|
||||||
|
Ext.QuickTips.init();
|
||||||
|
var resultTpl = new Ext.XTemplate(
|
||||||
|
'<tpl for="."><div class="x-combo-list-item" style="white-space:normal !important;word-wrap: break-word;">',
|
||||||
|
'<span> {APP_PRO_TITLE}</span>',
|
||||||
|
'</div></tpl>'
|
||||||
|
);
|
||||||
|
|
||||||
|
var columnRenderer = function(data, metadata, record, rowIndex,columnIndex, store) {
|
||||||
|
var new_text = metadata.style.split(';');
|
||||||
|
var style = '';
|
||||||
|
for (var i = 0; i < new_text.length -1 ; i++) {
|
||||||
|
var chain = new_text[i] +";";
|
||||||
|
if (chain.indexOf('width') == -1) {
|
||||||
|
style = style + chain;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
metadata.attr = 'ext:qtip="' + data + '" style="'+ style +' white-space: normal; "';
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
var dateFrom = new Ext.form.DateField({
|
||||||
|
id:'dateFrom',
|
||||||
|
format: 'Y-m-d',
|
||||||
|
width: 120,
|
||||||
|
value: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
var dateTo = new Ext.form.DateField({
|
||||||
|
id:'dateTo',
|
||||||
|
format: 'Y-m-d',
|
||||||
|
width: 120,
|
||||||
|
value: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
// ComboBox Status
|
||||||
|
var comboStatus = new Ext.form.ComboBox({
|
||||||
|
width : 90,
|
||||||
|
boxMaxWidth : 90,
|
||||||
|
editable : false,
|
||||||
|
mode : 'local',
|
||||||
|
emptyText: _('ID_SELECT_STATUS'),
|
||||||
|
store : new Ext.data.ArrayStore({
|
||||||
|
fields: ['id', 'value'],
|
||||||
|
data : statusValues
|
||||||
|
}),
|
||||||
|
valueField : 'id',
|
||||||
|
displayField : 'value',
|
||||||
|
triggerAction : 'all',
|
||||||
|
listeners:{
|
||||||
|
scope: this,
|
||||||
|
'select': function() {
|
||||||
|
filterStatus = comboStatus.value;
|
||||||
|
store.setBaseParam( 'status', filterStatus);
|
||||||
|
store.setBaseParam( 'start', 0);
|
||||||
|
store.setBaseParam( 'limit', 25);
|
||||||
|
store.load();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
iconCls: 'no-icon'
|
||||||
|
});
|
||||||
|
|
||||||
|
var comboProcess = new Ext.form.ComboBox({
|
||||||
|
width : 200,
|
||||||
|
boxMaxWidth : 200,
|
||||||
|
editable : true,
|
||||||
|
displayField : 'APP_PRO_TITLE',
|
||||||
|
valueField : 'PRO_UID',
|
||||||
|
forceSelection: false,
|
||||||
|
emptyText: _('ID_EMPTY_PROCESSES'),
|
||||||
|
selectOnFocus: true,
|
||||||
|
tpl: resultTpl,
|
||||||
|
|
||||||
|
typeAhead: true,
|
||||||
|
mode: 'local',
|
||||||
|
autocomplete: true,
|
||||||
|
triggerAction: 'all',
|
||||||
|
|
||||||
|
store : new Ext.data.ArrayStore({
|
||||||
|
fields : ['PRO_UID','APP_PRO_TITLE'],
|
||||||
|
data : processValues
|
||||||
|
}),
|
||||||
|
listeners:{
|
||||||
|
scope: this,
|
||||||
|
'select': function() {
|
||||||
|
filterProcess = comboProcess.value;
|
||||||
|
|
||||||
|
store.setBaseParam('process', filterProcess);
|
||||||
|
store.setBaseParam( 'start', 0);
|
||||||
|
store.setBaseParam( 'limit', 25);
|
||||||
|
store.load();
|
||||||
|
}},
|
||||||
|
iconCls: 'no-icon'
|
||||||
|
});
|
||||||
|
|
||||||
|
actions = _addPluginActions([ {xtype: 'tbfill'}, _('ID_PROCESS'), comboProcess, '-', _('ID_STATUS'), comboStatus, _('ID_DELEGATE_DATE_FROM'),
|
||||||
|
|
||||||
|
dateFrom,
|
||||||
|
' ',
|
||||||
|
_('ID_TO'),
|
||||||
|
dateTo,
|
||||||
|
new Ext.Button ({
|
||||||
|
text: _('ID_FILTER_BY_DELEGATED_DATE'),
|
||||||
|
handler: function(){
|
||||||
|
store.setBaseParam('dateFrom', dateFrom.getValue());
|
||||||
|
store.setBaseParam('dateTo', dateTo.getValue());
|
||||||
|
store.load({params:{ start : 0 , limit : 25 }});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
|
||||||
|
var stepsFields = Ext.data.Record.create([
|
||||||
|
{name : 'APP_MSG_TYPE', type: 'string'},
|
||||||
|
{name : 'APP_MSG_FROM', type: 'string'},
|
||||||
|
{name : 'APP_MSG_TO', type: 'string'},
|
||||||
|
{name : 'APP_MSG_DATE', type: 'string'},
|
||||||
|
{name : 'APP_MSG_STATUS', type: 'string'}
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
store = new Ext.data.Store( {
|
||||||
|
proxy : new Ext.data.HttpProxy({
|
||||||
|
url: 'emailsAjax?request=MessageList'
|
||||||
|
}),
|
||||||
|
remoteSort : true,
|
||||||
|
sortInfo : stepsFields,
|
||||||
|
reader : new Ext.data.JsonReader( {
|
||||||
|
root: 'data',
|
||||||
|
totalProperty: 'totalCount',
|
||||||
|
fields : [
|
||||||
|
{name : 'APP_MSG_UID'},
|
||||||
|
{name : 'APP_UID'},
|
||||||
|
{name : 'DEL_INDEX'},
|
||||||
|
{name : 'PRO_UID'},
|
||||||
|
{name : 'TAS_UID'},
|
||||||
|
{name : 'PRO_TITLE'},
|
||||||
|
{name : 'TAS_TITLE'},
|
||||||
|
{name : 'APP_MSG_TYPE'},
|
||||||
|
{name : 'APP_MSG_SUBJECT'},
|
||||||
|
{name : 'APP_MSG_FROM'},
|
||||||
|
{name : 'APP_MSG_TO'},
|
||||||
|
{name : 'APP_MSG_STATUS'},
|
||||||
|
{name : 'APP_MSG_DATE'},
|
||||||
|
{name : 'APP_MSG_SEND_DATE'},
|
||||||
|
{name : 'APP_MSG_BODY'}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
store.setDefaultSort('APP_MSG_DATE', 'desc');
|
||||||
|
|
||||||
|
var expander = new Ext.ux.grid.RowExpander({
|
||||||
|
tpl : new Ext.Template(
|
||||||
|
"<hr/><b>"+
|
||||||
|
_('ID_PREVIEW')+
|
||||||
|
":</b><br/>"+
|
||||||
|
"<div style = 'display: table; width: 100%; margin: 5px;'>"+
|
||||||
|
"<div style='float: left; width: 10%;'> </div>"+
|
||||||
|
"<div style='float: left; width: 80%; border: 0px dashed #660000;'> {APP_MSG_BODY}</div>"+
|
||||||
|
"<div style='float: left; width: 10%;'> </div>"+
|
||||||
|
"</div>"+
|
||||||
|
"<hr/><br>"
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
var statusValuesGrid = statusValues;
|
||||||
|
statusValuesGrid.splice( 0, 1 );
|
||||||
|
cmodel = new Ext.grid.ColumnModel({
|
||||||
|
viewConfig: {
|
||||||
|
forceFit:true,
|
||||||
|
cls:"x-grid-empty",
|
||||||
|
emptyText: _('ID_NO_RECORDS_FOUND')
|
||||||
|
},
|
||||||
|
defaults: {
|
||||||
|
width: 50
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
expander,
|
||||||
|
{id:'APP_MSG_UID', dataIndex: 'APP_MSG_UID', hidden:true, hideable:false},
|
||||||
|
{header: 'APP_UID', dataIndex: 'APP_UID', hidden:true, hideable:false},
|
||||||
|
{header: 'DEL_INDEX', dataIndex: 'DEL_INDEX', hidden:true, hideable:false},
|
||||||
|
{header: 'PRO_UID', dataIndex: 'PRO_UID', hidden:true, hideable:false, sortable: false},
|
||||||
|
{header: 'TAS_UID', dataIndex: 'TAS_UID', hidden:true, hideable:false, sortable: false},
|
||||||
|
{header: _('ID_PROCESS'), dataIndex: 'PRO_TITLE', width: 100, hidden: false,renderer: columnRenderer, sortable: false},
|
||||||
|
{header: _('ID_TASK'), dataIndex: 'TAS_TITLE', width: 100, hidden: false,renderer: columnRenderer, sortable: false},
|
||||||
|
{header: _('ID_TYPE'), dataIndex: 'APP_MSG_TYPE', width: 50, hidden: false,renderer: columnRenderer, sortable: true},
|
||||||
|
{header: _('ID_DATE_LABEL'), dataIndex: 'APP_MSG_DATE', width: 80,hidden:false, renderer: columnRenderer, sortable: true},
|
||||||
|
{header: _('ID_SUBJECT'), dataIndex: 'APP_MSG_SUBJECT', width: 80,hidden:false, renderer: columnRenderer, sortable: true},
|
||||||
|
{header: _('ID_FROM'), dataIndex: 'APP_MSG_FROM', width: 80,hidden:false,renderer: columnRenderer, sortable: true},
|
||||||
|
{header: _('ID_TO'), dataIndex: 'APP_MSG_TO', width: 80,hidden:false,renderer: columnRenderer, sortable: true},
|
||||||
|
|
||||||
|
{
|
||||||
|
header: _('ID_STATUS'),
|
||||||
|
dataIndex: 'APP_MSG_STATUS',
|
||||||
|
width: 50,
|
||||||
|
renderer: columnRenderer,
|
||||||
|
editor: new Ext.form.ComboBox({
|
||||||
|
listClass: 'x-combo-list-small',
|
||||||
|
mode: 'local',
|
||||||
|
displayField:'value',
|
||||||
|
lazyRender: true,
|
||||||
|
triggerAction: 'all',
|
||||||
|
valueField:'id',
|
||||||
|
editable: false,
|
||||||
|
store: new Ext.data.ArrayStore({
|
||||||
|
fields: ['id', 'value'],
|
||||||
|
data : statusValuesGrid
|
||||||
|
}),
|
||||||
|
listeners: {
|
||||||
|
select: function(a, b) {
|
||||||
|
var row = emailsGrid.getSelectionModel().getSelected();
|
||||||
|
Ext.MessageBox.show({ msg: _('ID_PROCESSING'), wait:true,waitConfig: {interval:200} });
|
||||||
|
Ext.Ajax.request({
|
||||||
|
url : 'emailsAjax' ,
|
||||||
|
params : {
|
||||||
|
request : 'updateStatusMessage',
|
||||||
|
APP_MSG_UID: row.data.APP_MSG_UID,
|
||||||
|
APP_MSG_STATUS: this.value
|
||||||
|
},
|
||||||
|
success: function ( result, request ) {
|
||||||
|
Ext.MessageBox.hide();
|
||||||
|
},
|
||||||
|
failure: function ( result, request) {
|
||||||
|
if (typeof(result.responseText) != 'undefined') {
|
||||||
|
Ext.MessageBox.alert(_('ID_FAILED'), result.responseText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
smodel = new Ext.grid.RowSelectionModel({
|
||||||
|
singleSelect: true
|
||||||
|
});
|
||||||
|
|
||||||
|
bbarpaging = new Ext.PagingToolbar({
|
||||||
|
pageSize : 25,
|
||||||
|
store : store,
|
||||||
|
displayInfo : true,
|
||||||
|
displayMsg : _('ID_GRID_PAGE_DISPLAYING_EMAIL_MESSAGE') + ' ',
|
||||||
|
emptyMsg : _('ID_GRID_PAGE_NO_EMAIL_MESSAGE')
|
||||||
|
});
|
||||||
|
|
||||||
|
emailsGrid = new Ext.grid.EditorGridPanel({
|
||||||
|
region: 'center',
|
||||||
|
layout: 'fit',
|
||||||
|
id: 'emailsGrid',
|
||||||
|
height:100,
|
||||||
|
autoWidth : true,
|
||||||
|
stateful : true,
|
||||||
|
stateId : 'grid',
|
||||||
|
enableColumnResize: true,
|
||||||
|
enableHdMenu: true,
|
||||||
|
frame:false,
|
||||||
|
columnLines: false,
|
||||||
|
viewConfig: {
|
||||||
|
forceFit:true
|
||||||
|
},
|
||||||
|
clicksToEdit: 1,
|
||||||
|
title : _('ID_EMAILS'),
|
||||||
|
store: store,
|
||||||
|
cm: cmodel,
|
||||||
|
sm: smodel,
|
||||||
|
tbar: actions,
|
||||||
|
bbar: bbarpaging,
|
||||||
|
plugins: expander,
|
||||||
|
listeners: {
|
||||||
|
render: function(){
|
||||||
|
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING_GRID')});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
emailsGrid.store.load();
|
||||||
|
|
||||||
|
viewport = new Ext.Viewport({
|
||||||
|
layout: 'fit',
|
||||||
|
autoScroll: false,
|
||||||
|
items: [
|
||||||
|
emailsGrid
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
var _addPluginActions = function(defaultactions) {
|
||||||
|
try {
|
||||||
|
if (Ext.isArray(_pluginactions)) {
|
||||||
|
if (_pluginactions.length > 0) {
|
||||||
|
var positionToInsert = _tbfillPosition(defaultactions);
|
||||||
|
var leftactions = defaultactions.slice(0, positionToInsert);
|
||||||
|
var rightactions = defaultactions.slice(positionToInsert, defaultactions.length - 1);
|
||||||
|
return leftactions.concat(_pluginactions.concat(rightactions));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return defaultactions;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return defaultactions;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
return defaultactions;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var _tbfillPosition = function(actions) {
|
||||||
|
try {
|
||||||
|
for (var i = 0; i < actions.length; i++) {
|
||||||
|
if (Ext.isObject(actions[i])) {
|
||||||
|
if (actions[i].xtype == 'tbfill') {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -61,17 +61,19 @@ cron.application = {
|
|||||||
{
|
{
|
||||||
var record = grdpnlMain.getSelectionModel().getSelected();
|
var record = grdpnlMain.getSelectionModel().getSelected();
|
||||||
|
|
||||||
var strData = "<b>" + _("ID_DATE_LABEL") + "</b><br />" + record.get("DATE") + "<br />";
|
if (typeof record != "undefined") {
|
||||||
strData = strData + "<b>" + _("ID_WORKSPACE") + "</b><br />" + record.get("WORKSPACE") + "<br />";
|
var strData = "<b>" + _("ID_DATE_LABEL") + "</b><br />" + record.get("DATE") + "<br />";
|
||||||
strData = strData + "<b>" + _("ID_ACTION") + "</b><br />" + record.get("ACTION") + "<br />";
|
strData = strData + "<b>" + _("ID_WORKSPACE") + "</b><br />" + record.get("WORKSPACE") + "<br />";
|
||||||
strData = strData + "<b>" + _("ID_STATUS") + "</b><br />" + record.get("STATUS") + "<br />";
|
strData = strData + "<b>" + _("ID_ACTION") + "</b><br />" + record.get("ACTION") + "<br />";
|
||||||
strData = strData + "<b>" + _("ID_DESCRIPTION") + "</b><br />" + record.get("DESCRIPTION") + "<br />";
|
strData = strData + "<b>" + _("ID_STATUS") + "</b><br />" + record.get("STATUS") + "<br />";
|
||||||
|
strData = strData + "<b>" + _("ID_DESCRIPTION") + "</b><br />" + record.get("DESCRIPTION") + "<br />";
|
||||||
|
|
||||||
var formItems = Ext.getCmp("frmLogView").form.items;
|
var formItems = Ext.getCmp("frmLogView").form.items;
|
||||||
formItems.items[0].setValue(strData);
|
formItems.items[0].setValue(strData);
|
||||||
|
|
||||||
winLog.setTitle("Log - " + _("ID_WORKSPACE") + " " + record.get("WORKSPACE"));
|
winLog.setTitle("Log - " + _("ID_WORKSPACE") + " " + record.get("WORKSPACE"));
|
||||||
winLog.show();
|
winLog.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Variables
|
//Variables
|
||||||
@@ -233,7 +235,7 @@ cron.application = {
|
|||||||
var btnInfoView = new Ext.Action({
|
var btnInfoView = new Ext.Action({
|
||||||
id: "btnInfoView",
|
id: "btnInfoView",
|
||||||
|
|
||||||
text: _("ID_VIEW_INFO"),
|
text: _("ID_CRON_INFO"),
|
||||||
iconCls: "button_menu_ext ss_sprite ss_zoom",
|
iconCls: "button_menu_ext ss_sprite ss_zoom",
|
||||||
|
|
||||||
handler: function ()
|
handler: function ()
|
||||||
@@ -457,3 +459,4 @@ cron.application = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ext.onReady(cron.application.init, cron.application);
|
Ext.onReady(cron.application.init, cron.application);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user