[freeside-commits] branch FREESIDE_4_BRANCH updated. 36adfcacddb2487ca914c224ba60ab00f269e5a1

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


The branch, FREESIDE_4_BRANCH has been updated
       via  36adfcacddb2487ca914c224ba60ab00f269e5a1 (commit)
      from  72682b32ce9ed456cd1ec25af25c6c597838392b (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 36adfcacddb2487ca914c224ba60ab00f269e5a1
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Apr 28 11:59:41 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