bux fix for custom upgrade streams

line 199: in case of custom upgrade streams, variable $signature contains the last value from the foreach cycle at line 130, not the core schema signature!

line 209: if we do not insert schema signatures for each custom stream, after install osTicket thinks it needs an upgrade and gets stuck (see function isUpgradePending() in class.ticket)
auth: Handle REQUEST_URI not being authoritative

If _SERVER{REQUEST_URI} does not start with a leading slash, add one. This
will ensure that the redirect URL offered after a successful login will
be to an absolute url rather than an implied relative one.

Fixes osTicket/osTicket-1.7#858
Faster SQL-query, huge performance improvement on installations with thousands of tickets.
perf: Slight simplification of SQL tweak

'where 1' and 'where 1=1' gives me hives...
templates: %{ticket.phone} shows the entire number

Previously, due to a bug in Ticket::getPhone(), the first digit of the
formatted phone number was displayed only. This patch will allow display of
the entire formatted phone number.

Fixes osTicket/osTicket-1.8#248
ui: Fix large image display

Fixes oversize image display to be resized in both the ticket thread and
the redactor editor in (at least)

  * Ticket-view boxes
  * Client new-ticket form
  * Staff new ticket
  * Page add/edit
  * FAQ add/edit
  * Canned response add/edit

Fixes osTicket/osTicket-1.8#247
Merge pull request #861 from greezybacon/issue/858

auth: Handle REQUEST_URI not being authoritative

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #862 from greezybacon/issue/856

perf: Significant improvement fetching statistics

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #250 from greezybacon/issue/248

templates: %{ticket.phone} shows the entire number

Reviewed-By:  Peter Rotich <peter@osticket.com>
Merge pull request #251 from greezybacon/issue/247

ui: Fix large image display

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge remote branch 'upstream-1.7/develop' into develop

Merge more upstream 1.7.3+ changes

Conflicts:
	main.inc.php
upgrader: Correct deleted function call
Merge pull request #259 from greezybacon/issue/upgrade-no-ajax

upgrader: Correct deleted function call

Reviewed-By: Peter Rotich <peter@osticket.com>
fetch: Multiple email fetches may reflect same user

If two emails were fetched in the same timeframe, they may both be assigned
to the same user account.
Merge pull request #260 from greezybacon/issue/multi-fetch-same-user

fetch: Multiple email fetches may reflect same user

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #854 from alpianon/patch-1

bug fix for custom upgrade streams

Reviewed-By: Jared Hancock <jared@osticket.com>
Merge remote branch 'upstream-1.7/develop' into develop

Conflicts:
	setup/inc/class.installer.php
install: Fixup help tips on installer
install: Make help tip consistent with scp tips
fetch: Fix clobbered user on fetch, round two

Again, fix issue where multiple mails fetched in the same fetch run will set
the user of each of the mails to the user of the first email fetched.

The previous patch neglected to pass the new $cache argument through the
inherited UserForm::getFields() function.