Merge branch 'dashboards2' of bitbucket.org:colosa/processmaker into dashboards2
This commit is contained in:
@@ -14,9 +14,11 @@ require_once 'classes/model/om/BaseCatalog.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class Catalog extends BaseCatalog
|
||||
class Catalog extends BaseCatalog
|
||||
{
|
||||
public function load ($catUid, $catType)
|
||||
private $records = array();
|
||||
|
||||
public function load ($catUid, $catType)
|
||||
{
|
||||
try {
|
||||
$catalog = CatalogPeer::retrieveByPK($catUid, $catType);
|
||||
@@ -106,6 +108,106 @@ class Catalog extends BaseCatalog
|
||||
} catch (Exception $error) {
|
||||
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()) {
|
||||
|
||||
Reference in New Issue
Block a user