本文整理汇总了PHP中javascript::addRequiredFields方法的典型用法代码示例。如果您正苦于以下问题:PHP javascript::addRequiredFields方法的具体用法?PHP javascript::addRequiredFields怎么用?PHP javascript::addRequiredFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javascript
的用法示例。
在下文中一共展示了javascript::addRequiredFields方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_new_record_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()
{
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;
}
示例2: getFormBody
function getFormBody($prefix, $mod = '', $formname = '', $size = '30', $script = true)
{
if (!ACLController::checkAccess('Notes', 'edit', true)) {
return '';
}
global $mod_strings;
$temp_strings = $mod_strings;
if (!empty($mod)) {
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}
global $app_strings;
global $app_list_strings;
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_note_subject = $mod_strings['LBL_NOTE_SUBJECT'];
$lbl_note_description = $mod_strings['LBL_NOTE'];
$default_parent_type = $app_list_strings['record_type_default_key'];
$form = <<<EOF
\t\t\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t\t\t<input type="hidden" name="{$prefix}parent_type" value="{$default_parent_type}">
<p>\t\t\t\t<table cellspacing="0" cellpadding="0" border="0">
\t\t\t\t<tr>
\t\t\t\t <td class="dataLabel">{$lbl_note_subject} <span class="required">{$lbl_required_symbol}</span></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t <td class="dataField"><input name='{$prefix}name' size='{$size}' maxlength='255' type="text" value=""></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t <td class="dataLabel">{$lbl_note_description}</td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t <td class="dataField"><textarea name='{$prefix}description' cols='{$size}' rows='4' ></textarea></td>
\t\t\t\t</tr>
\t\t\t\t</table></p>
EOF;
if ($script) {
require_once 'include/javascript/javascript.php';
require_once 'modules/Notes/Note.php';
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new Note());
$javascript->addRequiredFields($prefix);
$form .= $javascript->getScript();
}
$mod_strings = $temp_strings;
return $form;
}
示例3: get_new_record_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()
{
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} <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;
}
示例4: getFormBody
function getFormBody($prefix, $mod = '', $formname = '', $size = '30')
{
global $mod_strings;
$temp_strings = $mod_strings;
if (!empty($mod)) {
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}
global $app_strings;
global $app_list_strings;
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_subject = $mod_strings['LBL_NOTE_SUBJECT'];
$lbl_description = $mod_strings['LBL_NOTE'];
$default_parent_type = $app_list_strings['record_type_default_key'];
$form = <<<EOF
\t\t\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t\t\t<input type="hidden" name="{$prefix}parent_type" value="{$default_parent_type}">
\t\t\t\t<p>
\t\t\t\t<table cellspacing="0" cellpadding="0" border="0">
\t\t\t\t<tr>
\t\t\t\t <td scope="row">{$lbl_subject} <span class="required">{$lbl_required_symbol}</span></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t <td ><input name='{$prefix}name' size='{$size}' maxlength='255' type="text" value=""></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t <td scope="row">{$lbl_description}</td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t <td ><textarea name='{$prefix}description' cols='{$size}' rows='4' ></textarea></td>
\t\t\t\t</tr>
\t\t\t\t</table></p>
EOF;
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new EmailTemplate());
$javascript->addRequiredFields($prefix);
$form .= $javascript->getScript();
$mod_strings = $temp_strings;
return $form;
}
示例5: getFormBody
function getFormBody($prefix, $mod = '', $formname = '')
{
if (!ACLController::checkAccess('Leads', 'edit', true)) {
return '';
}
global $mod_strings;
$temp_strings = $mod_strings;
if (!empty($mod)) {
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}
global $app_strings;
global $current_user;
$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_phone = $mod_strings['LBL_PHONE'];
$user_id = $current_user->id;
$lbl_email_address = $mod_strings['LBL_EMAIL_ADDRESS'];
$form = <<<EOQ
\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t<input type="hidden" name="{$prefix}email2" value="">
\t\t<input type="hidden" name="{$prefix}status" value="New">
\t\t<input type="hidden" name="{$prefix}assigned_user_id" value='{$user_id}'>
<p>\t\t{$lbl_first_name}<br>
\t\t<input name="{$prefix}first_name" type="text" value=""><br>
\t\t{$lbl_last_name} <span class="required">{$lbl_required_symbol}</span><br>
\t\t<input name='{$prefix}last_name' type="text" value=""><br>
\t\t{$lbl_phone}<br>
\t\t<input name='{$prefix}phone_work' type="text" value=""><br>
\t\t{$lbl_email_address}<br>
\t\t<input name='{$prefix}email1' type="text" value=""></p>
EOQ;
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new Lead());
$javascript->addField('email1', 'false', $prefix);
$javascript->addField('email2', 'false', $prefix);
$javascript->addRequiredFields($prefix);
$form .= $javascript->getScript();
$mod_strings = $temp_strings;
return $form;
}
示例6: getWideFormBody
//.........这里部分代码省略.........
global $theme;
$lbl_subject = $mod_strings['LBL_SUBJECT'];
// Unimplemented until jscalendar language files are fixed
// global $current_language;
// global $default_language;
// global $cal_codes;
// 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";
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_date = $mod_strings['LBL_DATE'];
$lbl_time = $mod_strings['LBL_TIME'];
global $timedate;
$ntc_date_format = '(' . $timedate->get_user_date_format() . ')';
$ntc_time_format = '(' . $timedate->get_user_time_format() . ')';
$cal_dateformat = $timedate->get_cal_date_format();
$user_id = $current_user->id;
$default_status = $app_list_strings['call_status_default'];
$default_parent_type = $app_list_strings['record_type_default_key'];
$date = TimeDate::getInstance()->nowDb();
$default_date_start = $timedate->to_display_date($date);
$default_time_start = $timedate->to_display_time($date, true);
$time_ampm = $timedate->AMPMMenu($prefix, $default_time_start);
$form = <<<EOQ
\t\t\t<input type="hidden" name="{$prefix}direction" value="Outbound">
\t\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t\t<input type="hidden" name="{$prefix}status" value="{$default_status}">
\t\t\t<input type="hidden" name="{$prefix}parent_type" value="{$default_parent_type}">
\t\t\t<input type="hidden" name="{$prefix}assigned_user_id" value='{$user_id}'>
\t\t\t<input type="hidden" name="{$prefix}duration_hours" value="1">
\t\t\t<input type="hidden" name="{$prefix}duration_minutes" value="0">
\t\t\t<input type="hidden" name="{$prefix}user_id" value="{$user_id}">
\t\t<table cellspacing='0' cellpadding='0' border='0' width="100%">
<tr>
EOQ;
if ($wide) {
$form .= <<<EOQ
<td scope='row' width="20%"><input type='radio' name='appointment' value='Call' class='radio' checked> {$mod_strings['LNK_NEW_CALL']}</td>
<td scope='row' width="80%">{$mod_strings['LBL_DESCRIPTION']}</td>
</tr>
<tr>
<td scope='row'><input type='radio' name='appointment' value='Meeting' class='radio'> {$mod_strings['LNK_NEW_MEETING']}</td>
<td rowspan='8' ><textarea name='Appointmentsdescription' cols='50' rows='5'></textarea></td>
</tr>
EOQ;
} else {
$form .= <<<EOQ
<td scope='row' width="20%"><input type='radio' name='appointment' value='Call' class='radio' onchange='document.{$formname}.module.value="Calls";' checked> {$mod_strings['LNK_NEW_CALL']}</td>
</tr>
<tr>
<td scope='row'><input type='radio' name='appointment' value='Meeting' class='radio' onchange='document.{$formname}.module.value="Meetings";'> {$mod_strings['LNK_NEW_MEETING']}</td>
</tr>
EOQ;
}
$jscalenderImage = SugarThemeRegistry::current()->getImageURL('jscalendar.gif');
$form .= <<<EOQ
<tr>
<td scope='row'>{$lbl_subject} <span class="required">{$lbl_required_symbol}</span></td>
</tr>
<tr>
<td ><input name='{$prefix}name' maxlength='255' type="text"></td>
</tr>
<tr>
<td scope='row'>{$lbl_date} <span class="required">{$lbl_required_symbol}</span> <span class="dateFormat">{$ntc_date_format}</span></td>
</tr>
<tr>
<td ><input onblur="parseDate(this, '{$cal_dateformat}');" name='{$prefix}date_start' size="12" id='{$prefix}jscal_field' maxlength='10' type="text" value="{$default_date_start}"> <!--not_in_theme!--><img src="{$jscalenderImage}" alt="{$app_strings['LBL_ENTER_DATE']}" id="{$prefix}jscal_trigger" align="absmiddle"></td>
</tr>
<tr>
<td scope='row'>{$lbl_time} <span class="required">{$lbl_required_symbol}</span> <span class="dateFormat">{$ntc_time_format}</span></td>
</tr>
<tr>
<td ><input name='{$prefix}time_start' size="12" type="text" maxlength='5' value="{$default_time_start}">{$time_ampm}</td>
</tr>
</table>
\t\t<script type="text/javascript">
\t\tCalendar.setup ({
\t\t\tinputField : "{$prefix}jscal_field", daFormat : "{$cal_dateformat}", ifFormat : "{$cal_dateformat}", showsTime : false, button : "{$prefix}jscal_trigger", singleClick : true, step : 1, weekNumbers:false
\t\t});
\t\t</script>
EOQ;
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new Call());
$javascript->addRequiredFields($prefix);
$form .= $javascript->getScript();
$mod_strings = $temp_strings;
return $form;
}
示例7: getFormBody
function getFormBody($prefix, $mod = '', $formname = '')
{
if (!ACLController::checkAccess('Ink', 'edit', true)) {
return '';
}
global $mod_strings;
$temp_strings = $mod_strings;
if (!empty($mod)) {
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}
global $app_strings;
global $app_list_strings;
global $current_user;
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$name = $mod_strings['LBL_NAME'];
$short_symbol = $mod_strings['LBL_SHORT_SYMBOL'];
$type = $mod_strings['LBL_TYPE'];
$type_options = get_select_options_with_id($app_list_strings['ink_type_options'], "");
$cmyk_type = $mod_strings['LBL_CMYK_TYPE'];
$cmyk_type_options = get_select_options_with_id($app_list_strings['cmyk_ink_type_options'], "");
$pantone = $mod_strings['LBL_PANTONE'];
$pantone_options = get_select_options_with_id($app_list_strings['pantone_ink_type_options'], "");
$user_id = $current_user->id;
$form = <<<EOQ
\t\t</tr>
\t\t<tr>
\t\t<td>
\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t<input type="hidden" name="{$prefix}assigned_user_id" value='{$user_id}'>
\t\t{$name}<br>
\t\t<input name="{$prefix}name" type="text" value=""><br></td>
\t\t<td>{$short_symbol}<br>
\t\t<input name='{$prefix}short_symbol' type="text" value=""></td>
\t\t</tr>
\t\t<tr>
\t\t<td>{$type}<br>
\t\t<select name='{$prefix}type'>{$type_options}</select><br>
\t\t</td>
\t\t<td>{$cmyk_type}<br>
\t\t<select name='{$prefix}cmyk_type'>{$cmyk_type_options}</select><br>
\t\t</td>
\t\t<td>{$pantone}<br>
\t\t<select name='{$prefix}pantone'>{$pantone_options}</select><br>
\t\t</td>
\t\t
EOQ;
require_once 'include/javascript/javascript.php';
require_once 'modules/Ink/Ink.php';
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new Ink());
//$javascript->addField('name','true',$prefix);
$javascript->addRequiredFields($prefix);
$form .= $javascript->getScript();
$mod_strings = $temp_strings;
return $form;
}
示例8: getFormBody
function getFormBody($prefix, $mod = '', $formname = '')
{
if (!ACLController::checkAccess('Meetings', 'edit', true)) {
return '';
}
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $current_user;
global $theme;
global $timedate;
$temp_strings = $mod_strings;
if (!empty($mod)) {
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}
// Unimplemented until jscalendar language files are fixed
// global $current_language;
// global $default_language;
// global $cal_codes;
$cal_lang = "en";
$cal_dateformat = $timedate->get_cal_date_format();
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_date = $mod_strings['LBL_DATE'];
$lbl_time = $mod_strings['LBL_TIME'];
$ntc_date_format = $timedate->get_user_date_format();
$ntc_time_format = '(' . $timedate->get_user_time_format() . ')';
$user_id = $current_user->id;
$default_status = $app_list_strings['meeting_status_default'];
$default_parent_type = $app_list_strings['record_type_default_key'];
$default_date_start = $timedate->nowDbDate();
$default_time_start = $timedate->nowDbTime();
$time_ampm = $timedate->AMPMMenu($prefix, $timedate->nowDbTime());
// Unimplemented until jscalendar language files are fixed
// $cal_lang =(empty($cal_codes[$current_language])) ? $cal_codes[$default_language] : $cal_codes[$current_language];
$jsCalendarImage = SugarThemeRegistry::current()->getImageURL('jscalendar.gif');
$form = <<<EOF
\t\t\t\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t\t\t\t<input type="hidden" name="{$prefix}status" value="{$default_status}">
\t\t\t\t\t<input type="hidden" name="{$prefix}parent_type" value="{$default_parent_type}">
\t\t\t\t\t<input type="hidden" name="{$prefix}assigned_user_id" value='{$user_id}'>
\t\t\t\t\t<input type="hidden" name="{$prefix}duration_hours" value="1">
\t\t\t\t\t<input type="hidden" name="{$prefix}duration_minutes" value="00">
\t\t\t\t\t<p>{$lbl_subject}<span class="required">{$lbl_required_symbol}</span><br>
\t\t\t\t\t<input name='{$prefix}name' size='25' maxlength='255' type="text"><br>
\t\t\t\t\t{$lbl_date} <span class="required">{$lbl_required_symbol}</span> <span class="dateFormat">{$ntc_date_format}</span><br>
\t\t\t\t\t<input name='{$prefix}date_start' id='jscal_field' onblur="parseDate(this, '{$cal_dateformat}');" type="text" maxlength="10" value="{$default_date_start}"> <!--not_in_theme!--><img src="{$jscalendarImage}" alt="{$app_strings['LBL_ENTER_DATE']}" id="jscal_trigger" align="absmiddle"><br>
\t\t\t\t\t{$lbl_time} <span class="required">{$lbl_required_symbol}</span> <span class="dateFormat">{$ntc_time_format}</span><br>
\t\t\t\t\t<input name='{$prefix}time_start' type="text" maxlength='5' value="{$default_time_start}">{$time_ampm}</p>
\t\t\t\t\t<script type="text/javascript">
\t\t\t\t\tCalendar.setup({
\t\t\t\t\t\tinputField : "jscal_field", daFormat : "{$cal_dateformat}", ifFormat : "{$cal_dateformat}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1, weekNumbers:false
\t\t\t\t\t});
\t\t\t\t\t</script>
EOF;
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new Meeting());
$javascript->addRequiredFields($prefix);
$form .= $javascript->getScript();
$mod_strings = $temp_strings;
return $form;
}
示例9: getFormBody
function getFormBody($prefix, $mod = 'Quotes', $formname = '')
{
if (!ACLController::checkAccess('Quotes', '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 $app_list_strings;
global $theme;
global $current_user;
global $timedate;
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_quote_name = $mod_strings['LBL_QUOTE_NAME'];
$lbl_quote_stage = $mod_strings['LBL_QUOTE_STAGE'];
$user_id = $current_user->id;
$team_id = $current_user->default_team;
///////////////////////////////////////
///
/// SETUP ACCOUNT POPUP
$popup_request_data = array('call_back_function' => 'set_form_return', 'form_name' => "{$prefix}EditView", 'field_to_name_array' => array('id' => 'billing_account_id', 'name' => "{$prefix}billing_account_name", 'billing_address_street' => "{$prefix}billing_address_street", 'billing_address_city' => "{$prefix}billing_address_city", 'billing_address_state' => "{$prefix}billing_address_state", 'billing_address_postalcode' => "{$prefix}billing_address_postalcode", 'billing_address_country' => "{$prefix}billing_address_country"));
$json = getJSONobj();
$encoded_popup_request_data = $json->encode($popup_request_data);
//
///////////////////////////////////////
$default_date_start = $timedate->asUserDate($timedate->getNow());
$cal_dateformat = $timedate->get_cal_date_format();
$jsCalendarImage = SugarThemeRegistry::current()->getImageURL("jscalendar.gif");
$the_form = <<<EOQ
\t\t\t<p><input type="hidden" name="{$prefix}record" value="">
\t\t\t<input type="hidden" name="{$prefix}assigned_user_id" value="{$user_id}">
\t\t\t<input type="hidden" name="{$prefix}team_id" value="{$team_id}">
\t\t\t<input type="hidden" name="{$prefix}billing_address_street">
\t\t\t<input type="hidden" name="{$prefix}billing_address_city">
\t\t\t<input type="hidden" name="{$prefix}billing_address_state">
\t\t\t<input type="hidden" name="{$prefix}billing_address_postalcode">
\t\t\t<input type="hidden" name="{$prefix}billing_address_country">
\t\t{$lbl_quote_name} <span class="required">{$lbl_required_symbol}</span><br>
\t\t<input name='{$prefix}name' type="text" value=""><br>
\t\t{$mod_strings['LBL_ACCOUNT_NAME']} <span class="required">{$lbl_required_symbol}</span><br>
\t\t<input name='{$prefix}billing_account_name' type='text' readonly value="" size="16">
\t\t<input name='billing_account_id' type="hidden" value=''> <input title="{$app_strings['LBL_SELECT_BUTTON_TITLE']}" type="button" class="button" value='{$app_strings['LBL_SELECT_BUTTON_LABEL']}' name=btn1 onclick='open_popup("Accounts", 600, 400, "", true, false, {$encoded_popup_request_data});' /><br>
\t\t{$mod_strings['LBL_DATE_QUOTE_EXPECTED_CLOSED']} <span class="required">{$lbl_required_symbol}</span><br>\t\t
\t\t<input name='{$prefix}date_quote_expected_closed' id='{$prefix}date_quote_expected_closed' onblur="parseDate(this, '{$cal_dateformat}');" type="text" maxlength="10" value="{$default_date_start}"> <!--not_in_theme!--><img src="{$jsCalendarImage}" alt="{$app_strings['LBL_ENTER_DATE']}" id="date_quote_expected_closed_trigger" align="absmiddle"><br>
\t\t{$lbl_quote_stage} <span class="required">{$lbl_required_symbol}</span><br>
\t\t<select name='{$prefix}quote_stage'>
EOQ;
$the_form .= get_select_options_with_id($app_list_strings['quote_stage_dom'], "");
$the_form .= <<<EOQ
\t\t</select><br>
\t\t<script type="text/javascript">
\t\tCalendar.setup({
\t\t\tinputField : "date_quote_expected_closed", daFormat : "{$cal_dateformat}", ifFormat : "{$cal_dateformat}", showsTime : false, button : "date_quote_expected_closed_trigger", singleClick : true, step : 1, weekNumbers:false
\t\t});
\t\t</script>
EOQ;
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(BeanFactory::getBean('Quotes'));
$javascript->addRequiredFields($prefix);
$javascript->addField('date_quote_expected_closed', true, $prefix);
$the_form .= $javascript->getScript();
return $the_form;
}
示例10: getFormBody
function getFormBody($prefix, $mod = '', $formname = '', $size = '30', $script = true)
{
if (!ACLController::checkAccess('ProspectLists', 'edit', true)) {
return '';
}
global $mod_strings;
$temp_strings = $mod_strings;
if (!empty($mod)) {
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}
global $app_strings;
global $current_user;
global $app_list_strings;
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$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;
$list_options = get_select_options_with_id($app_list_strings['prospect_list_type_dom'], 'default');
$lbl_prospect_list_name = $mod_strings['LBL_PROSPECT_LIST_NAME'];
$lbl_list_type = $mod_strings['LBL_LIST_TYPE'];
$form = <<<EOQ
\t\t\t<p><input type="hidden" name="record" value="">
\t\t\t{$lbl_prospect_list_name} <span class="required">{$lbl_required_symbol}</span><br>
\t\t\t<input name='name' type="text" value=""><br>
\t\t\t{$lbl_list_type} <span class="required">{$lbl_required_symbol}</span><br>
\t\t\t<select name="list_type">{$list_options}</select></p>
EOQ;
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new ProspectList());
$javascript->addRequiredFields($prefix);
$form .= $javascript->getScript();
$mod_strings = $temp_strings;
return $form;
}
示例11: getFormBody
function getFormBody($prefix, $mod = 'Opportunities', $formname = '')
{
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 $app_list_strings;
global $theme;
global $current_user;
global $sugar_config;
global $timedate;
// 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_opportunity_name = $mod_strings['LBL_OPPORTUNITY_NAME'];
$lbl_sales_stage = $mod_strings['LBL_SALES_STAGE'];
$lbl_date_closed = $mod_strings['LBL_DATE_CLOSED'];
$lbl_amount = $mod_strings['LBL_AMOUNT'];
$ntc_date_format = $timedate->get_user_date_format();
$cal_dateformat = $timedate->get_cal_date_format();
$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";
$the_form = <<<EOQ
<p>
\t\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t\t<input type="hidden" name="{$prefix}assigned_user_id" value='{$user_id}'>
\t\t{$lbl_opportunity_name} <span class="required">{$lbl_required_symbol}</span><br>
\t\t<input name='{$prefix}name' type="text" value="">
EOQ;
if ($sugar_config['require_accounts']) {
///////////////////////////////////////
///
/// SETUP ACCOUNT POPUP
$popup_request_data = array('call_back_function' => 'set_return', 'form_name' => "{$prefix}OppSave", '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']} <span class="required">{$lbl_required_symbol}</span><br>
\t\t<input class='sqsEnabled' autocomplete='off' id='qc_account_name' name='account_name' type='text' value="" size="16"><input id='qc_account_id' name='account_id' type="hidden" value=''> <input title="{$app_strings['LBL_SELECT_BUTTON_TITLE']}" type="button" class="button" value='{$app_strings['LBL_SELECT_BUTTON_LABEL']}' name=btn1
\t\t\tonclick='open_popup("Accounts", 600, 400, "", true, false, {$encoded_popup_request_data});' /><br>
EOQ;
}
$jsCalendarImage = SugarThemeRegistry::current()->getImageURL('jscalendar.gif');
$the_form .= <<<EOQ
\t\t{$lbl_date_closed} <span class="required">{$lbl_required_symbol}</span> <br><span class="dateFormat">{$ntc_date_format}</span><br>
\t\t<input name='{$prefix}date_closed' size='12' maxlength='10' id='{$prefix}jscal_field' type="text" value=""> <!--not_in_theme!--><img src="{$jsCalendarImage}" alt="{$app_strings['LBL_ENTER_DATE']}" id="jscal_trigger" align="absmiddle"><br>
\t\t{$lbl_sales_stage} <span class="required">{$lbl_required_symbol}</span><br>
\t\t<select name='{$prefix}sales_stage'>
EOQ;
$the_form .= get_select_options_with_id($app_list_strings['sales_stage_dom'], "");
$the_form .= <<<EOQ
\t\t</select><br>
\t\t{$lbl_amount} <span class="required">{$lbl_required_symbol}</span><br>
\t\t<input name='{$prefix}amount' type="text"></p>
\t\t<input type='hidden' name='lead_source' value=''>
\t\t<script type="text/javascript">
\t\tCalendar.setup ({
\t\t\tinputField : "{$prefix}jscal_field", daFormat : "{$cal_dateformat}", ifFormat : "{$cal_dateformat}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1, weekNumbers:false
\t\t});
\t\t</script>
EOQ;
require_once 'include/QuickSearchDefaults.php';
$qsd = QuickSearchDefaults::getQuickSearchDefaults();
$sqs_objects = array('qc_account_name' => $qsd->getQSParent());
$sqs_objects['qc_account_name']['populate_list'] = array('qc_account_name', 'qc_account_id');
$quicksearch_js = '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '</script>';
$the_form .= $quicksearch_js;
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new Opportunity());
$javascript->addRequiredFields($prefix);
$the_form .= $javascript->getScript();
return $the_form;
}
示例12: getWideFormBody
function getWideFormBody($prefix, $mod = '', $formname = '', $contact = '')
{
if (!ACLController::checkAccess('Suppliers', 'edit', true)) {
return '';
}
require_once 'modules/Contacts/Contact.php';
if (empty($contact)) {
$contact = new Contact();
}
global $mod_strings;
$temp_strings = $mod_strings;
if (!empty($mod)) {
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}
global $app_strings;
global $current_user;
$supplier = new Supplier();
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_supplier_name = $mod_strings['LBL_SUPPLIER_NAME'];
$lbl_phone = $mod_strings['LBL_PHONE'];
$lbl_website = $mod_strings['LBL_WEBSITE'];
if (isset($contact->assigned_user_id)) {
$user_id = $contact->assigned_user_id;
} else {
$user_id = $current_user->id;
}
$form = "";
$form .= <<<EOQ
\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t<input type="hidden" name="{$prefix}phone_fax" value="{$contact->phone_fax}">
\t\t<input type="hidden" name="{$prefix}phone_other" value="{$contact->phone_other}">
\t\t<input type="hidden" name="{$prefix}email1" value="{$contact->email1}">
\t\t<input type="hidden" name="{$prefix}email2" value="{$contact->email2}">
\t\t<input type='hidden' name='{$prefix}billing_address_street' value='{$contact->primary_address_street}'><input type='hidden' name='{$prefix}billing_address_city' value='{$contact->primary_address_city}'><input type='hidden' name='{$prefix}billing_address_state' value='{$contact->primary_address_state}'><input type='hidden' name='{$prefix}billing_address_postalcode' value='{$contact->primary_address_postalcode}'><input type='hidden' name='{$prefix}billing_address_country' value='{$contact->primary_address_country}'>
\t\t<input type='hidden' name='{$prefix}shipping_address_street' value='{$contact->primary_address_street}'><input type='hidden' name='{$prefix}shipping_address_city' value='{$contact->primary_address_city}'><input type='hidden' name='{$prefix}shipping_address_state' value='{$contact->primary_address_state}'><input type='hidden' name='{$prefix}shipping_address_postalcode' value='{$contact->primary_address_postalcode}'><input type='hidden' name='{$prefix}shipping_address_country' value='{$contact->primary_address_country}'>
\t\t<input type="hidden" name="{$prefix}assigned_user_id" value='{$user_id}'>
\t\t<table width='100%' border="0" cellpadding="0" cellspacing="0">
\t\t<tr>
\t\t<td width="20%" nowrap class="dataLabel">{$lbl_supplier_name} <span class="required">{$lbl_required_symbol}</span></td>
\t\t<TD width="80%" nowrap class="dataLabel">{$mod_strings['LBL_DESCRIPTION']}</TD>
\t\t</tr>
\t\t<tr>
\t\t<td nowrap class="dataField"><input name='{$prefix}name' type="text" value="{$contact->supplier_name}"></td>
\t\t<TD rowspan="5" class="dataField"><textarea name='{$prefix}description' rows='6' cols='50'></textarea></TD>
\t\t</tr>
\t\t<tr>
\t\t<td nowrap class="dataLabel">{$lbl_phone}</td>
\t\t</tr>
\t\t<tr>
\t\t<td nowrap class="dataField"><input name='{$prefix}phone_office' type="text" value="{$contact->phone_work}"></td>
\t\t</tr>
\t\t<tr>
\t\t<td nowrap class="dataLabel">{$lbl_website}</td>
\t\t</tr>
\t\t<tr>
\t\t<td nowrap class="dataField"><input name='{$prefix}website' type="text" value="http://"></td>
\t\t</tr>
EOQ;
//carry forward custom lead fields common to suppliers during Lead Conversion
$tempSupplier = new Supplier();
if (method_exists($contact, 'convertCustomFieldsForm')) {
$contact->convertCustomFieldsForm($form, $tempSupplier, $prefix);
}
unset($tempSupplier);
$form .= <<<EOQ
\t\t</TABLE>
EOQ;
require_once 'include/javascript/javascript.php';
require_once 'modules/Suppliers/Supplier.php';
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new Supplier());
$javascript->addRequiredFields($prefix);
$form .= $javascript->getScript();
$mod_strings = $temp_strings;
return $form;
}
示例13: getFormBody
function getFormBody($prefix, $mod = '', $formname = '')
{
global $mod_strings;
$temp_strings = $mod_strings;
if (!empty($mod)) {
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}
global $app_strings;
global $current_user;
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_url = $mod_strings['LBL_RSS_URL'] . ":";
$user_id = $current_user->id;
$form = <<<EOQ
\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t<input type="hidden" name="{$prefix}assigned_user_id" value='{$user_id}'>
\t\t{$lbl_url} <input name="{$prefix}url" type="text" value="" size=28> <span class="required">{$lbl_required_symbol}</span><br><br>
EOQ;
require_once 'include/javascript/javascript.php';
require_once 'modules/Feeds/Feed.php';
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new Feed());
//$javascript->addField('email1','false',$prefix);
$javascript->addRequiredFields($prefix);
$form .= $javascript->getScript();
$mod_strings = $temp_strings;
return $form;
}
示例14: get_new_record_form_old
/**
* 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> <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> <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;
}
示例15: getWideFormBody
function getWideFormBody($prefix, $mod = '', $formname = '', $contact = '')
{
if (!ACLController::checkAccess('Accounts', 'edit', true)) {
return '';
}
if (empty($contact)) {
$contact = new Contact();
}
global $mod_strings;
$temp_strings = $mod_strings;
if (!empty($mod)) {
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}
global $app_strings;
global $current_user;
$account = new Account();
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_account_name = $mod_strings['LBL_ACCOUNT_NAME'];
$lbl_phone = $mod_strings['LBL_PHONE'];
$lbl_website = $mod_strings['LBL_WEBSITE'];
if (isset($contact->assigned_user_id)) {
$user_id = $contact->assigned_user_id;
} else {
$user_id = $current_user->id;
}
//Retrieve Email address and set email1, email2
$sugarEmailAddress = new SugarEmailAddress();
$sugarEmailAddress->handleLegacyRetrieve($contact);
if (!isset($contact->email1)) {
$contact->email1 = '';
}
if (!isset($contact->email2)) {
$contact->email2 = '';
}
if (!isset($contact->email_opt_out)) {
$contact->email_opt_out = '';
}
$form = "";
$default_desc = "";
if (!empty($contact->description)) {
$default_desc = $contact->description;
}
$form .= <<<EOQ
\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t<input type="hidden" name="{$prefix}phone_fax" value="{$contact->phone_fax}">
\t\t<input type="hidden" name="{$prefix}phone_other" value="{$contact->phone_other}">
\t\t<input type="hidden" name="{$prefix}email1" value="{$contact->email1}">
\t\t<input type="hidden" name="{$prefix}email2" value="{$contact->email2}">
\t\t<input type='hidden' name='{$prefix}billing_address_street' value='{$contact->primary_address_street}'><input type='hidden' name='{$prefix}billing_address_city' value='{$contact->primary_address_city}'><input type='hidden' name='{$prefix}billing_address_state' value='{$contact->primary_address_state}'><input type='hidden' name='{$prefix}billing_address_postalcode' value='{$contact->primary_address_postalcode}'><input type='hidden' name='{$prefix}billing_address_country' value='{$contact->primary_address_country}'>
\t\t<input type='hidden' name='{$prefix}shipping_address_street' value='{$contact->alt_address_street}'><input type='hidden' name='{$prefix}shipping_address_city' value='{$contact->alt_address_city}'><input type='hidden' name='{$prefix}shipping_address_state' value='{$contact->alt_address_state}'><input type='hidden' name='{$prefix}shipping_address_postalcode' value='{$contact->alt_address_postalcode}'><input type='hidden' name='{$prefix}shipping_address_country' value='{$contact->alt_address_country}'>
\t\t<input type="hidden" name="{$prefix}assigned_user_id" value='{$user_id}'>
\t\t<input type='hidden' name='{$prefix}do_not_call' value='{$contact->do_not_call}'>
\t\t<input type='hidden' name='{$prefix}email_opt_out' value='{$contact->email_opt_out}'>
\t\t<table width='100%' border="0" cellpadding="0" cellspacing="0">
\t\t<tr>
\t\t<td width="20%" nowrap scope="row">{$lbl_account_name} <span class="required">{$lbl_required_symbol}</span></td>
\t\t<TD width="80%" nowrap scope="row">{$mod_strings['LBL_DESCRIPTION']}</TD>
\t\t</tr>
\t\t<tr>
\t\t<td nowrap ><input name='{$prefix}name' type="text" value="{$contact->account_name}"></td>
\t\t<TD rowspan="5" ><textarea name='{$prefix}description' rows='6' cols='50' >{$default_desc}</textarea></TD>
\t\t</tr>
\t\t<tr>
\t\t<td nowrap scope="row">{$lbl_phone}</td>
\t\t</tr>
\t\t<tr>
\t\t<td nowrap ><input name='{$prefix}phone_office' type="text" value="{$contact->phone_work}"></td>
\t\t</tr>
\t\t<tr>
\t\t<td nowrap scope="row">{$lbl_website}</td>
\t\t</tr>
\t\t<tr>
\t\t<td nowrap ><input name='{$prefix}website' type="text" value="http://"></td>
\t\t</tr>
EOQ;
//carry forward custom lead fields common to accounts during Lead Conversion
$tempAccount = new Account();
if (method_exists($contact, 'convertCustomFieldsForm')) {
$contact->convertCustomFieldsForm($form, $tempAccount, $prefix);
}
unset($tempAccount);
$form .= <<<EOQ
\t\t</TABLE>
EOQ;
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new Account());
$javascript->addRequiredFields($prefix);
$form .= $javascript->getScript();
$mod_strings = $temp_strings;
return $form;
}