MantisBT-Discord – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 <?php
2 /**
3 * Discord Integration
4 * Copyright (C) Robin van Nunen (robin@vnunen.nl) for Discord modification
5 * Copyright (C) Karim Ratib (karim@meedan.com) for original source
6 *
7 * Discord Integration is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License 2
9 * as published by the Free Software Foundation.
10 *
11 * Discord Integration is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Discord Integration; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 * or see http://www.gnu.org/licenses/.
20 */
21  
22 access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );
23  
24 layout_page_header( plugin_lang_get( 'title' ) );
25  
26 layout_page_begin( 'manage_overview_page.php' );
27  
28 print_manage_menu( 'manage_plugin_page.php' );
29  
30 ?>
31  
32 <div class="col-md-12 col-xs-12">
33 <div class="space-10"></div>
34 <div class="form-container">
35 <form action="<?php echo plugin_page( 'config' ) ?>" method="post">
36 <fieldset>
37 <div class="widget-box widget-color-blue2">
38 <div class="widget-header widget-header-small">
39 <h4 class="widget-title lighter">
40 <i class="ace-icon fa fa-exchange"></i>
41 <?php echo plugin_lang_get( 'title' ) ?>
42 </h4>
43 </div>
44  
45 <?php echo form_security_field( 'plugin_Discord_config' ) ?>
46 <div class="widget-body">
47 <div class="widget-main no-padding">
48 <div class="table-responsive">
49 <table class="table table-bordered table-condensed table-striped">
50  
51 <tr>
52 <td class="category">
53 <?php echo plugin_lang_get( 'url_webhook' ) ?>
54 </td>
55 <td>
56 <input size="80" type="text" name="url_webhook" value="<?php echo plugin_config_get( 'url_webhook' )?>" />
57 </td>
58 </tr>
59  
60 <tr>
61 <td class="category">
62 <?php echo plugin_lang_get( 'url_webhooks' )?>
63 </td>
64 <td colspan="2">
65 <p>
66 Specifies the mapping between Mantis project names and Discord webhooks.
67 </p>
68 <p>
69 Option name is <strong>plugin_Discord_url_webhooks</strong> and is an array of 'Mantis project name' => 'Discord webhook'.
70 Array options must be set using the <a href="adm_config_report.php">Configuration Report</a> screen.
71 The current value of this option is:<pre><?php var_export(plugin_config_get( 'url_webhooks' ))?></pre>
72 </p>
73 </td>
74 </tr>
75  
76 <tr>
77 <td class="category">
78 <?php echo plugin_lang_get( 'skip_bulk' )?>
79 </td>
80 <td colspan="2">
81 <input type="checkbox" name="skip_bulk" <?php if (plugin_config_get( 'skip_bulk' )) echo "checked"; ?> />
82 </td>
83 </tr>
84  
85 <tr>
86 <td class="category">
87 <?php echo plugin_lang_get( 'link_names' )?>
88 </td>
89 <td colspan="2">
90 <input type="checkbox" name="link_names" <?php if (plugin_config_get( 'link_names' )) echo "checked"; ?> />
91 </td>
92 </tr>
93  
94 <tr>
95 <td class="category">
96 <?php echo lang_get( 'language' ) ?>
97 </td>
98 <td>
99 <select id="language" name="language" class="input-sm">
100 <?php print_language_option_list( plugin_config_get('language') ) ?>
101 </select>
102 </td>
103 </tr>
104  
105 <tr>
106 <td class="category">
107 <?php echo plugin_lang_get( 'actions' ) ?>
108 </td>
109 <td>
110 <table>
111 <thead>
112 <tr>
113 <th style="width: 64px; text-align: center;"><?=plugin_lang_get('enabled')?></th>
114 <th><?=plugin_lang_get('action')?></th>
115 </tr>
116 </thead>
117 <tbody>
118 <?php
119 foreach(['hook_bug_report', 'hook_bug_update', 'hook_bug_deleted', 'hook_bugnote_add', 'hook_bugnote_edit', 'hook_bugnote_deleted'] as $name)
120 {
121 echo '
122 <tr>
123 <td style="text-align: center;"><input type="checkbox" id="' . $name . '" name="' . $name . '" ' . (plugin_config_get($name) ? 'checked' : '') . '/></td>
124 <td><label for="' . $name . '">' . plugin_lang_get($name) . '</label></td>
125 </tr>';
126 }
127 ?>
128 </tbody>
129 </table>
130 </td>
131 </tr>
132  
133 <tr>
134 <td class="category">
135 <?php echo plugin_lang_get( 'columns' )?>
136 </td>
137 <td colspan="2">
138 <p>
139 Specifies the bug fields that should be attached to the Discord notifications.
140 </p>
141 <p>
142 Option name is <strong>plugin_Discord_columns</strong> and is an array of bug column names.
143 Array options must be set using the <a href="adm_config_report.php">Configuration Report</a> screen.
144 <?php
145 $t_columns = columns_get_all( @$t_project_id );
146 $t_all = implode( ', ', $t_columns );
147 ?>
148 Available column names are:<div><textarea name="all_columns" readonly="readonly" cols="80" rows="5"><?php echo $t_all ?></textarea></div>
149 The current value of this option is:<pre><?php echo preg_replace('/[0-9]+ => /', '', var_export(plugin_config_get( 'columns' ), true)) ?></pre>
150 </p>
151 </td>
152 </tr>
153  
154 <tr>
155 <td class="category">
156 <?php echo plugin_lang_get( 'usernames' )?>
157 </td>
158 <td colspan="2">
159 <p>
160 Specifies the mapping between Mantis and Discord user names.
161 </p>
162 <p>
163 Option name is <strong>plugin_Discord_usernames</strong> and is an array of 'Mantis user name' => 'Discord user name'.
164 Array options must be set using the <a href="adm_config_report.php">Configuration Report</a> screen.
165 The current value of this option is:<pre><?php var_export(plugin_config_get( 'usernames' ))?></pre>
166 </p>
167 </td>
168 </tr>
169  
170 </table>
171 </div>
172 </div>
173 <div class="widget-toolbox padding-8 clearfix">
174 <input type="submit" class="btn btn-primary btn-white btn-round" value="<?php echo plugin_lang_get( 'action_update' ) ?>" />
175 </div>
176 </div>
177 </div>
178 </fieldset>
179 </form>
180 </div>
181 </div>
182  
183 <?php
184 layout_page_end();