コード例 #1
0
ファイル: Save.php プロジェクト: sysraj86/carnivalcrm
 ********************************************************************************/
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>";
コード例 #2
0
         $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();
     $customFields->setup($mod);
     $result = $customFields->getAllBeanFieldsView($fileType, 'html');
     foreach ($result as $f_name => $f_field) {
         $addfield->add_field($f_name, $f_field['html'], $f_field['label'], '', 'sugar_fields_MSI');
     }
 }
 $deleteFields->load_deleted_fields();
 foreach ($deleteFields->deleted_fields as $dl) {
     $addfield->add_deleted_field($dl);
 }
 $sp->parse_file($file);
 echo $sp->get_javascript_swap();
 //$view = str_replace('<!-- END: main -->',  $addfield->get_script()."\n<!-- END: main -->", $sp->get_edit_view() );
 echo $addfield->get_script();
 $view = $sp->get_edit_view();
 $slotCount = sizeof($sp->slots);
 echo "<script> setModuleName('{$the_module}'); setFileType('{$fileType}'); setSlotCount({$slotCount}); </script>";
 echo $sp->get_form();
 $prev_mod = $mod_strings;