api soap: correct usage of bugnote_set_view_state

Fixes #14573: Updating an issue's view state always sets it to private 

Conflicts:
	tests/soap/IssueNoteTest.php
Fix #14574: MSSQL server 2005 as minimum version
Documentation: RDBMS support note
Fix #14558: Monitors get lost when calling mc_issue_update via SOAP 
mc_issue_api: correct comment styles

Affects #14558: Monitors get lost when calling mc_issue_update via SOAP 
Fix #14587: Dynamic value lists of enumeration custom fields not working for category
Fix #6479: Direct project links

Adding possibility to change the current project id via GET/POST
parameters. Enables direct project selection for the following pages:
 * bug_report_page.php
 * view_all_bug_page.php

Lapinkiller's original patch was modified to align with MantisBT coding
guidelines, and reword the commit message.

Signed-off-by: Damien Regad <damien.regad@merckgroup.com>
Fix #6479: Force page reload to refresh Project Selector
Documentation for $g_allow_signup and $g_send_reset_password

Improves documentation and comments in config_defaults_inc.php, to
reflect the dependency between these 2 variables and the consequences of
having g_send_reset_password = OFF.

Fixes #6263
Allow custom default avatar icons

Following implementation of #13992, it was no longer possible for
administrators to define a custom default avatar, as Mantis forced use
of Gravatar's 'identicon'.

This commit reintroduces that functionality, and allows use of either
one of Gravatar's default images or a custom one (identified by an URL),
through appropriate configuration of $g_show_avatar.

Fixes #14032
Maintain old behavior for default gravatar icons

This is a follow up commit for 06b7b96f19834e30d5beaaa2dcb97e4e7f49a28e
that ensures installations using $g_show_avatar = ON maintain the same
behavior as before. In other words, setting the config to ON is
equivalent to 'identicon'.

Fixes #14032
Store bugnote URL replacement string in a static variable

The purpose is to make code more readable.

Follow up on fix for issue #14447.
Upgrade PHPMailer from 5.1 to 5.2.1

Version 5.2.1 (January 16, 2012)
* Closed several bugs
* Performance improvements
* MsgHTML() now returns the message as required.
* New method: GetSentMIMEMessage() (returns full copy of sent message)

Version 5.2 (July 19, 2011)
* protected MIME body and header
* better DKIM DNS Resource Record support
* better aly handling
* htmlfilter class added to extras
* moved to Apache Extras

Fixes #12562
Fix #14630: Improved logging for emails

Prior to this, several e-mail related events were not reported at all,
making troubleshooting of issues difficult. The following cases are now
logged:

 * sending of queued messages (email_send_all)
 * errors thrown by PHPMailer
 * reminder emails (email_bug_reminder) - fixes #9368
 * deletion of records from the email queue

In addition, admin/email_queue.php was modified to print a formatted
date instead of a numeric timestamp.
Fix #14631: Consistent email validation

PHPMailer uses filter_var() to check for an e-mail validity; this
function treats single-domain e-mail addresses (e.g. user@localhost) as
invalid. However, Mantis API function email_is_valid() relies on a
custom regex to validate e-mails, which does accept such addresses. As a
consequence, we accept addresses to which we are unable to send
messages.

To avoid this problem, we now rely on PHPMailer::ValidateAddress()
method to ensure that any email we store can be sent PHPMailer.
Do not skip e-mail validation if $g_login_method != LDAP

Prior to this, function email_is_valid() always returned true when
$g_use_ldap_email = ON, even if $g_login_method != LDAP.

Even though this is not an usual case (when not using LDAP, the other
LDAP-related configuration options should be left to their default
values), this causes the actual validation to be skipped which could
lead to email sending errors.

Fixes #14632
Bugnote '~' processing may produce error if bug does not exist

This error case is a bit far-fetched, and should normally not occur
unless there is some data corruption. If referencing an existing bugnote
whose parent bug is not in the database, the callback function cannot
retrieve the project_id, so error 403 is triggered.

The callback functions have also been reformatted for better readability

Fixes #12580
Protect $g_default_category_for_moves from deletion

When a category defined as default_category_for_moves is deleted and an
issue is subsequently moved to another project where its current
category does not exist, it gets assigned a non-existing category. This
causes application error 1502 to be triggered whenever MantisBT tries to
display the issue's Category, which can cause a system lock up.

This commit reduces the risk of this situation from happening, by
preventing users from deleting categories which are used as default
(either defined in config_inc.php or in the config table).

Fixes #14478
Fix #14655: Filtering of tags starting with '0' not possible
Follow up fix for #14655 master