5 * Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2002-2004 (c) GForge Team
11 * This file is part of GForge.
13 * GForge is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * GForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with GForge; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 function show_news_approve_form($sql_pending, $sql_rejected, $sql_approved) {
31 Show list of waiting news items
34 // function to show single news item
35 // factored out because called 3 time below
36 function show_news_item($result,$i,$approved,$selectable) {
37 global $HTML, $sys_shortdatefmt;
39 echo '<tr '. $HTML->boxGetAltRowStyle($i) . '><td width="20%">';
41 echo '<input type="checkbox" '
42 .'name="news_id[]" value="'
43 .db_result($result, $i, 'id').'" />';
45 echo date($sys_shortdatefmt, db_result($result,$i,'post_date')).'</td>
48 <a href="'.getStringFromServer('PHP_SELF').'?approve=1&id='.db_result($result,$i,'id').'">'.db_result($result,$i,'summary').'</a>
52 <a href="'.$GLOBALS['sys_urlprefix'].'/projects/'
53 .db_result($result,$i,'unix_group_name').'/">'
54 .db_result($result,$i,'group_name')
55 .' ('.db_result($result,$i,'unix_group_name').')'
68 $result=db_query($sql_pending);
69 $rows=db_numrows($result);
71 echo '<form action="'. getStringFromServer('PHP_SELF') .'" method="post">';
72 echo '<input type="hidden" name="mass_reject" value="1" />';
73 echo '<input type="hidden" name="post_changes" value="y" />';
77 <h4>'._('No Queued Items Found').'</h4>';
79 echo '<h4>'.sprintf(_('These items need to be approved (total: %1$s)'), $rows).'</h4>';
80 echo $GLOBALS['HTML']->listTableTop($title_arr);
81 for ($i=0; $i<$rows; $i++) {
82 show_news_item($result,$i,false,true);
84 echo $GLOBALS['HTML']->listTableBottom();
85 echo '<br /><input type="submit" name="submit" value="'._('Reject Selected').'" />';
90 Show list of rejected news items for this week
93 $result=db_query($sql_rejected);
94 $rows=db_numrows($result);
97 <h4>'._('No rejected items found for this week').'</h4>';
99 echo '<h4>'.sprintf(_('These items were rejected this past week (total: %1$s)'), $rows).'</h4>';
100 echo $GLOBALS['HTML']->listTableTop($title_arr);
101 for ($i=0; $i<$rows; $i++) {
102 show_news_item($result,$i,false,false);
104 echo $GLOBALS['HTML']->listTableBottom();
108 Show list of approved news items for this week
111 $result=db_query($sql_approved);
112 $rows=db_numrows($result);
115 <h4>'._('No approved items found for this week').'</h4>';
117 echo '<h4>'.sprintf(_('These items were approved this past week (total: %1$s)'), $rows).'</h4>';
118 echo $GLOBALS['HTML']->listTableTop($title_arr);
119 for ($i=0; $i<$rows; $i++) {
120 show_news_item($result,$i,true,false);
122 echo $GLOBALS['HTML']->listTableBottom();