SMS texting
authorJason Etheridge <jason@esilibrary.com>
Thu, 22 Sep 2011 13:17:50 +0000 (09:17 -0400)
committerJason Etheridge <jason@esilibrary.com>
Tue, 10 Jan 2012 19:04:50 +0000 (14:04 -0500)
commitfb103148f8d93ea04671cf13156a8abd22e50344
tree0f675a8c95343ccd36b3eb0e6b2d1a5743ab86be
parent764544d0cbad934d6fc0c673a032755fd34eb2e5
SMS texting

For SMS functionality we're basically converting a carrier and a phone number
into an email address and sending via SMTP like other email notifications.
There is administrative UI for configuring these mappings:

    Admin -> Server Settings -> SMS Carriers

The permission ADMIN_SMS_CARRIER is needed to use this interface. In a stock
Evergreen installation, this is given to the Global Administrator group.

In this interface, any occurance of "$number" in the Email Gateway field will
change into the pertinent SMS phone number when the mapping gets used. We're not
doing anything fancy here for verifying or munging phone numbers, but you could
do munging in the pertinent SMS Action/Trigger templates, or better, contribute
code for the OPAC templates and/or the utility method get_sms_gateway_email in
Trigger/Reactor.pm.

Our set of stock mappings comes from
http://en.wikipedia.org/wiki/List_of_SMS_gateways

There's no automated process for keeping this up-to-date, though some volunteer
with a Wikipedia account could add the page to their watchlist for changes and
let us know if something needs changing.

Set the org unit setting "SMS: Enable features that send SMS text messages."
(database name "sms.enable") to True to expose the following:

  * SMS notification widgets in the TT-OPAC hold placement interface (to notify
    when a hold is ready for pickup)

  * "(SMS)" links next to call numbers on the TT-OPAC record details page. The
    interface spawned by these links require user authentication by default, but
    this can be changed by setting the org unit setting "SMS: Disable auth
    requirement for texting call numbers." to True. The database name for that
    setting is "sms.disable_authentication_requirement.callnumbers".

  * New options in TT-OPAC My Account -> Account Preferences -> Notification
    Preferences (we also add in some missing prefs for holds outside of SMS)

There are two pertinent Action/Trigger templates under Admin -> Local
Administration -> Notifications / Action Triggers:

  * SMS Call Number
  * Hold Ready for Pickup SMS Notification

Don't disable these. We rely on the sms.enable YAOUS as the master on/off
switch.

Also, it's probably best to have just one sms.enable for the whole consortium.
If you mix and match on/off settings here, then user preferences for SMS can get
blown away if the user updates their settings in the TT-OPAC at an org where SMS
is disabled.  Hrmm, the same would probably happen if the user jumps between the
TT-OPAC and the original JS-PAC.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
30 files changed:
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/SendSMS.pm [new file with mode: 0644]
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/SMS.pm [new file with mode: 0644]
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/090.schema.action.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.sms_carriers.sql [new file with mode: 0644]
Open-ILS/src/templates/conify/global/config/sms_carrier.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/myopac/prefs_notify.tt2
Open-ILS/src/templates/opac/parts/place_hold.tt2
Open-ILS/src/templates/opac/parts/record/copy_table.tt2
Open-ILS/src/templates/opac/parts/sms_carrier_selector.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/parts/sms_number_textbox.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/sms_cn.tt2 [new file with mode: 0644]
Open-ILS/web/js/ui/default/conify/global/config/sms_carrier.js [new file with mode: 0644]
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
Open-ILS/xul/staff_client/server/locale/en-US/common.properties
Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
Open-ILS/xul/staff_client/server/patron/holds.js
Open-ILS/xul/staff_client/server/patron/holds_overlay.xul