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 ec520cd1a4a4ccfb733a4c7513c81a94ff6ea1b4 (commit)
from 26724d8703613f1056ab253b16a76808d34f5812 (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=ec520cd1a4a4ccfb733a4c7513c81a94ff6ea1b4
commit ec520cd1a4a4ccfb733a4c7513c81a94ff6ea1b4
Author: Franck Villaume <[email protected]>
Date: Fri May 21 12:13:37 2021 +0200
clean-up: use HTML helper
diff --git a/src/plugins/quotamanagement/common/quotamanagementPlugin.class.php
b/src/plugins/quotamanagement/common/quotamanagementPlugin.class.php
index 74e5c5e..a64a4cd 100644
--- a/src/plugins/quotamanagement/common/quotamanagementPlugin.class.php
+++ b/src/plugins/quotamanagement/common/quotamanagementPlugin.class.php
@@ -125,6 +125,7 @@ to monitor disk and database usage per user, project.");
case 'globaladmin': {
global $gfwww;
require_once $gfwww.'admin/admin_utils.php';
+ html_use_tablesorter();
site_admin_header(array('title'=>_('Quota and
Usage Admin')));
break;
}
diff --git a/src/plugins/quotamanagement/view/quota_admin.php
b/src/plugins/quotamanagement/view/quota_admin.php
index 9f62b6f..c688d3f 100644
--- a/src/plugins/quotamanagement/view/quota_admin.php
+++ b/src/plugins/quotamanagement/view/quota_admin.php
@@ -70,77 +70,25 @@ if (db_numrows($res_db) > 0) {
$quotas["$e[group_id]"]["quota_db_soft"] = $e["quota_db_soft"];
}
}
-?>
-<table width="900" cellpadding="2" cellspacing="0" border="0">
- <tr style="font-weight:bold">
- <td style="border-top:thick solid #808080" colspan="8"><?php
echo _('Projects quota'); ?></td>
- </tr>
- <tr>
- <td style="border-top:thin solid #808080"><?php echo _('id');
?></td>
- <td style="border-top:thin solid #808080"><?php echo _('name');
?></td>
- <td style="border-top:thin solid #808080"><br /></td>
- <td style="border-top:thin solid #808080;
text-align:right"><?php echo _('database quota soft'); ?></td>
- <td style="border-top:thin solid #808080;
text-align:right"><?php echo _('database quota hard'); ?></td>
- <td style="border-top:thin solid #808080;
text-align:right"><?php echo _('disk quota soft'); ?></td>
- <td style="border-top:thin solid #808080;
text-align:right"><?php echo _('disk quota hard'); ?></td>
- <td style="border-top:thin solid #808080"><br /></td>
- </tr>
- <?php
- $total_database = 0;
- $total_disk = 0;
- foreach ($quotas as $q)
- {
- $total_database += $q["database_size"];
- $total_disk += $q["disk_size"];
- echo $HTML->openForm(array('action' =>
'/plugins/'.$quotamanagement->name.'/?type=globaladmin&action=update', 'method'
=> 'post'));
- ?>
- <input type="hidden" name="group_id" value="<?php echo
$q["group_id"]; ?>" />
- <tr>
- <td style="border-top:thin solid #808080"><?php echo
$q["group_id"]; ?></td>
- <td style="border-top:thin solid #808080">
- <?php echo
util_make_link('/plugins/'.$quotamanagement->name.'/?group_id='.$q['group_id'].'&type=projectadmin',
$q['unix_name']) ?>
- </td>
- <td style="border-top:thin solid #808080"><?php echo
$q["name"]; ?></td>
- <td style="border-top:thin solid #808080;
text-align:right">
- <input type="text" name="qds"
- size="12"
- value="<?php echo $q["quota_db_soft"];
?>"
-
style="background:#ffffd0;text-align:right" />
- <?php echo _('MB'); ?>
- </td>
- <td style="border-top:thin solid #808080;
text-align:right">
- <input type="text" name="qdh"
- size="12"
- value="<?php echo $q["quota_db_hard"];
?>"
-
style="background:#ffffd0;text-align:right" />
- <?php echo _('MB'); ?>
- </td>
- <td style="border-top:thin solid #808080;
text-align:right">
- <input type="text" name="qs"
- size="12"
- value="<?php echo $q["quota_soft"]; ?>"
-
style="background:#ffffd0;text-align:right" />
- <?php echo _('MB'); ?>
- </td>
- <td style="border-top:thin solid #808080;
text-align:right">
- <input type="text" name="qh"
- size="12"
- value="<?php echo $q["quota_hard"]; ?>"
-
style="background:#ffffd0;text-align:right" />
- <?php echo _('MB'); ?>
- </td>
- <td style="border-top:thin solid #808080;
text-align:right">
- <input type="submit" value="<?php echo
_('Modify'); ?>" />
- </td>
- </tr>
- <?php
- echo $HTML->closeForm();
- }
-?>
- <tr style="font-weight:bold">
- <td style="border-top:thick solid #808080;border-bottom:thick
solid #808080" colspan="8"><br /></td>
- </tr>
-</table>
-<?php
+echo html_e('h2', array(), _('Projects Quota'));
+$titleArray = array(_('id'), _('unixname'), _('name'), _('database quota
soft').' (MB)', _('database quota hard').' (MB)', _('disk quota soft').' (MB)',
_('disk quota hard').' (MB)', '');
+$thClassArray = array('', '', '', 'align-right unsortable', 'align-right
unsortable', 'align-right unsortable', 'align-right unsortable', 'unsortable');
+echo $HTML->listTableTop($titleArray, array(), 'sortable', 'sortable_quota',
$thClassArray);
+foreach ($quotas as $q) {
+ $cells = array();
+ $cells[][] = $q['group_id'];
+ $cells[][] =
util_make_link('/plugins/'.$quotamanagement->name.'/?group_id='.$q['group_id'].'&type=projectadmin',
$q['unix_name']);
+ $cells[][] = $q['name'];
+ $cells[] = array($HTML->html_input('qds', '', '', 'numeric',
$q['quota_db_soft'], array('class' => 'align-right', 'form' => 'q'.$group_id,
'min' => 0)));
+ $cells[] = array($HTML->html_input('qdh', '', '', 'numeric',
$q['quota_db_hard'], array('class' => 'align-right', 'form' => 'q'.$group_id,
'min' => 0)));
+ $cells[] = array($HTML->html_input('qs', '', '', 'numeric',
$q['quota_soft'], array('class' => 'align-right', 'form' => 'q'.$group_id,
'min' => 0)));
+ $cells[] = array($HTML->html_input('qh', '', '', 'numeric',
$q['quota_hard'], array('class' => 'align-right', 'form' => 'q'.$group_id,
'min' => 0)));
+ $cells[] = array($HTML->openForm(array('action' =>
'/plugins/'.$quotamanagement->name.'/?type=globaladmin&action=update', 'method'
=> 'post', 'id' => 'q'.$group_id))
+ .$HTML->html_input('submit', '', '', 'submit',
_('Modify'), array('form' => 'q'.$group_id))
+ .$HTML->html_input('group_id', '', '', 'hidden',
$q['group_id'], array('form' => 'q'.$group_id))
+ .$HTML->closeForm());
+ echo $HTML->multiTableRow(array(), $cells);
+}
+echo $HTML->listTableBottom();
site_admin_footer();
diff --git a/src/www/include/Layout.class.php b/src/www/include/Layout.class.php
index d3206e6..b217a07 100644
--- a/src/www/include/Layout.class.php
+++ b/src/www/include/Layout.class.php
@@ -8,7 +8,7 @@
* Copyright 2010-2012, Alain Peyrat - Alcatel-Lucent
* Copyright © 2011 Thorsten Glaser – tarent GmbH
* Copyright 2011 - Marc-Etienne Vargenau, Alcatel-Lucent
- * Copyright 2012-2019, Franck Villaume - TrivialDev
+ * Copyright 2012-2019,2021, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -446,8 +446,8 @@ abstract class Layout extends FFError {
* @param array $linksArray The array of title links
* @param string $class The css classes to add
(optional)
* @param string $id The id of the table
(needed by sortable for example)
- * @param array $thClassArray specific class for th
column
- * @param array $thTitleArray specific title for th
column
+ * @param array $thClassArray specific class for th
cell
+ * @param array $thTitleArray specific title for th
cell
* @param array $thOtherAttrsArray optional other html
attributes for the th
* @param string $theadClass optional thead tr css
class. default is tableheading
* @return string the html code
@@ -464,13 +464,12 @@ abstract class Layout extends FFError {
}
$return = html_ao('table', $attrs);
- if (count($titleArray)) {
+ if (!empty($titleArray)) {
$ap = html_ap();
$return .= html_ao('thead');
$return .= html_ao('tr', array('class' => $theadClass));
- $count = count($titleArray);
- for ($i = 0; $i < $count; $i++) {
+ for ($i = 0; $i < count($titleArray); $i++) {
$thAttrs = array();
if ($thOtherAttrsArray &&
isset($thOtherAttrsArray[$i])) {
$thAttrs = $thOtherAttrsArray[$i];
@@ -626,10 +625,8 @@ abstract class Layout extends FFError {
*
* @param array $row_attrs the row attributes
* @param array $cell_data the array of cell data, each
element is an array,
- * the first item being the text,
- * the subsequent items are
attributes (dont include
- * the bgcolor for the title here,
that will be
- * handled by $istitle
+ * the first item must be the text,
+ * the subsequent items are
attributes (dont include the bgcolor for the title here, that will be handled
by $istitle)
* @param bool $istitle is this row part of the title ?
* @return string the html code
*/
-----------------------------------------------------------------------
Summary of changes:
.../common/quotamanagementPlugin.class.php | 1 +
src/plugins/quotamanagement/view/quota_admin.php | 92 +++++-----------------
src/www/include/Layout.class.php | 17 ++--
3 files changed, 28 insertions(+), 82 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits