Changeset:
1d716f2ddafa
https://sourceforge.net/p/mrbs/hg-code/ci/1d716f2ddafa98076bcc7844a8ed9a1919f86ffc
Author:
Campbell Morrison <[email protected]>
Date:
Thu Jul 14 13:38:43 2016 +0100
Log message:
Added config options to allow users (or just admins) to specify that an email
shouldn't be sent when making a booking. Useful if you are just making a minor
change or are creating a whole lot of bookings at the beginning of a term or
season. See SF Support requests #974.
diffstat:
web/css/mrbs.css.php | 7 ++++++-
web/edit_entry.php | 24 +++++++++++++++++++++++-
web/edit_entry_handler.php | 14 +++++++++++++-
web/lang/lang.en | 1 +
web/systemdefaults.inc.php | 6 ++++++
5 files changed, 49 insertions(+), 3 deletions(-)
diffs (116 lines):
diff -r 8d611ed5f07a -r 1d716f2ddafa web/css/mrbs.css.php
--- a/web/css/mrbs.css.php Wed Jul 13 16:27:16 2016 +0100
+++ b/web/css/mrbs.css.php Thu Jul 14 13:38:43 2016 +0100
@@ -761,7 +761,12 @@
.form_general input.all_day, .form_general input#area_def_duration_all_day
{width: auto; margin-left: 1em; margin-right: 0.5em}
.form_general select#start_seconds, input#area_def_duration_mins
{margin-right: 2em}
.form_general #div_rooms select, .form_general #div_typematch select {float:
left; margin-right: 2.0em}
-fieldset#rep_info {border-top: 1px solid <?php echo
$site_faq_entry_border_color ?>; padding-top: 0.7em}
+
+fieldset#rep_info, fieldset#booking_controls {
+ border-top: 1px solid <?php echo $site_faq_entry_border_color ?>;
+ padding-top: 0.7em;
+}
+
.form_general input#rep_num_weeks, .form_general input#month_absolute {width:
4em}
.edit_entry span#end_time_error {display: block; float: left; margin-left:
2em; font-weight: normal}
diff -r 8d611ed5f07a -r 1d716f2ddafa web/edit_entry.php
--- a/web/edit_entry.php Wed Jul 13 16:27:16 2016 +0100
+++ b/web/edit_entry.php Thu Jul 14 13:38:43 2016 +0100
@@ -1356,7 +1356,29 @@
echo "</fieldset>\n";
}
-
+
+echo "<fieldset id=\"booking_controls\">\n";
+echo "<legend></legend>\n";
+
+// Checkbox for no email
+if ($need_to_send_mail &&
+ ($mail_settings['allow_no_mail'] || ($is_admin &&
$mail_settings['allow_admins_no_mail'])))
+{
+ echo "<div id=\"div_no_mail\">\n";
+
+ $no_mail_default = FALSE;
+
+ $params = array('label' => get_vocab("no_mail") . ":",
+ 'name' => 'no_mail',
+ 'value' => $no_mail_default);
+ generate_checkbox($params);
+
+ echo "</div>\n";
+}
+
+echo "</fieldset>\n";
+
+
?>
<input type="hidden" name="returl" value="<?php echo
htmlspecialchars($returl) ?>">
<input type="hidden" name="create_by" value="<?php echo
htmlspecialchars($create_by)?>">
diff -r 8d611ed5f07a -r 1d716f2ddafa web/edit_entry_handler.php
--- a/web/edit_entry_handler.php Wed Jul 13 16:27:16 2016 +0100
+++ b/web/edit_entry_handler.php Thu Jul 14 13:38:43 2016 +0100
@@ -87,6 +87,7 @@
'month_relative_ord' => 'string',
'month_relative_day' => 'string',
'skip' => 'string', // bool, actually
+ 'no_mail' => 'string', // bool, actually
'private' => 'string', // bool, actually
'confirmed' => 'string',
'back_button' => 'string',
@@ -250,6 +251,16 @@
$end_year = $start_year;
}
+// Check that they really are allowed to set $no_mail;
+if ($no_mail)
+{
+ if (!$mail_settings['allow_no_mail'] &&
+ (!$is_admin || !$mail_settings['allow_admins_no_mail']))
+ {
+ $no_mail = FALSE;
+ }
+}
+
// If this is an Ajax request and we're being asked to commit the booking, then
// we'll only have been supplied with parameters that need to be changed.
Fill in
// the rest from the existing boking information.
@@ -685,7 +696,8 @@
$just_check = $ajax && function_exists('json_encode') && !$commit;
$this_id = (isset($id)) ? $id : NULL;
-$result = mrbsMakeBookings($bookings, $this_id, $just_check, $skip,
$original_room_id, $need_to_send_mail, $edit_type);
+$send_mail = ($no_mail) ? FALSE : $need_to_send_mail;
+$result = mrbsMakeBookings($bookings, $this_id, $just_check, $skip,
$original_room_id, $send_mail, $edit_type);
// If we weren't just checking and this was a succesful booking and
// we were editing an existing booking, then delete the old booking
diff -r 8d611ed5f07a -r 1d716f2ddafa web/lang/lang.en
--- a/web/lang/lang.en Wed Jul 13 16:27:16 2016 +0100
+++ b/web/lang/lang.en Thu Jul 14 13:38:43 2016 +0100
@@ -95,6 +95,7 @@
$vocab["month_absolute"] = "On day";
$vocab["month_relative"] = "On the";
$vocab["skip_conflicts"] = "Skip past conflicts";
+$vocab["no_mail"] = "Do not send email";
$vocab["ctrl_click"] = "Use Control-Click to select more than one
room";
$vocab["entryid"] = "Entry ID ";
$vocab["repeat_id"] = "Repeat ID ";
diff -r 8d611ed5f07a -r 1d716f2ddafa web/systemdefaults.inc.php
--- a/web/systemdefaults.inc.php Wed Jul 13 16:27:16 2016 +0100
+++ b/web/systemdefaults.inc.php Thu Jul 14 13:38:43 2016 +0100
@@ -932,6 +932,12 @@
$mail_settings['on_change'] = FALSE; // when an entry is changed
$mail_settings['on_delete'] = FALSE; // when an entry is deleted
+// It is also possible to allow all users or just admins to choose not to send
an
+// email when creating or editing a booking. This can be useful if an
inconsequential
+// change is being made, or many bookings are being made at the beginning of a
term or season.
+$mail_settings['allow_no_mail'] = FALSE;
+$mail_settings['allow_admins_no_mail'] = FALSE; // Ignored if 'allow_no_mail'
is TRUE
+
// WHAT TO EMAIL
// -------------
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits