Skip to content

Commit

Permalink
added project support to news
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@135 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Feb 3, 2001
1 parent 32e8348 commit c298a2c
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 18 deletions.
11 changes: 6 additions & 5 deletions news_add.php3
@@ -1,6 +1,6 @@
<?
# Mantis - a php based bugtracking system
# Copyright (C) 2000 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2000, 2001 Kenzaburo Ito - kenito@300baud.org
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
?>
Expand All @@ -9,7 +9,7 @@
<?
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

if ( !access_level_check_greater_or_equal( "developer" ) ) {
if ( !access_level_check_greater_or_equal( "manager" ) ) {
### need to replace with access error page
header( "Location: $g_logout_page" );
exit;
Expand All @@ -18,12 +18,13 @@
### " character poses problem when editting so let's just convert them
$f_headline = string_safe( str_replace( "\"", "'", $f_headline ) );
$f_body = string_safe( $f_body );

### Add item
$query = "INSERT
INTO $g_mantis_news_table
( id, poster_id, date_posted, last_modified, headline, body )
( id, project_id, poster_id, date_posted, last_modified, headline, body )
VALUES
( null, '$f_poster_id', NOW(), NOW(), '$f_headline', '$f_body' )";
( null, '$f_project_id', '$f_poster_id', NOW(), NOW(), '$f_headline', '$f_body' )";
$result = db_query( $query );
?>
<? print_html_top() ?>
Expand All @@ -49,7 +50,7 @@
### SUCCESS
if ( $result ) {
$t_headline = string_display( $f_headline );
$t_body = string_display( $f_body );
$t_body = stripslashes( string_display_with_br( $f_body ) );
?>
<p>
<div align=center>
Expand Down
4 changes: 2 additions & 2 deletions news_delete.php3
@@ -1,6 +1,6 @@
<?
# Mantis - a php based bugtracking system
# Copyright (C) 2000 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2000, 2001 Kenzaburo Ito - kenito@300baud.org
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
?>
Expand All @@ -9,7 +9,7 @@
<?
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

if ( !access_level_check_greater_or_equal( "developer" ) ) {
if ( !access_level_check_greater_or_equal( "manager" ) ) {
### need to replace with access error page
header( "Location: $g_logout_page" );
exit;
Expand Down
8 changes: 7 additions & 1 deletion news_delete_page.php3
@@ -1,13 +1,19 @@
<?
# Mantis - a php based bugtracking system
# Copyright (C) 2000 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2000, 2001 Kenzaburo Ito - kenito@300baud.org
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
?>
<? include( "core_API.php" ) ?>
<? login_cookie_check() ?>
<?
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

if ( !access_level_check_greater_or_equal( "manager" ) ) {
### need to replace with access error page
header( "Location: $g_logout_page" );
exit;
}
?>
<? print_html_top() ?>
<? print_head_top() ?>
Expand Down
19 changes: 15 additions & 4 deletions news_edit_page.php3
@@ -1,6 +1,6 @@
<?
# Mantis - a php based bugtracking system
# Copyright (C) 2000 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2000, 2001 Kenzaburo Ito - kenito@300baud.org
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
?>
Expand All @@ -9,7 +9,7 @@
<?
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

if ( !access_level_check_greater_or_equal( "developer" ) ) {
if ( !access_level_check_greater_or_equal( "manager" ) ) {
### need to replace with access error page
header( "Location: $g_logout_page" );
exit;
Expand Down Expand Up @@ -64,18 +64,29 @@
<td width=25%>
<? echo $s_headline ?>
</td>
<td>
<td width=75%>
<input type=text name=f_headline size=64 maxlength=64 value="<? echo $v_headline ?>">
</td>
</tr>
<tr bgcolor=<? echo $g_primary_color_light ?>>
<td width=75%>
<td>
<? echo $s_body ?>
</td>
<td>
<textarea name=f_body cols=60 rows=10><? echo $v_body ?></textarea>
</td>
</tr>
<tr bgcolor=<? echo $g_primary_color_dark ?>>
<td>
<? echo $s_post_to ?>
</td>
<td>
<select name=f_project_id>
<option value="0000000" <? if ( $v_project_id=="0000000" ) echo "SELECTED"?>>Sitewide
<? print_news_project_option_list( $v_project_id ) ?>
</select>
</td>
</tr>
<tr>
<td align=center colspan=2>
<input type=submit value="<? echo $s_update_news_button ?>">
Expand Down
17 changes: 14 additions & 3 deletions news_menu_page.php3
@@ -1,6 +1,6 @@
<?
# Mantis - a php based bugtracking system
# Copyright (C) 2000 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2000, 2001 Kenzaburo Ito - kenito@300baud.org
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
?>
Expand All @@ -9,7 +9,7 @@
<?
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

if ( !access_level_check_greater_or_equal( "developer" ) ) {
if ( !access_level_check_greater_or_equal( "manager" ) ) {
### need to replace with access error page
header( "Location: $g_logout_page" );
exit;
Expand Down Expand Up @@ -56,6 +56,17 @@
<textarea name=f_body cols=60 rows=8></textarea>
</td>
</tr>
<tr bgcolor=<? echo $g_primary_color_dark ?>>
<td>
<? echo $s_post_to ?>
</td>
<td>
<select name=f_project_id>
<option value="0000000">Sitewide
<? print_news_project_option_list( $g_project_cookie_val ) ?>
</select>
</td>
</tr>
<tr>
<td align=center colspan=2>
<input type=submit value="<? echo $s_post_news_button ?>">
Expand Down Expand Up @@ -86,7 +97,7 @@
<input type=radio name=f_action value="delete"> <? echo $s_delete_post ?>
</td>
</tr>
<tr bgcolor=<? echo $g_primary_color_light ?> align=center>
<tr bgcolor=<? echo $g_primary_color_light ?>>
<td valign=top width=25%>
<? echo $s_select_post ?>
</td>
Expand Down
6 changes: 3 additions & 3 deletions news_update.php3
@@ -1,6 +1,6 @@
<?
# Mantis - a php based bugtracking system
# Copyright (C) 2000 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2000, 2001 Kenzaburo Ito - kenito@300baud.org
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
?>
Expand All @@ -9,13 +9,13 @@
<?
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

if ( !access_level_check_greater_or_equal( "developer" ) ) {
if ( !access_level_check_greater_or_equal( "manager" ) ) {
### need to replace with access error page
header( "Location: $g_logout_page" );
exit;
}

### " character poses problem when editting so let's just convert them
### " character poses problem when editting so let's just convert them to '
$f_headline = string_safe( str_replace( "\"", "'", $f_headline ) );
$f_body = string_safe( $f_body );

Expand Down

0 comments on commit c298a2c

Please sign in to comment.