View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0026627 | mantisbt | feature | public | 2020-01-27 03:39 | 2020-05-27 04:03 |
Reporter | ciwu | Assigned To | atrol | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | duplicate | ||
Product Version | 2.23.0 | ||||
Summary | 0026627: Add files with option "default_bugnote_view_status" set to VS_PRIVATE | ||||
Description | If $g_default_bugnote_view_status is set to VS_PRIVATE the dropzone is set to"display: none". Adding files only possible on issue creation. Did I miss some setting? | ||||
Tags | No tags attached. | ||||
duplicate of | 0026805 | closed | vboctor | Attachments box is invisible when notes are private by default |
related to | 0026699 | new | Inconsistent options for setting public/private status | |
has duplicate | 0026630 | closed | atrol | No file upload possible, if config( 'default_bugnote_view_status' ) is not VS_PUBLIC |
related to | 0026985 | new | Reopen issue problem with option "default_bugnote_view_status" set to VS_PRIVATE |
I think 0026630 is the same. If private files planned or allowed dropzone should be always visible. BTW: |
|
My workaround in "bugnote_add_inc.php": <pre> // insert // change // to Result: Users with no rights for private notes can now attach files while adding (public) notes. Additional change: |
|
@ciwu I think, you are working in the wrong direction. It is indeed possible to add private attachments. I think the bug is just a leftover from the previous situation. Old code: {{{ As the change of the attach_style was removed, it is not possible to do file uploads, if default_bugnote_view_status is not VS_PUBLIC. The $t_attach_style is not necessary any longer. {{{ |
|
I've added $t_attach_style = '' because I would not change too much. Empty string has same effect as removing the whole att_style thing. Our actual setting after 0026627:0063586
Work's as expected. Did I miss something? |
|
This leaves an unused variable. I guess, this is not a good style. But you are right, it needs another fix so that users who are not allowed to set the privacy, create public notes.
... as the access level has to be checked in relation to the bug / project, not the user. The attached patch fixes both. patch.txt (1,355 bytes)
diff --git a/bugnote_add_inc.php b/bugnote_add_inc.php index 92715ef..d78c7d2 100644 --- a/bugnote_add_inc.php +++ b/bugnote_add_inc.php @@ -93,7 +93,7 @@ require_api( 'lang_api.php' ); <?php $t_default_bugnote_view_status = config_get( 'default_bugnote_view_status' ); - $t_bugnote_private = $t_default_bugnote_view_status == VS_PRIVATE; + $t_bugnote_private = $t_default_bugnote_view_status == VS_PRIVATE && access_has_bug_level( config_get( 'set_view_status_threshold' ), $f_bug_id ); $t_bugnote_class = $t_bugnote_private ? 'form-control bugnote-private' : 'form-control'; if( access_has_bug_level( config_get( 'set_view_status_threshold' ), $f_bug_id ) ) { @@ -111,6 +111,7 @@ require_api( 'lang_api.php' ); </tr> <?php }?> + <tr> <th class="category" width="15%"> <?php echo lang_get( 'bugnote' ) ?> @@ -146,9 +147,8 @@ require_api( 'lang_api.php' ); $t_file_upload_max_num = max( 1, config_get( 'file_upload_max_num' ) ); $t_max_file_size = file_get_max_file_size(); - $t_attach_style = ( $t_default_bugnote_view_status != VS_PUBLIC ) ? 'display: none;' : ''; ?> - <tr id="bugnote-attach-files" style="<?php echo $t_attach_style ?>"> + <tr id="bugnote-attach-files"> <th class="category"> <?php echo lang_get( $t_file_upload_max_num == 1 ? 'upload_file' : 'upload_files' ) ?> <br /> |
|
@ciwu, are you okay with the patch? |
|
@polzip can you have a look if it's everything is right there? |
|
@cproensa, thanks for checking. |
|
Can you explain what is exactly the problem there, so i understand the issue? |
|
In the setting as described at 0026627:0063591, the background of a note of someone who is not allowed to add private notes is yellow-private, although it will be a public note. |
|
I'm not familiar with the option
or config_defaults_inc:
It's definition is vague. I'd like more input on this to see if there are mote to fix. |
|
Yet, it's the current behaviour. If the default is private and a user is not allowed to set view_status, the notes are public. See bugnote_add in core/bugnote_api.php Check for private bugnotes: BTW: Where is the syntax for the bugnote markup? How to create such code sections? In older versions of mantis <pre></pre> worked... |
|
Creating a separate topic for the configuration option: 0026699 |
|
I've done it via "user_get_access_level" because in our installation all rights (internal vs external users) based on access level. I'll wait for the next release. |
|