diff --git a/design/privatefooter.php b/design/privatefooter.php index 5412d5c0..0e5a3d97 100644 --- a/design/privatefooter.php +++ b/design/privatefooter.php @@ -28,10 +28,10 @@

- Time: ms - Used: - Load: - Date: + Time: ms + Used: + Load: + Date:

diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index e3404d50..70a114d8 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -1,5 +1,8 @@ CHANGELOG +2013-09-01 by Ajax +Tool for staff to send mass PMs to primary and secondary classes + 2013-08-28 by porkpie Add an option for the styled tooltips diff --git a/sections/tools/index.php b/sections/tools/index.php index b0821742..6e68820a 100644 --- a/sections/tools/index.php +++ b/sections/tools/index.php @@ -497,6 +497,12 @@ case 'take_calendar_event': include('managers/ajax_take_calendar_event.php'); break; + case 'mass_pm': + include('managers/mass_pm.php'); + break; + case 'take_mass_pm': + include('managers/take_mass_pm.php'); + break; default: include(SERVER_ROOT.'/sections/tools/tools.php'); } diff --git a/sections/tools/managers/mass_pm.php b/sections/tools/managers/mass_pm.php new file mode 100644 index 00000000..6376fdb7 --- /dev/null +++ b/sections/tools/managers/mass_pm.php @@ -0,0 +1,47 @@ + +
+
+

Send a mass PM

+
+
+
+ + +
+

Class

+ +

Subject

+
+

Body

+ +
+ Send as System + +
+ + +
+
+
+
+ \ No newline at end of file diff --git a/sections/tools/managers/take_mass_pm.php b/sections/tools/managers/take_mass_pm.php new file mode 100644 index 00000000..f023f065 --- /dev/null +++ b/sections/tools/managers/take_mass_pm.php @@ -0,0 +1,28 @@ +query(" + (SELECT ID AS UserID FROM users_main WHERE PermissionID = '$PermissionID' AND ID != '$FromID') UNION (SELECT UserID FROM users_levels WHERE PermissionID = '$PermissionID' AND UserID != '$FromID')"); + +while(list($UserID) = G::$DB->next_record()) { + Misc::send_pm($UserID, $FromID, $Subject, $Body); +} + +header("Location: tools.php"); + + diff --git a/sections/tools/tools.php b/sections/tools/tools.php index 8c874298..03448fe6 100644 --- a/sections/tools/tools.php +++ b/sections/tools/tools.php @@ -38,7 +38,10 @@ Global Notification Calendar - + + Mass PM + +
diff --git a/static/functions/form_validate.js b/static/functions/form_validate.js index a0d3559d..e92d4aaa 100644 --- a/static/functions/form_validate.js +++ b/static/functions/form_validate.js @@ -36,6 +36,9 @@ $(document).ready(function() { if (query['action'] == "calendar") { $("#event_form").validate(); } + if (query['action'] == "mass_pm") { + $("#messageform").validate(); + } break; default: break; diff --git a/static/functions/jquery.autocomplete.js b/static/functions/jquery.autocomplete.js index 3bbf9ba3..d7fd96a6 100644 --- a/static/functions/jquery.autocomplete.js +++ b/static/functions/jquery.autocomplete.js @@ -180,6 +180,7 @@ that.el.on('blur.autocomplete', function () { that.onBlur(); }); that.el.on('focus.autocomplete', function () { that.fixPosition(); }); that.el.on('change.autocomplete', function (e) { that.onKeyUp(e); }); + that.el.on('paste.autocomplete', function () { that.onPaste(); }); }, onBlur: function () { @@ -355,7 +356,7 @@ that.findBestHint(); if (that.options.deferRequestBy > 0) { // Defer lookup in case when value changes very quickly: - that.onChangeInterval = setInterval(function () { + that.onChangeInterval = setTimeout(function () { that.onValueChange(); }, that.options.deferRequestBy); } else { @@ -364,6 +365,23 @@ } }, + onPaste: function () { + var that = this; + + if (that.disabled) { + return; + } + + clearInterval(that.onChangeInterval); + + setTimeout(function () { + if (that.currentValue !== that.el.val()) { + that.findBestHint(); + that.onValueChange(); + } + }, 100); + }, + onValueChange: function () { var that = this, q;