$admin->row_span(T('Default Bug Assignment'), 'thead');
$admin->row_text(T('This is the default developer new bugs will be assigned to. If a user does not have permisssion to assign bugs, this will be the default. If you don\'t want any default assignment, leave this as <em>Not Selected</em>.'), construct_option_select('setting[defaultassign]', Bugdar::$datastore['assignto'], $bugsys->options['defaultassign'], 'userid', 'displayname', 0));
- // defaultcomment
- $admin->row_span(T('Default Comment Text'), 'thead');
- $admin->row_textarea(T('If you wish to set a template for entering the initial comment of a bug report, then you may specify this here. However, the template will only take effect on the initial report/comment. Note: the template cannot be forced on the user as there is no way to validate it.'), 'setting[defaultcomment]', $bugsys->options['defaultcomment']);
$admin->table_end();
{
$response->data['title'] = T('Settings');
$response->context['template'] = 'admin_settings';
+
+ // Save settings on POST.
+ if ($request->http_method == 'POST') {
+ $query_bits = array();
+ $values = array();
+ foreach ($request->data['_POST']['settings'] AS $varname => $value) {
+ $query_bits[] = '(?,?)';
+ array_push($values, $varname, $value);
+ }
+
+ $query = bugdar::$db->Prepare("
+ REPLACE into " . TABLE_PREFIX . "setting
+ (varname, value)
+ VALUES " . implode(', ', $query_bits));
+ $query->Execute($values);
+ }
}
}
{%#import 'admin_header'%}
+<form method="post">
+
<div ng-app="bugdar.admin.settings">
<script type="text/ng-template" id="-/admin/settings/row.tpl">
<td ng-show="settingType == 'text'">
<input type="text" id="settings-{{name}}" name="settings[{{name}}]" value="{{value}}">
</td>
+
+ <td ng-show="settingType == 'textarea'">
+ <textarea id="settings-{{name}}" name="settings[{{name}}]">{{value}}</textarea>
+ </td>
</tr>
</script>
title="{%=T('Use Header Redirects')%}"
description="{%=T('Instead of displaying an intermediate page informing the user that their action was a success and a redirect is occurring, just send the user to the next screen using HTTP headers. This can save bandwidth.')%}"
value="{%= Bugdar::$options['redirectheaders'] %}">
+ <tr setting-type="textarea"
+ name="defaultcomment"
+ title="{%=T('Default Comment Text')%}"
+ description="{%=T('If you wish to set a template for entering the initial comment of a bug report, then you may specify this here. However, the template will only take effect on the initial report/comment. Note: the template cannot be forced on the user as there is no way to validate it.')%}">
+
+ <tr><th colspan="2"><input type="submit" value="Save Settings"></th></tr>
</table>
</div>
-{%#import 'admin_footer'%}
\ No newline at end of file
+</form>
+
+{%#import 'admin_footer'%}