From: <vb...@us...> - 2002-09-26 03:41:49
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv11650 Modified Files: action.php admin_manage_notes.php Log Message: - Removed single quotes from queries when accessing numeric fields. - Added support for re-queueing of notes. - Improved the Manage Notes page to have two lists. The first lists the documents that have pending notes, and the second lists all documents. Index: action.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/action.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- action.php 22 Sep 2002 04:17:37 -0000 1.8 +++ action.php 26 Sep 2002 03:41:46 -0000 1.9 @@ -17,26 +17,19 @@ exit; } - #if ( !isset( $f_url ) ) { - # echo 'f_url not defined<br />'; - # exit; - #} else { - # $c_url = urldecode( $f_url ); - #} - # @@@@ add handling for confirm? # The access level check is done in the APIs if ( isset( $f_note_id )) { $t_note_info = note_get_info( note_where_id_equals( $f_note_id ) ); if ( false === $t_note_info ) { - echo "note not found"; + echo "note not found"; exit; } $t_page_info = page_get_info( page_where_id_equals( $t_note_info['page_id'] ) ); if ( false === $t_page_info ) { - echo "page not found"; + echo "page not found"; exit; } $t_url = $t_page_info['url']; @@ -52,7 +45,7 @@ } else if ( 'pack' === $f_action ) { # in this case id = 0 note_pack_deleted(); - } else if ( 'pending' === $f_action ) { + } else if ( 'queue' === $f_action ) { note_pending( $f_note_id ); } else if ( 'edit' === $f_action ) { header( "Location: $g_note_add_page?f_note_id=$f_note_id" ); Index: admin_manage_notes.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_notes.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- admin_manage_notes.php 22 Sep 2002 04:17:38 -0000 1.17 +++ admin_manage_notes.php 26 Sep 2002 03:41:46 -0000 1.18 @@ -25,12 +25,49 @@ print_admin_menu (); - $pages = page_get_array ( page_where_url_exists(), 'last_updated DESC' ); + $query = "SELECT p.*, COUNT(n.id) as notes_count + FROM " . config_get( 'phpWN_page_table' ) . " p, + " . config_get( 'phpWN_note_table' ) . " n + WHERE (p.id=n.page_id) AND (n.visible=".NOTE_VISIBLE_PENDING.") + GROUP BY p.id + ORDER BY notes_count DESC"; + + $result = db_query($query); + + echo <<<EOT + <p><strong>Following are the documents that have notes pending approval:</strong></p> + <table class="box" summary=""> + <tr><th>Page</th><th>URL</th><th>Pending Notes</th></tr>\n +EOT; + $count = 0; + while ( $row = db_fetch_array( $result ) ) { + $color = util_alternate_colors( $count++ ); + extract( $row, EXTR_PREFIX_ALL, 'v' ); + echo "<tr bgcolor=\"$color\"><td><a href=\"$v_url\">$v_page</a></td><td>$v_url</td><td>$v_notes_count</td></tr>\n"; + } + echo <<<EOT + </table> + <p>There are $count document(s) to be moderated.</p>\n + <hr> + <div class="spacer"></div> + <p><strong>Following are all the documents that use phpWebNotes:</strong></p> + <table class="box" summary=""> + <tr><th>Page</th><th>URL</th></tr>\n +EOT; + + $count = 0; + $pages = page_get_array ( page_where_url_exists(), 'last_updated DESC' ); foreach( $pages as $page ) { extract( $page, EXTR_PREFIX_ALL, 'v' ); - echo "<a href=\"$v_url\">$v_page</a> - $v_url<br />\n"; + $color = util_alternate_colors( $count++ ); + echo "<tr bgcolor=\"$color\"><td><a href=\"$v_url\">$v_page</a></td><td>$v_url</td></tr>\n"; } + + echo <<<EOT + </table> + <p>There are $count document(s) that are indexed.</p>\n +EOT; print_footer( __FILE__ ); print_bottom_page( $g_bottom_page_inc ); |