//special cases for the expense amount and expense name
$expensemap = array
(
//key (##substitution name) => value (database column name)
expensename => cexpenseapprovalname,
expenseamount => cexpenseapprovalnte
);
//to setup new event and actions
/*
insert new events into tblworkflowevent
insert new filter types into tblworkflowfiltertype (new config1 entries for filter types must be setup below (search workflowtriggerfiltertypeconfig1)
insert new action types into tblworkflowtriggeractiontype (each fieldtype in each action type can be setup like the examples in the database, new types must be setup with new functions called workflowaction_configure_field_xxxxxxx)
*/
function workflowaction_validate($actionarr)
{
$type=$actionarr[workflowtriggeractiontypeshortname];
$actiontype=get_workflowtriggeractiontype($type);
foreach($actiontype[params] as $i=>$param)
{
$value=$actionarr[$param[datafield]];
$fieldtpe = $param[config][fieldtype];
if($param[config][params][notrequired])
continue ;
if($param[config][params][required] && !$value )
$msg .="$param[label] must be selected
";
else
{
$func = "workflowaction_validate_$fieldtpe";
if(function_exists($func))
{
$thismsg=$func($param[config][params],$value);
if($thismsg)
$msg.="$param[label]: $thismsg
";
}else
d("Can not validate $type. no function $func() defined");
}
}
return $msg;
}
function workflowaction_configure($actionarr, $prefix, $autohide = 0,$eventshortname="")
{
global $configureactioncount;
$configureactioncount++;
if($configureactioncount>1)
$displaycount=$configureactioncount;
$type=$actionarr[workflowtriggeractiontypeshortname];
$actiontype=get_workflowtriggeractiontype($type);
if($configureactioncount == 1){
?>
}
$out.="";
$out.="";
$out.="
| Configure Action $displaycount: $actiontype[workflowtriggeractiontypename] |
| Tasks are only assigned to Agents with Active Property Assignments | |||||||||||||||||||||
| Task Name | |||||||||||||||||||||
| Assign New Task to Assigned Agent | |||||||||||||||||||||
| Assign Only to Internal Staff | {$assignment} | ||||||||||||||||||||
| Automatically Approve Tasks Completed by Agents | |||||||||||||||||||||
| Task Description | "; $out.= innova_return($name.'[taskdescr]',$value[taskdescr]); // $out.=" | ||||||||||||||||||||
| Days Til Due | ".customfield_return('select box',"{$name}[taskdays]",$value[taskdays],'1,2,3,4,5,6,7,10,14,30,60,90')." | "; $delaydays=array(); for($dday=2;$dday<31;$dday++) $delaysdaysopts[$dday]="in ".$dday." days"; $delaysdaysopts[''] = "Immediately"; $delaysdaysopts[1] = "in 1 day"; $delaysdaysopts[60] = "in 60 days"; $delaysdaysopts[90] = "in 90 days"; for($rday=1;$rday<91;$rday++) $recurringdaysopts[$rday]=$rday." Days"; $recurringdaysopts[''] = 'Never'; $classname = "recurringonly_".$count; $out.=" |
Create this task: |
".customfield_return('select box',"{$name}[delaydays]",$value[delaydays], $delaysdaysopts)." | |||||||||||||||||
| Recurring | ".customfield_return('select box', "{$name}[recurringyesno]", $value[recurringyesno], 'yn', '', "onchange=\"recurringcheck($(this).val(),'".$classname."')\" onload=\"recurringcheck($(this).val(),'".$classname."')\"")." | ||||||||||||||||||||
| Task Template | ".customfield_return(sqldropdown,"{$name}[tasktemplateid]",$value[tasktemplateid],$qry,"", " style='width:100%;' class='$rndcnt' onchange=\" $(this).closest('tr').find('.previewbutton').show('fade') \" ")." | ||||||||||||||||||||
| A 'new task assigned' email will be automatically be sent to this assigned agent | |||||||||||||||||||||
| From Address | |
|---|---|
| Subject | |
| Subject | $subject |
| Body | "; $out.= innova_return($name.'[body]',$value[body]); $out.= " |
| Attach Merged PDF to E-Mail |
| Header: | "; $out.=""; $out.= innova_return($name.'[header]',$value['header']); $out.=" |
|---|---|
| Body: | "; $out.=""; $out.= innova_return($name.'[body]',$value[body]); $out.=" |
| Footer: | "; $out.=""; $out.= innova_return($name.'[footer]',$value[footer]); $out.=" |
| ".button(config,'Merge PDF Replacement List')." Merge PDF Replacement List"; $out.=" | |
| ".button(config,'Preview Replacement Document')." Preview Replacement Document (This may take several moments) "; $out.=" | |
| "; $out.=""; $out.=" | |
| Header height: | "; $out.=""; $out.="px"; $out.=" |
| Footer height: | "; $out.=""; $out.="px"; $out.=" |
| Auto Footer Page Numbering: | "; $out.=""; $out.=""; $out.=" |
| Auto Footer Date: | "; $out.=""; $out.=""; $out.=" |
Header Goes Here Line 1
Header Goes Here Line 2
Page Footer Goes Here Line 1