summaryrefslogtreecommitdiff
path: root/httemplate/elements/agent_transfer_link.html
blob: 4256f07f025879e7d427f510a1b4efd750cb5391 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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>