Koha/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc
Galen Charlton b6e62489d8 bug 3222: moved messaging preference editing
The display and editing of messaging preferences
for a patron have been moved as follows:

* the prefs for a patron are now displayed on the
  patron details tab, not the messaging tab.
* the prefs are now modified by editing the patron
  record, not on the messaging tab.

The messaging tab now contains only the list of
messages that have been or will be sent to the patron.

When creating a new patron record, changing the patron
category via the category dropdown now also changes
the default messaging preferences for that patron.  If
you start editing a new patron, change one of the messaging
preferences, then change the patron category, the form will
ask you if you want to keep the preferences or get
the defaults belonging to the new patron category.

Note that when you edit an existing patron record, changing
the patron category will *not* cause the messaging preferences
to be automatically changed.

Programmer's note: this commit introduces a new web service,
members/default_messagingprefs.pl, that uses Jesse Weaver's
C4::Service module.

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-22 13:20:56 -05:00

125 lines
5.5 KiB
HTML

<!-- snippet for form to set borrower and patron category messaging preferences -->
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
$(".none").click(function(){
if($(this).attr("checked")){
var rowid = $(this).attr("id");
newid = Number(rowid.replace("none",""))
$("#sms"+newid).attr("checked","");
$("#email"+newid).attr("checked","");
$("#digest"+newid).attr("checked","");
$("#rss"+newid).attr("checked","");
}
});
});
//]]>
</script>
<input type="hidden" name="modify" value="yes" />
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
<table>
<tr><th></th>
<th>Days in advance</th>
<!-- TMPL_IF NAME="SMSSendDriver" --><th>SMS</th><!-- /TMPL_IF -->
<th>Email</th><th>Digests only?</th>
<!-- <th>RSS</th> -->
<!-- TMPL_UNLESS NAME="messaging_form_inactive" --><th>Do not notify</th><!-- /TMPL_UNLESS -->
</tr>
<!-- TMPL_LOOP name="messaging_preferences" -->
<tr>
<td><!-- TMPL_VAR NAME="message_name" --></td>
<!-- TMPL_IF NAME="takes_days" -->
<td>
<!-- TMPL_IF NAME="messaging_form_inactive" -->
<select name="<!-- TMPL_VAR NAME="message_attribute_id" -->-DAYS" disabled="disabled">
<!-- TMPL_ELSE -->
<select name="<!-- TMPL_VAR NAME="message_attribute_id" -->-DAYS">
<!-- /TMPL_IF -->
<!-- TMPL_LOOP name="select_days" -->
<!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="day" -->" selected="selected"><!-- TMPL_VAR NAME="day" --></option><!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR NAME="day" -->"><!-- TMPL_VAR NAME="day" --></option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select>
</td>
<!-- TMPL_ELSE -->
<td>-</td>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="transport-sms" -->
<!-- TMPL_IF NAME="SMSSendDriver" --><td>
<!-- TMPL_IF NAME="messaging_form_inactive" -->
<input type="checkbox"
id="sms<!-- TMPL_VAR NAME="message_attribute_id" -->"
name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
value="sms" <!-- TMPL_VAR NAME="transport-sms" --> disabled="disabled" />
<!-- TMPL_ELSE -->
<input type="checkbox"
id="sms<!-- TMPL_VAR NAME="message_attribute_id" -->"
name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
value="sms" <!-- TMPL_VAR NAME="transport-sms" --> onclick = "$('#none'+'<!-- TMPL_VAR NAME="message_attribute_id" -->').attr('checked','');" />
<!-- /TMPL_IF -->
</td><!-- /TMPL_IF -->
<!-- TMPL_ELSE -->
<td>-</td>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="transport-email" -->
<td>
<!-- TMPL_IF NAME="messaging_form_inactive" -->
<input type="checkbox"
id="email<!-- TMPL_VAR NAME="message_attribute_id" -->"
name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
value="email" <!-- TMPL_VAR NAME="transport-email" --> disabled="disabled" />
<!-- TMPL_ELSE -->
<input type="checkbox"
id="email<!-- TMPL_VAR NAME="message_attribute_id" -->"
name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
value="email" <!-- TMPL_VAR NAME="transport-email" --> onclick = "$('#none'+'<!-- TMPL_VAR NAME="message_attribute_id" -->').attr('checked','');" />
<!-- /TMPL_IF -->
</td>
<!-- TMPL_ELSE -->
<td>-</td>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="has_digest" -->
<td>
<!-- TMPL_IF NAME="messaging_form_inactive" -->
<input type="checkbox"
id="digest<!-- TMPL_VAR NAME="message_attribute_id" -->"
value="<!-- TMPL_VAR NAME="message_attribute_id" -->"
name="digest" <!-- TMPL_VAR NAME="digest" --> disabled="disabled" />
<!-- TMPL_ELSE -->
<input type="checkbox"
id="digest<!-- TMPL_VAR NAME="message_attribute_id" -->"
value="<!-- TMPL_VAR NAME="message_attribute_id" -->"
name="digest" <!-- TMPL_VAR NAME="digest" --> onclick = "$('#none'+'<!-- TMPL_VAR NAME="message_attribute_id" -->').attr('checked','');" />
<!-- /TMPL_IF -->
</td>
<!-- TMPL_ELSE -->
<td>-</td>
<!-- /TMPL_IF -->
<!-- <!-- TMPL_IF NAME="transport-rss" -->
<td>
<!-- TMPL_IF NAME="messaging_form_inactive" -->
<input type="checkbox"
id="rss<!-- TMPL_VAR NAME="message_attribute_id" -->"
name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
value="rss" <!-- TMPL_VAR NAME="transport-rss" --> disabled="disabled" />
<!-- TMPL_ELSE -->
<input type="checkbox"
id="rss<!-- TMPL_VAR NAME="message_attribute_id" -->"
name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
value="rss" <!-- TMPL_VAR NAME="transport-rss" --> onclick = "$('#none'+'<!-- TMPL_VAR NAME="message_attribute_id" -->').attr('checked','');" />
<!-- /TMPL_IF -->
</td>
<!-- TMPL_ELSE -->
<td>-</td>
<!-- /TMPL_IF --> -->
<!-- TMPL_UNLESS NAME="messaging_form_inactive" -->
<td><input type="checkbox" class="none" id="none<!-- TMPL_VAR NAME="message_attribute_id" -->" /></td>
<!-- /TMPL_UNLESS -->
</tr>
<!-- /TMPL_LOOP -->
</table>