Documentation: improved troubleshooting for error 1502

Added instructions on how to retrieve the category id
Fix occurences of old logo filename

Commit e47a2dcb4b0d90097048e9ba5fa3d1f2c50e188f omitted to change 2
occurences of the logo's old filename (mantis_logo.gif)

Fixes #14119
Fix string_insert_hrefs() to handle URLs with user/password

This function inserts the hrefs in 2 steps: 1) URLs and 2) emails.

When the string contains URLs specifying a username and/or password,
e.g. http://user@example.com/ or http://user:password@example.com/
the 2nd call to pcre_replace() processes the part of it that matches the
email address specification, resulting in broken links and text display
as well as invalid HTML generation.

This commit fixes the behavior by adding logic to distinguish URLs with
password and actual emails addresses.

Fixes #12781
Issue #13998: Logo is not present on new installation.

- Updated config_inc_sample.php to use the new logo filename.
- Commented out all configuration options that are optional (i.e. all
  except db and email).

Fixes #14119
Issue #13998: Logo is not present on new installation.

1. Rename the mantis_logo_238x40.png to mantis_logo.png.  To avoid more
   renames in the future if we change the logo size or design.
2. Added a copy of mantis_logo.png in gif format to match the old file
   name, just in case config_inc.php points to it.  Note that the gif
   version is a lower quality due to the gif format.
3. Changed the code, default configuration, and sample configuration to
   reference mantis_logo.png.
Reduce size of logo in footer, to match the old button height

This is to maintain the page layout as it was before the new logo

Affects #14119
Record reporter+submitted date in extended info first revision history

When updating any of the "extended info" fields (Description, Steps To
Reproduce, Additional Information), the history of modifications is
saved in the mantis_bug_revision_table. When the first change is made
since issue creation, an additional, "initial" revision record is
created to keep track of the original value.

Prior to this, the record was saved with incorrect author and timestamp
information: current user and date of modification, instead of the bug's
reporter and date of submission.

Fixes #14272
Remove unnecessary use of array_reverse() to display bug revisions

Prior to this commit, in bug_revision_view_page.php the array returned
by functions bug_revision_list() and bug_revision_like() was
sytematically reversed by calling array_reverse().

Since these 2 functions are not used anywhere else, it is more efficient
to modify the SQL so that the functions sort the list as it should be
right from the start, thus avoiding the calls to array_reverse().

Note that the ORDER BY clause has been changed from 'timestamp' to 'id',
this guarantees correct display order in case the timestamps are equal
since by definition the id is a sequential number increased with each
revision as it is recorded.

Fixes #14273
Documentation update: revised Admin Guide / Installation
Documentation: revised Admin Guide / Custom Status

Fixed layout of 'programlisting' sections, introducing newlines to make
code more clear and readable. Improved definition of translations for
custom statuses.

Fixes #14279
Documentation: revised Admin Guide / Workflow
Documentation: Admin Guide / Installation including Upgrading

This is a complete overhaul of the Installation chapter, which removes
redundant text and reintroduces Upgrading instructions which were left
out in the conversion from the old 1.0 manual.

Takes into consideration the indications provided in doc/INSTALL.

Removes trailing '.' in chapter id admin.customize

Fixes #11597
Documentation: Admin Guide / revised requirements section

System requirement information was spread out in several sections. This
commit consolidates this into a single section, integrated into the
Installation chapter.

Fixes #14285
Documentation: Admin Guide / revised Backups section

Fixes #14285
Fix #14309: Log all SOAP errors to the server's web log 
Fix #14306: Tabbing to file upload field not possible on report page
Fix Excel export of plug-in columns limited to first 100 rows

Due to an incorrect location of columns_plugin_cache_issue_data()
function call outside of the main loop, only the first 100 rows of
plug-in columns were loaded when exporting issues to Excel.

Thanks to vincent_sels for spotting the issue and identifying the root
cause.

Fixes #14185
Fix PostgreSQL errors with boolean fields

PostgreSQL triggers an error when comparing a boolean field with an
integer value. This happens frequently in MantisBT as AdoDB stores
boolean fields as integers for most RDBMS.

This could prevent for example manage_user_page.php from loading.

To fix the problem, db_prepare_bool() has been modified to return 'true'
or 'false' as appropriate when the DB is PostgreSQL, through use of
AdoDB qstr() function. Behavior for other RDMBS is unchanged.

The where clause condition in manage_user_page.php has been modified to
use db_prepare_bool() instead of hardcoding 'enabled = 1'.

Following code cleanup was also performed:
- Uses of db_prepare_bool() in filter_api.php and mc_api.php that
  would have caused incorrect behavior with the modified function have
  been removed
- Removed non-existant 2nd parameter in call to db_prepare_bool() in
  filter_api.php
- Fix whitespace in mc_api.php

Fixes #14288
Optimize filter_db_get_available_queries()

This function was retrieving a list of filters then, through a for
loop, keeping only the records visible by the current user.

The revised code performs the filtering directly in the SQL.

The same correction was made to mci_filter_db_get_available_queries()
Don't throw error when using db_fetch_array on empty resultset

When you execute a query which returns no results, an error is thrown
when using db_fetch_array() on it, because the method tries to access
the EOF property of an object which in that case is null.

By adding an extra check on the passed p_result to see whether it is
null, you can safely use db_fetch_array for instance in while loops,
without having to always manually check whether or not the result has
rows. This makes code more readable and faster.

Fixes #14336

Signed-off-by: Damien Regad <damien.regad@merckgroup.com>