RT# 79913 - Mass agent transfer files
authorChristopher Burger <burgerc@freeside.biz>
Mon, 15 Apr 2019 12:05:48 +0000 (08:05 -0400)
committerChristopher Burger <burgerc@freeside.biz>
Mon, 15 Apr 2019 12:09:16 +0000 (08:09 -0400)
httemplate/elements/agent_transfer_link.html [new file with mode: 0644]
httemplate/misc/process/customers_transfer_to_agent.html [new file with mode: 0644]

diff --git a/httemplate/elements/agent_transfer_link.html b/httemplate/elements/agent_transfer_link.html
new file mode 100644 (file)
index 0000000..4256f07
--- /dev/null
@@ -0,0 +1,37 @@
+  <FORM NAME="agent_transfer_form">
+  <INPUT TYPE="hidden" NAME="search" VALUE="<% $search %>">
+  <INPUT TYPE="hidden" NAME="list" VALUE="<% $list %>">
+  <INPUT TYPE="hidden" NAME="table" VALUE="cust_main">
+  <& /elements/progress-init.html,
+                 'agent_transfer_form',
+                 [ qw( search list table agentnum) ],
+                 $process_url,
+                 $pdest,
+  &>  
+  <& /elements/select-agent.html, 'empty_label' => 'Transfer these customers to agent', 'onchange' => 'areyousure()' &>
+  </FORM>
+
+  <SCRIPT>
+      function areyousure(href) {
+        var sel = document.getElementById("agentnum");
+        if (sel.selectedIndex == 0) { alert("Please select a new agent to transfer to."); }
+        else if (confirm("Transfer these customers to agent " + sel.options[sel.selectedIndex].text )) {
+          process();
+          sel.selectedIndex = 0;
+        }
+        else {
+          sel.selectedIndex = 0;
+        }
+      }
+  </SCRIPT>
+
+<%init>
+
+my $opt = shift;
+my ($search, $list);
+$search = encode_base64(nfreeze($opt->{'search'})) if ref ($opt->{'search'}) eq 'HASH';
+$list = encode_base64(nfreeze($opt->{'list'})) if ref ($opt->{'list'}) eq 'ARRAY';
+my $process_url = "${p}misc/process/customers_transfer_to_agent.html";
+my $pdest = { 'message' => 'Transfer Complete' };
+
+</%init>
\ No newline at end of file
diff --git a/httemplate/misc/process/customers_transfer_to_agent.html b/httemplate/misc/process/customers_transfer_to_agent.html
new file mode 100644 (file)
index 0000000..8ee0d88
--- /dev/null
@@ -0,0 +1,6 @@
+<% $server->process %>
+<%init>
+
+my $server = new FS::UI::Web::JSRPC 'FS::cust_main_Mixin::process_customer_agent_transfer_search_result', $cgi; 
+
+</%init>
\ No newline at end of file