Bugzilla – Attachment 58172 Details for
Bug 13029
Allow to pass additional parameters to SMS::Send drivers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13029 : Follow up
Bug-13029--Follow-up.patch (text/plain), 3.26 KB, created by
Jonathan Druart
on 2016-12-14 12:39:03 UTC
(
hide
)
Description:
Bug 13029 : Follow up
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-12-14 12:39:03 UTC
Size:
3.26 KB
patch
obsolete
>From e7c03c9c294a137176c75ae2020918b2f0204c83 Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >Date: Fri, 30 Sep 2016 09:31:11 +1300 >Subject: [PATCH] Bug 13029 : Follow up > >Adding POD, changing the config files to live in a path pointed to by >koha-conf.xml > >This means multiple instances can have their own config > >Please test the 2 patches together > >Signed-off-by: Magnus Enger <magnus@libriotech.no> >Works as advertised. Arbitrary arguments can be passed to SMS:Send >drivers. If an argument is provided that has already been set by >SMS::Send or the driver, it will be overwritten by the value from >the YAML file. My only suggestion for an improvement would be an >example of what the YAML should look like, but that is a minor thing. > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/SMS.pm | 25 +++++++++++++++++++++---- > debian/templates/koha-conf-site.xml.in | 2 ++ > etc/koha-conf.xml | 2 ++ > 3 files changed, 25 insertions(+), 4 deletions(-) > >diff --git a/C4/SMS.pm b/C4/SMS.pm >index d011f5f..c603117 100644 >--- a/C4/SMS.pm >+++ b/C4/SMS.pm >@@ -1,6 +1,8 @@ > package C4::SMS; > > # Copyright 2007 Liblime >+# Copyright 2015 Biblibre >+# Copyright 2016 Catalyst > # > # This file is part of Koha. > # >@@ -28,7 +30,23 @@ my $success = C4::SMS->send_sms({ message => 'This is my text message', > > =head1 DESCRIPTION > >+A wrapper for SMS::Send. > >+Can use a yaml file for config, the path to which is in the koha-conf.xml >+<sms_send_config>__KOHA_CONF_DIR__/sms_send/</sms_send_config> >+ >+Each file needs to be in the format of >+__KOHA_CONF_DIR__/sms_send/<driver>.yaml >+ >+For example for SMS::Send::UK::Kapow the config would be >+ >+/etc/koha/sites/instancename/sms_send/UK/Kapow.yaml for package install >+or >+/etc/koha/sms_send/UK/Kapow.yaml for tarball >+ >+A underscore character is prepended to all parameter names so they are >+treated as driver-specific options (leading underscore must not appear >+in config file). > > =cut > >@@ -77,10 +95,9 @@ sub send_sms { > my $subpath = $driver; > $subpath =~ s|::|/|; > >- my $conf_file = File::Spec->catfile( >- C4::Context->config('installdir'), >- 'etc', 'sms', 'driver', $subpath >- ) . q{.yaml}; >+ my $conf_file = >+ File::Spec->catfile( C4::Context->config('sms_send_config'), $subpath ) >+ . q{.yaml}; > my %args; > if ( -f $conf_file ) { > require YAML; >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index 6bfe004..7f13c64 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -311,5 +311,7 @@ __END_SRU_PUBLICSERVER__ > <font type="HBO">/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf</font> > </ttf> > >+ <!-- Path to the config file for SMS::Send --> >+ <sms_send_config>__KOHA_CONF_DIR__/sms_send/</sms_send_config> > </config> > </yazgfs> >diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml >index 1ce3c90..2c188f8 100644 >--- a/etc/koha-conf.xml >+++ b/etc/koha-conf.xml >@@ -138,5 +138,7 @@ __PAZPAR2_TOGGLE_XML_POST__ > <font type="HBO">__FONT_DIR__/DejaVuSans-BoldOblique.ttf</font> > </ttf> > >+ <!-- Path to the config file for SMS::Send --> >+ <sms_send_config>__KOHA_CONF_DIR__/sms_send/</sms_send_config> > </config> > </yazgfs> >-- >2.9.3
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13029
:
32011
|
32013
|
34403
|
55942
|
55943
|
56102
|
56103
|
56104
|
56111
|
56112
|
56113
|
56116
|
58170
| 58172