[freeside-commits] branch FREESIDE_3_BRANCH updated. 91d8438442339a51023f1c92e60f164d0fc1e8c8
Ivan
ivan at 420.am
Tue Jul 21 11:07:52 PDT 2015
The branch, FREESIDE_3_BRANCH has been updated
via 91d8438442339a51023f1c92e60f164d0fc1e8c8 (commit)
via b2672342895ae99148fe2c52868e7c2d1b942452 (commit)
from 306f474a1f0b682d4815a8f9bd1a000fd4654253 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 91d8438442339a51023f1c92e60f164d0fc1e8c8
Author: Ivan Kohler <ivan at freeside.biz>
Date: Tue Jul 21 11:05:17 2015 -0700
self-service delete_contact, RT#37375
diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm
index 96df7b3..7d8d9d5 100644
--- a/fs_selfservice/FS-SelfService/SelfService.pm
+++ b/fs_selfservice/FS-SelfService/SelfService.pm
@@ -1353,7 +1353,7 @@ error message, or empty on success.
=item edit_contact
Updates information for the currently-logged in contact, or (optionally) the
-specified contact
+specified contact.
Takes a hash reference as parameter with the following keys:
@@ -1378,6 +1378,22 @@ error message, or empty on success.
=item delete_contact
+Deletes a contact. (Note: Cannot at this time delete the currently-logged in
+contact.)
+
+Takes a hash reference as parameter with the following keys:
+
+=over 4
+
+=item session_id
+
+=item contactnum
+
+=back
+
+Returns a hash reference with a single parameter, B<error>, which contains an
+error message, or empty on success.
+
=head2 "MY ACCOUNT" QUOTATION FUNCTIONS
All of these functions require the user to be logged in, and the 'session_id'
commit b2672342895ae99148fe2c52868e7c2d1b942452
Author: Ivan Kohler <ivan at freeside.biz>
Date: Tue Jul 21 11:05:32 2015 -0700
self-service delete_contact, RT#37375
diff --git a/FS/FS/ClientAPI/MyAccount/contact.pm b/FS/FS/ClientAPI/MyAccount/contact.pm
index 34a47cc..bb86ae0 100644
--- a/FS/FS/ClientAPI/MyAccount/contact.pm
+++ b/FS/FS/ClientAPI/MyAccount/contact.pm
@@ -118,6 +118,9 @@ sub delete_contact {
my($context, $session, $custnum) = _custoragent_session_custnum($p);
return { 'error' => $session } if $context eq 'error';
+ return { 'error' => 'Cannot delete the currently-logged in contact.' }
+ if $p->{contactnum} == $session->{contactnum};
+
my $contact = qsearchs('contact', { contactnum =>$ p->{contactnum},
custnum => $custnum, } )
or return { 'error' => 'Unknown contactnum' };
-----------------------------------------------------------------------
Summary of changes:
FS/FS/ClientAPI/MyAccount/contact.pm | 3 +++
fs_selfservice/FS-SelfService/SelfService.pm | 18 +++++++++++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
More information about the freeside-commits
mailing list