Skip to content
Browse files

[draft] show short job description

  • Loading branch information...
1 parent 4fd5456 commit 2b1e703d16e8f757296828dc4258afc6bb7792da @tim4dev committed Oct 30, 2011
Showing with 702 additions and 75 deletions.
  1. +2 −2 README
  2. +13 −0 TODO
  3. +7 −0 application/config.ini
  4. +7 −0 application/config.ini.original
  5. +10 −3 application/controllers/JobController.php
  6. +8 −5 application/controllers/WbjobdescController.php
  7. +11 −3 application/forms/FormJobdesc.php
  8. +1 −1 application/layouts/default/main-menu.phtml
  9. +41 −20 application/models/Job.php
  10. +49 −5 application/views/scripts/job/next-dashboard.phtml
  11. +48 −4 application/views/scripts/job/next.phtml
  12. +46 −2 application/views/scripts/job/problem-dashboard.phtml
  13. +45 −2 application/views/scripts/job/problem.phtml
  14. +94 −5 application/views/scripts/job/running-dashboard.phtml
  15. +94 −4 application/views/scripts/job/running.phtml
  16. +43 −2 application/views/scripts/job/terminated-dashboard.phtml
  17. +45 −2 application/views/scripts/job/terminated.phtml
  18. +4 −2 application/views/scripts/wbjobdesc/index.phtml
  19. +17 −1 docs/src/install.tex
  20. +12 −4 html/index.php
  21. +3 −2 html/styles/default/wbjobdesc.css
  22. +1 −1 html/styles/default/wblogbook.css
  23. +3 −1 install/MySql/10_make_tables.sh
  24. +2 −0 install/PostgreSql/10_make_tables.sh
  25. +2 −0 install/SqLite/10_make_tables.sh
  26. +4 −1 packaging/Fedora/webacula.spec
  27. +11 −3 tests/application/bootstrap.php
  28. +1 −0 tests/application/controllers/WbjobdescControllerTest.php
  29. +1 −0 tests/application/models/WbjobdescTest.php
  30. +3 −0 tests/conf/config.ini.mysql
  31. +3 −0 tests/conf/config.ini.pgsql
  32. +3 −0 tests/conf/config.ini.sqlite
  33. +23 −0 tests/prepare_tests/MySql/25_webacula_fill_jobdesc
  34. +21 −0 tests/prepare_tests/PostgreSql/35_webacula_fill_jobdesc
  35. +21 −0 tests/prepare_tests/SqLite/25_webacula_fill_jobdesc
  36. +1 −0 tests/prepare_tests/prepare.sh
  37. +2 −0 tests/prepare_tests/sync_bacula_db_from_mysql2others.sh
View
4 README
@@ -1,7 +1,7 @@
Webacula - Web Bacula - web interface of a Bacula backup system http://www.bacula.org/
-Version: 5.5.1
+Version: 5.5.2
http://webacula.sourceforge.net/
http://github.com/tim4dev/webacula
@@ -39,7 +39,7 @@ Webacula basic features:
-------
-Copyright 2007, 2008, 2009, 2010, 2011 Yuri Timofeev tim4dev@gmail.com
+Copyright 2007, 2008, 2009, 2010, 2011, 2012 Yuri Timofeev <tim4dev@gmail.com>
This program is free software: you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation, either version 3 of the License,
View
13 TODO
@@ -0,0 +1,13 @@
+
+- если в списке wbjobdesc/index описание есть, а в БД Bacula такого Job нет
+ то вместо значка "запустить задание" показать знак "?"
+
+- перевод
+
+- документация, changelog
+
+- unit tests
+
+- для Job вывод доп. инф-и : FileSet, Schedule, etc.
+
+
View
7 application/config.ini
@@ -41,6 +41,13 @@ bacula.bconsolecmd = "-n -c /etc/bacula/bconsole.conf"
;; Jobs with errors (last NN day(s)
; days_to_show_jobs_with_errors = 7
+;; Show human readable short Job description instead of Bacula Job names (default = 0)
+; avaliable optins : 0 | 1 | 2
+; 0 - only show Bacula Job Name (behavior as in earlier versions)
+; 1 - only show human readable short Job description instead of Bacula Job Name
+; 2 - show both
+; show_job_description = 0
+
; Normally, you will specify only one Restore job in bacula-dir.conf.
; However, if it is not so, if you have multiple (exact - more than one) Restore Job resources
; put Restore Job names from bacula-dir.conf here.
View
7 application/config.ini.original
@@ -41,6 +41,13 @@ bacula.bconsolecmd = "-n -c /etc/bacula/bconsole.conf"
;; Jobs with errors (last NN day(s)
; days_to_show_jobs_with_errors = 7
+;; Show human readable short Job description instead of Bacula Job names (default = 0)
+; avaliable optins : 0 | 1 | 2
+; 0 - only show Bacula Job Name (behavior as in earlier versions)
+; 1 - only show human readable short Job description instead of Bacula Job Name
+; 2 - show both
+; show_job_description = 0
+
; Normally, you will specify only one Restore job in bacula-dir.conf.
; However, if it is not so, if you have multiple (exact - more than one) Restore Job resources
; put Restore Job names from bacula-dir.conf here.
View
13 application/controllers/JobController.php
@@ -47,6 +47,7 @@ function terminatedAction()
$jobs = new Job();
$this->view->result = $jobs->getTerminatedJobs();
$this->view->meta_refresh = 300; // meta http-equiv="refresh"
+ $this->view->show_job_description = Zend_Registry::get('show_job_description');
}
@@ -65,6 +66,7 @@ function runningAction()
$this->view->titleDirRunningJobs = $this->view->translate->_("Information from Director : List of Running Jobs");
$this->view->resultDirRunningJobs = $jobs->getDirRunningJobs();
$this->view->meta_refresh = 300; // meta http-equiv="refresh"
+ $this->view->show_job_description = Zend_Registry::get('show_job_description');
}
/**
@@ -86,6 +88,7 @@ function runningDashboardAction()
} else {
$this->_helper->viewRenderer->setResponseSegment('job_running');
}
+ $this->view->show_job_description = Zend_Registry::get('show_job_description');
}
@@ -104,6 +107,7 @@ function nextAction()
$jobs = new Job();
$this->view->result = $jobs->getScheduledJobs();
$this->view->meta_refresh = 300; // meta http-equiv="refresh"
+ $this->view->show_job_description = Zend_Registry::get('show_job_description');
}
/**
@@ -127,6 +131,7 @@ function nextDashboardAction()
} else {
$this->_helper->viewRenderer->setResponseSegment('job_next');
}
+ $this->view->show_job_description = Zend_Registry::get('show_job_description');
}
@@ -303,6 +308,7 @@ function problemAction()
$jobs = new Job();
$this->view->result = $jobs->getProblemJobs($last_days);
$this->view->meta_refresh = 300; // meta http-equiv="refresh"
+ $this->view->show_job_description = Zend_Registry::get('show_job_description');
}
/**
@@ -322,6 +328,7 @@ function problemDashboardAction()
} else {
$this->_helper->viewRenderer->setResponseSegment('job_problem');
}
+ $this->view->show_job_description = Zend_Registry::get('show_job_description');
}
/**
@@ -513,11 +520,11 @@ function terminatedDashboardAction()
$this->view->title = $this->view->translate->_("Terminated Jobs (executed in last 24 hours)");
$job = new Job();
$this->view->result = $job->getTerminatedJobs();
- if ( empty($this->view->result) ) {
+ if ( empty($this->view->result) )
$this->_helper->viewRenderer->setNoRender();
- } else {
+ else
$this->_helper->viewRenderer->setResponseSegment('job_terminated');
- }
+ $this->view->show_job_description = Zend_Registry::get('show_job_description');
}
/**
View
13 application/controllers/WbjobdescController.php
@@ -1,8 +1,6 @@
<?php
/**
- * Copyright 2007, 2008, 2009 Yuri Timofeev tim4dev@gmail.com
- *
- * This file is part of Webacula.
+ * Copyright 2007, 2008, 2009, 2011 Yuri Timofeev tim4dev@gmail.com
*
* Webacula is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -53,11 +51,13 @@ public function addAction()
if ( $this->_request->isPost() && ($this->_request->getParam('form1') == '1') ) {
if ( $form->isValid($this->_getAllParams()) ) {
$name_job = stripslashes( trim( $this->_request->getParam('name_job') ) );
+ $short_desc = stripslashes( trim( $this->_request->getParam('short_desc') ) );
$description = stripslashes( trim( $this->_request->getParam('description') ) );
$retention_period = stripslashes( trim( $this->_request->getParam('retention_period') ) );
$table = new wbJobDesc();
$data = array(
- 'name_job' => $name_job,
+ 'name_job' => $name_job,
+ 'short_desc' => $short_desc,
'description' => $description,
'retention_period' => $retention_period
);
@@ -87,11 +87,13 @@ public function modifyAction()
if ( $form->isValid($this->_getAllParams()) ) {
$desc_id = intval( $this->_request->getParam('desc_id') );
$name_job = stripslashes( trim( $this->_request->getParam('name_job') ) );
+ $short_desc = stripslashes( trim( $this->_request->getParam('short_desc') ) );
$description = stripslashes( trim( $this->_request->getParam('description') ) );
$retention_period = stripslashes( trim( $this->_request->getParam('retention_period') ) );
$table = new wbJobDesc();
$data = array(
- 'name_job' => $name_job,
+ 'name_job' => $name_job,
+ 'short_desc' => $short_desc,
'description' => $description,
'retention_period' => $retention_period
);
@@ -121,6 +123,7 @@ public function modifyAction()
$form->populate( array(
'desc_id' => $row->desc_id,
'name_job' => $row->name_job,
+ 'short_desc' => $short_desc,
'description' => $row->description,
'retention_period' => $row->retention_period
));
View
14 application/forms/FormJobdesc.php
@@ -1,8 +1,6 @@
<?php
/**
- * Copyright 2007, 2008, 2009 Yuri Timofeev tim4dev@gmail.com
- *
- * This file is part of Webacula.
+ * Copyright 2007, 2008, 2009, 2011 Yuri Timofeev tim4dev@gmail.com
*
* Webacula is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -53,6 +51,15 @@ public function init()
$name_job->addValidator('StringLength', false, array(0, 64) );
//$name_job->addDecorator('HtmlTag', array('tag' => 'div', 'style'=>'margin-bottom:20px;'));
+ $short_desc = $this->createElement('text', 'short_desc', array(
+ 'label' => $this->translate->_('Short Job Description'),
+ 'required' => true,
+ 'size' => 30,
+ 'maxlength' => 64
+ ));
+ $name_job->addValidator('NotEmpty', false, null );
+ $name_job->addValidator('StringLength', false, array(0, 64) );
+
$description = $this->createElement(
'textarea', 'description', array(
'label' => $this->translate->_('Job Description'),
@@ -82,6 +89,7 @@ public function init()
$hidden_desc_id,
$hidden_form1,
$name_job,
+ $short_desc,
$description,
$retention_period,
$submit
View
2 application/layouts/default/main-menu.phtml
@@ -54,6 +54,7 @@ if ( !$cache->start($this->identity->role_id . '_main_menu') ) :
<li><a href="<?php echo $this->baseUrl;?>/job/problem"><?php print $this->translate->_("Problem"); ?></a></li>
<li><a href="<?php echo $this->baseUrl;?>/job/run-job"><?php print $this->translate->_("Run"); ?></a></li>
<li><a href="<?php echo $this->baseUrl;?>/job/timeline"><?php print $this->translate->_("Timeline"); ?></a></li>
+ <li><a href="<?php echo $this->baseUrl;?>/wbjobdesc/index"><?php print $this->translate->_("Job Descriptions"); ?></a></li>
</ul>
</li>
<li><a href="<?php echo $this->baseUrl;?>/job/find-form"><?php print $this->translate->_("Search"); ?></a></li>
@@ -86,7 +87,6 @@ if ( !$cache->start($this->identity->role_id . '_main_menu') ) :
<li><a href="<?php echo $this->baseUrl;?>/wblogbook/index"><?php print $this->translate->_("Logbook"); ?></a>
<ul>
<li><a href="<?php echo $this->baseUrl;?>/wblogbook/add"><?php print $this->translate->_("Add New Record"); ?></a></li>
- <li><a href="<?php echo $this->baseUrl;?>/wbjobdesc/index"><?php print $this->translate->_("Job Descriptions"); ?></a></li>
<li><a href="<?php echo $this->baseUrl;?>/feed/feed"><?php print $this->translate->_("RSS"); ?></a></li>
</ul>
</li>
View
61 application/models/Job.php
@@ -129,29 +129,30 @@ function getTerminatedJobs()
$select->joinLeft(array('s' => 'Status'), 'j.JobStatus = s.JobStatus', array('JobStatusLong'=>'JobStatusLong'));
break;
case 'PDO_SQLITE':
- // SQLite3 Documentation
- // http://sqlite.org/lang_datefunc.html
- // bug http://framework.zend.com/issues/browse/ZF-884
- // http://sqlite.org/pragma.html
- //$res = $db->query('PRAGMA short_column_names=1'); // not affected
- //$res = $db->query('PRAGMA full_column_names=0'); // not affected
- $select->from(array('j' => 'Job'),
- array('jobid'=>'JobId', 'JobName' => 'Name', 'level'=>'Level', 'clientid'=>'ClientId',
- 'starttime'=>'StartTime', 'endtime'=>'EndTime',
- 'volsessionid'=>'VolSessionId', 'volsessiontime'=>'VolSessionTime', 'jobfiles'=>'JobFiles',
- 'jobbytes'=>'JobBytes', 'joberrors'=>'JobErrors', 'poolid'=>'PoolId',
- 'filesetid'=>'FileSetId', 'purgedfiles'=>'PurgedFiles', 'jobstatus'=>'JobStatus',
- 'type' => 'Type',
- 'DurationTime' => "(strftime('%H:%M:%S',strftime('%s',EndTime) - strftime('%s',StartTime),'unixepoch'))",
- 'reviewed'=>'Reviewed'
- ));
- $select->joinLeft(array('s' => 'Status'), 'j.JobStatus = s.JobStatus', array('jobstatuslong' => 'JobStatusLong'));
- break;
+ // SQLite3 Documentation
+ // http://sqlite.org/lang_datefunc.html
+ // bug http://framework.zend.com/issues/browse/ZF-884
+ // http://sqlite.org/pragma.html
+ //$res = $db->query('PRAGMA short_column_names=1'); // not affected
+ //$res = $db->query('PRAGMA full_column_names=0'); // not affected
+ $select->from(array('j' => 'Job'),
+ array('jobid'=>'JobId', 'JobName' => 'Name', 'level'=>'Level', 'clientid'=>'ClientId',
+ 'starttime'=>'StartTime', 'endtime'=>'EndTime',
+ 'volsessionid'=>'VolSessionId', 'volsessiontime'=>'VolSessionTime', 'jobfiles'=>'JobFiles',
+ 'jobbytes'=>'JobBytes', 'joberrors'=>'JobErrors', 'poolid'=>'PoolId',
+ 'filesetid'=>'FileSetId', 'purgedfiles'=>'PurgedFiles', 'jobstatus'=>'JobStatus',
+ 'type' => 'Type',
+ 'DurationTime' => "(strftime('%H:%M:%S',strftime('%s',EndTime) - strftime('%s',StartTime),'unixepoch'))",
+ 'reviewed'=>'Reviewed'
+ ));
+ $select->joinLeft(array('s' => 'Status'), 'j.JobStatus = s.JobStatus', array('jobstatuslong' => 'JobStatusLong'));
+ break;
}
$select->joinLeft(array('c' => 'Client'), 'j.ClientId = c.ClientId', array('ClientName' => 'Name'));
$select->joinLeft(array('p' => 'Pool'), 'j.PoolId = p.PoolId', array('PoolName' => 'Name'));
$select->joinLeft(array('f' => 'FileSet'), 'j.FileSetId = f.FileSetId');
+ $select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job');
/*
* developers/Database_Tables.html
C Created but not yet running
@@ -240,6 +241,7 @@ function getRunningJobs()
$select->joinLeft(array('s' => 'Status'), 'j.JobStatus = s.JobStatus', array('JobStatusLong' => 'JobStatusLong'));
$select->joinLeft(array('c' => 'Client'), 'j.ClientId = c.ClientId', array('ClientName' => 'Name'));
$select->joinLeft(array('p' => 'Pool'), 'j.PoolId = p.PoolId', array('PoolName' => 'Name'));
+ $select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job');
$select->where("(j.EndTime = 0) OR (j.EndTime IS NULL) OR ".
"(j.JobStatus IN ('C','R','B','e','F','S','m','M','s','j','c','d','t','p','i','a','l','L'))");
$select->where("j.StartTime > ?", $last7day);
@@ -257,6 +259,7 @@ function getRunningJobs()
$select->joinLeft(array('s' => 'Status'), 'j.JobStatus = s.JobStatus', array('JobStatusLong' => 'JobStatusLong'));
$select->joinLeft(array('c' => 'Client'), 'j.ClientId = c.ClientId', array('ClientName' => 'Name'));
$select->joinLeft(array('p' => 'Pool'), 'j.PoolId = p.PoolId', array('PoolName' => 'Name'));
+ $select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job');
$select->where("(j.EndTime IS NULL) OR ".
"(j.JobStatus IN ('C','R','B','e','F','S','m','M','s','j','c','d','t','p','i','a','l','L'))");
$select->where("j.StartTime > ( NOW() - INTERVAL '7 days' )");
@@ -279,6 +282,7 @@ function getRunningJobs()
$select->joinLeft(array('s' => 'Status'), 'j.JobStatus = s.JobStatus', array('jobstatuslong' => 'JobStatusLong'));
$select->joinLeft(array('c' => 'Client'), 'j.ClientId = c.ClientId', array('ClientName' => 'Name'));
$select->joinLeft(array('p' => 'Pool'), 'j.PoolId = p.PoolId', array('PoolName' => 'Name'));
+ $select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job');
$select->where("(datetime(j.EndTime) IS NULL) OR ".
"(j.JobStatus IN ('C','R','B','e','F','S','m','M','s','j','c','d','t','p','i','a','l','L'))");
$select->where("j.StartTime > datetime('now','-7 days')");
@@ -515,7 +519,7 @@ function getScheduledJobs()
// пробуем парсить
$acols = preg_split("/[\s]+/", $line, -1, PREG_SPLIT_NO_EMPTY);
$count = count($acols);
- $aresult[$i]['level'] = $acols[0];
+ $aresult[$i]['level'] = $acols[0][0]; // first letter F(ull), I(nc), D(iff)
$aresult[$i]['type'] = $acols[1];
$aresult[$i]['pri'] = $acols[2];
$aresult[$i]['date'] = $acols[3] . ' ' . $acols[4];
@@ -538,7 +542,24 @@ function getScheduledJobs()
}
}
// do Bacula ACLs
- return $this->bacula_acl->doBaculaAcl( $aresult, 'name', 'job');
+ $aresult_acl = array();
+ $aresult_acl = $this->bacula_acl->doBaculaAcl( $aresult, 'name', 'job');
+ // show short Job description
+ $show_job_description = Zend_Registry::get('show_job_description');
+ if ( $show_job_description > 0 ) {
+ Zend_Loader::loadClass('Wbjobdesc');
+ $wbjobdesc = new Wbjobdesc();
+ foreach ($aresult_acl as &$line) {
+ $where = $wbjobdesc->getAdapter()->quoteInto('name_job = ?', $line['name']);
+ $row = $wbjobdesc->fetchRow($where);
+ if ($row) {
+ $line['short_desc'] = $row->short_desc;
+ }
+ unset($where, $row);
+ }
+ unset($line); /* чтобы последующие записи в $line не меняли последний элемент массива */
+ }
+ return $aresult_acl;
}
View
54 application/views/scripts/job/next-dashboard.phtml
@@ -24,23 +24,67 @@
<table id="box-table-dashboard">
<thead>
<tr>
- <th scope="col"> <?php print $this->translate->_("Level"); ?> </th>
+ <th scope="col">
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ echo $this->translate->_("Job Name");
+ break;
+ case 1 :
+ echo $this->translate->_("Short Job Description");
+ break;
+ case 2 :
+ echo $this->translate->_("Job Name"), ' /<br>',
+ $this->translate->_("Short Job Description");
+ break;
+ default :
+ echo $this->translate->_("Job Name");
+ break;
+ }
+ ?>
+ </th>
+ <th scope="col"> <?php print $this->translate->_("Level"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Type"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Priority"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Scheduled"); ?> </th>
- <th scope="col"> <?php print $this->translate->_("Job Name"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Volume"); ?> </th>
</tr>
</thead>
<tbody>
<?php foreach($this->result as $line) : ?>
<tr>
- <td><?php echo $this->escape($line['level']);?></td>
+ <!-- Job.Name -->
+ <td>
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ // only show Bacula Job Name (behavior as in earlier versions)
+ echo $this->escape($line['name']);
+ break;
+ case 1 :
+ // only show human readable short Job description instead of Bacula Job Name
+ if ( empty($line['short_desc']) )
+ echo '<i>', $this->escape($line['name']), '</i>';
+ else
+ echo $this->escape($line['short_desc']);
+ break;
+ case 2 :
+ // both
+ echo $this->escape($line['name']);
+ if ( !empty($line['short_desc']) )
+ echo '<br><i>', $this->escape($line['short_desc']), '</i>';
+ break;
+ default :
+ echo $this->escape($line['name']);
+ break;
+ }
+ ?>
+ </td>
+
+ <td align="center"><?php echo $this->escape($line['level']);?></td>
<td><?php echo $this->escape($line['type']);?></td>
<td align="center"><?php echo $this->escape($line['pri']);?></td>
<td><?php echo $this->escape($line['date']);?></td>
-
- <td><?php echo $this->escape($line['name']);?></td>
<td>
<?php if ($this->escape($line['vol']) === '*unknown*') : ?>
<?php echo $this->escape($line['vol']); ?>
View
52 application/views/scripts/job/next.phtml
@@ -20,24 +20,68 @@
<caption><?php echo $this->escape($this->title); ?></caption>
<thead>
<tr>
+ <th scope="col">
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ echo $this->translate->_("Job Name");
+ break;
+ case 1 :
+ echo $this->translate->_("Short Job Description");
+ break;
+ case 2 :
+ echo $this->translate->_("Job Name"), ' /<br>',
+ $this->translate->_("Short Job Description");
+ break;
+ default :
+ echo $this->translate->_("Job Name");
+ break;
+ }
+ ?>
+ </th>
<th scope="col"> <?php print $this->translate->_("Level"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Type"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Priority"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Scheduled"); ?> </th>
- <th scope="col"> <?php print $this->translate->_("Job Name"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Volume"); ?> </th>
<th scope="col"> <?php print $this->translate->_("% Free space<br /> on Volume"); ?> </th>
</tr>
</thead>
<tbody>
<?php foreach($this->result as $line) : ?>
<tr>
- <td><?php echo $this->escape($line['level']);?></td>
+ <!-- Job.Name -->
+ <td>
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ // only show Bacula Job Name (behavior as in earlier versions)
+ echo $this->escape($line['name']);
+ break;
+ case 1 :
+ // only show human readable short Job description instead of Bacula Job Name
+ if ( empty($line['short_desc']) )
+ echo '<i>', $this->escape($line['name']), '</i>';
+ else
+ echo $this->escape($line['short_desc']);
+ break;
+ case 2 :
+ // both
+ echo $this->escape($line['name']);
+ if ( !empty($line['short_desc']) )
+ echo '<br><i>', $this->escape($line['short_desc']), '</i>';
+ break;
+ default :
+ echo $this->escape($line['name']);
+ break;
+ }
+ ?>
+ </td>
+
+ <td align="center"><?php echo $this->escape($line['level']);?></td>
<td><?php echo $this->escape($line['type']);?></td>
<td align="center"><?php echo $this->escape($line['pri']);?></td>
<td><?php echo $this->escape($line['date']);?></td>
-
- <td><?php echo $this->escape($line['name']);?></td>
<td>
<?php if ($this->escape($line['vol']) === '*unknown*') : ?>
<?php echo $this->escape($line['vol']); ?>
View
48 application/views/scripts/job/problem-dashboard.phtml
@@ -12,7 +12,25 @@
<tr>
<th scope="col">&nbsp;</th>
<th scope="col"> <?php print $this->translate->_("Id"); ?> </th>
- <th scope="col"> <?php print $this->translate->_("Job Name"); ?> </th>
+ <th scope="col">
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ echo $this->translate->_("Job Name");
+ break;
+ case 1 :
+ echo $this->translate->_("Short Job Description");
+ break;
+ case 2 :
+ echo $this->translate->_("Job Name"), ' /<br>',
+ $this->translate->_("Short Job Description");
+ break;
+ default :
+ echo $this->translate->_("Job Name");
+ break;
+ }
+ ?>
+ </th>
<th scope="col"> <?php print $this->translate->_("Status"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Level"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Files"); ?> </th>
@@ -51,7 +69,33 @@
</td>
<!-- Job.Name -->
- <td><?php echo $this->escape($line['jobname']);?></td>
+ <!-- Job.Name -->
+ <td>
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ // only show Bacula Job Name (behavior as in earlier versions)
+ echo $this->escape($line['jobname']);
+ break;
+ case 1 :
+ // only show human readable short Job description instead of Bacula Job Name
+ if ( empty($line['short_desc']) )
+ echo '<i>', $this->escape($line['jobname']), '</i>';
+ else
+ echo $this->escape($line['short_desc']);
+ break;
+ case 2 :
+ // both
+ echo $this->escape($line['jobname']);
+ if ( !empty($line['short_desc']) )
+ echo '<br><i>', $this->escape($line['short_desc']), '</i>';
+ break;
+ default :
+ echo $this->escape($line['jobname']);
+ break;
+ }
+ ?>
+ </td>
<!-- Status -->
<?php
View
47 application/views/scripts/job/problem.phtml
@@ -8,7 +8,25 @@
<tr>
<th scope="col">&nbsp;</th>
<th scope="col"> <?php print $this->translate->_("Job Id"); ?> </th>
- <th scope="col"> <?php print $this->translate->_("Job Name"); ?> </th>
+ <th scope="col">
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ echo $this->translate->_("Job Name");
+ break;
+ case 1 :
+ echo $this->translate->_("Short Job Description");
+ break;
+ case 2 :
+ echo $this->translate->_("Job Name"), ' /<br>',
+ $this->translate->_("Short Job Description");
+ break;
+ default :
+ echo $this->translate->_("Job Name");
+ break;
+ }
+ ?>
+ </th>
<th scope="col"> <?php print $this->translate->_("Status"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Level"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Files"); ?> </th>
@@ -52,7 +70,32 @@
</td>
<!-- Job.Name -->
- <td><?php echo $this->escape($line['jobname']);?></td>
+ <td>
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ // only show Bacula Job Name (behavior as in earlier versions)
+ echo $this->escape($line['jobname']);
+ break;
+ case 1 :
+ // only show human readable short Job description instead of Bacula Job Name
+ if ( empty($line['short_desc']) )
+ echo '<i>', $this->escape($line['jobname']), '</i>';
+ else
+ echo $this->escape($line['short_desc']);
+ break;
+ case 2 :
+ // both
+ echo $this->escape($line['jobname']);
+ if ( !empty($line['short_desc']) )
+ echo '<br><i>', $this->escape($line['short_desc']), '</i>';
+ break;
+ default :
+ echo $this->escape($line['jobname']);
+ break;
+ }
+ ?>
+ </td>
<!-- Status -->
<?php
View
99 application/views/scripts/job/running-dashboard.phtml
@@ -27,7 +27,25 @@
<tr>
<th scope="col"> <?php print $this->translate->_("Id"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Level"); ?> </th>
- <th scope="col"> <?php print $this->translate->_("Job Name"); ?> </th>
+ <th scope="col">
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ echo $this->translate->_("Job Name");
+ break;
+ case 1 :
+ echo $this->translate->_("Short Job Description");
+ break;
+ case 2 :
+ echo $this->translate->_("Job Name"), ' /<br>',
+ $this->translate->_("Short Job Description");
+ break;
+ default :
+ echo $this->translate->_("Job Name");
+ break;
+ }
+ ?>
+ </th>
<th scope="col"> <?php print $this->translate->_("Status"); ?> </th>
</tr>
</thead>
@@ -40,11 +58,37 @@
</a>
</td>
<td><?php echo $this->escape($line['level']);?></td>
- <td><?php echo $this->escape($line['name']);?></td>
+ <!-- Job Name -->
+ <td>
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ // only show Bacula Job Name (behavior as in earlier versions)
+ echo $this->escape($line['name']);
+ break;
+ case 1 :
+ // only show human readable short Job description instead of Bacula Job Name
+ if ( empty($line['short_desc']) )
+ echo '<i>', $this->escape($line['name']), '</i>';
+ else
+ echo $this->escape($line['short_desc']);
+ break;
+ case 2 :
+ // both
+ echo $this->escape($line['name']);
+ if ( !empty($line['short_desc']) )
+ echo '<br><i>', $this->escape($line['short_desc']), '</i>';
+ break;
+ default :
+ echo $this->escape($line['name']);
+ break;
+ }
+ ?>
+ </td>
<td><?php echo $this->escape($line['status']);?></td>
</tr>
<?php endforeach; ?>
-<tbody>
+</tbody>
</table>
<?php
@@ -77,7 +121,25 @@
<thead>
<tr>
<th scope="col"> <?php print $this->translate->_("Id"); ?> </th>
- <th scope="col"> <?php print $this->translate->_("Job Name"); ?> </th>
+ <th scope="col">
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ echo $this->translate->_("Job Name");
+ break;
+ case 1 :
+ echo $this->translate->_("Short Job Description");
+ break;
+ case 2 :
+ echo $this->translate->_("Job Name"), ' /<br>',
+ $this->translate->_("Short Job Description");
+ break;
+ default :
+ echo $this->translate->_("Job Name");
+ break;
+ }
+ ?>
+ </th>
<th scope="col"> <?php print $this->translate->_("Status"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Level"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Errors"); ?> </th>
@@ -93,7 +155,34 @@
<?php echo $this->escape($line['jobid']);?>
</a>
</td>
- <td><?php echo $this->escape($line['jobname']);?></td>
+ <!-- Job Name -->
+ <td>
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ // only show Bacula Job Name (behavior as in earlier versions)
+ echo $this->escape($line['jobname']);
+ break;
+ case 1 :
+ // only show human readable short Job description instead of Bacula Job Name
+ if ( empty($line['short_desc']) )
+ echo '<i>', $this->escape($line['jobname']), '</i>';
+ else
+ echo $this->escape($line['short_desc']);
+ break;
+ case 2 :
+ // both
+ echo $this->escape($line['jobname']);
+ if ( !empty($line['short_desc']) )
+ echo '<br><i>', $this->escape($line['short_desc']), '</i>';
+ break;
+ default :
+ echo $this->escape($line['jobname']);
+ break;
+ }
+ ?>
+ </td>
+
<?php
if ( $this->escape($line['joberrors']) != 0 ) {
echo '<td class="err" align="center"> ',
View
98 application/views/scripts/job/running.phtml
@@ -22,7 +22,24 @@
<tr>
<th scope="col"> <?php print $this->translate->_("Job Id"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Level"); ?> </th>
- <th scope="col"> <?php print $this->translate->_("Job Name"); ?> </th>
+ <th scope="col">
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ echo $this->translate->_("Job Name");
+ break;
+ case 1 :
+ echo $this->translate->_("Short Job Description");
+ break;
+ case 2 :
+ echo $this->translate->_("Job Name"), ' /<br>',
+ $this->translate->_("Short Job Description");
+ break;
+ default :
+ echo $this->translate->_("Job Name");
+ break;
+ }
+ ?> </th>
<th scope="col"> <?php print $this->translate->_("Status"); ?> </th>
</tr>
</thead>
@@ -35,7 +52,35 @@
</a>
</td>
<td><?php echo $this->escape($line['level']);?></td>
- <td><?php echo $this->escape($line['name']);?></td>
+
+ <!-- Job Name -->
+ <td>
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ // only show Bacula Job Name (behavior as in earlier versions)
+ echo $this->escape($line['name']);
+ break;
+ case 1 :
+ // only show human readable short Job description instead of Bacula Job Name
+ if ( empty($line['short_desc']) )
+ echo '<i>', $this->escape($line['name']), '</i>';
+ else
+ echo $this->escape($line['short_desc']);
+ break;
+ case 2 :
+ // both
+ echo $this->escape($line['name']);
+ if ( !empty($line['short_desc']) )
+ echo '<br><i>', $this->escape($line['short_desc']), '</i>';
+ break;
+ default :
+ echo $this->escape($line['name']);
+ break;
+ }
+ ?>
+ </td>
+
<td><?php echo $this->escape($line['status']);?></td>
</tr>
<?php endforeach; ?>
@@ -69,7 +114,24 @@
<thead>
<tr>
<th scope="col"> <?php print $this->translate->_("Job Id"); ?> </th>
- <th scope="col"> <?php print $this->translate->_("Job Name"); ?> </th>
+ <th scope="col">
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ echo $this->translate->_("Job Name");
+ break;
+ case 1 :
+ echo $this->translate->_("Short Job Description");
+ break;
+ case 2 :
+ echo $this->translate->_("Job Name"), ' /<br>',
+ $this->translate->_("Short Job Description");
+ break;
+ default :
+ echo $this->translate->_("Job Name");
+ break;
+ }
+ ?> </th>
<th scope="col"> <?php print $this->translate->_("Status"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Level"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Errors"); ?> </th>
@@ -88,7 +150,35 @@
<?php echo $this->escape($line['jobid']);?>
</a>
</td>
- <td><?php echo $this->escape($line['jobname']);?></td>
+
+ <!-- Job Name -->
+ <td>
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ // only show Bacula Job Name (behavior as in earlier versions)
+ echo $this->escape($line['jobname']);
+ break;
+ case 1 :
+ // only show human readable short Job description instead of Bacula Job Name
+ if ( empty($line['short_desc']) )
+ echo '<i>', $this->escape($line['jobname']), '</i>';
+ else
+ echo $this->escape($line['short_desc']);
+ break;
+ case 2 :
+ // both
+ echo $this->escape($line['jobname']);
+ if ( !empty($line['short_desc']) )
+ echo '<br><i>', $this->escape($line['short_desc']), '</i>';
+ break;
+ default :
+ echo $this->escape($line['jobname']);
+ break;
+ }
+ ?>
+ </td>
+
<?php
if ( $this->escape($line['joberrors']) != 0 ) {
echo '<td class="err" align="center"> ',
View
45 application/views/scripts/job/terminated-dashboard.phtml
@@ -14,7 +14,24 @@
<th scope="col">&nbsp;</th>
<th scope="col">&nbsp;</th>
<th scope="col"> <?php print $this->translate->_("Id"); ?> </th>
- <th scope="col"> <?php print $this->translate->_("Job Name"); ?> </th>
+ <th scope="col">
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ echo $this->translate->_("Job Name");
+ break;
+ case 1 :
+ echo $this->translate->_("Short Job Description");
+ break;
+ case 2 :
+ echo $this->translate->_("Job Name"), ' /<br>',
+ $this->translate->_("Short Job Description");
+ break;
+ default :
+ echo $this->translate->_("Job Name");
+ break;
+ }
+ ?> </th>
<th scope="col"> <?php print $this->translate->_("Status"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Level"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Files"); ?> </th>
@@ -56,7 +73,31 @@
</td>
<!-- Job.Name -->
- <td><?php echo $this->escape($line['jobname']);?></td>
+ <td><?php
+ switch ($this->show_job_description) {
+ case 0 :
+ // only show Bacula Job Name (behavior as in earlier versions)
+ echo $this->escape($line['jobname']);
+ break;
+ case 1 :
+ // only show human readable short Job description instead of Bacula Job Name
+ if ( empty($line['short_desc']) )
+ echo '<i>', $this->escape($line['jobname']), '</i>';
+ else
+ echo $this->escape($line['short_desc']);
+ break;
+ case 2 :
+ // both
+ echo $this->escape($line['jobname']);
+ if ( !empty($line['short_desc']) )
+ echo '<br><i>', $this->escape($line['short_desc']), '</i>';
+ break;
+ default :
+ echo $this->escape($line['jobname']);
+ break;
+ }
+ ?>
+ </td>
<!-- Status -->
<?php
View
47 application/views/scripts/job/terminated.phtml
@@ -9,7 +9,25 @@
<th scope="col">&nbsp;</th>
<th scope="col">&nbsp;</th>
<th scope="col"> <?php print $this->translate->_("Job Id"); ?> </th>
- <th scope="col"> <?php print $this->translate->_("Job Name"); ?> </th>
+ <th scope="col">
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ echo $this->translate->_("Job Name");
+ break;
+ case 1 :
+ echo $this->translate->_("Short Job Description");
+ break;
+ case 2 :
+ echo $this->translate->_("Job Name"), ' /<br>',
+ $this->translate->_("Short Job Description");
+ break;
+ default :
+ echo $this->translate->_("Job Name");
+ break;
+ }
+ ?>
+ </th>
<th scope="col"> <?php print $this->translate->_("Status"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Level"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Files"); ?> </th>
@@ -58,7 +76,32 @@
</td>
<!-- Job.Name -->
- <td><?php echo $this->escape($line['jobname']);?> </td>
+ <td>
+ <?php
+ switch ($this->show_job_description) {
+ case 0 :
+ // only show Bacula Job Name (behavior as in earlier versions)
+ echo $this->escape($line['jobname']);
+ break;
+ case 1 :
+ // only show human readable short Job description instead of Bacula Job Name
+ if ( empty($line['short_desc']) )
+ echo '<i>', $this->escape($line['jobname']), '</i>';
+ else
+ echo $this->escape($line['short_desc']);
+ break;
+ case 2 :
+ // both
+ echo $this->escape($line['jobname']);
+ if ( !empty($line['short_desc']) )
+ echo '<br><i>', $this->escape($line['short_desc']), '</i>';
+ break;
+ default :
+ echo $this->escape($line['jobname']);
+ break;
+ }
+ ?>
+ </td>
<!-- Status -->
<?php
View
6 application/views/scripts/wbjobdesc/index.phtml
@@ -34,11 +34,12 @@ $(document).ready(
<?php if ($this->result): ?>
-<table id="box-table-wbjobdesc" border="0" width="70%">
+<table id="box-table-wbjobdesc" border="0" width="80%">
<thead>
<tr>
<th scope="col">&nbsp;</th>
- <th scope="col" width="35%"> <?php print $this->translate->_("Job Name"); ?> </th>
+ <th scope="col" width="20%"> <?php print $this->translate->_("Job Name"); ?> </th>
+ <th scope="col"> <?php print $this->translate->_("Short Job Description"); ?> </th>
<th scope="col"> <?php print $this->translate->_("Job Description"); ?> </th>
<th scope="col" width="10%"> <?php print $this->translate->_("Retention period"); ?> </th>
<th scope="col" width="50px">&nbsp;</th>
@@ -59,6 +60,7 @@ $(document).ready(
?>
</td>
<td><?php echo $line['name_job'] ?></td>
+ <td><?php echo $line['short_desc'] ?></td>
<td><?php echo $line['description'] ?></td>
<td><?php echo $line['retention_period'] ?></td>
<td>
View
18 docs/src/install.tex
@@ -34,7 +34,7 @@
}
\author{
\begin{small}
- Copyright 2007, 2008, 2009, 2010, 2011
+ Copyright 2007, 2008, 2009, 2010, 2011, 2012
Yuri Timofeev \htmladdnormallink{tim4dev@gmail.com}{mailto:tim4dev@gmail.com}
\end{small}
}
@@ -457,5 +457,21 @@ \section{Update from prior version}
The script \texttt{webacula\_clean\_tmp\_files.sh} is not necessary now.
+\textbf{Update from 5.5.1 to 5.5.2}
+
+Update the code as usual.
+And make changes to the database schema (for example, MySQL)
+
+\begin{verbatim}
+ALTER TABLE webacula_jobdesc ADD COLUMN short_desc CHAR(64) NOT NULL;
+CREATE INDEX webacula_idx3 ON webacula_jobdesc (short_desc);
+\end{verbatim}
+
+Change \texttt{application/config.ini} if necessary:
+
+\begin{verbatim}
+;; Show human readable short Job description instead of Job Bacula names
+show_job_description = 1
+\end{verbatim}
\end{document}
View
16 html/index.php
@@ -1,7 +1,7 @@
<?php
/**
*
- * Copyright 2007, 2008, 2009, 2010, 2011 Yuri Timofeev tim4dev@gmail.com
+ * Copyright 2007, 2008, 2009, 2010, 2011, 2012 Yuri Timofeev <tim4dev@gmail.com>
*
* This program is free software: you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation, either version 3 of the License,
@@ -18,7 +18,7 @@
*
*/
-define('WEBACULA_VERSION', '5.5.1' . ', build 2011.10.28');
+define('WEBACULA_VERSION', '5.5.2' . ', build 2011.10.28');
define('BACULA_VERSION', 12); // Bacula Catalog version
define('ROOT_DIR', dirname(dirname(__FILE__)) );
@@ -97,12 +97,10 @@
Zend_Registry::set('ERR_VOLUME', -1);
/**
- *
* Database, table, field and columns names in PostgreSQL are case-independent, unless you created them with double-quotes
* around their name, in which case they are case-sensitive.
* Note: that PostgreSQL actively converts all non-quoted names to lower case and so returns lower case in query results.
* In MySQL, table names can be case-sensitive or not, depending on which operating system you are using.
- *
*/
// setup database bacula
@@ -164,6 +162,16 @@
$registry->set('locale', $locale);
$registry->set('language', $locale->getLanguage());
+// Show human readable short Job description instead of Job Bacula names
+if ( isset($config->general->show_job_description) ) {
+ if ( ( $config->general->show_job_description < 0 ) || ( $config->general->show_job_description > 2 ) )
+ $show_job_description = 0;
+ else
+ $show_job_description = $config->general->show_job_description;
+} else
+ $show_job_description = 0;
+$registry->set('show_job_description', $show_job_description);
+
Zend_Layout::startMvc(array(
'layoutPath' => '../application/layouts/' . $config->layout->path,
'layout' => 'main'
View
5 html/styles/default/wbjobdesc.css
@@ -6,7 +6,7 @@
font-family: "Lucida Grande", Helvetica, verdana, sans-serif;
background-color:#fff;
border-collapse: collapse;
- width: 60%;
+ width: 80%;
line-height: 1.2em;
}
#box-table-wbjobdesc caption {
@@ -73,11 +73,12 @@ label {
}
div.roundcorner-wjd {
- width: 34em;
+ width: 38em;
padding: 10px;
text-align: left;
margin-top: 30px;
margin-bottom: 20px;
color: #000;
background: #d0ffbd;
+ font-family: 'Times New Roman',Times,serif;
}
View
2 html/styles/default/wblogbook.css
@@ -87,7 +87,7 @@ label {
}
div.roundcorner-wlb {
- width: 55em;
+ width: 57em;
padding: 20px;
text-align: left;
margin-top: 30px;
View
4 install/MySql/10_make_tables.sh
@@ -52,9 +52,11 @@ CREATE TABLE IF NOT EXISTS webacula_jobdesc (
desc_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
name_job CHAR(64) UNIQUE NOT NULL,
retention_period CHAR(32),
+ short_desc CHAR(64) NOT NULL,
description TEXT NOT NULL,
PRIMARY KEY(desc_id),
- INDEX (name_job)
+ INDEX (name_job),
+ INDEX (short_desc)
);
View
2 install/PostgreSql/10_make_tables.sh
@@ -43,10 +43,12 @@ CREATE TABLE webacula_jobdesc (
desc_id SERIAL,
name_job CHAR(64) UNIQUE NOT NULL,
retention_period CHAR(32),
+ short_desc CHAR(64) NOT NULL,
description TEXT NOT NULL,
PRIMARY KEY(desc_id)
);
CREATE INDEX webacula_idx2 ON webacula_jobdesc (name_job);
+CREATE INDEX webacula_idx3 ON webacula_jobdesc (short_desc);
CREATE TABLE webacula_version (
versionId INTEGER NOT NULL
View
2 install/SqLite/10_make_tables.sh
@@ -39,10 +39,12 @@ CREATE TABLE webacula_jobdesc (
desc_id INTEGER,
name_job CHAR(64) UNIQUE NOT NULL,
retention_period CHAR(32),
+ short_desc CHAR(64) NOT NULL,
description TEXT NOT NULL,
PRIMARY KEY(desc_id)
);
CREATE INDEX webacula_idx2 ON webacula_jobdesc(name_job);
+CREATE INDEX webacula_idx3 ON webacula_jobdesc(short_desc);
CREATE TABLE webacula_version (
View
5 packaging/Fedora/webacula.spec
@@ -1,5 +1,5 @@
Name: webacula
-Version: 5.5.1
+Version: 5.5.2
Release: 1%{?dist}
Summary: Web interface of a Bacula backup system
Summary(ru): Веб интерфейс для Bacula backup system
@@ -105,6 +105,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Sat Oct 29 2011 Yuri Timofeev <tim4dev@gmail.com> 5.5.2-1
+- Version 5.5.2
+
* Sat Sep 10 2011 Yuri Timofeev <tim4dev@gmail.com> 5.5.1-1
- Version 5.5.1
View
14 tests/application/bootstrap.php
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 2009, 2010, 2011 Yuri Timofeev tim4dev@gmail.com
+ * Copyright 2009, 2010, 2011, 2012 Yuri Timofeev <tim4dev@gmail.com>
* @author Yuri Timofeev <tim4dev@gmail.com>
* @package webacula
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU Public License
@@ -72,12 +72,10 @@
Zend_Registry::set('ERR_VOLUME', -1);
/**
- *
* Database, table, field and columns names in PostgreSQL are case-independent, unless you created them with double-quotes
* around their name, in which case they are case-sensitive.
* Note: that PostgreSQL actively converts all non-quoted names to lower case and so returns lower case in query results.
* In MySQL, table names can be case-sensitive or not, depending on which operating system you are using.
- *
*/
// setup database bacula
@@ -135,6 +133,16 @@
$registry->set('locale', $locale);
$registry->set('language', $locale->getLanguage());
+// Show human readable short Job description instead of Job Bacula names
+if ( isset($config->general->show_job_description) ) {
+ if ( ( $config->general->show_job_description < 0 ) || ( $config->general->show_job_description > 2 ) )
+ $show_job_description = 0;
+ else
+ $show_job_description = $config->general->show_job_description;
+} else
+ $show_job_description = 0;
+$registry->set('show_job_description', $show_job_description);
+
Zend_Layout::startMvc(array(
'layoutPath' => $appRoot . '/application/layouts/' . $config->layout->path,
'layout' => 'main'
View
1 tests/application/controllers/WbjobdescControllerTest.php
@@ -16,6 +16,7 @@ public function testAdd()
$this->request->setPost(array(
'form1' => 1,
'name_job' => 'job name test 2',
+ 'short_desc' => 'short description',
'description' => "PHPUnit test $description\njob description\n",
'retention_period' => '3 years'
));
View
1 tests/application/models/WbjobdescTest.php
@@ -42,6 +42,7 @@ public function testInsertAndUpdateRecord ()
// insert
$data = array(
'name_job' => 'job.name.test.1',
+ 'short_desc' => 'Important billing DB',
'description' => 'PHPUnit test',
'retention_period' => '3 days'
);
View
3 tests/conf/config.ini.mysql
@@ -40,6 +40,9 @@ bacula.bconsolecmd = "-n -c /etc/bacula/bconsole.conf"
; Jobs with errors (last NN day(s)
; days_to_show_jobs_with_errors = 7
+;; Show human readable short Job description instead of Job Bacula names (default = 0)
+; show_job_description = 0
+
[timeline]
gdfontpath = "/usr/share/fonts/dejavu"
fontname = "DejaVuLGCSansMono"
View
3 tests/conf/config.ini.pgsql
@@ -40,6 +40,9 @@ bacula.bconsolecmd = "-n -c /etc/bacula/bconsole.conf"
; Jobs with errors (last NN day(s)
; days_to_show_jobs_with_errors = 7
+;; Show human readable short Job description instead of Job Bacula names (default = 0)
+; show_job_description = 0
+
[timeline]
gdfontpath = "/usr/share/fonts/dejavu"
fontname = "DejaVuLGCSansMono"
View
3 tests/conf/config.ini.sqlite
@@ -39,6 +39,9 @@ bacula.bconsolecmd = "-n -c /etc/bacula/bconsole.conf"
; Jobs with errors (last NN day(s)
; days_to_show_jobs_with_errors = 7
+;; Show human readable short Job description instead of Job Bacula names (default = 0)
+; show_job_description = 0
+
[timeline]
gdfontpath = "/usr/share/fonts/dejavu"
fontname = "DejaVuLGCSansMono"
View
23 tests/prepare_tests/MySql/25_webacula_fill_jobdesc
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Job descriptions
+#
+
+if mysql -f <<END-OF-DATA
+
+USE bacula;
+
+INSERT INTO webacula_jobdesc (name_job, retention_period, short_desc, description)
+ VALUES ('not.exists.job', '1', 'This Job not exists', 'Specially for unit tests');
+
+INSERT INTO webacula_jobdesc (name_job, retention_period, short_desc, description)
+ VALUES ('job.name.test.4', '3', 'Описание Задания', 'Specially for unit tests');
+
+END-OF-DATA
+then
+ echo "succeeded."
+else
+ echo "failed."
+fi
+
+exit 0
View
21 tests/prepare_tests/PostgreSql/35_webacula_fill_jobdesc
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Job descriptions
+#
+
+if /usr/bin/psql -q -f - -d bacula <<END-OF-DATA
+
+INSERT INTO webacula_jobdesc (name_job, retention_period, short_desc, description)
+ VALUES ('not.exists.job', '1', 'This Job not exists', 'Specially for unit tests');
+
+INSERT INTO webacula_jobdesc (name_job, retention_period, short_desc, description)
+ VALUES ('job.name.test.4', '3', 'Описание Задания', 'Specially for unit tests');
+
+END-OF-DATA
+then
+ echo "PostgreSql : fill logbook succeeded"
+else
+ echo "PostgreSql : fill logbook failed !"
+fi
+
+exit 0
View
21 tests/prepare_tests/SqLite/25_webacula_fill_jobdesc
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Job descriptions
+#
+
+db_name="/tmp/webacula/sqlite/bacula.db"
+
+/usr/bin/sqlite3 $* ${db_name} <<END-OF-DATA
+
+INSERT INTO webacula_jobdesc (name_job, retention_period, short_desc, description)
+ VALUES ('not.exists.job', '1', 'This Job not exists', 'Specially for unit tests');
+
+INSERT INTO webacula_jobdesc (name_job, retention_period, short_desc, description)
+ VALUES ('job.name.test.4', '3', 'Описание Задания', 'Specially for unit tests');
+
+END-OF-DATA
+
+
+echo "Sqlite : logbook fill OK"
+
+exit 0
View
1 tests/prepare_tests/prepare.sh
@@ -357,6 +357,7 @@ fi
my_log "MySQL : fill webacula logbook"
cd ${BASEDIR}
sh ./MySql/20_webacula_fill_logbook
+sh ./MySql/25_webacula_fill_jobdesc
sh ./MySql/30_webacula_fill_acl
sh ./MySql/40_bacula_fill_log
View
2 tests/prepare_tests/sync_bacula_db_from_mysql2others.sh
@@ -91,6 +91,7 @@ sh ./10_make_tables.sh
sh ./20_acl_make_tables.sh
cd ${BASEDIR}
sh ./PostgreSql/30_webacula_fill_logbook
+sh ./PostgreSql/35_webacula_fill_jobdesc
sh ./PostgreSql/40_webacula_fill_acl
cd ${BASEDIR}
@@ -100,6 +101,7 @@ sh ./10_make_tables.sh /tmp/webacula/sqlite/bacula.db
sh ./20_acl_make_tables.sh /tmp/webacula/sqlite/bacula.db
cd ${BASEDIR}
sh ./SqLite/20_webacula_fill_logbook
+sh ./SqLite/25_webacula_fill_jobdesc
sh ./SqLite/30_webacula_fill_acl
my_log "Copy DB from MySQL to PGSQL ..."

0 comments on commit 2b1e703

Please sign in to comment.
Something went wrong with that request. Please try again.