Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Modified code to update last_updated/last_modified fields for bugs, b…
…ugnotes, and news.

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@647 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Jan 15, 2002
1 parent 3428cbb commit 1c4d826
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 5 deletions.
3 changes: 3 additions & 0 deletions bug_assign.php
Expand Up @@ -29,6 +29,9 @@
WHERE id='$f_id'";
$result = db_query($query);

# updated the last_updated date
bug_date_update( $f_id );

# send assigned to email
email_assign( $f_id );

Expand Down
3 changes: 3 additions & 0 deletions bug_close.php
Expand Up @@ -25,6 +25,9 @@
WHERE id='$f_id'";
$result = db_query($query);

# updated the last_updated date
bug_date_update( $f_id );

email_close( $f_id );

$t_redirect_url = $g_view_all_bug_page;
Expand Down
3 changes: 3 additions & 0 deletions bug_file_add.php
Expand Up @@ -44,6 +44,9 @@
(null, $f_id, '', '', '$t_file_path$f_file_name', '$f_file_name', '$t_file_path', $t_file_size, '$f_file_type', NOW(), '$t_content')";
}
$result = db_query( $query );

# updated the last_updated date
bug_date_update( $f_id );
}

# Determine which view page to redirect back to.
Expand Down
3 changes: 3 additions & 0 deletions bug_update.php
Expand Up @@ -73,6 +73,9 @@
WHERE id='$t_bug_text_id'";
$result = db_query($query);

# updated the last_updated date
bug_date_update( $f_id );

# If we should notify and it's in feedback state then send an email
switch ( $f_status ) {
case FEEDBACK: if ( $f_status!= $f_old_status ) {
Expand Down
2 changes: 1 addition & 1 deletion bugnote_add.php
Expand Up @@ -35,7 +35,7 @@
INTO $g_mantis_bugnote_table
( id, bug_id, reporter_id, bugnote_text_id, date_submitted, last_modified )
VALUES
( null, '$f_id', '$u_id','$t_bugnote_text_id',NOW(), NOW() )";
( null, '$f_id', '$u_id','$t_bugnote_text_id', NOW(), NOW() )";
$result = db_query( $query );

$query = "SELECT date_submitted
Expand Down
1 change: 1 addition & 0 deletions bugnote_edit_page.php
Expand Up @@ -35,6 +35,7 @@
<form method="post" action="<?php echo $g_bugnote_update ?>">
<input type="hidden" name="f_id" value="<?php echo $f_id ?>">
<input type="hidden" name="f_bugnote_text_id" value="<?php echo $f_bugnote_text_id ?>">
<input type="hidden" name="f_bugnote_id" value="<?php echo $f_bugnote_id ?>">
<tr>
<td class="form-title">
<?php echo $s_edit_bugnote_title ?>
Expand Down
4 changes: 2 additions & 2 deletions bugnote_inc.php
Expand Up @@ -9,7 +9,7 @@
# $f_id must be set and be set to the bug id
?>
<?php
# @@@ uneeded?
# @@@ uneeded?
#db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

# grab the user id currently logged in
Expand Down Expand Up @@ -79,7 +79,7 @@
if ( get_bug_field( "status", $f_id ) < RESOLVED ) {
if (( access_level_check_greater_or_equal( ADMINISTRATOR ) ) ||
( $v3_reporter_id == $t_user_id )) {
print_bracket_link( $g_bugnote_edit_page."?f_bugnote_text_id=".$v3_bugnote_text_id."&f_id=".$f_id, $s_bugnote_edit_link );
print_bracket_link( $g_bugnote_edit_page."?f_bugnote_text_id=".$v3_bugnote_text_id."&f_id=".$f_id."&f_bugnote_id=".$v3_id, $s_bugnote_edit_link );
print_bracket_link( $g_bugnote_delete."?f_bugnote_id=".$v3_id."&f_id=".$f_id, $s_delete_link );
}
}
Expand Down
3 changes: 3 additions & 0 deletions bugnote_update.php
Expand Up @@ -22,6 +22,9 @@
WHERE id='$f_bugnote_text_id'";
$result = db_query( $query );

# updated the last_updated date
bugnote_date_update( $f_bugnote_id );

# Determine which view page to redirect back to.
$t_redirect_url = get_view_redirect_url( $f_id );
if ( ( ON == $g_quick_proceed )&&( $result ) ) {
Expand Down
20 changes: 20 additions & 0 deletions core_helper_API.php
Expand Up @@ -10,6 +10,26 @@

# These are miscellaneous functions to help the package

# --------------------
# updates the last_updated field
function bug_date_update( $p_bug_id ) {
global $g_mantis_bug_table;

$query = "UPDATE last_updated
FROM $g_mantis_bug_table
WHERE id='$p_bug_id'";
$result = db_query( $query );
}
# --------------------
# updates the last_modified field
function bugnote_date_update( $p_bugnote_id ) {
global $g_mantis_bugnote_table;

$query = "UPDATE last_modified
FROM $g_mantis_bugnote_table
WHERE id='$p_bugnote_id'";
$result = db_query( $query );
}
# --------------------
# Returns the specified field value of the specified bug
function get_bug_field( $p_field_name, $p_bug_id ) {
Expand Down
3 changes: 2 additions & 1 deletion core_news_API.php
Expand Up @@ -50,7 +50,8 @@ function news_update_query( $p_id, $p_headline, $p_body, $p_project_id ) {

# Update entry
$query = "UPDATE $g_mantis_news_table
SET headline='$p_headline', body='$p_body', project_id='$p_project_id'
SET headline='$p_headline', body='$p_body',
project_id='$p_project_id', last_modified=NOW()
WHERE id='$p_id'";
return db_query( $query );
}
Expand Down
3 changes: 2 additions & 1 deletion doc/ChangeLog
Expand Up @@ -18,7 +18,8 @@ Mantis
* Modified comments to use one # instead of ### (save space)
* Modified alternate_colors() to have default parameters.
* Modified all files to use <?php instead of <?
* Modified error messages to use $MANTIS_ERROR array
* Modified error messages to use $MANTIS_ERROR array.
* Modified code to update last_updated/last_modified fields for bugs, bugnotes, and news.
* Added view by page feature.
* Added edit new link in news update page.
* Added file upload into database.
Expand Down

0 comments on commit 1c4d826

Please sign in to comment.