history_report.report.php (fogproject-1.5.5) | : | history_report.report.php (fogproject-1.5.6) | ||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
* Prints the history of all items. | * Prints the history of all items. | |||
* | * | |||
* @category History_Report | * @category History_Report | |||
* @package FOGProject | * @package FOGProject | |||
* @author Tom Elliott <tommygunsster@gmail.com> | * @author Tom Elliott <tommygunsster@gmail.com> | |||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 | * @license http://opensource.org/licenses/gpl-3.0 GPLv3 | |||
* @link https://fogproject.org | * @link https://fogproject.org | |||
*/ | */ | |||
class History_Report extends ReportManagementPage | class History_Report extends ReportManagementPage | |||
{ | { | |||
public function file() | ||||
{ | ||||
$this->title = _('FOG History - Search'); | ||||
unset( | ||||
$this->data, | ||||
$this->form, | ||||
$this->headerData, | ||||
$this->templates, | ||||
$this->attributes | ||||
); | ||||
$this->templates = array( | ||||
'${field}', | ||||
'${input}' | ||||
); | ||||
$this->attributes = array( | ||||
array('class' => 'col-xs-4'), | ||||
array('class' => 'col-xs-8 form-group') | ||||
); | ||||
$userNames = self::getSubObjectIDs( | ||||
'User', | ||||
'', | ||||
'name' | ||||
); | ||||
$userNames = array_values( | ||||
array_filter( | ||||
array_unique( | ||||
(array)$userNames | ||||
) | ||||
) | ||||
); | ||||
natcasesort($userNames); | ||||
if (count($userNames) > 0) { | ||||
$userSelForm = self::selectForm( | ||||
'usersearch', | ||||
$userNames | ||||
); | ||||
unset($userNames); | ||||
} | ||||
$fields = array( | ||||
'<label for="usersearch">' | ||||
. _('Enter an user name to search for') | ||||
. '</label>' => $userSelForm, | ||||
'<label for="info">' | ||||
. _('Enter a term to search for') | ||||
. '</label>' => '<div class="input-group">' | ||||
. '<input type="text" class="' | ||||
. 'form-control text-input" name=' | ||||
. '"info" value="' | ||||
. $info | ||||
. '" autocomplete="off" id="info" />' | ||||
. '</div>', | ||||
'<label for="performsearch">' | ||||
. _('Perform search') | ||||
. '</label>' => '<button type="submit" name="performsearch" ' | ||||
. 'class="btn btn-info btn-block" id="performsearch">' | ||||
. _('Search') | ||||
. '</button>' | ||||
); | ||||
array_walk($fields, $this->fieldsToData); | ||||
echo '<div class="col-xs-9">'; | ||||
echo '<div class="panel panel-info">'; | ||||
echo '<div class="panel-heading text-center">'; | ||||
echo '<h4 class="title">'; | ||||
echo $this->title; | ||||
echo '</h4>'; | ||||
echo '</div>'; | ||||
echo '<div class="panel-body">'; | ||||
echo '<form class="form-horizontal" method="post" action="' | ||||
. $this->formAction | ||||
. '">'; | ||||
$this->render(12); | ||||
echo '</form>'; | ||||
echo '</div>'; | ||||
echo '</div>'; | ||||
echo '</div>'; | ||||
} | ||||
/** | /** | |||
* Display page. | * Display page. | |||
* | * | |||
* @return void | * @return void | |||
*/ | */ | |||
public function file() | ||||
public function filePost() | ||||
{ | { | |||
$this->title = _('Full History Export'); | $this->title = _('Full History Export'); | |||
$usersearch = filter_input( | ||||
INPUT_POST, | ||||
'usersearch' | ||||
); | ||||
$info = filter_input( | ||||
INPUT_POST, | ||||
'info' | ||||
); | ||||
if (!$usersearch) { | ||||
$usersearch = '%'; | ||||
} | ||||
$info = '%'. $info . '%'; | ||||
array_walk( | array_walk( | |||
self::$inventoryCsvHead, | self::$inventoryCsvHead, | |||
function (&$classGet, &$csvHeader) { | function (&$classGet, &$csvHeader) { | |||
$this->ReportMaker->addCSVCell($csvHeader); | $this->ReportMaker->addCSVCell($csvHeader); | |||
unset($classGet, $csvHeader); | unset($classGet, $csvHeader); | |||
} | } | |||
); | ); | |||
$this->ReportMaker->endCSVLine(); | $this->ReportMaker->endCSVLine(); | |||
$this->headerData = array( | $this->headerData = array( | |||
_('User'), | _('User'), | |||
skipping to change at line 58 | skipping to change at line 151 | |||
'${info}', | '${info}', | |||
'${createdTime}', | '${createdTime}', | |||
'${ip}' | '${ip}' | |||
); | ); | |||
$this->attributes = array( | $this->attributes = array( | |||
array(), | array(), | |||
array(), | array(), | |||
array(), | array(), | |||
array() | array() | |||
); | ); | |||
Route::listem('history'); | Route::listem( | |||
'history', | ||||
'id', | ||||
'false', | ||||
array( | ||||
'createdBy' => $usersearch, | ||||
'info' => $info | ||||
) | ||||
); | ||||
$Historys = json_decode( | $Historys = json_decode( | |||
Route::getData() | Route::getData() | |||
); | ); | |||
$Historys = $Historys->historys; | $Historys = $Historys->historys; | |||
$inventoryCsvHead = array( | $inventoryCsvHead = array( | |||
_('History ID') => 'id', | _('History ID') => 'id', | |||
_('History Info') => 'info', | _('History Info') => 'info', | |||
_('History User') => 'createdBy', | _('History User') => 'createdBy', | |||
_('History Time') => 'createdTime', | _('History Time') => 'createdTime', | |||
_('History IP') => 'ip' | _('History IP') => 'ip' | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 103 lines changed or added |