freeside/FS/FS Conf.pm,1.103,1.104 cust_main.pm,1.159,1.160
ivan
ivan at pouncequick.420.am
Tue Aug 24 04:17:02 PDT 2004
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory pouncequick:/tmp/cvs-serv11531/FS/FS
Modified Files:
Conf.pm cust_main.pm
Log Message:
big update for reseller interface
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -d -r1.159 -r1.160
--- cust_main.pm 17 Aug 2004 13:14:50 -0000 1.159
+++ cust_main.pm 24 Aug 2004 11:16:57 -0000 1.160
@@ -13,6 +13,7 @@
}
use Date::Format;
#use Date::Manip;
+use String::Approx qw(amatch);
use Business::CreditCard;
use FS::UID qw( getotaker dbh );
use FS::Record qw( qsearchs qsearch dbdef );
@@ -2948,6 +2949,42 @@
AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = 0 )
)
"; }
+
+=item fuzzy_search FUZZY_HASHREF [ HASHREF, SELECT, EXTRA_SQL, CACHE_OBJ ]
+
+Performs a fuzzy (approximate) search and returns the matching FS::cust_main
+records. Currently, only I<last> or I<company> may be specified (the
+appropriate ship_ field is also searched if applicable).
+
+Additional options are the same as FS::Record::qsearch
+
+=cut
+
+sub fuzzy_search {
+ my( $self, $fuzzy, $hash, @opt) = @_;
+ #$self
+ $hash ||= {};
+ my @cust_main = ();
+
+ check_and_rebuild_fuzzyfiles();
+ foreach my $field ( keys %$fuzzy ) {
+ my $sub = \&{"all_$field"};
+ my %match = ();
+ $match{$_}=1 foreach ( amatch($fuzzy->{$field}, ['i'], @{ &$sub() } ) );
+
+ foreach ( keys %match ) {
+ push @cust_main, qsearch('cust_main', { %$hash, $field=>$_}, @opt);
+ push @cust_main, qsearch('cust_main', { %$hash, "ship_$field"=>$_}, @opt)
+ if defined dbdef->table('cust_main')->column('ship_last');
+ }
+ }
+
+ my %saw = ();
+ @cust_main = grep { !$saw{$_->custnum}++ } @cust_main;
+
+ @cust_main;
+
+}
=back
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- Conf.pm 30 Jul 2004 04:54:40 -0000 1.103
+++ Conf.pm 24 Aug 2004 11:16:57 -0000 1.104
@@ -759,7 +759,7 @@
{
'key' => 'showpasswords',
'section' => 'UI',
- 'description' => 'Display unencrypted user passwords in the web interface',
+ 'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
'type' => 'checkbox',
},
@@ -1274,6 +1274,13 @@
'section' => 'billing',
'description' => 'After a payment, the number of days a refund link will be available for that payment. Defaults to 120.',
'type' => 'text',
+ },
+
+ {
+ 'key' => 'agent-showpasswords',
+ 'section' => '',
+ 'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
+ 'type' => 'checkbox',
},
);
More information about the freeside-commits
mailing list