[freeside-commits] branch FREESIDE_3_BRANCH updated. d39884aa7ef13f26a39e6db0c305b98aa61943e1

Ivan ivan at 420.am
Thu Apr 28 11:59:46 PDT 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  d39884aa7ef13f26a39e6db0c305b98aa61943e1 (commit)
      from  051449daeb488ac38f380392d6e42d9f6408d892 (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 d39884aa7ef13f26a39e6db0c305b98aa61943e1
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Apr 28 11:59:44 2016 -0700

    bulk queue update tool, RT#42042

diff --git a/bin/queue-bulk_change b/bin/queue-bulk_change
new file mode 100644
index 0000000..4fc22b3
--- /dev/null
+++ b/bin/queue-bulk_change
@@ -0,0 +1,34 @@
+#!/usr/bin/perl
+
+use strict;
+#use Getopt::Std;
+use FS::UID qw( adminsuidsetup );
+use FS::Record qw( qsearch qsearchs );
+use FS::queue_arg;
+use FS::queue;
+
+my $user = shift or &usage;
+adminsuidsetup $user;
+
+my $from = shift or &usage;
+my $to = shift or &usage;
+
+foreach my $queue_arg ( qsearch('queue_arg', { 'arg' => $from, } ) ) {
+
+  $queue_arg->arg($to);
+  my $error = $queue_arg->replace;
+  die $error if $error;
+
+  #not on 3.x my $queue = $queue_arg->queue; 
+  my $queue = qsearchs( 'queue', { 'jobnum' => $queue_arg->jobnum } );
+  if ( $queue->status eq 'failed' ) {
+    $queue->status('new');
+    my $error = $queue->replace;
+    die $error if $error;
+  }
+
+}
+
+sub usage {
+  die "usage: queue-bulk_chage employee_username from_arg to_arg\n";
+}

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

Summary of changes:
 bin/queue-bulk_change |   34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 bin/queue-bulk_change




More information about the freeside-commits mailing list