Fix #15453: Only display Close button if workflow allows Closed status
Documentation: custom fields localization

The indications in the Custom Fields localization section contained an
incorrect reference to lang_get_current() to determine the current
language in custom_strings_inc.php. Using this function will cause the
code to return incorrect translations if the default language is
different from English.

Fixes #10118
Fix #2971: add reminder events to the bug history
Removed trailing ':' from reminder_sent_to language string

This is for consistency, as except for error messages punctuation is
generally added by the code.

Issue #2971
Improve handling of reminders' recipients list truncation

Replaced the previous method of truncating the list to a hardcoded
number of entries (50), to a more robust approach based on the size of
the underlying database field (250 chars, note_attr in bugnote table).

Added a message on the REMINDER bugnote, to inform user that the list of
recipients stored with the note, was actually truncated (Users should
refer to the issue's history to see who actually received the reminder).

This functionality relies on a hack, i.e. to indicate that the list was
truncated, bug_reminder.php is not storing the trailing delimiter in the
note_attr field, and this is picked up in bugnote_view_inc.php to
display the note to the user's attention.

Fixes #15470
Optimize code to add reminder recipients to monitoring list
Fix return value of email_bug_reminder()

The function now returns an array containing only the users to whom the
reminder e-mail was actually sent (i.e. excludes failures, blank e-mails,
etc).

In addition, the return value is now an array of user id's instead of
user names, which indeed makes more sense from an API perspective, as
mentioned by Julian Fitzell in 5ea3d0bc837ef14fd66b63d63e5481ea3addcf29,
since the function's only caller is bug_reminder.php which exclusively
relies on user id's.

Fixes #15472
bug_reminder.php does not handle unsent reminders

Reminders are not logged in history (or the bugnote) if the e-mail was not
actually sent to the recipient.

The function now uses email_bug_reminder()'s return value instead of the
full user-provided list of recipients for inclusion in the reminder's
bugnote and to add history entries.

Fixes #15471
Fix #15481: custom field values sort order in view all page filter

Commit b5abce1f917da688c86aec17dee11111ced5f0b7 introduced a regression
in the sort order of custom field values because the query retrieving
the custom field values was rewritten with a SELECT DISTINCT instead of
using a GROUP BY clause. With MySQL, group by sorts the results, whereas
distinct does not (not tested with other RDBMS).

This fixes the issue by adding an ORDER BY clause.
Fix #15511: XSS vulnerability when deleting a version
Fix #15517: soap API datatype for DateTime

Wrong datatype for DateTime  'dateTime' vs. 'xsd:dateTime'
results in an error during deserialization in .net

Signed-off-by: Damien Regad <damien.regad@merckgroup.com>
Fix #15522: SOAP mc_project_get_issues now reports due_date

Signed-off-by: Damien Regad <damien.regad@merckgroup.com>
Fix crash when report_bug_threshold=array in access_has_bug_level

When displaying a bug for which the user is not the reporter,
$g_limit_reporters=ON and the workflow is set so report_bug_threshold is
an array, MantisBT crashes with "PHP Fatal error: Unsupported operand
types".

This is due to use of '+ 1' to indicate that user should have the next
higher access level to view the issue. We now use the same logic but
within a foreach loop to check against each array element.

Fixes #15538
Fix #15540: Wrong example code for custom status translation
Optimize performance of access_has_bug_level() api function

Through use of a static array to cache the reporter threshold when
$g_limit_reporter = ON and more importantly reducing the total number of
API calls, the performance of this function has been improved by 65%
(stress tests executed over 2000 iterations, 0.34s vs 0.22s).

Issue #15538, follow up on b3276bbf50abdf53eaa9ef3b20ddb9461aaf1808
Fix #13054: Install: don't suppress errors when including libraries
Fix invalid access denied error caused by access_has_bug_level()

Commit d42e80c01277eec37c7436a23ec72073c9961c49 changed the code in
access_has_bug_level() function, and introduced a bug as the final call
to access_compare_level() inverted the 2 parameters which caused an
incorrect return value to be returned in certain cases, incorrectly
denying access to issues.

Issue #15538
Issue #15556: remove unused variable

$c_private is initialized but never used in bugnote_add()'s scope.
Documentation: added step in Customizing Status Values section

We now include instructions to check and update existing workflow
configurations to include the new status values.

Fixes #10047
Fix #15558: url_get() fallback to next method in case of error