Skip to content

Commit

Permalink
Merge branch 'branch-7.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
wanderleihuttel committed Nov 7, 2017
2 parents 4833c7d + 5d482e1 commit 919d971
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 13 deletions.
9 changes: 7 additions & 2 deletions application/models/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,8 @@ function getSelectFilteredJob($date_begin, $time_begin, $date_end, $time_end,
$select->joinLeft(array('c' => 'Client'), 'j.ClientId = c.ClientId', array('ClientName' => 'c.Name'));
$select->joinLeft(array('p' => 'Pool'), 'j.PoolId = p.PoolId', array('PoolName' => 'p.Name'));
$select->joinLeft(array('f' => 'FileSet'), 'j.FileSetId = f.FileSetId', array('FileSet'));
$select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job');

$select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job');
$select->joinLeft(array('wjs'=> 'webacula_job_size'), 'j.JobId = wjs.JobId', array('FileSize' => 'FileSize'));
$select->where( "('" . $date_begin . ' ' . $time_begin . "' <= j.StartTime) AND (j.StartTime <= '" .
$date_end . ' ' . $time_end . "')" );

Expand Down Expand Up @@ -857,6 +857,7 @@ function getByJobId($jobid)
$select->joinLeft(array('p' => 'Pool'), 'j.PoolId = p.PoolId', array('PoolName' => 'Name'));
$select->joinLeft(array('f' => 'FileSet'), 'j.FileSetId = f.FileSetId', array('FileSet'));
$select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job');
$select->joinLeft(array('wjs'=> 'webacula_job_size'), 'j.JobId = wjs.JobId', array('FileSize' => 'FileSize'));
$select->where("j.JobId = '$jobid'");
$select->order(array("StartTime", "JobId"));
//$sql = $select->__toString(); echo "<pre>$sql</pre>"; exit; // for !!!debug!!!
Expand Down Expand Up @@ -917,6 +918,7 @@ function getByJobName($jobname)
$select->joinLeft(array('p' => 'Pool'), 'j.PoolId = p.PoolId', array('PoolName' => 'Name'));
$select->joinLeft(array('f' => 'FileSet'), 'j.FileSetId = f.FileSetId', array('FileSet'));
$select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job');
$select->joinLeft(array('wjs'=> 'webacula_job_size'), 'j.JobId = wjs.JobId', array('FileSize' => 'FileSize'));
$select->where("j.Name = '$jobname'");
$select->order(array("StartTime desc", "JobId desc"));
//$sql = $select->__toString(); echo "<pre>$sql</pre>"; exit; // for !!!debug!!!
Expand Down Expand Up @@ -974,6 +976,7 @@ function getByVolumeName($volname)
$select->joinLeft(array('o' => 'JobMedia'), 'j.JobId = o.JobId', array('JobId'));
$select->joinLeft(array('m' => 'Media'), 'm.MediaId = o.MediaId', array('MediaId'));
$select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job');
$select->joinLeft(array('wjs'=> 'webacula_job_size'), 'j.JobId = wjs.JobId', array('FileSize' => 'FileSize'));

$select->where("m.VolumeName = '$volname'");
$select->order(array("StartTime", "j.JobId"));
Expand Down Expand Up @@ -1139,6 +1142,7 @@ function getLastJobRun($numjob)
$select->joinInner(array('s' => 'Status'), "j.JobStatus = s.JobStatus" , array('jobstatuslong'=>'JobStatusLong'));
break;
}
$select->joinLeft(array('wjs'=> 'webacula_job_size'), 'j.JobId = wjs.JobId', array('FileSize' => 'FileSize'));
$select->where("j.JobStatus IN ('T', 'E', 'e', 'f', 'A', 'W', 'D')");
$select->where("j.Type = 'B'");
$select->order(array("sortStartTime DESC"));
Expand Down Expand Up @@ -1396,6 +1400,7 @@ function getJobBeforeDate($date_before, $client_id_from, $file_set)
" ORDER BY Job.StartTime ASC";
break;
}
//echo "<pre>$sql</pre>"; exit; // for !!!debug!!!
$stmt = $this->db->query($sql);
$ajob_inc = $stmt->fetchAll();
unset($stmt);
Expand Down
35 changes: 29 additions & 6 deletions application/views/scripts/job/find-filters.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
?>

<div class="rows">
<div class="col-md-10">
<div class="col-md-12">
<div class="panel panel-default panel-primary">
<div class="panel-heading">
<?php echo $this->escape($this->title); ?>
Expand Down Expand Up @@ -51,7 +51,9 @@
<th class="text-center"><a href="<?php echo $urlp; ?>/order/j.JobStatus"><?php echo $this->translate->_("Status"); ?></a></th>
<th class="text-center"><a href="<?php echo $urlp; ?>/order/j.Level"> <?php echo $this->translate->_("Level"); ?></a></th>
<th class="text-right"><a href="<?php echo $urlp; ?>/order/j.JobFiles"> <?php echo $this->translate->_("Files"); ?></a></th>
<th class="text-right"><a href="<?php echo $urlp; ?>/order/j.JobBytes"> <?php echo $this->translate->_("Bytes"); ?></a></th>
<th class="text-right"><a href="<?php echo $urlp; ?>/order/j.JobBytes"> <?php echo $this->translate->_("Bytes Stored"); ?></a></th>
<th class="text-right"><?php echo $this->translate->_("Bytes Copied"); ?></th>
<th class="text-right"><?php echo $this->translate->_("Software Compression"); ?></th>
<th class="text-center"><a href="<?php echo $urlp; ?>/order/j.JobErrors"><?php echo $this->translate->_("Errors"); ?></a></th>
<th class="text-left"><a href="<?php echo $urlp; ?>/order/c.Name"> <?php echo $this->translate->_("Client"); ?></a></th>
<th class="text-left"><a href="<?php echo $urlp; ?>/order/p.Name"> <?php echo $this->translate->_("Pool"); ?></a></th>
Expand Down Expand Up @@ -147,21 +149,42 @@

<td class="text-center"><?php echo $this->escape($line['level']);?></td>
<?php
if ( ($line['jobfiles'] == 0) && ($line['type'] != 'D') )
if ( ($line['jobfiles'] == 0) && ($line['type'] != 'B') )
$class = 'class="warning"';
else
$class = '';
echo '<td ', $class, ' class="text-right">', number_format($line['jobfiles']), '</td>';
?>

<?php
if ( ($line['jobbytes'] == 0) && ($line['type'] != 'D') )
if ( ($line['jobbytes'] == 0) && ($line['type'] != 'B') )
$class = 'class="warning"';
else
$class = '';
echo '<td ', $class, ' class="text-right">', $this->convBytes($line['jobbytes']), '</td>';
?>


<?php
if ( ($line['filesize'] == 0) && ($line['type'] != 'B') ) {
$class = 'class="text-right warning"';
} else {
$class = 'class="text-right"';
}
echo '<td ', $class, '>', $this->convBytes($line['filesize']), '</td>';
?>

<?php
$jobbytes=$line['jobbytes'];
$filesize=$line['filesize'];
if (( $jobbytes != 0) && ($filesize != 0) ){
$filesize == 0 ? 1 : $filesize;
$class = '';
echo '<td class="text-center">', $this->escape( number_format((1-($jobbytes/$filesize))*100,2) ), ' %</td>';
} else {
echo '<td class="text-center">-</td>';
}
?>

<!-- Errors -->
<?php
if ( $line['joberrors'] == 0 )
Expand Down Expand Up @@ -249,4 +272,4 @@
</div><!-- end div panel panel-default -->
</div><!-- end div col-md-8 -->
</div><!-- end div rows -->
<!-- job/find-filters.phtml -->
<!-- job/find-filters.phtml -->
8 changes: 4 additions & 4 deletions application/views/scripts/job/terminated-dashboard.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<th class="text-center"> <?php print $this->translate->_("Level"); ?></th>
<th class="text-right"> <?php print $this->translate->_("Files"); ?></th>
<th class="text-right"> <?php print $this->translate->_("Bytes"); ?></th>
<th class="text-center"> <?php print $this->translate->_("Errors"); ?></th>
<th class="text-center"> <?php print $this->translate->_("Log"); ?></th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -152,7 +152,7 @@
<!-- Errors -->
<?php
if ( $line['joberrors'] == 0 )
echo '<td class="text-center">-</td>';
echo '<td class="text-center"><a href="'. $this->baseUrl .'/log/view-log-id/jobid/'. $line['jobid'] . '/jobname/' . $line['jobname'] .'" title="' . $this->translate->_("View Messages") . '"><img src="' . $this->baseUrl .'/images/logviewer-small.png' . '"/></a></td>';
else {
if ( $line['reviewed'] > 0 ) {
// reviewed icon
Expand All @@ -168,7 +168,7 @@
$this->translate->_("View Messages"), '"';
if ( $line['reviewed'] == 0 )
echo ' class="text-center danger" ';
echo '>', $this->escape($line['joberrors']), '</a></td>';
echo '><img src="' . $this->baseUrl .'/images/logviewer-small.png' . '"/></a></td>';
}
?>
</tr>
Expand All @@ -193,4 +193,4 @@
</p><!-- close p -->
</div><!-- close div panel-body -->
</div><!-- close div panel panel-default -->
<!-- job/terminated-dashboard.phtml -->
<!-- job/terminated-dashboard.phtml -->
4 changes: 3 additions & 1 deletion application/views/scripts/job/terminated.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@
<td class="text-center">&nbsp;<?php echo $this->escape($line['durationtime']);?></td>

<!-- add to logbook button -->
<td><?php
<td>
<a href="<?php echo $this->baseUrl .'/log/view-log-id/jobid/'. $line['jobid'] . '/jobname/' . $line['jobname']; ?>" title="<?php echo $this->translate->_("Console Messages"); ?>"><img src="<?php echo $this->baseUrl .'/images/logviewer.png'?>"/></a>
<?php
if ( isset($line['poolid'], $line['poolname']) ) {
echo '<a href="';
echo $this->baseUrl, '/wblogbook/writelogbook/name_job/', $this->escape($line['jobname']),
Expand Down
Binary file added html/images/logviewer-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/images/logviewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 919d971

Please sign in to comment.