Merged in bugfix/HOR-4075 (pull request #6192)
HOR-4075 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com> Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
24
workflow/engine/classes/ListAdditionalColumnsInterface.php
Normal file
24
workflow/engine/classes/ListAdditionalColumnsInterface.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The list implement additional columns.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
interface ListAdditionalColumnsInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the $additionalClassName value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getAdditionalClassName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of $additionalClassName.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setAdditionalClassName($v);
|
||||||
|
}
|
||||||
27
workflow/engine/classes/ListCreateUpdateInterface.php
Normal file
27
workflow/engine/classes/ListCreateUpdateInterface.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The list can create and update records.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
interface ListCreateUpdateInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an application record into list.
|
||||||
|
*
|
||||||
|
* @param type $data
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function create($data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update an application record from list.
|
||||||
|
*
|
||||||
|
* @param type $data
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function update($data);
|
||||||
|
}
|
||||||
42
workflow/engine/classes/ListInterface.php
Normal file
42
workflow/engine/classes/ListInterface.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface for list of cases
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
interface ListInterface extends ListCreateUpdateInterface, ListAdditionalColumnsInterface, ListUserDisplayFormatInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function add restriction in the query related to the filters.
|
||||||
|
*
|
||||||
|
* @param Criteria $criteria , must be contain only select of columns
|
||||||
|
* @param array $filters
|
||||||
|
* @param array $additionalColumns information about the new columns related to custom cases list
|
||||||
|
*
|
||||||
|
* @throws PropelException
|
||||||
|
*/
|
||||||
|
public function loadFilters(&$criteria, $filters);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function get the information in the corresponding cases list.
|
||||||
|
*
|
||||||
|
* @param string $usr_uid , must be show cases related to this user
|
||||||
|
* @param array $filters for apply in the result
|
||||||
|
* @param callable $callbackRecord
|
||||||
|
*
|
||||||
|
* @return array $data
|
||||||
|
* @throws PropelException
|
||||||
|
*/
|
||||||
|
public function loadList($usr_uid, $filters = [], callable $callbackRecord = null);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the number of cases of a user.
|
||||||
|
*
|
||||||
|
* @param string $usrUid
|
||||||
|
* @param array $filters
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getCountList($usrUid, $filters = []);
|
||||||
|
}
|
||||||
24
workflow/engine/classes/ListUserDisplayFormatInterface.php
Normal file
24
workflow/engine/classes/ListUserDisplayFormatInterface.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The list implements user name formated.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
interface ListUserDisplayFormatInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the $userDisplayFormat value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getUserDisplayFormat();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of $userDisplayFormat.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setUserDisplayFormat($v);
|
||||||
|
}
|
||||||
77
workflow/engine/classes/model/ListBaseTrait.php
Normal file
77
workflow/engine/classes/model/ListBaseTrait.php
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List basic methods
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
trait ListBaseTrait
|
||||||
|
{
|
||||||
|
private $additionalClassName = '';
|
||||||
|
private $userDisplayFormat = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the $additionalClassName value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getAdditionalClassName()
|
||||||
|
{
|
||||||
|
return $this->additionalClassName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of $additionalClassName.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setAdditionalClassName($v)
|
||||||
|
{
|
||||||
|
$this->additionalClassName = $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the $userDisplayFormat value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getUserDisplayFormat()
|
||||||
|
{
|
||||||
|
return $this->userDisplayFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of $userDisplayFormat.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setUserDisplayFormat($v)
|
||||||
|
{
|
||||||
|
$this->userDisplayFormat = $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the number of cases by class and user.
|
||||||
|
*
|
||||||
|
* @param type $peerClass
|
||||||
|
* @param type $usrUid
|
||||||
|
* @param type $filters
|
||||||
|
*
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
protected function getCountListFromPeer($peerClass, $usrUid, $filters = [])
|
||||||
|
{
|
||||||
|
$criteria = new Criteria();
|
||||||
|
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||||
|
$criteria->add($peerClass::USR_UID, $usrUid, Criteria::EQUAL);
|
||||||
|
if (count($filters)) {
|
||||||
|
self::loadFilters($criteria, $filters);
|
||||||
|
}
|
||||||
|
$dataset = $peerClass::doSelectRS($criteria);
|
||||||
|
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$dataset->next();
|
||||||
|
$row = $dataset->getRow();
|
||||||
|
return (int) $row['TOTAL'];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,8 +15,10 @@ require_once 'classes/model/om/BaseListCanceled.php';
|
|||||||
* @package classes.model
|
* @package classes.model
|
||||||
*/
|
*/
|
||||||
// @codingStandardsIgnoreStart
|
// @codingStandardsIgnoreStart
|
||||||
class ListCanceled extends BaseListCanceled
|
class ListCanceled extends BaseListCanceled implements ListInterface
|
||||||
{
|
{
|
||||||
|
use ListBaseTrait;
|
||||||
|
|
||||||
// @codingStandardsIgnoreEnd
|
// @codingStandardsIgnoreEnd
|
||||||
/**
|
/**
|
||||||
* Create List Canceled Table
|
* Create List Canceled Table
|
||||||
@@ -283,7 +285,7 @@ class ListCanceled extends BaseListCanceled
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$resp = array();
|
$resp = array();
|
||||||
$criteria = new Criteria();
|
$criteria = new Criteria();
|
||||||
@@ -346,16 +348,7 @@ class ListCanceled extends BaseListCanceled
|
|||||||
*/
|
*/
|
||||||
public function getCountList($usrUid, $filters = array())
|
public function getCountList($usrUid, $filters = array())
|
||||||
{
|
{
|
||||||
$criteria = new Criteria();
|
return $this->getCountListFromPeer
|
||||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
(ListCanceledPeer::class, $usrUid, $filters);
|
||||||
$criteria->add(ListCanceledPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
|
||||||
if (count($filters)) {
|
|
||||||
self::loadFilters($criteria, $filters);
|
|
||||||
}
|
|
||||||
$dataset = ListCanceledPeer::doSelectRS($criteria);
|
|
||||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$dataset->next();
|
|
||||||
$aRow = $dataset->getRow();
|
|
||||||
return (int)$aRow['TOTAL'];
|
|
||||||
}
|
}
|
||||||
} // ListCanceled
|
} // ListCanceled
|
||||||
|
|||||||
@@ -15,8 +15,10 @@ require_once 'classes/model/om/BaseListCompleted.php';
|
|||||||
* @package classes.model
|
* @package classes.model
|
||||||
*/
|
*/
|
||||||
// @codingStandardsIgnoreStart
|
// @codingStandardsIgnoreStart
|
||||||
class ListCompleted extends BaseListCompleted
|
class ListCompleted extends BaseListCompleted implements ListInterface
|
||||||
{
|
{
|
||||||
|
use ListBaseTrait;
|
||||||
|
|
||||||
// @codingStandardsIgnoreEnd
|
// @codingStandardsIgnoreEnd
|
||||||
/**
|
/**
|
||||||
* Create List Completed Table
|
* Create List Completed Table
|
||||||
@@ -271,7 +273,7 @@ class ListCompleted extends BaseListCompleted
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$resp = array();
|
$resp = array();
|
||||||
$criteria = new Criteria();
|
$criteria = new Criteria();
|
||||||
@@ -324,23 +326,16 @@ class ListCompleted extends BaseListCompleted
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of cases of a user
|
* Returns the number of cases of a user.
|
||||||
|
*
|
||||||
* @param $usrUid
|
* @param $usrUid
|
||||||
* @param array $filters
|
* @param array $filters
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getCountList($usrUid, $filters = array())
|
public function getCountList($usrUid, $filters = array())
|
||||||
{
|
{
|
||||||
$criteria = new Criteria();
|
return $this->getCountListFromPeer
|
||||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
(ListCompletedPeer::class, $usrUid, $filters);
|
||||||
$criteria->add(ListCompletedPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
|
||||||
if (count($filters)) {
|
|
||||||
self::loadFilters($criteria, $filters);
|
|
||||||
}
|
|
||||||
$dataset = ListCompletedPeer::doSelectRS($criteria);
|
|
||||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$dataset->next();
|
|
||||||
$aRow = $dataset->getRow();
|
|
||||||
return (int)$aRow['TOTAL'];
|
|
||||||
}
|
}
|
||||||
} // ListCompleted
|
} // ListCompleted
|
||||||
|
|||||||
@@ -15,52 +15,9 @@ use ProcessMaker\BusinessModel\Cases as BmCases;
|
|||||||
* @package classes.model
|
* @package classes.model
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ListInbox extends BaseListInbox
|
class ListInbox extends BaseListInbox implements ListInterface
|
||||||
{
|
{
|
||||||
private $additionalClassName = '';
|
use ListBaseTrait;
|
||||||
private $userDisplayFormat = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the $additionalClassName value.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getAdditionalClassName()
|
|
||||||
{
|
|
||||||
return $this->additionalClassName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of $additionalClassName.
|
|
||||||
*
|
|
||||||
* @param string $v new value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setAdditionalClassName($v)
|
|
||||||
{
|
|
||||||
$this->additionalClassName = $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the $userDisplayFormat value.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getUserDisplayFormat()
|
|
||||||
{
|
|
||||||
return $this->userDisplayFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of $userDisplayFormat.
|
|
||||||
*
|
|
||||||
* @param string $v new value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setUserDisplayFormat($v)
|
|
||||||
{
|
|
||||||
$this->userDisplayFormat = $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create List Inbox Table
|
* Create List Inbox Table
|
||||||
@@ -569,7 +526,7 @@ class ListInbox extends BaseListInbox
|
|||||||
* @return array $data
|
* @return array $data
|
||||||
* @throws PropelException
|
* @throws PropelException
|
||||||
*/
|
*/
|
||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$pmTable = new PmTable();
|
$pmTable = new PmTable();
|
||||||
$list = isset($filters['action']) ? $filters['action'] : "";
|
$list = isset($filters['action']) ? $filters['action'] : "";
|
||||||
@@ -713,7 +670,7 @@ class ListInbox extends BaseListInbox
|
|||||||
$dataset = ListInboxPeer::doSelectRS($criteria);
|
$dataset = ListInboxPeer::doSelectRS($criteria);
|
||||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$dataset->next();
|
$dataset->next();
|
||||||
$aRow = $dataset->getRow();
|
$row = $dataset->getRow();
|
||||||
return (int)$aRow['TOTAL'];
|
return (int) $row['TOTAL'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,10 @@ require_once 'classes/model/om/BaseListMyInbox.php';
|
|||||||
* @package classes.model
|
* @package classes.model
|
||||||
*/
|
*/
|
||||||
// @codingStandardsIgnoreStart
|
// @codingStandardsIgnoreStart
|
||||||
class ListMyInbox extends BaseListMyInbox
|
class ListMyInbox extends BaseListMyInbox implements ListInterface
|
||||||
{
|
{
|
||||||
|
use ListBaseTrait;
|
||||||
|
|
||||||
// @codingStandardsIgnoreEnd
|
// @codingStandardsIgnoreEnd
|
||||||
/**
|
/**
|
||||||
* Create List My Inbox Table
|
* Create List My Inbox Table
|
||||||
@@ -248,7 +250,7 @@ class ListMyInbox extends BaseListMyInbox
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$criteria = new Criteria();
|
$criteria = new Criteria();
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,10 @@ require_once 'classes/model/om/BaseListParticipatedHistory.php';
|
|||||||
* @package classes.model
|
* @package classes.model
|
||||||
*/
|
*/
|
||||||
// @codingStandardsIgnoreStart
|
// @codingStandardsIgnoreStart
|
||||||
class ListParticipatedHistory extends BaseListParticipatedHistory
|
class ListParticipatedHistory extends BaseListParticipatedHistory implements ListInterface
|
||||||
{
|
{
|
||||||
|
use ListBaseTrait;
|
||||||
|
|
||||||
// @codingStandardsIgnoreEnd
|
// @codingStandardsIgnoreEnd
|
||||||
/**
|
/**
|
||||||
* Create List Participated History Table
|
* Create List Participated History Table
|
||||||
@@ -203,7 +205,7 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$criteria = new Criteria();
|
$criteria = new Criteria();
|
||||||
|
|
||||||
|
|||||||
@@ -12,52 +12,9 @@ use ProcessMaker\BusinessModel\Cases as BmCases;
|
|||||||
* application requirements. This class will only be generated as
|
* application requirements. This class will only be generated as
|
||||||
* long as it does not already exist in the output directory.
|
* long as it does not already exist in the output directory.
|
||||||
*/
|
*/
|
||||||
class ListParticipatedLast extends BaseListParticipatedLast
|
class ListParticipatedLast extends BaseListParticipatedLast implements ListInterface
|
||||||
{
|
{
|
||||||
private $additionalClassName = '';
|
use ListBaseTrait;
|
||||||
private $userDisplayFormat = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the $additionalClassName value.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getAdditionalClassName()
|
|
||||||
{
|
|
||||||
return $this->additionalClassName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of $additionalClassName.
|
|
||||||
*
|
|
||||||
* @param string $v new value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setAdditionalClassName($v)
|
|
||||||
{
|
|
||||||
$this->additionalClassName = $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the $userDisplayFormat value.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getUserDisplayFormat()
|
|
||||||
{
|
|
||||||
return $this->userDisplayFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of $userDisplayFormat.
|
|
||||||
*
|
|
||||||
* @param string $v new value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setUserDisplayFormat($v)
|
|
||||||
{
|
|
||||||
$this->userDisplayFormat = $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create List Participated History Table.
|
* Create List Participated History Table.
|
||||||
@@ -410,7 +367,7 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
|||||||
* @return array $data
|
* @return array $data
|
||||||
* @throws PropelException
|
* @throws PropelException
|
||||||
*/
|
*/
|
||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null, $appUid = '')
|
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null, $appUid = '')
|
||||||
{
|
{
|
||||||
$pmTable = new PmTable();
|
$pmTable = new PmTable();
|
||||||
$criteria = $pmTable->addPMFieldsToList('sent');
|
$criteria = $pmTable->addPMFieldsToList('sent');
|
||||||
@@ -554,18 +511,8 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
|||||||
*/
|
*/
|
||||||
public function getCountList($usrUid, $filters = array())
|
public function getCountList($usrUid, $filters = array())
|
||||||
{
|
{
|
||||||
$criteria = new Criteria();
|
return $this->getCountListFromPeer
|
||||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
(ListParticipatedLastPeer::class, $usrUid, $filters);
|
||||||
$criteria->add(ListParticipatedLastPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
|
||||||
if (count($filters)) {
|
|
||||||
self::loadFilters($criteria, $filters);
|
|
||||||
}
|
|
||||||
$dataset = ListParticipatedLastPeer::doSelectRS($criteria);
|
|
||||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$dataset->next();
|
|
||||||
$aRow = $dataset->getRow();
|
|
||||||
|
|
||||||
return (int) $aRow['TOTAL'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,52 +15,9 @@ use ProcessMaker\BusinessModel\Cases as BmCases;
|
|||||||
* @package classes.model
|
* @package classes.model
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ListPaused extends BaseListPaused
|
class ListPaused extends BaseListPaused implements ListInterface
|
||||||
{
|
{
|
||||||
private $additionalClassName = '';
|
use ListBaseTrait;
|
||||||
private $userDisplayFormat = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the $additionalClassName value.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getAdditionalClassName()
|
|
||||||
{
|
|
||||||
return $this->additionalClassName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of $additionalClassName.
|
|
||||||
*
|
|
||||||
* @param string $v new value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setAdditionalClassName($v)
|
|
||||||
{
|
|
||||||
$this->additionalClassName = $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the $userDisplayFormat value.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getUserDisplayFormat()
|
|
||||||
{
|
|
||||||
return $this->userDisplayFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of $userDisplayFormat.
|
|
||||||
*
|
|
||||||
* @param string $v new value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setUserDisplayFormat($v)
|
|
||||||
{
|
|
||||||
$this->userDisplayFormat = $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create List Paused Table
|
* Create List Paused Table
|
||||||
@@ -326,7 +283,7 @@ class ListPaused extends BaseListPaused
|
|||||||
* @return array $data
|
* @return array $data
|
||||||
* @throws PropelException
|
* @throws PropelException
|
||||||
*/
|
*/
|
||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$resp = array();
|
$resp = array();
|
||||||
$pmTable = new PmTable();
|
$pmTable = new PmTable();
|
||||||
@@ -417,16 +374,7 @@ class ListPaused extends BaseListPaused
|
|||||||
*/
|
*/
|
||||||
public function getCountList($usrUid, $filters = array())
|
public function getCountList($usrUid, $filters = array())
|
||||||
{
|
{
|
||||||
$criteria = new Criteria();
|
return $this->getCountListFromPeer
|
||||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
(ListPausedPeer::class, $usrUid, $filters);
|
||||||
$criteria->add(ListPausedPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
|
||||||
if (count($filters)) {
|
|
||||||
self::loadFilters($criteria, $filters);
|
|
||||||
}
|
|
||||||
$dataset = ListPausedPeer::doSelectRS($criteria);
|
|
||||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$dataset->next();
|
|
||||||
$aRow = $dataset->getRow();
|
|
||||||
return (int)$aRow['TOTAL'];
|
|
||||||
}
|
}
|
||||||
} // ListPaused
|
} // ListPaused
|
||||||
|
|||||||
@@ -15,9 +15,10 @@ require_once 'classes/model/om/BaseListUnassigned.php';
|
|||||||
* @package classes.model
|
* @package classes.model
|
||||||
*/
|
*/
|
||||||
// @codingStandardsIgnoreStart
|
// @codingStandardsIgnoreStart
|
||||||
class ListUnassigned extends BaseListUnassigned
|
class ListUnassigned extends BaseListUnassigned implements ListInterface
|
||||||
{
|
{
|
||||||
private $additionalClassName = '';
|
use ListBaseTrait;
|
||||||
|
|
||||||
private $total = 0;
|
private $total = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -192,7 +193,7 @@ class ListUnassigned extends BaseListUnassigned
|
|||||||
} else {
|
} else {
|
||||||
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||||
$casesList->getSearchCriteriaListCases($criteria, __CLASS__ . 'Peer', $search, $this->additionalClassName, $additionalColumns);
|
$casesList->getSearchCriteriaListCases($criteria, __CLASS__ . 'Peer', $search, $this->getAdditionalClassName(), $additionalColumns);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +229,7 @@ class ListUnassigned extends BaseListUnassigned
|
|||||||
{
|
{
|
||||||
$pmTable = new PmTable();
|
$pmTable = new PmTable();
|
||||||
$criteria = $pmTable->addPMFieldsToList('unassigned');
|
$criteria = $pmTable->addPMFieldsToList('unassigned');
|
||||||
$this->additionalClassName = $pmTable->tableClassName;
|
$this->setAdditionalClassName($pmTable->tableClassName);
|
||||||
$additionalColumns = $criteria->getSelectColumns();
|
$additionalColumns = $criteria->getSelectColumns();
|
||||||
|
|
||||||
$criteria->addSelectColumn(ListUnassignedPeer::APP_UID);
|
$criteria->addSelectColumn(ListUnassignedPeer::APP_UID);
|
||||||
@@ -260,8 +261,9 @@ class ListUnassigned extends BaseListUnassigned
|
|||||||
BasePeer::TYPE_FIELDNAME,
|
BasePeer::TYPE_FIELDNAME,
|
||||||
empty($filters['sort']) ? "DEL_DELEGATE_DATE" : $filters['sort'],
|
empty($filters['sort']) ? "DEL_DELEGATE_DATE" : $filters['sort'],
|
||||||
"DEL_DELEGATE_DATE",
|
"DEL_DELEGATE_DATE",
|
||||||
$this->additionalClassName,
|
$this->getAdditionalClassName(),
|
||||||
$additionalColumns
|
$additionalColumns,
|
||||||
|
$this->getUserDisplayFormat()
|
||||||
);
|
);
|
||||||
|
|
||||||
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
|
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
|
||||||
@@ -269,10 +271,20 @@ class ListUnassigned extends BaseListUnassigned
|
|||||||
$limit = isset($filters['limit']) ? $filters['limit'] : "25";
|
$limit = isset($filters['limit']) ? $filters['limit'] : "25";
|
||||||
$paged = isset($filters['paged']) ? $filters['paged'] : 1;
|
$paged = isset($filters['paged']) ? $filters['paged'] : 1;
|
||||||
$count = isset($filters['count']) ? $filters['count'] : 1;
|
$count = isset($filters['count']) ? $filters['count'] : 1;
|
||||||
if ($dir == "DESC") {
|
if (is_array($sort) && count($sort) > 0) {
|
||||||
$criteria->addDescendingOrderByColumn($sort);
|
foreach ($sort as $key) {
|
||||||
|
if ($dir == 'DESC') {
|
||||||
|
$criteria->addDescendingOrderByColumn($key);
|
||||||
|
} else {
|
||||||
|
$criteria->addAscendingOrderByColumn($key);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$criteria->addAscendingOrderByColumn($sort);
|
if ($dir == 'DESC') {
|
||||||
|
$criteria->addDescendingOrderByColumn($sort);
|
||||||
|
} else {
|
||||||
|
$criteria->addAscendingOrderByColumn($sort);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->total = ListUnassignedPeer::doCount($criteria);
|
$this->total = ListUnassignedPeer::doCount($criteria);
|
||||||
if ($paged == 1) {
|
if ($paged == 1) {
|
||||||
|
|||||||
@@ -3582,6 +3582,9 @@ class Cases
|
|||||||
break;
|
break;
|
||||||
case 'USR_UID':
|
case 'USR_UID':
|
||||||
$columnSort = $this->buildOrderFieldFormatted($columnsList, $userDisplayFormat, 'DEL_CURRENT_');
|
$columnSort = $this->buildOrderFieldFormatted($columnsList, $userDisplayFormat, 'DEL_CURRENT_');
|
||||||
|
if (empty($columnSort)) {
|
||||||
|
$columnSort = $this->buildOrderFieldFormatted($columnsList, $userDisplayFormat, '', false);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$columnSort = $listPeer::TABLE_NAME . '.' . $sort;
|
$columnSort = $listPeer::TABLE_NAME . '.' . $sort;
|
||||||
@@ -3612,13 +3615,13 @@ class Cases
|
|||||||
*
|
*
|
||||||
* @return array $columnSort, columns by apply the sql command ORDER BY
|
* @return array $columnSort, columns by apply the sql command ORDER BY
|
||||||
*/
|
*/
|
||||||
public function buildOrderFieldFormatted($columnsList, $format, $prefix = 'DEL_PREVIOUS_')
|
public function buildOrderFieldFormatted($columnsList, $format, $prefix = 'DEL_PREVIOUS_', $validate = true)
|
||||||
{
|
{
|
||||||
$columnSort = [];
|
$columnSort = [];
|
||||||
|
|
||||||
if (in_array($prefix . 'USR_FIRSTNAME', $columnsList) &&
|
if (!$validate || (in_array($prefix . 'USR_FIRSTNAME', $columnsList) &&
|
||||||
in_array($prefix . 'USR_LASTNAME', $columnsList) &&
|
in_array($prefix . 'USR_LASTNAME', $columnsList) &&
|
||||||
in_array($prefix . 'USR_USERNAME', $columnsList)
|
in_array($prefix . 'USR_USERNAME', $columnsList))
|
||||||
) {
|
) {
|
||||||
switch ($format) {
|
switch ($format) {
|
||||||
case '@firstName @lastName':
|
case '@firstName @lastName':
|
||||||
|
|||||||
Reference in New Issue
Block a user