Added SOURCESELECT Custom Field Type
Added ability to calculate basic Math functions in SCRIPT custom field types git-svn-id: svn://192.168.202.10@3352 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -566,6 +566,14 @@ OTHER CHANGES:
|
||||
|
||||
161. Added 'add_did' function to the Non-Agent API.
|
||||
|
||||
162. Added new SOURCESELECT Custom Field Type, it is a single-selection pull-
|
||||
down menu where there are multiple sets of options available depending
|
||||
on the value of another field for the lead. Also added the ability to
|
||||
perform basic Math functions within a SCRIPT Custom Field using values
|
||||
from other fields in the equations. For more information on how both of
|
||||
these new features work, see the Field Options help in the admin web
|
||||
screen.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2811,7 +2811,7 @@ field_name VARCHAR(5000),
|
||||
field_description VARCHAR(100),
|
||||
field_rank SMALLINT(5),
|
||||
field_help VARCHAR(1000),
|
||||
field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY','SCRIPT','HIDDEN','READONLY','HIDEBLOB','SWITCH') default 'TEXT',
|
||||
field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY','SCRIPT','HIDDEN','READONLY','HIDEBLOB','SWITCH','SOURCESELECT') default 'TEXT',
|
||||
field_options VARCHAR(5000),
|
||||
field_size SMALLINT(5),
|
||||
field_max SMALLINT(5),
|
||||
@@ -4744,4 +4744,4 @@ INSERT INTO vicidial_settings_containers VALUES ('INTERNATIONAL_DNC_IMPORT','Pro
|
||||
|
||||
UPDATE system_settings set vdc_agent_api_active='1';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1616',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1617',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
|
||||
@@ -624,7 +624,7 @@ ALTER TABLE vicidial_inbound_groups ADD park_file_name VARCHAR(100) default '';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1543',db_schema_update_date=NOW() where db_schema_version < 1543;
|
||||
|
||||
ALTER TABLE vicidial_lists_fields MODIFY field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY','SCRIPT','HIDDEN','READONLY','HIDEBLOB','SWITCH') default 'TEXT';
|
||||
ALTER TABLE vicidial_lists_fields MODIFY field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY','SCRIPT','HIDDEN','READONLY','HIDEBLOB','SWITCH','SOURCESELECT') default 'TEXT';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1544',db_schema_update_date=NOW() where db_schema_version < 1544;
|
||||
|
||||
@@ -1430,3 +1430,7 @@ index (drop_time)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1616',db_schema_update_date=NOW() where db_schema_version < 1616;
|
||||
|
||||
ALTER TABLE vicidial_lists_fields MODIFY field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY','SCRIPT','HIDDEN','READONLY','HIDEBLOB','SWITCH','SOURCESELECT') default 'TEXT';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1617',db_schema_update_date=NOW() where db_schema_version < 1617;
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
<?php
|
||||
|
||||
# Evaluator.php - part of the Matex project written by Dorin Marcoci, © 2021
|
||||
# (edited by Matt Florell in 2021)
|
||||
#
|
||||
# CHANGES:
|
||||
# 210211-1426 - Changed from original script to comment-out Exceptions in favor of returned errors
|
||||
#
|
||||
|
||||
namespace Matex;
|
||||
|
||||
class Exception extends \Exception {}
|
||||
|
||||
class Evaluator {
|
||||
|
||||
private $pos;
|
||||
private $text;
|
||||
|
||||
public $variables = [];
|
||||
public $onVariable;
|
||||
public $functions = []; // ARCTAN COS SIN TAN ABS EXP LN LOG SQRT SQR INT FRAC TRUNC ROUND ARCSIN ARCCOS SIGN NOT
|
||||
public $onFunction;
|
||||
|
||||
private function getIdentity(int &$kind = null, string &$value = null): bool {
|
||||
$ops = $this->pos;
|
||||
$ist = ($this->text[$this->pos] ?? false) == '"';
|
||||
if ($ist) {
|
||||
$this->pos++;
|
||||
if (($ist = strpos($this->text, '"', $this->pos)) === false) return false;
|
||||
$kind = 4;
|
||||
$value = substr($this->text, $this->pos, $ist - $this->pos);
|
||||
$this->pos = $ist + 1;
|
||||
return true;
|
||||
}
|
||||
while ((($char = $this->text[$this->pos] ?? false) !== false) && (ctype_alnum($char) || in_array($char, ['.', '_'])))
|
||||
$this->pos++;
|
||||
if (!$len = $this->pos - $ops) return false;
|
||||
$str = substr($this->text, $ops, $len);
|
||||
if (is_numeric($str)) $kind = 1;
|
||||
else {
|
||||
if (ctype_digit($str[0]) || (strpos($str, '.') !== false)) return false;
|
||||
$kind = $char == '(' ? 3 : 2;
|
||||
}
|
||||
$value = $str;
|
||||
return true;
|
||||
}
|
||||
|
||||
private function getVariable(string $name) {
|
||||
$value = $this->variables[$name] ?? null;
|
||||
if (!isset($value) && isset($this->onVariable)) {
|
||||
call_user_func_array($this->onVariable, [$name, &$value]);
|
||||
$this->variables[$name] = $value;
|
||||
}
|
||||
if (!isset($value)) {return "Math Error: Unknown variable";}
|
||||
// throw new Exception('Unknown variable: '.$name, 5);
|
||||
return $value;
|
||||
}
|
||||
|
||||
private function addArgument(&$arguments, $argument) {
|
||||
if ($argument == '') {return "Math Error: Empty argument";}
|
||||
// throw new Exception('Empty argument', 4);
|
||||
$arguments[] = $argument;
|
||||
}
|
||||
|
||||
private function getArguments(&$arguments = []): bool {
|
||||
$b = 1;
|
||||
$this->pos++;
|
||||
$mark = $this->pos;
|
||||
while ((($char = $this->text[$this->pos] ?? false) !== false) && ($b > 0)) {
|
||||
if (($char == ',') && ($b == 1)) {
|
||||
$this->addArgument($arguments, substr($this->text, $mark, $this->pos - $mark));
|
||||
$mark = $this->pos + 1;
|
||||
}
|
||||
elseif ($char == ')') $b--;
|
||||
elseif ($char == '(') $b++;
|
||||
$this->pos++;
|
||||
}
|
||||
if (!in_array($char, [false, '+', '-', '/', '*', '^', '%', ')']))
|
||||
return false;
|
||||
$this->addArgument($arguments, substr($this->text, $mark, $this->pos - $mark - 1));
|
||||
return true;
|
||||
}
|
||||
|
||||
private function proArguments($arguments) {
|
||||
$ops = $this->pos;
|
||||
$otx = $this->text;
|
||||
$result = [];
|
||||
foreach ($arguments as $argument)
|
||||
$result[] = $this->perform($argument);
|
||||
$this->pos = $ops;
|
||||
$this->text = $otx;
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function getFunction(string $name) {
|
||||
$routine = $this->functions[$name] ?? null;
|
||||
if (!isset($routine) && isset($this->onFunction)) {
|
||||
call_user_func_array($this->onFunction, [$name, &$routine]);
|
||||
$this->functions[$name] = $routine;
|
||||
}
|
||||
if (!isset($routine)) {return "Math Error: Unknown function";}
|
||||
// throw new Exception('Unknown function: '.$name, 6);
|
||||
if (!$this->getArguments($arguments)) {return "Math Error: Syntax error";}
|
||||
// throw new Exception('Syntax error', 1);
|
||||
if (isset($routine['arc']) && ($routine['arc'] != count($arguments))) {return "Math Error: Invalid argument count";}
|
||||
// throw new Exception('Invalid argument count', 3);
|
||||
return call_user_func_array($routine['ref'], $this->proArguments($arguments));
|
||||
}
|
||||
|
||||
private function isNumer($value): bool {
|
||||
return is_float($value) || is_integer($value);
|
||||
}
|
||||
|
||||
private function checkNumers($a, $b) {
|
||||
if ($this->isNumer($a) && $this->isNumer($b)) return;
|
||||
{return "Math Error: Non-numeric value";}
|
||||
// throw new Exception('Non-numeric value', 8);
|
||||
}
|
||||
|
||||
private function checkString($a) {
|
||||
if (is_string($a)) return;
|
||||
{return "Math Error: Non-string value";}
|
||||
// throw new Exception('Non-string value', 9);
|
||||
}
|
||||
|
||||
private function term() {
|
||||
$minus = false;
|
||||
while ((($char = $this->text[$this->pos] ?? false) !== false) && in_array($char, ['-', '+'])) {
|
||||
$negat = $char == '-';
|
||||
$minus = $minus ? ($negat ? false : true) : $negat;
|
||||
$this->pos++;
|
||||
}
|
||||
if ($this->text[$this->pos] == '(') {
|
||||
$this->pos++;
|
||||
$value = $this->calculate();
|
||||
$this->pos++;
|
||||
if (!in_array($this->text[$this->pos] ?? false, [false, '+', '-', '/', '*', '^', '%', ')'])) {return "Math Error: Syntax error";}
|
||||
// throw new Exception('Syntax error', 1);
|
||||
return $minus ? - $value : $value;
|
||||
}
|
||||
if (!$this->getIdentity($kind, $name)) {return "Math Error: Syntax error";}
|
||||
// throw new Exception('Syntax error', 1);
|
||||
switch ($kind) {
|
||||
case 1: $value = (float) $name; break;
|
||||
case 2: $value = $this->getVariable($name); break;
|
||||
case 3: $value = $this->getFunction($name); break;
|
||||
case 4: $value = $name; break;
|
||||
}
|
||||
return $minus ? - $value : $value;;
|
||||
}
|
||||
|
||||
private function subTerm() {
|
||||
$value = $this->term();
|
||||
while (in_array($char = $this->text[$this->pos] ?? false, ['*', '/', '^', '%'])) {
|
||||
$this->pos++;
|
||||
$term = $this->term();
|
||||
$this->checkNumers($value, $term);
|
||||
switch ($char) {
|
||||
case '*':
|
||||
if ( (!is_numeric($value)) or (strlen($value) < 1) or (!is_numeric($term)) or (strlen($term) < 1) ) {return "Math Error: Empty variable";}
|
||||
// throw new Exception('Empty variable', 7);
|
||||
$value *= $term;
|
||||
break;
|
||||
case '/':
|
||||
if ($term == 0) {return "Math Error: Division by zero";}
|
||||
// throw new Exception('Division by zero', 7);
|
||||
$value /= $term;
|
||||
break;
|
||||
case '^':
|
||||
$value **= $term;
|
||||
break;
|
||||
case '%':
|
||||
$value %= $term;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
private function calculate() {
|
||||
$value = $this->subTerm();
|
||||
while (in_array($char = $this->text[$this->pos] ?? false, ['+', '-'])) {
|
||||
$this->pos++;
|
||||
$subTerm = $this->subTerm();
|
||||
if (($char == '+') && is_string($value)) {
|
||||
$this->checkString($subTerm);
|
||||
$value .= $subTerm;
|
||||
continue;
|
||||
}
|
||||
$this->checkNumers($value, $subTerm);
|
||||
if ( (strlen($subTerm) < 1) or (!is_numeric($subTerm)) ) {return "Math Error: Empty variable";}
|
||||
// throw new Exception('Empty variable', 7);
|
||||
if ($char == '-') $subTerm = -$subTerm;
|
||||
$value += $subTerm;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
private function perform(string $formula) {
|
||||
$this->pos = 0;
|
||||
$this->text = $formula;
|
||||
return $this->calculate();
|
||||
}
|
||||
|
||||
public function execute(string $formula) {
|
||||
$b = 0;
|
||||
for ($i = 0; $i < strlen($formula); $i++) {
|
||||
switch ($formula[$i]) {
|
||||
case '(': $b++; break;
|
||||
case ')': $b--; break;
|
||||
}
|
||||
}
|
||||
if ($b != 0) {return "Math Error: Unmatched brackets";}
|
||||
// throw new Exception('Unmatched brackets', 2);
|
||||
$i = strpos($formula, '"');
|
||||
if ($i === false)
|
||||
$formula = str_replace(' ', '', strtolower($formula));
|
||||
else {
|
||||
$cleaned = '';
|
||||
$l = strlen($formula);
|
||||
$s = 0;
|
||||
$b = false;
|
||||
do {
|
||||
if ($b) $i++;
|
||||
$part = substr($formula, $s, $i - $s);
|
||||
if (!$b) $part = str_replace(' ', '', strtolower($part));
|
||||
$s = $i;
|
||||
$b = !$b;
|
||||
$cleaned .= $part;
|
||||
$d = $s + 1;
|
||||
if ($l < $d) break;
|
||||
} while (($i = strpos($formula, '"', $d)) !== false);
|
||||
if ($l != $s)
|
||||
$cleaned .= str_replace(' ', '', strtolower(substr($formula, $s)));
|
||||
$formula = $cleaned;
|
||||
}
|
||||
return $this->perform($formula);
|
||||
}
|
||||
|
||||
}
|
||||
+92
-10
@@ -4,7 +4,7 @@
|
||||
#
|
||||
# functions for agent scripts
|
||||
#
|
||||
# Copyright (C) 2020 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2021 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
#
|
||||
# CHANGES:
|
||||
@@ -49,7 +49,8 @@
|
||||
# 181004-1644 - Fix for defaut field in AREA type
|
||||
# 191013-1029 - Fixes for PHP7
|
||||
# 200406-1204 - Fix for gender default field population
|
||||
#
|
||||
# 210211-0145 - Added SOURCESELECT field type, added basic Math equations to SCRIPT custom field types
|
||||
#
|
||||
|
||||
# $mysql_queries = 26
|
||||
|
||||
@@ -343,6 +344,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
|
||||
$custom_required_fields_multi='|';
|
||||
|
||||
require("dbconnect_mysqli.php");
|
||||
require("Evaluator.php");
|
||||
|
||||
$CFoutput='';
|
||||
$stmt="SHOW TABLES LIKE \"custom_$list_id\";";
|
||||
@@ -538,7 +540,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
|
||||
}
|
||||
$field_HTML='';
|
||||
|
||||
if ($A_field_type[$o]=='SELECT')
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='SOURCESELECT') )
|
||||
{
|
||||
$change_trigger='';
|
||||
$default_field_flag=0;
|
||||
@@ -553,19 +555,76 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
|
||||
{
|
||||
$field_HTML .= "<select MULTIPLE size=$A_field_size[$o] name=$A_field_label[$o][] id=$A_field_label[$o][]>\n";
|
||||
}
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') or ($A_field_type[$o]=='SWITCH') )
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='SOURCESELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') or ($A_field_type[$o]=='SWITCH') )
|
||||
{
|
||||
$field_options_array = explode("\n",$A_field_options[$o]);
|
||||
$field_options_count = count($field_options_array);
|
||||
$te=0; $te_printed=0;
|
||||
if ($A_field_type[$o]=='SOURCESELECT')
|
||||
{
|
||||
$NEWfield_options_array = array();
|
||||
$NEWfield_options_array[0] = '|no options';
|
||||
if (!preg_match("/^source=>/i",$field_options_array[0]))
|
||||
{echo _QXZ("ERROR: SOURCESELECT custom field is not defined properly");}
|
||||
else
|
||||
{
|
||||
$sourceselect_field = preg_replace("/^source=>/i",'',trim($field_options_array[0]));
|
||||
$sourceselect_value='';
|
||||
##### grab the source field data from main or custom table for the lead_id
|
||||
if (preg_match("/\|$sourceselect_field\|/i",$vicidial_list_fields))
|
||||
{$stmt="SELECT $sourceselect_field FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";}
|
||||
else
|
||||
{$stmt="SELECT $sourceselect_field FROM custom_$list_id where lead_id='$lead_id' LIMIT 1;";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$sourceselect_ct = mysqli_num_rows($rslt);
|
||||
if ($sourceselect_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$sourceselect_value = $row[0];
|
||||
}
|
||||
$temp_sourcematch = "value=>$sourceselect_value";
|
||||
if ($DB) {echo "Starting SOURCESELECT: |$sourceselect_field|$sourceselect_value|$temp_sourcematch|\n";}
|
||||
$temp_matchfound=0; $NFA=0;
|
||||
while ( ($te < $field_options_count) and ($temp_matchfound < 2) )
|
||||
{
|
||||
if ($temp_matchfound == '1')
|
||||
{
|
||||
if (preg_match("/^option=>/i",trim($field_options_array[$te])))
|
||||
{
|
||||
$field_options_array[$te] = preg_replace("/^option=>/i",'',trim($field_options_array[$te]));
|
||||
$NEWfield_options_array[$NFA] = trim($field_options_array[$te]);
|
||||
$NFA++;
|
||||
}
|
||||
else
|
||||
{$temp_matchfound=2;}
|
||||
}
|
||||
if (preg_match("/^$temp_sourcematch$/i",trim($field_options_array[$te])) )
|
||||
{$temp_matchfound=1;}
|
||||
|
||||
if ($DB) {echo "SOURCESELECT 2: $te|$field_options_array[$te]|$temp_matchfound|\n";}
|
||||
|
||||
$te++;
|
||||
}
|
||||
if ($NFA < 1) {$NFA=1;}
|
||||
$field_options_array = $NEWfield_options_array;
|
||||
$field_options_count = $NFA;
|
||||
if ($DB) {echo "SOURCESELECT 3: $te|$field_options_count|$field_options_array[0]|\n";}
|
||||
}
|
||||
}
|
||||
$te=0; $te_printed=0;
|
||||
if ($DB > 0) {echo "DEBUG: |$A_field_id[$o]|$A_field_label[$o]|$A_field_name[$o]|$A_field_type[$o]|$A_field_options[$o]|$field_options_count|\n";}
|
||||
while ($te < $field_options_count)
|
||||
{
|
||||
if (preg_match("/,/",$field_options_array[$te]))
|
||||
if (preg_match("/,|\|/",$field_options_array[$te]))
|
||||
{
|
||||
$field_selected='';
|
||||
$field_options_value_array = explode(",",$field_options_array[$te]);
|
||||
if ($A_field_type[$o]=='SELECT')
|
||||
if ($A_field_type[$o]=='SOURCESELECT')
|
||||
{$field_options_value_array = explode('|',$field_options_array[$te]);}
|
||||
else
|
||||
{$field_options_value_array = explode(",",$field_options_array[$te]);}
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='SOURCESELECT') )
|
||||
{
|
||||
if (strlen($A_field_value[$o]) > 0)
|
||||
{
|
||||
@@ -641,7 +700,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
|
||||
$te++;
|
||||
}
|
||||
}
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') )
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='SOURCESELECT') or ($A_field_type[$o]=='MULTI') )
|
||||
{
|
||||
$field_HTML .= "</select>\n";
|
||||
}
|
||||
@@ -649,7 +708,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
|
||||
# If options were printed for SELECT, MULTI, RADIO or CHECKBOX and required is set, mark as a required field
|
||||
if ($te_printed > 0)
|
||||
{
|
||||
if ($A_field_type[$o]=='SELECT')
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='SOURCESELECT') )
|
||||
{
|
||||
if ( ($A_field_required[$o] == 'Y') or ( ($A_field_required[$o] == 'INBOUND_ONLY') and (preg_match("/^Y\d\d\d\d\d\d\d/",$call_id)) ) )
|
||||
{$custom_required_fields_select .= "$A_field_label[$o]|";}
|
||||
@@ -861,7 +920,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
|
||||
|
||||
##### BEGIN parsing for vicidial variables #####
|
||||
$NOTESout='';
|
||||
if (preg_match("/--A--|--U--/",$CFoutput))
|
||||
if (preg_match("/--A--|--U--|--M--/",$CFoutput))
|
||||
{
|
||||
if ( (preg_match('/--A--user_custom_|--U--user_custom_/i',$CFoutput)) or (preg_match('/--A--fullname|--U--fullname/i',$CFoutput)) )
|
||||
{
|
||||
@@ -1316,6 +1375,29 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
|
||||
$o++;
|
||||
}
|
||||
|
||||
# check for Math formulas
|
||||
if ( (preg_match("/--M--/",$CFoutput)) or (preg_match("/--N--/",$CFoutput)) )
|
||||
{
|
||||
$DBM=0;
|
||||
$evaluator = new \Matex\Evaluator();
|
||||
preg_match_all("/--M--(.*?)--N--/", $CFoutput, $MathMatch);
|
||||
$MathMatch_count = count($MathMatch[0]);
|
||||
$Mct=0;
|
||||
while ($MathMatch_count > $Mct)
|
||||
{
|
||||
$temp_MathEq = $MathMatch[0][$Mct];
|
||||
$temp_MathEq = preg_replace("/--M--|--N--/",'',$temp_MathEq);
|
||||
$temp_MathEq_orig = $temp_MathEq;
|
||||
$temp_MathEq = preg_replace("/[^- \+\-\*\^\.\(\)\%\/0-9]/",'',$temp_MathEq);
|
||||
|
||||
$temp_MathResult = $evaluator->execute($temp_MathEq);
|
||||
if ($DBM > 0) {$CFoutput .= "MATH DEBUG: $Mct|$temp_MathEq|$temp_MathResult|\n";}
|
||||
$CFoutput = str_replace("--M--$temp_MathEq_orig--N--","$temp_MathResult",$CFoutput);
|
||||
|
||||
$Mct++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($DB > 0) {echo "$CFoutput<BR>\n";}
|
||||
}
|
||||
##### END parsing for vicidial variables #####
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# vdc_form_display.php
|
||||
#
|
||||
# Copyright (C) 2020 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2021 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed display the contents of the FORM tab in the agent
|
||||
# interface, as well as take submission of the form submission when the agent
|
||||
@@ -45,10 +45,11 @@
|
||||
# 180503-1813 - Added code for SWITCH field type
|
||||
# 200406-1137 - Added hide_gender and gender default population
|
||||
# 201117-2056 - Changes for better compatibility with non-latin data input
|
||||
# 210211-0146 - Added SOURCESELECT field type
|
||||
#
|
||||
|
||||
$version = '2.14-35';
|
||||
$build = '201117-2056';
|
||||
$version = '2.14-36';
|
||||
$build = '210211-0146';
|
||||
$php_script = 'vdc_form_display.php';
|
||||
|
||||
require_once("dbconnect_mysqli.php");
|
||||
|
||||
+11
-2
@@ -5434,12 +5434,13 @@ if ($SSscript_remove_js > 0)
|
||||
# 210124-0947 - Added copy_user Non-Agent API function
|
||||
# 210207-0915 - Added Shared Debug Page to admin utilities
|
||||
# 210210-1601 - Added add_did Non-Agent API function
|
||||
# 210211-1145 - Added Matex use information
|
||||
#
|
||||
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
|
||||
|
||||
$admin_version = '2.14-786a';
|
||||
$build = '210210-1601';
|
||||
$admin_version = '2.14-787a';
|
||||
$build = '210211-1145';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -44905,6 +44906,14 @@ if ($ADD==999995)
|
||||
|
||||
echo "<br><br><B> "._QXZ("Other integrated software disclaimers").":</B><BR><BR>\n";
|
||||
|
||||
echo "<center><TABLE width=$section_width cellspacing=5 cellpadding=2>\n";
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right valign=middle rowspan=3 nowrap><B><font size=3>"._QXZ("Matex").": </B></td>";
|
||||
echo "<td align=right valign=top><B><font size=2>"._QXZ("Copyright").": </B></td><td align=left><font size=1> "._QXZ("Matex PHP Mathematical expression parser and evaluator library was written by Dorin Marcoci").", © 2021</td></tr>\n";
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right valign=top><B><font size=2>"._QXZ("License").": </B></td><td align=left><font size=1> "._QXZ("Chart.js is licensed under the")." <a href=\"https://github.com/madorin/matex/blob/master/LICENSE.md\" target=\"_blank\">MIT "._QXZ("open source license")."</a></td></tr>\n";
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right valign=top nowrap><B><font size=2>"._QXZ("Source Code").": </B></td><td align=left><font size=1> "._QXZ("Matex original source code is available at")." <a href=\"https://github.com/madorin/matex\" target=\"_blank\">"._QXZ("this link")."</a>.</td></tr>\n";
|
||||
|
||||
echo "<tr><td colspan=3> </tr>";
|
||||
|
||||
echo "<center><TABLE width=$section_width cellspacing=5 cellpadding=2>\n";
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right valign=middle rowspan=3 nowrap><B><font size=3>"._QXZ("Pure-knob").": </B></td>";
|
||||
echo "<td align=right valign=top><B><font size=2>"._QXZ("Copyright").": </B></td><td align=left><font size=1> "._QXZ("The pure-knob javascript library was written by Andre Plötze").", © 2018</td></tr>\n";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# admin_lists_custom.php
|
||||
#
|
||||
# Copyright (C) 2019 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2021 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# this screen manages the custom lists fields in ViciDial
|
||||
#
|
||||
@@ -53,10 +53,11 @@
|
||||
# 180502-2215 - Added new help display
|
||||
# 180504-1807 - Added new SWITCH field type
|
||||
# 191013-1014 - Fixes for PHP7
|
||||
# 210211-0032 - Added SOURCESELECT field type
|
||||
#
|
||||
|
||||
$admin_version = '2.14-44';
|
||||
$build = '191013-1014';
|
||||
$admin_version = '2.14-45';
|
||||
$build = '210211-0032';
|
||||
|
||||
require("dbconnect_mysqli.php");
|
||||
require("functions.php");
|
||||
@@ -821,7 +822,7 @@ if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) )
|
||||
else
|
||||
{
|
||||
$TEST_valid_options=0;
|
||||
if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') or ($field_type=='SWITCH') )
|
||||
if ( ($field_type=='SELECT') or ($field_type=='SOURCESELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') or ($field_type=='SWITCH') )
|
||||
{
|
||||
$TESTfield_options_array = explode("\n",$field_options);
|
||||
$TESTfield_options_count = count($TESTfield_options_array);
|
||||
@@ -829,9 +830,12 @@ if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) )
|
||||
$switch_list_self=0;
|
||||
while ($te < $TESTfield_options_count)
|
||||
{
|
||||
if (preg_match("/,/",$TESTfield_options_array[$te]))
|
||||
if (preg_match("/,|\|/",$TESTfield_options_array[$te]))
|
||||
{
|
||||
$TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]);
|
||||
if ($field_type=='SOURCESELECT')
|
||||
{$TESTfield_options_value_array = explode('|',$TESTfield_options_array[$te]);}
|
||||
else
|
||||
{$TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]);}
|
||||
if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) )
|
||||
{$TEST_valid_options++;}
|
||||
if ( ($field_type=='SWITCH') and ($TESTfield_options_value_array[0] == "$list_id") )
|
||||
@@ -842,8 +846,8 @@ if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) )
|
||||
$field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM);
|
||||
}
|
||||
|
||||
if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) )
|
||||
{echo "<B><font color=red>"._QXZ("ERROR: You must enter field options when adding a SELECT, MULTI, RADIO or CHECKBOX field type")." - $list_id|$field_label|$field_type|$switch_list_self|$field_options</B></font>\n<BR>";}
|
||||
if ( ( ($field_type=='SELECT') or ($field_type=='SOURCESELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,|\|/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) )
|
||||
{echo "<B><font color=red>"._QXZ("ERROR: You must enter field options when adding a SELECT, MULTI, RADIO, CHECKBOX or SOURCESELECT field type")." - $list_id|$field_label|$field_type|$switch_list_self|$field_options</B></font>\n<BR>";}
|
||||
else
|
||||
{
|
||||
if ( ($field_type=='SWITCH') and ($switch_list_self < 1) )
|
||||
@@ -967,7 +971,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELD_SUBMIT") and ($list_id > 99) and ($field_i
|
||||
else
|
||||
{
|
||||
$TEST_valid_options=0;
|
||||
if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') or ($field_type=='SWITCH') )
|
||||
if ( ($field_type=='SELECT') or ($field_type=='SOURCESELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') or ($field_type=='SWITCH') )
|
||||
{
|
||||
$TESTfield_options_array = explode("\n",$field_options);
|
||||
$TESTfield_options_count = count($TESTfield_options_array);
|
||||
@@ -975,9 +979,12 @@ if ( ($action == "MODIFY_CUSTOM_FIELD_SUBMIT") and ($list_id > 99) and ($field_i
|
||||
$switch_list_self=0;
|
||||
while ($te < $TESTfield_options_count)
|
||||
{
|
||||
if (preg_match("/,/",$TESTfield_options_array[$te]))
|
||||
if (preg_match("/,|\|/",$TESTfield_options_array[$te]))
|
||||
{
|
||||
$TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]);
|
||||
if ($field_type=='SOURCESELECT')
|
||||
{$TESTfield_options_value_array = explode('|',$TESTfield_options_array[$te]);}
|
||||
else
|
||||
{$TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]);}
|
||||
if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) )
|
||||
{$TEST_valid_options++;}
|
||||
if ( ($field_type=='SWITCH') and ($TESTfield_options_value_array[0] == "$list_id") )
|
||||
@@ -989,8 +996,8 @@ if ( ($action == "MODIFY_CUSTOM_FIELD_SUBMIT") and ($list_id > 99) and ($field_i
|
||||
$field_options_ENUM = preg_replace("/.$/",'',$field_options_ENUM);
|
||||
}
|
||||
|
||||
if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) )
|
||||
{echo "<B><font color=red>"._QXZ("ERROR: You must enter field options when updating a SELECT, MULTI, RADIO or CHECKBOX field type")." - $list_id|$field_label|$field_type|$field_options</B></font>\n<BR>";}
|
||||
if ( ( ($field_type=='SELECT') or ($field_type=='SOURCESELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,|\|/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) )
|
||||
{echo "<B><font color=red>"._QXZ("ERROR: You must enter field options when updating a SELECT, MULTI, RADIO, CHECKBOX or SOURCESELECT field type")." - $list_id|$field_label|$field_type|$field_options</B></font>\n<BR>";}
|
||||
else
|
||||
{
|
||||
if ( ($field_type=='SWITCH') and ($switch_list_self < 1) )
|
||||
@@ -1230,7 +1237,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
|
||||
$encrypt_icon='';
|
||||
if ($A_field_encrypt[$o] == 'Y')
|
||||
{$encrypt_icon = " <img src=\""._QXZ("../../agc/images/encrypt.gif")."\" width=16 height=20 valign=bottom alt=\""._QXZ("Encrypted Field")."\">";}
|
||||
if ($A_field_type[$o]=='SELECT')
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='SOURCESELECT') )
|
||||
{
|
||||
$field_HTML .= "<select size=1 name=$A_field_label[$o] id=$A_field_label[$o]>\n";
|
||||
}
|
||||
@@ -1238,22 +1245,34 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
|
||||
{
|
||||
$field_HTML .= "<select MULTIPLE size=$A_field_size[$o] name=$A_field_label[$o] id=$A_field_label[$o]>\n";
|
||||
}
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') or ($A_field_type[$o]=='SWITCH') )
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='SOURCESELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') or ($A_field_type[$o]=='SWITCH') )
|
||||
{
|
||||
$field_options_array = explode("\n",$A_field_options[$o]);
|
||||
$field_options_count = count($field_options_array);
|
||||
$te=0;
|
||||
while ($te < $field_options_count)
|
||||
{
|
||||
if (preg_match("/,/",$field_options_array[$te]))
|
||||
if (preg_match("/,|\|/",$field_options_array[$te]))
|
||||
{
|
||||
$field_selected='';
|
||||
$field_options_value_array = explode(",",$field_options_array[$te]);
|
||||
if ($A_field_type[$o]=='SOURCESELECT')
|
||||
{$field_options_value_array = explode('|',$field_options_array[$te]);}
|
||||
else
|
||||
{$field_options_value_array = explode(",",$field_options_array[$te]);}
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') )
|
||||
{
|
||||
if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'SELECTED';}
|
||||
$field_HTML .= "<option value=\"$field_options_value_array[0]\" $field_selected>$field_options_value_array[1]</option>\n";
|
||||
}
|
||||
if ($A_field_type[$o]=='SOURCESELECT')
|
||||
{
|
||||
if (preg_match("/^option=>/i",$field_options_value_array[0]))
|
||||
{
|
||||
$field_options_value_array[0] = preg_replace("/^option=>/i",'',$field_options_value_array[0]);
|
||||
if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'SELECTED';}
|
||||
$field_HTML .= "<option value=\"$field_options_value_array[0]\" $field_selected>$field_options_value_array[1]</option>\n";
|
||||
}
|
||||
}
|
||||
if ( ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') )
|
||||
{
|
||||
if ($A_multi_position[$o]=='VERTICAL')
|
||||
@@ -1282,7 +1301,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
|
||||
$te++;
|
||||
}
|
||||
}
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') )
|
||||
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='SOURCESELECT') or ($A_field_type[$o]=='MULTI') )
|
||||
{
|
||||
$field_HTML .= "</select>\n";
|
||||
}
|
||||
@@ -1519,6 +1538,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
|
||||
echo "<option value='HIDEBLOB'>"._QXZ("HIDEBLOB")."</option>\n";
|
||||
echo "<option value='SWITCH'>"._QXZ("SWITCH")."</option>\n";
|
||||
echo "<option value='READONLY'>"._QXZ("READONLY")."</option>\n";
|
||||
echo "<option value='SOURCESELECT'>"._QXZ("SOURCESELECT")."</option>\n";
|
||||
echo "<option value='$A_field_type[$o]' selected>"._QXZ("$A_field_type[$o]")."</option>\n";
|
||||
echo "</select> $NWB#lists_fields-field_type$NWE </td></tr>\n";
|
||||
echo "<tr $bgcolor><td align=right>"._QXZ("Field Options")." $A_field_rank[$o]: </td><td align=left><textarea name=field_options ROWS=5 COLS=60>$A_field_options[$o]</textarea> $NWB#lists_fields-field_options$NWE </td></tr>\n";
|
||||
@@ -1622,6 +1642,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
|
||||
echo "<option value='HIDEBLOB'>"._QXZ("HIDEBLOB")."</option>\n";
|
||||
echo "<option value='SWITCH'>"._QXZ("SWITCH")."</option>\n";
|
||||
echo "<option value='READONLY'>"._QXZ("READONLY")."</option>\n";
|
||||
echo "<option value='SOURCESELECT'>"._QXZ("SOURCESELECT")."</option>\n";
|
||||
echo "<option selected value='TEXT'>"._QXZ("TEXT")."</option>\n";
|
||||
echo "</select> $NWB#lists_fields-field_type$NWE </td></tr>\n";
|
||||
echo "<tr $bgcolor><td align=right>"._QXZ("Field Options").": </td><td align=left><textarea name=field_options ROWS=5 COLS=60></textarea> $NWB#lists_fields-field_options$NWE </td></tr>\n";
|
||||
@@ -1880,16 +1901,22 @@ function add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field
|
||||
|
||||
$field_options_ENUM='';
|
||||
$field_cost=1;
|
||||
if ( ($field_type=='SELECT') or ($field_type=='RADIO') )
|
||||
if ( ($field_type=='SELECT') or ($field_type=='SOURCESELECT') or ($field_type=='RADIO') )
|
||||
{
|
||||
$field_options_array = explode("\n",$field_options);
|
||||
$field_options_count = count($field_options_array);
|
||||
$te=0;
|
||||
while ($te < $field_options_count)
|
||||
{
|
||||
if (preg_match("/,/",$field_options_array[$te]))
|
||||
if (preg_match("/,|\|/",$field_options_array[$te]))
|
||||
{
|
||||
$field_options_value_array = explode(",",$field_options_array[$te]);
|
||||
if ($field_type=='SOURCESELECT')
|
||||
{
|
||||
$field_options_value_array = explode('|',$field_options_array[$te]);
|
||||
$field_options_value_array[0] = preg_replace("/^option=>/i",'',$field_options_value_array[0]);
|
||||
}
|
||||
else
|
||||
{$field_options_value_array = explode(",",$field_options_array[$te]);}
|
||||
$field_options_ENUM .= "'$field_options_value_array[0]',";
|
||||
}
|
||||
$te++;
|
||||
@@ -2068,16 +2095,22 @@ function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$fi
|
||||
|
||||
$field_options_ENUM='';
|
||||
$field_cost=1;
|
||||
if ( ($field_type=='SELECT') or ($field_type=='RADIO') )
|
||||
if ( ($field_type=='SELECT') or ($field_type=='SOURCESELECT') or ($field_type=='RADIO') )
|
||||
{
|
||||
$field_options_array = explode("\n",$field_options);
|
||||
$field_options_count = count($field_options_array);
|
||||
$te=0;
|
||||
while ($te < $field_options_count)
|
||||
{
|
||||
if (preg_match("/,/",$field_options_array[$te]))
|
||||
if (preg_match("/,|\|/",$field_options_array[$te]))
|
||||
{
|
||||
$field_options_value_array = explode(",",$field_options_array[$te]);
|
||||
if ($field_type=='SOURCESELECT')
|
||||
{
|
||||
$field_options_value_array = explode('|',$field_options_array[$te]);
|
||||
$field_options_value_array[0] = preg_replace("/^option=>/i",'',$field_options_value_array[0]);
|
||||
}
|
||||
else
|
||||
{$field_options_value_array = explode(",",$field_options_array[$te]);}
|
||||
$field_options_ENUM .= "'$field_options_value_array[0]',";
|
||||
}
|
||||
$te++;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# version: 20210103084501
|
||||
# version: 20210211025401
|
||||
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 8 digits in length, Must be at least 2 characters in length.</QXZ>
|
||||
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
|
||||
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ>
|
||||
@@ -444,8 +444,8 @@ lists_fields-field_description Field Description <QXZ>The description of this fi
|
||||
lists_fields-field_rank Field Rank <QXZ>The order in which these fields is displayed to the agent from lowest on top to highest on the bottom.</QXZ>
|
||||
lists_fields-field_order Field Order <QXZ>If more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right.</QXZ>
|
||||
lists_fields-field_help Field Help <QXZ>Optional field, if you fill it in, the agent will be able to see this text when they click on a help link next to the field in their agent interface.</QXZ>
|
||||
lists_fields-field_type Field Type <QXZ>This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box. DISPLAY will display only and not allow for modification by the agent. SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does. HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data. HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured. The SWITCH field type allows the agent to switch the lead custom fields to another list, as well as reloading the FORM tab with the new set of list custom fields for the new list. To configure SWITCH type fields, you must define the button values below in the Field Options box.</QXZ>
|
||||
lists_fields-field_options Field Options <QXZ>For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter</QXZ>. <QXZ>For the SCRIPT field types, this field is where you put your script contents. You can use single quote and amphersand characters as well so that you can create links and iframe elements. If you want to put urlencoded fields in this area, make sure you use the --U-- and --V-- flags for your variables instead of using A and B, for example --U--test_field--V--. For the SWITCH field type, you should define the list ID for the custom fields as well as the text that you want to appear in the button to activate the new form in a comma separated line, with one line for each button you want to appear. For the SWITCH field type, it is a requirement that one of the entries be the current list ID.</QXZ>
|
||||
lists_fields-field_type Field Type <QXZ>This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box. DISPLAY will display only and not allow for modification by the agent. SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does. HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data. HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured. The SWITCH field type allows the agent to switch the lead custom fields to another list, as well as reloading the FORM tab with the new set of list custom fields for the new list. To configure SWITCH type fields, you must define the button values below in the Field Options box. SOURCESELECT is a single-selection pull-down menu where there are multiple sets of options available depending on the value of another field for the lead, see the Field Options help for more details.</QXZ>
|
||||
lists_fields-field_options Field Options <QXZ>For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter</QXZ>. <QXZ>For the SCRIPT field types, this field is where you put your script contents. You can use single quote and amphersand characters as well so that you can create links and iframe elements. If you want to put urlencoded fields in this area, make sure you use the --U-- and --V-- flags for your variables instead of using A and B, for example --U--test_field--V--. You can also use the --M-- and --N-- flags to enclose basic Math equations to have them calculated when the script is loaded initially, for example multiplying test_field by 12 would be entered with --M--(--A--test_field--B-- * 12)--N--. For the SWITCH field type, you should define the list ID for the custom fields as well as the text that you want to appear in the button to activate the new form in a comma separated line, with one line for each button you want to appear. For the SWITCH field type, it is a requirement that one of the entries be the current list ID. For SOURCESELECT, if this field is set to use the -province- field to determine what values to use, then the first line in the Field Options box should be -source=>province-, without the dashes. The next options line will be the first province value to look for, for example -value=>Ontario-, and if the value for that field for the lead matches, the next lines will be the options to show with the value and display text separated by a pipe. After that, you can add more values each with options after them, like this example below shows: <br>source=>province<br>value=>Ontario<br>option=>|select month here<br>option=>September|September<br>option=>October|October<br>value=>Nova Scotia<br>option=>|select month here<br>option=>June|June<br>option=>July|July<br>option=>August|August<br>value=>British Columbia<br>option=>|select month here<br>option=>January|January<br>option=>February|February<br>option=>March|March<br>value=><br>option=>|no match</QXZ>
|
||||
lists_fields-multi_position Option Position <QXZ>For CHECKBOX and RADIO field types only, if set to HORIZONTAL the options will appear on the same line possibly wrapping to the line below if there are many options. If set to VERTICAL there will be only one option per line. Default is HORIZONTAL.</QXZ>
|
||||
lists_fields-field_size Field Size <QXZ>This setting will mean different things depending on what the field type is. For TEXT fields, the size is the number of characters that will show in the field. For AREA fields, the size is the width of the text box in characters. For MULTI fields, this setting defines the number of options to be shown in the multi select list. For SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored.</QXZ>
|
||||
lists_fields-field_max Field Max <QXZ>This setting will mean different things depending on what the field type is. For TEXT, HIDDEN and READONLY fields, the size is the maximum number of characters that are allowed in the field. For AREA fields, this field defines the number of rows of text visible in the text box. For MULTI, SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored.</QXZ>
|
||||
|
||||
Reference in New Issue
Block a user