View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007835 | mantisbt | feature | public | 2007-03-16 18:06 | 2017-04-26 06:39 |
Reporter | giallu | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | new | Resolution | open | ||
Summary | 0007835: Add "Has patch" flag to improve usefulness of the "Upload File" feature | ||||
Description | It would be useful to put an additional field for the "upload file" subsection, where the user can specify if the attached file is a patch for the issue. If we can implement this, along with the ability to query for bugs with patches Just reference, I am attaching the "Create New Attachment" page from | ||||
Tags | attachments | ||||
Attached Files | filehelper_patch_versus_1.1.6_2009_05_28.txt (23,744 bytes)
--- core/bug_api.php Fri Feb 13 10:33:21 2009 +++ core/bug_api.php Wed May 27 14:27:42 2009 @@ -646,7 +646,7 @@ } $query = "INSERT INTO $t_mantis_bug_file_table - ( bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content ) + ( bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content, patch, obsolete, user_id ) VALUES ( '$t_new_bug_id', '" . db_prepare_string( $t_bug_file['title'] ) . "', '" . db_prepare_string( $t_bug_file['description'] ) . "', @@ -656,7 +656,10 @@ '" . db_prepare_int( $t_bug_file['filesize'] ) . "', '" . db_prepare_string( $t_bug_file['file_type'] ) . "', '" . db_prepare_string( $t_bug_file['date_added'] ) . "', - '" . db_prepare_string( $t_bug_file['content'] ) . "');"; + '" . db_prepare_string( $t_bug_file['content'] ) . "', + '" . db_prepare_string( $t_bug_file['patch'] ) . "', + '" . db_prepare_string( $t_bug_file['obsolete'] ) . "', + '" . db_prepare_string( $t_bug_file['user_id'] ) . "');"; db_query( $query ); } } @@ -1132,7 +1135,7 @@ $t_bug_file_table = config_get( 'mantis_bug_file_table' ); - $query = "SELECT id, title, diskfile, filename, filesize, file_type, date_added + $query = "SELECT id, title, diskfile, filename, filesize, file_type, date_added, patch, obsolete, user_id, description FROM $t_bug_file_table WHERE bug_id='$c_bug_id' ORDER BY date_added"; --- bug_file_add.php Fri Feb 13 10:33:25 2009 +++ bug_file_add.php Wed May 27 13:42:33 2009 @@ -33,6 +33,15 @@ $f_bug_id = gpc_get_int( 'bug_id', -1 ); $f_file = gpc_get_file( 'file', -1 ); + $f_action = gpc_get_int( 'action', -1 ); + $f_field = gpc_get_string( 'field', ''); + $f_file_id = gpc_get_int( 'file_id', -1 ); + $f_description = gpc_get( 'description', '' ); + $f_patch = gpc_get_bool( 'patch', 0 ); + $f_obsolete = gpc_get_bool( 'obsolete', 0 ); + + $t_user_id = auth_get_current_user_id(); + if ( $f_bug_id == -1 && $f_file == -1 ) { # _POST/_FILES does not seem to get populated if you exceed size limit so check if bug_id is -1 @@ -45,6 +54,7 @@ access_ensure_bug_level( config_get( 'upload_bug_file_threshold' ), $f_bug_id ); + if ( $f_action == -1 || $f_file_id == -1 ) { $t_bug = bug_get( $f_bug_id, true ); if( $t_bug->project_id != helper_get_current_project() ) { # in case the current project is not the same project of the bug we are viewing... @@ -53,8 +63,11 @@ } $f_file_error = ( isset( $f_file['error'] ) ) ? $f_file['error'] : 0; - file_add( $f_bug_id, $f_file['tmp_name'], $f_file['name'], $f_file['type'], 'bug', $f_file_error ); - + file_add( $f_bug_id, $f_file['tmp_name'], $f_file['name'], $f_file['type'], + 'bug', $f_file_error, '', $f_description, $f_patch, $f_obsolete, $t_user_id ); + } else { + file_mark( $f_file_id, $f_field, $f_action, $f_bug_id ); + } # Determine which view page to redirect back to. $t_redirect_url = string_get_bug_view_url( $f_bug_id ); --- bug_file_upload_inc.php Fri Feb 13 10:33:24 2009 +++ bug_file_upload_inc.php Wed May 27 16:14:19 2009 @@ -49,6 +49,34 @@ echo lang_get( 'upload_file' ) ?> </td> </tr> + +<!-- Attachments --> +<?php + $t_show_attachments = ( $t_bug->reporter_id == auth_get_current_user_id() ) || access_has_bug_level( config_get( 'view_attachments_threshold' ), $f_bug_id ); + + if ( $t_show_attachments ) { +?> +<!-- +<tr <?php echo helper_alternate_class() ?>> + <td class="category"> + <a name="attachments" id="attachments" /> + <?php echo lang_get( 'attached_files' ) ?> + </td> + <td colspan="2"> + <?php file_list_attachments( $f_bug_id ); ?> + </td> +</tr> +--> +<tr> + <td colspan="2"> + <?php file_list_attachments( $f_bug_id ); ?> + </td> +</tr> + +<?php + } +?> + <tr class="row-1"> <td class="category" width="15%"> <?php echo lang_get( 'select_file' ) ?><br /> @@ -59,6 +87,22 @@ <input type="hidden" name="max_file_size" value="<?php echo $t_max_file_size ?>" /> <input name="file" type="file" size="40" /> <input type="submit" class="button" value="<?php echo lang_get( 'upload_file_button' ) ?>" /> + </td> +</tr> +<tr class="row-2"> + <td class="category" width="15%"> + <?php echo lang_get( 'file_comment' ) ?> + </td> + <td with="85%"> + <input type="text" name="description" size="80" /> + </td> +</tr> +<tr class="row-1"> + <td class="category"> + <?php echo lang_get( 'file_remarks' ) ?> + </td> + <td with="85%"> + <input type="checkbox" name="patch" value="1" ><?php echo lang_get( 'file_patch' ) ?></input> </td> </tr> </table> --- bug_report.php Thu Mar 19 16:09:58 2009 +++ bug_report.php Wed May 27 14:18:15 2009 @@ -54,7 +54,9 @@ $t_bug_data->additional_information = gpc_get_string( 'additional_info', config_get ( 'default_bug_additional_info' ) ); $f_file = gpc_get_file( 'file', null ); #@@@ (thraxisp) Note that this always returns a structure - # size = 0, if no file + + $f_file_description = gpc_get_string( 'file_description', '' ); + $f_file_patch = gpc_get_bool( 'patch', 0 ); # size = 0, if no file $f_report_stay = gpc_get_bool( 'report_stay', false ); $t_bug_data->project_id = gpc_get_int( 'project_id' ); # Patch to keep the original reporter @@ -166,7 +168,9 @@ # Handle the file upload if ( !is_blank( $f_file['tmp_name'] ) && ( 0 < $f_file['size'] ) ) { $f_file_error = ( isset( $f_file['error'] ) ) ? $f_file['error'] : 0; - file_add( $t_bug_id, $f_file['tmp_name'], $f_file['name'], $f_file['type'], 'bug', $f_file_error ); + file_add( $t_bug_id, $f_file['tmp_name'], $f_file['name'], + $f_file['type'], 'bug', $f_file_error, + '', $f_file_description, $f_file_patch, 0, $t_bug_data->reporter_id); } # Handle custom field submission --- bug_report_advanced_page.php Wed Jan 07 20:01:38 2009 +++ bug_report_advanced_page.php Wed May 27 13:42:33 2009 @@ -517,6 +517,23 @@ <input <?php echo helper_get_tab_index() ?> name="file" type="file" size="60" /> </td> </tr> +<tr <?php echo helper_alternate_class() ?>> + <td class="category" width="15%"> + <?php echo lang_get( 'file_comment' ) ?> + </td> + <td with="85%"> + <input type="text" name="file_description" size="80" /> + </td> +</tr> +<tr <?php echo helper_alternate_class() ?>> + <td class="category"> + <?php echo lang_get( 'file_remarks' ) ?> + </td> + <td with="85%"> + <input type="checkbox" name="patch" value="1" ><?php echo lang_get( 'file_patch' ) ?></input> + </td> +</tr> + <?php } ?> --- bug_report_page.php Tue Jan 06 14:29:51 2009 +++ bug_report_page.php Wed May 27 13:42:33 2009 @@ -427,6 +427,23 @@ <input <?php echo helper_get_tab_index() ?> name="file" type="file" size="60" /> </td> </tr> +<tr <?php echo helper_alternate_class() ?>> + <td class="category" width="15%"> + <?php echo lang_get( 'file_comment' ) ?> + </td> + <td with="85%"> + <input type="text" name="file_description" size="80" /> + </td> +</tr> +<tr <?php echo helper_alternate_class() ?>> + <td class="category"> + <?php echo lang_get( 'file_remarks' ) ?> + </td> + <td with="85%"> + <input type="checkbox" name="patch" value="1" ><?php echo lang_get( 'file_patch' ) ?></input> + </td> +</tr> + <?php } ?> --- bug_view_advanced_page.php Fri Feb 13 10:33:24 2009 +++ bug_view_advanced_page.php Wed May 27 13:42:33 2009 @@ -538,7 +538,7 @@ <?php } # custom fields found ?> -<!-- Attachments --> +<!-- Attachments <?php $t_show_attachments = ( $t_bug->reporter_id == auth_get_current_user_id() ) || access_has_bug_level( config_get( 'view_attachments_threshold' ), $f_bug_id ); @@ -556,7 +556,7 @@ <?php } ?> - +--> <!-- Buttons --> <tr align="center"> <td align="center" colspan="6"> --- bug_view_page.php Fri Feb 13 10:33:25 2009 +++ bug_view_page.php Wed May 27 13:42:33 2009 @@ -446,7 +446,7 @@ <?php } # custom fields found ?> -<!-- Attachments --> +<!-- Attachments <?php $t_show_attachments = ( $t_bug->reporter_id == auth_get_current_user_id() ) || access_has_bug_level( config_get( 'view_attachments_threshold' ), $f_bug_id ); @@ -464,7 +464,7 @@ <?php } ?> - +--> <!-- Buttons --> <tr align="center"> <td align="center" colspan="6"> --- config_defaults_inc.php Thu Jan 22 16:05:38 2009 +++ config_defaults_inc.php Wed May 27 13:42:33 2009 @@ -848,6 +848,15 @@ # absolute path to the default upload folder. Requires trailing / or \ $g_absolute_path_default_upload_folder = ''; + + + # access level needed to mark file obsolete + # reporter can always mark file as an obsolete (aka request for remove) + $g_allow_mark_obsolete_threshold = DEVELOPER; + + # access level needed to mark file patch + # reporter can always mark file as a patch + $g_allow_mark_patch_threshold = DEVELOPER; ############################ # Mantis HTML Settings --- config_inc.php Fri Feb 13 10:33:24 2009 +++ config_inc.php Tue May 26 16:04:38 2009 @@ -29,9 +29,9 @@ # set these values to match your setup $g_hostname = "localhost"; $g_db_type = 'mysql'; - $g_database_name = "mantis"; - $g_db_username = "mantis"; - $g_db_password = "mantis"; + $g_database_name = "mantis111"; + $g_db_username = "mantis111"; + $g_db_password = "mantis111"; # --- email variables ------------- $g_administrator_email = 'mantis@cscanada.ca'; @@ -44,7 +44,7 @@ # Patch to allow real name in FROM field in email notification # Mantis Issue 7546 # start - $g_from_name = 'CS Canada Mantis Bug Tracker'; + $g_from_name = 'PC 10 Mantis v1.1.1 branch Test Setup'; # end @@ -83,9 +83,9 @@ # --- Configuration : Display -------- #This is the browser window title (<TITLE> tag). - $g_window_title = "CS Canada Issues Tracker"; + $g_window_title = "PC 10 Mantis v1.1.1 branch Test Setup"; #This is a heading that is displayed in the viewing area of the page. - $g_page_title = "CS Canada"; + $g_page_title = "PC 10 Mantis v1.1.1 branch"; #This option is used as a default value for user preferences. #This field indicates whether users should get the simple bug report page, #or the advanced bug report page, or both. Possible values are: --- core/file_api.php Fri Feb 13 10:33:21 2009 +++ core/file_api.php Wed May 27 17:26:06 2009 @@ -129,15 +129,24 @@ # -------------------- # Check if the current user can delete attachments from the specified bug. - function file_can_delete_bug_attachments( $p_bug_id ) { + function file_can_delete_bug_attachments( $p_bug_id, $p_file_id = 0 ) { if ( bug_is_readonly( $p_bug_id ) ) { return false; } $t_reported_by_me = bug_is_user_reporter( $p_bug_id, auth_get_current_user_id() ); $t_can_download = access_has_bug_level( config_get( 'delete_attachments_threshold' ), $p_bug_id ); + + if ( $p_file_id > 0 ) { + $t_owned_by_me = file_is_user_owner( $p_file_id, auth_get_current_user_id() ); + } # @@@ Fix this to be readable + if ( $p_file_id > 0 ) { + $t_can_download = $t_can_download || ( $t_owned_by_me && config_get( 'allow_delete_own_attachments' ) ); + } else { + # left due to compatibility reasons. should be removed. $t_can_download = $t_can_download || ( $t_reported_by_me && config_get( 'allow_delete_own_attachments' ) ); + } return $t_can_download; } @@ -154,18 +163,32 @@ } $t_can_download = file_can_download_bug_attachments( $p_bug_id ); - $t_can_delete = file_can_delete_bug_attachments( $p_bug_id ); $t_preview_text_ext = config_get( 'preview_text_extensions' ); $t_preview_image_ext = config_get( 'preview_image_extensions' ); + PRINT "<table width=\"100%\">\n"; + PRINT " <tr class=\"row-category\">\n"; + PRINT " <td>".lang_get( 'attachments')."</td>\n"; + PRINT " <td>".lang_get( 'file_type')."</td>\n"; + PRINT " <td>".lang_get( 'file_created')."</td>\n"; + PRINT " <td>".lang_get( 'file_size')."</td>\n"; + PRINT " <td>".lang_get( 'file_action')."</td>\n"; + PRINT "</tr>\n"; + $t_current_background = helper_alternate_class(); + $image_previewed = false; for ( $i = 0 ; $i < $num_files ; $i++ ) { + print "\n<tr ".$t_current_background.">\n"; $row = $t_attachment_rows[$i]; extract( $row, EXTR_PREFIX_ALL, 'v' ); $t_file_display_name = string_display_line( file_get_display_name( $v_filename ) ); $t_filesize = number_format( $v_filesize ); $t_date_added = date( config_get( 'normal_date_format' ), db_unixtimestamp( $v_date_added ) ); + $t_can_delete = file_can_delete_bug_attachments( $p_bug_id, $v_id ); + $t_description = string_display_line ( $v_description ); + $t_can_mark_delete = file_can_mark_obsolete( $p_bug_id, $v_id ); + $t_can_mark_patch = file_can_mark_patch( $p_bug_id, $v_id ); if ( $image_previewed ) { $image_previewed = false; @@ -187,22 +210,64 @@ $t_exists = config_get( 'file_upload_method' ) != DISK || file_exists( $v_diskfile ); if ( !$t_exists ) { + print "\n<td colspan=\"5\">\n"; print_file_icon ( $t_file_display_name ); PRINT ' <span class="strike">' . $t_file_display_name . '</span> (attachment missing)'; + print "\n</td>\n"; } else { + print "\n<td>\n"; + if ( $v_patch ) + print "<B>P</B>"; PRINT $t_href_start; print_file_icon ( $t_file_display_name ); - PRINT $t_href_end . ' ' . $t_href_start . $t_file_display_name . - $t_href_end . "$t_href_clicket ($t_filesize bytes) <span class=\"italic\">$t_date_added</span>"; + PRINT $t_href_end . ' '; + if ( $v_obsolete ) { + if ( $t_can_delete || $t_can_mark_delete) { + PRINT $t_href_start . "<span class=\"strike\">" . $t_file_display_name . "</span>" . $t_href_end . $t_href_clicket; + } else { + PRINT "<span class=\"strike\">".$t_file_display_name."</span>"; + } + } else { + PRINT $t_href_start . $t_file_display_name . $t_href_end . $t_href_clicket; + } + print "</td>"; + print "<td>"; + if ( $t_can_mark_patch && !$v_patch ) { + print " [<a class=\"small\" href=\"bug_file_add.php?field=patch&file_id=$v_id&action=1&bug_id=$p_bug_id\">" . lang_get( 'file_patch' ) .'</a>]'; + } else if ( $t_can_mark_patch && $v_patch ) { + print " [<a class=\"small\" href=\"bug_file_add.php?field=patch&file_id=$v_id&action=0&bug_id=$p_bug_id\">" . lang_get( 'file_unpatch' ) .'</a>]'; + } else if ( !$t_can_mark_patch && $v_patch ) { + print lang_get( 'file_is_patch' ); + } else { + print $v_file_type; + } + print "</td>"; + print "<td>".$t_date_added."</td>"; + print "<td>".$t_filesize." bytes</td>"; + + print "<td>"; + # if can change patch status + # if can set to delete if ( $t_can_delete ) { PRINT " [<a class=\"small\" href=\"bug_file_delete.php?file_id=$v_id\">" . lang_get('delete_link') . '</a>]'; } + if ( $t_can_mark_delete && !$v_obsolete ) { + PRINT " [<a class=\"small\" href=\"bug_file_add.php?field=obsolete&file_id=$v_id&action=1&bug_id=$p_bug_id\">" . lang_get( 'file_obsolete' ) . '</a>]'; + } + if ( $t_can_mark_delete && $v_obsolete ) { + PRINT " [<a class=\"small\" href=\"bug_file_add.php?field=obsolete&file_id=$v_id&action=0&bug_id=$p_bug_id\">" . lang_get( 'file_unobsolete' ) . '</a>]'; + } if ( ( FTP == config_get( 'file_upload_method' ) ) && file_exists ( $v_diskfile ) ) { PRINT ' (' . lang_get( 'cached' ) . ')'; } + print "\n</td>\n</tr>\n"; + if ( strlen( $v_description ) > 0 ) { + print "<tr ".$t_current_background."><td colspan=\"5\">"; + print $v_description . "</td></tr>"; + } if ( $t_can_download && ( $v_filesize <= config_get( 'preview_attachments_inline_max_size' ) ) && ( $v_filesize != 0 ) && @@ -222,6 +287,7 @@ PRINT " <span id=\"hideSection_$c_id\">[<a class=\"small\" href='#' id='attmlink_".$c_id."' onclick='swap_content(\"hideSection_".$c_id."\");swap_content(\"showSection_".$c_id."\");return false;'>". lang_get( 'show_content' ) ."</a>]</span>"; PRINT " <span style='display:none' id=\"showSection_$c_id\">[<a class=\"small\" href='#' id='attmlink_".$c_id."' onclick='swap_content(\"hideSection_".$c_id."\");swap_content(\"showSection_".$c_id."\");return false;'>". lang_get( 'hide_content' ) ."</a>]"; + print "\n<tr ".$t_current_background.">\n<td colspan=\"5\">\n"; PRINT "<pre>"; switch ( config_get( 'file_upload_method' ) ) { case DISK: @@ -250,6 +316,7 @@ echo htmlspecialchars($v_content); PRINT "</pre></span>\n"; + print "</td></tr>"; } @@ -258,6 +325,7 @@ ( $v_filesize != 0 ) && ( in_array( strtolower( file_get_extension( $t_file_display_name ) ), $t_preview_image_ext, true ) ) ) { + print "<tr ".$t_current_background."><td colspan=\"5\">"; $t_preview_style = 'border: 0;'; $t_max_width = config_get( 'preview_max_width' ); if ( $t_max_width > 0 ) { @@ -274,13 +342,12 @@ PRINT "\n<br />$t_href_start<img alt=\"$t_title\" $t_preview_style src=\"file_download.php?file_id=$v_id&type=bug\" />$t_href_end"; $image_previewed = true; + print "</td></tr>"; } } - if ( $i != ( $num_files - 1 ) ) { - PRINT "<br />\n"; - } } + print "</table>"; } # -------------------- # delete all files that are associated with the given bug @@ -610,12 +678,20 @@ $t_bug_id = 0; } + if ( $p_user_id == -1 ) + { + $p_user_id = auth_get_current_user_id(); + } # prepare variables for insertion $c_bug_id = db_prepare_int( $p_bug_id ); $c_project_id = db_prepare_int( $t_project_id ); $c_file_type = db_prepare_string( $p_file_type ); $c_title = db_prepare_string( $p_title ); $c_desc = db_prepare_string( $p_desc ); + $c_patch = db_prepare_bool( $p_patch ); + $c_obsolete = db_prepare_bool( $p_obsolete ); + $c_user_id = db_prepare_int( $p_user_id ); + if( $t_project_id == ALL_PROJECTS ) { $t_file_path = config_get( 'absolute_path_default_upload_folder' ); @@ -679,9 +755,9 @@ $c_id = ( 'bug' == $p_table ) ? $c_bug_id : $c_project_id; $query = "INSERT INTO $t_file_table - (" . $p_table . "_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content) + (" . $p_table . "_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content, patch, obsolete, user_id) VALUES - ($c_id, '$c_title', '$c_desc', '$c_disk_file_name', '$c_new_file_name', '$c_file_path', $c_file_size, '$c_file_type', " . db_now() .", $c_content)"; + ($c_id, '$c_title', '$c_desc', '$c_disk_file_name', '$c_new_file_name', '$c_file_path', $c_file_size, '$c_file_type', " . db_now() .", $c_content, $c_patch, $c_obsolete, $c_user_id)"; db_query( $query ); if ( 'bug' == $p_table ) { @@ -794,5 +870,61 @@ } else { return ''; } + } + # -------------------- + # Check if the current user can mark attachment as a patch. + function file_can_mark_patch( $p_bug_id, $p_file_id ) { + if ( bug_is_readonly( $p_bug_id ) ) { + return false; + } + + $t_submitted_by_me = file_is_user_owner( $p_file_id, auth_get_current_user_id() ); + $t_can_mark = access_has_bug_level( config_get( 'allow_mark_patch_threshold' ), $p_bug_id ); + $t_can_download = $t_can_mark || $t_submitted_by_me; + + return $t_can_download; + } + + # -------------------- + # Check if the current user can mark attachment as a obsolete. + function file_can_mark_obsolete( $p_bug_id, $p_file_id ) { + if ( bug_is_readonly( $p_bug_id ) ) { + return false; + } + + $t_submitted_by_me = file_is_user_owner( $p_file_id, auth_get_current_user_id() ); + $t_can_mark = access_has_bug_level( config_get( 'allow_mark_obsolete_threshold' ), $p_bug_id ); + $t_can_download = $t_can_mark || $t_submitted_by_me; + + return $t_can_download; + } + + # -------------------- + # Marks/unmarks file as a patch/obsolete + function file_mark( $p_file_id, $p_field, $p_action, $p_bug_id ) { + if ( bug_is_readonly( $p_bug_id ) ) { + return false; + } + $t_bug_file_table = config_get( 'mantis_bug_file_table' ); + $query = "UPDATE $t_bug_file_table + SET $p_field = $p_action + WHERE id = $p_file_id"; + db_query( $query ); + } + + function file_is_user_owner( $p_file_id, $p_user_id ) { + if ( $p_user_id == file_get_field( $p_file_id, 'user_id' ) ) { + return true; + } + return false; + } + + # abandon files on user deletion + function file_user_abandon( $p_user_id ) { + $t_bug_file_table = config_get ( 'mantis_bug_file_table' ); + $query = "UPDATE $t_bug_file_table + SET user_id = 0 + WHERE id = $p_user_id"; + db_query( $query ); } ?> --- admin/schema.php Fri Feb 13 10:33:15 2009 +++ admin/schema.php Wed May 27 14:41:02 2009 @@ -361,4 +361,12 @@ ", Array( 'mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS' ) ) ); $upgrade[] = Array('CreateIndexSQL', Array( 'idx_typeowner', config_get( 'mantis_tokens_table' ), 'type, owner' ) ); +# mantisbt 0007835 +$upgrade[] = Array( 'AddColumnSQL', Array( config_get( 'mantis_bug_file_table' ), " + user_id I UNSIGNED NOTNULL DEFAULT '0', + patch L NOTNULL DEFAULT \"'0'\", + obsolete L NOTNULL DEFAULT \"'0'\" ") ); ?> --- lang/strings_english.txt Fri Feb 13 10:33:13 2009 +++ lang/strings_english.txt Wed May 27 15:39:29 2009 @@ -1577,4 +1577,17 @@ $s_graph_page = 'Graph Bug History'; $s_graph_bug_page_link = 'Graph'; +# print_api.php +$s_file_comment = 'File description'; +$s_file_remarks = 'Remarks'; +$s_file_patch = 'Mark patch'; +$s_file_unpatch = 'Unmark patch'; +$s_file_obsolete = 'Obsolete'; +$s_file_unobsolete = 'Not obsolete'; +$s_file_type = 'Type'; +$s_file_created = 'Created'; +$s_file_size = 'Size'; +$s_file_status = 'Status'; +$s_file_action = 'Action'; +$s_file_is_patch = 'patch'; ?> --- core/user_api.php Fri Feb 13 10:33:21 2009 +++ core/user_api.php Wed May 27 13:42:33 2009 @@ -25,6 +25,7 @@ require_once( $t_core_dir . 'email_api.php' ); require_once( $t_core_dir . 'ldap_api.php' ); + require_once( $t_core_dir . 'file_api.php' ); ### User API ### @@ -524,6 +525,9 @@ } user_clear_cache( $p_user_id ); + + # abandon user file + file_user_abandon( $p_user_id ); # Remove account $query = "DELETE FROM $t_user_table | ||||
related to | 0008134 | closed | it's not possible to delete own attachments | |
has duplicate | 0008854 | closed | grangeway | request: direct attachment replacement |
has duplicate | 0003442 | closed | vboctor | Add description to uploading files |
has duplicate | 0006603 | closed | dregad | Include descriptions with file attachments |
related to | 0008068 | confirmed | Title of attachment isn't shown | |
related to | 0005009 | acknowledged | Being able to know at what step a file was uploaded ? | |
related to | 0008287 | acknowledged | Missing notification on file attachment | |
related to | 0008947 | new | Reference to uploaded file in Notes |
I can't seem to open the PNG file. I like the idea, but I was thinking that we should support the concept of tags. Hence, an issue can be associated with multiple tags, one of these tags can be "patch". We can still have a check box on the file upload form that automatically associated the "patch" tag with the issue. This will also make filtering easier since it will build on whatever infrastructure we use for tags. |
|
The "tag" concept looks interesting (maybe it's to be discussed further on the ML?) but I think the "patch" property is something to be assigned to single attachments, not to the whole issue. I will try to formalize what it's required for this in the wiki, then I will ask for comments on the ML |
|
Patch submitted.. it must be checked I think |
|
Thanks for the contribution. Here is my comments on the patch. First of all, I note you based the patch on 1.1 code. Our guidelines for stable releases http://www.mantisbt.org/wiki/doku.php/mantisbt:development_scheme does not allow us to add new features there, so you should port the patch to svn trunk. That said, some technical stuff:
For a first round I think it's enough... I also inquired about the status of print_bug_attachments_list() and it seems it is listed under Deprecated functions by mistake. Thank you again |
|
|
|
Thanks for comments.
|
|
Ok. I think stage 1 is ready.
Someone should reviewe it and apply (I hope) |
|
I tried to apply the patch but failed: [giallu@hal9001 mantisbt]$ patch -p2 < diffs any idea? |
|
No idea why.. if patch for config_defailts_inc.php in in the middle of the patch it fails. If I move it to the end.. its ok. Im no diff expert... The fixed file posted as last. |
|
That is what I hate about patches. I keep getting these hunk errors! |
|
Did you get today's fixed patch?? |
|
Well... hunk errors means something is not quite in sync between the reference revision the patch is based on and the revision you are applying the patch to. it's sort of svn and cvs conflict state, so you definitely want to see them :) In this case, it seems smig1o was handcrafting the patch file... |
|
So here is updated patch with brand new attachments table. Enjoy.. |
|
A couple of comments:
|
|
1 @vboctor 2 Seems that I have forgotten about report page... sorru :) |
|
Ok added first >final< patch of the filehelper stage1. I hope its good enough to put it into mantis core. |
|
I found the patch very useful, thank you smig1o. |
|
Removed assignment. giallu will not contribute to this issue in near future. |
|
Hi, |
|