BUG 0000 BUG 0000 User Inbox Simplified (second commit)
This commit is contained in:
@@ -1,29 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* pmTables controller
|
||||
* @author Douglas Medrano <douglas@colosa.com, douglas.medrano@live.com>
|
||||
* @New Calendar
|
||||
* Admin controller
|
||||
* @access public
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* UX - User experience
|
||||
*/
|
||||
|
||||
public function uxList()
|
||||
{
|
||||
$this->includeExtJS('admin/uxUsersList');
|
||||
//$this->setView('admin/calendarEdit');
|
||||
|
||||
//$this->setJSVar('fields',$fields);ç
|
||||
G::LoadClass('configuration');
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('usersList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$this->setJSVar('CONFIG', $Config);
|
||||
$this->setJSVar('FORMATS',$c->getFormats());
|
||||
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* CALENDAR
|
||||
* getting default list
|
||||
* @param string $httpData->PRO_UID (opional)
|
||||
*/
|
||||
public function calendarEdit($httpData)
|
||||
{
|
||||
global $RBAC;
|
||||
|
||||
//$RBAC->requirePermissions('PM_SETUP_ADVANCE');
|
||||
G::LoadClass('configuration');
|
||||
G::LoadClass('calendar');
|
||||
|
||||
$CalendarUid = str_replace ( '"', '', isset ( $_GET ['id'] ) ? $_GET ['id'] : G::GenerateUniqueID () );
|
||||
G::LoadClass ( 'calendar' );
|
||||
$calendarObj = new calendar ( );
|
||||
|
||||
if ((isset ( $_GET ['id'] )) && ($_GET ['id'] != "")) {
|
||||
$fields = $calendarObj->getCalendarInfoE ( $CalendarUid );
|
||||
$fields ['OLD_NAME'] = $fields['CALENDAR_NAME'];
|
||||
}
|
||||
if (! (isset ( $fields ['CALENDAR_UID'] ))) { //For a new Calendar
|
||||
if (!isset($fields['CALENDAR_UID'])) { //For a new Calendar
|
||||
$fields ['CALENDAR_UID'] = $CalendarUid;
|
||||
$fields ['OLD_NAME'] = '';
|
||||
|
||||
@@ -37,25 +61,18 @@ class Admin extends Controller
|
||||
$fields ['CALENDAR_NAME'] = G::LoadTranslation ( "ID_COPY_OF" ) . " " . $fields ['CALENDAR_NAME'];
|
||||
}
|
||||
|
||||
$RBAC->requirePermissions('PM_SETUP_ADVANCE');
|
||||
G::LoadClass('configuration');
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('additionalTablesList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$this->includeExtJS('admin/calendarEdit');
|
||||
$this->setView('admin/calendarEdit');
|
||||
|
||||
$variableArray = array();
|
||||
$variableArray[0] = 'uno';
|
||||
$variableArray[1] = 'dos';
|
||||
|
||||
|
||||
$businessDayArray = array();
|
||||
for($i=0;$i<sizeof($fields['BUSINESS_DAY']);$i++) {
|
||||
$businessDayArray[$i] = $fields['BUSINESS_DAY'][$i+1];
|
||||
|
||||
}
|
||||
|
||||
for($i=0;$i<sizeof($fields['BUSINESS_DAY']);$i++) {
|
||||
$businessDayArray[$i] = $fields['BUSINESS_DAY'][$i+1];
|
||||
}
|
||||
|
||||
$fields['BUSINESS_DAY'] = $businessDayArray;
|
||||
//validating if the calendar is new, it means that we don't have the $_GET array
|
||||
$fields['HOLIDAY']=(isset ( $_GET['id'] )&&$_GET['id']!='')?$fields['HOLIDAY']:array();
|
||||
|
||||
@@ -22,9 +22,55 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
class adminProxy extends HttpProxyController
|
||||
{
|
||||
function calendarSave() {
|
||||
function uxUserUpdate($httpData)
|
||||
{
|
||||
require_once 'classes/model/Users.php';
|
||||
$data = (array) json_decode($httpData->users);
|
||||
|
||||
$user = UsersPeer::retrieveByPK($data['USR_UID']);
|
||||
$user->setUsrUx($data['USR_UX']);
|
||||
$user->save();
|
||||
$row = $user->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
$uxList = self::getUxTypesList();
|
||||
$row['USR_UX'] = $uxList[$user->getUsrUx()];
|
||||
|
||||
return array('success' => true, 'message'=>'done', 'users'=>$row);
|
||||
}
|
||||
|
||||
function uxGroupUpdate($httpData)
|
||||
{
|
||||
require_once 'classes/model/Groupwf.php';
|
||||
$data = (array) json_decode($httpData->groups);
|
||||
|
||||
$group = GroupwfPeer::retrieveByPK($data['GRP_UID']);
|
||||
$group->setGrpUx($data['GRP_UX']);
|
||||
$group->save();
|
||||
|
||||
$g = new Groupwf();
|
||||
//$row = $group->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$row = $g->Load($group->getGrpUid());
|
||||
$row['CON_VALUE'] = $row['GRP_TITLE'];
|
||||
|
||||
$uxList = self::getUxTypesList();
|
||||
$row['GRP_UX'] = $uxList[$group->getGrpUx()];
|
||||
|
||||
return array('success' => true, 'message'=>'done', 'groups'=>$row);
|
||||
}
|
||||
|
||||
function getUxTypesList()
|
||||
{
|
||||
return Array(
|
||||
'NORMAL' => 'Normal',
|
||||
'SIMPLIFIED' => 'Simplified'
|
||||
);
|
||||
}
|
||||
|
||||
function calendarSave()
|
||||
{
|
||||
//{ $_POST['BUSINESS_DAY']
|
||||
$businessDayArray = G::json_decode($_POST['BUSINESS_DAY']);
|
||||
$businessDayFixArray = array();
|
||||
@@ -86,7 +132,7 @@ class adminProxy extends HttpProxyController
|
||||
|
||||
}// end testingOption function
|
||||
|
||||
/**
|
||||
/**
|
||||
* saving the authentication source data
|
||||
* @param object $params
|
||||
* @return array $data
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user