From 2e928dafa3cf6383ea9e97f48af61af05e5a292a Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 31 Dec 2009 02:20:33 +0000 Subject: prospecting: proper contact error handling when you add a prospect --- httemplate/edit/process/elements/process.html | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html index e24f3f681..87cadb774 100644 --- a/httemplate/edit/process/elements/process.html +++ b/httemplate/edit/process/elements/process.html @@ -190,11 +190,26 @@ if ($old && exists($opt{'copy_on_empty'})) { } if ( $opt{'agent_virt'} ) { - die "illegal agentnum" - unless $curuser->agentnums_href->{$new->agentnum} - or $opt{'agent_null_right'} - && ! $new->agentnum - && $curuser->access_right($opt{'agent_null_right'}); + + if ( ! $new->agentnum + && ( ! $opt{'agent_null_right'} + || ! $curuser->access_right($opt{'agent_null_right'}) + ) + ) + { + + $error ||= 'Select an agent'; + + } else { + + die "illegal agentnum" + unless $curuser->agentnums_href->{$new->agentnum} + or $opt{'agent_null_right'} + && ! $new->agentnum + && $curuser->access_right($opt{'agent_null_right'}); + + } + } $error ||= $new->check; -- cgit v1.2.1