MantisBT-Discord – Diff between revs 2 and 3

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 2 Rev 3
Line 1... Line 1...
1 <?php 1 <?php
-   2  
2 /** 3 /**
3 * Discord Integration 4 * Discord Integration
4 * Copyright (C) 2014 Karim Ratib (karim.ratib@gmail.com) 5 * Copyright (C) 2014 Karim Ratib (karim.ratib@gmail.com)
5 * 6 *
6 * Discord Integration is free software; you can redistribute it and/or 7 * Discord Integration is free software; you can redistribute it and/or
Line 16... Line 17...
16 * along with Discord Integration; if not, write to the Free Software 17 * along with Discord Integration; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18 * or see http://www.gnu.org/licenses/. 19 * or see http://www.gnu.org/licenses/.
19 */ 20 */
Line 20... Line 21...
20   21  
21 auth_reauthenticate( ); 22 auth_reauthenticate();
Line 22... Line 23...
22 access_ensure_global_level( config_get( 'manage_plugin_threshold' ) ); 23 access_ensure_global_level(config_get('manage_plugin_threshold'));
Line 23... Line 24...
23   24  
Line 24... Line 25...
24 html_page_top( plugin_lang_get( 'title' ) ); 25 html_page_top(plugin_lang_get('title'));
Line 25... Line 26...
25   26  
Line 26... Line 27...
26 print_manage_menu( ); 27 print_manage_menu();
27   28  
28 ?> 29 ?>
Line 29... Line 30...
29   30  
30 <br /> 31 <br />
31   32  
32 <form action="<?php echo plugin_page( 'config_edit' )?>" method="post"> 33 <form action="<?php echo plugin_page('config_edit') ?>" method="post">
33 <?php echo form_security_field( 'plugin_Discord_config_edit' ) ?> 34 <?php echo form_security_field('plugin_Discord_config_edit') ?>
Line 34... Line 35...
34 <table align="center" class="width75" cellspacing="1"> 35 <table class="width75" cellspacing="1">
35   36  
36 <tr> 37 <tr>
37 <td class="form-title" colspan="3"> 38 <td class="form-title" colspan="3">
38 <?php echo plugin_lang_get( 'title' ) . ' : ' . plugin_lang_get( 'config' )?> 39 <?php echo plugin_lang_get('title') . ' : ' . plugin_lang_get('config') ?>
39 </td> 40 </td>
40 </tr> 41 </tr>
41   42  
Line 42... Line 43...
42 <tr <?php echo helper_alternate_class( )?>> 43 <tr <?php echo helper_alternate_class() ?>>
43 <td class="category"> 44 <td class="category">
44 <?php echo plugin_lang_get( 'url_webhook' )?> 45 <?php echo plugin_lang_get('url_webhook') ?>
45 </td> 46 </td>
46 <td colspan="2"> 47 <td colspan="2">
47 <input size="80" type="text" name="url_webhook" value="<?php echo plugin_config_get( 'url_webhook' )?>" /> 48 <input size="80" type="text" name="url_webhook" value="<?php echo plugin_config_get('url_webhook') ?>" />
48 </td> 49 </td>
49 </tr> 50 </tr>
50   51  
51 <tr <?php echo helper_alternate_class( )?>> 52 <tr <?php echo helper_alternate_class() ?>>
52 <td class="category"> 53 <td class="category">
-   54 <?php echo plugin_lang_get('url_webhooks') ?>
53 <?php echo plugin_lang_get( 'url_webhooks' )?> 55 </td>
54 </td> 56 <td colspan="2">
55 <td colspan="2"> 57 <p>
56 <p> 58 Specifies the mapping between Mantis project names and Discord webhooks.
57 Specifies the mapping between Mantis project names and Discord webhooks. 59 </p>
58 </p> 60 <p>
59 <p> 61 Option name is <strong>plugin_Discord_url_webhooks</strong> and is an array of 'Mantis project name' => 'Discord webhook'.
60 Option name is <strong>plugin_Discord_url_webhooks</strong> and is an array of 'Mantis project name' => 'Discord webhook'. 62 Array options must be set using the <a href="adm_config_report.php">Configuration Report</a> screen.
61 Array options must be set using the <a href="adm_config_report.php">Configuration Report</a> screen. 63 The current value of this option is:
62 The current value of this option is:<pre><?php var_export(plugin_config_get( 'url_webhooks' ))?></pre> 64 <pre><?php var_export(plugin_config_get('url_webhooks')) ?></pre>
63 </p> 65 </p>
64 </td> 66 </td>
65 </tr> 67 </tr>
66 68  
Line 67... Line 69...
67 <!-- 69 <!--
68 <tr <?php echo helper_alternate_class( )?>> 70 <tr <?php echo helper_alternate_class() ?>>
69 <td class="category"> 71 <td class="category">
70 <?php echo plugin_lang_get( 'bot_name' )?> 72 <?php echo plugin_lang_get('bot_name') ?>
71 </td> 73 </td>
72 <td colspan="2"> 74 <td colspan="2">
73 <input type="text" name="bot_name" value="<?php echo plugin_config_get( 'bot_name' )?>" /> 75 <input type="text" name="bot_name" value="<?php echo plugin_config_get('bot_name') ?>" />
74 </td> 76 </td>
75 </tr> 77 </tr>
76   78  
77 <tr <?php echo helper_alternate_class( )?>> 79 <tr <?php echo helper_alternate_class() ?>>
78 <td class="category"> 80 <td class="category">
79 <?php echo plugin_lang_get( 'bot_icon' )?> 81 <?php echo plugin_lang_get('bot_icon') ?>
Line 80... Line 82...
80 </td> 82 </td>
81 <td colspan="2"> 83 <td colspan="2">
82 <p> 84 <p>
83 Can be either a URL pointing to small image or an emoji of the form :emoji:</br> 85 Can be either a URL pointing to small image or an emoji of the form :emoji:</br>
84 Defaults to the Mantis logo. 86 Defaults to the Mantis logo.
85 </p> 87 </p>
86 <input type="text" name="bot_icon" value="<?php echo plugin_config_get( 'bot_icon' )?>" /> 88 <input type="text" name="bot_icon" value="<?php echo plugin_config_get('bot_icon') ?>" />
87 </td> 89 </td>
Line 88... Line 90...
88 </tr> 90 </tr>
89 --> 91 -->
90   92  
91 <tr <?php echo helper_alternate_class( )?>> 93 <tr <?php echo helper_alternate_class() ?>>
92 <td class="category"> 94 <td class="category">
93 <?php echo plugin_lang_get( 'skip_bulk' )?> 95 <?php echo plugin_lang_get('skip_bulk') ?>
94 </td> 96 </td>
95 <td colspan="2"> 97 <td colspan="2">
96 <input type="checkbox" name="skip_bulk" <?php if (plugin_config_get( 'skip_bulk' )) echo "checked"; ?> /> 98 <input type="checkbox" name="skip_bulk" <?php if (plugin_config_get('skip_bulk')) echo "checked"; ?> />
97 </td> 99 </td>
Line 98... Line 100...
98 </tr> 100 </tr>
99   101  
100 <tr <?php echo helper_alternate_class( )?>> 102 <tr <?php echo helper_alternate_class() ?>>
101 <td class="category"> 103 <td class="category">
102 <?php echo plugin_lang_get( 'link_names' )?> 104 <?php echo plugin_lang_get('link_names') ?>
103 </td> 105 </td>
104 <td colspan="2"> 106 <td colspan="2">
105 <input type="checkbox" name="link_names" <?php if (plugin_config_get( 'link_names' )) echo "checked"; ?> /> 107 <input type="checkbox" name="link_names" <?php if (plugin_config_get('link_names')) echo "checked"; ?> />
Line 106... Line 108...
106 </td> 108 </td>
107 </tr> 109 </tr>
108 110  
109 <!-- 111 <!--
110   112  
111 <tr <?php echo helper_alternate_class( )?>> 113 <tr <?php echo helper_alternate_class() ?>>
112 <td class="category"> 114 <td class="category">
113 <?php echo plugin_lang_get( 'default_channel' )?> 115 <?php echo plugin_lang_get('default_channel') ?>
114 </td> 116 </td>
115 <td colspan="2"> 117 <td colspan="2">
116 <input type="text" name="default_channel" value="<?php echo plugin_config_get( 'default_channel' )?>" /> 118 <input type="text" name="default_channel" value="<?php echo plugin_config_get('default_channel') ?>" />
117 </td> 119 </td>
118 </tr> 120 </tr>
119   121  
120 <tr <?php echo helper_alternate_class( )?>> 122 <tr <?php echo helper_alternate_class() ?>>
121 <td class="category"> 123 <td class="category">
Line 122... Line 124...
122 <?php echo plugin_lang_get( 'channels' )?> 124 <?php echo plugin_lang_get('channels') ?>
123 </td> 125 </td>
124 <td colspan="2"> 126 <td colspan="2">
125 <p> 127 <p>
126 Specifies the mapping between Mantis project names and Discord #channels. 128 Specifies the mapping between Mantis project names and Discord #channels.
127 </p> 129 </p>
128 <p> 130 <p>
129 Option name is <strong>plugin_Discord_channels</strong> and is an array of 'Mantis project name' => 'Discord channel name'. 131 Option name is <strong>plugin_Discord_channels</strong> and is an array of 'Mantis project name' => 'Discord channel name'.
130 Array options must be set using the <a href="adm_config_report.php">Configuration Report</a> screen. 132 Array options must be set using the <a href="adm_config_report.php">Configuration Report</a> screen.
131 The current value of this option is:<pre><?php var_export(plugin_config_get( 'channels' ))?></pre> 133 The current value of this option is:<pre><?php var_export(plugin_config_get('channels')) ?></pre>
132 </p> 134 </p>
133 </td> 135 </td>
134 </tr> 136 </tr>
135 --> 137 -->
136   138  
137 <tr <?php echo helper_alternate_class( )?>> 139 <tr <?php echo helper_alternate_class() ?>>
-   140 <td class="category">
138 <td class="category"> 141 <?php echo plugin_lang_get('columns') ?>
139 <?php echo plugin_lang_get( 'columns' )?> 142 </td>
140 </td> 143 <td colspan="2">
141 <td colspan="2"> 144 <p>
Line 142... Line 145...
142 <p> 145 Specifies the bug fields that should be attached to the Discord notifications.
143 Specifies the bug fields that should be attached to the Discord notifications. 146 </p>
144 </p> 147 <p>
145 <p> 148 Option name is <strong>plugin_Discord_columns</strong> and is an array of bug column names.
146 Option name is <strong>plugin_Discord_columns</strong> and is an array of bug column names. 149 Array options must be set using the <a href="adm_config_report.php">Configuration Report</a> screen.
147 Array options must be set using the <a href="adm_config_report.php">Configuration Report</a> screen. 150 <?php
148 <?php 151 $t_columns = columns_get_all($t_project_id);
149 $t_columns = columns_get_all( $t_project_id ); 152 $t_all = implode(', ', $t_columns);
Line 150... Line 153...
150 $t_all = implode( ', ', $t_columns ); 153 ?>
151 ?> 154 Available column names are:<div><textarea name="all_columns" readonly="readonly" cols="80" rows="5"><?php echo $t_all ?></textarea></div>
152 Available column names are:<div><textarea name="all_columns" readonly="readonly" cols="80" rows="5"><?php echo $t_all ?></textarea></div> 155 The current value of this option is:
153 The current value of this option is:<pre><?php var_export(plugin_config_get( 'columns' ))?></pre> 156 <pre><?php var_export(plugin_config_get('columns')) ?></pre>
154 </p> 157 </p>
Line 155... Line 158...
155 </td> 158 </td>
156 </tr> 159 </tr>