CODE STYLE, workflow/engine/controllers/
FILES: caseSchedulerProxy.php dashboard.php home.php installer.php main.php
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,322 +1,337 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Dashboard controller
|
||||
* @inherits Controller
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
|
||||
class Dashboard extends Controller {
|
||||
class Dashboard extends Controller
|
||||
{
|
||||
|
||||
// Class properties
|
||||
private $pmDashlet;
|
||||
// Class properties
|
||||
private $pmDashlet;
|
||||
|
||||
// Class constructor
|
||||
public function __construct() {
|
||||
G::LoadClass('pmDashlet');
|
||||
$this->pmDashlet = new PMDashlet();
|
||||
}
|
||||
|
||||
// Functions for the dashboards users module - Start
|
||||
|
||||
public function index($httpData) {
|
||||
try {
|
||||
$this->setJSVar('dashletsInstances', $this->getDashletsInstancesForCurrentUser());
|
||||
$this->includeExtJS('dashboard/index');
|
||||
$this->includeExtJSLib('ux/portal');
|
||||
G::RenderPage('publish', 'extJs');
|
||||
// Class constructor
|
||||
public function __construct ()
|
||||
{
|
||||
G::LoadClass( 'pmDashlet' );
|
||||
$this->pmDashlet = new PMDashlet();
|
||||
}
|
||||
catch (Exception $error) {
|
||||
//ToDo: Display a error message
|
||||
}
|
||||
}
|
||||
|
||||
public function renderDashletInstance($data) {
|
||||
try {
|
||||
if (!isset($data->DAS_INS_UID)) {
|
||||
$data->DAS_INS_UID = '';
|
||||
}
|
||||
if ($data->DAS_INS_UID == '') {
|
||||
throw new Exception('Parameter "DAS_INS_UID" is empty.');
|
||||
}
|
||||
$this->pmDashlet->setup($data->DAS_INS_UID);
|
||||
// Functions for the dashboards users module - Start
|
||||
|
||||
if (!isset($_REQUEST['w']) ) {
|
||||
$width = 300;
|
||||
}
|
||||
else {
|
||||
$width = $_REQUEST['w'];
|
||||
}
|
||||
$this->pmDashlet->render($width);
|
||||
}
|
||||
catch (Exception $error) {
|
||||
//ToDo: Show the error message
|
||||
echo $error->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
private function getDashletsInstancesForCurrentUser() {
|
||||
try {
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
throw new Exception('The session has expired.');
|
||||
}
|
||||
return $this->pmDashlet->getDashletsInstancesForUser($_SESSION['USER_LOGGED']);
|
||||
public function index ($httpData)
|
||||
{
|
||||
try {
|
||||
$this->setJSVar( 'dashletsInstances', $this->getDashletsInstancesForCurrentUser() );
|
||||
$this->includeExtJS( 'dashboard/index' );
|
||||
$this->includeExtJSLib( 'ux/portal' );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
} catch (Exception $error) {
|
||||
//ToDo: Display a error message
|
||||
}
|
||||
}
|
||||
catch (Exception $error) {
|
||||
throw $error;
|
||||
|
||||
public function renderDashletInstance ($data)
|
||||
{
|
||||
try {
|
||||
if (! isset( $data->DAS_INS_UID )) {
|
||||
$data->DAS_INS_UID = '';
|
||||
}
|
||||
if ($data->DAS_INS_UID == '') {
|
||||
throw new Exception( 'Parameter "DAS_INS_UID" is empty.' );
|
||||
}
|
||||
$this->pmDashlet->setup( $data->DAS_INS_UID );
|
||||
|
||||
if (! isset( $_REQUEST['w'] )) {
|
||||
$width = 300;
|
||||
} else {
|
||||
$width = $_REQUEST['w'];
|
||||
}
|
||||
$this->pmDashlet->render( $width );
|
||||
} catch (Exception $error) {
|
||||
//ToDo: Show the error message
|
||||
echo $error->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Functions for the dashboards users module - End
|
||||
|
||||
// Functions for the dasboards administration module - Start
|
||||
|
||||
public function dashletsList() {
|
||||
try {
|
||||
$this->includeExtJS('dashboard/dashletsList');
|
||||
if (isset($_SESSION['__DASHBOARD_ERROR__'])) {
|
||||
$this->setJSVar('__DASHBOARD_ERROR__', $_SESSION['__DASHBOARD_ERROR__']);
|
||||
unset($_SESSION['__DASHBOARD_ERROR__']);
|
||||
}
|
||||
$this->setView('dashboard/dashletsList');
|
||||
G::RenderPage('publish', 'extJs');
|
||||
private function getDashletsInstancesForCurrentUser ()
|
||||
{
|
||||
try {
|
||||
if (! isset( $_SESSION['USER_LOGGED'] )) {
|
||||
throw new Exception( 'The session has expired.' );
|
||||
}
|
||||
return $this->pmDashlet->getDashletsInstancesForUser( $_SESSION['USER_LOGGED'] );
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
catch (Exception $error) {
|
||||
//ToDo: Display a error message
|
||||
}
|
||||
}
|
||||
|
||||
public function getDashletsInstances($data) {
|
||||
$this->setResponseType('json');
|
||||
$result = new stdclass();
|
||||
$result->status = 'OK';
|
||||
try {
|
||||
if (!isset($data->start)) {
|
||||
$data->start = null;
|
||||
}
|
||||
if (!isset($data->limit)) {
|
||||
$data->limit = null;
|
||||
}
|
||||
$result->dashletsInstances = $this->pmDashlet->getDashletsInstances($data->start, $data->limit);
|
||||
$result->totalDashletsInstances = $this->pmDashlet->getDashletsInstancesQuantity();
|
||||
}
|
||||
catch (Exception $error) {
|
||||
$result->status = 'ERROR';
|
||||
$result->message = $error->getMessage();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
// Functions for the dashboards users module - End
|
||||
|
||||
public function dashletInstanceForm($data) {
|
||||
try {
|
||||
$this->includeExtJS('dashboard/dashletInstanceForm', false);
|
||||
$this->setView('dashboard/dashletInstanceForm');
|
||||
if (!isset($data->DAS_INS_UID)) {
|
||||
$data->DAS_INS_UID = '';
|
||||
}
|
||||
$dashlets = $this->getDashlets();
|
||||
$this->setJSVar('storeDasUID', $dashlets);
|
||||
if ($data->DAS_INS_UID != '') {
|
||||
$this->pmDashlet->setup($data->DAS_INS_UID);
|
||||
$this->setJSVar('dashletInstance', $this->pmDashlet->getDashletInstance());
|
||||
$this->setJSVar('additionalFields', PMDashlet::getAdditionalFields(get_class($this->pmDashlet->getDashletObject())));
|
||||
}
|
||||
else {
|
||||
$dashletInstance = new stdclass();
|
||||
$dashletInstance->DAS_UID = $dashlets[0][0];
|
||||
$dashlet = new Dashlet();
|
||||
$dashletFields = $dashlet->load($dashletInstance->DAS_UID);
|
||||
$this->setJSVar('dashletInstance', $dashletInstance);
|
||||
$this->setJSVar('additionalFields', PMDashlet::getAdditionalFields($dashletFields['DAS_CLASS']));
|
||||
}
|
||||
G::RenderPage('publish', 'extJs');
|
||||
return null;
|
||||
|
||||
// Functions for the dasboards administration module - Start
|
||||
|
||||
|
||||
public function dashletsList ()
|
||||
{
|
||||
try {
|
||||
$this->includeExtJS( 'dashboard/dashletsList' );
|
||||
if (isset( $_SESSION['__DASHBOARD_ERROR__'] )) {
|
||||
$this->setJSVar( '__DASHBOARD_ERROR__', $_SESSION['__DASHBOARD_ERROR__'] );
|
||||
unset( $_SESSION['__DASHBOARD_ERROR__'] );
|
||||
}
|
||||
$this->setView( 'dashboard/dashletsList' );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
} catch (Exception $error) {
|
||||
//ToDo: Display a error message
|
||||
}
|
||||
}
|
||||
catch (Exception $error) {
|
||||
$_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
|
||||
G::header('Location: dashletsList');
|
||||
die();
|
||||
|
||||
public function getDashletsInstances ($data)
|
||||
{
|
||||
$this->setResponseType( 'json' );
|
||||
$result = new stdclass();
|
||||
$result->status = 'OK';
|
||||
try {
|
||||
if (! isset( $data->start )) {
|
||||
$data->start = null;
|
||||
}
|
||||
if (! isset( $data->limit )) {
|
||||
$data->limit = null;
|
||||
}
|
||||
$result->dashletsInstances = $this->pmDashlet->getDashletsInstances( $data->start, $data->limit );
|
||||
$result->totalDashletsInstances = $this->pmDashlet->getDashletsInstancesQuantity();
|
||||
} catch (Exception $error) {
|
||||
$result->status = 'ERROR';
|
||||
$result->message = $error->getMessage();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
public function saveDashletInstance($data) {
|
||||
$this->setResponseType('json');
|
||||
$result = new stdclass();
|
||||
$result->status = 'OK';
|
||||
try {
|
||||
$this->pmDashlet->saveDashletInstance(get_object_vars($data));
|
||||
public function dashletInstanceForm ($data)
|
||||
{
|
||||
try {
|
||||
$this->includeExtJS( 'dashboard/dashletInstanceForm', false );
|
||||
$this->setView( 'dashboard/dashletInstanceForm' );
|
||||
if (! isset( $data->DAS_INS_UID )) {
|
||||
$data->DAS_INS_UID = '';
|
||||
}
|
||||
$dashlets = $this->getDashlets();
|
||||
$this->setJSVar( 'storeDasUID', $dashlets );
|
||||
if ($data->DAS_INS_UID != '') {
|
||||
$this->pmDashlet->setup( $data->DAS_INS_UID );
|
||||
$this->setJSVar( 'dashletInstance', $this->pmDashlet->getDashletInstance() );
|
||||
$this->setJSVar( 'additionalFields', PMDashlet::getAdditionalFields( get_class( $this->pmDashlet->getDashletObject() ) ) );
|
||||
} else {
|
||||
$dashletInstance = new stdclass();
|
||||
$dashletInstance->DAS_UID = $dashlets[0][0];
|
||||
$dashlet = new Dashlet();
|
||||
$dashletFields = $dashlet->load( $dashletInstance->DAS_UID );
|
||||
$this->setJSVar( 'dashletInstance', $dashletInstance );
|
||||
$this->setJSVar( 'additionalFields', PMDashlet::getAdditionalFields( $dashletFields['DAS_CLASS'] ) );
|
||||
}
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
return null;
|
||||
} catch (Exception $error) {
|
||||
$_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
|
||||
G::header( 'Location: dashletsList' );
|
||||
die();
|
||||
}
|
||||
}
|
||||
catch (Exception $error) {
|
||||
$result->status = 'ERROR';
|
||||
$result->message = $error->getMessage();
|
||||
|
||||
public function saveDashletInstance ($data)
|
||||
{
|
||||
$this->setResponseType( 'json' );
|
||||
$result = new stdclass();
|
||||
$result->status = 'OK';
|
||||
try {
|
||||
$this->pmDashlet->saveDashletInstance( get_object_vars( $data ) );
|
||||
} catch (Exception $error) {
|
||||
$result->status = 'ERROR';
|
||||
$result->message = $error->getMessage();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function deleteDashletInstance($data) {
|
||||
$this->setResponseType('json');
|
||||
$result = new stdclass();
|
||||
$result->status = 'OK';
|
||||
try {
|
||||
if (!isset($data->DAS_INS_UID)) {
|
||||
$data->DAS_INS_UID = '';
|
||||
}
|
||||
if ($data->DAS_INS_UID == '') {
|
||||
throw new Exception('Parameter "DAS_INS_UID" is empty.');
|
||||
}
|
||||
$this->pmDashlet->deleteDashletInstance($data->DAS_INS_UID);
|
||||
public function deleteDashletInstance ($data)
|
||||
{
|
||||
$this->setResponseType( 'json' );
|
||||
$result = new stdclass();
|
||||
$result->status = 'OK';
|
||||
try {
|
||||
if (! isset( $data->DAS_INS_UID )) {
|
||||
$data->DAS_INS_UID = '';
|
||||
}
|
||||
if ($data->DAS_INS_UID == '') {
|
||||
throw new Exception( 'Parameter "DAS_INS_UID" is empty.' );
|
||||
}
|
||||
$this->pmDashlet->deleteDashletInstance( $data->DAS_INS_UID );
|
||||
} catch (Exception $error) {
|
||||
$result->status = 'ERROR';
|
||||
$result->message = $error->getMessage();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
catch (Exception $error) {
|
||||
$result->status = 'ERROR';
|
||||
$result->message = $error->getMessage();
|
||||
|
||||
public function getAdditionalFields ($data)
|
||||
{
|
||||
$this->setResponseType( 'json' );
|
||||
$result = new stdclass();
|
||||
$result->status = 'OK';
|
||||
try {
|
||||
$dashlet = new Dashlet();
|
||||
$dashletFields = $dashlet->load( $data->DAS_UID );
|
||||
if (! is_null( $dashletFields )) {
|
||||
$result->additionalFields = PMDashlet::getAdditionalFields( $dashletFields['DAS_CLASS'] );
|
||||
} else {
|
||||
throw new Exception( 'Dashlet "' . $data->DAS_UID . '" does not exist.' );
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$result->status = 'ERROR';
|
||||
$result->message = $error->getMessage();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getAdditionalFields($data) {
|
||||
$this->setResponseType('json');
|
||||
$result = new stdclass();
|
||||
$result->status = 'OK';
|
||||
try {
|
||||
$dashlet = new Dashlet();
|
||||
$dashletFields = $dashlet->load($data->DAS_UID);
|
||||
if (!is_null($dashletFields)) {
|
||||
$result->additionalFields = PMDashlet::getAdditionalFields($dashletFields['DAS_CLASS']);
|
||||
}
|
||||
else {
|
||||
throw new Exception('Dashlet "' . $data->DAS_UID . '" does not exist.');
|
||||
}
|
||||
public function getOwnersByType ($data)
|
||||
{
|
||||
$this->setResponseType( 'json' );
|
||||
$result = new stdclass();
|
||||
$result->status = 'OK';
|
||||
try {
|
||||
switch ($data->type) {
|
||||
case 'EVERYBODY':
|
||||
$result->total = 0;
|
||||
$result->owners = array ();
|
||||
break;
|
||||
case 'USER':
|
||||
require_once 'classes/model/Users.php';
|
||||
|
||||
$users = array ();
|
||||
|
||||
$usersInstance = new Users();
|
||||
$allUsers = $usersInstance->getAll();
|
||||
foreach ($allUsers->data as $user) {
|
||||
$users[] = array ('OWNER_UID' => $user['USR_UID'],'OWNER_NAME' => $user['USR_FIRSTNAME'] . ' ' . $user['USR_LASTNAME']
|
||||
);
|
||||
}
|
||||
|
||||
$result->total = $allUsers->totalCount;
|
||||
$result->owners = $users;
|
||||
break;
|
||||
case 'DEPARTMENT':
|
||||
require_once 'classes/model/Department.php';
|
||||
require_once 'classes/model/Content.php';
|
||||
|
||||
$departments = array ();
|
||||
//SELECT
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria->setDistinct();
|
||||
$criteria->addSelectColumn( DepartmentPeer::DEP_UID );
|
||||
$criteria->addSelectColumn( ContentPeer::CON_VALUE );
|
||||
//FROM
|
||||
$conditions = array ();
|
||||
$conditions[] = array (DepartmentPeer::DEP_UID,ContentPeer::CON_ID
|
||||
);
|
||||
$conditions[] = array (ContentPeer::CON_CATEGORY,DBAdapter::getStringDelimiter() . 'DEPO_TITLE' . DBAdapter::getStringDelimiter()
|
||||
);
|
||||
$conditions[] = array (ContentPeer::CON_LANG,DBAdapter::getStringDelimiter() . 'en' . DBAdapter::getStringDelimiter()
|
||||
);
|
||||
$criteria->addJoinMC( $conditions, Criteria::LEFT_JOIN );
|
||||
//WHERE
|
||||
$criteria->add( DepartmentPeer::DEP_STATUS, 'ACTIVE' );
|
||||
//ORDER BY
|
||||
$criteria->addAscendingOrderByColumn( ContentPeer::CON_VALUE );
|
||||
|
||||
$dataset = DepartmentPeer::doSelectRS( $criteria );
|
||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$dataset->next();
|
||||
while ($row = $dataset->getRow()) {
|
||||
$departments[] = array ('OWNER_UID' => $row['DEP_UID'],'OWNER_NAME' => $row['CON_VALUE']
|
||||
);
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
$result->total = DepartmentPeer::doCount( $criteria );
|
||||
$result->owners = $departments;
|
||||
break;
|
||||
case 'GROUP':
|
||||
require_once 'classes/model/Groupwf.php';
|
||||
require_once 'classes/model/Content.php';
|
||||
|
||||
$groups = array ();
|
||||
//SELECT
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria->setDistinct();
|
||||
$criteria->addSelectColumn( GroupwfPeer::GRP_UID );
|
||||
$criteria->addSelectColumn( ContentPeer::CON_VALUE );
|
||||
//FROM
|
||||
$conditions = array ();
|
||||
$conditions[] = array (GroupwfPeer::GRP_UID,ContentPeer::CON_ID
|
||||
);
|
||||
$conditions[] = array (ContentPeer::CON_CATEGORY,DBAdapter::getStringDelimiter() . 'GRP_TITLE' . DBAdapter::getStringDelimiter()
|
||||
);
|
||||
$conditions[] = array (ContentPeer::CON_LANG,DBAdapter::getStringDelimiter() . 'en' . DBAdapter::getStringDelimiter()
|
||||
);
|
||||
$criteria->addJoinMC( $conditions, Criteria::LEFT_JOIN );
|
||||
//WHERE
|
||||
$criteria->add( GroupwfPeer::GRP_STATUS, 'ACTIVE' );
|
||||
//ORDER BY
|
||||
$criteria->addAscendingOrderByColumn( ContentPeer::CON_VALUE );
|
||||
|
||||
$dataset = GroupwfPeer::doSelectRS( $criteria );
|
||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$dataset->next();
|
||||
while ($row = $dataset->getRow()) {
|
||||
$groups[] = array ('OWNER_UID' => $row['GRP_UID'],'OWNER_NAME' => $row['CON_VALUE']
|
||||
);
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
$result->total = GroupwfPeer::doCount( $criteria );
|
||||
$result->owners = $groups;
|
||||
break;
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$result->status = 'ERROR';
|
||||
$result->message = $error->getMessage();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
catch (Exception $error) {
|
||||
$result->status = 'ERROR';
|
||||
$result->message = $error->getMessage();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getOwnersByType($data) {
|
||||
$this->setResponseType('json');
|
||||
$result = new stdclass();
|
||||
$result->status = 'OK';
|
||||
try {
|
||||
switch ($data->type) {
|
||||
case 'EVERYBODY':
|
||||
$result->total = 0;
|
||||
$result->owners = array();
|
||||
break;
|
||||
case 'USER':
|
||||
require_once 'classes/model/Users.php';
|
||||
private function getDashlets ()
|
||||
{
|
||||
try {
|
||||
require_once 'classes/model/Dashlet.php';
|
||||
|
||||
$users = array();
|
||||
$dashlets = array ();
|
||||
|
||||
$usersInstance = new Users();
|
||||
$allUsers = $usersInstance->getAll();
|
||||
foreach ($allUsers->data as $user) {
|
||||
$users[] = array('OWNER_UID' => $user['USR_UID'], 'OWNER_NAME' => $user['USR_FIRSTNAME'] . ' ' . $user['USR_LASTNAME']);
|
||||
}
|
||||
//SELECT
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria->addSelectColumn( DashletPeer::DAS_UID );
|
||||
$criteria->addSelectColumn( DashletPeer::DAS_TITLE );
|
||||
//ORDER BY
|
||||
$criteria->addAscendingOrderByColumn( DashletPeer::DAS_TITLE );
|
||||
|
||||
$result->total = $allUsers->totalCount;
|
||||
$result->owners = $users;
|
||||
break;
|
||||
case 'DEPARTMENT':
|
||||
require_once 'classes/model/Department.php';
|
||||
require_once 'classes/model/Content.php';
|
||||
|
||||
$departments = array();
|
||||
//SELECT
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->setDistinct();
|
||||
$criteria->addSelectColumn(DepartmentPeer::DEP_UID);
|
||||
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
|
||||
//FROM
|
||||
$conditions = array();
|
||||
$conditions[] = array(DepartmentPeer::DEP_UID, ContentPeer::CON_ID);
|
||||
$conditions[] = array(ContentPeer::CON_CATEGORY, DBAdapter::getStringDelimiter() . 'DEPO_TITLE' . DBAdapter::getStringDelimiter());
|
||||
$conditions[] = array(ContentPeer::CON_LANG, DBAdapter::getStringDelimiter() . 'en' . DBAdapter::getStringDelimiter());
|
||||
$criteria->addJoinMC($conditions, Criteria::LEFT_JOIN);
|
||||
//WHERE
|
||||
$criteria->add(DepartmentPeer::DEP_STATUS, 'ACTIVE');
|
||||
//ORDER BY
|
||||
$criteria->addAscendingOrderByColumn(ContentPeer::CON_VALUE);
|
||||
|
||||
$dataset = DepartmentPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
while ($row = $dataset->getRow()) {
|
||||
$departments[] = array('OWNER_UID' => $row['DEP_UID'], 'OWNER_NAME' => $row['CON_VALUE']);
|
||||
$dataset = DashletPeer::doSelectRS( $criteria );
|
||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$dataset->next();
|
||||
}
|
||||
while ($row = $dataset->getRow()) {
|
||||
$dashlets[] = array ($row['DAS_UID'],$row['DAS_TITLE']
|
||||
);
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
$result->total = DepartmentPeer::doCount($criteria);
|
||||
$result->owners = $departments;
|
||||
break;
|
||||
case 'GROUP':
|
||||
require_once 'classes/model/Groupwf.php';
|
||||
require_once 'classes/model/Content.php';
|
||||
|
||||
$groups = array();
|
||||
//SELECT
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->setDistinct();
|
||||
$criteria->addSelectColumn(GroupwfPeer::GRP_UID);
|
||||
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
|
||||
//FROM
|
||||
$conditions = array();
|
||||
$conditions[] = array(GroupwfPeer::GRP_UID, ContentPeer::CON_ID);
|
||||
$conditions[] = array(ContentPeer::CON_CATEGORY, DBAdapter::getStringDelimiter() . 'GRP_TITLE' . DBAdapter::getStringDelimiter());
|
||||
$conditions[] = array(ContentPeer::CON_LANG, DBAdapter::getStringDelimiter() . 'en' . DBAdapter::getStringDelimiter());
|
||||
$criteria->addJoinMC($conditions, Criteria::LEFT_JOIN);
|
||||
//WHERE
|
||||
$criteria->add(GroupwfPeer::GRP_STATUS, 'ACTIVE');
|
||||
//ORDER BY
|
||||
$criteria->addAscendingOrderByColumn(ContentPeer::CON_VALUE);
|
||||
|
||||
$dataset = GroupwfPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
while ($row = $dataset->getRow()) {
|
||||
$groups[] = array('OWNER_UID' => $row['GRP_UID'], 'OWNER_NAME' => $row['CON_VALUE']);
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
$result->total = GroupwfPeer::doCount($criteria);
|
||||
$result->owners = $groups;
|
||||
break;
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
return $dashlets;
|
||||
}
|
||||
catch (Exception $error) {
|
||||
$result->status = 'ERROR';
|
||||
$result->message = $error->getMessage();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function getDashlets() {
|
||||
try {
|
||||
require_once 'classes/model/Dashlet.php';
|
||||
|
||||
$dashlets = array();
|
||||
|
||||
//SELECT
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->addSelectColumn(DashletPeer::DAS_UID);
|
||||
$criteria->addSelectColumn(DashletPeer::DAS_TITLE);
|
||||
//ORDER BY
|
||||
$criteria->addAscendingOrderByColumn(DashletPeer::DAS_TITLE);
|
||||
|
||||
$dataset = DashletPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
while ($row = $dataset->getRow()) {
|
||||
$dashlets[] = array($row['DAS_UID'], $row['DAS_TITLE']);
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
return $dashlets;
|
||||
}
|
||||
|
||||
// Functions for the dasboards administration module - End
|
||||
// Functions for the dasboards administration module - End
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Home controller
|
||||
*
|
||||
@@ -9,184 +10,180 @@
|
||||
|
||||
class Home extends Controller
|
||||
{
|
||||
private $userID;
|
||||
private $userName;
|
||||
private $userFullName;
|
||||
private $userRolName;
|
||||
private $userUxType;
|
||||
private $userUxBaseTemplate;
|
||||
private $userID;
|
||||
private $userName;
|
||||
private $userFullName;
|
||||
private $userRolName;
|
||||
private $userUxType;
|
||||
private $userUxBaseTemplate;
|
||||
|
||||
private $appListStart = 0;
|
||||
private $appListLimit = 15;
|
||||
private $appListStart = 0;
|
||||
private $appListLimit = 15;
|
||||
|
||||
private $clientBrowser;
|
||||
private $lastSkin;
|
||||
private $clientBrowser;
|
||||
private $lastSkin;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
//die($_SESSION['user_experience']);
|
||||
// setting client browser information
|
||||
$this->clientBrowser = G::getBrowser();
|
||||
public function __construct ()
|
||||
{
|
||||
//die($_SESSION['user_experience']);
|
||||
// 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'] : 'classic';
|
||||
$this->userUxBaseTemplate = (is_dir(PATH_CUSTOM_SKINS . 'uxs')) ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'templates' : 'home';
|
||||
// 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'] : 'classic';
|
||||
$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->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'] : '';
|
||||
}
|
||||
}
|
||||
|
||||
public function login($httpData)
|
||||
{
|
||||
//start new session
|
||||
@session_destroy ();
|
||||
session_start ();
|
||||
session_regenerate_id ();
|
||||
|
||||
$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('u'=>'', 'p'=>'', 'm'=>'');
|
||||
}
|
||||
|
||||
$this->setVar('msg', $data['m']);
|
||||
$this->setVar('usr', $data['u']);
|
||||
$this->setVar('pwd', $data['p']);
|
||||
$this->setVar('skin', $skin);
|
||||
|
||||
$this->setView($this->userUxBaseTemplate . PATH_SEP . $template);
|
||||
$this->render();
|
||||
}
|
||||
|
||||
/**
|
||||
* getting default list
|
||||
* @param string $httpData (opional)
|
||||
*/
|
||||
|
||||
public function index($httpData)
|
||||
{
|
||||
if ($this->userUxType == 'SINGLE') {
|
||||
$this->indexSingle($httpData);
|
||||
return;
|
||||
}
|
||||
|
||||
require_once 'classes/model/UsersProperties.php';
|
||||
G::LoadClass('process');
|
||||
G::LoadClass('case');
|
||||
|
||||
$userProperty = new UsersProperties();
|
||||
$process = new Process();
|
||||
$case = new Cases();
|
||||
G::loadClass('system');
|
||||
$sysConf = System::getSystemConfiguration(PATH_CONFIG . 'env.ini');
|
||||
|
||||
//Get ProcessStatistics Info
|
||||
$start = 0;
|
||||
$limit = '';
|
||||
|
||||
$proData = $process->getAllProcesses($start, $limit);
|
||||
$processList = $case->getStartCasesPerType($_SESSION['USER_LOGGED'], 'category');
|
||||
$switchLink = $userProperty->getUserLocation($_SESSION['USER_LOGGED']);
|
||||
|
||||
if (substr($sysConf['default_skin'], 0, 2) == 'ux') {
|
||||
$_SESSION['_defaultUserLocation'] = $switchLink;
|
||||
$switchLink = '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . $sysConf['default_skin'] . '/main';
|
||||
}
|
||||
|
||||
unset($processList[0]);
|
||||
|
||||
//Get simplified options
|
||||
global $G_TMP_MENU;
|
||||
|
||||
$mnu = new Menu();
|
||||
$mnu->load('simplified');
|
||||
$arrayMnuOption = array();
|
||||
$mnuNewCase = array();
|
||||
|
||||
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]
|
||||
);
|
||||
|
||||
if ($mnu->Id[$index] != 'S_NEW_CASE') {
|
||||
$arrayMnuOption[] = $option;
|
||||
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'] : '';
|
||||
}
|
||||
else {
|
||||
$mnuNewCase = $option;
|
||||
}
|
||||
|
||||
public function login ($httpData)
|
||||
{
|
||||
//start new session
|
||||
@session_destroy();
|
||||
session_start();
|
||||
session_regenerate_id();
|
||||
|
||||
$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 ('u' => '','p' => '','m' => ''
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->setVar( 'msg', $data['m'] );
|
||||
$this->setVar( 'usr', $data['u'] );
|
||||
$this->setVar( 'pwd', $data['p'] );
|
||||
$this->setVar( 'skin', $skin );
|
||||
|
||||
$this->setView( $this->userUxBaseTemplate . PATH_SEP . $template );
|
||||
$this->render();
|
||||
}
|
||||
|
||||
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'index');
|
||||
/**
|
||||
* getting default list
|
||||
*
|
||||
* @param string $httpData (opional)
|
||||
*/
|
||||
|
||||
$this->setVar('usrUid', $this->userID);
|
||||
$this->setVar('userName', $this->userName);
|
||||
$this->setVar('processList', $processList);
|
||||
$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);
|
||||
public function index ($httpData)
|
||||
{
|
||||
if ($this->userUxType == 'SINGLE') {
|
||||
$this->indexSingle( $httpData );
|
||||
return;
|
||||
}
|
||||
|
||||
$this->render();
|
||||
}
|
||||
require_once 'classes/model/UsersProperties.php';
|
||||
G::LoadClass( 'process' );
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
public function indexSingle($httpData)
|
||||
{
|
||||
require_once 'classes/model/Step.php';
|
||||
G::LoadClass('applications');
|
||||
$userProperty = new UsersProperties();
|
||||
$process = new Process();
|
||||
$case = new Cases();
|
||||
G::loadClass( 'system' );
|
||||
$sysConf = System::getSystemConfiguration( PATH_CONFIG . 'env.ini' );
|
||||
|
||||
$apps = new Applications();
|
||||
$step = new Step;
|
||||
//Get ProcessStatistics Info
|
||||
$start = 0;
|
||||
$limit = '';
|
||||
|
||||
$cases = $apps->getAll($this->userID, 0, 1, 'todo');
|
||||
$proData = $process->getAllProcesses( $start, $limit );
|
||||
$processList = $case->getStartCasesPerType( $_SESSION['USER_LOGGED'], 'category' );
|
||||
$switchLink = $userProperty->getUserLocation( $_SESSION['USER_LOGGED'] );
|
||||
|
||||
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->render();
|
||||
exit();
|
||||
if (substr( $sysConf['default_skin'], 0, 2 ) == 'ux') {
|
||||
$_SESSION['_defaultUserLocation'] = $switchLink;
|
||||
$switchLink = '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . $sysConf['default_skin'] . '/main';
|
||||
}
|
||||
|
||||
unset( $processList[0] );
|
||||
|
||||
//Get simplified options
|
||||
global $G_TMP_MENU;
|
||||
|
||||
$mnu = new Menu();
|
||||
$mnu->load( 'simplified' );
|
||||
$arrayMnuOption = array ();
|
||||
$mnuNewCase = array ();
|
||||
|
||||
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]
|
||||
);
|
||||
|
||||
if ($mnu->Id[$index] != 'S_NEW_CASE') {
|
||||
$arrayMnuOption[] = $option;
|
||||
} else {
|
||||
$mnuNewCase = $option;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'index' );
|
||||
|
||||
$this->setVar( 'usrUid', $this->userID );
|
||||
$this->setVar( 'userName', $this->userName );
|
||||
$this->setVar( 'processList', $processList );
|
||||
$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->render();
|
||||
}
|
||||
|
||||
$lastApp = $cases['data'][0];
|
||||
$_SESSION['INDEX'] = $lastApp['DEL_INDEX'];
|
||||
$_SESSION['APPLICATION'] = $lastApp['APP_UID'];
|
||||
$_SESSION['PROCESS'] = $lastApp['PRO_UID'];
|
||||
$_SESSION['TASK'] = $lastApp['TAS_UID'];
|
||||
public function indexSingle ($httpData)
|
||||
{
|
||||
require_once 'classes/model/Step.php';
|
||||
G::LoadClass( 'applications' );
|
||||
|
||||
$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;
|
||||
$apps = new Applications();
|
||||
$step = new Step();
|
||||
|
||||
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'indexSingle');
|
||||
$cases = $apps->getAll( $this->userID, 0, 1, 'todo' );
|
||||
|
||||
$this->setVar('usrUid', $this->userID);
|
||||
$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");
|
||||
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->render();
|
||||
exit();
|
||||
}
|
||||
|
||||
$this->render();
|
||||
}
|
||||
$lastApp = $cases['data'][0];
|
||||
$_SESSION['INDEX'] = $lastApp['DEL_INDEX'];
|
||||
$_SESSION['APPLICATION'] = $lastApp['APP_UID'];
|
||||
$_SESSION['PROCESS'] = $lastApp['PRO_UID'];
|
||||
$_SESSION['TASK'] = $lastApp['TAS_UID'];
|
||||
|
||||
public function appList($httpData)
|
||||
$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->setVar( 'usrUid', $this->userID );
|
||||
$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)
|
||||
{
|
||||
// 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) {
|
||||
@@ -200,116 +197,120 @@ class Home extends Controller
|
||||
$title = 'Unassigned Inbox';
|
||||
break;
|
||||
default:
|
||||
$title = ucwords($httpData->t);
|
||||
break;
|
||||
$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('cases_count', $cases['totalCount']);
|
||||
$this->setVar('title', $title);
|
||||
$this->setVar('appListStart', $this->appListLimit);
|
||||
$this->setVar('appListLimit', 10);
|
||||
$this->setVar('listType', $httpData->t);
|
||||
$this->setVar( 'cases', $cases['data'] );
|
||||
$this->setVar( 'cases_count', $cases['totalCount'] );
|
||||
$this->setVar( 'title', $title );
|
||||
$this->setVar( 'appListStart', $this->appListLimit );
|
||||
$this->setVar( 'appListLimit', 10 );
|
||||
$this->setVar( 'listType', $httpData->t );
|
||||
|
||||
$this->render();
|
||||
}
|
||||
|
||||
public function getApps($httpData)
|
||||
{
|
||||
$cases = $this->getAppsData($httpData->t, $httpData->start, $httpData->limit);
|
||||
|
||||
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'applications');
|
||||
$this->setVar('cases', $cases['data']);
|
||||
$this->render();
|
||||
}
|
||||
|
||||
public function getAppsData($type, $start=null, $limit=null)
|
||||
public function getApps ($httpData)
|
||||
{
|
||||
require_once ( "classes/model/AppNotes.php" );
|
||||
G::LoadClass('applications');
|
||||
$cases = $this->getAppsData( $httpData->t, $httpData->start, $httpData->limit );
|
||||
|
||||
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'applications' );
|
||||
$this->setVar( 'cases', $cases['data'] );
|
||||
$this->render();
|
||||
}
|
||||
|
||||
public function getAppsData ($type, $start = null, $limit = null)
|
||||
{
|
||||
require_once ("classes/model/AppNotes.php");
|
||||
G::LoadClass( 'applications' );
|
||||
|
||||
$apps = new Applications();
|
||||
$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;
|
||||
|
||||
$cases = $apps->getAll($this->userID, $start, $limit, $type);
|
||||
$cases = $apps->getAll( $this->userID, $start, $limit, $type );
|
||||
//g::pr($cases['data']); die;
|
||||
|
||||
|
||||
// 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'])) {
|
||||
$cases['data'][$i]['DEL_DELEGATE_DATE'] = G::getformatedDate($row['DEL_DELEGATE_DATE'],
|
||||
'M d, yyyy - h:i:s');
|
||||
if (isset( $row['DEL_DELEGATE_DATE'] )) {
|
||||
$cases['data'][$i]['DEL_DELEGATE_DATE'] = G::getformatedDate( $row['DEL_DELEGATE_DATE'], 'M d, yyyy - h:i:s' );
|
||||
}
|
||||
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);
|
||||
$notes = $appNotes->getNotesList( $row['APP_UID'], '', $notesStart, $notesLimit );
|
||||
$notes = $notes['array'];
|
||||
|
||||
$cases['data'][$i]['NOTES_COUNT'] = $notes['totalCount'];
|
||||
$cases['data'][$i]['NOTES_LIST'] = $notes['notes'];
|
||||
$cases['data'][$i]['NOTES_LIST'] = $notes['notes'];
|
||||
}
|
||||
return $cases;
|
||||
}
|
||||
|
||||
public function startCase($httpData)
|
||||
{
|
||||
G::LoadClass('case');
|
||||
$case = new Cases();
|
||||
$aData = $case->startCase($httpData->id, $_SESSION['USER_LOGGED']);
|
||||
public function startCase ($httpData)
|
||||
{
|
||||
G::LoadClass( 'case' );
|
||||
$case = new Cases();
|
||||
$aData = $case->startCase( $httpData->id, $_SESSION['USER_LOGGED'] );
|
||||
|
||||
$_SESSION['APPLICATION'] = $aData['APPLICATION'];
|
||||
$_SESSION['INDEX'] = $aData['INDEX'];
|
||||
$_SESSION['PROCESS'] = $aData['PROCESS'];
|
||||
$_SESSION['TASK'] = $httpData->id;
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
$_SESSION['CASES_REFRESH'] = true;
|
||||
$_SESSION['APPLICATION'] = $aData['APPLICATION'];
|
||||
$_SESSION['INDEX'] = $aData['INDEX'];
|
||||
$_SESSION['PROCESS'] = $aData['PROCESS'];
|
||||
$_SESSION['TASK'] = $httpData->id;
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
$_SESSION['CASES_REFRESH'] = true;
|
||||
|
||||
// Execute Events
|
||||
require_once 'classes/model/Event.php';
|
||||
$event = new Event();
|
||||
$event->createAppEvents($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK']);
|
||||
// Execute Events
|
||||
require_once 'classes/model/Event.php';
|
||||
$event = new Event();
|
||||
$event->createAppEvents( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK'] );
|
||||
|
||||
$oCase = new Cases();
|
||||
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
|
||||
//../cases/cases_Open?APP_UID={$APP.APP_UID}&DEL_INDEX={$APP.DEL_INDEX}&action=todo
|
||||
$aNextStep['PAGE'] = '../cases/cases_Open?APP_UID='.$aData['APPLICATION'].'&DEL_INDEX='.$aData['INDEX'].'&action=draft';
|
||||
$_SESSION ['BREAKSTEP'] ['NEXT_STEP'] = $aNextStep;
|
||||
$oCase = new Cases();
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
//../cases/cases_Open?APP_UID={$APP.APP_UID}&DEL_INDEX={$APP.DEL_INDEX}&action=todo
|
||||
$aNextStep['PAGE'] = '../cases/cases_Open?APP_UID=' . $aData['APPLICATION'] . '&DEL_INDEX=' . $aData['INDEX'] . '&action=draft';
|
||||
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
|
||||
|
||||
$this->redirect($aNextStep['PAGE']);
|
||||
}
|
||||
|
||||
public function error($httpData)
|
||||
{
|
||||
$httpData->no = isset($httpData->no) ? $httpData->no : 0;
|
||||
|
||||
switch ($httpData->no) {
|
||||
case 2: $tpl = $this->userUxBaseTemplate . PATH_SEP . 'noAppsMsg'; break;
|
||||
default: $tpl = $this->userUxBaseTemplate . PATH_SEP . 'error';
|
||||
$this->redirect( $aNextStep['PAGE'] );
|
||||
}
|
||||
|
||||
$this->setView($tpl);
|
||||
$this->render();
|
||||
}
|
||||
public function error ($httpData)
|
||||
{
|
||||
$httpData->no = isset( $httpData->no ) ? $httpData->no : 0;
|
||||
|
||||
switch ($httpData->no) {
|
||||
case 2:
|
||||
$tpl = $this->userUxBaseTemplate . PATH_SEP . 'noAppsMsg';
|
||||
break;
|
||||
default:
|
||||
$tpl = $this->userUxBaseTemplate . PATH_SEP . 'error';
|
||||
}
|
||||
|
||||
$this->setView( $tpl );
|
||||
$this->render();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user