[freeside-commits] branch master updated. f1c6e127832b6a9f10200d06f86d6aced24b4871

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


The branch, master has been updated
       via  f1c6e127832b6a9f10200d06f86d6aced24b4871 (commit)
      from  8929bee6e58cf603aa2275ec1428afeb2306e5ea (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 f1c6e127832b6a9f10200d06f86d6aced24b4871
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Apr 28 11:59:39 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