[freeside-commits] freeside/FS/bin freeside-disable-reasons, NONE, 1.1.2.1 freeside-upgrade, 1.5.2.5, 1.5.2.6
Jeff Finucane,420,,
jeff at wavetail.420.am
Tue Dec 11 21:42:51 PST 2007
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail:/tmp/cvs-serv26503/FS/bin
Modified Files:
Tag: FREESIDE_1_7_BRANCH
freeside-upgrade
Added Files:
Tag: FREESIDE_1_7_BRANCH
freeside-disable-reasons
Log Message:
cust_credit reason improvement, bugfix, and tool
--- NEW FILE: freeside-disable-reasons ---
#!/usr/bin/perl -w
use strict;
use vars qw($opt_t $opt_e);
use Getopt::Std;
use FS::UID qw(adminsuidsetup);
use FS::Record qw(qsearch qsearchs);
use FS::reason_type;
use FS::reason;
getopts('t:e');
my $user = shift or die &usage;
adminsuidsetup $user;
die &usage
unless ($opt_t);
$FS::Record::nowarn_identical = 1;
my @reason = ();
if ( $opt_t ) {
$opt_t =~ /^(\d+)$/ or die "invalid reason_type";
@reason = qsearch('reason', { reason_type => $1 } );
die "no reasons found\n" unless @reason;
} else {
die "no reason_type specified\n";
}
foreach my $reason ( @reason ) {
if ( $opt_e ) {
$reason->disabled('');
}else{
$reason->disabled('Y');
}
my $error = $reason->replace
if $reason->modified;
die $error if $error;
}
sub usage {
die "Usage:\n\n freeside-disable-reasons -t reason_type [ -e ] user\n";
}
=head1 NAME
freeside-disable-reasons - Command line tool to set the disabled column for reasons
=head1 SYNOPSIS
freeside-disable-reasons -t reason_type [ -e ] user
=head1 DESCRIPTION
Disables the reasons of the specified reason type.
Enables instead if -e is specified.
=head1 SEE ALSO
L<FS::reason>, L<FS::reason_type>
=cut
Index: freeside-upgrade
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-upgrade,v
retrieving revision 1.5.2.5
retrieving revision 1.5.2.6
diff -u -d -r1.5.2.5 -r1.5.2.6
--- freeside-upgrade 4 Dec 2007 18:19:07 -0000 1.5.2.5
+++ freeside-upgrade 12 Dec 2007 05:42:49 -0000 1.5.2.6
@@ -84,6 +84,11 @@
}
}
+$dbh->commit or die $dbh->errstr; # we *MUST* commit before upgrading data
+dbdef_create($dbh, $dbdef_file);
+delete $FS::Schema::dbdef_cache{$dbdef_file}; #force an actual reload
+reload_dbdef($dbdef_file);
+
upgrade()
unless $DRY_RUN;
More information about the freeside-commits
mailing list