diff options
author | ivan <ivan> | 2003-09-29 05:51:48 +0000 |
---|---|---|
committer | ivan <ivan> | 2003-09-29 05:51:48 +0000 |
commit | 82ca96ae60383ae3da99c460c313dd8eafcaaff4 (patch) | |
tree | 4e9440aa42cf17e490312ff6b210760292ed2256 /httemplate/edit/cust_main.cgi | |
parent | f448821b74ba09f119006cd38810e0626e4650bc (diff) |
agents can be disabled (auto-sensing based on schema)
Diffstat (limited to 'httemplate/edit/cust_main.cgi')
-rwxr-xr-x | httemplate/edit/cust_main.cgi | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 3777cc3e5..d85d7886e 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -75,9 +75,11 @@ print qq!<FORM ACTION="${p1}process/cust_main.cgi" METHOD=POST NAME="form1">!, my $r = qq!<font color="#ff0000">*</font> !; -my @agents = qsearch( 'agent', {} ); +my %agent_search = dbdef->table('agent')->column('disabled') + ? ( 'disabled' => '' ) : (); +my @agents = qsearch( 'agent', \%agent_search ); #die "No agents created!" unless @agents; -eidiot "You have not created any agents. You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents; +eidiot "You have not created any agents (or all agents are disabled). You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents; my $agentnum = $cust_main->agentnum || $agents[0]->agentnum; #default to first if ( scalar(@agents) == 1 ) { print qq!<INPUT TYPE="hidden" NAME="agentnum" VALUE="$agentnum">!; |