issue: Calling Non-Static Statically
This addresses the `Non-static method XXX cannot be called statically` errors.
This commit is contained in:
2
ajax.php
2
ajax.php
@@ -48,5 +48,5 @@ $dispatcher = patterns('',
|
||||
))
|
||||
);
|
||||
Signal::send('ajax.client', $dispatcher);
|
||||
print $dispatcher->resolve($ost->get_path_info());
|
||||
print $dispatcher->resolve(Osticket::get_path_info());
|
||||
?>
|
||||
|
||||
@@ -32,5 +32,5 @@ $dispatcher = patterns('',
|
||||
Signal::send('api', $dispatcher);
|
||||
|
||||
# Call the respective function
|
||||
print $dispatcher->resolve($ost->get_path_info());
|
||||
print $dispatcher->resolve(Osticket::get_path_info());
|
||||
?>
|
||||
|
||||
@@ -28,4 +28,4 @@ require_once INCLUDE_DIR.'/class.dispatcher.php';
|
||||
$dispatcher = new Dispatcher();
|
||||
|
||||
Signal::send('ajax.client', $dispatcher);
|
||||
print $dispatcher->resolve($ost->get_path_info());
|
||||
print $dispatcher->resolve(Osticket::get_path_info());
|
||||
|
||||
@@ -49,7 +49,7 @@ class Bootstrap {
|
||||
$_SERVER['REMOTE_ADDR'] = '';
|
||||
}
|
||||
|
||||
function https() {
|
||||
static function https() {
|
||||
return osTicket::is_https();
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ class Bootstrap {
|
||||
define('TIMEZONE_TABLE',$prefix.'timezone');
|
||||
}
|
||||
|
||||
function loadConfig() {
|
||||
static function loadConfig() {
|
||||
#load config info
|
||||
$configfile='';
|
||||
if(file_exists(INCLUDE_DIR.'ost-config.php')) //NEW config file v 1.6 stable ++
|
||||
@@ -180,7 +180,7 @@ class Bootstrap {
|
||||
define('SESSION_TTL', 86400); // Default 24 hours
|
||||
}
|
||||
|
||||
function connect() {
|
||||
static function connect() {
|
||||
#Connect to the DB && get configuration from database
|
||||
$ferror=null;
|
||||
$options = array();
|
||||
@@ -201,7 +201,7 @@ class Bootstrap {
|
||||
self::croak($ferror);
|
||||
}
|
||||
|
||||
function loadCode() {
|
||||
static function loadCode() {
|
||||
#include required files
|
||||
require_once INCLUDE_DIR.'class.util.php';
|
||||
require_once INCLUDE_DIR.'class.translation.php';
|
||||
@@ -221,7 +221,7 @@ class Bootstrap {
|
||||
require_once INCLUDE_DIR.'class.queue.php';
|
||||
}
|
||||
|
||||
function i18n_prep() {
|
||||
static function i18n_prep() {
|
||||
ini_set('default_charset', 'utf-8');
|
||||
ini_set('output_encoding', 'utf-8');
|
||||
|
||||
@@ -310,7 +310,7 @@ class Bootstrap {
|
||||
}
|
||||
}
|
||||
|
||||
function croak($message) {
|
||||
static function croak($message) {
|
||||
$msg = $message."\n\n".THISPAGE;
|
||||
Mailer::sendmail(ADMIN_EMAIL, 'osTicket Fatal Error', $msg,
|
||||
sprintf('"osTicket Alerts"<%s>', ADMIN_EMAIL));
|
||||
|
||||
@@ -762,7 +762,7 @@ class Services_JSON
|
||||
/**
|
||||
* @todo Ultimately, this should just call PEAR::isError()
|
||||
*/
|
||||
function isError($data, $code = null)
|
||||
static function isError($data, $code = null)
|
||||
{
|
||||
if (class_exists('pear')) {
|
||||
return PEAR::isError($data, $code);
|
||||
|
||||
@@ -146,7 +146,7 @@ class Spyc {
|
||||
* @return array
|
||||
* @param string $input Path of YAML file or string containing YAML
|
||||
*/
|
||||
function YAMLLoad($input) {
|
||||
static function YAMLLoad($input) {
|
||||
$Spyc = new Spyc;
|
||||
return $Spyc->__load($input);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class AdminAjaxAPI extends AjaxController {
|
||||
}
|
||||
|
||||
$title = __("Add New Department");
|
||||
$path = ltrim($ost->get_path_info(), '/');
|
||||
$path = ltrim(Osticket::get_path_info(), '/');
|
||||
|
||||
include STAFFINC_DIR . 'templates/quick-add.tmpl.php';
|
||||
}
|
||||
@@ -95,7 +95,7 @@ class AdminAjaxAPI extends AjaxController {
|
||||
}
|
||||
|
||||
$title = __("Add New Team");
|
||||
$path = ltrim($ost->get_path_info(), '/');
|
||||
$path = ltrim(Osticket::get_path_info(), '/');
|
||||
|
||||
include STAFFINC_DIR . 'templates/quick-add.tmpl.php';
|
||||
}
|
||||
@@ -139,7 +139,7 @@ class AdminAjaxAPI extends AjaxController {
|
||||
}
|
||||
|
||||
$title = __("Add New Role");
|
||||
$path = ltrim($ost->get_path_info(), '/');
|
||||
$path = ltrim(Osticket::get_path_info(), '/');
|
||||
|
||||
include STAFFINC_DIR . 'templates/quick-add-role.tmpl.php';
|
||||
}
|
||||
@@ -186,7 +186,7 @@ class AdminAjaxAPI extends AjaxController {
|
||||
}
|
||||
|
||||
$title = __("Add New Agent");
|
||||
$path = ltrim($ost->get_path_info(), '/');
|
||||
$path = ltrim(Osticket::get_path_info(), '/');
|
||||
|
||||
include STAFFINC_DIR . 'templates/quick-add.tmpl.php';
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ require_once(INCLUDE_DIR.'class.draft.php');
|
||||
|
||||
class DraftAjaxAPI extends AjaxController {
|
||||
|
||||
function _createDraft($vars) {
|
||||
static function _createDraft($vars) {
|
||||
if (false === ($vars['body'] = self::_findDraftBody($_POST)))
|
||||
return JsonDataEncoder::encode(array(
|
||||
'error' => __("Draft body not found in request"),
|
||||
@@ -22,7 +22,7 @@ class DraftAjaxAPI extends AjaxController {
|
||||
));
|
||||
}
|
||||
|
||||
function _getDraft($draft) {
|
||||
static function _getDraft($draft) {
|
||||
if (!$draft || !$draft instanceof Draft)
|
||||
Http::response(205, "Draft not found. Create one first");
|
||||
|
||||
@@ -35,7 +35,7 @@ class DraftAjaxAPI extends AjaxController {
|
||||
));
|
||||
}
|
||||
|
||||
function _updateDraft($draft) {
|
||||
static function _updateDraft($draft) {
|
||||
if (false === ($body = self::_findDraftBody($_POST)))
|
||||
return JsonDataEncoder::encode(array(
|
||||
'error' => array(
|
||||
@@ -50,7 +50,7 @@ class DraftAjaxAPI extends AjaxController {
|
||||
echo "{}";
|
||||
}
|
||||
|
||||
function _uploadInlineImage($draft) {
|
||||
static function _uploadInlineImage($draft) {
|
||||
global $cfg;
|
||||
|
||||
if (!isset($_POST['data']) && !isset($_FILES['file']))
|
||||
@@ -376,7 +376,7 @@ class DraftAjaxAPI extends AjaxController {
|
||||
echo JsonDataEncoder::encode($files);
|
||||
}
|
||||
|
||||
function _findDraftBody($vars) {
|
||||
static function _findDraftBody($vars) {
|
||||
if (isset($vars['name'])) {
|
||||
$parts = array();
|
||||
// Support nested `name`, like trans[lang]
|
||||
|
||||
@@ -85,7 +85,7 @@ class KbaseAjaxAPI extends AjaxController {
|
||||
|
||||
$title = __("Manage FAQ Access");
|
||||
$verb = __('Update');
|
||||
$path = ltrim($ost->get_path_info(), '/');
|
||||
$path = ltrim(Osticket::get_path_info(), '/');
|
||||
|
||||
include STAFFINC_DIR . 'templates/quick-add.tmpl.php';
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class StaffAjaxAPI extends AjaxController {
|
||||
|
||||
$title = __("Set Agent Password");
|
||||
$verb = $id == 0 ? __('Set') : __('Update');
|
||||
$path = ltrim($ost->get_path_info(), '/');
|
||||
$path = ltrim(Osticket::get_path_info(), '/');
|
||||
|
||||
include STAFFINC_DIR . 'templates/quick-add.tmpl.php';
|
||||
}
|
||||
@@ -119,7 +119,7 @@ class StaffAjaxAPI extends AjaxController {
|
||||
|
||||
$title = __("Change Password");
|
||||
$verb = __('Update');
|
||||
$path = ltrim($ost->get_path_info(), '/');
|
||||
$path = ltrim(Osticket::get_path_info(), '/');
|
||||
|
||||
include STAFFINC_DIR . 'templates/quick-add.tmpl.php';
|
||||
}
|
||||
@@ -163,7 +163,7 @@ class StaffAjaxAPI extends AjaxController {
|
||||
|
||||
$title = __("Reset Agent Permissions");
|
||||
$verb = __("Continue");
|
||||
$path = ltrim($ost->get_path_info(), '/');
|
||||
$path = ltrim(Osticket::get_path_info(), '/');
|
||||
|
||||
include STAFFINC_DIR . 'templates/reset-agent-permissions.tmpl.php';
|
||||
}
|
||||
@@ -205,7 +205,7 @@ class StaffAjaxAPI extends AjaxController {
|
||||
|
||||
$title = __("Change Primary Department");
|
||||
$verb = __("Continue");
|
||||
$path = ltrim($ost->get_path_info(), '/');
|
||||
$path = ltrim(Osticket::get_path_info(), '/');
|
||||
|
||||
include STAFFINC_DIR . 'templates/quick-add.tmpl.php';
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ class ThreadAjaxAPI extends AjaxController {
|
||||
return $resp;
|
||||
}
|
||||
|
||||
function _addcollaborator($thread, $user=null, $form=null, $type=null, $info=array()) {
|
||||
static function _addcollaborator($thread, $user=null, $form=null, $type=null, $info=array()) {
|
||||
global $thisstaff;
|
||||
|
||||
$info += array(
|
||||
@@ -227,7 +227,7 @@ class ThreadAjaxAPI extends AjaxController {
|
||||
|
||||
|
||||
|
||||
function _collaborator($collaborator, $form=null, $info=array()) {
|
||||
static function _collaborator($collaborator, $form=null, $info=array()) {
|
||||
global $thisstaff;
|
||||
|
||||
$info += array('action' => sprintf('#thread/%d/collaborators/%d',
|
||||
@@ -243,7 +243,7 @@ class ThreadAjaxAPI extends AjaxController {
|
||||
return $resp;
|
||||
}
|
||||
|
||||
function _collaborators($thread, $info=array()) {
|
||||
static function _collaborators($thread, $info=array()) {
|
||||
|
||||
ob_start();
|
||||
include(STAFFINC_DIR . 'templates/collaborators.tmpl.php');
|
||||
|
||||
@@ -318,7 +318,7 @@ class TicketsAjaxAPI extends AjaxController {
|
||||
return self::_userlookup($user, null, $info);
|
||||
}
|
||||
|
||||
function _userlookup($user, $form, $info) {
|
||||
static function _userlookup($user, $form, $info) {
|
||||
global $thisstaff;
|
||||
|
||||
ob_start();
|
||||
@@ -450,7 +450,7 @@ class TicketsAjaxAPI extends AjaxController {
|
||||
return self::_updateMerge($parent, $tickets, $info);
|
||||
}
|
||||
|
||||
private function _updateMerge($ticket, $tickets, $info) {
|
||||
static private function _updateMerge($ticket, $tickets, $info) {
|
||||
include(STAFFINC_DIR . 'templates/merge-tickets.tmpl.php');
|
||||
}
|
||||
|
||||
@@ -994,7 +994,7 @@ class TicketsAjaxAPI extends AjaxController {
|
||||
foreach ($tickets as $ticket) {
|
||||
list($ticket_id, $flags, $dept_id, $ticket_pid) = $ticket;
|
||||
$mergeType = Ticket::getMergeTypeByFlag($flags);
|
||||
$isParent = Ticket::isParent($flags);
|
||||
$isParent = Ticket::isParentStatic($flags);
|
||||
$role = $thisstaff->getRole($dept_id);
|
||||
$hasPermission[] = $role->hasPerm($permission);
|
||||
|
||||
@@ -1670,7 +1670,7 @@ class TicketsAjaxAPI extends AjaxController {
|
||||
$thread->triggerAction($action);
|
||||
}
|
||||
|
||||
private function _changeSelectedTicketsStatus($state, $info=array(), $errors=array()) {
|
||||
private static function _changeSelectedTicketsStatus($state, $info=array(), $errors=array()) {
|
||||
|
||||
$count = $_REQUEST['count'] ?:
|
||||
($_REQUEST['tids'] ? count($_REQUEST['tids']) : 0);
|
||||
@@ -1702,7 +1702,7 @@ class TicketsAjaxAPI extends AjaxController {
|
||||
return self::_changeStatus($state, $info, $errors);
|
||||
}
|
||||
|
||||
private function _changeTicketStatus($ticket, $state, $info=array(), $errors=array()) {
|
||||
private static function _changeTicketStatus($ticket, $state, $info=array(), $errors=array()) {
|
||||
|
||||
$verb = TicketStateField::getVerb($state);
|
||||
|
||||
@@ -1738,7 +1738,7 @@ class TicketsAjaxAPI extends AjaxController {
|
||||
return self::_changeStatus($state, $info, $errors);
|
||||
}
|
||||
|
||||
private function _changeStatus($state, $info=array(), $errors=array()) {
|
||||
private static function _changeStatus($state, $info=array(), $errors=array()) {
|
||||
|
||||
if ($info && isset($info['errors']))
|
||||
$errors = array_merge($errors, $info['errors']);
|
||||
|
||||
@@ -178,7 +178,7 @@ class UsersAjaxAPI extends AjaxController {
|
||||
include(STAFFINC_DIR . 'templates/user.tmpl.php');
|
||||
}
|
||||
|
||||
function register($id) {
|
||||
static function register($id) {
|
||||
global $thisstaff;
|
||||
|
||||
if (!$thisstaff)
|
||||
@@ -286,7 +286,7 @@ class UsersAjaxAPI extends AjaxController {
|
||||
return self::addUser();
|
||||
}
|
||||
|
||||
function addUser() {
|
||||
static function addUser() {
|
||||
global $thisstaff;
|
||||
|
||||
$info = array();
|
||||
|
||||
@@ -35,7 +35,7 @@ class LocalCronApiController extends CronApiController {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
function call() {
|
||||
static function call() {
|
||||
$cron = new LocalCronApiController();
|
||||
$cron->run();
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ class PipeApiController extends TicketApiController {
|
||||
exit($exitcode);
|
||||
}
|
||||
|
||||
function process() {
|
||||
static function process() {
|
||||
$pipe = new PipeApiController();
|
||||
if(($ticket=$pipe->processEmail()))
|
||||
return $pipe->response(201, $ticket->getNumber());
|
||||
|
||||
@@ -91,15 +91,15 @@ class API {
|
||||
}
|
||||
|
||||
/** Static functions **/
|
||||
function add($vars, &$errors) {
|
||||
static function add($vars, &$errors) {
|
||||
return API::save(0, $vars, $errors);
|
||||
}
|
||||
|
||||
function validate($key, $ip) {
|
||||
static function validate($key, $ip) {
|
||||
return ($key && $ip && self::getIdByKey($key, $ip));
|
||||
}
|
||||
|
||||
function getIdByKey($key, $ip='') {
|
||||
static function getIdByKey($key, $ip='') {
|
||||
|
||||
$sql='SELECT id FROM '.API_KEY_TABLE.' WHERE apikey='.db_input($key);
|
||||
if($ip)
|
||||
@@ -111,15 +111,15 @@ class API {
|
||||
return $id;
|
||||
}
|
||||
|
||||
function lookupByKey($key, $ip='') {
|
||||
static function lookupByKey($key, $ip='') {
|
||||
return self::lookup(self::getIdByKey($key, $ip));
|
||||
}
|
||||
|
||||
function lookup($id) {
|
||||
static function lookup($id) {
|
||||
return ($id && is_numeric($id) && ($k= new API($id)) && $k->getId()==$id)?$k:null;
|
||||
}
|
||||
|
||||
function save($id, $vars, &$errors) {
|
||||
static function save($id, $vars, &$errors) {
|
||||
|
||||
if(!$id && (!$vars['ipaddr'] || !Validator::is_ip($vars['ipaddr'])))
|
||||
$errors['ipaddr'] = __('Valid IP is required');
|
||||
@@ -382,9 +382,9 @@ class ApiXmlDataParser extends XmlDataParser {
|
||||
include_once "class.json.php";
|
||||
class ApiJsonDataParser extends JsonDataParser {
|
||||
static function parse($stream, $tidy=false) {
|
||||
return $this->fixup(parent::parse($stream));
|
||||
return self::fixup(parent::parse($stream));
|
||||
}
|
||||
function fixup($current) {
|
||||
static function fixup($current) {
|
||||
if (!is_array($current))
|
||||
return $current;
|
||||
foreach ($current as $key=>&$value) {
|
||||
@@ -427,7 +427,7 @@ class ApiJsonDataParser extends JsonDataParser {
|
||||
include_once "class.mailparse.php";
|
||||
class ApiEmailDataParser extends EmailDataParser {
|
||||
|
||||
function parse($stream) {
|
||||
static function parse($stream) {
|
||||
return $this->fixup(parent::parse($stream));
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class Application {
|
||||
array('desc'=>$desc, 'href'=>$href));
|
||||
}
|
||||
|
||||
function getStaffApps() {
|
||||
static function getStaffApps() {
|
||||
return self::$staff_apps;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class Application {
|
||||
array('desc'=>$desc, 'href'=>$href));
|
||||
}
|
||||
|
||||
function getClientApps() {
|
||||
static function getClientApps() {
|
||||
return self::$client_apps;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class Application {
|
||||
array('desc'=>$desc, 'href'=>$href));
|
||||
}
|
||||
|
||||
function getAdminApps() {
|
||||
static function getAdminApps() {
|
||||
return self::$admin_apps;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ abstract class AuthenticationBackend {
|
||||
* $forcedAuth - indicate if authentication is required.
|
||||
*
|
||||
*/
|
||||
function processSignOn(&$errors, $forcedAuth=true) {
|
||||
static function processSignOn(&$errors, $forcedAuth=true) {
|
||||
|
||||
foreach (static::allRegistered() as $bk) {
|
||||
// All backends are queried here, even if they don't support
|
||||
@@ -437,7 +437,7 @@ abstract class AuthenticationBackend {
|
||||
abstract function authenticate($username, $password);
|
||||
abstract function login($user, $bk);
|
||||
abstract static function getUser(); //Validates authenticated users.
|
||||
abstract function getAllowedBackends($userid);
|
||||
abstract static function getAllowedBackends($userid);
|
||||
abstract protected function getAuthKey($user);
|
||||
abstract static function signOut($user);
|
||||
}
|
||||
@@ -489,7 +489,7 @@ abstract class StaffAuthenticationBackend extends AuthenticationBackend {
|
||||
return array_merge(self::$_registry, parent::allRegistered());
|
||||
}
|
||||
|
||||
function isBackendAllowed($staff, $bk) {
|
||||
static function isBackendAllowed($staff, $bk) {
|
||||
|
||||
if (!($backends=self::getAllowedBackends($staff->getId())))
|
||||
return true; //No restrictions
|
||||
@@ -509,7 +509,7 @@ abstract class StaffAuthenticationBackend extends AuthenticationBackend {
|
||||
return $policies;
|
||||
}
|
||||
|
||||
function getAllowedBackends($userid) {
|
||||
static function getAllowedBackends($userid) {
|
||||
|
||||
$backends =array();
|
||||
//XXX: Only one backend can be specified at the moment.
|
||||
@@ -718,7 +718,7 @@ abstract class UserAuthenticationBackend extends AuthenticationBackend {
|
||||
return $policies;
|
||||
}
|
||||
|
||||
function getAllowedBackends($userid) {
|
||||
static function getAllowedBackends($userid) {
|
||||
$backends = array();
|
||||
$sql = 'SELECT A1.backend FROM '.USER_ACCOUNT_TABLE
|
||||
.' A1 INNER JOIN '.USER_EMAIL_TABLE.' A2 ON (A2.user_id = A1.user_id)'
|
||||
@@ -928,7 +928,7 @@ abstract class AuthStrikeBackend extends AuthenticationBackend {
|
||||
return false;
|
||||
}
|
||||
|
||||
function getAllowedBackends($userid) {
|
||||
static function getAllowedBackends($userid) {
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -945,8 +945,8 @@ abstract class AuthStrikeBackend extends AuthenticationBackend {
|
||||
|
||||
}
|
||||
|
||||
abstract function authStrike($credentials);
|
||||
abstract function authTimeout();
|
||||
abstract static function authStrike($credentials);
|
||||
abstract static function authTimeout();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -954,7 +954,7 @@ abstract class AuthStrikeBackend extends AuthenticationBackend {
|
||||
*/
|
||||
class StaffAuthStrikeBackend extends AuthStrikeBackend {
|
||||
|
||||
function authTimeout() {
|
||||
static function authTimeout() {
|
||||
global $ost;
|
||||
|
||||
$cfg = $ost->getConfig();
|
||||
@@ -975,7 +975,7 @@ class StaffAuthStrikeBackend extends AuthStrikeBackend {
|
||||
$authsession['strikes']=0;
|
||||
}
|
||||
|
||||
function authstrike($credentials) {
|
||||
static function authstrike($credentials) {
|
||||
global $ost;
|
||||
|
||||
$cfg = $ost->getConfig();
|
||||
@@ -1023,7 +1023,7 @@ StaffAuthenticationBackend::register('StaffAuthStrikeBackend');
|
||||
*/
|
||||
class UserAuthStrikeBackend extends AuthStrikeBackend {
|
||||
|
||||
function authTimeout() {
|
||||
static function authTimeout() {
|
||||
global $ost;
|
||||
|
||||
$cfg = $ost->getConfig();
|
||||
@@ -1044,7 +1044,7 @@ class UserAuthStrikeBackend extends AuthStrikeBackend {
|
||||
$authsession['strikes']=0;
|
||||
}
|
||||
|
||||
function authstrike($credentials) {
|
||||
static function authstrike($credentials) {
|
||||
global $ost;
|
||||
|
||||
$cfg = $ost->getConfig();
|
||||
|
||||
@@ -52,7 +52,7 @@ abstract class AvatarSource {
|
||||
$this->mode = $mode;
|
||||
}
|
||||
|
||||
function getName() {
|
||||
static function getName() {
|
||||
return __(static::$name);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,11 +52,11 @@ class Banlist {
|
||||
return false;
|
||||
}
|
||||
|
||||
function includes($email) {
|
||||
static function includes($email) {
|
||||
return self::getSystemBanList()->containsRule('email','equal',$email);
|
||||
}
|
||||
|
||||
function ensureSystemBanList() {
|
||||
static function ensureSystemBanList() {
|
||||
|
||||
if (!($id=Filter::getByName('SYSTEM BAN LIST')))
|
||||
$id=self::createSystemBanList();
|
||||
@@ -64,7 +64,7 @@ class Banlist {
|
||||
return $id;
|
||||
}
|
||||
|
||||
function createSystemBanList() {
|
||||
static function createSystemBanList() {
|
||||
# XXX: Filter::create should return the ID!!!
|
||||
$errors=array();
|
||||
return Filter::create(array(
|
||||
@@ -80,7 +80,7 @@ class Banlist {
|
||||
), $errors);
|
||||
}
|
||||
|
||||
function getSystemBanList() {
|
||||
static function getSystemBanList() {
|
||||
return self::ensureSystemBanList();
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ extends VerySimpleModel {
|
||||
return $responses;
|
||||
}
|
||||
|
||||
function responsesByDeptId($deptId, $explicit=false) {
|
||||
static function responsesByDeptId($deptId, $explicit=false) {
|
||||
return self::getCannedResponses($deptId, $explicit);
|
||||
}
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ extends VerySimpleModel {
|
||||
))->delete();
|
||||
}
|
||||
|
||||
function getConfigsByNamespace($namespace=false, $key, $value=false) {
|
||||
static function getConfigsByNamespace($namespace=false, $key, $value=false) {
|
||||
$filter = array();
|
||||
|
||||
$filter['key'] = $key;
|
||||
@@ -1778,7 +1778,7 @@ class OsticketConfig extends Config {
|
||||
}
|
||||
|
||||
//Used to detect version prior to 1.7 (useful during upgrade)
|
||||
/* static */ function getDBVersion() {
|
||||
static function getDBVersion() {
|
||||
$sql='SELECT `ostversion` FROM '.TABLE_PREFIX.'config '
|
||||
.'WHERE id=1';
|
||||
return db_result(db_query($sql));
|
||||
|
||||
@@ -20,12 +20,12 @@ require_once INCLUDE_DIR.'class.signal.php';
|
||||
|
||||
class Cron {
|
||||
|
||||
function MailFetcher() {
|
||||
static function MailFetcher() {
|
||||
require_once(INCLUDE_DIR.'class.mailfetch.php');
|
||||
MailFetcher::run(); //Fetch mail..frequency is limited by email account setting.
|
||||
}
|
||||
|
||||
function TicketMonitor() {
|
||||
static function TicketMonitor() {
|
||||
require_once(INCLUDE_DIR.'class.ticket.php');
|
||||
Ticket::checkOverdue(); //Make stale tickets overdue
|
||||
// Cleanup any expired locks
|
||||
@@ -34,34 +34,35 @@ class Cron {
|
||||
|
||||
}
|
||||
|
||||
function PurgeLogs() {
|
||||
static function PurgeLogs() {
|
||||
global $ost;
|
||||
// Once a day on a 5-minute cron
|
||||
if (rand(1,300) == 42)
|
||||
if($ost) $ost->purgeLogs();
|
||||
}
|
||||
|
||||
function PurgeDrafts() {
|
||||
static function PurgeDrafts() {
|
||||
require_once(INCLUDE_DIR.'class.draft.php');
|
||||
Draft::cleanup();
|
||||
}
|
||||
|
||||
function CleanOrphanedFiles() {
|
||||
static function CleanOrphanedFiles() {
|
||||
require_once(INCLUDE_DIR.'class.file.php');
|
||||
AttachmentFile::deleteOrphans();
|
||||
}
|
||||
|
||||
function CleanExpiredSessions() {
|
||||
static function CleanExpiredSessions() {
|
||||
require_once(INCLUDE_DIR.'class.ostsession.php');
|
||||
DbSessionBackend::cleanup();
|
||||
$backend = new DbSessionBackend();
|
||||
$backend->cleanup();
|
||||
}
|
||||
|
||||
function CleanPwResets() {
|
||||
static function CleanPwResets() {
|
||||
require_once(INCLUDE_DIR.'class.config.php');
|
||||
ConfigItem::cleanPwResets();
|
||||
}
|
||||
|
||||
function MaybeOptimizeTables() {
|
||||
static function MaybeOptimizeTables() {
|
||||
// Once a week on a 5-minute cron
|
||||
$chance = rand(1,2000);
|
||||
switch ($chance) {
|
||||
@@ -102,7 +103,7 @@ class Cron {
|
||||
}
|
||||
}
|
||||
|
||||
function run(){ //called by outside cron NOT autocron
|
||||
static function run(){ //called by outside cron NOT autocron
|
||||
global $ost;
|
||||
if (!$ost || $ost->isUpgradePending())
|
||||
return;
|
||||
|
||||
@@ -634,12 +634,12 @@ implements TemplateVariable, Searchable {
|
||||
return $row ? $row[0] : 0;
|
||||
}
|
||||
|
||||
function getNameById($id) {
|
||||
static function getNameById($id) {
|
||||
$names = Dept::getDepartments();
|
||||
return $names[$id];
|
||||
}
|
||||
|
||||
function getDefaultDeptName() {
|
||||
static function getDefaultDeptName() {
|
||||
global $cfg;
|
||||
|
||||
return ($cfg
|
||||
|
||||
@@ -71,7 +71,7 @@ class Draft extends VerySimpleModel {
|
||||
implode(' ', $attrs));
|
||||
}
|
||||
|
||||
function getAttachmentIds($body=false) {
|
||||
static function getAttachmentIds($body=false) {
|
||||
$attachments = array();
|
||||
if (!$body)
|
||||
$body = $this->getBody();
|
||||
|
||||
@@ -794,7 +794,7 @@ class DynamicFormField extends VerySimpleModel {
|
||||
* flags which should be set on the new field to implement the
|
||||
* requirement / visibility mode.
|
||||
*/
|
||||
function allRequirementModes() {
|
||||
static function allRequirementModes() {
|
||||
return array(
|
||||
'a' => array('desc' => __('Optional'),
|
||||
'flags' => self::FLAG_CLIENT_VIEW | self::FLAG_AGENT_VIEW
|
||||
@@ -1198,7 +1198,7 @@ class DynamicFormEntry extends VerySimpleModel {
|
||||
return $vars;
|
||||
}
|
||||
|
||||
function forTicket($ticket_id, $force=false) {
|
||||
static function forTicket($ticket_id, $force=false) {
|
||||
static $entries = array();
|
||||
if (!isset($entries[$ticket_id]) || $force) {
|
||||
$stuff = DynamicFormEntry::objects()
|
||||
@@ -1241,7 +1241,7 @@ class DynamicFormEntry extends VerySimpleModel {
|
||||
$this->object_id = $object_id;
|
||||
}
|
||||
|
||||
function forObject($object_id, $object_type) {
|
||||
static function forObject($object_id, $object_type) {
|
||||
return DynamicFormEntry::objects()
|
||||
->filter(array('object_id'=>$object_id, 'object_type'=>$object_type));
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ class AttachmentFile extends VerySimpleModel {
|
||||
exit();
|
||||
}
|
||||
|
||||
function _getKeyAndHash($data=false, $file=false) {
|
||||
static function _getKeyAndHash($data=false, $file=false) {
|
||||
if ($file) {
|
||||
$sha1 = base64_encode(sha1_file($data, true));
|
||||
$md5 = base64_encode(md5_file($data, true));
|
||||
@@ -624,7 +624,7 @@ class AttachmentFile extends VerySimpleModel {
|
||||
/*
|
||||
Method formats http based $_FILE uploads - plus basic validation.
|
||||
*/
|
||||
function format($files) {
|
||||
static function format($files) {
|
||||
global $ost;
|
||||
|
||||
if(!$files || !is_array($files))
|
||||
|
||||
@@ -165,7 +165,7 @@ extends VerySimpleModel {
|
||||
return ($this->use_replyto_email);
|
||||
}
|
||||
|
||||
function disableFilters($object) {
|
||||
static function disableFilters($object) {
|
||||
switch (get_class($object)) {
|
||||
case 'Topic':
|
||||
$object_id = 'topic_id';
|
||||
@@ -207,7 +207,7 @@ extends VerySimpleModel {
|
||||
'configuration__like' => sprintf('%%"%s":%s}', $object_id, $id)));
|
||||
foreach($actions as $fa) {
|
||||
// Put a flag on the filter
|
||||
$fa->setFilterFlags(false, 'Filter::FLAG_DELETED_OBJECT', true);
|
||||
FilterAction::setFilterFlags($fa, 'Filter::FLAG_DELETED_OBJECT', true);
|
||||
$fa->save();
|
||||
|
||||
// Disable the filter
|
||||
@@ -374,7 +374,7 @@ extends VerySimpleModel {
|
||||
return $keys;
|
||||
}
|
||||
|
||||
/* static */ function getSupportedMatchTypes() {
|
||||
static function getSupportedMatchTypes() {
|
||||
return array(
|
||||
'equal'=> __('Equal'),
|
||||
'not_equal'=> __('Not Equal'),
|
||||
@@ -475,7 +475,7 @@ extends VerySimpleModel {
|
||||
}
|
||||
|
||||
/** static functions **/
|
||||
function getTargets() {
|
||||
static function getTargets() {
|
||||
return array(
|
||||
'Any' => __('Any'),
|
||||
'Web' => __('Web Forms'),
|
||||
@@ -571,7 +571,7 @@ extends VerySimpleModel {
|
||||
return $filter;
|
||||
}
|
||||
|
||||
function validate_actions($vars, &$errors) {
|
||||
static function validate_actions($vars, &$errors) {
|
||||
//allow the save if it is to set a filter flag
|
||||
if ($vars['pass'])
|
||||
return true;
|
||||
@@ -967,7 +967,7 @@ class TicketFilter {
|
||||
* Normalize ticket source to supported filter target
|
||||
*
|
||||
*/
|
||||
function origin2target($origin) {
|
||||
static function origin2target($origin) {
|
||||
$sources=array('web' => 'Web', 'email' => 'Email', 'phone' => 'Web', 'staff' => 'Web', 'api' => 'API');
|
||||
|
||||
return $sources[strtolower($origin)];
|
||||
|
||||
@@ -89,7 +89,7 @@ class FilterAction extends VerySimpleModel {
|
||||
return $this->_impl;
|
||||
}
|
||||
|
||||
function setFilterFlags($actions=false, $flag, $bool) {
|
||||
static function setFilterFlags($actions=false, $flag, $bool) {
|
||||
$flag = constant($flag);
|
||||
if ($actions) {
|
||||
foreach ($actions as $action)
|
||||
@@ -656,7 +656,7 @@ class FA_SendEmail extends TriggerAction {
|
||||
require_once PEAR_DIR . 'Mail/RFC822.php';
|
||||
require_once PEAR_DIR . 'PEAR.php';
|
||||
|
||||
if (!($mails = Mail_RFC822::parseAddressList($to)) || PEAR::isError($mails))
|
||||
if (!($mails = Mail_Parse::parseAddressList($to)) || PEAR::isError($mails))
|
||||
return false;
|
||||
|
||||
// Allow %{recipient} in the body
|
||||
@@ -695,7 +695,7 @@ class FA_SendEmail extends TriggerAction {
|
||||
'size' => 80, 'length' => 1000,
|
||||
),
|
||||
'validators' => function($self, $value) {
|
||||
if (!($mails = Mail_RFC822::parseAddressList($value)) || PEAR::isError($mails))
|
||||
if (!($mails = Mail_Parse::parseAddressList($value)) || PEAR::isError($mails))
|
||||
$self->addError('Unable to parse address list. '
|
||||
.'Use commas to separate addresses.');
|
||||
|
||||
|
||||
@@ -580,7 +580,7 @@ class FormField {
|
||||
static $more_types = array();
|
||||
static $uid = null;
|
||||
|
||||
function _uid() {
|
||||
static function _uid() {
|
||||
return ++self::$uid;
|
||||
}
|
||||
|
||||
@@ -2207,7 +2207,7 @@ class DatetimeField extends FormField {
|
||||
return $this->max;
|
||||
}
|
||||
|
||||
function getPastPresentLabels() {
|
||||
static function getPastPresentLabels() {
|
||||
return array(__('Create Date'), __('Reopen Date'),
|
||||
__('Close Date'), __('Last Update'));
|
||||
}
|
||||
@@ -2853,7 +2853,7 @@ class TopicField extends ChoiceField {
|
||||
}
|
||||
|
||||
function whatChanged($before, $after) {
|
||||
return FormField::whatChanged($before, $after);
|
||||
return parent::whatChanged($before, $after);
|
||||
}
|
||||
|
||||
function searchable($value) {
|
||||
@@ -2961,7 +2961,7 @@ class SLAField extends ChoiceField {
|
||||
}
|
||||
|
||||
function whatChanged($before, $after) {
|
||||
return FormField::whatChanged($before, $after);
|
||||
return parent::whatChanged($before, $after);
|
||||
}
|
||||
|
||||
function searchable($value) {
|
||||
@@ -3077,7 +3077,7 @@ class PriorityField extends ChoiceField {
|
||||
}
|
||||
|
||||
function whatChanged($before, $after) {
|
||||
return FormField::whatChanged($before, $after);
|
||||
return parent::whatChanged($before, $after);
|
||||
}
|
||||
|
||||
function searchable($value) {
|
||||
@@ -3158,7 +3158,7 @@ class TimezoneField extends ChoiceField {
|
||||
}
|
||||
|
||||
function whatChanged($before, $after) {
|
||||
return FormField::whatChanged($before, $after);
|
||||
return parent::whatChanged($before, $after);
|
||||
}
|
||||
|
||||
function searchable($value) {
|
||||
|
||||
@@ -45,7 +45,7 @@ interface CustomList {
|
||||
function getConfigurationForm();
|
||||
function getSummaryFields();
|
||||
|
||||
function getSortModes();
|
||||
static function getSortModes();
|
||||
function getSortMode();
|
||||
function getListOrderBy();
|
||||
|
||||
@@ -181,7 +181,7 @@ class DynamicList extends VerySimpleModel implements CustomList {
|
||||
return ($this->getForm() && $this->getForm()->getFields());
|
||||
}
|
||||
|
||||
function getSortModes() {
|
||||
static function getSortModes() {
|
||||
return array(
|
||||
'Alpha' => __('Alphabetical'),
|
||||
'-Alpha' => __('Alphabetical (Reversed)'),
|
||||
|
||||
@@ -69,7 +69,7 @@ class Log {
|
||||
}
|
||||
|
||||
/*** static function ***/
|
||||
function lookup($id){
|
||||
static function lookup($id){
|
||||
return ($id && is_numeric($id) && ($l= new Log($id)) && $l->getId()==$id)?$l:null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -626,7 +626,7 @@ class Mailer {
|
||||
|
||||
//Emails using native php mail function - if DB connection doesn't exist.
|
||||
//Don't use this function if you can help it.
|
||||
function sendmail($to, $subject, $message, $from, $options=null) {
|
||||
static function sendmail($to, $subject, $message, $from, $options=null) {
|
||||
$mailer = new Mailer(null, array('notice'=>true, 'nobounce'=>true));
|
||||
$mailer->setFromAddress($from);
|
||||
return $mailer->send($to, $subject, $message, $options);
|
||||
|
||||
@@ -989,7 +989,7 @@ class MailFetcher {
|
||||
|
||||
Static function called to initiate email polling
|
||||
*/
|
||||
function run() {
|
||||
static function run() {
|
||||
global $ost;
|
||||
|
||||
if(!$ost->getConfig()->isEmailPollingEnabled())
|
||||
|
||||
@@ -180,7 +180,7 @@ class Mail_Parse {
|
||||
}
|
||||
|
||||
/* static */
|
||||
function findHeaderEntry($headers, $name, $allEntries=false) {
|
||||
static function findHeaderEntry($headers, $name, $allEntries=false) {
|
||||
if (!is_array($headers))
|
||||
$headers = self::splitHeaders($headers, $allEntries);
|
||||
foreach ($headers as $key=>$val)
|
||||
@@ -561,7 +561,7 @@ class Mail_Parse {
|
||||
return 0;
|
||||
}
|
||||
|
||||
function parseAddressList($address, $charset='UTF-8'){
|
||||
static function parseAddressList($address, $charset='UTF-8'){
|
||||
if (!$address)
|
||||
return array();
|
||||
|
||||
@@ -603,7 +603,7 @@ class EmailDataParser {
|
||||
$this->stream = $stream;
|
||||
}
|
||||
|
||||
function parse($stream) {
|
||||
static function parse($stream) {
|
||||
global $cfg;
|
||||
|
||||
$contents ='';
|
||||
|
||||
@@ -27,7 +27,7 @@ class ObjectModel {
|
||||
const OBJECT_TYPE_STAFF = 'S';
|
||||
const OBJECT_TYPE_CHILD_TICKET = 'C';
|
||||
|
||||
private function objects() {
|
||||
private static function objects() {
|
||||
static $objects = false;
|
||||
if ($objects == false) {
|
||||
$objects = array(
|
||||
|
||||
@@ -2907,7 +2907,7 @@ class MySqlCompiler extends SqlCompiler {
|
||||
return sprintf("`%s`", str_replace("`", "``", $what));
|
||||
}
|
||||
|
||||
function supportsOption($option) {
|
||||
static function supportsOption($option) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -363,7 +363,7 @@ class osTicket {
|
||||
return db_input($this->get_var($index, $vars), $quote);
|
||||
}
|
||||
|
||||
function get_path_info() {
|
||||
static function get_path_info() {
|
||||
if(isset($_SERVER['PATH_INFO']))
|
||||
return $_SERVER['PATH_INFO'];
|
||||
|
||||
@@ -599,7 +599,7 @@ class osTicket {
|
||||
/**
|
||||
* Returns TRUE if the request was made via HTTPS and false otherwise
|
||||
*/
|
||||
function is_https() {
|
||||
static function is_https() {
|
||||
|
||||
// Local server flags
|
||||
if (isset($_SERVER['HTTPS'])
|
||||
@@ -614,7 +614,7 @@ class osTicket {
|
||||
/**
|
||||
* Returns TRUE if the current browser is IE and FALSE otherwise
|
||||
*/
|
||||
function is_ie() {
|
||||
static function is_ie() {
|
||||
if (preg_match('/MSIE|Internet Explorer|Trident\/[\d]{1}\.[\d]{1,2}/',
|
||||
$_SERVER['HTTP_USER_AGENT']))
|
||||
return true;
|
||||
@@ -632,7 +632,7 @@ class osTicket {
|
||||
}
|
||||
|
||||
/**** static functions ****/
|
||||
function start() {
|
||||
static function start() {
|
||||
// Prep basic translation support
|
||||
Internationalization::bootstrap();
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ class PluginManager {
|
||||
return $plugins;
|
||||
}
|
||||
|
||||
function throwException($errno, $errstr) {
|
||||
static function throwException($errno, $errstr) {
|
||||
throw new RuntimeException($errstr);
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ class PluginManager {
|
||||
return static::$plugin_info[$install_path];
|
||||
}
|
||||
|
||||
function getInstance($path) {
|
||||
static function getInstance($path) {
|
||||
static $instances = array();
|
||||
if (!isset($instances[$path])
|
||||
&& ($ps = static::allInstalled())
|
||||
|
||||
@@ -571,7 +571,7 @@ class CustomQueue extends VerySimpleModel {
|
||||
return $this->_conditions;
|
||||
}
|
||||
|
||||
function getExportableFields() {
|
||||
static function getExportableFields() {
|
||||
$cdata = $fields = array();
|
||||
foreach (TicketForm::getInstance()->getFields() as $f) {
|
||||
// Ignore core fields
|
||||
@@ -1582,7 +1582,7 @@ abstract class QueueColumnAnnotation {
|
||||
}
|
||||
|
||||
// Add the annotation to a QuerySet
|
||||
abstract function annotate($query, $name);
|
||||
abstract static function annotate($query, $name);
|
||||
|
||||
// Fetch some HTML to render the decoration on the page. This function
|
||||
// can return boolean FALSE to indicate no decoration should be applied
|
||||
@@ -1636,7 +1636,7 @@ extends QueueColumnAnnotation {
|
||||
static $qname = '_thread_count';
|
||||
static $desc = /* @trans */ 'Thread Count';
|
||||
|
||||
function annotate($query, $name=false) {
|
||||
static function annotate($query, $name=false) {
|
||||
$name = $name ?: static::$qname;
|
||||
return $query->annotate(array(
|
||||
$name => TicketThread::objects()
|
||||
@@ -1667,7 +1667,7 @@ extends QueueColumnAnnotation {
|
||||
static $qname = '_reopen_count';
|
||||
static $desc = /* @trans */ 'Reopen Count';
|
||||
|
||||
function annotate($query, $name=false) {
|
||||
static function annotate($query, $name=false) {
|
||||
$name = $name ?: static::$qname;
|
||||
return $query->annotate(array(
|
||||
$name => TicketThread::objects()
|
||||
@@ -1699,7 +1699,7 @@ extends QueueColumnAnnotation {
|
||||
static $qname = '_att_count';
|
||||
static $desc = /* @trans */ 'Attachment Count';
|
||||
|
||||
function annotate($query, $name=false) {
|
||||
static function annotate($query, $name=false) {
|
||||
// TODO: Convert to Thread attachments
|
||||
$name = $name ?: static::$qname;
|
||||
return $query->annotate(array(
|
||||
@@ -1730,7 +1730,7 @@ extends QueueColumnAnnotation {
|
||||
static $qname = '_task_count';
|
||||
static $desc = /* @trans */ 'Tasks Count';
|
||||
|
||||
function annotate($query, $name=false) {
|
||||
static function annotate($query, $name=false) {
|
||||
$name = $name ?: static::$qname;
|
||||
return $query->annotate(array(
|
||||
$name => Task::objects()
|
||||
@@ -1759,7 +1759,7 @@ extends QueueColumnAnnotation {
|
||||
static $qname = '_collabs';
|
||||
static $desc = /* @trans */ 'Collaborator Count';
|
||||
|
||||
function annotate($query, $name=false) {
|
||||
static function annotate($query, $name=false) {
|
||||
$name = $name ?: static::$qname;
|
||||
return $query->annotate(array(
|
||||
$name => TicketThread::objects()
|
||||
@@ -1787,7 +1787,7 @@ extends QueueColumnAnnotation {
|
||||
static $icon = 'exclamation';
|
||||
static $desc = /* @trans */ 'Overdue Icon';
|
||||
|
||||
function annotate($query, $name=false) {
|
||||
static function annotate($query, $name=false) {
|
||||
return $query->values('isoverdue');
|
||||
}
|
||||
|
||||
@@ -1806,7 +1806,7 @@ extends QueueColumnAnnotation {
|
||||
static $icon = 'code-fork';
|
||||
static $desc = /* @trans */ 'Merged Icon';
|
||||
|
||||
function annotate($query, $name=false) {
|
||||
static function annotate($query, $name=false) {
|
||||
return $query->values('ticket_pid', 'flags');
|
||||
}
|
||||
|
||||
@@ -1833,7 +1833,7 @@ extends QueueColumnAnnotation {
|
||||
static $icon = 'link';
|
||||
static $desc = /* @trans */ 'Linked Icon';
|
||||
|
||||
function annotate($query, $name=false) {
|
||||
static function annotate($query, $name=false) {
|
||||
return $query->values('ticket_pid', 'flags');
|
||||
}
|
||||
|
||||
@@ -1854,7 +1854,7 @@ extends QueueColumnAnnotation {
|
||||
static $icon = 'phone';
|
||||
static $desc = /* @trans */ 'Ticket Source';
|
||||
|
||||
function annotate($query, $name=false) {
|
||||
static function annotate($query, $name=false) {
|
||||
return $query->values('source');
|
||||
}
|
||||
|
||||
@@ -1869,7 +1869,7 @@ extends QueueColumnAnnotation {
|
||||
static $icon = "lock";
|
||||
static $desc = /* @trans */ 'Locked';
|
||||
|
||||
function annotate($query, $name=false) {
|
||||
static function annotate($query, $name=false) {
|
||||
global $thisstaff;
|
||||
|
||||
return $query
|
||||
@@ -1896,7 +1896,7 @@ extends QueueColumnAnnotation {
|
||||
static $icon = "user";
|
||||
static $desc = /* @trans */ 'Assignee Avatar';
|
||||
|
||||
function annotate($query, $name=false) {
|
||||
static function annotate($query, $name=false) {
|
||||
return $query->values('staff_id', 'team_id');
|
||||
}
|
||||
|
||||
@@ -1935,7 +1935,7 @@ extends QueueColumnAnnotation {
|
||||
static $icon = "user";
|
||||
static $desc = /* @trans */ 'User Avatar';
|
||||
|
||||
function annotate($query, $name=false) {
|
||||
static function annotate($query, $name=false) {
|
||||
return $query->values('user_id');
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ abstract class SearchBackend {
|
||||
static::$registry[$backend::$id] = $backend;
|
||||
}
|
||||
|
||||
function getInstance($id) {
|
||||
static function getInstance($id) {
|
||||
if (!isset(self::$registry[$id]))
|
||||
return null;
|
||||
|
||||
@@ -1096,7 +1096,7 @@ extends SavedSearch {
|
||||
return $this->title ?: $this->describeCriteria();
|
||||
}
|
||||
|
||||
function load($key) {
|
||||
static function load($key) {
|
||||
global $thisstaff;
|
||||
|
||||
if (strpos($key, 'adhoc') === 0)
|
||||
|
||||
@@ -435,7 +435,7 @@ class EmailTemplateGroup {
|
||||
return $id;
|
||||
}
|
||||
|
||||
function lookup($id){
|
||||
static function lookup($id){
|
||||
return ($id && is_numeric($id) && ($t= new EmailTemplateGroup($id)) && $t->getId()==$id)?$t:null;
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ class EmailTemplate {
|
||||
return $inst;
|
||||
}
|
||||
|
||||
function lookupByName($tpl_id, $name, $group=null) {
|
||||
static function lookupByName($tpl_id, $name, $group=null) {
|
||||
$sql = 'SELECT id FROM '.EMAIL_TEMPLATE_TABLE
|
||||
.' WHERE tpl_id='.db_input($tpl_id)
|
||||
.' AND code_name='.db_input($name);
|
||||
@@ -700,7 +700,7 @@ class EmailTemplate {
|
||||
return false;
|
||||
}
|
||||
|
||||
function lookup($id, $group=null) {
|
||||
static function lookup($id, $group=null) {
|
||||
return ($id && is_numeric($id) && ($t= new EmailTemplate($id, $group)) && $t->getId()==$id)?$t:null;
|
||||
}
|
||||
|
||||
@@ -709,7 +709,7 @@ class EmailTemplate {
|
||||
* file should be free flow text. The first line is the subject and the
|
||||
* rest of the file is the body.
|
||||
*/
|
||||
function fromInitialData($name, $group=null) {
|
||||
static function fromInitialData($name, $group=null) {
|
||||
$templ = new EmailTemplate(0, $group);
|
||||
$lang = ($group) ? $group->getLanguage() : 'en_US';
|
||||
$i18n = new Internationalization($lang);
|
||||
|
||||
@@ -670,7 +670,7 @@ implements Searchable {
|
||||
* email communication without a thread entry, for instance, like
|
||||
* tickets created without an initial message.
|
||||
*/
|
||||
function lookupByEmailHeaders(&$mailinfo) {
|
||||
static function lookupByEmailHeaders(&$mailinfo) {
|
||||
$possibles = array();
|
||||
foreach (array('mid', 'in-reply-to', 'references') as $header) {
|
||||
$matches = array();
|
||||
@@ -1401,7 +1401,7 @@ implements TemplateVariable {
|
||||
* previously seen. This is useful if no thread-id is associated
|
||||
* with the email (if it was rejected for instance).
|
||||
*/
|
||||
function lookupByEmailHeaders(&$mailinfo, &$seen=false) {
|
||||
static function lookupByEmailHeaders(&$mailinfo, &$seen=false) {
|
||||
// Search for messages using the References header, then the
|
||||
// in-reply-to header
|
||||
if ($mailinfo['mid'] &&
|
||||
@@ -1570,7 +1570,7 @@ implements TemplateVariable {
|
||||
return $entry;
|
||||
}
|
||||
|
||||
function setExtra($entries, $info=NULL, $thread_id=NULL) {
|
||||
static function setExtra($entries, $info=NULL, $thread_id=NULL) {
|
||||
foreach ($entries as $entry) {
|
||||
$mergeInfo = ThreadEntryMergeInfo::objects()
|
||||
->filter(array('thread_entry_id'=>$entry->getId()))
|
||||
@@ -1598,7 +1598,7 @@ implements TemplateVariable {
|
||||
return $this->merge_info ? $this->merge_info->data : null;
|
||||
}
|
||||
|
||||
function sortEntries($entries, $ticket) {
|
||||
static function sortEntries($entries, $ticket) {
|
||||
$buckets = array();
|
||||
$childEntries = array();
|
||||
foreach ($entries as $i=>$E) {
|
||||
|
||||
@@ -252,7 +252,7 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
return $this->_children ?: array();
|
||||
}
|
||||
|
||||
function getMergeTypeByFlag($flag) {
|
||||
static function getMergeTypeByFlag($flag) {
|
||||
if (($flag & self::FLAG_COMBINE_THREADS) != 0)
|
||||
return 'combine';
|
||||
if (($flag & self::FLAG_SEPARATE_THREADS) != 0)
|
||||
@@ -279,10 +279,15 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
return false;
|
||||
}
|
||||
|
||||
function isParent($flag=false) {
|
||||
if (is_numeric($flag) && ($flag & self::FLAG_PARENT) != 0)
|
||||
function isParent() {
|
||||
if ($this->hasFlag(self::FLAG_PARENT))
|
||||
return true;
|
||||
elseif (!is_numeric($flag) && $this->hasFlag(self::FLAG_PARENT))
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static function isParentStatic($flag=false) {
|
||||
if (is_numeric($flag) && ($flag & self::FLAG_PARENT) != 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -2490,7 +2495,7 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
return true;
|
||||
}
|
||||
|
||||
function manageMerge($tickets) {
|
||||
static function manageMerge($tickets) {
|
||||
global $thisstaff;
|
||||
|
||||
$permission = ($tickets['title'] && $tickets['title'] == 'link') ? (Ticket::PERM_LINK) : (Ticket::PERM_MERGE);
|
||||
@@ -2554,7 +2559,7 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
return $ticketObjects;
|
||||
}
|
||||
|
||||
function merge($tickets) {
|
||||
static function merge($tickets) {
|
||||
$options = $tickets;
|
||||
if (!$tickets = self::manageMerge($tickets))
|
||||
return false;
|
||||
@@ -3958,7 +3963,7 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
return db_fetch_array(db_query($sql));
|
||||
}
|
||||
|
||||
protected function filterTicketData($origin, $vars, $forms, $user=false, $postCreate=false) {
|
||||
protected static function filterTicketData($origin, $vars, $forms, $user=false, $postCreate=false) {
|
||||
global $cfg;
|
||||
|
||||
// Unset all the filter data field data in case things change
|
||||
|
||||
@@ -527,7 +527,7 @@ implements TemplateVariable, Searchable {
|
||||
return $imported;
|
||||
}
|
||||
|
||||
function importFromPost($stream, $extra=array()) {
|
||||
static function importFromPost($stream, $extra=array()) {
|
||||
if (!is_array($stream))
|
||||
$stream = sprintf('name, email%s %s',PHP_EOL, $stream);
|
||||
|
||||
@@ -784,7 +784,7 @@ implements TemplateVariable {
|
||||
static function parse($address) {
|
||||
require_once PEAR_DIR . 'Mail/RFC822.php';
|
||||
require_once PEAR_DIR . 'PEAR.php';
|
||||
if (($parts = Mail_RFC822::parseAddressList($address))
|
||||
if (($parts = Mail_Parse::parseAddressList($address))
|
||||
&& !PEAR::isError($parts))
|
||||
return current($parts);
|
||||
}
|
||||
@@ -1226,7 +1226,7 @@ class UserAccount extends VerySimpleModel {
|
||||
Signal::send('auth.clean', $this->getUser());
|
||||
}
|
||||
|
||||
protected function sendUnlockEmail($template) {
|
||||
protected static function sendUnlockEmail($template) {
|
||||
global $ost, $cfg;
|
||||
|
||||
$token = Misc::randCode(48); // 290-bits
|
||||
|
||||
@@ -166,8 +166,7 @@ class Validator {
|
||||
static function is_email($email, $list=false, $verify=false) {
|
||||
require_once PEAR_DIR . 'Mail/RFC822.php';
|
||||
require_once PEAR_DIR . 'PEAR.php';
|
||||
$rfc822 = new Mail_RFC822();
|
||||
if (!($mails = @$rfc822->parseAddressList($email)) || PEAR::isError($mails))
|
||||
if (!($mails = @Mail_Parse::parseAddressList($email)) || PEAR::isError($mails))
|
||||
return false;
|
||||
|
||||
if (!$list && count($mails) > 1)
|
||||
@@ -340,7 +339,7 @@ class Validator {
|
||||
return true;
|
||||
}
|
||||
|
||||
function process($fields,$vars,&$errors){
|
||||
static function process($fields,$vars,&$errors){
|
||||
|
||||
$val = new Validator();
|
||||
$val->setFields($fields);
|
||||
@@ -350,7 +349,7 @@ class Validator {
|
||||
return (!$errors);
|
||||
}
|
||||
|
||||
function check_acl($backend) {
|
||||
static function check_acl($backend) {
|
||||
global $cfg;
|
||||
|
||||
$acl = $cfg->getACL();
|
||||
|
||||
@@ -410,7 +410,7 @@ class HtmlBlockElement extends HtmlInlineElement {
|
||||
return $output."\n";
|
||||
}
|
||||
|
||||
function borderize($what, $width) {
|
||||
static function borderize($what, $width) {
|
||||
$output = ',-'.str_repeat('-', $width)."-.\n";
|
||||
foreach (explode("\n", $what) as $l)
|
||||
$output .= '| '.mb_str_pad($l, $width)." |\n";
|
||||
|
||||
@@ -71,7 +71,7 @@ class Mail
|
||||
* @return object Mail a instance of the driver class or if fails a PEAR Error
|
||||
* @access public
|
||||
*/
|
||||
function &factory($driver, $params = array())
|
||||
static function &factory($driver, $params = array())
|
||||
{
|
||||
$driver = strtolower($driver);
|
||||
$class = 'Mail_' . $driver;
|
||||
@@ -241,6 +241,7 @@ class Mail
|
||||
function parseRecipients($recipients)
|
||||
{
|
||||
include_once 'Mail/RFC822.php';
|
||||
include_once INCLUDE_DIR.'class.mailparse.php';
|
||||
|
||||
// if we're passed an array, assume addresses are valid and
|
||||
// implode them before parsing.
|
||||
@@ -251,7 +252,7 @@ class Mail
|
||||
// Parse recipients, leaving out all personal info. This is
|
||||
// for smtp recipients, etc. All relevant personal information
|
||||
// should already be in the headers.
|
||||
$addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false);
|
||||
$addresses = Mail_Parse::parseAddressList($recipients, 'localhost', false);
|
||||
|
||||
// If parseAddressList() returned a PEAR_Error object, just return it.
|
||||
if (is_a($addresses, 'PEAR_Error')) {
|
||||
|
||||
@@ -86,7 +86,7 @@ $info=Format::htmlchars(($errors && $_POST) ? array_merge($info,$_POST) : $info,
|
||||
<td width="180"><?php echo __('Sort Order'); ?>:</td>
|
||||
<td><select name="sort_mode">
|
||||
<?php
|
||||
$sortModes = $list ? $list->getSortModes() : DynamicList::getSortModes();
|
||||
$sortModes = $list ? $list::getSortModes() : DynamicList::getSortModes();
|
||||
foreach ($sortModes as $key=>$desc) { ?>
|
||||
<option value="<?php echo $key; ?>" <?php
|
||||
if ($key == $info['sort_mode']) echo 'selected="selected"';
|
||||
|
||||
@@ -49,7 +49,7 @@ name="queue-export" id="queue-export">
|
||||
</tbody>
|
||||
<tbody class="sortable-rows" id="fields">
|
||||
<?php
|
||||
foreach (array_merge($fields, $queue->getExportableFields()) as $path => $label) {
|
||||
foreach (array_merge($fields, CustomQueue::getExportableFields()) as $path => $label) {
|
||||
echo sprintf('<tr style="display: table-row;">
|
||||
<td><i class="faded-more
|
||||
icon-sort"></i> <label><input
|
||||
|
||||
@@ -65,7 +65,7 @@ $hidden_cols = $queue->inheritExport();
|
||||
<select id="add-field" name="new-field" style="max-width: 300px;">
|
||||
<option value="">— <?php echo __('Add Other Field'); ?> —</option>
|
||||
<?php
|
||||
$fields = $queue->getExportableFields();
|
||||
$fields = CustomQueue::getExportableFields();
|
||||
if (is_array($fields)) {
|
||||
foreach ($fields as $path => $label) { ?>
|
||||
<option value="<?php echo $path; ?>" <?php
|
||||
|
||||
@@ -25,7 +25,7 @@ class CryptoMigrater extends MigrationTask {
|
||||
XXX: This is not a good way of decrypting data - use to descrypt old
|
||||
data.
|
||||
*/
|
||||
function _decrypt($text, $salt) {
|
||||
static function _decrypt($text, $salt) {
|
||||
|
||||
if(!function_exists('mcrypt_encrypt') || !function_exists('mcrypt_decrypt'))
|
||||
return $text;
|
||||
|
||||
@@ -22,7 +22,7 @@ require_once(INCLUDE_DIR.'class.page.php');
|
||||
|
||||
// Determine the requested page
|
||||
// - Strip extension
|
||||
$slug = Format::slugify($ost->get_path_info());
|
||||
$slug = Format::slugify(Osticket::get_path_info());
|
||||
|
||||
// Get the part before the first dash
|
||||
$first_word = explode('-', $slug);
|
||||
|
||||
@@ -313,7 +313,7 @@ $dispatcher = patterns('',
|
||||
Signal::send('ajax.scp', $dispatcher);
|
||||
|
||||
# Call the respective function
|
||||
$rv = $dispatcher->resolve($ost->get_path_info());
|
||||
$rv = $dispatcher->resolve(Osticket::get_path_info());
|
||||
|
||||
// Indicate JSON response content-type
|
||||
if (is_string($rv) && $rv[0] == '{')
|
||||
|
||||
@@ -29,7 +29,7 @@ if(!defined('INCLUDE_DIR')) Http::response(500, 'Server configuration error');
|
||||
require_once INCLUDE_DIR.'/class.dispatcher.php';
|
||||
$dispatcher = new Dispatcher();
|
||||
|
||||
$PI = $ost->get_path_info();
|
||||
$PI = Osticket::get_path_info();
|
||||
if (strpos(strtolower($PI), '/admin/') === 0) {
|
||||
require('admin.inc.php');
|
||||
$PI = substr($PI, 6);
|
||||
|
||||
@@ -59,6 +59,27 @@ class Test {
|
||||
return $scripts;
|
||||
}
|
||||
|
||||
static function find_function_calls($scripts) {
|
||||
$calls=array();
|
||||
foreach ($scripts as $s) {
|
||||
$lines = explode("\n", file_get_contents($s));
|
||||
$lineno=0;
|
||||
foreach ($lines as $line) {
|
||||
$lineno++; $matches=array();
|
||||
// Ignore what looks like within comments (#|/|*)
|
||||
if (preg_match('/^(\s*?)(#|\/|\*)/m', $line))
|
||||
continue;
|
||||
|
||||
preg_match_all('/^.*\w+(?:-[>]|::)([a-zA-Z0-9_]+)\(.*/', $line, $matches,
|
||||
PREG_SET_ORDER);
|
||||
foreach ($matches as $m)
|
||||
if (strpos($m[0], 'nolint') === false)
|
||||
$calls[] = array($s, $lineno, $line, $m[1]);
|
||||
}
|
||||
}
|
||||
return $calls;
|
||||
}
|
||||
|
||||
function fail($script, $line, $message) {
|
||||
$this->fails[] = array(get_class($this), $script, $line, $message);
|
||||
fputs(STDOUT, 'F');
|
||||
|
||||
@@ -99,7 +99,7 @@ class DateTimeZone {
|
||||
}
|
||||
|
||||
class DateTimeImmutable {
|
||||
function createFromMutable() {}
|
||||
static function createFromMutable() {}
|
||||
}
|
||||
|
||||
class Phar {
|
||||
@@ -129,8 +129,8 @@ class finfo {
|
||||
}
|
||||
|
||||
class Locale {
|
||||
function getDisplayName() {}
|
||||
function acceptFromHttp() {}
|
||||
static function getDisplayName() {}
|
||||
static function acceptFromHttp() {}
|
||||
}
|
||||
class IntlBreakIterator {
|
||||
static function createWordInstance() {}
|
||||
@@ -176,7 +176,7 @@ class IntlDateFormatter {
|
||||
}
|
||||
|
||||
class ResourceBundle {
|
||||
function getLocales() {}
|
||||
static function getLocales() {}
|
||||
}
|
||||
|
||||
class NumberFormatter {
|
||||
@@ -212,12 +212,12 @@ class Crypt_AES {
|
||||
}
|
||||
|
||||
class PEAR {
|
||||
function isError() {}
|
||||
static function isError() {}
|
||||
function mail() {}
|
||||
}
|
||||
|
||||
class mail {
|
||||
function factory() {}
|
||||
static function factory() {}
|
||||
function connect() {}
|
||||
function disconnect() {}
|
||||
}
|
||||
@@ -247,7 +247,7 @@ class SplFileObject {
|
||||
|
||||
class AuditEntry {
|
||||
function getDataById() {}
|
||||
function getTableInfo() {}
|
||||
static function getTableInfo() {}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -19,7 +19,7 @@ class UndefinedMethods extends Test {
|
||||
file_get_contents($s), $matches);
|
||||
$function_defs = array_merge($function_defs, $matches[1]);
|
||||
}
|
||||
foreach (find_function_calls($scripts) as $call) {
|
||||
foreach (static::find_function_calls($scripts) as $call) {
|
||||
list($file, $no, $line, $func) = $call;
|
||||
if (!in_array($func, $function_defs)) {
|
||||
// We don't ship all of mdpf, so a bit of it looks undefined
|
||||
@@ -33,26 +33,5 @@ class UndefinedMethods extends Test {
|
||||
}
|
||||
}
|
||||
|
||||
function find_function_calls($scripts) {
|
||||
$calls=array();
|
||||
foreach ($scripts as $s) {
|
||||
$lines = explode("\n", file_get_contents($s));
|
||||
$lineno=0;
|
||||
foreach ($lines as $line) {
|
||||
$lineno++; $matches=array();
|
||||
// Ignore what looks like within comments (#|/|*)
|
||||
if (preg_match('/^(\s*?)(#|\/|\*)/m', $line))
|
||||
continue;
|
||||
|
||||
preg_match_all('/^.*\w+(?:-[>]|::)([a-zA-Z0-9_]+)\(.*/', $line, $matches,
|
||||
PREG_SET_ORDER);
|
||||
foreach ($matches as $m)
|
||||
if (strpos($m[0], 'nolint') === false)
|
||||
$calls[] = array($s, $lineno, $line, $m[1]);
|
||||
}
|
||||
}
|
||||
return $calls;
|
||||
}
|
||||
|
||||
return 'UndefinedMethods';
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user