BUG-14053 El ordenamiento de archivos no se realiza... SOLVED
- El ordenamiento de las columnas no tenian una busqueda asignada. - Se habilitaron solo dos columnas para el ordenamiento "Name, Modified". - Se cambio el criteria para que acepte esos parametros en el archivo AppFolder.php
This commit is contained in:
@@ -394,10 +394,25 @@ class AppFolder extends BaseAppFolder
|
|||||||
$oCase = new Cases();
|
$oCase = new Cases();
|
||||||
G::LoadClass( 'process' );
|
G::LoadClass( 'process' );
|
||||||
$oProcess = new Process();
|
$oProcess = new Process();
|
||||||
|
|
||||||
$oAppDocument = new AppDocument();
|
$oAppDocument = new AppDocument();
|
||||||
$oCriteria = new Criteria();
|
$oCriteria = new Criteria();
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::APP_DOC_UID);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::DOC_VERSION);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::APP_UID);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::DEL_INDEX);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::DOC_UID);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::USR_UID);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::APP_DOC_TYPE);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::APP_DOC_CREATE_DATE);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::APP_DOC_INDEX);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::FOLDER_UID);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::APP_DOC_PLUGIN);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::APP_DOC_TAGS);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::APP_DOC_STATUS);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::APP_DOC_STATUS_DATE);
|
||||||
|
$oCriteria->addSelectColumn( AppDocumentPeer::APP_DOC_FIELDNAME);
|
||||||
|
|
||||||
if ((is_array( $docIdFilter )) && (count( $docIdFilter ) > 0)) {
|
if ((is_array( $docIdFilter )) && (count( $docIdFilter ) > 0)) {
|
||||||
//Search by App Doc UID no matter what Folder it is
|
//Search by App Doc UID no matter what Folder it is
|
||||||
$oCriteria->add( AppDocumentPeer::APP_DOC_UID, $docIdFilter, CRITERIA::IN );
|
$oCriteria->add( AppDocumentPeer::APP_DOC_UID, $docIdFilter, CRITERIA::IN );
|
||||||
@@ -410,23 +425,24 @@ class AppFolder extends BaseAppFolder
|
|||||||
} elseif ($searchType == "TAG") {
|
} elseif ($searchType == "TAG") {
|
||||||
$oCriteria->add( AppDocumentPeer::APP_DOC_TAGS, "%" . $keyword . "%", CRITERIA::LIKE );
|
$oCriteria->add( AppDocumentPeer::APP_DOC_TAGS, "%" . $keyword . "%", CRITERIA::LIKE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_once ("classes/model/AppDelegation.php");
|
||||||
if ($user != '') {
|
if ($user != '') {
|
||||||
require_once ("classes/model/AppDelegation.php");
|
require_once ("classes/model/AppDelegation.php");
|
||||||
$criteria = new Criteria();
|
$criteria = new Criteria();
|
||||||
$criteria->addSelectColumn( AppDelegationPeer::APP_UID );
|
$criteria->addSelectColumn( AppDelegationPeer::APP_UID );
|
||||||
$criteria->setDistinct();
|
$criteria->setDistinct();
|
||||||
|
|
||||||
$conditions = array ();
|
$conditions = array ();
|
||||||
$conditions[] = array (AppDelegationPeer::APP_UID,AppDocumentPeer::APP_UID);
|
$conditions[] = array (AppDelegationPeer::APP_UID,AppDocumentPeer::APP_UID);
|
||||||
$conditions[] = array (AppDelegationPeer::DEL_INDEX,AppDocumentPeer::DEL_INDEX);
|
$conditions[] = array (AppDelegationPeer::DEL_INDEX,AppDocumentPeer::DEL_INDEX);
|
||||||
|
|
||||||
$criteria->addJoinMC( $conditions, Criteria::LEFT_JOIN );
|
$criteria->addJoinMC( $conditions, Criteria::LEFT_JOIN );
|
||||||
|
|
||||||
$criteria->add( AppDelegationPeer::USR_UID, $user );
|
$criteria->add( AppDelegationPeer::USR_UID, $user );
|
||||||
|
|
||||||
$rs2 = AppDocumentPeer::doSelectRS( $criteria );
|
$rs2 = AppDocumentPeer::doSelectRS( $criteria );
|
||||||
|
|
||||||
$rs2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
$rs2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$data = array ();
|
$data = array ();
|
||||||
while ($rs2->next()) {
|
while ($rs2->next()) {
|
||||||
@@ -435,33 +451,43 @@ class AppFolder extends BaseAppFolder
|
|||||||
}
|
}
|
||||||
$oCriteria->add( AppDocumentPeer::APP_UID, $data, CRITERIA::IN );
|
$oCriteria->add( AppDocumentPeer::APP_UID, $data, CRITERIA::IN );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($onlyActive) {
|
if ($onlyActive) {
|
||||||
$oCriteria->add( AppDocumentPeer::APP_DOC_STATUS, 'ACTIVE' );
|
$oCriteria->add( AppDocumentPeer::APP_DOC_STATUS, 'ACTIVE' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$oCriteria->addSelectColumn( ContentPeer::CON_VALUE . ' AS NAME');
|
||||||
|
$oCriteria->add( ContentPeer::CON_CATEGORY, "APP_DOC_FILENAME");
|
||||||
|
$oCriteria->add( ContentPeer::CON_LANG, SYS_LANG);
|
||||||
|
$oCriteria->addJoin( AppDocumentPeer::APP_DOC_UID, ContentPeer::CON_ID, Criteria::LEFT_JOIN );
|
||||||
|
|
||||||
$numRecTotal = AppDocumentPeer::doCount($oCriteria);
|
$numRecTotal = AppDocumentPeer::doCount($oCriteria);
|
||||||
|
|
||||||
$oCase->verifyTable();
|
$oCase->verifyTable();
|
||||||
|
|
||||||
//Need to review hot to get the Column Type name
|
//Need to review hot to get the Column Type name
|
||||||
switch($ColumnSort) {
|
switch($ColumnSort) {
|
||||||
case 'appDocCreateDate' : $ColumnSort = AppDocumentPeer::APP_DOC_CREATE_DATE; break;
|
case 'appDocCreateDate' :
|
||||||
//...
|
$ColumnSort = AppDocumentPeer::APP_DOC_CREATE_DATE;
|
||||||
default: break;
|
break;
|
||||||
|
case 'name' :
|
||||||
|
$ColumnSort = 'NAME';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($direction == 'ASC') {
|
if($direction == 'ASC') {
|
||||||
$oCriteria->addAscendingOrderByColumn( $ColumnSort );
|
$oCriteria->addAscendingOrderByColumn( $ColumnSort );
|
||||||
} else {
|
} else {
|
||||||
$oCriteria->addDescendingOrderByColumn( $ColumnSort );
|
$oCriteria->addDescendingOrderByColumn( $ColumnSort );
|
||||||
}
|
}
|
||||||
|
|
||||||
$response['documents'] = array ();
|
$response['documents'] = array ();
|
||||||
|
|
||||||
$oCriteria->setLimit( $limit );
|
$oCriteria->setLimit( $limit );
|
||||||
$oCriteria->setOffset( $start );
|
$oCriteria->setOffset( $start );
|
||||||
|
|
||||||
$rs = AppDocumentPeer::doSelectRS( $oCriteria );
|
$rs = AppDocumentPeer::doSelectRS( $oCriteria );
|
||||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$rs->next();
|
$rs->next();
|
||||||
@@ -474,7 +500,7 @@ class AppFolder extends BaseAppFolder
|
|||||||
$completeInfo = $this->getCompleteDocumentInfo( $row['APP_UID'], $row['APP_DOC_UID'], $row['DOC_VERSION'], $row['DOC_UID'], $row['USR_UID'] );
|
$completeInfo = $this->getCompleteDocumentInfo( $row['APP_UID'], $row['APP_DOC_UID'], $row['DOC_VERSION'], $row['DOC_UID'], $row['USR_UID'] );
|
||||||
$oAppDocument = new AppDocument();
|
$oAppDocument = new AppDocument();
|
||||||
$lastVersion = $oAppDocument->getLastAppDocVersion( $row['APP_DOC_UID'], $row['APP_UID'] );
|
$lastVersion = $oAppDocument->getLastAppDocVersion( $row['APP_DOC_UID'], $row['APP_UID'] );
|
||||||
|
|
||||||
if ($completeInfo['APP_DOC_STATUS'] != "DELETED") {
|
if ($completeInfo['APP_DOC_STATUS'] != "DELETED") {
|
||||||
if (in_array($row["APP_DOC_UID"], $completeInfo["INPUT_DOCUMENTS"]) || in_array($row["APP_DOC_UID"], $completeInfo["OUTPUT_DOCUMENTS"]) || in_array($completeInfo["USR_UID"], array($_SESSION["USER_LOGGED"], "-1")) || $user == "") {
|
if (in_array($row["APP_DOC_UID"], $completeInfo["INPUT_DOCUMENTS"]) || in_array($row["APP_DOC_UID"], $completeInfo["OUTPUT_DOCUMENTS"]) || in_array($completeInfo["USR_UID"], array($_SESSION["USER_LOGGED"], "-1")) || $user == "") {
|
||||||
if (count( $docIdFilter ) > 0) {
|
if (count( $docIdFilter ) > 0) {
|
||||||
@@ -498,17 +524,15 @@ class AppFolder extends BaseAppFolder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$rs->next();
|
$rs->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
$response["totalDocumentsCount"] = $numRecTotal;
|
$response["totalDocumentsCount"] = $numRecTotal;
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getCompleteDocumentInfo ($appUid, $appDocUid, $docVersion, $docUid, $usrId)
|
public function getCompleteDocumentInfo ($appUid, $appDocUid, $docVersion, $docUid, $usrId)
|
||||||
{
|
{
|
||||||
//require_once ("classes/model/AppDocument.php");
|
//require_once ("classes/model/AppDocument.php");
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ if (! isset ($_SESSION ['USER_LOGGED'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset ($_REQUEST ['action']) && isset($_REQUEST['sort']) && isset($_REQUEST['dir'])) {
|
if (isset ($_REQUEST ['action']) && isset($_REQUEST['sort']) && isset($_REQUEST['dir'])) {
|
||||||
if ($_REQUEST['sort'] == "appDocCreateDate" && ($_REQUEST['dir'] == 'ASC' || $_REQUEST['dir'] == 'DESC')) {
|
sortContent();
|
||||||
sortContent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1271,7 +1271,7 @@ rowExpander, {
|
|||||||
header: _("ID_OWNER"),
|
header: _("ID_OWNER"),
|
||||||
dataIndex: "owner",
|
dataIndex: "owner",
|
||||||
width: 100,
|
width: 100,
|
||||||
sortable: true,
|
sortable: false,
|
||||||
groupable: true,
|
groupable: true,
|
||||||
renderer: renderFullName
|
renderer: renderFullName
|
||||||
//sortable: false
|
//sortable: false
|
||||||
@@ -1290,7 +1290,7 @@ rowExpander, {
|
|||||||
header: _("ID_TYPE"),
|
header: _("ID_TYPE"),
|
||||||
dataIndex: "type",
|
dataIndex: "type",
|
||||||
width: 100,
|
width: 100,
|
||||||
sortable: true,
|
sortable: false,
|
||||||
groupable: true,
|
groupable: true,
|
||||||
//align: "right",
|
//align: "right",
|
||||||
renderer: renderType
|
renderer: renderType
|
||||||
@@ -1298,7 +1298,7 @@ rowExpander, {
|
|||||||
header: _("ID_PROCESS"),
|
header: _("ID_PROCESS"),
|
||||||
dataIndex: "proTitle",
|
dataIndex: "proTitle",
|
||||||
width: 150,
|
width: 150,
|
||||||
sortable: true,
|
sortable: false,
|
||||||
groupable: true
|
groupable: true
|
||||||
//align: "right"
|
//align: "right"
|
||||||
//renderer: renderType
|
//renderer: renderType
|
||||||
@@ -1306,7 +1306,7 @@ rowExpander, {
|
|||||||
header: _("ID_CASE"),
|
header: _("ID_CASE"),
|
||||||
dataIndex: "appLabel",
|
dataIndex: "appLabel",
|
||||||
width: 150,
|
width: 150,
|
||||||
sortable: true,
|
sortable: false,
|
||||||
groupable: true
|
groupable: true
|
||||||
//align: "right"
|
//align: "right"
|
||||||
//renderer: renderType
|
//renderer: renderType
|
||||||
|
|||||||
Reference in New Issue
Block a user