public function display(BugData $p_bug, $p_columns_target) { plugin_push_current('RelationshipColumnView'); $p_bug_id = $p_bug->id; echo GetRelationshipContent($p_bug_id, plugin_config_get('ShowRelationshipsColorful'), $p_columns_target == COLUMNS_TARGET_VIEW_PAGE, plugin_config_get('ShowRelationships'), plugin_config_get('ShowRelationshipIcons')); plugin_pop_current(); }
public function display($p_bug, $p_columns_target) { plugin_push_current('Source'); if (isset($this->changeset_cache[$p_bug->id])) { echo '<a href="view.php?id=', $p_bug->id, '#changesets">', $this->changeset_cache[$p_bug->id], '</a>'; } plugin_pop_current(); }
function options() { plugin_push_current('CustomerManagement'); if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) { $options = array(1 => lang_get('yes'), 2 => lang_get('no')); } plugin_pop_current(); return $options; }
public function display($p_bug, $p_columns_target) { plugin_push_current('Timecard'); $p_bug_id = $p_bug->id; $t_bug = TimecardBug::load($p_bug_id, true); $t_bug->calculate(); if ($t_bug->estimate >= 0) { echo $t_bug->estimate, plugin_lang_get('hours'); } plugin_pop_current(); }
public function display($p_bug, $p_columns_target) { plugin_push_current('CustomerManagement'); if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) { $bugData = CustomerManagementDao::getBugData($p_bug->id); if (count($bugData) > 0) { $isBillable = CustomerManagementDao::getService($bugData['is_billable']); echo string_display_line($isBillable ? lang_get('yes') : lang_get('no')); } } plugin_pop_current(); }
function options() { plugin_push_current('CustomerManagement'); if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) { $options = array(); foreach (CustomerManagementDao::findAllGroups() as $group) { $options[$group['id']] = $group['name']; } } plugin_pop_current(); return $options; }
public function display($p_bug, $p_columns_target) { plugin_push_current('CustomerManagement'); if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) { $bugData = CustomerManagementDao::getBugData($p_bug->id); if (count($bugData) > 0) { $group = CustomerManagementDao::getGroupForCustomer($bugData['customer_id']); echo string_display_line($group['name']); } } plugin_pop_current(); }
function query($p_filter_input) { $invoice = $p_filter_input; if (is_blank($invoice)) { return; } plugin_push_current('CustomerManagement'); if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) { $t_query = CustomerManagementDao::buildFilterArrayForInvoice($invoice); } plugin_pop_current(); return $t_query; }
/** * Wrap method calls to the target object in plugin_push/pop calls. */ function __call($p_method, $p_args) { plugin_push_current($this->basename); $value = call_user_func_array(array($this->object, $p_method), $p_args); plugin_pop_current(); return $value; }
print_test_row('Phpmailer sendmail configuration requires escapeshellarg. Please use a different phpmailer method if this is blocked.', PHPMAILER_METHOD_SENDMAIL != config_get('phpMailer_method') || PHPMAILER_METHOD_SENDMAIL == config_get('phpMailer_method') && function_exists('escapeshellarg')); check_zend_optimiser_version(); if (plugin_is_installed('MantisGraph')) { plugin_push_current('MantisGraph'); print_test_row('checking gd is enabled, and version 2...', get_gd_version() == 2); if (plugin_config_get('eczlibrary', ON) == OFF) { $t_jpgraph_path = config_get('absolute_path') . 'library' . DIRECTORY_SEPARATOR . 'jpgraph' . DIRECTORY_SEPARATOR; if (!file_exists($t_jpgraph_path . 'jpgraph.php')) { print_test_row('checking we can find jpgraph class files...', false); } else { require_once $t_jpgraph_path . 'jpgraph.php'; print_test_row('Checking Jpgraph version (if installed)...', version_compare(JPG_VERSION, '2.3.0') ? true : false, JPG_VERSION); } print_test_row('check configuration: jpgraph (if used) requires php bundled gd for antialiasing support', plugin_config_get('jpgraph_antialias', OFF) == OFF || function_exists('imageantialias')); } plugin_pop_current(); } print_test_row('Checking if ctype is enabled in php (required for rss feeds)....', extension_loaded('ctype')); print_test_row('Checking for mysql is at least version 4.1...', !(db_is_mysql() && version_compare($t_serverinfo['version'], '4.1.0', '<'))); print_test_row('Checking for broken mysql version ( bug 10250)...', !(db_is_mysql() && $t_serverinfo['version'] == '4.1.21')); if (!is_blank(config_get_global('default_timezone'))) { if (print_test_row('Checking if a timezone is set in config.inc.php....', !is_blank(config_get_global('default_timezone')), config_get_global('default_timezone'))) { print_test_row('Checking if timezone is valid from config.inc.php....', in_array(config_get_global('default_timezone'), timezone_identifiers_list()), config_get_global('default_timezone')); } } else { if (print_test_row('Checking if timezone is set in php.ini....', ini_get('date.timezone') !== '')) { print_test_row('Checking if timezone is valid in php.ini....', in_array(ini_get('date.timezone'), timezone_identifiers_list()), ini_get('date.timezone')); } } test_database_utf8(); print_test_row('Checking Register Globals is set to off', !ini_get_bool('register_globals'));
/** * Executes a plugin's callback function for a given event. * @param string Event name * @param string Callback name * @param string Plugin basename * @param multi Parameters for event callback * @return multi Null if callback not found, value from callback otherwise * @access public */ function event_callback( $p_event, $p_callback, $p_plugin, $p_params = null ) { $t_value = null; if( !is_array( $p_params ) ) { $p_params = array( $p_params, ); } if( $p_plugin !== 0 ) { global $g_plugin_cache; plugin_push_current( $p_plugin ); if( method_exists( $g_plugin_cache[$p_plugin], $p_callback ) ) { $t_value = call_user_func_array( array( $g_plugin_cache[$p_plugin], $p_callback ), array_merge( array( $p_event ), $p_params ) ); } plugin_pop_current(); } else { if( function_exists( $p_callback ) ) { $t_value = call_user_func_array( $p_callback, array_merge( array( $p_event ), $p_params ) ); } } return $t_value; }
/** * Initialize a single plugin. * @param string Plugin basename * @return boolean True if plugin initialized, false otherwise. */ function plugin_init($p_basename) { global $g_plugin_cache, $g_plugin_cache_init; # handle dependent plugins if (isset($g_plugin_cache[$p_basename])) { $t_plugin = $g_plugin_cache[$p_basename]; # hard dependencies; return false if the dependency is not registered, # does not meet the version requirement, or is not yet initialized. if (is_array($t_plugin->requires)) { foreach ($t_plugin->requires as $t_required => $t_version) { if (plugin_dependency($t_required, $t_version, true) !== 1) { return false; } } } # soft dependencies; only return false if the soft dependency is # registered, but not yet initialized. if (is_array($t_plugin->uses)) { foreach ($t_plugin->uses as $t_used => $t_version) { if (isset($g_plugin_cache[$t_used]) && !isset($g_plugin_cache_init[$t_used])) { return false; } } } # if plugin schema needs an upgrade, do not initialize if (plugin_needs_upgrade($t_plugin)) { return false; } plugin_push_current($p_basename); # load plugin error strings global $g_lang_strings; $t_lang = lang_get_current(); $t_plugin_errors = $t_plugin->errors(); foreach ($t_plugin_errors as $t_error_name => $t_error_string) { $t_error_code = "plugin_{$p_basename}_{$t_error_name}"; $g_lang_strings[$t_lang]['MANTIS_ERROR'][$t_error_code] = $t_error_string; } # finish initializing the plugin $t_plugin->__init(); $g_plugin_cache_init[$p_basename] = true; plugin_pop_current(); return true; } else { return false; } }