This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, master has been updated
via d7ce97a9a8c220a6b5d4228f4593835d0b3040c9 (commit)
from 0ccbb2b9479e8d90df6f85b298159e4a6c094a8f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=d7ce97a9a8c220a6b5d4228f4593835d0b3040c9
commit d7ce97a9a8c220a6b5d4228f4593835d0b3040c9
Author: Franck Villaume <[email protected]>
Date: Sun Jul 28 17:45:54 2019 +0200
quota management: new display for project view
diff --git a/src/plugins/quota_management/view/quota_project.php
b/src/plugins/quota_management/view/quota_project.php
index 2c22400..4209f30 100644
--- a/src/plugins/quota_management/view/quota_project.php
+++ b/src/plugins/quota_management/view/quota_project.php
@@ -131,6 +131,8 @@ if ($group->usesPM()) {
$quotas[] = $q;
}
+plugin_hook_by_reference('quota_display_db', $quotas);
+
$quotas_disk = array();
// disk_total_space
@@ -150,35 +152,23 @@ if (db_numrows($res_db) > 0) {
$quota_db_soft = $e["quota_db_soft"];
}
-$quota_tot_other = 0;
-$quota_tot_1 = 0;
-$quota_tot_scm = 0;
-
if (forge_get_config('use_shell')) {
$q["name"] = _('Home project directory');
$q["size"] = $quota_management->getHomeSize($group_id);
- $q["quota_label"] = _('With Home quota control');
- $quota_tot_1 += $q["size"];
$quotas_disk[] = $q;
}
if ($group->usesFTP()) {
$q["name"] = _('FTP project directory');
$q["size"] = $quota_management->getFTPSize($group_id);
- $q["quota_label"] = _('With FTP quota control');
- $quota_tot_1 += $q["size"];
$quotas_disk[] = $q;
}
-plugin_hook_by_reference('quota_display', $quotas_disk);
+plugin_hook_by_reference('quota_display_disks', $quotas_disk);
-echo $HTML->listTableTop();
-?>
+echo $HTML->listTableTop(array(_('Database'), _('DB Quota')), array(), '',
'quota', array(), array(), array(array('colspan' => 2, 'style' => 'text-align:
center'), array('colspan' => 2, 'style' => 'text-align: center')));
- <tr style="font-weight:bold">
- <td colspan="2" style="border-top:thick solid #808080;
text-align: center"><?php echo _('Database'); ?></td>
- <td colspan="2" style="border-top:thick solid #808080;
text-align: center"><?php echo _('DB Quota'); ?></td>
- </tr>
+?>
<tr style="font-weight:bold">
<td style="border-top:thin solid #808080"><?php echo
_('Category'); ?></td>
<td style="border-top:thin solid #808080; text-align:
right"><?php echo _('Size'); ?></td>
@@ -229,93 +219,53 @@ foreach ($quotas as $index => $q) {
echo $HTML->listTableBottom(); ?>
<br />
<br />
-<?php if (count($quotas_disk) > 0) { ?>
-<table width="500" cellpadding="2" cellspacing="0" border="0">
- <tr style="font-weight:bold">
- <td colspan="3" style="border-top:thick solid #808080;
text-align: center">
- <?php echo _('Disk space'); ?>
- </td>
- </tr>
+<?php
+if (count($quotas_disk) > 0) {
+ echo $HTML->listTableTop(array(_('Disk'), _('Quota')), array(), '',
'quota', array(), array(), array(array('colspan' => 2, 'style' => 'text-align:
center'), array('colspan' => 2, 'style' => 'text-align: center')));
+?>
<tr style="font-weight:bold">
<td style="border-top:thin solid #808080">
<?php echo _('Category'); ?>
</td>
- <td style="border-top:thin solid #808080; text-align:
right"> </td>
<td style="border-top:thin solid #808080; text-align: right">
<?php echo _('size'); ?>
</td>
+ <td> </td><td> </td>
</tr>
<?php
$sizetot = 0;
-foreach ($quotas_disk as $q) {
+foreach ($quotas_disk as $index => $q) {
if ($q["size"] != "") {
$sizetot += $q["size"];
?>
<tr>
<td style="border-top:thin solid #808080"><?php echo
$q["name"]; ?></td>
<td style="border-top:thin solid #808080; text-align: right">
- <?php echo $q["quota_label"]; ?>
- </td>
- <td style="border-top:thin solid #808080; text-align: right">
<?php echo human_readable_bytes($q["size"]); ?>
</td>
+ <?php
+ if ($index == max(array_keys($quotas_disk))) {
+ echo '<td style="border-top:thin solid #808080;
text-align: center">'._('Soft').'</td><td style="border-top:thin solid #808080;
text-align: center">'.('Hard').'</td>';
+ } else {
+ echo '<td> </td><td> </td>';
+ }
+ ?>
</tr>
<?php
}
}
-?>
- <tr style="font-weight:bold">
- <td style="border-top:thick solid #808080;border-bottom:thick
solid #808080"><?php echo _('Total'); ?></td>
- <td style="border-top:thick solid #808080;border-bottom:thick
solid #808080"> </td>
- <td style="border-top:thick solid #808080;border-bottom:thick
solid #808080; text-align: right">
- <?php echo human_readable_bytes($sizetot); ?>
- </td>
- </tr>
-</table>
-<br />
-<br />
-
-<?php
-}
-$color1 = "#ffffff";
-$color2 = "#ffffff";
-$msg1 = " ";
-$msg2 = " ";
+$bgcolorstyle = '';
+$msg1 = '';
$qs = $quota_soft * 1024 * 1024;
-if (($quota_tot_1+0) > ($qs+0) && ($qs+0) > 0) {
- $color1 = "#FFDCDC";
+if (($sizetot+0) > ($qs+0) && ($qs+0) > 0) {
+ $bgcolorstyle = 'background-color:#FFDCDC; color:white;';
$msg1 = _('Quota exceeded');
}
-if (($quota_tot_scm+0) > ($qs+0) && ($qs+0) > 0) {
- $color2 = "#FFDCDC";
- $msg2 = _('Quota exceeded');
-}
?>
-
-<table width="500" cellpadding="2" cellspacing="0" border="0">
- <tr style="font-weight:bold">
- <td colspan="4" style="border-top:thick solid #808080;
text-align: center"><?php echo _('Quota disk management'); ?></td>
- </tr>
<tr style="font-weight:bold">
- <td style="border-top:thin solid #808080">
- <?php echo _('Quota settings'); ?>
- </td>
- <td style="border-top:thin solid #808080;font-weight:bold;
text-align: right">
-
- </td>
- <td style="border-top:thin solid #808080; text-align: right">
- <?php echo _('Quota soft'); ?>
- </td>
- <td style="border-top:thin solid #808080; text-align: right">
- <?php echo _('Quota hard'); ?>
- </td>
- </tr>
- <tr style="background:<?php echo $color1; ?>">
- <td style="border-top:thin solid #808080">
- <?php echo _('Home, Ftp'); ?>
- </td>
- <td style="border-top:thin solid
#808080;font-weight:bold;color:red; text-align: right">
- <?php echo $msg1; ?>
+ <td style="border-top:thick solid #808080;border-bottom:thick
solid #808080"><?php echo _('Total'); ?></td>
+ <td style="border-top:thick solid #808080;border-bottom:thick
solid #808080; text-align: right; <?php echo $bgcolorstyle; ?>">
+ <?php echo human_readable_bytes($sizetot); ?>
</td>
<td style="border-top:thin solid #808080; text-align: right">
<?php
@@ -338,38 +288,7 @@ if (($quota_tot_scm+0) > ($qs+0) && ($qs+0) > 0) {
?>
</td>
</tr>
-<?php if ($group->usesSCM()) { ?>
- <tr style="background:<?php echo $color2; ?>">
- <td style="border-top:thin solid #808080">
- <?php echo _('SCM'); ?>
- </td>
- <td style="border-top:thin solid
#808080;font-weight:bold;color:red; text-align: right">
- <?php echo $msg2; ?>
- </td>
- <td style="border-top:thin solid #808080; text-align: right">
- <?php
- if ($quota_soft == 0) {
- echo "---";
- } else {
- echo "$quota_soft";
- echo _('MB');
- }
- ?>
- </td>
- <td style="border-top:thin solid #808080; text-align: right">
- <?php
- if ($quota_hard == 0) {
- echo "---";
- } else {
- echo "$quota_hard";
- echo _('MB');
- }
- ?>
- </td>
- </tr>
-<?php } ?>
- <tr style="font-weight:bold">
- <td colspan="4" style="border-top:thick solid
#808080"> </td>
- </tr>
-</table>
-<?php project_admin_footer();
+<?php
+ echo $HTML->listTableBottom();
+}
+project_admin_footer();
-----------------------------------------------------------------------
Summary of changes:
.../quota_management/view/quota_project.php | 139 +++++----------------
1 file changed, 29 insertions(+), 110 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits