Merged in luisfernandosl/processmaker/PM-860 (pull request #1190)

PM 860 "Home > Users > Groups: La ordenacion de..." SOLVED
This commit is contained in:
Julio Cesar Laura Avendaño
2014-11-12 11:05:28 -04:00
3 changed files with 20 additions and 7 deletions

View File

@@ -283,7 +283,7 @@ class Groupwf extends BaseGroupwf
$c->add( ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
$c->add( ContentPeer::CON_ID, $UidGroup );
$c->add( ContentPeer::CON_LANG, SYS_LANG );
$dataset = ContentPeer::doSelectRS( $c );
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$dataset->next();
@@ -343,7 +343,7 @@ class Groupwf extends BaseGroupwf
return $result;
}
public function getAllGroup ($start = null, $limit = null, $search = null)
public function getAllGroup ($start = null, $limit = null, $search = null, $sortField = null, $sortDir = null)
{
require_once PATH_RBAC . "model/RbacUsers.php";
require_once 'classes/model/TaskUser.php';
@@ -355,7 +355,6 @@ class Groupwf extends BaseGroupwf
$criteria->addJoin( GroupwfPeer::GRP_UID, ContentPeer::CON_ID, Criteria::LEFT_JOIN );
$criteria->add( ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG );
$criteria->addAscendingOrderByColumn( ContentPeer::CON_VALUE );
if ($search) {
$criteria->add( ContentPeer::CON_VALUE, '%' . $search . '%', Criteria::LIKE );
@@ -371,7 +370,16 @@ class Groupwf extends BaseGroupwf
$criteria->addJoin( GroupwfPeer::GRP_UID, ContentPeer::CON_ID, Criteria::LEFT_JOIN );
$criteria->add( ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG );
$criteria->addAscendingOrderByColumn( ContentPeer::CON_VALUE );
if (is_null($sortField) || trim($sortField) == "") {
$sortField = ContentPeer::CON_VALUE;
}
if (!is_null($sortDir) && trim($sortDir) != "" && strtoupper($sortDir) == "DESC") {
$criteria->addDescendingOrderByColumn($sortField);
} else {
$criteria->addAscendingOrderByColumn($sortField);
}
if ($start != '') {
$criteria->setOffset( $start );

View File

@@ -93,6 +93,9 @@ switch ($_POST['action']) {
$limit = isset( $_REQUEST['limit'] ) ? $_REQUEST['limit'] : $limit_size;
$filter = isset( $_REQUEST['textFilter'] ) ? $_REQUEST['textFilter'] : '';
$sortField = isset($_REQUEST["sort"])? $_REQUEST["sort"] : "";
$sortDir = isset($_REQUEST["dir"])? $_REQUEST["dir"] : "";
global $RBAC;
if ($limit == $start) {
$limit = $limit + $limit;
@@ -107,7 +110,8 @@ switch ($_POST['action']) {
$uxList = adminProxy::getUxTypesList();
$groups = new Groupwf();
$data = $groups->getAllGroup( $start, $limit, $filter );
$data = $groups->getAllGroup( $start, $limit, $filter, $sortField, $sortDir);
$result = $data['rows'];
$totalRows = 0;

View File

@@ -212,6 +212,7 @@ Ext.onReady(function(){
});
store = new Ext.data.GroupingStore( {
remoteSort: true,
proxy : new Ext.data.HttpProxy({
url: 'groups_Ajax?action=groupsList'
}),
@@ -243,8 +244,8 @@ Ext.onReady(function(){
{id:'GRP_UID', dataIndex: 'USR_UID', hidden:true, hideable:false},
{header: _('ID_GROUP_NAME'), dataIndex: 'CON_VALUE', width: 400, align:'left'},
{header: _('ID_STATUS'), dataIndex: 'GRP_STATUS', width: 130, align:'center', renderer: render_status},
{header: _('ID_USERS'), dataIndex: 'GRP_USERS', width: 100, align:'center'},
{header: _('ID_TASKS'), dataIndex: 'GRP_TASKS', width: 100, align:'center'}
{header: _("ID_USERS"), dataIndex: "GRP_USERS", sortable: false, width: 100, align:"center"},
{header: _("ID_TASKS"), dataIndex: "GRP_TASKS", sortable: false, width: 100, align:"center"}
]
});