5 * Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2002-2004 (c) GForge Team
9 * This file is part of GForge.
11 * GForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * GForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with GForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 function show_news_approve_form($qpa_pending, $qpa_rejected, $qpa_approved) {
28 Show list of waiting news items
31 // function to show single news item
32 // factored out because called 3 time below
33 function show_news_item($result,$i,$approved,$selectable) {
36 echo '<tr '. $HTML->boxGetAltRowStyle($i) . '><td width="20%">';
38 echo '<input type="checkbox" '
39 .'name="news_id[]" value="'
40 .db_result($result, $i, 'id').'" />';
42 echo date(_('Y-m-d'), db_result($result,$i,'post_date')).'</td>
45 <a href="'.getStringFromServer('PHP_SELF').'?approve=1&id='.db_result($result,$i,'id').'">'.db_result($result,$i,'summary').'</a>
49 .util_make_link_g (db_result($result,$i,'unix_group_name'),db_result($result,$i,'group_id'),db_result($result,$i,'group_name').' ('.db_result($result,$i,'unix_group_name').')')
61 $result=db_query_qpa($qpa_pending);
62 $rows=db_numrows($result);
64 echo '<form action="'. getStringFromServer('PHP_SELF') .'" method="post">';
65 echo '<input type="hidden" name="mass_reject" value="1" />';
66 echo '<input type="hidden" name="post_changes" value="y" />';
70 <h4>'._('No Queued Items Found').'</h4>';
72 echo '<h4>'.sprintf(_('These items need to be approved (total: %1$s)'), $rows).'</h4>';
73 echo $GLOBALS['HTML']->listTableTop($title_arr);
74 for ($i=0; $i<$rows; $i++) {
75 show_news_item($result,$i,false,true);
77 echo $GLOBALS['HTML']->listTableBottom();
78 echo '<br /><input type="submit" name="submit" value="'._('Reject Selected').'" />';
83 Show list of rejected news items for this week
86 $result=db_query_qpa($qpa_rejected);
87 $rows=db_numrows($result);
90 <h4>'._('No rejected items found for this week').'</h4>';
92 echo '<h4>'.sprintf(_('These items were rejected this past week (total: %1$s)'), $rows).'</h4>';
93 echo $GLOBALS['HTML']->listTableTop($title_arr);
94 for ($i=0; $i<$rows; $i++) {
95 show_news_item($result,$i,false,false);
97 echo $GLOBALS['HTML']->listTableBottom();
101 Show list of approved news items for this week
104 $result=db_query_qpa($qpa_approved);
105 $rows=db_numrows($result);
108 <h4>'._('No approved items found for this week').'</h4>';
110 echo '<h4>'.sprintf(_('These items were approved this past week (total: %1$s)'), $rows).'</h4>';
111 echo $GLOBALS['HTML']->listTableTop($title_arr);
112 for ($i=0; $i<$rows; $i++) {
113 show_news_item($result,$i,true,false);
115 echo $GLOBALS['HTML']->listTableBottom();
122 // c-file-style: "bsd"