function getForm($prefix, $mod = '', $form = '')
    {
        if (!ACLController::checkAccess('ProspectLists', 'edit', true)) {
            return '';
        }
        if (!empty($mod)) {
            global $current_language;
            $mod_strings = return_module_language($current_language, $mod);
        } else {
            global $mod_strings;
        }
        global $app_strings, $current_user;
        $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
        $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
        $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
        $user_id = $current_user->id;
        $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
        $the_form .= <<<EOQ
\t\t<form name="{$prefix}ProspectListSave" onSubmit="return check_form('{$prefix}ProspectListSave');" method="POST" action="index.php">
\t\t\t<input type="hidden" name="{$prefix}module" value="ProspectLists">
\t\t\t<input type="hidden" name="{$prefix}action" value="Save">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
EOQ;
        $the_form .= $this->getFormBody($prefix, $mod, $prefix . "ProspectListSave");
        $the_form .= <<<EOQ
\t\t<p><input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value="  {$lbl_save_button_label}  " ></p>
\t\t</form>

EOQ;
        $the_form .= get_left_form_footer();
        $the_form .= get_validate_record_js();
        return $the_form;
    }
/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    if (!ACLController::checkAccess('Tasks', 'edit', true)) {
        return '';
    }
    require_once 'include/time.php';
    global $app_strings, $mod_strings, $app_list_strings;
    global $current_user;
    global $theme;
    // Unimplemented until jscalendar language files are fixed
    // global $current_language;
    // global $default_language;
    // global $cal_codes;
    $user_id = $current_user->id;
    $default_status = $mod_strings['LBL_DEFAULT_STATUS'];
    $default_priority = $mod_strings['LBL_DEFAULT_PRIORITY'];
    $default_parent_type = $app_list_strings['record_type_default_key'];
    // Unimplemented until jscalendar language files are fixed
    // $cal_lang = (empty($cal_codes[$current_language])) ? $cal_codes[$default_language] : $cal_codes[$current_language];
    $cal_lang = "en";
    $cal_dateformat = parse_calendardate($app_strings['NTC_DATE_FORMAT']);
    $ntc_time_format = '(' . getDisplayTimeFormat() . ')';
    $ampm = AMPMMenu('', '');
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $the_form .= <<<EOQ
\t\t<form name="TaskSave" onSubmit="return check_form('TaskSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="module" value="Tasks">
\t\t\t<input type="hidden" name="record" value="">
\t\t\t<input type="hidden" name="status" value="{$default_status}">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
\t\t\t<input type="hidden" name="priority" value="{$default_priority}">
\t\t\t<input type="hidden" name="parent_type" value="{$default_parent_type}">
\t\t\t<input type="hidden" name="action" value="Save">
\t\t\t<input type="hidden" name="date_due_flag">
\t\t<p>{$mod_strings['LBL_NEW_FORM_SUBJECT']} <span class="required">{$app_strings['LBL_REQUIRED_SYMBOL']}</span><br>
\t\t<input name='name' type="text" value=""><br>
\t\t{$mod_strings['LBL_NEW_FORM_DUE_DATE']}&nbsp;<span class="dateFormat">{$app_strings['NTC_DATE_FORMAT']}</span><br>
\t\t<input name='date_due' maxlength="10" onblur="parseDate(this, '{$cal_dateformat}');" id='jscal_field' type="text" value=""> <img src="themes/{$theme}/images/jscalendar.gif" alt="{$app_strings['LBL_ENTER_DATE']}"  id="jscal_trigger" align="absmiddle"><br>
\t\t{$mod_strings['LBL_NEW_FORM_DUE_TIME']}&nbsp;<span class="dateFormat">{$ntc_time_format}</span><br>
\t\t<input name='time_due' maxlength='5' type="text">&nbsp;{$ampm}</p>
\t\t<p><input title="{$app_strings['LBL_SAVE_BUTTON_TITLE']}" accessKey="{$app_strings['LBL_SAVE_BUTTON_KEY']}" class="button" type="submit" name="button" value="{$app_strings['LBL_SAVE_BUTTON_LABEL']}" ></p>
\t\t</form>
\t\t<script type="text/javascript">
\t\tCalendar.setup ({
\t\t\tinputField : "jscal_field", ifFormat : "{$cal_dateformat}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1
\t\t});
\t\t</script>
EOQ;
    require_once 'include/javascript/javascript.php';
    require_once 'modules/Tasks/Task.php';
    $javascript = new javascript();
    $javascript->setFormName('TaskSave');
    $javascript->setSugarBean(new Task());
    $javascript->addRequiredFields('');
    $javascript->addField('date_due', false, '');
    $javascript->addField('time_due', false, '');
    $the_form .= $javascript->getScript();
    $the_form .= get_left_form_footer();
    return $the_form;
}
Example #3
0
/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    global $app_strings;
    global $app_list_strings;
    global $mod_strings;
    global $currentModule;
    global $current_user;
    global $timedate;
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $form = new XTemplate('modules/Campaigns/Forms.html');
    $module_select = empty($_REQUEST['module_select']) ? '' : $_REQUEST['module_select'];
    $form->assign('MOD', $mod_strings);
    $form->assign('APP', $app_strings);
    $form->assign('THEME', SugarThemeRegistry::current()->__toString());
    $form->assign("JAVASCRIPT", get_set_focus_js() . get_validate_record_js());
    $form->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['campaign_status_dom'], "Planning"));
    $form->assign("TYPE_OPTIONS", get_select_options_with_id($app_list_strings['campaign_type_dom'], ""));
    $form->assign("USER_ID", $current_user->id);
    $form->assign("TEAM_ID", sprintf('<input type="hidden" name="team_id" value="%s">', $current_user->default_team));
    $form->assign("CALENDAR_LANG", "en");
    $form->assign("USER_DATEFORMAT", '(' . $timedate->get_user_date_format() . ')');
    $form->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
    $form->parse('main');
    $the_form .= $form->text('main');
    $focus = BeanFactory::getBean('Campaigns');
    $javascript = new javascript();
    $javascript->setFormName('quick_save');
    $javascript->setSugarBean($focus);
    $javascript->addRequiredFields('');
    $jscript = $javascript->getScript();
    $the_form .= $jscript . get_left_form_footer();
    return $the_form;
}
    function getForm($prefix, $mod = '')
    {
        if (!empty($mod)) {
            global $current_language;
            $mod_strings = return_module_language($current_language, $mod);
        } else {
            global $mod_strings;
        }
        global $app_strings;
        global $app_list_strings;
        $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
        $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
        $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
        $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
        $the_form .= <<<EOQ

\t\t\t\t<form name="{$prefix}EmailTemplateSave" onSubmit="return check_form('{$prefix}EmailTemplateSave')" method="POST" action="index.php">
\t\t\t\t\t<input type="hidden" name="{$prefix}module" value="EmailTemplates">
\t\t\t\t\t<input type="hidden" name="{$prefix}action" value="Save">
EOQ;
        $the_form .= $this->getFormBody($prefix, $mod, "{$prefix}EmailTemplateSave", "20");
        $the_form .= <<<EOQ
\t\t\t\t<p><input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value="  {$lbl_save_button_label}  " ></p>
\t\t\t\t</form>

EOQ;
        $the_form .= get_left_form_footer();
        $the_form .= get_validate_record_js();
        return $the_form;
    }
/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    if (!ACLController::checkAccess('Bugs', 'edit', true)) {
        return '';
    }
    global $mod_strings;
    global $app_strings;
    global $app_list_strings;
    global $mod_strings;
    global $theme;
    global $current_user;
    $seedRelease = new Release();
    $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
    $lbl_default_status = $app_list_strings['bug_status_default_key'];
    $lbl_subject = $mod_strings['LBL_SUBJECT'];
    $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
    $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
    $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
    $user_id = $current_user->id;
    $priority_options = get_select_options_with_id($app_list_strings['bug_priority_dom'], $app_list_strings['bug_priority_default_key']);
    $release_options = get_select_options_with_id($seedRelease->get_releases(TRUE, "Active"), "");
    $type_options = get_select_options_with_id($app_list_strings['bug_type_dom'], $app_list_strings['bug_type_default_key']);
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $the_form .= <<<EOQ

\t\t<form name="BugSave" onSubmit="return check_form('BugSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="module" value="Bugs">
\t\t\t<input type="hidden" name="record" value="">

\t\t\t<input type="hidden" name="status" value="{$lbl_default_status}">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
\t\t\t<input type="hidden" name="action" value="Save">




\t\t{$lbl_subject}&nbsp;<span class="required">{$lbl_required_symbol}</span><br>
\t\t<p><input name='name' type="text" size='20' maxlength="255"value=""><br>
 \t\t{$mod_strings['LBL_TYPE']}&nbsp;<br>
\t\t<select name='type' >{$type_options}</select><br>
\t\t{$mod_strings['LBL_RELEASE']}&nbsp;<br>
\t\t<select name='found_in_release' >{$release_options}</select><br>
\t\t{$mod_strings['LBL_PRIORITY']}&nbsp;<br>
\t\t<select name='priority' >{$priority_options}</select>
</p><p>\t\t<input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value="  {$lbl_save_button_label}  " ></p>

\t\t</form>
EOQ;
    require_once 'include/javascript/javascript.php';
    require_once 'modules/Bugs/Bug.php';
    $javascript = new javascript();
    $javascript->setFormName('BugSave');
    $javascript->setSugarBean(new Bug());
    $javascript->addRequiredFields('');
    $the_form .= $javascript->getScript();
    $the_form .= get_left_form_footer();
    return $the_form;
}
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;
        }
    }
}
/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    global $mod_strings;
    global $app_strings;
    global $app_list_strings;
    global $theme;
    global $current_user;
    global $sugar_version, $sugar_config;
    $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
    $lbl_subject = $mod_strings['LBL_SUBJECT'];
    $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
    $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
    $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
    $user_id = $current_user->id;
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $the_form .= '<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    $the_form .= <<<EOQ
\t\t<form name="MachineSave" onSubmit="return check_form('MachineSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="module" value="Machines">
\t\t\t<input type="hidden" name="record" value="">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
\t\t\t<input type="hidden" name="action" value="Save">



\t\t{$lbl_subject}&nbsp;<span class="required">{$lbl_required_symbol}</span><br>
\t\t<p><input name='name' type="text" size='27' maxlength="255"value=""><br>
EOQ;
    global $sugar_config;
    $the_form .= <<<EOQ
<p>\t\t<input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value="  {$lbl_save_button_label}  " ></p>
\t\t
\t\t</form>
EOQ;
    require_once 'include/javascript/javascript.php';
    require_once 'modules/Machines/Machine.php';
    $javascript = new javascript();
    $javascript->setFormName('MachineSave');
    $javascript->setSugarBean(new Machine());
    $javascript->addRequiredFields('');
    $the_form .= $javascript->getScript();
    $the_form .= get_left_form_footer();
    return $the_form;
}
Example #8
0
function get_new_record_form()
{
    global $app_strings;
    global $mod_strings;
    global $currentModule;
    $the_form = '';
    if (!empty($_REQUEST['module_name'])) {
        $the_form = get_left_form_header($mod_strings['LBL_ADD_FIELD'] . "&nbsp;" . $_REQUEST['module_name']);
        global $app_list_strings;
        $before_form = ob_get_contents();
        ob_end_clean();
        ob_start();
        include 'modules/EditCustomFields/EditView.php';
        $the_form .= ob_get_contents();
        ob_end_clean();
        ob_start();
        echo $before_form;
        $the_form .= get_left_form_footer();
    }
    return $the_form;
}
function get_new_record_form()
{
    if (!ACLController::checkAccess('ProjectTask', 'edit', true)) {
        return '';
    }
    global $app_strings;
    global $mod_strings;
    global $currentModule;
    global $current_user;
    global $sugar_version, $sugar_config;
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $form = new XTemplate('modules/ProjectTask/Forms.html');
    $module_select = empty($_REQUEST['module_select']) ? '' : $_REQUEST['module_select'];
    $form->assign('mod', $mod_strings);
    $form->assign('app', $app_strings);
    $form->assign('module', $currentModule);
    $options = get_select_options_with_id(get_user_array(), $current_user->id);
    $form->assign('ASSIGNED_USER_OPTIONS', $options);
    ///////////////////////////////////////
    ///
    /// SETUP ACCOUNT POPUP
    $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => "quick_save", 'field_to_name_array' => array('id' => 'parent_id', 'name' => 'project_name'));
    $json = getJSONobj();
    $encoded_popup_request_data = $json->encode($popup_request_data);
    //
    ///////////////////////////////////////
    $form->assign('encoded_popup_request_data', $encoded_popup_request_data);
    $form->parse('main');
    $the_form .= $form->text('main');
    require_once 'modules/ProjectTask/ProjectTask.php';
    $focus = new ProjectTask();
    require_once 'include/javascript/javascript.php';
    $javascript = new javascript();
    $javascript->setFormName('quick_save');
    $javascript->setSugarBean($focus);
    $javascript->addRequiredFields('');
    $jscript = $javascript->getScript();
    $the_form .= $jscript . get_left_form_footer();
    return $the_form;
}
Example #10
0
function get_new_record_form()
{
    if (!ACLController::checkAccess('Press', 'edit', true)) {
        return '';
    }
    global $app_strings;
    global $mod_strings;
    global $currentModule;
    global $current_user;
    $the_form = get_left_form_header($mod_strings['LBL_QUICK_NEW_PRESS']);
    $form = new XTemplate('modules/Press/Forms.html');
    $module_select = empty($_REQUEST['module_select']) ? '' : $_REQUEST['module_select'];
    $form->assign('mod', $mod_strings);
    $form->assign('app', $app_strings);
    $form->assign('module', $currentModule);
    $json = getJSONobj();
    $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'quick_save', 'field_to_name_array' => array('id' => 'assigned_user_id', 'user_name' => 'assigned_user_name'));
    $form->assign('encoded_users_popup_request_data', $json->encode($popup_request_data));
    $form->parse('main');
    $the_form .= $form->text('main');
    require_once 'modules/Press/Press.php';
    $focus = new Press();
    require_once 'include/QuickSearchDefaults.php';
    $qsd = new QuickSearchDefaults();
    $sqs_objects = array('assigned_user_name' => $qsd->getQSUser());
    $quicksearch_js = $qsd->getQSScripts();
    $quicksearch_js .= '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '</script>';
    echo $quicksearch_js;
    require_once 'include/javascript/javascript.php';
    $javascript = new javascript();
    $javascript->setFormName('quick_save');
    $javascript->setSugarBean($focus);
    $javascript->addRequiredFields('');
    $javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
    $jscript = $javascript->getScript();
    $the_form .= $jscript . get_left_form_footer();
    return $the_form;
}
    function getFormHeader($prefix, $mod = '', $title = '')
    {
        if (!ACLController::checkAccess('Calls', 'edit', true)) {
            return '';
        }
        if (!empty($mod)) {
            global $current_language;
            $mod_strings = return_module_language($current_language, $mod);
        } else {
            global $mod_strings;
        }
        if (!empty($title)) {
            $the_form = get_left_form_header($title);
        } else {
            $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
        }
        $the_form .= <<<EOQ
\t\t<form name="{$prefix}CallSave" onSubmit="return check_form('{$prefix}CallSave') "method="POST" action="index.php">
\t\t\t<input type="hidden" name="{$prefix}module" value="Calls">
\t\t\t<input type="hidden" name="{$prefix}action" value="Save">

EOQ;
        return $the_form;
    }
Example #12
0
/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form_old()
{
    require_once 'include/time.php';
    global $mod_strings;
    global $app_strings;
    global $app_list_strings;
    global $current_user;
    global $theme;
    // Unimplemented until jscalendar language files are fixed
    // global $current_language;
    // global $default_language;
    // global $cal_codes;
    $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
    $lbl_subject = $mod_strings['LBL_SUBJECT'];
    $lbl_date = $mod_strings['LBL_DATE'];
    $lbl_time = $mod_strings['LBL_TIME'];
    $ntc_date_format = $app_strings['NTC_DATE_FORMAT'];
    $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
    $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
    $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
    $default_parent_type = $app_list_strings['record_type_default_key'];
    $default_date_start = date('Y-m-d');
    $default_time_start = to_display_time(date('H:i'));
    $ntc_time_format = '(' . getDisplayTimeFormat() . ')';
    $ampm = AMPMMenu('', date('H:i'));
    $user_id = $current_user->id;
    // Unimplemented until jscalendar language files are fixed
    // $cal_lang = (empty($cal_codes[$current_language])) ? $cal_codes[$default_language] : $cal_codes[$current_language];
    $cal_lang = "en";
    $cal_dateformat = parse_calendardate($app_strings['NTC_DATE_FORMAT']);
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $the_form .= <<<EOQ

\t\t<form name="EmailSave" onSubmit="return check_form('EmailSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="module" value="Emails">
\t\t\t<input type="hidden" name="record" value="">
\t\t\t<input type="hidden" name="action" value="Save">
\t\t\t<input type="hidden" name="parent_type" value="{$default_parent_type}">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
<p>\t\t{$lbl_subject} <span class="required">{$lbl_required_symbol}</span><br>
\t\t<input name='name' type="text"><br>
\t\t{$lbl_date} <span class="required">{$lbl_required_symbol}</span>&nbsp;<span class="dateFormat">{$ntc_date_format}</span><br>
\t\t<input name='date_start' onblur="parseDate(this, {$cal_dateformat});" id='jscal_field' type="text" maxlength="10" value="{$default_date_start}"> <img src="themes/{$theme}/images/jscalendar.gif" alt="{$app_strings['LBL_ENTER_DATE']}"  id="jscal_trigger" align="absmiddle"><br>
\t\t{$lbl_time} <span class="required">{$lbl_required_symbol}</span>&nbsp;<span class="dateFormat">{$ntc_time_format}</span><br>
\t\t<input name='time_start' maxlength='5' type="text" value="{$default_time_start}">{$ampm}</p>
<p>\t\t<input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value="  {$lbl_save_button_label}  " ></p>
\t\t</form>
\t\t<script type="text/javascript">
\t\tCalendar.setup ({
\t\t\tinputField : "jscal_field", ifFormat : "{$cal_dateformat}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1
\t\t});
\t\t</script>

EOQ;
    $the_form .= get_left_form_footer();
    require_once 'include/javascript/javascript.php';
    require_once 'modules/Emails/Email.php';
    $javascript = new javascript();
    $javascript->setFormName('EmailSave');
    $javascript->setSugarBean(new Email());
    $javascript->addRequiredFields('');
    $the_form .= $javascript->getScript();
    return $the_form;
}
Example #13
0
/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    global $app_strings;
    global $app_list_strings;
    global $mod_strings;
    global $currentModule;
    global $theme;
    global $current_user;
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $form = new XTemplate('modules/Campaigns/Forms.html');
    global $timedate;
    $module_select = empty($_REQUEST['module_select']) ? '' : $_REQUEST['module_select'];
    $form->assign('MOD', $mod_strings);
    $form->assign('APP', $app_strings);
    $form->assign('THEME', $theme);
    $form->assign("JAVASCRIPT", get_set_focus_js() . get_validate_record_js());
    $form->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['campaign_status_dom'], "Planning"));
    $form->assign("TYPE_OPTIONS", get_select_options_with_id($app_list_strings['campaign_type_dom'], ""));
    $form->assign("USER_ID", $current_user->id);
    $form->assign("CALENDAR_LANG", "en");
    $form->assign("USER_DATEFORMAT", '(' . $timedate->get_user_date_format() . ')');
    $form->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
    $form->parse('main');
    $the_form .= $form->text('main');
    require_once 'modules/Campaigns/Campaign.php';
    $focus = new Campaign();
    require_once 'include/javascript/javascript.php';
    $javascript = new javascript();
    $javascript->setFormName('quick_save');
    $javascript->setSugarBean($focus);
    $javascript->addRequiredFields('');
    $jscript = $javascript->getScript();
    $the_form .= $jscript . get_left_form_footer();
    return $the_form;
}
Example #14
0
/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    global $mod_strings;
    global $app_strings;
    global $app_list_strings;
    global $theme;
    global $current_user;
    global $sugar_version, $sugar_config;
    $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
    $lbl_default_status = $app_list_strings['case_status_default_key'];
    $lbl_subject = $mod_strings['LBL_SUBJECT'];
    $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
    $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
    $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
    $user_id = $current_user->id;
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $the_form .= '<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    $the_form .= <<<EOQ
\t\t<form name="CaseSave" onSubmit="return check_form('CaseSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="module" value="Cases">
\t\t\t<input type="hidden" name="record" value="">
\t\t\t<input type="hidden" name="priority" value="P2">
\t\t\t<input type="hidden" name="status" value="{$lbl_default_status}">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
\t\t\t<input type="hidden" name="action" value="Save">



\t\t{$lbl_subject}&nbsp;<span class="required">{$lbl_required_symbol}</span><br>
\t\t<p><input name='name' type="text" size='27' maxlength="255"value=""><br>
EOQ;
    global $sugar_config;
    if ($sugar_config['require_accounts']) {
        ///////////////////////////////////////
        ///
        /// SETUP ACCOUNT POPUP
        $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => "CaseSave", 'field_to_name_array' => array('id' => 'account_id', 'name' => 'account_name'));
        $json = getJSONobj();
        $encoded_popup_request_data = $json->encode($popup_request_data);
        //
        ///////////////////////////////////////
        $the_form .= <<<EOQ
\t\t{$mod_strings['LBL_ACCOUNT_NAME']}&nbsp;<span class="required">{$lbl_required_symbol}</span><br>
<input type="text" name="account_name" id="account_name" readonly="readonly" value="" size="16">
<input type="hidden" name="account_id" id="account_id" value="">
<input type="button" name="btn1" class="button" title="{$app_strings['LBL_SELECT_BUTTON_TITLE']}" accesskey="{$app_strings['LBL_SELECT_BUTTON_KEY']}" value='{$app_strings['LBL_SELECT_BUTTON_LABEL']}'
\tonclick='open_popup("Accounts", 600, 400, "", true, false, {$encoded_popup_request_data});' /><br>
EOQ;
    }
    $the_form .= <<<EOQ
<p>\t\t<input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value="  {$lbl_save_button_label}  " ></p>
\t\t
\t\t</form>
EOQ;
    require_once 'include/javascript/javascript.php';
    require_once 'modules/Cases/Case.php';
    $javascript = new javascript();
    $javascript->setFormName('CaseSave');
    $javascript->setSugarBean(new aCase());
    $javascript->addRequiredFields('');
    $the_form .= $javascript->getScript();
    $the_form .= get_left_form_footer();
    return $the_form;
}
Example #15
0
    function getForm($prefix, $mod = 'Opportunities')
    {
        if (!ACLController::checkAccess('Opportunities', 'edit', true)) {
            return '';
        }
        if (!empty($mod)) {
            global $current_language;
            $mod_strings = return_module_language($current_language, $mod);
        } else {
            global $mod_strings;
        }
        global $app_strings;
        global $sugar_version, $sugar_config;
        $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
        $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
        $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
        $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
        $the_form .= <<<EOQ
\t\t<form name="{$prefix}OppSave" onSubmit="return check_form('{$prefix}OppSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="{$prefix}module" value="Opportunities">
\t\t\t<input type="hidden" name="{$prefix}action" value="Save">
EOQ;
        $the_form .= $this->getFormBody($prefix, $mod, "{$prefix}OppSave");
        $the_form .= <<<EOQ
\t\t<input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value="  {$lbl_save_button_label}  " >
\t\t</form>

EOQ;
        $the_form .= get_left_form_footer();
        $the_form .= get_validate_record_js();
        return $the_form;
    }
function get_new_record_form()
{
    if (empty($_SESSION['studio']['module'])) {
        return '';
    }
    global $mod_strings;
    $module_name = $_SESSION['studio']['module'];
    $debug = true;
    $html = "";
    $html = get_left_form_header($mod_strings['LBL_TOOLBOX']);
    $add_field_icon = SugarThemeRegistry::current()->getImage("plus_inline", 'style="margin-left:4px;margin-right:4px;" alt="Add Field" border="0" align="absmiddle"');
    $minus_field_icon = SugarThemeRegistry::current()->getImage("minus_inline", 'style="margin-left:4px;margin-right:4px;" alt="Add Field" border="0" align="absmiddle"');
    $edit_field_icon = SugarThemeRegistry::current()->getImage("edit_inline", 'style="margin-left:4px;margin-right:4px;" alt="Add Field" border="0" align="absmiddle"');
    $delete = SugarThemeRegistry::current()->getImage("delete_inline", "border='0' alt='Delete' style='margin-left:4px;margin-right:4px;'");
    $show_bin = true;
    if (isset($_REQUEST['edit_subpanel_MSI'])) {
        global $sugar_version, $sugar_config;
    }
    $show_bin = false;
    $html .= "\n\n\t\t\t<script type=\"text/javascript\" src=\"modules/DynamicLayout/DynamicLayout_3.js\">\n\t\t\t</script>\n\t\t\t<p>\n\t\t";
    if (isset($_REQUEST['edit_col_MSI'])) {
        // do nothing
    } else {
        $html .= <<<EOQ


\t   <link rel="stylesheet" type="text/css" href="include/javascript/yui-old/assets/container.css" />
\t\t            \t<script type="text/javascript" src="include/javascript/yui-old/container.js"></script>
\t\t\t\t\t<script type="text/javascript" src="include/javascript/yui-old/PanelEffect.js"></script>



EOQ;
        $field_style = '';
        $bin_style = '';
        $add_icon = SugarThemeRegistry::current()->getImage("plus_inline", 'style="margin-left:4px;margin-right:4px;" alt="Maximize" border="0" align="absmiddle"');
        $min_icon = SugarThemeRegistry::current()->getImage("minus_inline", 'style="margin-left:4px;margin-right:4px;" alt="Minimize" border="0" align="absmiddle"');
        $del_icon = SugarThemeRegistry::current()->getImage("delete_inline", 'style="margin-left:4px;margin-right:4px;" alt="Minimize" border="0" align="absmiddle"');
        $html .= <<<EOQ
\t\t              <br><br><table  cellpadding="0" cellspacing="0" border="1" width="100%"   id='s_field_delete'>
\t\t\t\t\t\t\t<tr><td colspan='2' align='center'>
\t\t\t\t\t       {$del_icon} <br>Drag Fields Here To Delete
\t\t\t\t\t\t</td></tr></table>
\t\t\t\t\t<div id="s_fields_MSIlink" style="display:none">
\t\t\t\t\t\t<a href="#" onclick="toggleDisplay('s_fields_MSI');">
\t\t\t\t\t\t\t {$add_icon} {$mod_strings['LBL_VIEW_SUGAR_FIELDS']}
\t\t\t\t\t\t</a>
\t\t\t\t\t</div>
\t\t\t\t\t<div id="s_fields_MSI" style="display:inline">

\t\t\t\t\t\t<table  cellpadding="0" cellspacing="0" border="0" width="100%" id="studio_fields">
\t\t\t\t\t\t\t<tr><td colspan='2'>

\t\t\t\t\t\t\t\t\t<a href="#" onclick="toggleDisplay('s_fields_MSI');">{$min_icon}</a>{$mod_strings['LBL_SUGAR_FIELDS_STAGE']}
\t\t\t\t\t\t\t\t    <br><select id='studio_display_type' onChange='filterStudioFields(this.value)'><option value='all'>All<option value='custom'>Custom</select>
\t\t\t\t\t\t\t\t\t</td>
\t\t\t\t\t\t\t</tr>
\t\t\t\t\t\t</table>
\t\t\t\t\t</div>

EOQ;
    }
    $html .= get_left_form_footer();
    if (!$debug) {
        return $html;
    }
    return $html . <<<EOQ
EOQ;
}
Example #17
0
/**
 * Create HTML form to enter a new record with the minimum necessary vtiger_fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    global $mod_strings;
    global $app_strings;
    global $current_user;
    global $adb;
    //for dynamic quickcreateform construction
    $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
    $lbl_first_name = $mod_strings['LBL_FIRST_NAME'];
    $lbl_last_name = $mod_strings['LBL_LAST_NAME'];
    $lbl_account_name = $mod_strings['LBL_ACCOUNT_NAME'];
    $lbl_phone = $mod_strings['LBL_PHONE'];
    $lbl_email_address = $mod_strings['LBL_EMAIL_ADDRESS'];
    $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
    $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
    $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
    $user_id = $current_user->id;
    $qcreate_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $qcreate_get_field = "select * from vtiger_field where tabid=4 and quickcreate=0 and vtiger_field.presence in (0,2) order by quickcreatesequence";
    $qcreate_get_result = $adb->pquery($qcreate_get_field, array());
    $qcreate_get_noofrows = $adb->num_rows($qcreate_get_result);
    $fieldName_array = array();
    //for validation
    $qcreate_form .= '<form name="EditView" onSubmit="if(formValidate()){VtigerJS_DialogBox.block();} else {return false;}" method="POST" action="index.php">';
    $qcreate_form .= '<input type="hidden" name="module" value="Contacts">';
    $qcreate_form .= '<input type="hidden" name="record" value="">';
    $qcreate_form .= '<input type="hidden" name="assigned_user_id" value="' . $user_id . '">';
    $qcreate_form .= '<input type="hidden" name="email2" value="">';
    $qcreate_form .= '<input type="hidden" name="action" value="Save">';
    //$qcreate_form.='<input type="hidden" name="return_action" value="index">';
    //$qcreate_form.='<input type="hidden" name="return_module" value="Contacts">';
    $qcreate_form .= '<table>';
    for ($j = 0; $j < $qcreate_get_noofrows; $j++) {
        $qcreate_form .= '<tr>';
        $fieldlabel = $adb->query_result($qcreate_get_result, $j, 'fieldlabel');
        $uitype = $adb->query_result($qcreate_get_result, $j, 'uitype');
        $tabid = $adb->query_result($qcreate_get_result, $j, 'tabid');
        $fieldname = $adb->query_result($qcreate_get_result, $j, 'fieldname');
        //for validation
        $typeofdata = $adb->query_result($qcreate_get_result, $j, 'typeofdata');
        //for validation
        $qcreate_form .= get_quickcreate_form($fieldlabel, $uitype, $fieldname, $tabid);
        //to get validationdata
        //start
        $fldLabel_array = array();
        $fldLabel_array[$fieldlabel] = $typeofdata;
        $fieldName_array['QCK_' . $fieldname] = $fldLabel_array;
        //end
        $qcreate_form .= '</tr>';
    }
    //for validation
    $validationData = $fieldName_array;
    $fieldName = '';
    $fieldLabel = '';
    $fldDataType = '';
    $rows = count($validationData);
    foreach ($validationData as $fldName => $fldLabel_array) {
        if ($fieldName == '') {
            $fieldName = "'" . $fldName . "'";
        } else {
            $fieldName .= ",'" . $fldName . "'";
        }
        foreach ($fldLabel_array as $fldLabel => $datatype) {
            if ($fieldLabel == '') {
                $fieldLabel = "'" . $fldLabel . "'";
            } else {
                $fieldLabel .= ",'" . $fldLabel . "'";
            }
            if ($fldDataType == '') {
                $fldDataType = "'" . $datatype . "'";
            } else {
                $fldDataType .= ",'" . $datatype . "'";
            }
        }
    }
    $qcreate_form .= '</table>';
    $qcreate_form .= '<input title="' . $lbl_save_button_title . '" accessKey="' . $lbl_save_button_key . '" class="button" type="submit" name="button" value="' . $lbl_save_button_label . '" >';
    $qcreate_form .= '</form>';
    $qcreate_form .= '<script type="text/javascript">

        var fieldname = new Array(' . $fieldName . ')
        var fieldlabel = new Array(' . $fieldLabel . ')
        var fielddatatype = new Array(' . $fldDataType . ')

                </script>';
    $qcreate_form .= get_left_form_footer();
    return $qcreate_form;
}