5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2002-2004 (c) GForge Team
7 * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
8 * http://fusionforge.org/
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
16 * FusionForge 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 along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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($row,$i,$approved,$selectable) {
36 echo '<tr '. $HTML->boxGetAltRowStyle($i) . '><td>';
38 echo '<input type="checkbox" '
39 .'name="news_id[]" value="'
42 echo date(_('Y-m-d'), $row['post_date']).'</td>
45 <a href="'.getStringFromServer('PHP_SELF').'?approve=1&id='.$row['id'].'">'.$row['summary'].'</a>
48 <td class="onethirdwidth">'
49 .util_make_link_g ($row['unix_group_name'],$row['group_id'],$row['group_name'].' ('.$row['unix_group_name'].')')
61 $ra = RoleAnonymous::getInstance() ;
63 $result = db_query_qpa($qpa_pending);
65 while ($row_item = db_fetch_array($result)) {
66 if ($ra->hasPermission('project_read', $row_item['group_id'])) {
70 $rows = count($items);
72 echo '<form action="'. getStringFromServer('PHP_SELF') .'" method="post">';
73 echo '<input type="hidden" name="mass_reject" value="1" />';
74 echo '<input type="hidden" name="post_changes" value="y" />';
78 <h2>'._('No Queued Items Found').'</h2>';
80 echo '<h2>'.sprintf(_('These items need to be approved (total: %1$s)'), $rows).'</h2>';
81 echo $GLOBALS['HTML']->listTableTop($title_arr);
82 for ($i=0; $i<$rows; $i++) {
83 show_news_item($items[$i],$i,false,true);
85 echo $GLOBALS['HTML']->listTableBottom();
86 echo '<br /><input type="submit" name="submit" value="'._('Reject Selected').'" />';
91 Show list of rejected news items for this week
94 $result = db_query_qpa($qpa_rejected);
96 while ($row_item = db_fetch_array($result)) {
97 if ($ra->hasPermission('project_read', $row_item['group_id'])) {
101 $rows = count($items);
105 <h2>'._('No rejected items found for this week').'</h2>';
107 echo '<h2>'.sprintf(_('These items were rejected this past week or were not intended for front page (total: %1$s)'), $rows).'</h2>';
108 echo $GLOBALS['HTML']->listTableTop($title_arr);
109 for ($i=0; $i<$rows; $i++) {
110 show_news_item($items[$i],$i,false,true);
112 echo $GLOBALS['HTML']->listTableBottom();
116 Show list of approved news items for this week
119 $result = db_query_qpa($qpa_approved);
121 while ($row_item = db_fetch_array($result)) {
122 if ($ra->hasPermission('project_read', $row_item['group_id'])) {
123 $items[] = $row_item;
126 $rows = count($items);
129 <h2>'._('No approved items found for this week').'</h2>';
131 echo '<h2>'.sprintf(_('These items were approved this past week (total: %1$s)'), $rows).'</h2>';
132 echo $GLOBALS['HTML']->listTableTop($title_arr);
133 for ($i=0; $i<$rows; $i++) {
134 show_news_item($items[$i],$i,false,true);
136 echo $GLOBALS['HTML']->listTableBottom();
143 // c-file-style: "bsd"