Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Showing with 751 additions and 179 deletions.
  1. +1 −1  core/ajax_api.php
  2. +34 −7 core/bug_api.php
  3. +158 −82 core/bugnote_api.php
  4. +2 −2 core/category_api.php
  5. +3 −0  core/config_api.php
  6. +202 −43 core/csv_api.php
  7. +3 −0  core/current_user_api.php
  8. +9 −0 core/custom_field_api.php
  9. +6 −0 core/custom_function_api.php
  10. +3 −0  core/database_api.php
  11. +27 −0 core/email_api.php
  12. +1 −1  core/excel_api.php
  13. +6 −0 core/file_api.php
  14. +21 −3 core/filter_api.php
  15. +6 −0 core/freemind_api.php
  16. +0 −2  core/icon_api.php
  17. +3 −0  core/json_api.php
  18. +3 −0  core/last_visited_api.php
  19. +21 −1 core/my_view_inc.php
  20. +6 −0 core/news_api.php
  21. +4 −0 core/plugin_api.php
  22. +21 −0 core/print_api.php
  23. +0 −7 core/profile_api.php
  24. +3 −0  core/projax_api.php
  25. +15 −0 core/project_api.php
  26. +3 −0  core/relationship_api.php
  27. +6 −0 core/relationship_graph_api.php
  28. +9 −0 core/sponsorship_api.php
  29. +7 −0 core/string_api.php
  30. +4 −0 core/summary_api.php
  31. +7 −0 core/tag_api.php
  32. +3 −0  core/twitter_api.php
  33. +84 −23 core/utility_api.php
  34. +12 −0 core/xmlhttprequest_api.php
  35. +13 −5 plugins/XmlImportExport/XmlImportExport.php
  36. +3 −0  tag_attach.php
  37. +3 −0  tag_delete.php
  38. +3 −0  tag_detach.php
  39. +3 −0  tag_update.php
  40. +6 −0 tag_update_page.php
  41. +3 −0  tag_view_page.php
  42. +3 −2 tests/test.php
  43. +3 −0  view.php
  44. +18 −0 view_all_inc.php
View
2  core/ajax_api.php
@@ -26,7 +26,7 @@
*/
/**
- * @todo @@@function documentation
+ * @todo function documentation
* @param string $p_initial_string
* @param string $p_element_id_prefix
* @param string $p_query_string
View
41 core/bug_api.php
@@ -15,6 +15,7 @@
# along with Mantis. If not, see <http://www.gnu.org/licenses/>.
/**
+ * Bug API
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
* @copyright Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
@@ -24,17 +25,43 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires history_api
+ */
require_once( $t_core_dir . 'history_api.php' );
+/**
+ * requires email_api
+ */
require_once( $t_core_dir . 'email_api.php' );
+/**
+ * requires bugnote_api
+ */
require_once( $t_core_dir . 'bugnote_api.php' );
+/**
+ * requires file_api
+ */
require_once( $t_core_dir . 'file_api.php' );
+/**
+ * requires string_api
+ */
require_once( $t_core_dir . 'string_api.php' );
+/**
+ * requires sponsorship_api
+ */
require_once( $t_core_dir . 'sponsorship_api.php' );
+/**
+ * requires twitter_api
+ */
require_once( $t_core_dir . 'twitter_api.php' );
+/**
+ * requires tag_api
+ */
require_once( $t_core_dir . 'tag_api.php' );
+/**
+ * requires relationship_api
+ */
require_once( $t_core_dir . 'relationship_api.php' );
-# ## Bug API ###
# ===================================
# Bug Data Structure Definition
# ===================================
@@ -618,7 +645,7 @@ function bug_create( $p_bug_data ) {
/**
* Copy a bug from one project to another. Also make copies of issue notes, attachments, history,
* email notifications etc.
- * @@@ Not managed FTP file upload
+ * @todo Not managed FTP file upload
* @param array p_bug_id integer representing bug id
* @param int p_target_project_id
* @param bool p_copy_custom_fields
@@ -655,7 +682,7 @@ function bug_copy( $p_bug_id, $p_target_project_id = null, $p_copy_custom_fields
# MASC ATTENTION: IF THE SOURCE BUG HAS TO HANDLER THE bug_create FUNCTION CAN TRY TO AUTO-ASSIGN THE BUG
# WE FORCE HERE TO DUPLICATE THE SAME HANDLER OF THE SOURCE BUG
- # @@@ VB: Shouldn't we check if the handler in the source project is also a handler in the destination project?
+ # @todo VB: Shouldn't we check if the handler in the source project is also a handler in the destination project?
bug_set_field( $t_new_bug_id, 'handler_id', $t_bug_data->handler_id );
bug_set_field( $t_new_bug_id, 'duplicate_id', $t_bug_data->duplicate_id );
@@ -915,7 +942,7 @@ function bug_delete_all( $p_project_id ) {
bug_delete( $row['id'] );
}
- # @@@ should we check the return value of each bug_delete() and
+ # @todo should we check the return value of each bug_delete() and
# return false if any of them return false? Presumable bug_delete()
# will eventually trigger an error on failure so it won't matter...
@@ -1122,7 +1149,7 @@ function bug_update( $p_bug_id, $p_bug_data, $p_update_extended = false, $p_bypa
return true;
}
- # @@@ handle priority change if it requires special handling
+ # @todo handle priority change if it requires special handling
# generic update notification
email_generic( $p_bug_id, 'updated', $t_action_prefix . 'updated' );
}
@@ -1136,7 +1163,7 @@ function bug_update( $p_bug_id, $p_bug_data, $p_update_extended = false, $p_bypa
/**
* Returns the extended record of the specified bug, this includes
* the bug text fields
- * @@@ include reporter name and handler name, the problem is that
+ * @todo include reporter name and handler name, the problem is that
* handler can be 0, in this case no corresponding name will be
* found. Use equivalent of (+) in Oracle.
* @param int p_bug_id integer representing bug id
@@ -1350,7 +1377,7 @@ function bug_get_bugnote_stats( $p_bug_id ) {
* @return array array of results or null
* @access public
* @uses database_api.php
- * @users file_api.php
+ * @uses file_api.php
*/
function bug_get_attachments( $p_bug_id ) {
if( !file_can_view_bug_attachments( $p_bug_id ) ) {
View
240 core/bugnote_api.php
@@ -1,7 +1,6 @@
<?php
# Mantis - a php based bugtracking system
-# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
-# Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
+
# Mantis is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
@@ -14,24 +13,35 @@
#
# You should have received a copy of the GNU General Public License
# along with Mantis. If not, see <http://www.gnu.org/licenses/>.
-#
-# --------------------------------------------------------
-# $Id$
-# --------------------------------------------------------
/**
+ * BugNote API
* @package CoreAPI
* @subpackage BugnoteAPI
+ * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
+ * @copyright Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
+ * @link http://www.mantisbt.org
*/
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires current_user_api
+ */
require_once( $t_core_dir . 'current_user_api.php' );
+/**
+ * requires email_api
+ */
require_once( $t_core_dir . 'email_api.php' );
+/**
+ * requires history_api
+ */
require_once( $t_core_dir . 'history_api.php' );
+/**
+ * requires bug_api
+ */
require_once( $t_core_dir . 'bug_api.php' );
-# ## Bugnote API ###
# ===================================
# Bugnote Data Structure Definition
# ===================================
@@ -48,13 +58,13 @@ class BugnoteData {
var $time_tracking;
}
-# ===================================
-# Boolean queries and ensures
-# ===================================
-# --------------------
-# Check if a bugnote with the given ID exists
-#
-# return true if the bugnote exists, false otherwise
+/**
+ * Check if a bugnote with the given ID exists
+ * return true if the bugnote exists, false otherwise
+ * @param int $p_bugnote_id bugnote id
+ * @return bool
+ * @access public
+ */
function bugnote_exists( $p_bugnote_id ) {
$c_bugnote_id = db_prepare_int( $p_bugnote_id );
$t_bugnote_table = db_get_table( 'mantis_bugnote_table' );
@@ -71,19 +81,26 @@ function bugnote_exists( $p_bugnote_id ) {
}
}
-# --------------------
-# Check if a bugnote with the given ID exists
-#
-# return true if the bugnote exists, raise an error if not
+/**
+ * Check if a bugnote with the given ID exists
+ * return true if the bugnote exists, raise an error if not
+ * @param int $p_bugnote_id bugnote id
+ * @access public
+ */
function bugnote_ensure_exists( $p_bugnote_id ) {
if( !bugnote_exists( $p_bugnote_id ) ) {
trigger_error( ERROR_BUGNOTE_NOT_FOUND, ERROR );
}
}
-# --------------------
-# Check if the given user is the reporter of the bugnote
-# return true if the user is the reporter, false otherwise
+/**
+ * Check if the given user is the reporter of the bugnote
+ * return true if the user is the reporter, false otherwise
+ * @param int $p_bugnote_id bugnote id
+ * @param int $p_user_id user id
+ * @return bool
+ * @access public
+ */
function bugnote_is_user_reporter( $p_bugnote_id, $p_user_id ) {
if( bugnote_get_field( $p_bugnote_id, 'reporter_id' ) == $p_user_id ) {
return true;
@@ -92,13 +109,20 @@ function bugnote_is_user_reporter( $p_bugnote_id, $p_user_id ) {
}
}
-# ===================================
-# Creation / Deletion / Updating
-# ===================================
-# --------------------
-# Add a bugnote to a bug
-#
-# return the ID of the new bugnote
+/**
+ * Add a bugnote to a bug
+ * return the ID of the new bugnote
+ * @param int $p_bug_id bug id
+ * @param string $p_bugnote_text bugnote text
+ * @param string $p_time_tracking hh:mm string
+ * @param bool $p_private whether bugnote is private
+ * @param int $p_type bugnote type
+ * @param string $p_attr
+ * @param int $p_user_id user id
+ * @param bool $p_send_email generate email?
+ * @return false|int false or indicating bugnote id added
+ * @access public
+ */
function bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking = '0:00', $p_private = false, $p_type = 0, $p_attr = '', $p_user_id = null, $p_send_email = TRUE ) {
$c_bug_id = db_prepare_int( $p_bug_id );
$c_time_tracking = helper_duration_to_minutes( $p_time_tracking );
@@ -170,8 +194,12 @@ function bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking = '0:00', $p_
return $t_bugnote_id;
}
-# --------------------
-# Delete a bugnote
+/**
+ * Delete a bugnote
+ * @param int $p_bugnote_id bug note id
+ * @return bool
+ * @access public
+ */
function bugnote_delete( $p_bugnote_id ) {
$c_bugnote_id = db_prepare_int( $p_bugnote_id );
$t_bug_id = bugnote_get_field( $p_bugnote_id, 'bug_id' );
@@ -195,8 +223,12 @@ function bugnote_delete( $p_bugnote_id ) {
return true;
}
-# --------------------
-# delete all bugnotes associated with the given bug
+/**
+ * delete all bugnotes associated with the given bug
+ * @param int $p_bug_id bug id
+ * @return bool
+ * @access public
+ */
function bugnote_delete_all( $p_bug_id ) {
$c_bug_id = db_prepare_int( $p_bug_id );
$t_bugnote_table = db_get_table( 'mantis_bugnote_table' );
@@ -227,11 +259,12 @@ function bugnote_delete_all( $p_bug_id ) {
return true;
}
-# ===================================
-# Data Access
-# ===================================
-# --------------------
-# Get the text associated with the bugnote
+/**
+ * Get the text associated with the bugnote
+ * @param int $p_bugnote_id bugnote id
+ * @return string bugnote text
+ * @access public
+ */
function bugnote_get_text( $p_bugnote_id ) {
$t_bugnote_text_id = bugnote_get_field( $p_bugnote_id, 'bugnote_text_id' );
$t_bugnote_text_table = db_get_table( 'mantis_bugnote_text_table' );
@@ -245,8 +278,13 @@ function bugnote_get_text( $p_bugnote_id ) {
return db_result( $result );
}
-# --------------------
-# Get a field for the given bugnote
+/**
+ * Get a field for the given bugnote
+ * @param int $p_bugnote_id bugnote id
+ * @param string $p_field_name field name
+ * @return string field value
+ * @access public
+ */
function bugnote_get_field( $p_bugnote_id, $p_field_name ) {
$c_bugnote_id = db_prepare_int( $p_bugnote_id );
$c_field_name = db_prepare_string( $p_field_name );
@@ -260,8 +298,12 @@ function bugnote_get_field( $p_bugnote_id, $p_field_name ) {
return db_result( $result );
}
-# --------------------
-# Get latest bugnote id
+/**
+ * Get latest bugnote id
+ * @param int $p_bug_id bug id
+ * @return int latest bugnote id
+ * @access public
+ */
function bugnote_get_latest_id( $p_bug_id ) {
$c_bug_id = db_prepare_int( $p_bug_id );
$t_bugnote_table = db_get_table( 'mantis_bugnote_table' );
@@ -272,15 +314,21 @@ function bugnote_get_latest_id( $p_bug_id ) {
ORDER by last_modified DESC";
$result = db_query_bound( $query, Array( $c_bug_id ), 1 );
- return db_result( $result );
+ return (int)db_result( $result );
}
-# --------------------
-# Build the bugnotes array for the given bug_id filtered by specified $p_user_access_level.
-# Bugnotes are sorted by date_submitted according to 'bugnote_order' configuration setting.
-#
-# Return BugnoteData class object with raw values from the tables except the field
-# last_modified - it is UNIX_TIMESTAMP.
+/**
+ * Build the bugnotes array for the given bug_id filtered by specified $p_user_access_level.
+ * Bugnotes are sorted by date_submitted according to 'bugnote_order' configuration setting.
+ * Return BugnoteData class object with raw values from the tables except the field
+ * last_modified - it is UNIX_TIMESTAMP.
+ * @param int $p_bug_id bug id
+ * @param int $p_user_bugnote_order sort order
+ * @param int $p_user_bugnote_limit number of bugnotes to display to user
+ * @param int $p_user_id user id
+ * @return array array of bugnotes
+ * @access public
+ */
function bugnote_get_all_visible_bugnotes( $p_bug_id, $p_user_bugnote_order, $p_user_bugnote_limit, $p_user_id = null ) {
if( $p_user_id === null ) {
$t_user_id = auth_get_current_user_id();
@@ -315,12 +363,18 @@ function bugnote_get_all_visible_bugnotes( $p_bug_id, $p_user_bugnote_order, $p_
return $t_bugnotes;
}
-# --------------------
-# Build the bugnotes array for the given bug_id. Bugnotes are sorted by date_submitted
-# according to 'bugnote_order' configuration setting.
-# Return BugnoteData class object with raw values from the tables except the field
-# last_modified - it is UNIX_TIMESTAMP.
-# The data is not filtered by VIEW_STATE !!
+/**
+ * Build the bugnotes array for the given bug_id. Bugnotes are sorted by date_submitted
+ * according to 'bugnote_order' configuration setting.
+ * Return BugnoteData class object with raw values from the tables except the field
+ * last_modified - it is UNIX_TIMESTAMP.
+ * The data is not filtered by VIEW_STATE !!
+ * @param int $p_bug_id bug id
+ * @param int $p_user_bugnote_order sort order
+ * @param int $p_user_bugnote_limit number of bugnotes to display to user
+ * @return array array of bugnotes
+ * @access public
+ */
function bugnote_get_all_bugnotes( $p_bug_id, $p_user_bugnote_order, $p_user_bugnote_limit ) {
global $g_cache_bugnotes;
@@ -388,11 +442,13 @@ function bugnote_get_all_bugnotes( $p_bug_id, $p_user_bugnote_order, $p_user_bug
return $g_cache_bugnotes[$p_bug_id][$p_user_bugnote_order];
}
-# ===================================
-# Data Modification
-# ===================================
-# --------------------
-# Update the time_tracking field of the bugnote
+/**
+ * Update the time_tracking field of the bugnote
+ * @param int $p_bugnote_id bugnote id
+ * @param string $p_time_tracking timetracking string (hh:mm format)
+ * @return bool
+ * @access public
+ */
function bugnote_set_time_tracking( $p_bugnote_id, $p_time_tracking ) {
$c_bugnote_id = db_prepare_int( $p_bugnote_id );
$c_bugnote_time_tracking = helper_duration_to_minutes( $p_time_tracking );
@@ -407,8 +463,12 @@ function bugnote_set_time_tracking( $p_bugnote_id, $p_time_tracking ) {
return true;
}
-# --------------------
-# Update the last_modified field of the bugnote
+/**
+ * Update the last_modified field of the bugnote
+ * @param int $p_bugnote_id bugnote id
+ * @return bool
+ * @access public
+ */
function bugnote_date_update( $p_bugnote_id ) {
$c_bugnote_id = db_prepare_int( $p_bugnote_id );
$t_bugnote_table = db_get_table( 'mantis_bugnote_table' );
@@ -422,8 +482,13 @@ function bugnote_date_update( $p_bugnote_id ) {
return true;
}
-# --------------------
-# Set the bugnote text
+/**
+ * Set the bugnote text
+ * @param int $p_bugnote_id bugnote id
+ * @param string $p_bugnote_text bugnote text
+ * @return bool
+ * @access public
+ */
function bugnote_set_text( $p_bugnote_id, $p_bugnote_text ) {
$t_bug_id = bugnote_get_field( $p_bugnote_id, 'bug_id' );
$t_bugnote_text_id = bugnote_get_field( $p_bugnote_id, 'bugnote_text_id' );
@@ -442,8 +507,13 @@ function bugnote_set_text( $p_bugnote_id, $p_bugnote_text ) {
return true;
}
-# --------------------
-# Set the view state of the bugnote
+/**
+ * Set the view state of the bugnote
+ * @param int $p_bugnote_id bugnote id
+ * @param bool $p_private
+ * @return bool
+ * @access public
+ */
function bugnote_set_view_state( $p_bugnote_id, $p_private ) {
$c_bugnote_id = db_prepare_int( $p_bugnote_id );
$t_bug_id = bugnote_get_field( $p_bugnote_id, 'bug_id' );
@@ -456,7 +526,6 @@ function bugnote_set_view_state( $p_bugnote_id, $p_private ) {
$t_bugnote_table = db_get_table( 'mantis_bugnote_table' );
- # update view_state
$query = "UPDATE $t_bugnote_table
SET view_state=" . db_param() . "
WHERE id=" . db_param();
@@ -467,24 +536,26 @@ function bugnote_set_view_state( $p_bugnote_id, $p_private ) {
return true;
}
-# ===================================
-# Other
-# ===================================
-# --------------------
-# Pad the bugnote id with the appropriate number of zeros for printing
+/**
+ * Pad the bugnote id with the appropriate number of zeros for printing
+ * @param int $p_bugnote_id bugnote id
+ * @return string
+ * @access public
+ */
function bugnote_format_id( $p_bugnote_id ) {
$t_padding = config_get( 'display_bugnote_padding' );
return str_pad( $p_bugnote_id, $t_padding, '0', STR_PAD_LEFT );
}
-# ===================================
-# Bugnote Stats
-# ===================================
-# --------------------
-# Returns an array of bugnote stats
-# $p_from - Starting date (yyyy-mm-dd) inclusive, if blank, then ignored.
-# $p_to - Ending date (yyyy-mm-dd) inclusive, if blank, then ignored.
+/**
+ * Returns an array of bugnote stats
+ * @param int $p_bug_id bug id
+ * @param string $p_from Starting date (yyyy-mm-dd) inclusive, if blank, then ignored.
+ * @param string $p_to Ending date (yyyy-mm-dd) inclusive, if blank, then ignored.
+ * @return array array of bugnote stats
+ * @access public
+ */
function bugnote_stats_get_events_array( $p_bug_id, $p_from, $p_to ) {
$c_bug_id = db_prepare_int( $p_bug_id );
$c_from = db_bind_timestamp( $p_from . ' 00:00:00' );
@@ -523,10 +594,15 @@ function bugnote_stats_get_events_array( $p_bug_id, $p_from, $p_to ) {
return $t_results;
}
-# --------------------
-# Returns an array of bugnote stats
-# $p_from - Starting date (yyyy-mm-dd) inclusive, if blank, then ignored.
-# $p_to - Ending date (yyyy-mm-dd) inclusive, if blank, then ignored.
+/**
+ * Returns an array of bugnote stats
+ * @param int $p_project_id project id
+ * @param string $p_from Starting date (yyyy-mm-dd) inclusive, if blank, then ignored.
+ * @param string $p_to Ending date (yyyy-mm-dd) inclusive, if blank, then ignored.
+ * @param int $p_cost cost
+ * @return array array of bugnote stats
+ * @access public
+ */
function bugnote_stats_get_project_array( $p_project_id, $p_from, $p_to, $p_cost ) {
$c_project_id = db_prepare_int( $p_project_id );
$c_to = db_bind_timestamp( $p_to . ' 23:59:59' );
View
4 core/category_api.php
@@ -304,8 +304,8 @@ function category_get_row( $p_category_id ) {
/**
* Sort categories based on what project they're in.
* Call beforehand with a single parameter to set a 'preferred' project.
- * @return array $p_category1 array containing category details
- * @return array $p_category2 array containing category details
+ * @param array $p_category1 array containing category details
+ * @param array $p_category2 array containing category details
* @return int integer representing sort order
* @access public
*/
View
3  core/config_api.php
@@ -22,6 +22,9 @@
* @link http://www.mantisbt.org
*/
+/**
+ * requires error_api
+ */
require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'error_api.php' );
# cache for config variables
View
245 core/csv_api.php
@@ -15,6 +15,10 @@
# along with Mantis. If not, see <http://www.gnu.org/licenses/>.
/**
+ * CSV API
+ * Names for formatting functions are csv_format_*, where * corresponds to the
+ * field name as return get csv_get_columns() and by the filter api.
+ *
* @package CoreAPI
* @subpackage CSVAPI
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
@@ -22,19 +26,30 @@
* @link http://www.mantisbt.org
*/
-# ## CSV API ###
-# get the csv file new line, can be moved to config in the future
+/**
+ * get the csv file new line, can be moved to config in the future
+ * @return string containing new line character
+ * @access public
+ */
function csv_get_newline() {
return "\r\n";
}
-# get the csv file separator, can be moved to config in the future
+/**
+ * get the csv file separator, can be moved to config in the future
+ * @return string
+ * @access public
+ */
function csv_get_separator() {
return config_get( 'csv_separator' );
}
-# if all projects selected, default to <username>.csv, otherwise default to
-# <projectname>.csv.
+/**
+ * if all projects selected, default to <username>.csv, otherwise default to
+ * <projectname>.csv.
+ * @return string filename
+ * @access public
+ */
function csv_get_default_filename() {
$t_current_project_id = helper_get_current_project();
@@ -47,7 +62,12 @@ function csv_get_default_filename() {
return $t_filename . '.csv';
}
-# escape a string before writing it to csv file.
+/**
+ * escape a string before writing it to csv file.
+ * @param type $todo TODO
+ * @return TODO
+ * @access public
+ */
function csv_escape_string( $p_str ) {
# enclose strings with separators with quotaiton marks
@@ -63,156 +83,295 @@ function csv_escape_string( $p_str ) {
return $p_str;
}
-# An array of column names that are used to identify fields to include and in which order.
+/**
+ * An array of column names that are used to identify fields to include and in which order.
+ * @param type $todo TODO
+ * @return TODO
+ * @access public
+ */
function csv_get_columns() {
$t_columns = helper_get_columns_to_view( COLUMNS_TARGET_CSV_PAGE );
return $t_columns;
}
-#
-# Formatting Functions
-#
-# Names for formatting functions are csv_format_*, where * corresponds to the
-# field name as return get csv_get_columns() and by the filter api.
-#
-# format bug id
+/**
+ * format bug id
+ * @param int $p_bug_id bug id
+ * @return string csv formatted bug
+ * @access public
+ */
function csv_format_id( $p_bug_id ) {
return bug_format_id( $p_bug_id );
}
-# returns the project name corresponding to the supplied project id.
+/**
+ * returns the project name corresponding to the supplied project id.
+ * @param int $p_project_id project id
+ * @return string csv formatted project name
+ * @access public
+ */
function csv_format_project_id( $p_project_id ) {
return csv_escape_string( project_get_name( $p_project_id ) );
}
-# returns the reporter name corresponding to the supplied id.
+/**
+ * returns the reporter name corresponding to the supplied id.
+ * @param int $p_reporter_id user id
+ * @return string formatted user name
+ * @access public
+ */
function csv_format_reporter_id( $p_reporter_id ) {
return csv_escape_string( user_get_name( $p_reporter_id ) );
}
-# returns the handler name corresponding to the supplied id
+/**
+ * returns the handler name corresponding to the supplied id
+ * @param int $p_handler_id user id
+ * @return string formatted user name
+ * @access public
+ */
function csv_format_handler_id( $p_handler_id ) {
if( $p_handler_id > 0 ) {
return csv_escape_string( user_get_name( $p_handler_id ) );
}
}
-# return the priority string
+/**
+ * return the priority string
+ * @param int $p_priority
+ * @return string formatted priority string
+ * @access public
+ */
function csv_format_priority( $p_priority ) {
return csv_escape_string( get_enum_element( 'priority', $p_priority ) );
}
-# return the severity string
+/**
+ * return the severity string
+ * @param int $p_severity
+ * @return string formatted severity string
+ * @access public
+ */
function csv_format_severity( $p_severity ) {
return csv_escape_string( get_enum_element( 'severity', $p_severity ) );
}
-# return the reproducability string
+/**
+ * return the reproducability string
+ * @param int $p_reproducibility
+ * @return string formatted reproducibility string
+ * @access public
+ */
function csv_format_reproducibility( $p_reproducibility ) {
return csv_escape_string( get_enum_element( 'reproducibility', $p_reproducibility ) );
}
-# return the version
+/**
+ * return the version
+ * @param string $p_version version string
+ * @return string formatted version string
+ * @access public
+ */
function csv_format_version( $p_version ) {
return csv_escape_string( $p_version );
}
-# return the fixed_in_version
+/**
+ * return the fixed_in_version
+ * @param string $p_fixed_in_version fixed in version string
+ * @return string formatted fixed in version string
+ * @access public
+ */
function csv_format_fixed_in_version( $p_fixed_in_version ) {
return csv_escape_string( $p_fixed_in_version );
}
-# return the target_version
+/**
+ * return the target_version
+ * @param string $p_target_version target version string
+ * @return string formatted target version string
+ * @access public
+ */
function csv_format_target_version( $p_target_version ) {
return csv_escape_string( $p_target_version );
}
-# return the projection
+/**
+ * return the projection
+ * @param int $p_projection
+ * @return string formatted projection string
+ * @access public
+ */
function csv_format_projection( $p_projection ) {
return csv_escape_string( get_enum_element( 'projection', $p_projection ) );
}
-# return the category
+/**
+ * return the category
+ * @param int $p_category_id
+ * @return string formatted category string
+ * @access public
+ */
function csv_format_category_id( $p_category_id ) {
return csv_escape_string( category_full_name( $p_category_id, false ) );
}
-# return the date submitted
+/**
+ * return the date submitted
+ * @param string $p_date_submitted
+ * @return string formatted date
+ * @access public
+ */
function csv_format_date_submitted( $p_date_submitted ) {
return date( config_get( 'short_date_format' ), $p_date_submitted );
}
-# return the eta
+/**
+ * return the eta
+ * @param int $p_eta eta
+ * @return string formatted eta
+ * @access public
+ */
function csv_format_eta( $p_eta ) {
return csv_escape_string( get_enum_element( 'eta', $p_eta ) );
}
-# return the operating system
+/**
+ * return the operating system
+ * @param string $p_os operating system
+ * @return string formatted operating system
+ * @access public
+ */
function csv_format_os( $p_os ) {
return csv_escape_string( $p_os );
}
-# return the os build (os version)
+/**
+ * return the os build (os version)
+ * @param string $p_os_build operating system build
+ * @return string formatted operating system build
+ * @access public
+ */
function csv_format_os_build( $p_os_build ) {
return csv_escape_string( $p_os_build );
}
-# return the os build (os version)
+/**
+ * return the build
+ * @param string $p_build
+ * @return string formatted build
+ * @access public
+ */
function csv_format_build( $p_build ) {
return csv_escape_string( $p_build );
}
-# return the platform
+/**
+ * return the platform
+ * @param string $p_platform platform
+ * @return string formatted platform
+ * @access public
+ */
function csv_format_platform( $p_platform ) {
return csv_escape_string( $p_platform );
}
-# return the view state (eg: private / public)
+/**
+ * return the view state (eg: private / public)
+ * @param int $p_view_state view state
+ * @return string formatted view state
+ * @access public
+ */
function csv_format_view_state( $p_view_state ) {
return csv_escape_string( get_enum_element( 'view_state', $p_view_state ) );
}
-# return the last updated date
+/**
+ * return the last updated date
+ * @param string $p_last_updated last updated
+ * @return string formated last updated string
+ * @access public
+ */
function csv_format_last_updated( $p_last_updated ) {
return date( config_get( 'short_date_format' ), $p_last_updated );
}
-# return the summary
+/**
+ * return the summary
+ * @param string $p_summary summary
+ * @return string formatted summary
+ * @access public
+ */
function csv_format_summary( $p_summary ) {
return csv_escape_string( $p_summary );
}
-# return the description
-function csv_format_description( $p_summary ) {
- return csv_escape_string( $p_summary );
+/**
+ * return the description
+ * @param string $p_description description
+ * @return string formatted description
+ * @access public
+ */
+function csv_format_description( $p_description ) {
+ return csv_escape_string( $p_description );
}
-# return the steps to reproduce
+/**
+ * return the steps to reproduce
+ * @param string $p_steps_to_reproduce steps to reproduce
+ * @return string formatted steps to reproduce
+ * @access public
+ */
function csv_format_steps_to_reproduce( $p_steps_to_reproduce ) {
return csv_escape_string( $p_steps_to_reproduce );
}
-# return the additional information
+/**
+ * return the additional information
+ * @param string $p_additional_information
+ * @return string formatted additional information
+ * @access public
+ */
function csv_format_additional_information( $p_additional_information ) {
return csv_escape_string( $p_additional_information );
}
-# return the status string
+/**
+ * return the status string
+ * @param string $p_status status
+ * @return string formatted status
+ * @access public
+ */
function csv_format_status( $p_status ) {
return csv_escape_string( get_enum_element( 'status', $p_status ) );
}
-# return the resolution string
+/**
+ * return the resolution string
+ * @param int $p_resolution resolution
+ * @return string formatted resolution string
+ * @access public
+ */
function csv_format_resolution( $p_resolution ) {
return csv_escape_string( get_enum_element( 'resolution', $p_resolution ) );
}
-# return the duplicate bug id
+/**
+ * return the duplicate bug id
+ * @param int $p_duplicate_id
+ * @return string formatted bug id
+ * @access public
+ */
function csv_format_duplicate_id( $p_duplicate_id ) {
return bug_format_id( $p_duplicate_id );
}
-# return the selection
+/**
+ * return the selection
+ * @param int $p_duplicate_id
+ * @return string
+ * @access public
+ */
function csv_format_selection( $p_duplicate_id ) {
return csv_escape_string( '' );
}
View
3  core/current_user_api.php
@@ -24,6 +24,9 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires filter_api
+ */
require_once( $t_core_dir . 'filter_api.php' );
# ## Current User API ###
View
9 core/custom_field_api.php
@@ -24,8 +24,17 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires bug_api
+ */
require_once( $t_core_dir . 'bug_api.php' );
+/**
+ * requires helper_api
+ */
require_once( $t_core_dir . 'helper_api.php' );
+/**
+ * requires date_api
+ */
require_once( $t_core_dir . 'date_api.php' );
# ## Custom Fields API ###
View
6 core/custom_function_api.php
@@ -24,7 +24,13 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires prepare_api
+ */
require_once( $t_core_dir . 'prepare_api.php' );
+/**
+ * requires columns_api
+ */
require_once( $t_core_dir . 'columns_api.php' );
# ## Custom Function API ###
View
3  core/database_api.php
@@ -31,6 +31,9 @@
*/
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires gpc_api
+ */
require_once( $t_core_dir . 'gpc_api.php' );
# Do not explicitly include $t_core_dir to allow using system ADODB by including
View
27 core/email_api.php
@@ -26,14 +26,41 @@
define( 'PHPMAILER_PATH', $t_core_dir . 'phpmailer' . DIRECTORY_SEPARATOR );
+/**
+ * requires current_user_api
+ */
require_once( $t_core_dir . 'current_user_api.php' );
+/**
+ * requires bug_api
+ */
require_once( $t_core_dir . 'bug_api.php' );
+/**
+ * requires custom_field_api
+ */
require_once( $t_core_dir . 'custom_field_api.php' );
+/**
+ * requires string_api
+ */
require_once( $t_core_dir . 'string_api.php' );
+/**
+ * requires history_api
+ */
require_once( $t_core_dir . 'history_api.php' );
+/**
+ * requires email_queue_api
+ */
require_once( $t_core_dir . 'email_queue_api.php' );
+/**
+ * requires relationship_api
+ */
require_once( $t_core_dir . 'relationship_api.php' );
+/**
+ * requires disposable_api
+ */
require_once( $t_core_dir . 'disposable' . DIRECTORY_SEPARATOR . 'disposable.php' );
+/**
+ * requires class.phpmailer.php
+ */
require_once( PHPMAILER_PATH . 'class.phpmailer.php' );
# reusable object of class SMTP
View
2  core/excel_api.php
@@ -15,6 +15,7 @@
# along with Mantis. If not, see <http://www.gnu.org/licenses/>.
/**
+ * Excel API
* @package CoreAPI
* @subpackage ExcelAPI
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
@@ -22,7 +23,6 @@
* @link http://www.mantisbt.org
*/
-# ## Excel API ###
/**
* A method that returns the header for an Excel Xml file.
*
View
6 core/file_api.php
@@ -24,7 +24,13 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires history_api
+ */
require_once( $t_core_dir . 'history_api.php' );
+/**
+ * requires bug_api
+ */
require_once( $t_core_dir . 'bug_api.php' );
$g_cache_file_count = array();
View
24 core/filter_api.php
@@ -24,17 +24,35 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires current_user_api
+ */
require_once( $t_core_dir . 'current_user_api.php' );
+/**
+ * requires user_api
+ */
require_once( $t_core_dir . 'user_api.php' );
+/**
+ * requires bug_api
+ */
require_once( $t_core_dir . 'bug_api.php' );
+/**
+ * requires collapse_api
+ */
require_once( $t_core_dir . 'collapse_api.php' );
+/**
+ * requires relationship_api
+ */
require_once( $t_core_dir . 'relationship_api.php' );
+/**
+ * requires tag_api
+ */
require_once( $t_core_dir . 'tag_api.php' );
+/**
+ * requires config_filter_defaults_inc
+ */
require_once( $g_absolute_path . 'config_filter_defaults_inc.php' );
-# ==========================================================================
-# PERMALINK FUNCTIONS =
-# ==========================================================================
/**
* Get a permalink for the current active filter. The results of using these fields by other users
* can be inconsistent with the original results due to fields like "Myself", "Current Project",
View
6 core/freemind_api.php
@@ -27,7 +27,13 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires filter_api
+ */
require_once( $t_core_dir . 'filter_api.php' );
+/**
+ * requires bug_api
+ */
require_once( $t_core_dir . 'bug_api.php' );
/**
View
2  core/icon_api.php
@@ -22,8 +22,6 @@
* @link http://www.mantisbt.org
*/
-# Icon API
-
# prints the staus icon
function icon_get_status_icon( $p_icon ) {
$t_icon_path = config_get( 'icon_path' );
View
3  core/json_api.php
@@ -23,6 +23,9 @@
* @link http://www.mantisbt.org
*/
+/**
+ * requires url_api
+ */
require_once( config_get( 'core_path' ) . 'url_api.php' );
/**
View
3  core/last_visited_api.php
@@ -24,6 +24,9 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires tokens_api
+ */
require_once( $t_core_dir . 'tokens_api.php' );
/**
View
22 core/my_view_inc.php
@@ -14,13 +14,33 @@
# You should have received a copy of the GNU General Public License
# along with Mantis. If not, see <http://www.gnu.org/licenses/>.
+/**
+ * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
+ * @copyright Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
+ * @link http://www.mantisbt.org
+ */
$t_core_path = config_get( 'core_path' );
+/**
+ * requires current_user_api
+ */
require_once( $t_core_path . 'current_user_api.php' );
-require_once( $t_core_path . 'bug_api.php' );
+/**
+ * requires bug_api
+ */
+ require_once( $t_core_path . 'bug_api.php' );
+/**
+ * requires string_api
+ */
require_once( $t_core_path . 'string_api.php' );
+/**
+ * requires date_api
+ */
require_once( $t_core_path . 'date_api.php' );
+/**
+ * requires icon_api
+ */
require_once( $t_core_path . 'icon_api.php' );
$t_filter = current_user_get_bug_filter();
View
6 core/news_api.php
@@ -26,7 +26,13 @@
$t_core_path = config_get( 'core_path' );
+/**
+ * requires current_user_api
+ */
require_once( $t_core_path . 'current_user_api.php' );
+/**
+ * requires twitter_api
+ */
require_once( $t_core_path . 'twitter_api.php' );
# --------------------
View
4 core/plugin_api.php
@@ -26,6 +26,10 @@
*/
$t_class_path = config_get_global( 'class_path' );
+
+/**
+ * requires MantisPlugin.class
+ */
require_once( $t_class_path . 'MantisPlugin.class.php' );
# Cache variables #####
View
21 core/print_api.php
@@ -25,12 +25,33 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires ajax_api
+ */
require_once( $t_core_dir . 'ajax_api.php' );
+/**
+ * requires current_user_api
+ */
require_once( $t_core_dir . 'current_user_api.php' );
+/**
+ * requires string_api
+ */
require_once( $t_core_dir . 'string_api.php' );
+/**
+ * requires prepare_api
+ */
require_once( $t_core_dir . 'prepare_api.php' );
+/**
+ * requires profile_api
+ */
require_once( $t_core_dir . 'profile_api.php' );
+/**
+ * requires last_visited_api
+ */
require_once( $t_core_dir . 'last_visited_api.php' );
+/**
+ * requires file_api
+ */
require_once( $t_core_dir . 'file_api.php' );
# --------------------
View
7 core/profile_api.php
@@ -22,13 +22,6 @@
* @link http://www.mantisbt.org
*/
-# ===================================
-# Boolean queries and ensures
-# ===================================
-# ===================================
-# Creation / Deletion / Updating
-# ===================================
-
# Create a new profile for the user, return the ID of the new profile
function profile_create( $p_user_id, $p_platform, $p_os, $p_os_build, $p_description ) {
$c_user_id = db_prepare_int( $p_user_id );
View
3  core/projax_api.php
@@ -23,6 +23,9 @@
* @link http://www.mantisbt.org
*/
+/**
+ * requires projax.php
+ */
require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'projax' . DIRECTORY_SEPARATOR . 'projax.php' );
# enables the projax library for this page.
View
15 core/project_api.php
@@ -24,10 +24,25 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires category_api
+ */
require_once( $t_core_dir . 'category_api.php' );
+/**
+ * requires version_api
+ */
require_once( $t_core_dir . 'version_api.php' );
+/**
+ * requires bug_api
+ */
require_once( $t_core_dir . 'bug_api.php' );
+/**
+ * requires file_api
+ */
require_once( $t_core_dir . 'file_api.php' );
+/**
+ * requires news_api
+ */
require_once( $t_core_dir . 'news_api.php' );
# ## Project API ###
View
3  core/relationship_api.php
@@ -67,6 +67,9 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires collapse_api
+ */
require_once( $t_core_dir . 'collapse_api.php' );
class BugRelationshipData {
View
6 core/relationship_graph_api.php
@@ -41,7 +41,13 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires relationship_api
+ */
require_once( $t_core_dir . 'relationship_api.php' );
+/**
+ * requires graphviz_api
+ */
require_once( $t_core_dir . 'graphviz_api.php' );
# Generate a relationship graph for the given issue.
View
9 core/sponsorship_api.php
@@ -24,8 +24,17 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires email_api
+ */
require_once( $t_core_dir . 'email_api.php' );
+/**
+ * requires bug_api
+ */
require_once( $t_core_dir . 'bug_api.php' );
+/**
+ * requires history_api
+ */
require_once( $t_core_dir . 'history_api.php' );
# =========================================
View
7 core/string_api.php
@@ -24,7 +24,14 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires bug_api
+ */
require_once( $t_core_dir . 'bug_api.php' );
+
+/**
+ * requires user_pref_api
+ */
require_once( $t_core_dir . 'user_pref_api.php' );
$g_cache_html_valid_tags = '';
View
4 core/summary_api.php
@@ -21,6 +21,10 @@
* @copyright Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
*/
+
+/**
+ * requires config_filter_defaults_include
+ */
require_once( $g_absolute_path . 'config_filter_defaults_inc.php' );
function summary_helper_print_row( $p_label, $p_open, $p_resolved, $p_closed, $p_total ) {
View
7 core/tag_api.php
@@ -27,7 +27,14 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires bug api
+ */
require_once( $t_core_dir . 'bug_api.php' );
+
+/**
+ * requires history api
+ */
require_once( $t_core_dir . 'history_api.php' );
/**
View
3  core/twitter_api.php
@@ -24,6 +24,9 @@
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires config api
+ */
require_once( $t_core_dir . 'config_api.php' );
$g_twitter_enabled = null;
View
107 core/utility_api.php
@@ -1,7 +1,6 @@
<?php
# Mantis - a php based bugtracking system
-# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
-# Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
+
# Mantis is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
@@ -14,10 +13,6 @@
#
# You should have received a copy of the GNU General Public License
# along with Mantis. If not, see <http://www.gnu.org/licenses/>.
-#
-# --------------------------------------------------------
-# $Id$
-# --------------------------------------------------------
/**
* Utility functions are *small* functions that are used often and therefore
@@ -27,12 +22,21 @@
* included first in order to make them available to all the APIs.
* Miscellaneous functions that provide functionality on top of other APIS
* are found in the helper_api.
+ *
* @package CoreAPI
* @subpackage UtilityAPI
+ * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
+ * @copyright Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
+ * @link http://www.mantisbt.org
*/
-# converts a 1 value to X
-# converts a 0 value to a space
+/**
+ * converts a 1 value to X
+ * converts a 0 value to a space
+ * @param int $p_num boolean numeric
+ * @return string X or space
+ * @access public
+ */
function trans_bool( $p_num ) {
if( 0 == $p_num ) {
return '&nbsp;';
@@ -41,18 +45,33 @@ function trans_bool( $p_num ) {
}
}
-# Breaks up an enum string into num:value elements
+/**
+ * Breaks up an enum string into num:value elements
+ * @param string $p_enum_string enum string
+ * @return array array of num:value elements
+ * @access public
+ */
function explode_enum_string( $p_enum_string ) {
return explode( ',', $p_enum_string );
}
-# Given one num:value pair it will return both in an array
-# num will be first (element 0) value second (element 1)
+/**
+ * Given one num:value pair it will return both in an array
+ * num will be first (element 0) value second (element 1)
+ * @param string $p_enum_elem a num:value pair
+ * @return array array(num->value)
+ * @access public
+ */
function explode_enum_arr( $p_enum_elem ) {
return explode( ':', $p_enum_elem );
}
-# Get the string associated with the $p_enum value
+/**
+ * Get the string associated with the $p_enum value
+ * @param string $p_enum_string
+ * @return array
+ * @access public
+ */
function get_enum_to_array( $p_enum_string ) {
$t_arr = explode_enum_string( $p_enum_string );
$enum_count = count( $t_arr );
@@ -64,7 +83,13 @@ function get_enum_to_array( $p_enum_string ) {
return $t_array;
}
-# Get the string associated with the $p_enum value
+/**
+ * Get the string associated with the $p_enum value
+ * @param string $p_enum_string
+ * @param int $p_num
+ * @return string
+ * @access public
+ */
function get_enum_to_string( $p_enum_string, $p_num ) {
$t_arr = explode_enum_string( $p_enum_string );
$enum_count = count( $t_arr );
@@ -77,7 +102,12 @@ function get_enum_to_string( $p_enum_string, $p_num ) {
return '@' . $p_num . '@';
}
-# Add a trailing DIRECTORY_SEPARATOR to a string if it isn't present
+/**
+ * Add a trailing DIRECTORY_SEPARATOR to a string if it isn't present
+ * @param string $p_path
+ * @return string
+ * @access public
+ */
function terminate_directory_path( $p_path ) {
$str_len = strlen( $p_path );
if( $p_path && $p_path[$str_len - 1] != DIRECTORY_SEPARATOR ) {
@@ -87,8 +117,13 @@ function terminate_directory_path( $p_path ) {
return $p_path;
}
-# Return true if the parameter is an empty string or a string
-# containing only whitespace, false otherwise
+/**
+ * Return true if the parameter is an empty string or a string
+ * containing only whitespace, false otherwise
+ * @param string $p_var string to test
+ * @return bool
+ * @access public
+ */
function is_blank( $p_var ) {
$p_var = trim( $p_var );
$str_len = strlen( $p_var );
@@ -98,7 +133,12 @@ function is_blank( $p_var ) {
return false;
}
-# Get the named php ini variable but return it as a bool
+/**
+ * Get the named php ini variable but return it as a bool
+ * @param string $p_name
+ * @return bool
+ * @access public
+ */
function ini_get_bool( $p_name ) {
$result = ini_get( $p_name );
@@ -124,8 +164,13 @@ function ini_get_bool( $p_name ) {
}
}
-# Get the named php ini variable but return it as a number after converting "K" and "M"
-function ini_get_number( $p_name ) {
+/**
+ * Get the named php ini variable but return it as a number after converting "K" and "M"
+ * @param string $p_name
+ * @return int
+ * @access public
+ */
+function ini_get_number( ) {
$t_result = ini_get( $p_name );
$t_val = spliti( 'M', $t_result );
if( $t_val[0] != $t_result ) {
@@ -138,7 +183,14 @@ function ini_get_number( $p_name ) {
return $t_result;
}
-# Sort a multi-dimensional array by one of its keys
+/**
+ * Sort a multi-dimensional array by one of its keys
+ * @param array $p_array Array to sort
+ * @param string $p_key key to sort array on
+ * @param int $p_direction sort direction
+ * @return array sorted array
+ * @access public
+ */
function multi_sort( $p_array, $p_key, $p_direction = ASCENDING ) {
if( DESCENDING == $p_direction ) {
$t_factor = -1;
@@ -165,8 +217,12 @@ function multi_sort( $p_array, $p_key, $p_direction = ASCENDING ) {
return $p_array;
}
-# Return GD version
-# It doesn't use gd_info() so it works with PHP < 4.3.0 as well
+/**
+ * Return GD version
+ * It doesn't use gd_info() so it works with PHP < 4.3.0 as well
+ * @return int represents gd version
+ * @access public
+ */
function get_gd_version() {
$t_GDfuncList = get_extension_funcs( 'gd' );
if( !is_array( $t_GDfuncList ) ) {
@@ -180,7 +236,12 @@ function get_gd_version() {
}
}
-# return true or false if string matches current page name
+/**
+ * return true or false if string matches current page name
+ * @param string $p_string page name
+ * @return bool
+ * @access public
+ */
function is_page_name( $p_string ) {
return isset( $_SERVER['PHP_SELF'] ) && ( 0 < strpos( $_SERVER['PHP_SELF'], $p_string ) );
}
View
12 core/xmlhttprequest_api.php
@@ -23,9 +23,21 @@
*/
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
+/**
+ * requires bug_api
+ */
require_once( $t_core_dir . 'bug_api.php' );
+/**
+ * requires profile_api
+ */
require_once( $t_core_dir . 'profile_api.php' );
+/**
+ * requires logging_api
+ */
require_once( $t_core_dir . 'logging_api.php' );
+/**
+ * requires projax_api
+ */
require_once( $t_core_dir . 'projax_api.php' );
/**
View
18 plugins/XmlImportExport/XmlImportExport.php
@@ -1,6 +1,6 @@
<?php
# Mantis - a php based bugtracking system
-# Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
+
# Mantis is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
@@ -13,11 +13,19 @@
#
# You should have received a copy of the GNU General Public License
# along with Mantis. If not, see <http://www.gnu.org/licenses/>.
-#
-# --------------------------------------------------------
-# $Id$
-# --------------------------------------------------------
+/**
+ * XML Import / Export Plugin
+ * @package MantisPlugin
+ * @subpackage MantisPlugin
+ * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
+ * @copyright Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
+ * @link http://www.mantisbt.org
+ */
+
+/**
+ * requires MantisPlugin.class.php
+ */
require_once( config_get( 'class_path' ) . 'MantisPlugin.class.php' );
class XmlImportExportPlugin extends MantisPlugin {
View
3  tag_attach.php
@@ -26,6 +26,9 @@
$t_core_path = config_get( 'core_path' );
+ /**
+ * requires tag_api
+ */
require_once( $t_core_path . 'tag_api.php' );
form_security_validate( 'tag_attach' );
View
3  tag_delete.php
@@ -26,6 +26,9 @@
$t_core_path = config_get( 'core_path' );
+ /**
+ * requires tag_api
+ */
require_once( $t_core_path . 'tag_api.php' );
form_security_validate( 'tag_delete' );
View
3  tag_detach.php
@@ -26,6 +26,9 @@
$t_core_path = config_get( 'core_path' );
+ /**
+ * requires tag_api
+ */
require_once( $t_core_path . 'tag_api.php' );
form_security_validate( 'tag_detach' );
View
3  tag_update.php
@@ -26,6 +26,9 @@
$t_core_path = config_get( 'core_path' );
+ /**
+ * requires tag_api
+ */
require_once( $t_core_path . 'tag_api.php' );
form_security_validate( 'tag_update' );
View
6 tag_update_page.php
@@ -26,7 +26,13 @@
$t_core_path = config_get( 'core_path' );
+ /**
+ * requires ajax_api
+ */
require_once( $t_core_path . 'ajax_api.php' );
+ /**
+ * requires tag_api
+ */
require_once( $t_core_path . 'tag_api.php' );
compress_enable();
View
3  tag_view_page.php
@@ -26,6 +26,9 @@
$t_core_path = config_get( 'core_path' );
+ /**
+ * requires tag_api
+ */
require_once( $t_core_path . 'tag_api.php' );
access_ensure_global_level( config_get( 'tag_view_threshold' ) );
View
5 tests/test.php
@@ -16,7 +16,6 @@
/**
* @package MantisBT
- * @version $Id$
* @copyright Copyright (C) 2002 - 2008 Mantis Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
*/
@@ -24,7 +23,9 @@
# Require the core API and admin authentication to run tests
$t_authenticated_testing = true;
-# Load the core API
+/**
+ * requires core APIs
+ */
require_once( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'core.php' );
# Check for access rights if required
View
3  view.php
@@ -27,6 +27,9 @@
$t_core_path = config_get( 'core_path' );
+ /**
+ * requires string_api
+ */
require_once( $t_core_path.'string_api.php' );
// Copy 'id' parameter into 'bug_id' so it is found by the simple/advanced view page.
View
18 view_all_inc.php
@@ -23,11 +23,29 @@
$t_core_path = config_get( 'core_path' );
+ /**
+ * requires current_user_api
+ */
require_once( $t_core_path.'current_user_api.php' );
+ /**
+ * requires bug_api
+ */
require_once( $t_core_path.'bug_api.php' );
+ /**
+ * requires string_api
+ */
require_once( $t_core_path.'string_api.php' );
+ /**
+ * requires date_api
+ */
require_once( $t_core_path.'date_api.php' );
+ /**
+ * requires icon_api
+ */
require_once( $t_core_path.'icon_api.php' );
+ /**
+ * requires columns_api
+ */
require_once( $t_core_path.'columns_api.php' );
$t_filter = current_user_get_bug_filter();
Please sign in to comment.
Something went wrong with that request. Please try again.