HOR-2887 problem solving in the user experience lists

This commit is contained in:
Roly Rudy Gutierrez Pinto
2017-05-24 08:51:17 -04:00
parent 5065e669e1
commit c35c6db260
3 changed files with 24 additions and 18 deletions

View File

@@ -22,6 +22,7 @@ class Home extends Controller
private $clientBrowser; private $clientBrowser;
private $lastSkin; private $lastSkin;
private $usrId;
public function __construct () public function __construct ()
{ {
@@ -39,6 +40,10 @@ class Home extends Controller
$this->userName = isset( $_SESSION['USR_USERNAME'] ) ? $_SESSION['USR_USERNAME'] : ''; $this->userName = isset( $_SESSION['USR_USERNAME'] ) ? $_SESSION['USR_USERNAME'] : '';
$this->userFullName = isset( $_SESSION['USR_FULLNAME'] ) ? $_SESSION['USR_FULLNAME'] : ''; $this->userFullName = isset( $_SESSION['USR_FULLNAME'] ) ? $_SESSION['USR_FULLNAME'] : '';
$this->userRolName = isset( $_SESSION['USR_ROLENAME'] ) ? $_SESSION['USR_ROLENAME'] : ''; $this->userRolName = isset( $_SESSION['USR_ROLENAME'] ) ? $_SESSION['USR_ROLENAME'] : '';
$users = new Users();
$users = $users->load($this->userID);
$this->usrId = $users["USR_ID"];
} }
} }
@@ -261,7 +266,6 @@ class Home extends Controller
// settings vars and rendering // settings vars and rendering
$this->setVar( 'cases', $cases['data'] ); $this->setVar( 'cases', $cases['data'] );
$this->setVar( 'cases_count', $cases['totalCount'] );
$this->setVar( 'title', $title ); $this->setVar( 'title', $title );
$this->setVar( 'noPerms', G::LoadTranslation( 'ID_CASES_NOTES_NO_PERMISSIONS' )); $this->setVar( 'noPerms', G::LoadTranslation( 'ID_CASES_NOTES_NO_PERMISSIONS' ));
$this->setVar( 'appListStart', $this->appListLimit ); $this->setVar( 'appListStart', $this->appListLimit );
@@ -317,7 +321,6 @@ class Home extends Controller
$this->setVar( 'arraySearch', $arraySearch ); $this->setVar( 'arraySearch', $arraySearch );
$this->setVar( 'cases', $cases['data'] ); $this->setVar( 'cases', $cases['data'] );
$this->setVar( 'cases_count', $cases['totalCount'] );
$this->setVar( 'title', $title ); $this->setVar( 'title', $title );
$this->setVar( 'noPerms', G::LoadTranslation( 'ID_CASES_NOTES_NO_PERMISSIONS' )); $this->setVar( 'noPerms', G::LoadTranslation( 'ID_CASES_NOTES_NO_PERMISSIONS' ));
$this->setVar( 'appListStart', $this->appListLimit ); $this->setVar( 'appListStart', $this->appListLimit );
@@ -368,13 +371,13 @@ class Home extends Controller
$notesLimit = 4; $notesLimit = 4;
switch ($user) { switch ($user) {
case 'CURRENT_USER': case 'CURRENT_USER':
$user = $this->userID; $user = $this->usrId;
break; break;
case 'ALL': case 'ALL':
$user = null; $user = null;
break; break;
case null: case null:
$user = $this->userID; $user = $this->usrId;
break; break;
default: default:
//$user = $this->userID; //$user = $this->userID;
@@ -449,6 +452,8 @@ class Home extends Controller
case 'draft': case 'draft':
case 'todo': case 'todo':
$listName = 'inbox'; $listName = 'inbox';
$userObject = Users::loadById($dataList['userId']);
$dataList['userId'] = $userObject->getUsrUid();
$cases = $list->getList($listName, $dataList); $cases = $list->getList($listName, $dataList);
break; break;
case 'unassigned': case 'unassigned':
@@ -574,6 +579,7 @@ class Home extends Controller
$cUsers->addSelectColumn(UsersPeer::USR_UID); $cUsers->addSelectColumn(UsersPeer::USR_UID);
$cUsers->addSelectColumn(UsersPeer::USR_FIRSTNAME); $cUsers->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$cUsers->addSelectColumn(UsersPeer::USR_LASTNAME); $cUsers->addSelectColumn(UsersPeer::USR_LASTNAME);
$cUsers->addSelectColumn(UsersPeer::USR_ID);
if (!empty($search)) { if (!empty($search)) {
$cUsers->addOr(UsersPeer::USR_FIRSTNAME, "%$search%", Criteria::LIKE); $cUsers->addOr(UsersPeer::USR_FIRSTNAME, "%$search%", Criteria::LIKE);
$cUsers->addOr(UsersPeer::USR_LASTNAME, "%$search%", Criteria::LIKE); $cUsers->addOr(UsersPeer::USR_LASTNAME, "%$search%", Criteria::LIKE);
@@ -582,7 +588,7 @@ class Home extends Controller
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next(); $oDataset->next();
while ($aRow = $oDataset->getRow()) { while ($aRow = $oDataset->getRow()) {
$users[] = array ($aRow['USR_UID'], htmlentities($aRow['USR_LASTNAME'] . ' ' . $aRow['USR_FIRSTNAME'], ENT_QUOTES, "UTF-8")); $users[] = array($aRow['USR_ID'], htmlentities($aRow['USR_LASTNAME'] . ' ' . $aRow['USR_FIRSTNAME'], ENT_QUOTES, "UTF-8"));
$oDataset->next(); $oDataset->next();
} }
break; break;

View File

@@ -173,7 +173,7 @@
<body onload="resize()" onresize="resize()" > <body onload="resize()" onresize="resize()" >
<center> <center>
<div class="content-header" style="text-align:left"> <div class="content-header" style="text-align:left">
<h1 style="padding: 10px">{$title} ({$cases_count})</h1> <h1 style="padding: 10px">{$title}</h1>
<ul id="commentlist"> <ul id="commentlist">
{include file='home/applications.html'} {include file='home/applications.html'}
</ul> </ul>

View File

@@ -356,7 +356,7 @@
<center> <center>
<div class="content-header" style="text-align:left"> <div class="content-header" style="text-align:left">
<h1 style="padding: 10px">{$title} ({$cases_count})</h1> <h1 style="padding: 10px">{$title}</h1>
<ul id="commentlist"> <ul id="commentlist">
{include file='home/applications.html'} {include file='home/applications.html'}
</ul> </ul>