PageRenderTime 38ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/MantisBT/plugins/XmlImportExport/pages/import.php

https://bitbucket.org/crypticrod/sr_wp_code
PHP | 124 lines | 92 code | 17 blank | 15 comment | 2 complexity | af576510cd4eed67178c321f25eaf268 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.1, GPL-3.0, LGPL-2.0, AGPL-3.0
  1. <?php
  2. # MantisBT - a php based bugtracking system
  3. # Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net
  4. # MantisBT is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 2 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # MantisBT is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
  16. auth_reauthenticate( );
  17. html_page_top( plugin_lang_get( 'import' ) );
  18. $t_this_page = plugin_page('import'); //FIXME with plugins this does not work...
  19. print_manage_menu( $t_this_page );
  20. $t_max_file_size = (int)min(
  21. ini_get_number( 'upload_max_filesize' ),
  22. ini_get_number( 'post_max_size' ),
  23. config_get( 'max_file_size' )
  24. );
  25. // We need a project to import into
  26. $t_project_id = helper_get_current_project( );
  27. if( ALL_PROJECTS == $t_project_id ) {
  28. print_header_redirect( "login_select_proj_page.php?ref=$t_this_page" );
  29. }
  30. ?>
  31. <div class="center">
  32. <form name="file_upload" method="post" enctype="multipart/form-data" action="<?php echo plugin_page( 'import_action' )?>">
  33. <?php echo form_security_field( 'plugin_xml_import_action' ) ?>
  34. <input type="hidden" name="project_id" value="<?php echo $t_project_id;?>" />
  35. <table class="width100">
  36. <tr>
  37. <td class="form-title" colspan="2">
  38. <?php
  39. echo plugin_lang_get( 'importing_in_project' ) . ' ' . string_display( project_get_field( $t_project_id, 'name' ) );
  40. ?>
  41. </td>
  42. </tr>
  43. <tr class="row-1">
  44. <td class="category" width="25%">
  45. <?php echo lang_get( 'select_file' )?><br />
  46. <?php echo '<span class="small">(' . lang_get( 'max_file_size' ) . ': ' . number_format( $t_max_file_size / 1000 ) . 'k)</span>'?>
  47. </td>
  48. <td width="85%">
  49. <input type="hidden" name="max_file_size" value="<?php echo $t_max_file_size?>" />
  50. <input type="hidden" name="step" value="1" />
  51. <input name="file" type="file" size="40" />
  52. </td>
  53. </tr>
  54. <tr>
  55. <td class="form-title" colspan="2">
  56. <?php
  57. echo plugin_lang_get( 'import_options' );
  58. ?>
  59. </td>
  60. </tr>
  61. <tr class="row-2">
  62. <td class="category" width="25%">
  63. <?php echo plugin_lang_get( 'cross_references' );?>
  64. </td>
  65. <td>
  66. <p><?php echo plugin_lang_get( 'default_strategy' );?>
  67. <select name="strategy">
  68. <option value="renumber" title="<?php echo plugin_lang_get( 'renumber_desc' );?>">
  69. <?php echo plugin_lang_get( 'renumber' );?></option>
  70. <option value="link" title="<?php echo plugin_lang_get( 'link_desc' );?>">
  71. <?php echo plugin_lang_get( 'link' );?></option>
  72. <option value="disable" title="<?php echo plugin_lang_get( 'disable_desc' );?>">
  73. <?php echo plugin_lang_get( 'disable' );?></option>
  74. </select>
  75. </p>
  76. <p><?php echo plugin_lang_get( 'fallback' );?>
  77. <select name="fallback">
  78. <option value="link" title="<?php echo plugin_lang_get( 'link_desc' );?>">
  79. <?php echo plugin_lang_get( 'link' );?></option>
  80. <option value="disable" title="<?php echo plugin_lang_get( 'disable_desc' );?>">
  81. <?php echo plugin_lang_get( 'disable' );?></option>
  82. </select>
  83. </p>
  84. </td>
  85. </tr>
  86. <tr class="row-2">
  87. <td class="category" width="25%"><?php echo lang_get( 'categories' );?></td>
  88. <td>
  89. <p><label for="keepcategory"><?php echo plugin_lang_get( 'keep_same_category' );?></label>
  90. <input type="checkbox" checked=checked id="keepcategory" name="keepcategory" /></p>
  91. <p><?php echo plugin_lang_get( 'fallback_category' );?>
  92. <select name="defaultcategory">
  93. <?php print_category_option_list( );?>
  94. </select>
  95. </p>
  96. </td>
  97. </tr>
  98. <tr>
  99. <td colspan="2" class="center">
  100. <input type="submit" class="button" value="<?php echo lang_get( 'upload_file_button' )?>" />
  101. </td>
  102. </tr>
  103. </table>
  104. </form>
  105. </div>
  106. <?php
  107. html_page_bottom();