Merge branch 'dashboards2' of bitbucket.org:colosa/processmaker into dashboards2
This commit is contained in:
@@ -358,7 +358,7 @@ class WebApplication
|
||||
|
||||
//if (! $isPluginRequest) { // if it is not a request for a plugin endpoint
|
||||
// hook to get rest api classes from plugins
|
||||
if (class_exists('PMPluginRegistry')) {
|
||||
if (class_exists('PMPluginRegistry') && file_exists(PATH_DATA_SITE . 'plugin.singleton')) {
|
||||
$pluginRegistry = \PMPluginRegistry::loadSingleton(PATH_DATA_SITE . 'plugin.singleton');
|
||||
$plugins = $pluginRegistry->getRegisteredRestServices();
|
||||
|
||||
|
||||
@@ -104,7 +104,16 @@ class Installer
|
||||
$result['name']['message'] = ($result['isset']) ? 'Workspace already exist' : $result['name']['message'];
|
||||
$result['name']['status'] = ($result['isset']) ? false : $result['name']['status'];
|
||||
//print_r($result);
|
||||
return Array('created' => G::var_compare(true, $result['path_data'], $result['database']['connection'], $result['name']['status'], $result['database']['version'], $result['database']['ao']['ao_db_wf']['status'], $result['database']['ao']['ao_db_rb']['status'], $result['database']['ao']['ao_db_rp']['status'], $result['admin']['username'], (($result['isset']) ? false : true), $result['admin']['password']), 'result' => $result
|
||||
return Array('created' => G::var_compare(true,
|
||||
$result['path_data'],
|
||||
$result['database']['connection'],
|
||||
$result['name']['status'],
|
||||
$result['database']['version'],
|
||||
$result['database']['ao']['ao_db_wf']['status'],
|
||||
$result['admin']['username'],
|
||||
(($result['isset']) ? false : true),
|
||||
$result['admin']['password']),
|
||||
'result' => $result
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -922,6 +922,9 @@ class workspaceTools
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
$checkData = $licensedFeatures->addNewFeatures($checkData);
|
||||
|
||||
$catalog = new Catalog();
|
||||
$checkData = $catalog->registerRows($checkData);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
foreach ($checkData as $checkThis) {
|
||||
$this->updateThisRegistry($checkThis);
|
||||
|
||||
@@ -16,6 +16,8 @@ require_once 'classes/model/om/BaseCatalog.php';
|
||||
*/
|
||||
class Catalog extends BaseCatalog
|
||||
{
|
||||
private $records = array();
|
||||
|
||||
public function load ($catUid, $catType)
|
||||
{
|
||||
try {
|
||||
@@ -107,5 +109,105 @@ class Catalog extends BaseCatalog
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
private function dataCatalog ()
|
||||
{
|
||||
$this->records[] = array('10','ID_BARS','GRAPHIC','','','2015-03-04','2015-03-04');
|
||||
$this->records[] = array('20','ID_LINES','GRAPHIC','','','2015-03-04','2015-03-04');
|
||||
$this->records[] = array('100','ID_MONTH','PERIODICITY','','','2015-03-04','2015-03-04');
|
||||
$this->records[] = array('200','ID_QUARTER','PERIODICITY','','','2015-03-04','2015-03-04');
|
||||
$this->records[] = array('300','ID_SEMESTER','PERIODICITY','','','2015-03-04','2015-03-04');
|
||||
$this->records[] = array('400','ID_YEAR','PERIODICITY','','','2015-03-04','2015-03-04');
|
||||
$this->records[] = array('1010','ID_PROCESS_EFFICIENCE','INDICATOR','','','2015-03-04','2015-03-04');
|
||||
$this->records[] = array('1030','ID_EMPLYEE_EFFICIENCIE','INDICATOR','','','2015-03-04','2015-03-04');
|
||||
$this->records[] = array('1050','ID_OVER_DUE','INDICATOR','%','Unit for displaying','2015-03-04','2015-03-04');
|
||||
}
|
||||
public function registerRows($data)
|
||||
{
|
||||
$this->dataCatalog();
|
||||
$newData = array();
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->clearSelectColumns();
|
||||
$criteria->addSelectColumn(CatalogPeer::CAT_UID);
|
||||
$criteria->addSelectColumn(CatalogPeer::CAT_TYPE);
|
||||
$rs = CatalogPeer::doSelectRS($criteria);
|
||||
$dataCatalog = array();
|
||||
while ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
$dataCatalog[] = $row;
|
||||
}
|
||||
|
||||
foreach($this->records as $k => $record) {
|
||||
$flag = false;
|
||||
|
||||
foreach ($dataCatalog as $key => $catalog) {
|
||||
if ($record[0] == $catalog[0] && $record[2] == $catalog[1]) {
|
||||
$flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($flag) {
|
||||
continue;
|
||||
}
|
||||
$newData[] = array (
|
||||
'db' => 'wf',
|
||||
'table' => 'CATALOG',
|
||||
'keys' =>
|
||||
array (
|
||||
0 => 'CAT_UID',
|
||||
1 => 'CAT_TYPE'
|
||||
),
|
||||
'data' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'field' => 'CAT_UID',
|
||||
'type' => 'text',
|
||||
'value' => $record[0],
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'field' => 'CAT_LABEL_ID',
|
||||
'type' => 'text',
|
||||
'value' => $record[1],
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'field' => 'CAT_TYPE',
|
||||
'type' => 'text',
|
||||
'value' => $record[2],
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
'field' => 'CAT_FLAG',
|
||||
'type' => 'text',
|
||||
'value' => $record[3],
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
'field' => 'CAT_OBSERVATION',
|
||||
'type' => 'text',
|
||||
'value' => $record[4],
|
||||
),
|
||||
5 =>
|
||||
array (
|
||||
'field' => 'CAT_CREATE_DATE',
|
||||
'type' => 'text',
|
||||
'value' => $record[5],
|
||||
),
|
||||
6 =>
|
||||
array (
|
||||
'field' => 'CAT_UPDATE_DATE',
|
||||
'type' => 'text',
|
||||
'value' => $record[6],
|
||||
)
|
||||
),
|
||||
'action' => 1,
|
||||
);
|
||||
|
||||
}
|
||||
return array_merge($data, $newData);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ class ListCanceled extends BaseListCanceled {
|
||||
$criteria->setOffset( $start );
|
||||
}
|
||||
|
||||
$dataset = ListCanceledPeer::doSelectRS($criteria);
|
||||
$dataset = ListCanceledPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = array();
|
||||
while ($dataset->next()) {
|
||||
|
||||
@@ -284,7 +284,7 @@ class ListCompleted extends BaseListCompleted
|
||||
$criteria->setOffset( $start );
|
||||
}
|
||||
|
||||
$dataset = ListCompletedPeer::doSelectRS($criteria);
|
||||
$dataset = ListCompletedPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = array();
|
||||
while ($dataset->next()) {
|
||||
|
||||
@@ -102,7 +102,7 @@ class ListInbox extends BaseListInbox
|
||||
$users->refreshTotal($data['USR_UID'], 'add', 'inbox');
|
||||
|
||||
$listParticipatedLast = new ListParticipatedLast();
|
||||
$listParticipatedLast->remove($data['APP_UID'], $data['USR_UID']);
|
||||
$listParticipatedLast->remove($data['APP_UID'], $data['USR_UID'], $data['DEL_INDEX']);
|
||||
|
||||
//Update - WHERE
|
||||
$criteriaWhere = new Criteria("workflow");
|
||||
@@ -444,7 +444,7 @@ class ListInbox extends BaseListInbox
|
||||
$criteria->setOffset( $start );
|
||||
}
|
||||
|
||||
$dataset = ListInboxPeer::doSelectRS($criteria);
|
||||
$dataset = ListInboxPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = array();
|
||||
$aPriorities = array ('1' => 'VL','2' => 'L','3' => 'N','4' => 'H','5' => 'VH');
|
||||
|
||||
@@ -259,7 +259,7 @@ class ListMyInbox extends BaseListMyInbox
|
||||
$criteria->setOffset( $start );
|
||||
}
|
||||
|
||||
$dataset = ListMyInboxPeer::doSelectRS($criteria);
|
||||
$dataset = ListMyInboxPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = array();
|
||||
$aPriorities = array ('1' => 'VL','2' => 'L','3' => 'N','4' => 'H','5' => 'VH');
|
||||
|
||||
@@ -214,7 +214,7 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
$criteria->setOffset( $start );
|
||||
}
|
||||
|
||||
$dataset = ListParticipatedHistoryPeer::doSelectRS($criteria);
|
||||
$dataset = ListParticipatedHistoryPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = array();
|
||||
$aPriorities = array ('1' => 'VL','2' => 'L','3' => 'N','4' => 'H','5' => 'VH');
|
||||
|
||||
@@ -285,7 +285,7 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
$criteria->setOffset( $start );
|
||||
}
|
||||
|
||||
$dataset = ListParticipatedLastPeer::doSelectRS($criteria);
|
||||
$dataset = ListParticipatedLastPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = array();
|
||||
$aPriorities = array ('1' => 'VL','2' => 'L','3' => 'N','4' => 'H','5' => 'VH');
|
||||
|
||||
@@ -328,7 +328,7 @@ class ListPaused extends BaseListPaused {
|
||||
$criteria->setOffset( $start );
|
||||
}
|
||||
|
||||
$dataset = ListPausedPeer::doSelectRS($criteria);
|
||||
$dataset = ListPausedPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = array();
|
||||
while ($dataset->next()) {
|
||||
|
||||
@@ -12,12 +12,13 @@ class newSiteProxy extends HttpProxyController
|
||||
public function testingNW ($params) {
|
||||
if (isset( $_POST['NW_TITLE'] )) {
|
||||
$action = (isset( $_POST['action'] )) ? trim( $_POST['action'] ) : 'test';
|
||||
$ao_db_drop = (isset( $_POST['AO_DB_DROP'] )) ? true : false;
|
||||
|
||||
G::LoadClass( 'Installer' );
|
||||
//G::LoadClass( 'json' );
|
||||
$name = trim( $_POST['NW_TITLE'] );
|
||||
$inst = new Installer();
|
||||
if ($inst->isset_site($name)) {
|
||||
if ($inst->isset_site($name) && $ao_db_drop !==true) {
|
||||
$this->error = true;
|
||||
return;
|
||||
}
|
||||
@@ -25,7 +26,6 @@ class newSiteProxy extends HttpProxyController
|
||||
$pass = (isset( $_POST['NW_PASSWORD'] )) ? $_POST['NW_PASSWORD'] : 'admin';
|
||||
$pass1 = (isset( $_POST['NW_PASSWORD2'] )) ? $_POST['NW_PASSWORD2'] : 'admin';
|
||||
|
||||
$ao_db_drop = (isset( $_POST['AO_DB_DROP'] )) ? true : false;
|
||||
|
||||
$ao_db_wf = (isset( $_POST['AO_DB_WF'] )) ? $_POST['AO_DB_WF'] : false;
|
||||
$ao_db_rb = (isset( $_POST['AO_DB_RB'] )) ? $_POST['AO_DB_RB'] : false;
|
||||
|
||||
@@ -59977,7 +59977,7 @@ INSERT INTO CATALOG (CAT_UID, CAT_LABEL_ID, CAT_TYPE, CAT_FLAG, CAT_OBSERVATION,
|
||||
('400','ID_YEAR','PERIODICITY','','','2015-03-04','2015-03-04'),
|
||||
('1010','ID_PROCESS_EFFICIENCE','INDICATOR','','','2015-03-04','2015-03-04'),
|
||||
('1030','ID_EMPLYEE_EFFICIENCIE','INDICATOR','','','2015-03-04','2015-03-04'),
|
||||
('1050','ID_OVER_DUE','INDICATOR','%','Unit for displaying','2015-03-04','2015-03-04'),
|
||||
('1050','ID_OVER_DUE','INDICATOR','%','Unit for displaying','2015-03-04','2015-03-04');
|
||||
|
||||
INSERT INTO ADDONS_MANAGER (ADDON_DESCRIPTION,ADDON_ID,ADDON_NAME,ADDON_NICK,ADDON_PUBLISHER,ADDON_RELEASE_TYPE,ADDON_STATUS,STORE_ID,ADDON_TYPE,ADDON_DOWNLOAD_URL,ADDON_VERSION,ADDON_DOWNLOAD_PROGRESS) VALUES
|
||||
('Enables de Actions By Email feature.','actionsByEmail','actionsByEmail','actionsByEmail','Colosa','localRegistry','ready','00000000000000000000000000010004','features','','','0'),
|
||||
|
||||
@@ -2705,12 +2705,13 @@ CREATE TABLE `USR_REPORTING`
|
||||
`TOTAL_TIME_BY_TASK` DECIMAL(7,2) default 0,
|
||||
`TOTAL_CASES_IN` DECIMAL(7,2) default 0,
|
||||
`TOTAL_CASES_OUT` DECIMAL(7,2) default 0,
|
||||
`USER_HOUR_COST` DECIMAL(7,2) default 0,
|
||||
`AVG_TIME` DECIMAL(7,2) default 0,
|
||||
`SDV_TIME` DECIMAL(7,2) default 0,
|
||||
`CONFIGURED_TASK_TIME` DECIMAL(7,2) default 0,
|
||||
`TOTAL_CASES_OVERDUE` DECIMAL(7,2) default 0,
|
||||
`TOTAL_CASES_ON_TIME` DECIMAL(7,2) default 0,
|
||||
PRIMARY KEY (`USR_UID`, `TAS_UID`,`MONTH`,`YEAR`)
|
||||
PRIMARY KEY (`USR_UID`, `TAS_UID`,`MONTH`,`YEAR`),
|
||||
KEY `indexApp`(`USR_UID`, `TAS_UID`, `PRO_UID`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Data calculated users by task';
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -2768,11 +2769,15 @@ CREATE TABLE `DASHBOARD_INDICATOR`
|
||||
`DAS_IND_TYPE` VARCHAR(32) default '' NOT NULL,
|
||||
`DAS_IND_TITLE` VARCHAR(255) default '' NOT NULL,
|
||||
`DAS_IND_GOAL` DECIMAL(7,2) default 0,
|
||||
`DAS_IND_DIRECTION` TINYINT default 2 NOT NULL,
|
||||
`DAS_UID_PROCESS` VARCHAR(32) default '' NOT NULL,
|
||||
`DAS_IND_PROPERTIES` MEDIUMTEXT,
|
||||
`DAS_CREATE_DATE` DATETIME NOT NULL,
|
||||
`DAS_UPDATE_DATE` DATETIME,
|
||||
`DAS_STATUS` TINYINT default 1 NOT NULL,
|
||||
`DAS_IND_FIRST_FIGURE` VARCHAR(32) default '',
|
||||
`DAS_IND_FIRST_FREQUENCY` VARCHAR(32) default '',
|
||||
`DAS_IND_SECOND_FIGURE` VARCHAR(32) default '',
|
||||
`DAS_IND_SECOND_FREQUENCY` VARCHAR(32) default '',
|
||||
`DAS_IND_CREATE_DATE` DATETIME NOT NULL,
|
||||
`DAS_IND_UPDATE_DATE` DATETIME,
|
||||
`DAS_IND_STATUS` TINYINT default 1 NOT NULL,
|
||||
PRIMARY KEY (`DAS_UID`),
|
||||
KEY `indexDashboard`(`DAS_UID`, `DAS_IND_TYPE`),
|
||||
CONSTRAINT `fk_dashboard_indicator_dashboard`
|
||||
@@ -2812,7 +2817,6 @@ CREATE TABLE `CATALOG`
|
||||
`CAT_OBSERVATION` MEDIUMTEXT,
|
||||
`CAT_CREATE_DATE` DATETIME NOT NULL,
|
||||
`CAT_UPDATE_DATE` DATETIME,
|
||||
`CAT_STATUS` TINYINT default 1 NOT NULL,
|
||||
PRIMARY KEY (`CAT_UID`, `CAT_TYPE`),
|
||||
KEY `indexType`( `CAT_TYPE`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Definitions catalog.';
|
||||
|
||||
@@ -11,71 +11,40 @@ if ($action == 'selfservice') {
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$urlProxy = '/api/1.0/' . SYS_SYS . '/lists/';
|
||||
$urlProxy = 'proxyNewCasesList';
|
||||
switch ($action) {
|
||||
case 'todo':
|
||||
case 'draft':
|
||||
$urlProxy .= 'inbox';
|
||||
$urlProxy .= '?list=inbox';
|
||||
break;
|
||||
case 'sent':
|
||||
$urlProxy .= 'participated';
|
||||
$urlProxy .= '?list=participated';
|
||||
break;
|
||||
case 'search':
|
||||
case 'participated-history':
|
||||
$urlProxy = 'proxyCasesList';
|
||||
break;
|
||||
case 'paused':
|
||||
$urlProxy .= 'paused';
|
||||
$urlProxy .= '?list=paused';
|
||||
break;
|
||||
case 'cancel':
|
||||
case 'canceled':
|
||||
$urlProxy .= 'canceled';
|
||||
$urlProxy .= '?list=canceled';
|
||||
break;
|
||||
case 'completed':
|
||||
$urlProxy .= 'completed';
|
||||
$urlProxy .= '?list=completed';
|
||||
break;
|
||||
case 'myinbox':
|
||||
case 'my-inbox':
|
||||
$urlProxy .= 'my-inbox';
|
||||
$urlProxy .= '?list=myInbox';
|
||||
break;
|
||||
case 'unassigned':
|
||||
$urlProxy = 'proxyCasesList';
|
||||
$action = 'unassigned';
|
||||
break;
|
||||
}
|
||||
|
||||
$clientId = 'x-pm-local-client';
|
||||
$client = getClientCredentials($clientId);
|
||||
$authCode = getAuthorizationCode($client);
|
||||
$debug = false; //System::isDebugMode();
|
||||
|
||||
$loader = Maveriks\Util\ClassLoader::getInstance();
|
||||
$loader->add(PATH_TRUNK . 'vendor/bshaffer/oauth2-server-php/src/', "OAuth2");
|
||||
|
||||
$request = array(
|
||||
'grant_type' => 'authorization_code',
|
||||
'code' => $authCode
|
||||
);
|
||||
$server = array(
|
||||
'REQUEST_METHOD' => 'POST'
|
||||
);
|
||||
$headers = array(
|
||||
"PHP_AUTH_USER" => $client['CLIENT_ID'],
|
||||
"PHP_AUTH_PW" => $client['CLIENT_SECRET'],
|
||||
"Content-Type" => "multipart/form-data;",
|
||||
"Authorization" => "Basic " . base64_encode($client['CLIENT_ID'] . ":" . $client['CLIENT_SECRET'])
|
||||
);
|
||||
|
||||
$request = new \OAuth2\Request(array(), $request, array(), array(), array(), $server, null, $headers);
|
||||
$oauthServer = new \ProcessMaker\Services\OAuth2\Server();
|
||||
$response = $oauthServer->postToken($request, true);
|
||||
$clientToken = $response->getParameters();
|
||||
$clientToken["client_id"] = $client['CLIENT_ID'];
|
||||
$clientToken["client_secret"] = $client['CLIENT_SECRET'];
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
|
||||
|
||||
G::LoadClass("BasePeer");
|
||||
G::LoadClass("configuration");
|
||||
//require_once ("classes/model/Fields.php");
|
||||
@@ -195,9 +164,6 @@ $oHeadPublisher->assign( 'reassignColumns', $reassignColumns ); //sending the co
|
||||
$oHeadPublisher->assign( 'action', $action ); //sending the action to make
|
||||
$oHeadPublisher->assign( 'urlProxy', $urlProxy ); //sending the urlProxy to make
|
||||
$oHeadPublisher->assign( 'caseListBuilder', $caseListBuilder ); //sending the caseListBuilder
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$oHeadPublisher->assign( 'credentials', $clientToken ); //sending the SYS_SYS to make
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$oHeadPublisher->assign( 'PMDateFormat', $dateFormat ); //sending the fields to get from proxy
|
||||
$oHeadPublisher->assign( 'statusValues', $status ); //Sending the listing of status
|
||||
$oHeadPublisher->assign( 'processValues', $processes ); //Sending the listing of processes
|
||||
|
||||
156
workflow/engine/methods/cases/proxyNewCasesList.php
Normal file
156
workflow/engine/methods/cases/proxyNewCasesList.php
Normal file
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$_GET = $filter->xssFilterHard($_GET);
|
||||
$_REQUEST = $filter->xssFilterHard($_REQUEST);
|
||||
$_SESSION['USER_LOGGED'] = $filter->xssFilterHard($_SESSION['USER_LOGGED']);
|
||||
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
$responseObject = new stdclass();
|
||||
$responseObject->error = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$responseObject->success = true;
|
||||
$responseObject->lostSession = true;
|
||||
print G::json_encode( $responseObject );
|
||||
die();
|
||||
}
|
||||
|
||||
try {
|
||||
$userUid = $_SESSION['USER_LOGGED'];
|
||||
$filters["paged"] = isset( $_REQUEST["paged"] ) ? $_REQUEST["paged"] : true;
|
||||
$filters['count'] = isset( $_REQUEST['count'] ) ? $_REQUEST['count'] : true;
|
||||
$filters["category"] = isset( $_REQUEST["category"] ) ? $_REQUEST["category"] : "";
|
||||
$filters["process"] = isset( $_REQUEST["process"] ) ? $_REQUEST["process"] : "";
|
||||
$filters["search"] = isset( $_REQUEST["search"] ) ? $_REQUEST["search"] : "";
|
||||
$filters["filter"] = isset( $_REQUEST["filter"] ) ? $_REQUEST["filter"] : "";
|
||||
$filters["dateFrom"] = (!empty( $_REQUEST["dateFrom"] )) ? substr( $_REQUEST["dateFrom"], 0, 10 ) : "";
|
||||
$filters["dateTo"] = (!empty( $_REQUEST["dateTo"] )) ? substr( $_REQUEST["dateTo"], 0, 10 ) : "";
|
||||
|
||||
$filters["start"] = isset( $_REQUEST["start"] ) ? $_REQUEST["start"] : "0";
|
||||
$filters["limit"] = isset( $_REQUEST["limit"] ) ? $_REQUEST["limit"] : "25";
|
||||
$filters["sort"] = isset( $_REQUEST["sort"] ) ? $_REQUEST["sort"] : "";
|
||||
$filters["dir"] = isset( $_REQUEST["dir"] ) ? $_REQUEST["dir"] : "DESC";
|
||||
|
||||
$filters["action"] = isset( $_REQUEST["action"] ) ? $_REQUEST["action"] : "";
|
||||
$listName = isset( $_REQUEST["list"] ) ? $_REQUEST["list"] : "inbox";
|
||||
|
||||
// Select list
|
||||
switch ($listName) {
|
||||
case 'inbox':
|
||||
$list = new ListInbox();
|
||||
$listpeer = 'ListInboxPeer';
|
||||
break;
|
||||
case 'participated_history':
|
||||
$list = new ListParticipatedHistory();
|
||||
$listpeer = 'ListParticipatedHistoryPeer';
|
||||
break;
|
||||
case 'participated':
|
||||
case 'participated_last':
|
||||
$list = new ListParticipatedLast();
|
||||
$listpeer = 'ListParticipatedLastPeer';
|
||||
break;
|
||||
case 'completed':
|
||||
$list = new ListCompleted();
|
||||
$listpeer = 'ListCompletedPeer';
|
||||
break;
|
||||
case 'paused':
|
||||
$list = new ListPaused();
|
||||
$listpeer = 'ListPausedPeer';
|
||||
break;
|
||||
case 'canceled':
|
||||
$list = new ListCanceled();
|
||||
$listpeer = 'ListCanceledPeer';
|
||||
break;
|
||||
case 'my_inbox':
|
||||
$list = new ListMyInbox();
|
||||
$listpeer = 'ListMyInboxPeer';
|
||||
break;
|
||||
case 'unassigned':
|
||||
$list = new ListUnassigned();
|
||||
$listpeer = 'ListUnassignedPeer';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Validate filters
|
||||
$filters["start"] = (int)$filters["start"];
|
||||
$filters["start"] = abs($filters["start"]);
|
||||
if ($filters["start"] != 0) {
|
||||
$filters["start"]+1;
|
||||
}
|
||||
|
||||
$filters["limit"] = (int)$filters["limit"];
|
||||
$filters["limit"] = abs($filters["limit"]);
|
||||
if ($filters["limit"] == 0) {
|
||||
G::LoadClass("configuration");
|
||||
$conf = new Configurations();
|
||||
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
if (isset($generalConfCasesList['casesListRowNumber'])) {
|
||||
$filters["limit"] = (int)$generalConfCasesList['casesListRowNumber'];
|
||||
} else {
|
||||
$filters["limit"] = 25;
|
||||
}
|
||||
} else {
|
||||
$filters["limit"] = (int)$filters["limit"];
|
||||
}
|
||||
|
||||
$filters["sort"] = G::toUpper($filters["sort"]);
|
||||
$columnsList = $listpeer::getFieldNames(BasePeer::TYPE_FIELDNAME);
|
||||
if (!(in_array($filters["sort"], $columnsList))) {
|
||||
$filters["sort"] = '';
|
||||
}
|
||||
|
||||
$filters["dir"] = G::toUpper($filters["dir"]);
|
||||
if (!($filters["dir"] == 'DESC' || $filters["dir"] == 'ASC')) {
|
||||
$filters["dir"] = 'DESC';
|
||||
}
|
||||
|
||||
$result = $list->loadList($userUid, $filters);
|
||||
if (!empty($result)) {
|
||||
foreach ($result as &$value) {
|
||||
if (isset($value['DEL_PREVIOUS_USR_UID'])) {
|
||||
$value['PREVIOUS_USR_UID'] = $value['DEL_PREVIOUS_USR_UID'];
|
||||
$value['PREVIOUS_USR_USERNAME'] = $value['DEL_PREVIOUS_USR_USERNAME'];
|
||||
$value['PREVIOUS_USR_FIRSTNAME'] = $value['DEL_PREVIOUS_USR_FIRSTNAME'];
|
||||
$value['PREVIOUS_USR_LASTNAME'] = $value['DEL_PREVIOUS_USR_LASTNAME'];
|
||||
}
|
||||
if (isset($value['DEL_DUE_DATE'])) {
|
||||
$value['DEL_TASK_DUE_DATE'] = $value['DEL_DUE_DATE'];
|
||||
}
|
||||
if (isset($value['APP_PAUSED_DATE'])) {
|
||||
$value['APP_UPDATE_DATE'] = $value['APP_PAUSED_DATE'];
|
||||
}
|
||||
if (isset($value['DEL_CURRENT_USR_USERNAME'])) {
|
||||
$value['USR_USERNAME'] = $value['DEL_CURRENT_USR_USERNAME'];
|
||||
$value['USR_FIRSTNAME'] = $value['DEL_CURRENT_USR_FIRSTNAME'];
|
||||
$value['USR_LASTNAME'] = $value['DEL_CURRENT_USR_LASTNAME'];
|
||||
$value['APP_UPDATE_DATE'] = $value['DEL_DELEGATE_DATE'];
|
||||
}
|
||||
if (isset($value['APP_STATUS'])) {
|
||||
$value['APP_STATUS_LABEL'] = G::LoadTranslation( "ID_{$value['APP_STATUS']}" );
|
||||
}
|
||||
|
||||
//$value = array_change_key_case($value, CASE_LOWER);
|
||||
}
|
||||
}
|
||||
|
||||
$filtersData = array();
|
||||
$filtersData['start'] = $filters["start"];
|
||||
$filtersData['limit'] = $filters["limit"];
|
||||
$filtersData['sort'] = G::toLower($filters["sort"]);
|
||||
$filtersData['dir'] = G::toLower($filters["dir"]);
|
||||
$filtersData['cat_uid'] = $filters["category"];
|
||||
$filtersData['pro_uid'] = $filters["process"];
|
||||
$filtersData['search'] = $filters["search"];
|
||||
$filtersData['date_from'] = $filters["dateFrom"];
|
||||
$filtersData['date_to'] = $filters["dateTo"];
|
||||
$response['filters'] = $filtersData;
|
||||
$response['data'] = $result;
|
||||
$filtersData['action'] = $filters["action"];
|
||||
$response['totalCount'] = $list->countTotal($userUid, $filtersData);
|
||||
|
||||
echo G::json_encode($response);
|
||||
} catch (Exception $e) {
|
||||
$msg = array("error" => $e->getMessage());
|
||||
echo G::json_encode($msg);
|
||||
}
|
||||
|
||||
@@ -293,16 +293,16 @@ class MessageEventDefinition
|
||||
|
||||
$messageEventDefinitionUid = \ProcessMaker\Util\Common::generateUID();
|
||||
|
||||
if (isset($arrayData["MSGED_VARIABLES"])) {
|
||||
$arrayData["MSGED_VARIABLES"] = serialize($arrayData["MSGED_VARIABLES"]);
|
||||
}
|
||||
|
||||
$messageEventDefinition->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
$messageEventDefinition->setMsgedUid($messageEventDefinitionUid);
|
||||
$messageEventDefinition->setPrjUid($projectUid);
|
||||
$messageEventDefinition->setMsgedUsrUid("00000000000000000000000000000001"); //admin
|
||||
|
||||
if (isset($arrayData["MSGED_VARIABLES"])) {
|
||||
$messageEventDefinition->setMsgedVariables(serialize($arrayData["MSGED_VARIABLES"]));
|
||||
}
|
||||
|
||||
if ($messageEventDefinition->validate()) {
|
||||
$cnn->begin();
|
||||
|
||||
@@ -375,7 +375,7 @@ class MessageEventDefinition
|
||||
}
|
||||
|
||||
if (isset($arrayData["MSGED_VARIABLES"])) {
|
||||
$messageEventDefinition->setMsgedVariables(serialize($arrayData["MSGED_VARIABLES"]));
|
||||
$arrayData["MSGED_VARIABLES"] = serialize($arrayData["MSGED_VARIABLES"]);
|
||||
}
|
||||
|
||||
$messageEventDefinition->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
||||
@@ -632,4 +632,3 @@ class MessageEventDefinition
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +116,12 @@ class PmPdo implements \OAuth2\Storage\AuthorizationCodeInterface,
|
||||
|
||||
public function setAccessToken($access_token, $client_id, $user_id, $expires, $scope = null)
|
||||
{
|
||||
//Delete expired Access and Refresh Token
|
||||
foreach (array($this->config["access_token_table"], $this->config["refresh_token_table"]) as $value) {
|
||||
$stmt = $this->db->prepare(sprintf("DELETE FROM %s WHERE EXPIRES < %s", $value, "'" . date("Y-m-d H:i:s") . "'"));
|
||||
$result = $stmt->execute();
|
||||
}
|
||||
|
||||
// convert expires to datestring
|
||||
$expires = date('Y-m-d H:i:s', $expires);
|
||||
|
||||
@@ -177,10 +183,8 @@ class PmPdo implements \OAuth2\Storage\AuthorizationCodeInterface,
|
||||
$access_token->load($token);
|
||||
|
||||
$stmt = $this->db->prepare(sprintf('DELETE FROM %s WHERE ACCESS_TOKEN = :token', $this->config['access_token_table']));
|
||||
$stmt->execute(compact('token'));
|
||||
|
||||
$stmt = $this->db->prepare(sprintf("DELETE FROM %s WHERE EXPIRES < %s", $this->config["refresh_token_table"], "'" . date("Y-m-d H:i:s") . "'"));
|
||||
return $stmt->execute(compact('token'));
|
||||
return $stmt->execute(compact("token"));
|
||||
}
|
||||
|
||||
/* OAuth2_Storage_UserCredentialsInterface */
|
||||
|
||||
@@ -734,7 +734,6 @@ Ext.onReady ( function() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Create HttpProxy instance, all CRUD requests will be directed to single proxy url.
|
||||
if (caseListBuilder) {
|
||||
var proxyCasesList = new Ext.data.HttpProxy({
|
||||
@@ -747,13 +746,6 @@ Ext.onReady ( function() {
|
||||
api: {
|
||||
read : urlProxy
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
,method: 'GET'
|
||||
,headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + credentials.access_token
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,20 @@ leimnud.event.add(document.getElementById('form[USR_PASSWORD_MASK]'), 'keypress'
|
||||
}
|
||||
});
|
||||
|
||||
leimnud.event.add(document.getElementById('form[USER_ENV]'), 'keypress', function(event) {
|
||||
var key;
|
||||
if(window.event)
|
||||
key = window.event.keyCode; //IE
|
||||
else
|
||||
key = event.which; //firefox
|
||||
if(key == 13) {
|
||||
document.getElementById('form[BSUBMIT]').click();
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
leimnud.event.add(document.getElementById('form[BSUBMIT]'), 'click', function() {
|
||||
createCookie("pm_sys_sys", "{\"sys_sys\": \"" + getField("USER_ENV").value + "\"}", 365);
|
||||
|
||||
|
||||
@@ -48,6 +48,20 @@ leimnud.event.add(document.getElementById('form[USR_PASSWORD_MASK]'), 'keypress'
|
||||
}
|
||||
});
|
||||
|
||||
leimnud.event.add(document.getElementById('form[USER_ENV]'), 'keypress', function(event) {
|
||||
var key;
|
||||
if(window.event)
|
||||
key = window.event.keyCode; //IE
|
||||
else
|
||||
key = event.which; //firefox
|
||||
if(key == 13) {
|
||||
document.getElementById('form[BSUBMIT]').click();
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
leimnud.event.add(document.getElementById('form[BSUBMIT]'), 'click', function() {
|
||||
createCookie("pm_sys_sys", "{\"sys_sys\": \"" + getField("USER_ENV").value + "\"}", 365);
|
||||
|
||||
|
||||
@@ -692,16 +692,22 @@ ob_start();
|
||||
|
||||
// Rebuild the base Workflow translations if not exists
|
||||
if (! is_file( PATH_LANGUAGECONT . 'translation.en' )) {
|
||||
$pathFile = $filter->validateInput("classes/model/Translation.php",'path');
|
||||
$pathFile = $filter->validateInput(PATH_CLASSES . "model" . PATH_SEP . "Translation.php", "path");
|
||||
|
||||
require_once ($pathFile);
|
||||
$fields = Translation::generateFileTranslation( 'en' );
|
||||
|
||||
$pmTranslation = new Translation();
|
||||
$fields = $pmTranslation->generateFileTranslation("en");
|
||||
}
|
||||
|
||||
// TODO: Verify if the language set into url is defined in translations env.
|
||||
if (SYS_LANG != 'en' && ! is_file( PATH_LANGUAGECONT . 'translation.' . SYS_LANG )) {
|
||||
$pathFile = $filter->validateInput("classes/model/Translation.php",'path');
|
||||
$pathFile = $filter->validateInput(PATH_CLASSES . "model" . PATH_SEP . "Translation.php", "path");
|
||||
|
||||
require_once ($pathFile);
|
||||
$fields = Translation::generateFileTranslation( SYS_LANG );
|
||||
|
||||
$pmTranslation = new Translation();
|
||||
$fields = $pmTranslation->generateFileTranslation(SYS_LANG);
|
||||
}
|
||||
|
||||
// Setup plugins
|
||||
@@ -894,6 +900,7 @@ if (! defined( 'EXECUTE_BY_CRON' )) {
|
||||
$noLoginFiles[] = 'appFolderAjax';
|
||||
$noLoginFiles[] = 'steps_Ajax';
|
||||
$noLoginFiles[] = 'proxyCasesList';
|
||||
$noLoginFiles[] = 'proxyNewCasesList';
|
||||
$noLoginFiles[] = 'casesStartPage_Ajax';
|
||||
$noLoginFiles[] = 'appProxy';
|
||||
$noLoginFiles[] = 'cases_Ajax';
|
||||
|
||||
Reference in New Issue
Block a user