-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2dab4d0
commit d12f408
Showing
21 changed files
with
1,047 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?php defined('BX_DOL') or die('hack attempt'); | ||
/** | ||
* Copyright (c) UNA, Inc - https://una.io | ||
* MIT License - https://opensource.org/licenses/MIT | ||
* | ||
* @defgroup UnaCore UNA Core | ||
* @{ | ||
*/ | ||
|
||
/** | ||
* @see BxDolCategories | ||
*/ | ||
class BxDolAuditQuery extends BxDolDb implements iBxDolSingleton | ||
{ | ||
protected function __construct() | ||
{ | ||
if (isset($GLOBALS['bxDolClasses'][get_class($this)])) | ||
trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR); | ||
|
||
parent::__construct(); | ||
$this->_sTable = 'sys_audit'; | ||
} | ||
/** | ||
* Prevent cloning the instance | ||
*/ | ||
public function __clone() | ||
{ | ||
if (isset($GLOBALS['bxDolClasses'][get_class($this)])) | ||
trigger_error('Clone is not allowed for the class: ' . get_class($this), E_USER_ERROR); | ||
} | ||
|
||
/** | ||
* Get singleton instance of the class | ||
*/ | ||
public static function getInstance() | ||
{ | ||
$sClass = __CLASS__; | ||
if(!isset($GLOBALS['bxDolClasses'][__CLASS__])) | ||
$GLOBALS['bxDolClasses'][__CLASS__] = new $sClass(); | ||
|
||
return $GLOBALS['bxDolClasses'][__CLASS__]; | ||
} | ||
|
||
public function getData($aParams = array(), &$aItems = false) | ||
{ | ||
$aMethod = array('name' => 'getAll', 'params' => array(0 => 'query')); | ||
|
||
$sSelectClause = "`sc`.*"; | ||
$sJoinClause = $sWhereClause = $sGroupClause = $sLimitClause = ""; | ||
$sOrderClause = "`sc`.`added` ASC"; | ||
|
||
if(isset($aParams['count_only']) && $aParams['count_only'] === true) { | ||
$aMethod['name'] = 'getOne'; | ||
$sSelectClause = "COUNT(`sc`.`id`)"; | ||
} | ||
|
||
switch($aParams['type']) { | ||
case 'profile_list': | ||
$aMethod['name'] = 'getColumn'; | ||
$sSelectClause = " DISTINCT `sc`.`profile_id`"; | ||
|
||
break; | ||
|
||
case 'action_list': | ||
$aMethod['name'] = 'getColumn'; | ||
$sSelectClause = " DISTINCT `sc`.`action_lang_key`"; | ||
|
||
break; | ||
} | ||
|
||
if(!empty($sGroupClause)) | ||
$sGroupClause = "GROUP BY " . $sGroupClause; | ||
|
||
if(!empty($sOrderClause)) | ||
$sOrderClause = "ORDER BY " . $sOrderClause; | ||
|
||
$aMethod['params'][0] = "SELECT " . $sSelectClause . " | ||
FROM `" . $this->_sTable . "` AS `sc`" . $sJoinClause . " | ||
WHERE 1" . $sWhereClause . " " . $sGroupClause . " " . $sOrderClause. " " . $sLimitClause; | ||
$oRv = call_user_func_array(array($this, $aMethod['name']), $aMethod['params']); | ||
if ($aItems === false) | ||
return $oRv; | ||
$aItems = $oRv; | ||
} | ||
} | ||
|
||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* Copyright (c) UNA, Inc - https://una.io | ||
* MIT License - https://opensource.org/licenses/MIT | ||
* | ||
* @defgroup UnaCore UNA Core | ||
* @{ | ||
*/ | ||
|
||
function BxDolReportsManageTools(oOptions) { | ||
this._iSearchTimeoutId = false; | ||
this._sObjNameGrid = oOptions.sObjNameGrid; | ||
this._sObjName = oOptions.sObjName == undefined ? 'oBxDolReportsManageTools' : oOptions.sObjName; | ||
|
||
this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect; | ||
this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed; | ||
this._sParamsDivider = oOptions.sParamsDivider == undefined ? '#-#' : oOptions.sParamsDivider; | ||
|
||
this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds; | ||
this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams; | ||
|
||
} | ||
|
||
BxDolReportsManageTools.prototype.onChangeFilter = function (oFilter) { | ||
var $this = this; | ||
var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid); | ||
var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : ''; | ||
var oSearch = $('#bx-grid-search-' + this._sObjNameGrid); | ||
var sValueSearch = oSearch.length > 0 ? oSearch.val() : ''; | ||
if (sValueSearch == _t('_sys_grid_search')) | ||
sValueSearch = ''; | ||
|
||
clearTimeout($this._iSearchTimeoutId); | ||
$this._iSearchTimeoutId = setTimeout(function () { | ||
glGrids[$this._sObjNameGrid].setFilter(sValueFilter1 + $this._sParamsDivider + sValueSearch, true); | ||
}, 500); | ||
}; | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.