function get_new_record_form() { require_once 'modules/DynamicLayout/AddField.php'; global $image_path, $mod_strings; global $sugar_version, $sugar_config; if (!empty($_REQUEST['edit_label_MSI']) && !empty($_SESSION['dyn_layout_module'])) { $module_name = $_SESSION['dyn_layout_module']; $html = get_left_form_header($mod_strings['LBL_TOOLBOX']); $html .= <<<EOQ \t<table class="contentBox" cellpadding="0" cellspacing="0" border="0" width="100%" id="sugar_labels_MSI">Sugar Labels <br><iframe name="labeleditor" height='400' id="labeleditor" frameborder="0" width="280" marginwidth="0" marginheight="0" style="border: 1px solid #444444;" src="index.php?module=LabelEditor&action=LabelList&module_name={$module_name}&sugar_body_only=1" ></iframe></td></tr></table> EOQ; $html .= get_left_form_footer(); return $html; } else { if (!empty($_REQUEST['edit_subpanel_MSI']) || empty($_REQUEST['edit_row_MSI']) && empty($_REQUEST['edit_col_MSI']) && $_REQUEST['action'] != 'SelectFile' && !empty($_SESSION['dyn_layout_file'])) { $addfield = new AddField(); if (isset($_SESSION['dyn_layout_file'])) { $the_module = get_module($_SESSION['dyn_layout_file']); } $font_slot = '<IMG src="' . $image_path . 'slot.gif" alt="Slot" border="0" >'; $slot_path = $image_path . "slot.gif"; $html = get_left_form_header($mod_strings['LBL_TOOLBOX']); $add_field_icon = get_image($image_path . "plus_inline", 'style="margin-left:4px;margin-right:4px;" alt="Add Field" border="0" align="absmiddle"'); $minus_field_icon = get_image($image_path . "minus_inline", 'style="margin-left:4px;margin-right:4px;" alt="Add Field" border="0" align="absmiddle"'); $edit_field_icon = get_image($image_path . "edit_inline", 'style="margin-left:4px;margin-right:4px;" alt="Add Field" border="0" align="absmiddle"'); $delete = get_image($image_path . "delete_inline", "border='0' alt='Delete' style='margin-left:4px;margin-right:4px;'"); $show_bin = true; if (isset($_REQUEST['edit_subpanel_MSI'])) { $show_bin = false; } $delete_items = $addfield->get_html(true, $show_bin); $html .= "\n\t<script>\n\tvar slot_path = '{$slot_path}';\n\tvar font_slot = '{$font_slot}';\n\t</script>\n\t<script type=\"text/javascript\" src=\"modules/DynamicLayout/DynamicLayout_3.js?s=" . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . "\">\n\t</script>\n\t<p>\n"; if (isset($_REQUEST['edit_col_MSI'])) { // do nothing } else { if (!isset($_REQUEST['edit_subpanel_MSI'])) { $html .= "\n\t<input type='checkbox' class=\"checkbox\" style='vertical-align: middle;' id='display_html_MSI' name='display_html_MSI' > {$mod_strings['LBL_DISPLAY_HTML']} <br>\n\t<a href='#' onclick='addFieldPOPUP()' class='leftColumnModuleS3Link'>{$add_field_icon}</a> <a href='#' onclick='addFieldPOPUP()' class='leftColumnModuleS3Link'>{$mod_strings['LBL_ADD_FIELDS']}</a>\n\t<br>"; } $html .= "\n\t<a href=\"#\" onclick=\"editCustomFields();\" class='leftColumnModuleS3Link'>{$edit_field_icon}</a>\n\t<a href='#' onclick=\"editCustomFields();\" class='leftColumnModuleS3Link'>{$mod_strings['LBL_EDIT_FIELDS']}</a><br>\n\t\n\t<p>{$delete_items}</p>"; } $html .= get_left_form_footer(); return $html; } } }
********************************************************************************/ require_once 'modules/DynamicFields/DynamicField.php'; $module = $_REQUEST['module_name']; $custom_fields = new DynamicField($module); if (!empty($module)) { $class_name = $beanList[$module]; $class_file = $class_name; if ($class_file == 'aCase') { $class_file = 'Case'; } require_once "modules/{$module}/{$class_file}.php"; $mod = new $class_name(); $custom_fields->setup($mod); } else { echo "\nNo Module Included Could Not Save"; } $name = $_REQUEST['field_label']; $options = ''; if ($_REQUEST['field_type'] == 'enum') { $options = $_REQUEST['options']; } $default_value = ''; $custom_fields->addField($name, $name, $_REQUEST['field_type'], '255', 'optional', $default_value, $options, '', ''); $html = $custom_fields->getFieldHTML($name, $_REQUEST['file_type']); set_register_value('dyn_layout', 'field_counter', $_REQUEST['field_count']); $label = $custom_fields->getFieldLabelHTML($name, $_REQUEST['field_type']); require_once 'modules/DynamicLayout/AddField.php'; $af = new AddField(); $af->add_field($name, $html, $label, 'window.opener.'); echo $af->get_script('window.opener.'); echo "\n<script>window.close();</script>";
$cp = new LabelParser(); $cp->parse_file($file, 'cols'); $view = $cp->get_edit_view(); $prev_mod = $mod_strings; if (!empty($_REQUEST['mod_lang'])) { $mod_strings = return_module_language($current_language, $_REQUEST['mod_lang']); } else { $mod_strings = return_module_language($current_language, $the_module); } $xtpl = write_to_cache($file, $view); include_once $xtpl; $mod_strings = $prev_mod; } else { //otherwise we must be editing field layout \ require_once 'modules/DynamicLayout/AddField.php'; $addfield = new AddField(); if ($fileType != 'other') { require_once 'modules/DynamicFields/DynamicField.php'; if (!empty($_REQUEST['mod_class'])) { $temp_mod = $_REQUEST['mod_class']; $class_name = $beanList[$temp_mod]; $class_file = $beanFiles[$class_name]; require_once $class_file; $customFields = new DynamicField($temp_mod); } else { $class_name = $beanList[$the_module]; $class_file = $beanFiles[$class_name]; require_once $class_file; $customFields = new DynamicField($the_module); } $mod = new $class_name();
function remove_from_add_fields($field) { require_once 'modules/DynamicLayout/AddField.php'; $this->remove_fields .= "\n\n" . AddField::get_remove_from_add_field($field); }
function indexPage() { if (isset($_REQUEST['edit_col_MSI'])) { require_once 'modules/DynamicLayout/plugins/SubPanelColParser.php'; $sp = new SubPanelColParser(); } else { $sp = new SubPanelParser(); } global $beanList, $beanFiles, $mod_strings; //if the last request was a save lets do that $parent_module = $_REQUEST['select_subpanel_module']; $subpanel = $_REQUEST['subpanel']; //$layout_def = SubPanel::getSubPanelDefine($parent_module, $subpanel); if (!empty($_REQUEST['save_subpanel_MSI'])) { $sp->set_subpanel($parent_module, $subpanel); $sp->parse_text(); $file = $sp->save_layout(); } $sp->set_subpanel($parent_module, $subpanel); $sp->parse_text(); echo $sp->get_javascript_swap(); $view = $sp->get_edit_view(); $prev_mod = $mod_strings; echo $sp->get_form(); echo $view; $mod_strings = $prev_mod; $prev_mod = $mod_strings; $slotCount = sizeof($sp->slots); echo "<script> setModuleName('{$sp->child_module}'); setFileType('subpanel'); setSlotCount({$slotCount}); </script>"; require_once 'modules/DynamicLayout/AddField.php'; $addfield = new AddField(); require_once 'modules/DynamicFields/DynamicField.php'; $submodulename = $sp->panel->_instance_properties['module']; $submoduleclass = $beanList[$submodulename]; require_once $beanFiles[$submoduleclass]; $child_module = new $submoduleclass(); $customFields = new DynamicField($child_module); $customFields->setup($child_module); $result = $customFields->getAllBeanFieldsView('list', 'html'); foreach ($result as $f_name => $f_field) { if (isset($child_module->field_defs[$f_name]['vname'])) { $addfield->add_field_no_label($f_name, translate($child_module->field_defs[$f_name]['vname'], 'Contacts'), '', 'sugar_fields_MSI', true); } } echo $addfield->get_script(); }