[ Index ] |
|
Code source de Mantis 1.1.0rc3 |
1 <?php 2 # Mantis - a php based bugtracking system 3 4 # Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org 5 # Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net 6 7 # Mantis is free software: you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation, either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # Mantis is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with Mantis. If not, see <http://www.gnu.org/licenses/>. 19 20 # -------------------------------------------------------- 21 # $Id: account_prefs_inc.php,v 1.34.14.1 2007-10-13 22:32:02 giallu Exp $ 22 # -------------------------------------------------------- 23 24 $t_core_path = config_get( 'core_path' ); 25 26 require_once( $t_core_path.'user_pref_api.php' ); 27 28 function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_accounts_menu = true, $p_redirect_url = '') { 29 if ( null === $p_user_id ) { 30 $p_user_id = auth_get_current_user_id(); 31 } 32 33 $t_redirect_url = $p_redirect_url; 34 if ( is_blank( $t_redirect_url ) ) { 35 $t_redirect_url = 'account_prefs_page.php'; 36 } 37 38 # protected account check 39 if ( user_is_protected( $p_user_id ) ) { 40 if ( $p_error_if_protected ) { 41 trigger_error( ERROR_PROTECTED_ACCOUNT, ERROR ); 42 } else { 43 return; 44 } 45 } 46 47 if ( ! user_pref_exists( $p_user_id ) ) { 48 user_pref_set_default( $p_user_id ); 49 } 50 51 # prefix data with u_ 52 $t_pref = user_pref_get( $p_user_id ); 53 ?> 54 <?php # Account Preferences Form BEGIN ?> 55 <br /> 56 <div align="center"> 57 <form method="post" action="account_prefs_update.php"> 58 <input type="hidden" name="user_id" value="<?php echo $p_user_id ?>" /> 59 <input type="hidden" name="redirect_url" value="<?php echo $t_redirect_url ?>" /> 60 <table class="width75" cellspacing="1"> 61 <tr> 62 <td class="form-title"> 63 <?php echo lang_get( 'default_account_preferences_title' ) ?> 64 </td> 65 <td class="right"> 66 <?php 67 if ( $p_accounts_menu ) { 68 print_account_menu( 'account_prefs_page.php' ); 69 } 70 ?> 71 </td> 72 </tr> 73 <tr class="row-1"> 74 <td class="category" width="50%"> 75 <?php echo lang_get( 'default_project' ) ?> 76 </td> 77 <td width="50%"> 78 <select name="default_project"> 79 <?php print_project_option_list( $t_pref->default_project ) ?> 80 </select> 81 </td> 82 </tr> 83 <tr class="row-2"> 84 <td class="category"> 85 <?php echo lang_get( 'advanced_report' ) ?> 86 </td> 87 <td> 88 <input type="checkbox" name="advanced_report" <?php check_checked( $t_pref->advanced_report, ON ); ?> /> 89 </td> 90 </tr> 91 <tr class="row-1"> 92 <td class="category"> 93 <?php echo lang_get( 'advanced_view' ) ?> 94 </td> 95 <td> 96 <input type="checkbox" name="advanced_view" <?php check_checked( $t_pref->advanced_view, ON ); ?> /> 97 </td> 98 </tr> 99 <tr class="row-2"> 100 <td class="category"> 101 <?php echo lang_get( 'advanced_update' ) ?> 102 </td> 103 <td> 104 <input type="checkbox" name="advanced_update" <?php check_checked( $t_pref->advanced_update, ON ); ?> /> 105 </td> 106 </tr> 107 <tr class="row-1"> 108 <td class="category"> 109 <?php echo lang_get( 'refresh_delay' ) ?> 110 </td> 111 <td> 112 <input type="text" name="refresh_delay" size="4" maxlength="4" value="<?php echo $t_pref->refresh_delay ?>" /> 113 </td> 114 </tr> 115 <tr class="row-2"> 116 <td class="category"> 117 <?php echo lang_get( 'redirect_delay' ) ?> 118 </td> 119 <td> 120 <input type="text" name="redirect_delay" size="1" maxlength="1" value="<?php echo $t_pref->redirect_delay ?>" /> 121 </td> 122 </tr> 123 <tr class="row-1"> 124 <td class="category"> 125 <?php echo lang_get( 'bugnote_order' ) ?> 126 </td> 127 <td> 128 <input type="radio" name="bugnote_order" value="ASC" <?php check_checked( $t_pref->bugnote_order, 'ASC' ); ?> /><?php echo lang_get( 'bugnote_order_asc' ) ?> 129 <input type="radio" name="bugnote_order" value="DESC" <?php check_checked( $t_pref->bugnote_order, 'DESC' ); ?> /><?php echo lang_get( 'bugnote_order_desc' ) ?> 130 </td> 131 </tr> 132 <?php 133 if ( ON == config_get( 'enable_email_notification' ) ) { 134 ?> 135 <tr class="row-2"> 136 <td class="category"> 137 <?php echo lang_get( 'email_on_new' ) ?> 138 </td> 139 <td> 140 <input type="checkbox" name="email_on_new" <?php check_checked( $t_pref->email_on_new, ON ); ?> /> 141 <?php echo lang_get( 'with_minimum_severity' ) ?> 142 <select name="email_on_new_min_severity"> 143 <option value="<?php echo OFF ?>"><?php echo lang_get( 'any' ) ?></option> 144 <option value="<?php echo OFF ?>"></option> 145 <?php print_enum_string_option_list( 'severity', $t_pref->email_on_new_min_severity ) ?> 146 </select> 147 </td> 148 </tr> 149 <tr class="row-1"> 150 <td class="category"> 151 <?php echo lang_get( 'email_on_assigned' ) ?> 152 </td> 153 <td> 154 <input type="checkbox" name="email_on_assigned" <?php check_checked( $t_pref->email_on_assigned, ON ); ?> /> 155 <?php echo lang_get( 'with_minimum_severity' ) ?> 156 <select name="email_on_assigned_min_severity"> 157 <option value="<?php echo OFF ?>"><?php echo lang_get( 'any' ) ?></option> 158 <option value="<?php echo OFF ?>"></option> 159 <?php print_enum_string_option_list( 'severity', $t_pref->email_on_assigned_min_severity ) ?> 160 </select> 161 </td> 162 </tr> 163 <tr class="row-2"> 164 <td class="category"> 165 <?php echo lang_get( 'email_on_feedback' ) ?> 166 </td> 167 <td> 168 <input type="checkbox" name="email_on_feedback" <?php check_checked( $t_pref->email_on_feedback, ON ); ?> /> 169 <?php echo lang_get( 'with_minimum_severity' ) ?> 170 <select name="email_on_feedback_min_severity"> 171 <option value="<?php echo OFF ?>"><?php echo lang_get( 'any' ) ?></option> 172 <option value="<?php echo OFF ?>"></option> 173 <?php print_enum_string_option_list( 'severity', $t_pref->email_on_feedback_min_severity ) ?> 174 </select> 175 </td> 176 </tr> 177 <tr class="row-1"> 178 <td class="category"> 179 <?php echo lang_get( 'email_on_resolved' ) ?> 180 </td> 181 <td> 182 <input type="checkbox" name="email_on_resolved" <?php check_checked( $t_pref->email_on_resolved, ON ); ?> /> 183 <?php echo lang_get( 'with_minimum_severity' ) ?> 184 <select name="email_on_resolved_min_severity"> 185 <option value="<?php echo OFF ?>"><?php echo lang_get( 'any' ) ?></option> 186 <option value="<?php echo OFF ?>"></option> 187 <?php print_enum_string_option_list( 'severity', $t_pref->email_on_resolved_min_severity ) ?> 188 </select> 189 </td> 190 </tr> 191 <tr class="row-2"> 192 <td class="category"> 193 <?php echo lang_get( 'email_on_closed' ) ?> 194 </td> 195 <td> 196 <input type="checkbox" name="email_on_closed" <?php check_checked( $t_pref->email_on_closed, ON ); ?> /> 197 <?php echo lang_get( 'with_minimum_severity' ) ?> 198 <select name="email_on_closed_min_severity"> 199 <option value="<?php echo OFF ?>"><?php echo lang_get( 'any' ) ?></option> 200 <option value="<?php echo OFF ?>"></option> 201 <?php print_enum_string_option_list( 'severity', $t_pref->email_on_closed_min_severity ) ?> 202 </select> 203 </td> 204 </tr> 205 <tr class="row-1"> 206 <td class="category"> 207 <?php echo lang_get( 'email_on_reopened' ) ?> 208 </td> 209 <td> 210 <input type="checkbox" name="email_on_reopened" <?php check_checked( $t_pref->email_on_reopened, ON ); ?> /> 211 <?php echo lang_get( 'with_minimum_severity' ) ?> 212 <select name="email_on_reopened_min_severity"> 213 <option value="<?php echo OFF ?>"><?php echo lang_get( 'any' ) ?></option> 214 <option value="<?php echo OFF ?>"></option> 215 <?php print_enum_string_option_list( 'severity', $t_pref->email_on_reopened_min_severity ) ?> 216 </select> 217 </td> 218 </tr> 219 <tr class="row-2"> 220 <td class="category"> 221 <?php echo lang_get( 'email_on_bugnote_added' ) ?> 222 </td> 223 <td> 224 <input type="checkbox" name="email_on_bugnote" <?php check_checked( $t_pref->email_on_bugnote, ON ); ?> /> 225 <?php echo lang_get( 'with_minimum_severity' ) ?> 226 <select name="email_on_bugnote_min_severity"> 227 <option value="<?php echo OFF ?>"><?php echo lang_get( 'any' ) ?></option> 228 <option value="<?php echo OFF ?>"></option> 229 <?php print_enum_string_option_list( 'severity', $t_pref->email_on_bugnote_min_severity ) ?> 230 </select> 231 </td> 232 </tr> 233 <tr class="row-1"> 234 <td class="category"> 235 <?php echo lang_get( 'email_on_status_change' ) ?> 236 </td> 237 <td> 238 <input type="checkbox" name="email_on_status" <?php check_checked( $t_pref->email_on_status, ON ); ?> /> 239 <?php echo lang_get( 'with_minimum_severity' ) ?> 240 <select name="email_on_status_min_severity"> 241 <option value="<?php echo OFF ?>"><?php echo lang_get( 'any' ) ?></option> 242 <option value="<?php echo OFF ?>"></option> 243 <?php print_enum_string_option_list( 'severity', $t_pref->email_on_status_min_severity ) ?> 244 </select> 245 </td> 246 </tr> 247 <tr class="row-2"> 248 <td class="category"> 249 <?php echo lang_get( 'email_on_priority_change' ) ?> 250 </td> 251 <td> 252 <input type="checkbox" name="email_on_priority" <?php check_checked( $t_pref->email_on_priority , ON); ?> /> 253 <?php echo lang_get( 'with_minimum_severity' ) ?> 254 <select name="email_on_priority_min_severity"> 255 <option value="<?php echo OFF ?>"><?php echo lang_get( 'any' ) ?></option> 256 <option value="<?php echo OFF ?>"></option> 257 <?php print_enum_string_option_list( 'severity', $t_pref->email_on_priority_min_severity ) ?> 258 </select> 259 </td> 260 </tr> 261 <tr class="row-1"> 262 <td class="category"> 263 <?php echo lang_get( 'email_bugnote_limit' ) ?> 264 </td> 265 <td> 266 <input type="text" name="email_bugnote_limit" maxlength="2" size="2" value="<?php echo $t_pref->email_bugnote_limit ?>"> 267 </td> 268 </tr> 269 <?php } else { ?> 270 <input type="hidden" name="email_on_new" value="<?php echo $t_pref->email_on_new ?>" /> 271 <input type="hidden" name="email_on_assigned" value="<?php echo $t_pref->email_on_assigned ?>" /> 272 <input type="hidden" name="email_on_feedback" value="<?php echo $t_pref->email_on_feedback ?>" /> 273 <input type="hidden" name="email_on_resolved" value="<?php echo $t_pref->email_on_resolved ?>" /> 274 <input type="hidden" name="email_on_closed" value="<?php echo $t_pref->email_on_closed ?>" /> 275 <input type="hidden" name="email_on_reopened" value="<?php echo $t_pref->email_on_reopened ?>" /> 276 <input type="hidden" name="email_on_bugnote" value="<?php echo $t_pref->email_on_bugnote ?>" /> 277 <input type="hidden" name="email_on_status" value="<?php echo $t_pref->email_on_status ?>" /> 278 <input type="hidden" name="email_on_priority" value="<?php echo $t_pref->email_on_priority ?>" /> 279 <input type="hidden" name="email_on_new_min_severity" value="<?php echo $t_pref->email_on_new_min_severity ?>" /> 280 <input type="hidden" name="email_on_assigned_min_severity" value="<?php echo $t_pref->email_on_assigned_min_severity ?>" /> 281 <input type="hidden" name="email_on_feedback_min_severity" value="<?php echo $t_pref->email_on_feedback_min_severity ?>" /> 282 <input type="hidden" name="email_on_resolved_min_severity" value="<?php echo $t_pref->email_on_resolved_min_severity ?>" /> 283 <input type="hidden" name="email_on_closed_min_severity" value="<?php echo $t_pref->email_on_closed_min_severity ?>" /> 284 <input type="hidden" name="email_on_reopened_min_severity" value="<?php echo $t_pref->email_on_reopened_min_severity ?>" /> 285 <input type="hidden" name="email_on_bugnote_min_severity" value="<?php echo $t_pref->email_on_bugnote_min_severity ?>" /> 286 <input type="hidden" name="email_on_status_min_severity" value="<?php echo $t_pref->email_on_status_min_severity ?>" /> 287 <input type="hidden" name="email_on_priority_min_severity" value="<?php echo $t_pref->email_on_priority_min_severity ?>" /> 288 <input type="hidden" name="email_bugnote_limit" value="<?php echo $t_pref->email_bugnote_limit ?>" /> 289 <?php } ?> 290 <tr class="row-2"> 291 <td class="category"> 292 <?php echo lang_get( 'language' ) ?> 293 </td> 294 <td> 295 <select name="language"> 296 <?php print_language_option_list( $t_pref->language ) ?> 297 </select> 298 </td> 299 </tr> 300 <tr> 301 <td colspan="2" class="center"> 302 <input type="submit" class="button" value="<?php echo lang_get( 'update_prefs_button' ) ?>" /> 303 </td> 304 </tr> 305 </table> 306 </form> 307 </div> 308 309 <br /> 310 311 <div class="border-center"> 312 <form method="post" action="account_prefs_reset.php"> 313 <input type="hidden" name="user_id" value="<?php echo $p_user_id ?>" /> 314 <input type="hidden" name="redirect_url" value="<?php echo $t_redirect_url ?>" /> 315 <input type="submit" class="button" value="<?php echo lang_get( 'reset_prefs_button' ) ?>" /> 316 </form> 317 </div> 318 319 <?php 320 } # end of edit_account_prefs() 321 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 09:42:17 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |