$formdata[$arr['title']]['parent_class'] = 'free_space'; } if ($arr_tmp['label_before']) { $formdata[$arr['title']]['label_before'] = $arr_tmp['label_before']; } if ($arr_tmp['label_head']) { $formdata[$arr['title']]['label_head'] = $arr_tmp['label_head']; } if ($arr_tmp['label_after']) { if ($arr['type'] == 'checkbox') { $formdata[$arr['title']]['settings']['data'] = array('1' => v('CMT_' . strtoupper($arr_tmp['label_after']))); } else { $formdata[$arr['title']]['label_after'] = $arr_tmp['label_after']; } } $field_type = get_field_type($arr_tmp['id_field']); if ($field_type == 'int' or $field_type == 'text' or $field_type == 'textarea' or $field_type == 'select') { if ($arr_tmp['align'] != 'none') { $formdata[$arr['title']]['style']['class'] = "align-" . $arr_tmp['align']; } else { $formdata[$arr['title']]['style']['class'] = "align-left"; } if ($arr_tmp['max_columns']) { $formdata[$arr['title']]['style']['class'] .= " col-" . $arr_tmp['max_columns'] . "_of_7"; } else { $formdata[$arr['title']]['style']['class'] .= " col-6_of_7"; } if ($arr_tmp['max_width'] != 0) { $formdata[$arr['title']]['style']['width'] = $arr_tmp['max_width']; } if ($field_type == 'textarea') {
/** * Вывод шаблона рубрики * * @param int $show * @param int $extern */ function rubricTemplateShow($show = '', $extern = '0') { global $AVE_DB, $AVE_Template; if ($extern == 1) { $fetchId = isset($_REQUEST['rubric_id']) && is_numeric($_REQUEST['rubric_id']) ? $_REQUEST['rubric_id'] : 0; } else { $fetchId = isset($_REQUEST['Id']) && is_numeric($_REQUEST['Id']) ? $_REQUEST['Id'] : 0; } $row = $AVE_DB->Query("\r\n\t\t\tSELECT\r\n\t\t\t\trubric_title,\r\n\t\t\t\trubric_template\r\n\t\t\tFROM " . PREFIX . "_rubrics\r\n\t\t\tWHERE Id = '" . $fetchId . "'\r\n\t\t")->FetchRow(); $tags = array(); $ddid = array(); $sql = $AVE_DB->Query("\r\n\t\t\tSELECT *\r\n\t\t\tFROM " . PREFIX . "_rubric_fields\r\n\t\t\tWHERE rubric_id = '" . $fetchId . "'\r\n\t\t\tORDER BY rubric_field_position ASC\r\n\t\t"); while ($row_rf = $sql->FetchRow()) { array_push($tags, $row_rf); if ($row_rf->rubric_field_type == 'dropdown') { array_push($ddid, $row_rf->Id); } } $sql->Close(); $AVE_Template->assign('feld_array', get_field_type()); if ($show == 1) { $row->rubric_template = stripslashes($_POST['rubric_template']); } if ($extern == 1) { $AVE_Template->assign('tags_row', $row); $AVE_Template->assign('tags', $tags); $AVE_Template->assign('ddid', implode(',', $ddid)); } else { $AVE_Template->assign('row', $row); $AVE_Template->assign('tags', $tags); $AVE_Template->assign('formaction', 'index.php?do=rubs&action=template&sub=save&Id=' . $fetchId . '&cp=' . SESSION); $AVE_Template->assign('content', $AVE_Template->fetch('rubs/form.tpl')); } }
function clean_save_data($target_module, $action_array) { global $app_list_strings; if (empty($app_list_strings)) { global $sugar_config; $app_list_strings = return_app_list_strings_language($sugar_config['default_language']); } foreach ($target_module->column_fields as $field) { if (empty($target_module->{$field})) { $data_cleaned = false; if ($target_module->field_defs[$field]['type'] == 'bool') { $target_module->{$field} = 0; $data_cleaned = true; } if (isset($target_module->field_defs[$field]['auto_increment']) && $target_module->field_defs[$field]['auto_increment']) { $target_module->{$field} = null; $data_cleaned = true; } // make sure there are options, some enums based on functions don't have options set if ($target_module->field_defs[$field]['type'] == 'enum' && isset($target_module->field_defs[$field]['options'])) { $options_array_name = $target_module->field_defs[$field]['options']; $target_module->{$field} = key($app_list_strings[$options_array_name]); $data_cleaned = true; //end if type is enum } if ($target_module->field_defs[$field]['name'] == 'duration_hours' || $target_module->field_defs[$field]['name'] == 'duration_minutes') { $target_module->{$field} = '0'; $data_cleaned = true; //end if duration hours or minutes from calls module } if (($target_module->field_defs[$field]['name'] == 'date_start' || $target_module->field_defs[$field]['name'] == 'time_start') && ($target_module->object_name == "Call" || $target_module->object_name == "Meeting")) { $target_module->{$field} = get_expiry_date(get_field_type($target_module->field_defs[$field]), 0); if ($target_module->field_defs[$field]['type'] == 'date' && !empty($target_module->field_defs[$field]['rel_field'])) { $rel_field = $target_module->field_defs[$field]['rel_field']; $target_module->{$rel_field} = get_expiry_date('time', $action_array['basic'][$field]); } $data_cleaned = true; } if ($target_module->field_defs[$field]['name'] == 'date_entered') { $data_cleaned = true; } if ($target_module->field_defs[$field]['name'] == "name") { //make sure you set the 'name' to blank, otherwise you won't be able //to go into the record $target_module->{$field} = " - blank - "; $data_cleaned = true; } if ($data_cleaned == false) { //try to fill with default if available if (!empty($target_module->field_defs[$field]['default'])) { $target_module->{$field} = $target_module->field_defs[$field]['default']; } else { //fill in with blank value $target_module->{$field} = ""; } } //end if not empty } //end foreach } //end function clean_save_data }
$sql = "SELECT * FROM accounts LIMIT 1"; $row = mysql_fetch_assoc(mysql_unbuffered_query($sql)); $fieldnames = array_keys($row); for ($i = 0; $i < count($fieldnames); $i++) { // FIELDS ACCOUNTID FIELD if ($fieldnames[$i] != 'accountid') { echo "<tr valign=\"top\">"; echo "<td>" . str_replace(" ", " ", ucwords(str_replace("_", " ", $fieldnames[$i]))) . ":</td>"; echo "<td>"; if ($fieldnames[$i] == "password") { echo "<input type=\"password\" name=\"" . $fieldnames[$i] . "\" size=\"50\"/>"; } elseif ($fieldnames[$i] == "phone_number" || $fieldnames[$i] == "fax") { echo "<input type=\"text\" name=\"" . $fieldnames[$i] . "\" size=\"50\" onkeyup=\"inputmask(this.value,this,'phone');\" maxlength=\"12\"/>"; } elseif ($fieldnames[$i] == "zip") { echo "<input type=\"text\" name=\"" . $fieldnames[$i] . "\" size=\"50\" onkeyup=\"inputmask(this.value,this,'zip');\" maxlength=\"5\"/>"; } elseif (get_field_type("accounts", $fieldnames[$i]) == "enum") { echo "<select name=\"" . $fieldnames[$i] . "\">"; $vals = get_enum("accounts", $fieldnames[$i]); for ($j = 0; $j < count($vals); $j++) { echo "<option value=\"" . $vals[$j] . "\""; echo ">" . $vals[$j] . "</option>"; } echo "</select>"; } else { echo "<input type=\"text\" name=\"" . $fieldnames[$i] . "\" size=\"50\"/>"; } echo "</td>"; echo "</tr>"; } } echo "<tr><td> </td><td><input type='submit' name='submitaccount' value='Create Account'/></td></tr>";
function get_field_info($table, $field, $db = NULL) { if ($data = get_data("SHOW COLUMNS FROM `" . $table . "`", $db)) { foreach ($data as $line) { if ($line['Field'] == $field) { $line['Length'] = get_field_length($line['Type']); $line['Type'] = get_field_type($line['Type']); return $line; } } return false; } return false; }
if ($webservice_result == null && $login_result == 'Success') { $process_result = set_notice_data($result[$action]['notice'], $result[$action]['field'], $date, $result[$action]['value'], $operation, $argument); } break; case 'createnotice': if ($webservice_result == null && $login_result == 'Success') { $result[$action]['notice'] = create_notice(); $process_result = 'Success'; } else { $result[$action]['notice'] = 'undefined'; } break; case 'noticefield': $result[$action]['field'] = get_param('field'); if ($webservice_result == null) { $result[$action]['fieldtype'] = get_field_type($result[$action]['field']); $result[$action]['fieldvalue'] = get_field_values($result[$action]['field']); $process_result = 'Success'; } else { $result[$action]['fieldtype'] = 'undefined'; $result[$action]['fieldvalue'] = 'undefined'; } break; case 'extractcredits': if ($webservice_result == null) { $result[$action]['filename'] = extract_credits(); $process_result = 'Success'; } else { $result[$action]['filename'] = 'undefined'; $result[$action]['value'] = 'undefined'; }
} if (!isset($max_columns)) { $max_columns = 0; } if (!isset($max_width)) { $max_width = 0; } if (!isset($max_rows)) { $max_rows = 0; } $formdata['label'] = array('type' => 'text', 'label' => v('CMT_LABEL'), 'style' => array('class' => "col-3_of_7")); if ($id_field != 0) { $formdata['label_before'] = array('type' => 'text', 'label' => v('CMT_LABEL'), 'label_after' => v('CMT_LABEL_BEFORE'), 'style' => array('class' => "col-3_of_7")); $formdata['label_after'] = array('type' => 'text', 'label' => v('CMT_LABEL'), 'label_after' => v('CMT_LABEL_AFTER'), 'style' => array('class' => "col-3_of_7")); $formdata['label_head'] = array('type' => 'text', 'label' => v('CMT_LABEL'), 'label_after' => v('CMT_LABEL_HEAD'), 'style' => array('class' => "col-3_of_7")); $field_type = get_field_type($id_field); if ($field_type != 'datepicker') { if ($field_type == 'int') { if (isset($align) && $align == 'none') { $align = 'right'; } } else { if (isset($align) && $align == 'none') { $align = 'left'; } } if ($field_type != 'select') { $formdata['align'] = array('type' => 'select', 'label' => v('CMT_ALIGN'), 'settings' => array('data' => array('left' => v('CMT_ALIGN_LEFT'), 'right' => v('CMT_ALIGN_RIGHT'), 'center' => v('CMT_ALIGN_CENTER'))), 'style' => array('class' => "col-3_of_7")); } $formdata['next_row'] = array('type' => 'checkbox', 'label' => v('CMT_NEXT_ROW')); $formdata['max_columns'] = array('type' => 'text', 'label' => v('CMT_COLUMNS'), 'label_after' => '1-7', 'style' => array('class' => 'align-right col-1_of_7'));
if ($fieldnames[$i] == "email" || $fieldnames[$i] == "phone_number" || $fieldnames[$i] == "name" || $fieldnames[$i] == "project_name" || $fieldnames[$i] == "quantity") { echo "<font color=\"#B80009\"><sup>*</sup></font>"; } echo " </td>"; echo "<td>"; if ($fieldnames[$i] == "design_file") { echo "<input type=\"file\" name=\"" . $fieldnames[$i] . "\"/><br><i>Please review our drawing <a href=\"#\" onclick=\"window.open('/filespecs.php','filespecs','status=0,toolbar=0,location=0,resizeable=1,scrollbars=1,menubar=0,directories=0,height=500,width=600');\">file requirements</a>.</i>"; } elseif ($fieldnames[$i] == "phone_number" || $fieldnames[$i] == "fax") { echo "<input type=\"text\" name=\"" . $fieldnames[$i] . "\" value=\"" . formvalue($account[$fieldnames[$i]]) . "\" size=\"{$inputsize}\" onkeyup=\"inputmask(this.value,this,'phone');\" maxlength=\"12\"/>"; } elseif ($fieldnames[$i] == "zip") { echo "<input type=\"text\" name=\"" . $fieldnames[$i] . "\" value=\"" . formvalue($account[$fieldnames[$i]]) . "\" size=\"{$inputsize}\" onkeyup=\"inputmask(this.value,this,'zip');\" maxlength=\"5\"/>"; } elseif (get_field_type("quotes", $fieldnames[$i]) == "text") { echo "<textarea name=\"" . $fieldnames[$i] . "\" cols=\"40\" rows=\"7\">" . formvalue($account[$fieldnames[$i]]) . "</textarea>"; } elseif (get_field_type("quotes", $fieldnames[$i]) == "int") { echo "<input type=\"text\" name=\"" . $fieldnames[$i] . "\" value=\"" . formvalue($account[$fieldnames[$i]]) . "\" size=\"{$inputsize}\" maxlength=\"7\" onkeyup=\"inputmask(this.value,this,'int');\"/>"; } elseif (get_field_type("quotes", $fieldnames[$i]) == "enum") { echo "<select name=\"" . $fieldnames[$i] . "\">"; $vals = get_enum("quotes", $fieldnames[$i]); for ($j = 0; $j < count($vals); $j++) { echo "<option value=\"" . $vals[$j] . "\""; if ($vals[$j] == $account[$fieldnames[$i]]) { echo " selected=\"selected\""; } echo ">" . $vals[$j] . "</option>"; } echo "</select>"; } else { echo "<input type=\"text\" name=\"" . $fieldnames[$i] . "\" value=\"" . formvalue($account[$fieldnames[$i]]) . "\" size=\"{$inputsize}\"/>"; } echo "</td></tr>\n"; }
function get_field_output(&$temp_module, $selector_array, $meta_array, $actions = false) { global $current_language; global $app_list_strings; global $app_strings; global $mod_strings; $enum_multi = $meta_array['enum_multi']; $temp_module_strings = return_module_language($current_language, $temp_module->module_dir); $all_fields_array = $temp_module->getFieldDefinitions(); $target_field_array = $all_fields_array[$selector_array['field']]; if (!empty($target_field_array['vname'])) { $target_vname = $target_field_array['vname']; } else { $target_vname = ""; } $label_name = get_label($target_vname, $temp_module_strings); $field_type = get_field_type($target_field_array); $field_name = $target_field_array['name']; //////Determine if this is called from an existing record or new and if it is enum multi if ($selector_array['target_field'] == $field_name) { if (($selector_array['operator'] == "in" || $selector_array['operator'] == "not_in") && $selector_array['target_field'] == $field_name || isset($target_field_array['isMultiSelect']) && $target_field_array['isMultiSelect'] == true) { $selected_value = unencodeMultienum($selector_array['value']); $selected_operator = $selector_array['operator']; $selected_time = $selector_array['time']; } else { $selected_value = $selector_array['value']; $selected_operator = $selector_array['operator']; $selected_time = $selector_array['time']; } //Handle Advanced Actions Type if ($actions == true) { $selected_ext1 = $selector_array['ext1']; $selected_ext2 = $selector_array['ext2']; $selected_ext3 = $selector_array['ext3']; } } else { $selected_value = ""; $selected_operator = ""; $selected_time = ""; //Handle Advanced Actions Type if ($actions == true) { $selected_ext1 = ""; $selected_ext2 = ""; $selected_ext3 = ""; } } /////////////////////////////////////////////////////////// //Get output array and return it ////////////////////////////////////////////////////////// $output_array = array(); if ($actions == true) { $output_array['ext1']['display'] = ""; $output_array['ext2']['display'] = ""; $output_array['ext3']['display'] = ""; } if (!empty($field_type)) { /* One off check to see if this is duration_hours or duration_minutes These two fields really should be enum, but they are chars. This is a problem, since the UI for calls is really enum in 15 minute increments */ $sorted_fields = array(); if ($selector_array['target_field'] == "duration_minutes") { $target_field_array['options'] = "duration_intervals"; $field_type = "enum"; //if the module is calls, then populate sorted_fields array with minute values if (get_class($temp_module) == 'Call' && isset($temp_module->minutes_values)) { $target_field_array['function'] = ''; $sorted_fields = $temp_module->minutes_values; } //end if target_field is duration_minutes or duration_hours } //Checking reminder time in meetings and calls if ($selector_array['target_field'] == "reminder_time") { $target_field_array['options'] = "reminder_time_options"; $field_type = "enum"; //end if target_field is reminder_time } // currency_id field should be enum if ($field_type == 'currency_id') { $target_field_array['function'] = 'getCurrencyDropDownList'; $field_type = "enum"; } if ($field_type == "enum" || $field_type == "multienum" || $field_type == "radioenum") { $output_array['real_type'] = $field_type; //check for multi_select and that this is the same dropdown as previous; //Set the value select if (!empty($target_field_array['function'])) { $function = $target_field_array['function']; if (is_array($function) && isset($function['name'])) { $function = $target_field_array['function']['name']; } else { $function = $target_field_array['function']; } if (!empty($target_field_array['function']['returns']) && $target_field_array['function']['returns'] == 'html') { if (!empty($target_field_array['function']['include'])) { require_once $target_field_array['function']['include']; } } if (isset($target_field_array['function_bean'])) { $funcBean = BeanFactory::getBean($target_field_array['function_bean']); if (method_exists($funcBean, $function)) { $function = array($funcBean, $function); } } $sorted_fields = call_user_func($function); } else { //get list of strings if sorted fields has not already been populated if (count($sorted_fields) == 0) { $sorted_fields = $app_list_strings[$target_field_array['options']]; } } if (isset($sorted_fields)) { asort($sorted_fields); } $column_select = get_select_options_with_id($sorted_fields, $selected_value); //if(!empty($target_field_array['isMultiSelect']) && $target_field_array['isMultiSelect'] == true){ // $selected_operator = "in"; // $enum_multi = true; //} $isMultiSelect = false; $value_select = "<select id='" . $meta_array['parent_type'] . "__field_value' name='" . $meta_array['parent_type'] . "_field_value' tabindex='2'>" . $column_select . "</select>"; if ($enum_multi === true) { $value_select .= " <select id='" . $meta_array['parent_type'] . "__field_value_multi' tabindex='1' name='" . $meta_array['parent_type'] . "__field_value_multi[]' multiple size='5'>" . $column_select . "</select>"; } else { if (!empty($target_field_array['isMultiSelect']) && $target_field_array['isMultiSelect'] == true) { //$value_select = "<select id='".$meta_array['parent_type']."__field_value' name='".$meta_array['parent_type']."_field_value[]' tabindex='2' multiple size='5'>".$column_select."</select>"; $value_select = " <select id='" . $meta_array['parent_type'] . "__field_value_multi' tabindex='1' name='" . $meta_array['parent_type'] . "__field_value_multi[]' multiple size='5'>" . $column_select . "</select>"; $isMultiSelect = true; } } $output_array['value_select']['display'] = $value_select; //Set the Operator variables if ($enum_multi === true) { $operator_select_javascript = "onchange=\"toggleFieldDisplay('" . $meta_array['parent_type'] . "__operator', '" . $meta_array['parent_type'] . "__field_value', '" . $meta_array['parent_type'] . "__field_value_multi', 'Equals');\""; $javascript_start = "toggleFieldDisplay('" . $meta_array['parent_type'] . "__operator', '" . $meta_array['parent_type'] . "__field_value', '" . $meta_array['parent_type'] . "__field_value_multi', 'Equals'); \n"; } else { $operator_select_javascript = ""; $javascript_start = ""; } if ($enum_multi === true) { $operator = get_select_options_with_id($app_list_strings['mselect_type_dom'], $selected_operator); } else { if ($isMultiSelect) { $operator = get_select_options_with_id($app_list_strings['mselect_multi_type_dom'], $selected_operator); } else { $operator = get_select_options_with_id($app_list_strings['cselect_type_dom'], $selected_operator); } } $output_array['operator']['display'] = $operator; $output_array['operator']['jscript'] = $operator_select_javascript; $output_array['operator']['jscriptstart'] = $javascript_start; $time_select = get_select_options_with_id($app_list_strings['tselect_type_dom'], $selected_time); $output_array['time_select']['display'] = $mod_strings['LBL_TIME_INT'] . " <select id='time_int' name='time_int' tabindex='2'>" . $time_select . "</select>"; if ($actions == true) { $ext1_select = get_select_options_with_id($app_list_strings['wflow_adv_enum_type_dom'], $selected_ext1); $ext1_select = "<select id='" . $meta_array['parent_type'] . "__ext1' id='" . $meta_array['parent_type'] . "__ext1' tabindex='2'>" . $ext1_select . "</select>"; $output_array['adv_value']['display'] = $ext1_select; $value_select = " <input id='" . $meta_array['parent_type'] . "__adv_value' name='" . $meta_array['parent_type'] . "__adv_value' tabindex='1' size='2' maxlength='2' type='text' value='" . $selected_value . "'> step(s)"; $adv_select = $value_select; $output_array['adv_value']['display'] .= $adv_select; $output_array['adv_type']['display'] = "enum_step"; //exception handler for some advanced options not valid if this is a new record if (!empty($meta_array['action_type'])) { if ($meta_array['action_type'] == "new" || $meta_array['action_type'] == "new_rel") { $output_array['set_type']['disabled'] = "Disabled"; } } } //end type enum } if ($field_type == "char" || $field_type == "varchar" || $field_type == "encrypt" || $field_type == "name" || $field_type == "phone" || $field_type == "email" || $field_type == "url") { $output_array['real_type'] = $field_type; if (!empty($target_field_array['len'])) { $max_length = $target_field_array['len']; } else { $max_length = "50"; } $value_select = "<input id='" . $meta_array['parent_type'] . "__field_value' name='" . $meta_array['parent_type'] . "__field_value' tabindex='1' size='25' maxlength='" . $max_length . "' type='text' value='" . $selected_value . "'>"; $output_array['value_select']['display'] = $value_select; $operator = get_select_options_with_id($app_list_strings['cselect_type_dom'], $selected_operator); $output_array['operator']['display'] = $operator; $time_select = get_select_options_with_id($app_list_strings['tselect_type_dom'], $selected_time); $output_array['time_select']['display'] = $mod_strings['LBL_TIME_INT'] . " <select id='time_int' name='time_int' tabindex='2'>" . $time_select . "</select>"; $output_array['operator']['jscript'] = ""; $output_array['operator']['jscriptstart'] = ""; $output_array['set_type']['disabled'] = "Disabled"; if ($actions == true) { $output_array['adv_type']['display'] = ""; $output_array['adv_value']['display'] = ""; } //end if type char, varchar, or float } if ($field_type == "text") { $output_array['real_type'] = $field_type; $value_select = "<textarea id='" . $meta_array['parent_type'] . "__field_value' name='" . $meta_array['parent_type'] . "__field_value' tabindex='1' cols=\"40\" rows=\"3\">" . $selected_value . "</textarea>"; //$value_select = "<input id='".$meta_array['parent_type']."__field_value' name='".$meta_array['parent_type']."__field_value' tabindex='1' size='25' maxlength='".$max_length."' type='text' value='".$selected_value."'>"; $output_array['value_select']['display'] = $value_select; $operator = get_select_options_with_id($app_list_strings['cselect_type_dom'], $selected_operator); $output_array['operator']['display'] = $operator; $time_select = get_select_options_with_id($app_list_strings['tselect_type_dom'], $selected_time); $output_array['time_select']['display'] = $mod_strings['LBL_TIME_INT'] . " <select id='time_int' name='time_int' tabindex='2'>" . $time_select . "</select>"; $output_array['operator']['jscript'] = ""; $output_array['operator']['jscriptstart'] = ""; $output_array['set_type']['disabled'] = "Disabled"; if ($actions == true) { $output_array['adv_type']['display'] = ""; $output_array['adv_value']['display'] = ""; } //end field_type == text } if ($field_type == "datetimecombo" || $field_type == "datetime" || $field_type == "date" || $field_type == "time") { //coming here via actions or triggers? if ($actions == true) { $column_select = get_select_options_with_id($app_list_strings['tselect_type_dom'], $selected_value); $value_select = "<select id='" . $meta_array['parent_type'] . "__field_value' name='" . $meta_array['parent_type'] . "_field_value' tabindex='2'>" . $column_select . "</select>"; //current date or existing //check if this is action new or new_rel and if so, remove the Existing Value optino //since it is not applicable $temp_dom = $app_list_strings['wflow_action_datetime_type_dom']; if ($meta_array['action_type'] == "new" || $meta_array['action_type'] == "new_rel") { unset($temp_dom['Existing Value']); } $ext1_select = get_select_options_with_id($temp_dom, $selected_ext1); $ext1_select = " from <select id='" . $meta_array['parent_type'] . "__ext1' id='" . $meta_array['parent_type'] . "__ext1' tabindex='2'>" . $ext1_select . "</select>"; $value_select .= $ext1_select; $output_array['value_select']['display'] = $value_select; $output_array['set_type']['disabled'] = "Disabled"; $output_array['adv_type']['display'] = "datetime"; $output_array['adv_value']['display'] = ""; $output_array['real_type'] = $field_type; } else { $operator = get_select_options_with_id($app_list_strings['dtselect_type_dom'], $selected_operator); $output_array['operator']['display'] = $operator; $operator_select_javascript = "onchange=\"toggleFieldDisplay('" . $meta_array['parent_type'] . "__operator', '" . $meta_array['parent_type'] . "__time_past', '" . $meta_array['parent_type'] . "__time_future', 'More Than');\""; $javascript_start = "toggleFieldDisplay('" . $meta_array['parent_type'] . "__operator', '" . $meta_array['parent_type'] . "__time_past', '" . $meta_array['parent_type'] . "__time_future', 'More Than'); \n"; $time_select = get_select_options_with_id($app_list_strings['tselect_type_dom'], $selected_time); $output_array['time_select']['display'] = "<select id='time_int' name='time_int' tabindex='2'>" . $time_select . "</select> "; $output_array['time_select']['display'] .= "<span id='" . $meta_array['parent_type'] . "__time_past'>" . $mod_strings['LBL_TIME_PAST'] . "</span>"; $output_array['time_select']['display'] .= "<span id='" . $meta_array['parent_type'] . "__time_future'>" . $mod_strings['LBL_TIME_FUTURE'] . "</span>"; $output_array['operator']['jscript'] = $operator_select_javascript; $output_array['operator']['jscriptstart'] = $javascript_start; $output_array['set_type']['disabled'] = "Disabled"; $output_array['value_select']['display'] = ""; $output_array['real_type'] = $field_type; } //end if type datetime } if ($field_type == "assigned_user_name" || $field_name == 'assigned_user_id') { //Real type is just a surface variable used by javascript to determine dual type actions //in the javascript $output_array['real_type'] = "enum"; //check for multi_select and that this is the same dropdown as previous; //Set the value select $user_array = get_user_array(TRUE, "Active", "", true, null, ' AND is_group=0 '); //$column_select = get_select_options_with_id($app_list_strings[$target_field_array['options']], $selected_value); $column_select = get_select_options_with_id($user_array, $selected_value); $value_select = "<select id='" . $meta_array['parent_type'] . "__field_value' name='" . $meta_array['parent_type'] . "_field_value' tabindex='2'>" . $column_select . "</select>"; if ($enum_multi === true) { $value_select .= " <select id='" . $meta_array['parent_type'] . "__field_value_multi' tabindex='1' name='" . $meta_array['parent_type'] . "__field_value_multi[]' multiple size='5'>" . $column_select . "</select>"; } $output_array['value_select']['display'] = $value_select; //Set the Operator variables if ($enum_multi === true) { $operator_select_javascript = "onchange=\"toggleFieldDisplay('" . $meta_array['parent_type'] . "__operator', '" . $meta_array['parent_type'] . "__field_value', '" . $meta_array['parent_type'] . "__field_value_multi', 'Equals');\""; $javascript_start = "toggleFieldDisplay('" . $meta_array['parent_type'] . "__operator', '" . $meta_array['parent_type'] . "__field_value', '" . $meta_array['parent_type'] . "__field_value_multi', 'Equals'); \n"; } else { $operator_select_javascript = ""; $javascript_start = ""; } if ($enum_multi === true) { $operator = get_select_options_with_id($app_list_strings['mselect_type_dom'], $selected_operator); } else { $operator = get_select_options_with_id($app_list_strings['cselect_type_dom'], $selected_operator); } $output_array['operator']['display'] = $operator; $output_array['operator']['jscript'] = $operator_select_javascript; $output_array['operator']['jscriptstart'] = $javascript_start; $time_select = get_select_options_with_id($app_list_strings['tselect_type_dom'], $selected_time); $output_array['time_select']['display'] = $mod_strings['LBL_TIME_INT'] . " <select id='time_int' name='time_int' tabindex='2'>" . $time_select . "</select>"; ///If we are coming here for actions if ($actions == true) { ////This below is an exception handler flow statement //if this is time based, then don't include the logged in user, since it doesn't really apply if (!empty($meta_array['workflow_type']) && $meta_array['workflow_type'] == "Time") { $adv_user_array = $app_list_strings['wflow_adv_user_type_dom']; unset($adv_user_array['current_user']); //end if this is a time based object } else { $adv_user_array = $app_list_strings['wflow_adv_user_type_dom']; } $adv_select = get_select_options_with_id($adv_user_array, $selected_value); $adv_select = "<select id='" . $meta_array['parent_type'] . "__adv_value' id='" . $meta_array['parent_type'] . "__adv_value' tabindex='2'>" . $adv_select . "</select>"; $output_array['adv_value']['display'] = $adv_select; $ext1_select = get_select_options_with_id($app_list_strings['wflow_relate_type_dom'], $selected_ext1); $ext1_select = " <select id='" . $meta_array['parent_type'] . "__ext1' id='" . $meta_array['parent_type'] . "__ext1' tabindex='2'>" . $ext1_select . "</select>"; $output_array['adv_value']['display'] .= $ext1_select; $output_array['adv_type']['display'] = "exist_user"; } //end if type assigned_user_id } if ($field_type == "team_list") { //Real type is just a surface variable used by javascript to determine dual type actions //in the javascript $output_array['real_type'] = "enum"; //check for multi_select and that this is the same dropdown as previous; //Set the value select $column_select = get_select_options_with_id(get_team_array(), $selected_value); $value_select = "<select id='" . $meta_array['parent_type'] . "__field_value' name='" . $meta_array['parent_type'] . "_field_value' tabindex='2'>" . $column_select . "</select>"; if ($enum_multi === true) { $value_select .= " <select id='" . $meta_array['parent_type'] . "__field_value_multi' tabindex='1' name='" . $meta_array['parent_type'] . "__field_value_multi[]' multiple size='5'>" . $column_select . "</select>"; } $output_array['value_select']['display'] = $value_select; //Set the Operator variables if ($enum_multi === true) { $operator_select_javascript = "onchange=\"toggleFieldDisplay('" . $meta_array['parent_type'] . "__operator', '" . $meta_array['parent_type'] . "__field_value', '" . $meta_array['parent_type'] . "__field_value_multi', 'Equals');\""; $javascript_start = "toggleFieldDisplay('" . $meta_array['parent_type'] . "__operator', '" . $meta_array['parent_type'] . "__field_value', '" . $meta_array['parent_type'] . "__field_value_multi', 'Equals'); \n"; } else { $operator_select_javascript = ""; $javascript_start = ""; } if ($enum_multi === true) { $operator = get_select_options_with_id($app_list_strings['mselect_type_dom'], $selected_operator); } else { $operator = get_select_options_with_id($app_list_strings['cselect_type_dom'], $selected_operator); } $output_array['operator']['display'] = $operator; $output_array['operator']['jscript'] = $operator_select_javascript; $output_array['operator']['jscriptstart'] = $javascript_start; $time_select = get_select_options_with_id($app_list_strings['tselect_type_dom'], $selected_time); $output_array['time_select']['display'] = $mod_strings['LBL_TIME_INT'] . " <select id='time_int' name='time_int' tabindex='2'>" . $time_select . "</select>"; //if we are coming here to get actions if ($actions == true) { //exception handler. if the workflow type is time, then don't allow logged in user's team to be picked if (!empty($meta_array['workflow_type']) && $meta_array['workflow_type'] == "Time") { $adv_team_array = $app_list_strings['wflow_adv_team_type_dom']; unset($adv_team_array['current_team']); //end if this is a time based object } else { $adv_team_array = $app_list_strings['wflow_adv_team_type_dom']; } $adv_select = get_select_options_with_id($adv_team_array, $selected_value); $adv_select = "<select id='" . $meta_array['parent_type'] . "__adv_value' id='" . $meta_array['parent_type'] . "__adv_value' tabindex='2'>" . $adv_select . "</select>"; $output_array['adv_value']['display'] = $adv_select; $output_array['adv_type']['display'] = "exist_team"; } //end if type team_list } if ($field_type == "bool") { //Real type is just a surface variable used by javascript to determine dual type actions //in the javascript $output_array['real_type'] = $field_type; $column_select = get_select_options_with_id($app_list_strings['bselect_type_dom'], $selected_value); $value_select = "<select id='" . $meta_array['parent_type'] . "__field_value' name='" . $meta_array['parent_type'] . "__field_value' tabindex='2'>" . $column_select . "</select>"; $output_array['value_select']['display'] = $value_select; $operator = get_select_options_with_id($app_list_strings['bopselect_type_dom'], $selected_operator); $output_array['operator']['display'] = $operator; $time_select = get_select_options_with_id($app_list_strings['tselect_type_dom'], $selected_time); $output_array['time_select']['display'] = $mod_strings['LBL_TIME_INT'] . " <select id='time_int' name='time_int' tabindex='2'>" . $time_select . "</select>"; $output_array['operator']['jscript'] = ""; $output_array['operator']['jscriptstart'] = ""; $output_array['set_type']['disabled'] = "Disabled"; if ($actions == true) { $output_array['adv_type']['display'] = ""; $output_array['adv_value']['display'] = ""; } //end if type datetime } if ($field_type == "float" || $field_type == "int" || $field_type == "num" || $field_type == "decimal" || $field_type == "double" || $field_type == "currency") { //Real type is just a surface variable used by javascript to determine dual type actions //in the javascript $output_array['real_type'] = $field_type; if ($field_type == "int") { $length = 11; } else { $length = 25; } $value_select = "<input id='" . $meta_array['parent_type'] . "__field_value' name='" . $meta_array['parent_type'] . "__field_value' tabindex='1' size='" . $length . "' maxlength='" . $length . "' type='text' value='" . $selected_value . "'>"; $output_array['value_select']['display'] = $value_select; $operator = get_select_options_with_id($app_list_strings['dselect_type_dom'], $selected_operator); $output_array['operator']['display'] = $operator; $time_select = get_select_options_with_id($app_list_strings['tselect_type_dom'], $selected_time); $output_array['time_select']['display'] = $mod_strings['LBL_TIME_INT'] . " <select id='time_int' name='time_int' tabindex='2'>" . $time_select . "</select>"; $output_array['operator']['jscript'] = ""; $output_array['operator']['jscriptstart'] = ""; ///If we are coming here for actions if ($actions == true) { $ext1_select = get_select_options_with_id($app_list_strings['query_calc_oper_dom'], $selected_ext1); $ext1_select = "existing value <select id='" . $meta_array['parent_type'] . "__ext1' id='" . $meta_array['parent_type'] . "__ext1' tabindex='2'>" . $ext1_select . "</select>"; $output_array['adv_value']['display'] = $ext1_select; $value_select = " <input id='" . $meta_array['parent_type'] . "__adv_value' name='" . $meta_array['parent_type'] . "__adv_value' tabindex='1' size='5' maxlength='5' type='text' value='" . $selected_value . "'>"; $adv_select = $value_select; $output_array['adv_value']['display'] .= $adv_select; $output_array['adv_type']['display'] = "value_calc"; //exception handler for some advanced options not valid if this is a new record if (!empty($meta_array['action_type'])) { if ($meta_array['action_type'] == "new" || $meta_array['action_type'] == "new_rel") { $output_array['set_type']['disabled'] = "Disabled"; } } //end if actions is true } //end if type float } //end if type is set } $output_array['type'] = $field_type; $output_array['name'] = $label_name; return $output_array; //end function get_output_array }