[freeside-commits] branch FREESIDE_3_BRANCH updated. a0974543bc19678e78971c0182fe4cf4bcce0e9f

Ivan ivan at 420.am
Fri Jul 10 21:43:05 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  a0974543bc19678e78971c0182fe4cf4bcce0e9f (commit)
       via  0160ea1cf1d700eb6de7d1b790062d0535efc13c (commit)
      from  1e5b4f7418a74d9ebd1ee1375be7388815c11779 (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 a0974543bc19678e78971c0182fe4cf4bcce0e9f
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jul 10 21:43:04 2015 -0700

    include agent and restore cust-level status in small_custview

diff --git a/FS/FS/UI/Web/small_custview.pm b/FS/FS/UI/Web/small_custview.pm
index 1210da4..b48714c 100644
--- a/FS/FS/UI/Web/small_custview.pm
+++ b/FS/FS/UI/Web/small_custview.pm
@@ -95,8 +95,12 @@ sub small_custview {
   $html = qq!<A HREF="$url?! . $cust_main->custnum . '">'
     if $url;
 
+  if ( $FS::CurrentUser::CurrentUser->num_agents ) {
+    $html .= encode_entities($cust_main->agent->agent). ' ';
+  }
+
   $html .= 'Customer #<B>'. $cust_main->display_custnum.
-           ': '. encode_entities($cust_main->name). '</B></A>';
+           '</B>: <B>'. encode_entities($cust_main->name). '</B></A>'.
            ' - <B><FONT COLOR="#'. $cust_main->statuscolor. '">'.
            ucfirst($cust_main->status). '</FONT></B>';
 
diff --git a/FS/FS/access_user.pm b/FS/FS/access_user.pm
index 4b5a701..605eaee 100644
--- a/FS/FS/access_user.pm
+++ b/FS/FS/access_user.pm
@@ -329,6 +329,22 @@ sub access_usergroup {
 #
 #}
 
+=item num_agents
+
+Returns the number of agents this user can view (via group membership).
+
+=cut
+
+sub num_agents {
+  my $self = shift;
+  $self->scalar_sql(
+    'SELECT COUNT(DISTINCT agentnum) FROM access_usergroup
+                                     JOIN access_groupagent USING ( groupnum )
+       WHERE usernum = ?',
+    $self->usernum,
+  );
+}
+
 =item agentnums 
 
 Returns a list of agentnums this user can view (via group membership).

commit 0160ea1cf1d700eb6de7d1b790062d0535efc13c
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jul 10 19:49:46 2015 -0700

    remove dup dep

diff --git a/debian/control b/debian/control
index a79181d..ad4c30d 100644
--- a/debian/control
+++ b/debian/control
@@ -75,7 +75,7 @@ Depends: gnupg,ghostscript,gsfonts,gzip,latex-xcolor,
  libemail-valid-perl,libio-string-perl,libnet-smtp-ssl-perl,
  libgeo-coder-googlev3-perl,libcam-pdf-perl,libnet-openssh-perl,
  libhtml-quoted-perl,libregexp-ipv6-perl,libregexp-common-net-cidr-perl,
- libencode-perl,libexcel-writer-xlsx-perl,libgeo-googleearth-pluggable-perl,
+ libexcel-writer-xlsx-perl,libgeo-googleearth-pluggable-perl,
  libhtml-mason-psgihandler-perl,libdate-simple-perl,libsnmp-perl,
  libemail-valid-perl,libparse-fixedlength-perl,libregexp-common-net-cidr-perl,
  libio-string-perl,libnet-mac-vendor-perl,libnet-https-any-perl

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/UI/Web/small_custview.pm |    6 +++++-
 FS/FS/access_user.pm           |   16 ++++++++++++++++
 debian/control                 |    2 +-
 3 files changed, 22 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list