"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/web/lib/reports/imaging_log.report.php" between
fogproject-1.5.5.tar.gz and fogproject-1.5.6.tar.gz

About: FOG is a Linux-based network computer cloning solution for Windows, Mac OSX and various Linux distributions that ties together a few open-source tools with a PHP-based web interface. FOG doesn’t use any boot disks, or CDs; everything is done via TFTP and PXE.

imaging_log.report.php  (fogproject-1.5.5):imaging_log.report.php  (fogproject-1.5.6)
<?php <?php
/** /**
* Imaging Log report * Imaging Log report
* *
* PHP Version 5 * PHP Version 5
* *
* @category Imaging_Log * @category Imaging_Log
* @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 * @author Fernando Gietz <fernando.gietz@gmail.com>
* @link https://fogproject.org
*/
/**
* Imaging Log report
*
* @category Imaging_Log
* @package FOGProject
* @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 Imaging_Log extends ReportManagementPage class Imaging_Log extends ReportManagementPage
{ {
/** /**
* Initial display * Initial display
* *
* @return void * @return void
*/ */
public function file() public function file()
{ {
$this->title = _('FOG Imaging - 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'
);
$imageNames = self::getSubObjectIDs(
'Image',
'',
'name'
);
$HostNames = self::getSubObjectIDs(
'Host',
'',
'name'
);
$userNames = array_values(
array_filter(
array_unique(
(array)$userNames
)
)
);
$imageNames = array_values(
array_filter(
array_unique(
(array)$imageNames
)
)
);
$HostNames = array_values(
array_filter(
array_unique(
(array)$HostNames
)
)
);
natcasesort($userNames);
natcasesort($imageNames);
natcasesort($HostNames);
if (count($userNames) > 0) {
$userSelForm = self::selectForm(
'usersearch',
$userNames
);
unset($userNames);
}
if (count($imageNames) > 0) {
$imageSelForm = self::selectForm(
'imagesearch',
$imageNames
);
unset($imageNames);
}
if (count($HostNames) > 0) {
$hostSelForm = self::selectForm(
'hostsearch',
$HostNames
);
unset($HostNames);
}
$fields = array(
'<label for="imagesearch">'
. _('Enter an image name to search for')
. '</label>' => $imageSelForm,
'<label for="usersearch">'
. _('Enter an user name to search for')
. '</label>' => $userSelForm,
'<label for="hostsearch">'
. _('Enter a hostname to search for')
. '</label>' => $hostSelForm,
'<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>';
}
public function filePost()
{
$hostsearch = filter_input(
INPUT_POST,
'hostsearch'
);
$imagesearch = filter_input(
INPUT_POST,
'imagesearch'
);
$usersearch = filter_input(
INPUT_POST,
'usersearch'
);
if (!$hostsearch) {
$hostsearch = '%';
}
if (!$imagesearch) {
$imagesearch = '%';
}
if (!$usersearch) {
$usersearch = '%';
}
$hostIDs = self::getSubObjectIDs(
'Host',
array('name' => $hostsearch)
);
$userNames = self::getSubObjectIDs(
'User',
array('name' => $usersearch),
'name'
);
$imageNames = self::getSubObjectIDs(
'Image',
array('name' => $imagesearch),
'name'
);
$this->title = _('FOG Imaging Log'); $this->title = _('FOG Imaging Log');
$this->headerData = array( $this->headerData = array(
_('Created By'), _('Created By'),
_('Host'), _('Host'),
_('Start'), _('Start'),
_('End'), _('End'),
_('Duration'), _('Duration'),
_('Image'), _('Image'),
_('Type') _('Type')
); );
$this->templates = array( $this->templates = array(
skipping to change at line 74 skipping to change at line 223
); );
$imgTypes = array( $imgTypes = array(
'up' => _('Capture'), 'up' => _('Capture'),
'down' => _('Deploy') 'down' => _('Deploy')
); );
foreach ($csvHead as &$csvHeader) { foreach ($csvHead as &$csvHeader) {
$this->ReportMaker->addCSVCell($csvHeader); $this->ReportMaker->addCSVCell($csvHeader);
unset($csvHeader); unset($csvHeader);
} }
$this->ReportMaker->endCSVLine(); $this->ReportMaker->endCSVLine();
Route::listem('imaginglog'); Route::listem(
'imaginglog',
'hostID',
'false',
array(
'hostID' => $hostIDs,
'createdBy' => $userNames,
'image' => $imageNames
)
);
$ImagingLogs = json_decode( $ImagingLogs = json_decode(
Route::getData() Route::getData()
); );
$ImagingLogs = $ImagingLogs->imaginglogs; $ImagingLogs = $ImagingLogs->imaginglogs;
foreach ((array)$ImagingLogs as &$ImagingLog) { foreach ((array)$ImagingLogs as &$ImagingLog) {
if (!$ImagingLog->host->id) { if (!$ImagingLog->host->id) {
continue; continue;
} }
$start = $ImagingLog->start; $start = $ImagingLog->start;
$end = $ImagingLog->finish; $end = $ImagingLog->finish;
 End of changes. 5 change blocks. 
10 lines changed or deleted 168 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)