From: <vb...@us...> - 2002-08-31 01:59:37
|
Update of /cvsroot/mantisbt/mantisbt/core In directory usw-pr-cvs1:/tmp/cvs-serv3044 Modified Files: access_api.php custom_attribute_api.php email_api.php graph_api.php html_api.php Log Message: Now all core files don't use $s_ ... they now used lang_get() instead. Index: access_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/access_api.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- access_api.php 29 Aug 2002 02:56:23 -0000 1.2 +++ access_api.php 31 Aug 2002 01:59:34 -0000 1.3 @@ -16,10 +16,10 @@ # he/she is not authorised to. This outputs an access denied message then # re-directs to the mainpage. function access_denied() { - global $MANTIS_ERROR, $s_proceed; + global $MANTIS_ERROR; print '<center>'; print '<p>' . $MANTIS_ERROR[ERROR_ACCESS_DENIED] . '<p>'; - print_bracket_link( 'main_page.php', $s_proceed ); + print_bracket_link( 'main_page.php', lang_get( 'proceed' ) ); print '</center>'; exit; } Index: custom_attribute_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/custom_attribute_api.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- custom_attribute_api.php 30 Aug 2002 05:35:18 -0000 1.6 +++ custom_attribute_api.php 31 Aug 2002 01:59:34 -0000 1.7 @@ -124,7 +124,7 @@ # -------------------- function attribute_update( $p_parameter, $p_project_id, $p_attribute, $p_orig_attribute, $p_color='' ) { - global $g_mantis_project_customization_table, $s_states; + global $g_mantis_project_customization_table; $c_project_id = (integer)$p_project_id; $c_attribute = addslashes($p_attribute); @@ -142,7 +142,7 @@ break ; } } - if ( ($p_parameter == $s_states) && ($p_color != '') ) { + if ( ( $p_parameter == lang_get( 'states' ) ) && ( $p_color != '' ) ) { $t_color_arr = attribute_get_all('colors', $c_project_id) ; $t_color_arr[$t_index] = $p_color ; $t_color_str = implode(',',$t_color_arr); @@ -160,7 +160,7 @@ # -------------------- function attribute_delete( $p_parameter, $p_project_id, $p_attribute ) { - global $g_mantis_project_customization_table, $s_states, $g_custom_status_slot, $g_mantis_bug_table ; + global $g_mantis_project_customization_table, $g_custom_status_slot, $g_mantis_bug_table ; $c_project_id = (integer)$p_project_id; $c_attribute = addslashes($p_attribute); @@ -181,7 +181,7 @@ array_splice( $t_attribute_arr, $t_offset, 1); # color treatment for custom states - if ($p_parameter == $s_states) { + if ( $p_parameter == lang_get( 'states' ) ) { $t_color_arr = attribute_get_all('colors', $c_project_id) ; array_splice( $t_color_arr, $t_offset, 1); $t_color_str = implode(',',$t_color_arr); @@ -198,7 +198,7 @@ # update mantis_bug table # the bug with the deleted status is now set as @null@ # the status above are decreased by 1 - if ($p_parameter == $s_states) { + if ( $p_parameter == lang_get( 'states' ) ) { #slot[0] : the unused one ; index : the deleted bug ; index_up : the end of slot $t_status_index = $g_custom_status_slot[0] + 1 + $t_offset ; @@ -221,8 +221,7 @@ } # -------------------- - function attribute_display( $p_parameter, $s_title, $p_project_id) { - global $s_attribute_customization_title, $s_edit_link, $s_delete_link, $s_add_button, $s_copy_from, $s_copy_to, $s_asso_color, $s_states ; + function attribute_display( $p_parameter, $p_title, $p_project_id) { ?> <tr class="row-category"> <td width="100%"> @@ -253,9 +252,9 @@ </td> <td class="center" width="25%" bgcolor="<?php echo $t_bgcolor ?>"> <?php - print_bracket_link('manage_proj_attribute_edit_page.php?f_project_id='.$p_project_id."&f_parameter=$p_parameter&f_attribute=".$t2_attribute, $s_edit_link ); + print_bracket_link('manage_proj_attribute_edit_page.php?f_project_id='.$p_project_id."&f_parameter=$p_parameter&f_attribute=".$t2_attribute, lang_get( 'edit_link' ) ); PRINT ' '; - print_bracket_link('manage_proj_attribute_del_page.php?f_project_id='.$p_project_id."&f_parameter=$p_parameter&f_attribute=".$t2_attribute, $s_delete_link ); + print_bracket_link('manage_proj_attribute_del_page.php?f_project_id='.$p_project_id."&f_parameter=$p_parameter&f_attribute=".$t2_attribute, lang_get( 'delete_link' ) ); ?> </td> </tr> @@ -269,14 +268,14 @@ <form method="get" action="manage_proj_attribute_add.php"> <input type="hidden" name="f_project_id" value="<?php echo $p_project_id ?>"> <input type="text" name="f_attribute" size="32" maxlength="64"> - <?php if ($p_parameter == $s_states) { - echo $s_asso_color ?> + <?php if ( $p_parameter == lang_get ( 'states' ) ) { + echo lang_get( 'asso_color' ) ?> <select name="f_color"> <?php print_custom_status_color_list() ?> </select> <?php } #if color ?> <input type="hidden" name="f_parameter" value="<?php echo $p_parameter ?>"> - <input type="submit" value="<?php echo $s_add_button.' '.$s_title ?>"> + <input type="submit" value="<?php echo lang_get( 'add_button' ) . ' ' . $p_title ?>"> </form> </td> </tr> @@ -291,8 +290,8 @@ <select name="f_other_project_id"> <?php print_project_option_list() ?> </select> - <input type="submit" name="f_copy_from" value="<?php echo $s_copy_from ?>"> - <input type="submit" name="f_copy_to" value="<?php echo $s_copy_to ?>"> + <input type="submit" name="f_copy_from" value="<?php echo lang_get( 'copy_from' ) ?>"> + <input type="submit" name="f_copy_to" value="<?php echo lang_get( 'copy_to' ) ?>"> </form> </td> </tr> Index: email_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/email_api.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- email_api.php 29 Aug 2002 14:26:45 -0000 1.8 +++ email_api.php 31 Aug 2002 01:59:34 -0000 1.9 @@ -236,13 +236,9 @@ # -------------------- # Send password to user function email_signup( $p_user_id, $p_password ) { - global $g_mantis_user_table, $g_path, - $s_new_account_subject, - $s_new_account_greeting, $s_new_account_url, - $s_new_account_username, $s_new_account_password, - $s_new_account_message, $s_new_account_do_not_reply; + global $g_mantis_user_table, $g_path; - $c_user_id = (integer)$p_user_id; + $c_user_id = db_prepare_int( $p_user_id ); $query = "SELECT username, email FROM $g_mantis_user_table @@ -252,24 +248,22 @@ extract( $row, EXTR_PREFIX_ALL, 'v' ); # Build Welcome Message - $t_message = $s_new_account_greeting. - $s_new_account_url.$g_path."\n". - $s_new_account_username.$v_username."\n". - $s_new_account_password.$p_password."\n\n". - $s_new_account_message. - $s_new_account_do_not_reply; + $t_message = lang_get( 'new_account_greeting' ). + lang_get( 'new_account_url' ) . $g_path . "\n". + lang_get( 'new_account_username' ) . $v_username . "\n". + lang_get( 'new_account_password' ) . $p_password . "\n\n". + lang_get( 'new_account_message' ) . + lang_get( 'new_account_do_not_reply' ); $t_headers = ''; - email_send( $v_email, $s_new_account_subject, $t_message, $t_headers ); + email_send( $v_email, lang_get( 'new_account_subject' ), $t_message, $t_headers ); } # -------------------- # Send new password when user forgets function email_reset( $p_user_id, $p_password ) { - global $g_mantis_user_table, $g_path, - $s_reset_request_msg, $s_account_name_msg, - $s_news_password_msg; + global $g_mantis_user_table, $g_path; - $c_user_id = (integer)$p_user_id; + $c_user_id = db_prepare_int( $p_user_id ); $query = "SELECT username, email FROM $g_mantis_user_table @@ -279,9 +273,9 @@ extract( $row, EXTR_PREFIX_ALL, 'v' ); # Build Welcome Message - $t_message = $s_reset_request_msg."\n\n". - $s_account_name_msg.': '.$v_username."\n". - $s_news_password_msg.': '.$p_password."\n\n". + $t_message = lang_get( 'reset_request_msg' ) . "\n\n". + lang_get( 'account_name_msg' ) . ': '.$v_username."\n". + lang_get( 'news_password_msg' ) . ': '.$p_password."\n\n". $g_path."\n\n"; email_send( $v_email, 'New Password', $t_message ); @@ -289,66 +283,50 @@ # -------------------- # send notices when a new bug is added function email_new_bug( $p_bug_id ) { - global $s_new_bug_msg; - $t_bcc = build_bcc_list( $p_bug_id, 'new' ); - email_bug_info( $p_bug_id, $s_new_bug_msg, $t_bcc ); + email_bug_info( $p_bug_id, lang_get( 'new_bug_msg' ), $t_bcc ); } # -------------------- # send notices when a new bugnote function email_bugnote_add( $p_bug_id ) { - global $s_email_bugnote_msg; - $t_bcc = build_bcc_list( $p_bug_id, 'bugnote' ); - email_bug_info( $p_bug_id, $s_email_bugnote_msg, $t_bcc ); + email_bug_info( $p_bug_id, lang_get( 'email_bugnote_msg' ), $t_bcc ); } # -------------------- # send notices when a bug is RESOLVED function email_resolved( $p_bug_id ) { - global $s_email_resolved_msg; - $t_bcc = build_bcc_list( $p_bug_id, 'resolved' ); - email_bug_info( $p_bug_id, $s_email_resolved_msg, $t_bcc ); + email_bug_info( $p_bug_id, lang_get( 'email_resolved_msg' ), $t_bcc ); } # -------------------- # send notices when a bug is CLOSED function email_close( $p_bug_id ) { - global $s_email_close_msg; - $t_bcc = build_bcc_list( $p_bug_id, 'closed' ); - email_bug_info( $p_bug_id, $s_email_close_msg, $t_bcc ); + email_bug_info( $p_bug_id, lang_get( 'email_close_msg' ), $t_bcc ); } # -------------------- # send notices when a bug is set to FEEDBACK function email_feedback( $p_bug_id ) { - global $s_email_feedback_msg; - $t_bcc = build_bcc_list( $p_bug_id, 'feedback' ); - email_bug_info( $p_bug_id, $s_email_feedback_msg, $t_bcc ); + email_bug_info( $p_bug_id, lang_get( 'email_feedback_msg' ), $t_bcc ); } # -------------------- # send notices when a bug is REOPENED function email_reopen( $p_bug_id ) { - global $s_email_reopen_msg; - $t_bcc = build_bcc_list( $p_bug_id, 'reopened' ); - email_bug_info( $p_bug_id, $s_email_reopen_msg, $t_bcc ); + email_bug_info( $p_bug_id, lang_get( 'email_reopen_msg' ), $t_bcc ); } # -------------------- # send notices when a bug is ASSIGNED function email_assign( $p_bug_id ) { - global $s_email_assigned_msg; - $t_bcc = build_bcc_list( $p_bug_id, 'assigned' ); - email_bug_info( $p_bug_id, $s_email_assigned_msg, $t_bcc ); + email_bug_info( $p_bug_id, lang_get( 'email_assigned_msg' ), $t_bcc ); } # -------------------- # send notices when a bug is DELETED function email_bug_deleted( $p_bug_id ) { - global $s_email_bug_deleted_msg; - $t_bcc = build_bcc_list( $p_bug_id, 'deleted' ); - email_bug_info( $p_bug_id, $s_email_bug_deleted_msg, $t_bcc ); + email_bug_info( $p_bug_id, lang_get( 'email_bug_deleted_msg' ), $t_bcc ); } # -------------------- # Build the bug info part of the message @@ -357,17 +335,9 @@ $g_mantis_project_table, $g_complete_date_format, $g_show_view, $g_bugnote_order, $g_path, - $s_email_reporter, $s_email_handler, - $s_email_project, $s_email_bug, $s_email_category, - $s_email_reproducibility, $s_email_severity, - $s_email_priority, $s_email_status, $s_email_resolution, - $s_email_duplicate, $s_email_date_submitted, - $s_email_last_modified, $s_email_summary, - $s_email_description, - $g_email_separator1, $s_email_bug_deleted_msg, - $g_email_padding_length; + $g_email_separator1, $g_email_padding_length; - $c_bug_id = (integer)$p_bug_id; + $c_bug_id = db_prepare_int( $p_bug_id ); $query = "SELECT *, UNIX_TIMESTAMP(date_submitted) as date_submitted, UNIX_TIMESTAMP(last_updated) as last_updated @@ -405,7 +375,7 @@ $t_sta_str = get_enum_element( 'status', $v_status ); $t_rep_str = get_enum_element( 'reproducibility', $v_reproducibility ); $t_message = $g_email_separator1."\n"; - if ( $p_message != $s_email_bug_deleted_msg) { + if ( $p_message != lang_get( 'email_bug_deleted_msg' ) ) { $t_message .= $g_path; if ( ADVANCED_ONLY == $g_show_view || ( BOTH == $g_show_view && ON == current_user_get_pref( 'advanced_view' ) ) ) { $t_message .= 'view_bug_advanced_page.php'; @@ -415,29 +385,29 @@ $t_message .= '?f_id='.$p_bug_id."\n"; $t_message .= $g_email_separator1."\n"; } - $t_message .= str_pad( $s_email_reporter.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_reporter_name."\n"; - $t_message .= str_pad( $s_email_handler.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_handler_name."\n"; + $t_message .= str_pad( lang_get( 'email_reporter' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_reporter_name."\n"; + $t_message .= str_pad( lang_get( 'email_handler' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_handler_name."\n"; $t_message .= $g_email_separator1."\n"; - $t_message .= str_pad( $s_email_project.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_project_name."\n"; - $t_message .= str_pad( $s_email_bug.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$v_id."\n"; - $t_message .= str_pad( $s_email_category.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$v_category."\n"; - $t_message .= str_pad( $s_email_reproducibility.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_rep_str."\n"; - $t_message .= str_pad( $s_email_severity.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_sev_str."\n"; - $t_message .= str_pad( $s_email_priority.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_pri_str."\n"; - $t_message .= str_pad( $s_email_status.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_sta_str."\n"; + $t_message .= str_pad( lang_get( 'email_project' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_project_name."\n"; + $t_message .= str_pad( lang_get( 'email_bug' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$v_id."\n"; + $t_message .= str_pad( lang_get( 'email_category') . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$v_category."\n"; + $t_message .= str_pad( lang_get( 'email_reproducibility' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_rep_str."\n"; + $t_message .= str_pad( lang_get( 'email_severity' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_sev_str."\n"; + $t_message .= str_pad( lang_get( 'email_priority' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_pri_str."\n"; + $t_message .= str_pad( lang_get( 'email_status' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_sta_str."\n"; if ( RESOLVED == $v_status ) { $t_res_str = get_enum_element( 'resolution', $v_resolution ); - $t_message .= str_pad( $s_email_resolution.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_res_str."\n"; + $t_message .= str_pad( lang_get( 'email_resolution' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_res_str."\n"; if ( DUPLICATE == $v_resolution ) { - $t_message .= str_pad( $s_email_duplicate.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$v_duplicate_id."\n"; + $t_message .= str_pad( lang_get( 'email_duplicate' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$v_duplicate_id."\n"; } } $t_message .= $g_email_separator1."\n"; - $t_message .= str_pad( $s_email_date_submitted.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$v_date_submitted."\n"; - $t_message .= str_pad( $s_email_last_modified.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$v_last_updated."\n"; + $t_message .= str_pad( lang_get( 'email_date_submitted' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$v_date_submitted."\n"; + $t_message .= str_pad( lang_get( 'email_last_modified' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$v_last_updated."\n"; $t_message .= $g_email_separator1."\n"; - $t_message .= str_pad( $s_email_summary.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$v_summary."\n"; - $t_message .= "$s_email_description: \n".wordwrap( $v2_description )."\n"; + $t_message .= str_pad( lang_get( 'email_summary' ) . ': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$v_summary."\n"; + $t_message .= lang_get( 'email_description' ) . ": \n".wordwrap( $v2_description )."\n"; $t_message .= $g_email_separator1."\n\n"; return $t_message; @@ -537,7 +507,7 @@ # this function sends the actual email function email_send( $p_recipient, $p_subject, $p_message, $p_header='' ) { global $g_from_email, $g_enable_email_notification, - $g_return_path_email, $g_use_x_priority, $s_charset, + $g_return_path_email, $g_use_x_priority, $g_use_phpMailer, $g_phpMailer_method, $g_smtp_host; # short-circuit if no emails should be sent @@ -622,7 +592,7 @@ $t_headers .= "X-Priority: 0\n"; # Urgent = 1, Not Urgent = 5, Disable = 0 } $t_headers .= "Return-Path: <$g_return_path_email>\n"; # return email if error - $t_headers .= 'Content-Type: text/plain; charset=' . $s_charset . "\n"; + $t_headers .= 'Content-Type: text/plain; charset=' . lang_get( 'charset' ) . "\n"; $t_headers .= $p_header; Index: graph_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/graph_api.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- graph_api.php 25 Aug 2002 08:14:59 -0000 1.2 +++ graph_api.php 31 Aug 2002 01:59:34 -0000 1.3 @@ -339,7 +339,7 @@ # Pie chart which dispays by categories function graph_category_summary_pct( $p_title=''){ - global $category_name, $category_bug_count, $s_by_category; + global $category_name, $category_bug_count; $graph = new PieGraph(600,450); $graph->img->SetMargin(40,40,40,100); @@ -465,7 +465,7 @@ } function graph_developer_summary( ){ - global $developer_name, $total_bug_count, $open_bug_count, $resolved_bug_count, $s_by_developer; + global $developer_name, $total_bug_count, $open_bug_count, $resolved_bug_count; $graph = new Graph(300,380); $graph->img->SetMargin(40,40,40,170); @@ -473,7 +473,7 @@ $graph->SetScale('textlin'); $graph->SetMarginColor('white'); $graph->SetFrame(false); - $graph->title->Set($s_by_developer); + $graph->title->Set( lang_get( 'by_developer' ) ); $graph->xaxis->SetTickLabels($developer_name); $graph->xaxis->SetLabelAngle(90); $graph->yaxis->scale->ticks->SetDirection(-1); @@ -534,7 +534,7 @@ } function graph_reporter_summary( ){ - global $reporter_name, $reporter_count, $s_email_reporter, $s_by_reporter; + global $reporter_name, $reporter_count; $graph = new Graph(300,380); $graph->img->SetMargin(40,40,40,170); @@ -542,7 +542,7 @@ $graph->SetScale('textlin'); $graph->SetMarginColor('white'); $graph->SetFrame(false); - $graph->title->Set($s_by_reporter); + $graph->title->Set( lang_get( 'by_reporter' ) ); $graph->xaxis->SetTickLabels($reporter_name); $graph->xaxis->SetLabelAngle(90); $graph->yaxis->scale->ticks->SetDirection(-1); @@ -585,7 +585,7 @@ } function graph_category_summary(){ - global $category_name, $category_bug_count, $s_by_category; + global $category_name, $category_bug_count; $graph = new Graph(300,380); $graph->img->SetMargin(40,40,40,170); @@ -593,7 +593,7 @@ $graph->SetScale('textlin'); $graph->SetMarginColor('white'); $graph->SetFrame(false); - $graph->title->Set($s_by_category); + $graph->title->Set( lang_get( 'by_category' ) ); $graph->xaxis->SetTickLabels($category_name); $graph->xaxis->SetLabelAngle(90); $graph->yaxis->scale->ticks->SetDirection(-1); @@ -691,7 +691,7 @@ } function graph_cumulative_bydate(){ - global $metrics, $s_by_date; + global $metrics; for ($i=0;$i<count($metrics);$i++) { $plot_date[] = strtotime($metrics[$i][0]); @@ -706,7 +706,7 @@ $graph->SetScale('linlin'); $graph->SetMarginColor('white'); $graph->SetFrame(false); - $graph->title->Set("cumulative $s_by_date"); + $graph->title->Set( 'cumulative ' . lang_get( 'by_date' ) ); $graph->legend->Pos(0.1,0.6,'right','top'); $graph->legend->SetShadow(false); $graph->legend->SetFillColor('white'); Index: html_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/html_api.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- html_api.php 29 Aug 2002 02:56:23 -0000 1.5 +++ html_api.php 31 Aug 2002 01:59:34 -0000 1.6 @@ -70,19 +70,17 @@ # -------------------- # (3) Prints the content-type function print_content_type() { - global $s_charset; - - PRINT '<meta http-equiv="Content-type" content="text/html;charset=' . $s_charset . '">'; + PRINT '<meta http-equiv="Content-type" content="text/html;charset=' . lang_get( 'charset' ) . '">'; } # -------------------- # (4) Prints the <TITLE> tag function print_title( $p_title ) { global $g_show_project_in_title, - $g_project_cookie_val, $s_all_projects; + $g_project_cookie_val; if ( 0 == $g_project_cookie_val ) { - $t_project_name = $s_all_projects; + $t_project_name = lang_get( 'all_projects' ); } else { $t_project_name = project_get_field( $g_project_cookie_val, 'name' ); } @@ -128,12 +126,10 @@ # (9) Prints the title that is visible in the main panel of the browser # We use a temporary variable to create the title then print it. function print_header( $p_title='Mantis' ) { - global $g_show_project_in_title, - $g_project_cookie_val, - $s_all_projects; + global $g_show_project_in_title, $g_project_cookie_val; if ( 0 == $g_project_cookie_val ) { - $t_project_name = $s_all_projects; + $t_project_name = lang_get( 'all_projects' ); } else { $t_project_name = project_get_field( $g_project_cookie_val, 'name' ); } @@ -233,10 +229,7 @@ # it also creates the form where users can switch projects function print_login_info() { global $g_string_cookie_val, $g_project_cookie_val, - $g_complete_date_format, - $s_switch, $s_logged_in_as, $s_all_projects, - $s_access_levels_enum_string, - $g_use_javascript; + $g_complete_date_format, $g_use_javascript; $t_username = current_user_get_field( 'username' ); $t_access_level = get_enum_element( 'access_levels', current_user_get_access_level() ); @@ -245,7 +238,7 @@ PRINT '<table class="hide">'; PRINT '<tr>'; PRINT '<td class="login-info-left">'; - PRINT "$s_logged_in_as: <span class=\"login-username\">$t_username</span> <span class=\"small\">($t_access_level)</span>"; + PRINT lang_get( 'logged_in_as' ) . ": <span class=\"login-username\">$t_username</span> <span class=\"small\">($t_access_level)</span>"; PRINT '</td>'; PRINT '<td class="login-info-middle">'; PRINT "<span class=\"login-time\">$t_now</span>"; @@ -258,10 +251,10 @@ } else { PRINT '<select name="f_project_id" class="small">'; } - PRINT "<option value=\"0000000\">$s_all_projects</option>"; + PRINT '<option value="0000000">' . lang_get( 'all_projects' ) . '</option>'; print_project_option_list( $g_project_cookie_val ); PRINT '</select>'; - PRINT "<input type=\"submit\" value=\"$s_switch\" class=\"small\">"; + PRINT '<input type="submit" value="' . lang_get( 'switch' ) . '" class="small">'; PRINT '</form>'; PRINT '</td>'; PRINT '</tr>'; @@ -306,42 +299,38 @@ # also prints the login info, time, and project select form function print_menu() { global $g_string_cookie_val, $g_project_cookie_val, - $g_show_report, $g_view_summary_threshold, - $s_main_link, $s_view_bugs_link, $s_report_bug_link, - $s_summary_link, $s_account_link, - $s_manage_link, $s_users_link, $s_edit_news_link, $s_docs_link, - $s_jump, $s_logout_link; + $g_show_report, $g_view_summary_threshold; if ( isset( $g_string_cookie_val ) ) { $t_protected = current_user_get_field( 'protected' ); PRINT '<table class="width100" cellspacing="0">'; PRINT '<tr>'; PRINT '<td class="menu">'; - PRINT "<a href=\"main_page.php\">$s_main_link</a> | "; - PRINT "<a href=\"view_all_bug_page.php\">$s_view_bugs_link</a> | "; + PRINT '<a href="main_page.php">' . lang_get( 'main_link' ) . '</a> | '; + PRINT '<a href="view_all_bug_page.php">' . lang_get( 'view_bugs_link' ) . '</a> | '; if ( access_level_check_greater_or_equal( REPORTER ) ) { if ( "0000000" != $g_project_cookie_val ) { $t_report_url = get_report_redirect_url( 1 ); - PRINT "<a href=\"$t_report_url\">$s_report_bug_link</a> | "; + PRINT '<a href="$t_report_url">' . lang_get( 'report_bug_link' ) . '</a> | '; } else { - PRINT "<a href=\"login_select_proj_page.php?f_ref=".get_report_redirect_url( 1 )."\">$s_report_bug_link</a> | "; + PRINT '<a href="login_select_proj_page.php?f_ref=' . get_report_redirect_url( 1 ) . '">' . lang_get( 'report_bug_link' ) . '</a> | '; } } if ( access_level_check_greater_or_equal( $g_view_summary_threshold ) ) { - PRINT "<a href=\"summary_page.php\">$s_summary_link</a> | "; + PRINT '<a href="summary_page.php">' . lang_get( 'summary_link' ) . '</a> | '; } # only show accounts that are NOT protected if ( OFF == $t_protected ) { - PRINT "<a href=\"account_page.php\">$s_account_link</a> | "; + PRINT '<a href="account_page.php">' . lang_get( 'account_link' ) . '</a> | '; } if ( access_level_check_greater_or_equal( MANAGER ) ) { if ( "0000000" != $g_project_cookie_val ) { - PRINT "<a href=\"proj_user_menu_page.php\">$s_users_link</a> | "; + PRINT '<a href="proj_user_menu_page.php">' . lang_get( 'users_link' ) . '</a> | '; } else { - PRINT "<a href=\"login_select_proj_page.php\">$s_users_link</a> | "; + PRINT '<a href="login_select_proj_page.php">' . lang_get( 'users_link' ) . '</a> | '; } } @@ -351,24 +340,24 @@ } else { $t_link = 'manage_proj_menu_page.php'; } - PRINT "<a href=\"$t_link\">$s_manage_link</a> | "; + PRINT "<a href=\"$t_link\">" . lang_get( 'manage_link' ) . '</a> | '; } if ( access_level_check_greater_or_equal( MANAGER ) ) { # Admin can edit news for All Projects (site-wide) if ( ( "0000000" != $g_project_cookie_val ) || ( access_level_check_greater_or_equal( ADMINISTRATOR ) ) ) { - PRINT "<a href=\"news_menu_page.php\">$s_edit_news_link</a> | "; + PRINT '<a href="news_menu_page.php">' . lang_get( 'edit_news_link' ) . '</a> | '; } else { - PRINT "<a href=\"login_select_proj_page.php\">$s_edit_news_link</a> | "; + PRINT '<a href="login_select_proj_page.php">' . lang_get( 'edit_news_link' ) . '</a> | '; } } - PRINT "<a href=\"proj_doc_page.php\">$s_docs_link</a> | "; - PRINT "<a href=\"logout_page.php\">$s_logout_link</a>"; + PRINT '<a href="proj_doc_page.php">' . lang_get( 'docs_link' ) . '</a> | '; + PRINT '<a href="logout_page.php">' . lang_get( 'logout_link' ) . '</a>'; PRINT '</td>'; PRINT '<td class="right" style="white-space: nowrap;">'; PRINT '<form method="post" action="jump_to_bug.php">'; PRINT "<input type=\"text\" name=\"f_id\" size=\"10\" class=\"small\"> "; - PRINT "<input type=\"submit\" value=\"$s_jump\" class=\"small\"> "; + PRINT '<input type="submit" value="' . lang_get( 'jump' ) . '" class="small"> '; PRINT '</form>'; PRINT '</td>'; PRINT '</tr>'; @@ -379,15 +368,15 @@ ### -------------------- # prints the links to the graphic pages, in summary_page.php function print_menu_graph() { - global $s_synthesis_link, $s_status_link,$s_priority_link,$s_severity_link,$s_category_link,$s_resolution_link, $g_use_jpgraph ; + global $g_use_jpgraph; if ( $g_use_jpgraph != 0 ) { - PRINT '<a href="summary_page.php"><img src="images/synthese.gif" border="0" align="center" />$s_synthesis_link</a> | '; - PRINT '<a href="summary_graph_imp_status.php"><img src="images/synthgraph.gif" border="0" align="center" />$s_status_link</a> | '; - PRINT '<a href="summary_graph_imp_priority.php"><img src="images/synthgraph.gif" border="0" align="center" />$s_priority_link</a> | '; - PRINT '<a href="summary_graph_imp_severity.php"><img src="images/synthgraph.gif" border="0" align="center" />$s_severity_link</a> | '; - PRINT '<a href="summary_graph_imp_category.php"><img src="images/synthgraph.gif" border="0" align="center" />$s_category_link</a> | '; - PRINT '<a href="summary_graph_imp_resolution.php"><img src="images/synthgraph.gif" border="0" align="center" />$s_resolution_link</a>'; + PRINT '<a href="summary_page.php"><img src="images/synthese.gif" border="0" align="center" />' . lang_get( 'synthesis_link' ) . '</a> | '; + PRINT '<a href="summary_graph_imp_status.php"><img src="images/synthgraph.gif" border="0" align="center" />' . lang_get( 'status_link' ) . '</a> | '; + PRINT '<a href="summary_graph_imp_priority.php"><img src="images/synthgraph.gif" border="0" align="center" />' . lang_get( 'priority_link' ) . '</a> | '; + PRINT '<a href="summary_graph_imp_severity.php"><img src="images/synthgraph.gif" border="0" align="center" />' . lang_get( 'severity_link' ) . '</a> | '; + PRINT '<a href="summary_graph_imp_category.php"><img src="images/synthgraph.gif" border="0" align="center" />' . lang_get( 'category_link' ) . '</a> | '; + PRINT '<a href="summary_graph_imp_resolution.php"><img src="images/synthgraph.gif" border="0" align="center" />' . lang_get( 'resolution_link' ) . '</a>'; } } @@ -395,11 +384,6 @@ # prints the manage menu # if the $p_page matches a url then don't make that a link function print_manage_menu( $p_page='' ) { - global $s_manage_users_link, $s_manage_projects_link, - $s_create_new_account_link, - $s_projects, - $s_documentation_link; - if ( !access_level_check_greater_or_equal ( ADMINISTRATOR ) ) { return; } @@ -417,20 +401,16 @@ } PRINT '<p><div align="center">'; - print_bracket_link( $t_manage_page, $s_manage_users_link ); - print_bracket_link( $t_manage_project_menu_page, $s_manage_projects_link ); - print_bracket_link( $t_manage_user_create_page, $s_create_new_account_link ); - print_bracket_link( $t_documentation_page, $s_documentation_link ); + print_bracket_link( $t_manage_page, lang_get( 'manage_users_link' ) ); + print_bracket_link( $t_manage_project_menu_page, lang_get( 'manage_projects_link' ) ); + print_bracket_link( $t_manage_user_create_page, lang_get( 'create_new_account_link' ) ); + print_bracket_link( $t_documentation_page, lang_get( 'documentation_link' ) ); PRINT '</div>'; } # -------------------- # prints the account menu # if the $p_page matches a url then don't make that a link function print_account_menu( $p_page='' ) { - global $s_account_link, - $s_manage_profiles_link, - $s_change_preferences_link; - $t_account_page = 'account_page.php'; $t_account_prefs_page = 'account_prefs_page.php'; $t_account_profile_menu_page = 'account_prof_menu_page.php'; @@ -441,18 +421,15 @@ case $t_account_profile_menu_page : $t_account_profile_menu_page = ''; break; } - print_bracket_link( $t_account_page, $s_account_link ); - print_bracket_link( $t_account_prefs_page, $s_change_preferences_link ); - print_bracket_link( $t_account_profile_menu_page, $s_manage_profiles_link ); + print_bracket_link( $t_account_page, lang_get( 'account_link' ) ); + print_bracket_link( $t_account_prefs_page, lang_get( 'change_preferences_link' ) ); + print_bracket_link( $t_account_profile_menu_page, lang_get( 'manage_profiles_link' ) ); } # -------------------- # prints the doc menu # if the $p_page matches a url then don't make that a link function print_doc_menu( $p_page='' ) { - global $s_user_documentation, - $s_project_documentation, - $s_add_file, - $g_allow_file_upload; + global $g_allow_file_upload; $t_documentation_html = 'doc/documentation.html'; $t_proj_doc_page = 'proj_doc_page.php'; @@ -464,17 +441,17 @@ case $t_proj_doc_add_page : $t_proj_doc_add_page = ''; break; } - print_bracket_link( $t_documentation_html, $s_user_documentation ); - print_bracket_link( $t_proj_doc_page, $s_project_documentation ); + print_bracket_link( $t_documentation_html, lang_get( 'user_documentation' ) ); + print_bracket_link( $t_proj_doc_page, lang_get( 'project_documentation' ) ); if ( ( ON == $g_allow_file_upload )&&( access_level_check_greater_or_equal( MANAGER ) ) ) { - print_bracket_link( $t_proj_doc_add_page, $s_add_file ); + print_bracket_link( $t_proj_doc_add_page, lang_get( 'add_file' ) ); } } # -------------------- # prints the manage doc menu # if the $p_page matches a url then don't make that a link function print_manage_doc_menu( $p_page='' ) { - global $s_system_info_link, $g_path; + global $g_path; $g_path = $g_path.'doc/'; $t_documentation_page = 'documentation_page.php'; @@ -484,7 +461,7 @@ } PRINT '<p><div align="center">'; - print_bracket_link( $t_documentation_page, $s_system_info_link ); + print_bracket_link( $t_documentation_page, lang_get( 'system_info_link' ) ); print_bracket_link( $g_path.'ChangeLog', 'ChangeLog' ); print_bracket_link( $g_path.'README', 'README' ); print_bracket_link( $g_path.'INSTALL', 'INSTALL' ); @@ -495,13 +472,10 @@ # -------------------- # prints the summary menu function print_summary_menu( $p_page='' ) { - global $s_summary_link, - $g_use_jpgraph, $s_summary_jpgraph_link, - $s_print_all_bug_page_link, - $s_print_reports; + global $g_use_jpgraph; PRINT '<p><div align="center">'; - print_bracket_link( 'print_all_bug_page.php', $s_print_all_bug_page_link ); + print_bracket_link( 'print_all_bug_page.php', lang_get( 'print_all_bug_page_link' ) ); if ( $g_use_jpgraph != 0 ) { $t_summary_page = 'summary_page.php'; @@ -512,34 +486,32 @@ case $t_summary_jpgraph_page: $t_summary_jpgraph_page = ''; break; } - print_bracket_link( $t_summary_page, $s_summary_link ); - print_bracket_link( $t_summary_jpgraph_page, $s_summary_jpgraph_link ); + print_bracket_link( $t_summary_page, lang_get( 'summary_link' ) ); + print_bracket_link( $t_summary_jpgraph_page, lang_get( 'summary_jpgraph_link' ) ); } PRINT '</div>'; } # -------------------- # prints the signup link function print_signup_link() { - global $g_allow_signup, $s_signup_link; + global $g_allow_signup; if ( $g_allow_signup != 0 ) { PRINT '<p><div align="center">'; - print_bracket_link( 'signup_page.php', $s_signup_link ); + print_bracket_link( 'signup_page.php', lang_get( 'signup_link' ) ); PRINT '</div>'; } } # -------------------- function print_proceed( $p_result, $p_query, $p_link ) { - global $s_operation_successful, $s_proceed; - PRINT '<p>'; PRINT '<div align="center">'; if ( $p_result ) { # SUCCESS - PRINT $s_operation_successful.'<p>'; + PRINT lang_get( 'operation_successful' ) . '<p>'; } else { # FAILURE print_sql_error( $p_query ); } - print_bracket_link( $p_link, $s_proceed ); + print_bracket_link( $p_link, lang_get( 'proceed' ) ); PRINT '</div>'; } # -------------------- |