This commit is contained in:
Marco Antonio Nina Mena
2017-12-04 13:25:35 +00:00
committed by Julio Cesar Laura Avendaño
parent abe71a6ffe
commit 0d533e19d9
363 changed files with 23948 additions and 44623 deletions

View File

@@ -28,28 +28,28 @@ class Home extends Controller
/**
* Check the if the user has permissions over functions
*/
public function call ($name)
public function call($name)
{
global $RBAC;
$RBAC->allows(basename(__FILE__), $name);
parent::call($name);
}
public function __construct ()
public function __construct()
{
// setting client browser information
$this->clientBrowser = G::getBrowser();
// getting the ux type from user o group conf.
$this->userUxType = isset( $_SESSION['user_experience'] ) ? $_SESSION['user_experience'] : 'SIMPLIFIED';
$this->lastSkin = isset( $_SESSION['user_last_skin'] ) ? $_SESSION['user_last_skin'] : 'neoclassic';
$this->userUxBaseTemplate = (is_dir( PATH_CUSTOM_SKINS . 'uxs' )) ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'templates' : 'home';
$this->userUxType = isset($_SESSION['user_experience']) ? $_SESSION['user_experience'] : 'SIMPLIFIED';
$this->lastSkin = isset($_SESSION['user_last_skin']) ? $_SESSION['user_last_skin'] : 'neoclassic';
$this->userUxBaseTemplate = (is_dir(PATH_CUSTOM_SKINS . 'uxs')) ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'templates' : 'home';
if (isset( $_SESSION['USER_LOGGED'] ) && ! empty( $_SESSION['USER_LOGGED'] )) {
$this->userUid = isset( $_SESSION['USER_LOGGED'] ) ? $_SESSION['USER_LOGGED'] : null;
$this->userName = isset( $_SESSION['USR_USERNAME'] ) ? $_SESSION['USR_USERNAME'] : '';
$this->userFullName = isset( $_SESSION['USR_FULLNAME'] ) ? $_SESSION['USR_FULLNAME'] : '';
$this->userRolName = isset( $_SESSION['USR_ROLENAME'] ) ? $_SESSION['USR_ROLENAME'] : '';
if (isset($_SESSION['USER_LOGGED']) && ! empty($_SESSION['USER_LOGGED'])) {
$this->userUid = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : null;
$this->userName = isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME'] : '';
$this->userFullName = isset($_SESSION['USR_FULLNAME']) ? $_SESSION['USR_FULLNAME'] : '';
$this->userRolName = isset($_SESSION['USR_ROLENAME']) ? $_SESSION['USR_ROLENAME'] : '';
$users = new Users();
$users = $users->load($this->userUid);
@@ -57,34 +57,34 @@ class Home extends Controller
}
}
public function login ($httpData)
public function login($httpData)
{
//start new session
@session_destroy();
session_start();
session_regenerate_id();
$data = isset( $httpData->d ) ? unserialize( base64_decode( $httpData->d ) ) : '';
$data = isset($httpData->d) ? unserialize(base64_decode($httpData->d)) : '';
$template = $this->clientBrowser['name'] == 'msie' ? 'login_ie' : 'login_standard';
$skin = $this->clientBrowser['name'] == 'msie' ? $this->lastSkin : 'simplified';
if (! is_array( $data )) {
$data = array (
if (! is_array($data)) {
$data = array(
'u' => '',
'p' => '',
'm' => ''
);
}
$this->setVar( 'msg', $data['m'] );
$this->setVar( 'usr', $data['u'] );
$this->setVar( 'pwd', $data['p'] );
$this->setVar('timeZoneFailed', (isset($data['timeZoneFailed']))? $data['timeZoneFailed'] : 0);
$this->setVar('userTimeZone', (isset($data['userTimeZone']))? $data['userTimeZone'] : '');
$this->setVar('msg', $data['m']);
$this->setVar('usr', $data['u']);
$this->setVar('pwd', $data['p']);
$this->setVar('timeZoneFailed', (isset($data['timeZoneFailed']))? $data['timeZoneFailed'] : 0);
$this->setVar('userTimeZone', (isset($data['userTimeZone']))? $data['userTimeZone'] : '');
$this->setVar('browserTimeZone', (isset($data['browserTimeZone']))? $data['browserTimeZone'] : '');
$this->setVar( 'skin', $skin );
$this->setVar('skin', $skin);
$this->setView( $this->userUxBaseTemplate . PATH_SEP . $template );
$this->setView($this->userUxBaseTemplate . PATH_SEP . $template);
$this->render();
}
@@ -94,26 +94,26 @@ class Home extends Controller
* @param string $httpData (opional)
*/
public function index ($httpData)
public function index($httpData)
{
if ($this->userUxType == 'SINGLE') {
$this->indexSingle( $httpData );
$this->indexSingle($httpData);
return;
}
$userProperty = new UsersProperties();
$process = new Process();
$case = new Cases();
$sysConf = System::getSystemConfiguration( PATH_CONFIG . 'env.ini' );
$sysConf = System::getSystemConfiguration(PATH_CONFIG . 'env.ini');
//Get ProcessStatistics Info
$start = 0;
$limit = '';
$proData = $process->getAllProcesses( $start, $limit, null, null, false, true );
$processList = $case->getStartCasesPerType( $_SESSION['USER_LOGGED'], 'category' );
$proData = $process->getAllProcesses($start, $limit, null, null, false, true);
$processList = $case->getStartCasesPerType($_SESSION['USER_LOGGED'], 'category');
$processesList = array ();
$processesList = array();
foreach ($processList as $key => $valueProcess) {
foreach ($proData as $keyPro => $valuePro) {
@@ -126,18 +126,18 @@ class Home extends Controller
}
}
$switchLink = $userProperty->getUserLocation( $_SESSION['USER_LOGGED'], SYS_LANG );
$switchLink = $userProperty->getUserLocation($_SESSION['USER_LOGGED'], SYS_LANG);
if (!isset($_COOKIE['workspaceSkin'])) {
if (substr( $sysConf['default_skin'], 0, 2 ) == 'ux') {
if (substr($sysConf['default_skin'], 0, 2) == 'ux') {
$_SESSION['_defaultUserLocation'] = $switchLink;
$switchLink = '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . $sysConf['default_skin'] . '/main';
}
}
$oServerConf = & ServerConf::getSingleton();
$oServerConf = ServerConf::getSingleton();
if ($oServerConf->isRtl( SYS_LANG )) {
if ($oServerConf->isRtl(SYS_LANG)) {
$swRtl = 1;
} else {
$swRtl = 0;
@@ -147,13 +147,13 @@ class Home extends Controller
global $G_TMP_MENU;
$mnu = new Menu();
$mnu->load( 'simplified' );
$arrayMnuOption = array ();
$mnuNewCase = array ();
$mnu->load('simplified');
$arrayMnuOption = array();
$mnuNewCase = array();
if (! empty( $mnu->Options )) {
if (! empty($mnu->Options)) {
foreach ($mnu->Options as $index => $value) {
$option = array ('id' => $mnu->Id[$index],'url' => $mnu->Options[$index],'label' => $mnu->Labels[$index],'icon' => $mnu->Icons[$index],'class' => $mnu->ElementClass[$index]
$option = array('id' => $mnu->Id[$index],'url' => $mnu->Options[$index],'label' => $mnu->Labels[$index],'icon' => $mnu->Icons[$index],'class' => $mnu->ElementClass[$index]
);
if ($mnu->Id[$index] != 'S_NEW_CASE') {
@@ -164,30 +164,29 @@ class Home extends Controller
}
}
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'index' );
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'index');
$this->setVar( 'usrUid', $this->userUid );
$this->setVar( 'userName', $this->userName );
$this->setVar( 'processList', $processesList );
$this->setVar( 'canStartCase', $case->canStartCase( $_SESSION['USER_LOGGED'] ) );
$this->setVar( 'userUxType', $this->userUxType );
$this->setVar( 'clientBrowser', $this->clientBrowser['name'] );
$this->setVar( 'switchLink', $switchLink );
$this->setVar( 'arrayMnuOption', $arrayMnuOption );
$this->setVar( 'mnuNewCase', $mnuNewCase );
$this->setVar( 'rtl', $swRtl );
$this->setVar('usrUid', $this->userUid);
$this->setVar('userName', $this->userName);
$this->setVar('processList', $processesList);
$this->setVar('canStartCase', $case->canStartCase($_SESSION['USER_LOGGED']));
$this->setVar('userUxType', $this->userUxType);
$this->setVar('clientBrowser', $this->clientBrowser['name']);
$this->setVar('switchLink', $switchLink);
$this->setVar('arrayMnuOption', $arrayMnuOption);
$this->setVar('mnuNewCase', $mnuNewCase);
$this->setVar('rtl', $swRtl);
$this->render();
}
public function indexSingle ($httpData)
public function indexSingle($httpData)
{
$step = new Step();
$solrEnabled = false;
if (($solrConf = System::solrEnv()) !== false) {
$ApplicationSolrIndex = new AppSolr(
$solrConf["solr_enabled"],
$solrConf["solr_host"],
@@ -198,7 +197,7 @@ class Home extends Controller
//Check if there are missing records to reindex and reindex them
$ApplicationSolrIndex->synchronizePendingApplications();
$solrEnabled = true;
} else{
} else {
$solrEnabled = false;
}
}
@@ -206,16 +205,15 @@ class Home extends Controller
if ($solrEnabled) {
$cases = $ApplicationSolrIndex->getAppGridData($this->userUid, 0, 1, 'todo');
} else {
$apps = new Applications();
$cases = $apps->getAll( $this->userUid, 0, 1, 'todo' );
$cases = $apps->getAll($this->userUid, 0, 1, 'todo');
}
if (! isset( $cases['data'][0] )) {
if (! isset($cases['data'][0])) {
//the current user has not any aplication to do
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'indexSingle' );
$this->setVar( 'default_url', $this->userUxBaseTemplate . "/" . 'error?no=2' );
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'indexSingle');
$this->setVar('default_url', $this->userUxBaseTemplate . "/" . 'error?no=2');
$this->render();
exit();
}
@@ -226,25 +224,25 @@ class Home extends Controller
$_SESSION['PROCESS'] = $lastApp['PRO_UID'];
$_SESSION['TASK'] = $lastApp['TAS_UID'];
$steps = $apps->getSteps( $lastApp['APP_UID'], $lastApp['DEL_INDEX'], $lastApp['TAS_UID'], $lastApp['PRO_UID'] );
$lastStep = array_pop( $steps );
$lastStep['title'] = G::LoadTranslation( 'ID_FINISH' );
$steps = $apps->getSteps($lastApp['APP_UID'], $lastApp['DEL_INDEX'], $lastApp['TAS_UID'], $lastApp['PRO_UID']);
$lastStep = array_pop($steps);
$lastStep['title'] = G::LoadTranslation('ID_FINISH');
$steps[] = $lastStep;
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'indexSingle' );
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'indexSingle');
$this->setVar( 'usrUid', $this->userUid );
$this->setVar( 'userName', $this->userName );
$this->setVar( 'steps', $steps );
$this->setVar( 'default_url', "cases/cases_Open?APP_UID={$lastApp['APP_UID']}&DEL_INDEX={$lastApp['DEL_INDEX']}&action=todo" );
$this->setVar('usrUid', $this->userUid);
$this->setVar('userName', $this->userName);
$this->setVar('steps', $steps);
$this->setVar('default_url', "cases/cases_Open?APP_UID={$lastApp['APP_UID']}&DEL_INDEX={$lastApp['DEL_INDEX']}&action=todo");
$this->render();
}
public function appList ($httpData)
public function appList($httpData)
{
// setting default list applications types [default: todo]
$httpData->t = isset( $httpData->t ) ? $httpData->t : 'todo';
$httpData->t = isset($httpData->t) ? $httpData->t : 'todo';
// setting main list title
switch ($httpData->t) {
@@ -258,34 +256,34 @@ class Home extends Controller
$title = G::LoadTranslation("ID_UNASSIGNED_INBOX");
break;
default:
$title = ucwords( $httpData->t );
$title = ucwords($httpData->t);
break;
}
// getting apps data
$cases = $this->getAppsData( $httpData->t );
$cases = $this->getAppsData($httpData->t);
// settings html template
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'appList' );
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'appList');
// settings vars and rendering
$this->setVar( 'cases', $cases['data'] );
$this->setVar( 'title', $title );
$this->setVar( 'noPerms', G::LoadTranslation( 'ID_CASES_NOTES_NO_PERMISSIONS' ));
$this->setVar( 'appListStart', $this->appListLimit );
$this->setVar( 'appListLimit', 10 );
$this->setVar( 'listType', $httpData->t );
$this->setVar('cases', $cases['data']);
$this->setVar('title', $title);
$this->setVar('noPerms', G::LoadTranslation('ID_CASES_NOTES_NO_PERMISSIONS'));
$this->setVar('appListStart', $this->appListLimit);
$this->setVar('appListLimit', 10);
$this->setVar('listType', $httpData->t);
$this->render();
}
public function appAdvancedSearch ($httpData)
public function appAdvancedSearch($httpData)
{
$title = G::LoadTranslation("ID_ADVANCEDSEARCH");
$httpData->t = 'search';
// settings html template
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'appListSearch' );
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'appListSearch');
// get data
$process = (isset($httpData->process)) ? $httpData->process : null;
@@ -324,44 +322,44 @@ class Home extends Controller
$arraySearch = array($process, $status, $search, $category, $user, $dateFrom, $dateTo );
// settings vars and rendering
$this->setVar( 'statusValues', $this->getStatusArray( $httpData->t, $this->userUid) );
$this->setVar( 'categoryValues', $this->getCategoryArray() );
$this->setVar( 'allUsersValues', $this->getAllUsersArray( 'search' ) );
$this->setVar( 'categoryTitle', G::LoadTranslation("ID_CATEGORY") );
$this->setVar( 'processTitle', G::LoadTranslation("ID_PROCESS") );
$this->setVar( 'statusTitle', G::LoadTranslation("ID_STATUS") );
$this->setVar( 'searchTitle', G::LoadTranslation("ID_SEARCH") );
$this->setVar( 'userTitle', G::LoadTranslation("ID_USER") );
$this->setVar( 'fromTitle', G::LoadTranslation("ID_DELEGATE_DATE_FROM") );
$this->setVar( 'toTitle', G::LoadTranslation("ID_DELEGATE_DATE_TO") );
$this->setVar( 'filterTitle', G::LoadTranslation("ID_FILTER") );
$this->setVar( 'arraySearch', $arraySearch );
$this->setVar('statusValues', $this->getStatusArray($httpData->t, $this->userUid));
$this->setVar('categoryValues', $this->getCategoryArray());
$this->setVar('allUsersValues', $this->getAllUsersArray('search'));
$this->setVar('categoryTitle', G::LoadTranslation("ID_CATEGORY"));
$this->setVar('processTitle', G::LoadTranslation("ID_PROCESS"));
$this->setVar('statusTitle', G::LoadTranslation("ID_STATUS"));
$this->setVar('searchTitle', G::LoadTranslation("ID_SEARCH"));
$this->setVar('userTitle', G::LoadTranslation("ID_USER"));
$this->setVar('fromTitle', G::LoadTranslation("ID_DELEGATE_DATE_FROM"));
$this->setVar('toTitle', G::LoadTranslation("ID_DELEGATE_DATE_TO"));
$this->setVar('filterTitle', G::LoadTranslation("ID_FILTER"));
$this->setVar('arraySearch', $arraySearch);
$this->setVar( 'cases', $cases['data'] );
$this->setVar( 'title', $title );
$this->setVar( 'noPerms', G::LoadTranslation( 'ID_CASES_NOTES_NO_PERMISSIONS' ));
$this->setVar( 'appListStart', $this->appListLimit );
$this->setVar( 'appListLimit', 10 );
$this->setVar( 'listType', $httpData->t );
$this->setVar('cases', $cases['data']);
$this->setVar('title', $title);
$this->setVar('noPerms', G::LoadTranslation('ID_CASES_NOTES_NO_PERMISSIONS'));
$this->setVar('appListStart', $this->appListLimit);
$this->setVar('appListLimit', 10);
$this->setVar('listType', $httpData->t);
$this->setVar( 'processCurrentTitle', $processTitle );
$this->setVar( 'userCurrentName', $userName );
$this->setVar( 'currentUserLabel', G::LoadTranslation( "ID_ALL_USERS" ) );
$this->setVar( 'allProcessLabel', G::LoadTranslation("ID_ALL_PROCESS") );
$this->setVar('processCurrentTitle', $processTitle);
$this->setVar('userCurrentName', $userName);
$this->setVar('currentUserLabel', G::LoadTranslation("ID_ALL_USERS"));
$this->setVar('allProcessLabel', G::LoadTranslation("ID_ALL_PROCESS"));
$this->render();
}
public function getApps ($httpData)
public function getApps($httpData)
{
$cases = $this->getAppsData( $httpData->t, $httpData->start, $httpData->limit );
$cases = $this->getAppsData($httpData->t, $httpData->start, $httpData->limit);
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'applications' );
$this->setVar( 'cases', $cases['data'] );
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'applications');
$this->setVar('cases', $cases['data']);
$this->render();
}
public function getAppsData (
public function getAppsData(
$type,
$start = null,
$limit = null,
@@ -375,13 +373,12 @@ class Home extends Controller
$callback = null,
$dir = 'DESC',
$sort = "APP_CACHE_VIEW.APP_NUMBER",
$category = null)
{
$category = null
) {
$appNotes = new AppNotes();
$start = empty( $start ) ? $this->appListStart : $start;
$limit = empty( $limit ) ? $this->appListLimit : $limit;
$start = empty($start) ? $this->appListStart : $start;
$limit = empty($limit) ? $this->appListLimit : $limit;
$notesStart = 0;
$notesLimit = 4;
@@ -412,7 +409,6 @@ class Home extends Controller
) &&
(($solrConf = System::solrEnv()) !== false)
) {
$ApplicationSolrIndex = new AppSolr(
$solrConf["solr_enabled"],
$solrConf["solr_host"],
@@ -423,7 +419,7 @@ class Home extends Controller
//Check if there are missing records to reindex and reindex them
$ApplicationSolrIndex->synchronizePendingApplications();
$solrEnabled = true;
} else{
} else {
$solrEnabled = false;
}
}
@@ -494,19 +490,18 @@ class Home extends Controller
$cases = $list->getList($listType, $dataList);
}
} else {
/*----------------------------------********---------------------------------*/
/*----------------------------------********---------------------------------*/
$case = new \ProcessMaker\BusinessModel\Cases();
$cases = $case->getList($dataList);
foreach ($cases['data'] as &$value) {
$value = array_change_key_case($value, CASE_UPPER);
}
/*----------------------------------********---------------------------------*/
/*----------------------------------********---------------------------------*/
}
/*----------------------------------********---------------------------------*/
}
if(empty($cases) && $type == 'search') {
if (empty($cases) && $type == 'search') {
$case = new \ProcessMaker\BusinessModel\Cases();
$cases = $case->getCasesSearch($dataList);
foreach ($cases['data'] as &$value) {
@@ -514,22 +509,22 @@ class Home extends Controller
}
}
if(!isset($cases['totalCount'])){
if (!isset($cases['totalCount'])) {
$cases['totalCount'] = $cases['total'];
}
// formating & complitting apps data with 'Notes'
foreach ($cases['data'] as $i => $row) {
// Formatting
$appTitle = str_replace( '#', '', $row['APP_TITLE'] );
$appTitle = str_replace('#', '', $row['APP_TITLE']);
if (is_numeric( $appTitle )) {
$cases['data'][$i]['APP_TITLE'] = G::LoadTranslation( 'ID_CASE' ) . ' ' . $appTitle;
if (is_numeric($appTitle)) {
$cases['data'][$i]['APP_TITLE'] = G::LoadTranslation('ID_CASE') . ' ' . $appTitle;
}
if (isset( $row['DEL_DELEGATE_DATE'] )) {
if (isset($row['DEL_DELEGATE_DATE'])) {
$conf = new Configurations();
$generalConfCasesList = $conf->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
$cases['data'][$i]['DEL_DELEGATE_DATE'] = '';
if (!empty(config("system.workspace"))) {
if (isset( $generalConfCasesList['casesListDateFormat'] ) && ! empty( $generalConfCasesList['casesListDateFormat'] )) {
@@ -540,8 +535,8 @@ class Home extends Controller
$cases['data'][$i]['DEL_DELEGATE_DATE'] = $conf->getSystemDate($row['DEL_DELEGATE_DATE']);
}
}
if (isset( $row['APP_DEL_PREVIOUS_USER'] )) {
$cases['data'][$i]['APP_DEL_PREVIOUS_USER'] = ucwords( $row['APP_DEL_PREVIOUS_USER'] );
if (isset($row['APP_DEL_PREVIOUS_USER'])) {
$cases['data'][$i]['APP_DEL_PREVIOUS_USER'] = ucwords($row['APP_DEL_PREVIOUS_USER']);
}
// Completting with Notes
$notes = $appNotes->getNotesList($row['APP_UID'], '', $notesStart, $notesLimit);
@@ -555,10 +550,10 @@ class Home extends Controller
return $cases;
}
public function startCase ($httpData)
public function startCase($httpData)
{
$case = new Cases();
$aData = $case->startCase( $httpData->id, $_SESSION['USER_LOGGED'] );
$aData = $case->startCase($httpData->id, $_SESSION['USER_LOGGED']);
$_SESSION['APPLICATION'] = $aData['APPLICATION'];
$_SESSION['INDEX'] = $aData['INDEX'];
@@ -568,16 +563,16 @@ class Home extends Controller
$_SESSION['CASES_REFRESH'] = true;
$oCase = new Cases();
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
$aNextStep['PAGE'] = '../cases/cases_Open?APP_UID=' . $aData['APPLICATION'] . '&DEL_INDEX=' . $aData['INDEX'] . '&action=draft';
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
$this->redirect( $aNextStep['PAGE'] );
$this->redirect($aNextStep['PAGE']);
}
public function error ($httpData)
public function error($httpData)
{
$httpData->no = isset( $httpData->no ) ? $httpData->no : 0;
$httpData->no = isset($httpData->no) ? $httpData->no : 0;
switch ($httpData->no) {
case 2:
@@ -587,11 +582,11 @@ class Home extends Controller
$tpl = $this->userUxBaseTemplate . PATH_SEP . 'error';
}
$this->setView( $tpl );
$this->setView($tpl);
$this->render();
}
function getUserArray($action, $userUid, $search = null)
public function getUserArray($action, $userUid, $search = null)
{
$conf = new Configurations();
$confEnvSetting = $conf->getFormats();
@@ -613,7 +608,8 @@ class Home extends Controller
if (!empty($search)) {
$cUsers->add(
$cUsers->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $search . '%', Criteria::LIKE)->addOr(
$cUsers->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $search . '%', Criteria::LIKE))
$cUsers->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $search . '%', Criteria::LIKE)
)
);
}
$oDataset = UsersPeer::doSelectRS($cUsers);
@@ -637,63 +633,63 @@ class Home extends Controller
return $users;
}
function getCategoryArray ()
public function getCategoryArray()
{
$category = array();
$category[] = array ("",G::LoadTranslation( "ID_ALL_CATEGORIES" ));
$category[] = array("",G::LoadTranslation("ID_ALL_CATEGORIES"));
$criteria = new Criteria( 'workflow' );
$criteria->addSelectColumn( ProcessCategoryPeer::CATEGORY_UID );
$criteria->addSelectColumn( ProcessCategoryPeer::CATEGORY_NAME );
$dataset = ProcessCategoryPeer::doSelectRS( $criteria );
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
$criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
$dataset = ProcessCategoryPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
while ($row = $dataset->getRow()) {
$category[] = array ($row['CATEGORY_UID'],$row['CATEGORY_NAME']);
$category[] = array($row['CATEGORY_UID'],$row['CATEGORY_NAME']);
$dataset->next();
}
return $category;
}
function getAllUsersArray ($action)
public function getAllUsersArray($action)
{
global $oAppCache;
$users = array ();
$users[] = array ("CURRENT_USER",G::LoadTranslation( "ID_CURRENT_USER" ));
$users[] = array ("",G::LoadTranslation( "ID_ALL_USERS" ));
$users = array();
$users[] = array("CURRENT_USER",G::LoadTranslation("ID_CURRENT_USER"));
$users[] = array("",G::LoadTranslation("ID_ALL_USERS"));
if ($action == 'to_reassign') {
//now get users, just for the Search action
$cUsers = $oAppCache->getToReassignListCriteria(null);
$cUsers->addSelectColumn( AppCacheViewPeer::USR_UID );
$cUsers->addSelectColumn(AppCacheViewPeer::USR_UID);
if (g::MySQLSintaxis()) {
$cUsers->addGroupByColumn( AppCacheViewPeer::USR_UID );
$cUsers->addGroupByColumn(AppCacheViewPeer::USR_UID);
}
$cUsers->addAscendingOrderByColumn( AppCacheViewPeer::APP_CURRENT_USER );
$oDataset = AppCacheViewPeer::doSelectRS( $cUsers );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$cUsers->addAscendingOrderByColumn(AppCacheViewPeer::APP_CURRENT_USER);
$oDataset = AppCacheViewPeer::doSelectRS($cUsers);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$users[] = array ($aRow['USR_UID'],$aRow['APP_CURRENT_USER']);
$users[] = array($aRow['USR_UID'],$aRow['APP_CURRENT_USER']);
$oDataset->next();
}
}
return $users;
}
function getStatusArray ($action, $userUid)
public function getStatusArray($action, $userUid)
{
$status = array();
$aStatus = Application::$app_status_values;
$status[] = array('', G::LoadTranslation('ID_ALL_STATUS'));
foreach ($aStatus as $key => $value) {
if ($action == 'search') {
$status[] = array ($value, G::LoadTranslation( 'ID_CASES_STATUS_' . $key ));
$status[] = array($value, G::LoadTranslation('ID_CASES_STATUS_' . $key));
} else {
$status[] = array ($key, G::LoadTranslation( 'ID_CASES_STATUS_' . $key ));
$status[] = array($key, G::LoadTranslation('ID_CASES_STATUS_' . $key));
}
}
return $status;
@@ -724,8 +720,8 @@ class Home extends Controller
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$processes[] = array($aRow["PRO_ID"], $aRow["PRO_TITLE"]);
$oDataset->next();
$processes[] = array($aRow["PRO_ID"], $aRow["PRO_TITLE"]);
$oDataset->next();
}
return ($processes);
@@ -765,4 +761,3 @@ class Home extends Controller
print G::json_encode($users);
}
}