Skip to content

Commit 9bde82f

Browse files
author
Marius Cramer
committed
Merge branch 'master' into 'master'
Master See merge request !155
2 parents b82b993 + 02872aa commit 9bde82f

File tree

7 files changed

+164
-15
lines changed

7 files changed

+164
-15
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
require_once '../../lib/config.inc.php';
3+
require_once '../../lib/app.inc.php';
4+
5+
$list_def_file = 'list/backup_stats.list.php';
6+
7+
/******************************************
8+
* End Form configuration
9+
******************************************/
10+
11+
//* Check permissions for module
12+
$app->auth->check_module_permissions('sites');
13+
14+
$app->load('listform_actions','functions');
15+
16+
class list_action extends listform_actions {
17+
18+
public function prepareDataRow($rec)
19+
{
20+
global $app;
21+
22+
$rec = parent::prepareDataRow($rec);
23+
24+
$rec['active'] = "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>";
25+
if ($rec['backup_interval'] === 'none') {
26+
$rec['active'] = "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>";
27+
$rec['backup_copies'] = 0;
28+
}
29+
$recBackup = $app->db->queryOneRecord('SELECT COUNT(backup_id) AS backup_count FROM mail_backup WHERE mailuser_id = ?', $rec['mailuser_id']);
30+
$rec['backup_copies_exists'] = $recBackup['backup_count'];
31+
32+
return $rec;
33+
}
34+
}
35+
36+
$list = new list_action;
37+
$list->SQLExtWhere = "";
38+
$list->onLoad();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
$wb["list_head_txt"] = 'Backup Statistiken';
3+
$wb["database_name_txt"] = '';
4+
$wb['active_txt'] = 'Aktiv';
5+
$wb['domain_txt'] = 'Email';
6+
$wb['backup_count_txt'] = 'Anz. Backups';
7+
$wb['backup_server_txt'] = 'Server';
8+
$wb['backup_interval_txt'] = 'Intervall / Anz.';
9+
?>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
$wb["list_head_txt"] = 'Backup Stats';
3+
$wb["database_name_txt"] = '';
4+
$wb['active_txt'] = 'Active';
5+
$wb['domain_txt'] = 'Email';
6+
$wb['backup_count_txt'] = 'Backup count';
7+
$wb['backup_server_txt'] = 'Server';
8+
$wb['backup_interval_txt'] = 'Interval / cnt.';
9+
?>

interface/web/mail/lib/module.conf.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@
164164
'target' => 'content',
165165
'link' => 'mail/mail_user_stats.php',
166166
'html_id' => 'mail_user_stats');
167-
167+
$items[] = array (
168+
'title' => 'Backup Stats',
169+
'target' => 'content',
170+
'link' => 'mail/backup_stats.php',
171+
'html_id' => 'backup_stats');
168172

169173

170174
$module['nav'][] = array( 'title' => 'Statistics',
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
// Name of the list
3+
$liste["name"] = "backup_stats";
4+
5+
// Database table
6+
//$liste["table"] = "mail_domain";
7+
$liste["table"] = "mail_user";
8+
9+
// Index index field of the database table
10+
//$liste["table_idx"] = "domain_id";
11+
$liste["table_idx"] = "mailuser_id";
12+
13+
// Search Field Prefix
14+
$liste["search_prefix"] = "search_";
15+
16+
// Records per page
17+
$liste["records_per_page"] = "15";
18+
19+
// Script File of the list
20+
$liste["file"] = "backup_stats.php";
21+
22+
// Script file of the edit form
23+
$liste["edit_file"] = "backup_stats_edit.php";
24+
25+
// Paging Template
26+
$liste["paging_tpl"] = "templates/paging.tpl.htm";
27+
28+
// Enable auth
29+
$liste["auth"] = "yes";
30+
31+
// mark columns for php sorting (no real mySQL columns)
32+
$liste["phpsort"] = array('used_sort', 'files');
33+
34+
35+
/*****************************************************
36+
* Suchfelder
37+
*****************************************************/
38+
39+
$liste['item'][] = array (
40+
'field' => 'server_id',
41+
'datatype' => 'INTEGER',
42+
'formtype' => 'SELECT',
43+
'op' => '=',
44+
'prefix' => '',
45+
'width' => '',
46+
'value' => '',
47+
'suffix' => '',
48+
'datasource' => array (
49+
'type' => 'SQL',
50+
'querystring' => 'SELECT a.server_id, a.server_name FROM server a, mail_domain b WHERE (a.server_id = b.server_id) ORDER BY a.server_name',
51+
'keyfield' => 'server_id',
52+
'valuefield' => 'server_name'
53+
)
54+
);
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<div class='page-header'>
2+
<h1><tmpl_var name="list_head_txt"></h1>
3+
</div>
4+
<p><tmpl_var name="list_desc_txt"></p>
5+
6+
7+
<p class="fieldset-legend"><tmpl_var name="list_head_txt"></p>
8+
<div class="table-wrapper marginTop15">
9+
<table class="table">
10+
<thead class="dark form-group-sm">
11+
<tr>
12+
<th class="tiny-col" data-column="active"><tmpl_var name="active_txt"></th>
13+
<th data-column="domain"><tmpl_var name="domain_txt"></th>
14+
<th data-column="backup_server"><tmpl_var name="backup_server_txt"></th>
15+
<th data-column="backup_interval"><tmpl_var name="backup_interval_txt"></th>
16+
<th data-column="backup_count"><tmpl_var name="backup_count_txt"></th>
17+
</tr>
18+
</thead>
19+
<tbody>
20+
<tmpl_loop name="records">
21+
<tr class="tbl_row_{tmpl_if name='__EVEN__'}even{tmpl_else}uneven{/tmpl_if}">
22+
<td> <a href="#" data-load-content="mail/mail_user_edit.php?id={tmpl_var name='id'}">{tmpl_var name="active"}</a> </td>
23+
<td> <a href="#" data-load-content="mail/mail_user_edit.php?id={tmpl_var name='id'}">{tmpl_var name="domain"}</a> </td>
24+
<td> <a href="#" data-load-content="mail/mail_user_edit.php?id={tmpl_var name='id'}">{tmpl_var name="server_id"}</a> </td>
25+
<td> <a href="#" data-load-content="mail/mail_user_edit.php?id={tmpl_var name='id'}">{tmpl_var name="backup_interval"}</a> / <a href="#" data-load-content="mail/mail_user_edit.php?id={tmpl_var name='id'}">{tmpl_var name="backup_copies"}</a> </td>
26+
<td> <a href="#" data-load-content="mail/mail_user_edit.php?id={tmpl_var name='id'}">{tmpl_var name="backup_copies_exists"}</a> </td>
27+
</tr>
28+
</tmpl_loop>
29+
</tbody>
30+
<tfoot>
31+
<tr>
32+
<td colspan="5">
33+
<tmpl_var name="paging">
34+
</td>
35+
</tr>
36+
</tfoot>
37+
</table>
38+
</div>
39+
40+
</div>
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
<?php
22
$wb['head_txt'] = 'Outil de Resynchronisation';
33
$wb['legend_txt'] = 'Resynchroniser';
4-
$wb['Resynchroniser_sites_txt'] = 'Resynchroniser Sites web';
5-
$wb['Resynchroniser_ftp_txt'] = 'Resynchroniser utilisateurs FTP';
6-
$wb['Resynchroniser_shell_txt'] = 'Resynchroniser utilisateurs shell';
7-
$wb['Resynchroniser_cron_txt'] = 'Resynchroniser cronjobs';
8-
$wb['Resynchroniser_db_txt'] = 'Resynchroniser configuration clientdb';
9-
$wb['Resynchroniser_mailbox_txt'] = 'Resynchroniser Boites aux lettres';
10-
$wb['Resynchroniser_dkim_txt'] = 'Resynchroniser DKIM-Keys';
11-
$wb['Resynchroniser_dns_txt'] = 'Resynchroniser enregistrements DNS';
4+
$wb['resync_sites_txt'] = 'Resynchroniser Sites web';
5+
$wb['resync_ftp_txt'] = 'Resynchroniser utilisateurs FTP';
6+
$wb['resync_shell_txt'] = 'Resynchroniser utilisateurs shell';
7+
$wb['resync_cron_txt'] = 'Resynchroniser cronjobs';
8+
$wb['resync_db_txt'] = 'Resynchroniser configuration clientdb';
9+
$wb['resync_mailbox_txt'] = 'Resynchroniser Boites aux lettres';
10+
$wb['resync_dkim_txt'] = 'Resynchroniser DKIM-Keys';
11+
$wb['resync_dns_txt'] = 'Resynchroniser enregistrements DNS';
1212
$wb['btn_start_txt'] = 'Dérrer';
1313
$wb['btn_cancel_txt'] = 'Annuler';
14-
$wb['Resynchroniser_client_txt'] = 'Resynchroniser Enregisitrements Client';
15-
$wb['resync_webdav_txt'] = 'Resync WebDAV-Users';
16-
$wb['resync_mail_txt'] = 'Resync Maildomains';
17-
$wb['resync_vserver_txt'] = 'Resync vServer';
18-
$wb['resync_firewall_txt'] = 'Resync Firewall';
19-
$wb['resync_no_server_txt'] = 'No active server found';
14+
$wb['resync_client_txt'] = 'Resynchroniser Enregisitrements Client';
2015
?>

0 commit comments

Comments
 (0)