BUG 0000 BUG 0000 User Inbox Simplified (second commit)

This commit is contained in:
Erik Amaru Ortiz
2012-01-26 09:33:01 -04:00
parent f5f4b527f5
commit 5599ca8b96
22 changed files with 900 additions and 229 deletions

View File

@@ -1,6 +1,7 @@
<?php
/**
* Application controller
* Home controller
*
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
* @inherits Controller
* @access public
@@ -15,13 +16,14 @@ class Home extends Controller
public function __construct()
{
$_SESSION['user_experience'] = 'simplified';
if (isset($_SESSION['USER_LOGGED']) && !empty($_SESSION['USER_LOGGED'])) {
$this->userID = 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'] : '';
}
}
/**
@@ -37,14 +39,6 @@ class Home extends Controller
$process = new Process();
$case = new Cases();
/**
* Getting the user's processes that can start
*/
if (!$case->canStartCase($_SESSION ['USER_LOGGED'])) {
//throw new Exception("User can not start a cases");
}
//Get ProcessStatistics Info
$start = 0;
$limit = '';
@@ -53,32 +47,16 @@ class Home extends Controller
$processList = $case->getStartCasesPerType ( $_SESSION ['USER_LOGGED'], 'category' );
unset($processList[0]);
//$processList = array();
// foreach ( $processListInitial as $key => $procInfo ) {
// if (isset ( $procInfo ['pro_uid'] )) {
// if (trim ( $procInfo ['cat'] ) == "")
// $procInfo ['cat'] = "_OTHER_";
// $processList [$procInfo ['catname']] [$procInfo ['value']] = $procInfo;
// }
// }
//ksort($processList);
//g::pr($processList); die;
$this->setView('home/index');
$this->setVar('usrUid', $this->userID);
$this->setVar('userName', $this->userName);
$this->setVar('processList', $processList);
$this->setVar('canStartCase', $case->canStartCase($_SESSION ['USER_LOGGED']));
G::RenderPage('publish', 'mvc');
}
public function init($httpData)
public function appList($httpData)
{
require_once ( "classes/model/AppCacheView.php" );
require_once ( "classes/model/Application.php" );
@@ -98,11 +76,10 @@ class Home extends Controller
/**
* Getting the user's applications list
*/
//TODO validate user id
// getting user's cases on inbox
// getting user's cases on inbox
switch ($httpData->t) {
case 'in':
$criteria = $appCache->getToDoListCriteria($this->userID);
@@ -115,16 +92,10 @@ class Home extends Controller
break;
}
//$criteriac = $oAppCache->getToDoCountCriteria($this->userID);
//$criteria->setLimit($limit);
//$criteria->setOffset($start);
//$this->setView('home/index4');
$this->setView('home/index2');
$criteria->addDescendingOrderByColumn(AppCacheViewPeer::APP_NUMBER);
$dataset = AppCacheViewPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
@@ -161,7 +132,10 @@ class Home extends Controller
$cases[] = $row;
}
//g::pr($cases); die;
// settings html template
$this->setView('home/appList');
// settings vars and rendering
$this->setVar('cases', $cases);
$this->setVar('title', $title);
@@ -169,48 +143,6 @@ class Home extends Controller
G::RenderPage('publish', 'mvc');
}
/**
* getting default list
* @param string $httpData (opional)
*/
public function start($httpData)
{
$this->setView('home/index5');
//$this->setVar('id', $httpData->a);
//$this->setVar('index', $httpData->i);
$this->setVar('action', 'todo');
G::RenderPage('publish', 'mvc');
}
public function iframe_3($httpData)
{
$this->setView('home/iframe_3');
//$this->setVar('id', $httpData->a);
//$this->setVar('index', $httpData->i);
$this->setVar('action', 'todo');
G::RenderPage('publish', 'mvc');
}
public function iframe_4($httpData)
{
$this->setView('home/iframe_4');
//$this->setVar('id', $httpData->a);
//$this->setVar('index', $httpData->i);
$this->setVar('action', 'todo');
G::RenderPage('publish', 'mvc');
}
/**
* Private functions
*/
public function startCase($httpData)
{
G::LoadClass('case');