示例#1
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 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
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_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;
}
示例#4
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $beanFiles, $mod_strings;
     // the user admin (MLA) cannot edit any administrator holidays
     global $current_user;
     if (isset($_REQUEST['record'])) {
         $result = $GLOBALS['db']->query("SELECT is_admin FROM users WHERE id=(SELECT person_id FROM holidays WHERE id='{$_REQUEST['record']}')");
         $row = $GLOBALS['db']->fetchByAssoc($result);
         if (!is_admin($current_user) && $current_user->isAdminForModule('Users') && $row['is_admin'] == 1) {
             sugar_die('Unauthorized access');
         }
     }
     $this->ev->process();
     if ($_REQUEST['return_module'] == 'Project') {
         $projectBean = BeanFactory::getBean('Project', $_REQUEST['return_id']);
         $userBean = BeanFactory::getBean('Users');
         $contactBean = BeanFactory::getBean('Contacts');
         $projectBean->load_relationship("user_resources");
         $userResources = $projectBean->user_resources->getBeans($userBean);
         $projectBean->load_relationship("contact_resources");
         $contactResources = $projectBean->contact_resources->getBeans($contactBean);
         ksort($userResources);
         ksort($contactResources);
         $this->ss->assign("PROJECT", true);
         $this->ss->assign("USER_RESOURCES", $userResources);
         $this->ss->assign("CONTACT_RESOURCES", $contactResources);
         $this->ss->assign("MOD", $mod_strings);
         $holiday_js = "<script type='text/javascript'>\n";
         $holiday_js .= $projectBean->resourceSelectJS();
         $holiday_js .= "\n</script>";
         echo $holiday_js;
     }
     echo $this->ev->display();
     //echo the javascript that will validate the form
     $javascript = new javascript();
     $javascript->setFormName("EditView");
     $javascript->addFieldGeneric('holiday_date', '', 'LBL_HOLIDAY_DATE', 'true');
     $javascript->addFieldGeneric('person_type', '', 'LBL_PERSON_TYPE', 'true');
     //note that the person type and person id labels are use the resource name label on purpose for a clearer UI
     $javascript->addToValidateBinaryDependency('person_id', 'alpha', 'LBL_RESOURCE_NAME', 'true', '', 'person_type');
     echo $javascript->getScript();
 }
    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;
    }
示例#6
0
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;
}
示例#7
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;
}
示例#8
0
    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;
    }
    function getWideFormBody($prefix, $mod = '', $formname = '', $wide = true)
    {
        if (!ACLController::checkAccess('Calls', '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;
        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}&nbsp;<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}&nbsp;<span class="required">{$lbl_required_symbol}</span>&nbsp;<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}&nbsp;<span class="required">{$lbl_required_symbol}</span>&nbsp;<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;
    }
$focus->retrieveSettings();
if (!empty($_POST['restore'])) {
    $configurator->restoreConfig();
}
require_once 'include/Sugar_Smarty.php';
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
$sugar_smarty->assign('APP_LIST', $app_list_strings);
$sugar_smarty->assign('config', $configurator->config);
$sugar_smarty->assign('asterisk_config', $asterisk_config);
$sugar_smarty->assign('error', $configurator->errors);
$sugar_smarty->display('custom/modules/Configurator/asterisk_configurator.tpl');
require_once "include/javascript/javascript.php";
$javascript = new javascript();
$javascript->setFormName("ConfigureSettings");
$javascript->addFieldGeneric("asterisk_host", "varchar", $mod_strings['LBL_ASTERISK_HOST'], TRUE, "");
$javascript->addFieldGeneric("asterisk_port", "int", $mod_strings['LBL_ASTERISK_PORT'], TRUE, "");
$javascript->addFieldGeneric("asterisk_user", "varchar", $mod_strings['LBL_ASTERISK_USER'], TRUE, "");
$javascript->addFieldGeneric("asterisk_secret", "varchar", $mod_strings['LBL_ASTERISK_SECRET'], TRUE, "");
$javascript->addFieldGeneric("asterisk_prefix", "varchar", $mod_strings['LBL_ASTERISK_PREFIX'], TRUE, "");
$javascript->addFieldGeneric("asterisk_context", "varchar", $mod_strings['LBL_ASTERISK_CONTEXT'], TRUE, "");
$javascript->addFieldGeneric("asterisk_expr", "varchar", $mod_strings['LBL_ASTERISK_EXPR'], TRUE, "");
$javascript->addFieldGeneric("asterisk_soapuser", "varchar", $mod_strings['LBL_ASTERISK_SOAPUSER'], TRUE, "");
// Added in yaii-2.0
$javascript->addFieldGeneric("asterisk_dialinPrefix", "varchar", $mod_strings['LBL_ASTERISK_DIALINPREFIX'], TRUE, "");
$javascript->addFieldGeneric('asterisk_log_file', "varchar", $mod_strings['LBL_ASTERISK_LOG_FILE'], TRUE, "");
$javascript->addFieldGeneric('asterisk_dialout_channel', "varchar", $mod_strings['LBL_ASTERISK_DIALOUT_CHANNEL'], TRUE, "");
$javascript->addFieldGeneric('asterisk_dialin_ext_match', "varchar", $mod_strings['LBL_ASTERISK_DIALIN_EXT_MATCH'], TRUE, "");
$javascript->addFieldGeneric('asterisk_call_subject_inbound_abbr', "varchar", $mod_strings['LBL_ASTERISK_CALL_SUBJECT_INBOUND_ABBR'], TRUE, "");
$javascript->addFieldGeneric('asterisk_call_subject_outbound_abbr', "varchar", $mod_strings['LBL_ASTERISK_CALL_SUBJECT_OUTBOUND_ABBR'], TRUE, "");
示例#11
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $current_user, $mod_strings, $app_strings, $app_list_strings, $sugar_config, $locale;
     $configurator = new Configurator();
     $sugarConfig = SugarConfig::getInstance();
     $focus = new Administration();
     $configurator->parseLoggerSettings();
     $focus->retrieveSettings();
     if (!empty($_POST['restore'])) {
         $configurator->restoreConfig();
     }
     $this->ss->assign('MOD', $mod_strings);
     $this->ss->assign('APP', $app_strings);
     $this->ss->assign('APP_LIST', $app_list_strings);
     $this->ss->assign('config', $configurator->config);
     $this->ss->assign('error', $configurator->errors);
     $this->ss->assign("AUTO_REFRESH_INTERVAL_OPTIONS", get_select_options_with_id($app_list_strings['dashlet_auto_refresh_options_admin'], isset($configurator->config['dashlet_auto_refresh_min']) ? $configurator->config['dashlet_auto_refresh_min'] : 30));
     $this->ss->assign('LANGUAGES', get_languages());
     $this->ss->assign("JAVASCRIPT", get_set_focus_js() . get_configsettings_js());
     $this->ss->assign('company_logo', SugarThemeRegistry::current()->getImageURL('company_logo.png'));
     $this->ss->assign("settings", $focus->settings);
     $this->ss->assign("mail_sendtype_options", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $focus->settings['mail_sendtype']));
     if (!empty($focus->settings['proxy_on'])) {
         $this->ss->assign("PROXY_CONFIG_DISPLAY", 'inline');
     } else {
         $this->ss->assign("PROXY_CONFIG_DISPLAY", 'none');
     }
     if (!empty($focus->settings['proxy_auth'])) {
         $this->ss->assign("PROXY_AUTH_DISPLAY", 'inline');
     } else {
         $this->ss->assign("PROXY_AUTH_DISPLAY", 'none');
     }
     if (!empty($configurator->config['logger']['level'])) {
         $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), $configurator->config['logger']['level']));
     } else {
         $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), ''));
     }
     if (!empty($configurator->config['lead_conv_activity_opt'])) {
         $this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), $configurator->config['lead_conv_activity_opt']));
     } else {
         $this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), ''));
     }
     if (!empty($configurator->config['logger']['file']['suffix'])) {
         $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, $configurator->config['logger']['file']['suffix']));
     } else {
         $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, ''));
     }
     if (isset($configurator->config['logger_visible'])) {
         $this->ss->assign('logger_visible', $configurator->config['logger_visible']);
     } else {
         $this->ss->assign('logger_visible', true);
     }
     $ebay_site_ids = array('0' => 'eBay United States', '2' => 'eBay Canada (English)', '3' => 'eBay UK', '15' => 'eBay Australia', '16' => 'eBay Austria', '23' => 'eBay Belgium (French)', '71' => 'eBay France', '77' => 'eBay Germany', '100' => 'eBay Motors', '101' => 'eBay Italy', '123' => 'eBay Belgium (Dutch)', '146' => 'eBay Netherlands', '186' => 'eBay Spain', '193' => 'eBay Switzerland', '201' => 'eBay Hong Kong', '203' => 'eBay India', '205' => 'eBay Ireland', '207' => 'eBay Malaysia', '210' => 'eBay Canada (French)', '211' => 'eBay Philippines', '212' => 'eBay Poland', '216' => 'eBay Singapore');
     $this->ss->assign("EBAY_SITE_ID_OPTIONS", get_select_options_with_id($ebay_site_ids, isset($configurator->config['ebay_primary_site_id']) ? $configurator->config['ebay_primary_site_id'] : 0));
     require_once 'modules/xeBayOrders/xeBayOrder.php';
     $this->ss->assign("EBAY_SHIPPING_SERVICE_OPTIONS", get_select_options_with_id(getShippingServiceDropDown(), isset($configurator->config['ebay_shipping_service']) ? $configurator->config['ebay_shipping_service'] : 'HKBAM'));
     $this->ss->assign("EBAY_EXPRESS_CARRIER_OPTIONS", get_select_options_with_id(getExpressCarrierDropDown(), isset($configurator->config['ebay_express_carrier']) ? $configurator->config['ebay_express_carrier'] : 'default'));
     echo $this->getModuleTitle(false);
     $this->ss->display('modules/Configurator/tpls/EditView.tpl');
     $javascript = new javascript();
     $javascript->setFormName("ConfigureSettings");
     $javascript->addFieldGeneric("notify_fromaddress", "email", $mod_strings['LBL_NOTIFY_FROMADDRESS'], TRUE, "");
     $javascript->addFieldGeneric("notify_subject", "varchar", $mod_strings['LBL_NOTIFY_SUBJECT'], TRUE, "");
     $javascript->addFieldGeneric("proxy_host", "varchar", $mod_strings['LBL_PROXY_HOST'], TRUE, "");
     $javascript->addFieldGeneric("proxy_port", "int", $mod_strings['LBL_PROXY_PORT'], TRUE, "");
     $javascript->addFieldGeneric("proxy_password", "varchar", $mod_strings['LBL_PROXY_PASSWORD'], TRUE, "");
     $javascript->addFieldGeneric("proxy_username", "varchar", $mod_strings['LBL_PROXY_USERNAME'], TRUE, "");
     echo $javascript->getScript();
 }
示例#12
0
$quicksearch_js = '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '</script>';
$xtpl->assign("JAVASCRIPT", $quicksearch_js);
if (empty($focus->assigned_user_id) && empty($focus->id)) {
    $focus->assigned_user_id = $current_user->id;
}
if (empty($focus->assigned_name) && empty($focus->id)) {
    $focus->assigned_user_name = $current_user->user_name;
}
$xtpl->assign("ASSIGNED_USER_OPTIONS", get_select_options_with_id(get_user_array(TRUE, "Active", $focus->assigned_user_id), $focus->assigned_user_id));
$xtpl->assign("ASSIGNED_USER_NAME", $focus->assigned_user_name);
$xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id);
$xtpl->assign("REDIRECT_URL_DEFAULT", 'http://');
//required fields on Webtolead form
$campaign = new Campaign();
$javascript = new javascript();
$javascript->setFormName('WebToLeadCreation');
$javascript->setSugarBean($lead);
$javascript->addAllFields('');
//$javascript->addFieldGeneric('redirect_url', '', 'LBL_REDIRECT_URL' ,'true');
$javascript->addFieldGeneric('campaign_name', '', 'LBL_RELATED_CAMPAIGN', 'true');
$javascript->addFieldGeneric('assigned_user_name', '', 'LBL_ASSIGNED_TO', 'true');
$javascript->addToValidateBinaryDependency('campaign_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_LEAD_NOTIFY_CAMPAIGN'], 'false', '', 'campaign_id');
$javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
echo $javascript->getScript();
$json = getJSONobj();
$lead_fields = $json->encode($fields);
$xtpl->assign("LEAD_FIELDS", $lead_fields);
$classname = "SUGAR_GRID";
$xtpl->assign("CLASSNAME", $classname);
$xtpl->assign("DRAG_DROP_CHOOSER_WEB_TO_LEAD", constructDDWebToLeadFields($fields, $classname));
$xtpl->parse("main");
示例#13
0
    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}&nbsp;<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']}&nbsp;<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=''>&nbsp;<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}&nbsp;<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}&nbsp;<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}&nbsp;<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;
    }
    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;
    }
示例#15
0
    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}&nbsp;<span class="required">{$lbl_required_symbol}</span>&nbsp;<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}&nbsp;<span class="required">{$lbl_required_symbol}</span>&nbsp;<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;
    }
    function getFormBody($prefix, $mod = '', $formname = '')
    {
        //Goodwill
        if (!ACLController::checkAccess('ClientOrders', 'edit', true)) {
            return '';
        }
        //End Goodwill
        global $mod_strings;
        $temp_strings = $mod_strings;
        if (!empty($mod)) {
            global $current_language;
            $mod_strings = return_module_language($current_language, $mod);
        }
        global $mod_strings;
        global $app_strings;
        global $current_user;
        //Goodwill
        global $app_list_strings;
        $unit_options = get_select_options_with_id($app_list_strings['unit_of_measure'], "Each");
        //End Goodwill
        $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
        $lbl_number = $mod_strings['LBL_NUMBER'];
        $lbl_name = $mod_strings['LBL_NAME'];
        $user_id = $current_user->id;
        $form = <<<EOQ
\t\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t\t<input type="hidden" name="{$prefix}status" value="New">
\t<p>\t\t{$lbl_number}<span class="required">{$lbl_required_symbol}</span><br>
\t\t\t<input name="{$prefix}number" type="text" value=""><br>
\t\t\t{$lbl_name} <span class="required">{$lbl_required_symbol}</span><br>
\t\t\t
EOQ;
        require_once 'include/javascript/javascript.php';
        require_once 'modules/ClientOrders/ClientOrders.php';
        $javascript = new javascript();
        $javascript->setFormName($formname);
        $javascript->setSugarBean(new ClientOrders());
        $javascript->addField('number', 'true', $prefix);
        $javascript->addField('name', 'true', $prefix);
        $javascript->addField('unit', 'false', $prefix);
        $javascript->addField('limit_price', 'false', $prefix);
        $javascript->addRequiredFields($prefix);
        $form .= $javascript->getScript();
        $mod_strings = $temp_strings;
        return $form;
    }
示例#17
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $current_user, $mod_strings, $app_strings, $app_list_strings, $sugar_config, $locale;
     $configurator = new Configurator();
     $sugarConfig = SugarConfig::getInstance();
     $focus = new Administration();
     $configurator->parseLoggerSettings();
     $focus->retrieveSettings();
     if (!empty($_POST['restore'])) {
         $configurator->restoreConfig();
     }
     $this->ss->assign('MOD', $mod_strings);
     $this->ss->assign('APP', $app_strings);
     $this->ss->assign('APP_LIST', $app_list_strings);
     $this->ss->assign('config', $configurator->config);
     $this->ss->assign('error', $configurator->errors);
     $this->ss->assign('THEMES', SugarThemeRegistry::availableThemes());
     $this->ss->assign('LANGUAGES', get_languages());
     $this->ss->assign("JAVASCRIPT", get_set_focus_js() . get_configsettings_js());
     $this->ss->assign('company_logo', SugarThemeRegistry::current()->getImageURL('company_logo.png'));
     $this->ss->assign("settings", $focus->settings);
     $this->ss->assign("mail_sendtype_options", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $focus->settings['mail_sendtype']));
     if (!empty($focus->settings['proxy_on'])) {
         $this->ss->assign("PROXY_CONFIG_DISPLAY", 'inline');
     } else {
         $this->ss->assign("PROXY_CONFIG_DISPLAY", 'none');
     }
     if (!empty($focus->settings['proxy_auth'])) {
         $this->ss->assign("PROXY_AUTH_DISPLAY", 'inline');
     } else {
         $this->ss->assign("PROXY_AUTH_DISPLAY", 'none');
     }
     if (!empty($configurator->config['logger']['level'])) {
         $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), $configurator->config['logger']['level']));
     } else {
         $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), ''));
     }
     if (!empty($configurator->config['logger']['file']['suffix'])) {
         $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, $configurator->config['logger']['file']['suffix']));
     } else {
         $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, ''));
     }
     echo $this->getModuleTitle();
     $this->ss->display('modules/Configurator/tpls/EditView.tpl');
     $javascript = new javascript();
     $javascript->setFormName("ConfigureSettings");
     $javascript->addFieldGeneric("notify_fromaddress", "email", $mod_strings['LBL_NOTIFY_FROMADDRESS'], TRUE, "");
     $javascript->addFieldGeneric("notify_subject", "varchar", $mod_strings['LBL_NOTIFY_SUBJECT'], TRUE, "");
     $javascript->addFieldGeneric("proxy_host", "varchar", $mod_strings['LBL_PROXY_HOST'], TRUE, "");
     $javascript->addFieldGeneric("proxy_port", "int", $mod_strings['LBL_PROXY_PORT'], TRUE, "");
     $javascript->addFieldGeneric("proxy_password", "varchar", $mod_strings['LBL_PROXY_PASSWORD'], TRUE, "");
     $javascript->addFieldGeneric("proxy_username", "varchar", $mod_strings['LBL_PROXY_USERNAME'], TRUE, "");
     echo $javascript->getScript();
 }
    function getFormBody($prefix, $mod = '', $formname = '')
    {
        if (!ACLController::checkAccess('Prices', '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'];
        $supplier = $mod_strings['LBL_SUPPLIER_NAME'];
        $price = $mod_strings['LBL_PRICE'];
        $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<input type="hidden" name='{$prefix}paper_id'  id='{$prefix}paper_id' value="" />
\t\t<input type="hidden" name="{$prefix}supplier_id" id="{$prefix}supplier_id" value="">
\t\t
\t\t{$name}<br>
\t\t<input id="{$prefix}name" name="{$prefix}name" style="background:inherit; border-style:none;" readOnly size=60 type="text" value=""><br></td>
\t\t</tr><tr>
\t\t<td>{$supplier}<br>
\t\t<input id='{$prefix}supplier_name' name='{$prefix}supplier_name' style="background:inherit; border-style:none;" readOnly type="text" value=""></td>
\t\t</tr>
\t\t<tr>
\t\t<td>{$price}<br>
\t\t<input name='{$prefix}price' size='5' type="text" value=""><br>
\t\t</td>
\t\t
\t\t
EOQ;
        require_once 'include/javascript/javascript.php';
        require_once 'modules/Prices/Price.php';
        $javascript = new javascript();
        $javascript->setFormName($formname);
        $javascript->setSugarBean(new Price());
        $javascript->addField('price', 'true', $prefix);
        $javascript->addRequiredFields($prefix);
        $form .= $javascript->getScript();
        $mod_strings = $temp_strings;
        return $form;
    }
示例#19
0
    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}&nbsp;<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;
    }
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $mod_strings, $app_strings, $app_list_strings;
     require_once "modules/Configurator/metadata/SugarpdfSettingsdefs.php";
     if (file_exists('custom/modules/Configurator/metadata/SugarpdfSettingsdefs.php')) {
         require_once 'custom/modules/Configurator/metadata/SugarpdfSettingsdefs.php';
     }
     if (!empty($_POST['save'])) {
         // Save the logos
         $error = $this->checkUploadImage();
         if (empty($error)) {
             $focus = new Administration();
             foreach ($SugarpdfSettings as $k => $v) {
                 if ($v['type'] == 'password') {
                     if (isset($_POST[$k])) {
                         $_POST[$k] = blowfishEncode(blowfishGetKey($k), $_POST[$k]);
                     }
                 }
             }
             if (!empty($_POST["sugarpdf_pdf_class"]) && $_POST["sugarpdf_pdf_class"] != PDF_CLASS) {
                 // clear the cache for quotes detailview in order to switch the pdf class.
                 if (is_file($cachedfile = sugar_cached('modules/Quotes/DetailView.tpl'))) {
                     unlink($cachedfile);
                 }
             }
             $focus->saveConfig();
             header('Location: index.php?module=Administration&action=index');
         }
     }
     if (!empty($_POST['restore'])) {
         $focus = new Administration();
         foreach ($_POST as $key => $val) {
             $prefix = $focus->get_config_prefix($key);
             if (in_array($prefix[0], $focus->config_categories)) {
                 $result = $focus->db->query("SELECT count(*) AS the_count FROM config WHERE category = '{$prefix[0]}' AND name = '{$prefix[1]}'");
                 $row = $focus->db->fetchByAssoc($result);
                 if ($row['the_count'] != 0) {
                     $focus->db->query("DELETE FROM config WHERE category = '{$prefix[0]}' AND name = '{$prefix[1]}'");
                 }
             }
         }
         header('Location: index.php?module=Configurator&action=SugarpdfSettings');
     }
     echo getClassicModuleTitle("Administration", array("<a href='index.php?module=Administration&action=index'>" . translate('LBL_MODULE_NAME', 'Administration') . "</a>", $mod_strings['LBL_PDFMODULE_NAME']), false);
     $pdf_class = array("TCPDF" => "TCPDF", "EZPDF" => "EZPDF");
     $this->ss->assign('APP_LIST', $app_list_strings);
     $this->ss->assign("JAVASCRIPT", get_set_focus_js());
     $this->ss->assign("SugarpdfSettings", $SugarpdfSettings);
     $this->ss->assign("pdf_enable_ezpdf", PDF_ENABLE_EZPDF);
     if (PDF_ENABLE_EZPDF == "0" && PDF_CLASS == "EZPDF") {
         $error = "ERR_EZPDF_DISABLE";
         $this->ss->assign("selected_pdf_class", "TCPDF");
     } else {
         $this->ss->assign("selected_pdf_class", PDF_CLASS);
     }
     $this->ss->assign("pdf_class", $pdf_class);
     if (!empty($error)) {
         $this->ss->assign("error", $mod_strings[$error]);
     }
     if (!function_exists('imagecreatefrompng')) {
         $this->ss->assign("GD_WARNING", 1);
     } else {
         $this->ss->assign("GD_WARNING", 0);
     }
     $this->ss->display('modules/Configurator/tpls/SugarpdfSettings.tpl');
     require_once "include/javascript/javascript.php";
     $javascript = new javascript();
     $javascript->setFormName("ConfigureSugarpdfSettings");
     foreach ($SugarpdfSettings as $k => $v) {
         if (isset($v["required"]) && $v["required"] == true) {
             $javascript->addFieldGeneric($k, "varchar", $v['label'], TRUE, "");
         }
     }
     echo $javascript->getScript();
 }
示例#21
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()
{
    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;
}
示例#22
0
if (!array_key_exists('aod', $cfg->config)) {
    $cfg->config['aod'] = array('enable_aod' => '');
}
if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'save') {
    $cfg->config['aod']['enable_aod'] = !empty($_REQUEST['enable_aod']);
    $cfg->saveConfig();
    header('Location: index.php?module=Administration&action=index');
    exit;
}
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
$sugar_smarty->assign('APP_LIST', $app_list_strings);
$sugar_smarty->assign('LANGUAGES', get_languages());
$sugar_smarty->assign("JAVASCRIPT", get_set_focus_js());
$sugar_smarty->assign('config', $cfg->config['aod']);
$sugar_smarty->assign('error', $errors);
$buttons = <<<EOQ
    <input title="{$app_strings['LBL_SAVE_BUTTON_TITLE']}"
                       accessKey="{$app_strings['LBL_SAVE_BUTTON_KEY']}"
                       class="button primary"
                       type="submit"
                       name="save"
                       onclick="return check_form('ConfigureSettings');"
                       value="  {$app_strings['LBL_SAVE_BUTTON_LABEL']}  " >
                &nbsp;<input title="{$mod_strings['LBL_CANCEL_BUTTON_TITLE']}"  onclick="document.location.href='index.php?module=Administration&action=index'" class="button"  type="button" name="cancel" value="  {$app_strings['LBL_CANCEL_BUTTON_LABEL']}  " >
EOQ;
$sugar_smarty->assign("BUTTONS", $buttons);
$sugar_smarty->display('custom/modules/Administration/AODAdmin.tpl');
$javascript = new javascript();
$javascript->setFormName('ConfigureSettings');
echo $javascript->getScript();
示例#23
0
    //get select prospect list.
    if (!empty($mrkt_focus->id)) {
        $mrkt_focus->load_relationship('prospectlists');
        $prospectlists = $mrkt_focus->prospectlists->get();
    }
}
if (empty($prospectlists)) {
    $prospectlists = array();
}
if (empty($scope_options)) {
    $scope_options = array();
}
$ss->assign("SCOPE_OPTIONS", get_select_options_with_id($scope_options, $prospectlists));
$ss->assign("SAVE_CONFIRM_MESSAGE", $mod_strings['LBL_CONFIRM_SEND_SAVE']);
$javascript = new javascript();
$javascript->setFormName('wizform');
$javascript->setSugarBean($mrkt_focus);
$javascript->addAllFields('');
echo $javascript->getScript();
/**************************** Final Step UI DIV *******************/
//Grab the prospect list of type default
$default_pl_focus = ' ';
$campaign_focus->load_relationship('prospectlists');
$prospectlists = $campaign_focus->prospectlists->get();
$pl_count = 0;
$pl_lists = 0;
if (!empty($prospectlists)) {
    foreach ($prospectlists as $prospect_id) {
        $pl_focus = new ProspectList();
        $pl_focus->retrieve($prospect_id);
        if ($pl_focus->list_type == 'default' || $pl_focus->list_type == 'seed') {
示例#24
0
 ///////////SHOW TIME COMPONENTS if the workflow is of type "Time"
 if ($exp_meta_array['time_type'] === true) {
     $xtpl->assign('TIME_INTERVAL', $filter_array['time_select']['display']);
     //end if to show time components
 }
 $xtpl->assign('FORM_NAME', $form_name);
 $xtpl->parse("main");
 $xtpl->out("main");
 //rsmith
 $temp_module = BeanFactory::getBean($exp_object->lhs_module);
 $field = $exp_object->lhs_field;
 //now build toggle js
 global $mod_strings, $current_language;
 $mod_strings = return_module_language($current_language, $temp_module->module_dir);
 $javascript = new javascript();
 $javascript->setFormName('FieldViewNonSelector');
 $javascript->setSugarBean($temp_module);
 $type = $temp_module->field_name_map[$field]['type'];
 $js = "";
 if (isset($temp_module->field_name_map[$field]['required'])) {
     if ($type == 'date' || $type == 'time') {
         $js = "<script type=\"text/javascript\">";
         $js .= "addToValidate('EditView', '" . $exp_object->parent_type . "__field_value', 'assigned_user_name', 1,'" . $javascript->stripEndColon(translate($temp_module->field_name_map[$field]['vname'])) . "' )";
         $js .= "</script>";
     } else {
         if (in_array($type, ProcessView::get_js_exception_fields()) == 1) {
             $js = '';
         } else {
             $javascript->addField($field, true, '', $exp_object->parent_type . "__field_value");
             $js = $javascript->getScript();
         }
$GLOBALS['log']->info("Document revision edit view");
$xtpl = new XTemplate('modules/DocumentRevisions/EditView.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
if (isset($_REQUEST['return_module'])) {
    $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
}
if (isset($_REQUEST['return_action'])) {
    $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
}
if (isset($_REQUEST['return_id'])) {
    $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
}
$xtpl->assign("THEME", $theme);
$xtpl->assign("IMAGE_PATH", $image_path);
$xtpl->assign("PRINT_URL", "index.php?" . $GLOBALS['request_string']);
$xtpl->assign("JAVASCRIPT", get_set_focus_js() . get_validate_record_document_revision_js());
$focus->fill_document_name_revision($_REQUEST['return_id']);
$xtpl->assign("ID", $focus->id);
$xtpl->assign("DOCUMENT_NAME", $_REQUEST['document_name']);
$xtpl->assign("CURRENT_REVISION", $_REQUEST['document_revision']);
$xtpl->assign("FILE_URL", UploadFile::get_url($_REQUEST['document_filename'], $_REQUEST['document_revision_id']));
$xtpl->parse("main");
$xtpl->out("main");
//implements required fields check based on the required fields list defined in the bean.
require_once 'include/javascript/javascript.php';
$javascript = new javascript();
$javascript->setFormName('DocumentRevisionEditView');
$javascript->setSugarBean($focus);
$javascript->addAllFields('');
echo $javascript->getScript();
示例#26
0
function processJsForSelectorField(&$javascript, $field, $type, $tempModule, $fieldNumber, $ifAdvanced = 'field')
{
    $jsString = '';
    $javascript = new javascript();
    // Validate everything.
    $workFlowActionsExceptionFields = array();
    if (in_array($type, $workFlowActionsExceptionFields) != 1) {
        $jsString .= "removeFromValidate('EditView', 'field_{$fieldNumber}__{$ifAdvanced}_value');";
    }
    if (in_array($type, array('date', 'time', 'datetimecombo'))) {
        $jsString .= "addToValidate('EditView', 'field_{$fieldNumber}__{$ifAdvanced}_value', 'assigned_user_name', 1,'{$javascript->stripEndColon(translate($tempModule->field_name_map[$field]['vname']))}' )";
    } else {
        if (!(in_array($type, $workFlowActionsExceptionFields) == 1)) {
            $javascript->setFormName('EditView');
            $javascript->setSugarBean($tempModule);
            $javascript->addField($field, '', '', "field_{$_REQUEST['field_num']}__{$ifAdvanced}_value");
            $jsString .= $javascript->getScript(false);
        }
    }
    return $jsString;
}
$xtpl->assign("DOMAIN_NAME", $focus->domain_name);
if (empty($focus->list_type) or $focus->list_type != 'exempt_domain') {
    $xtpl->assign("DOMAIN_HIDDEN", "display:none");
}
if (empty($focus->assigned_user_id) && empty($focus->id)) {
    $focus->assigned_user_id = $current_user->id;
}
if (empty($focus->list_type)) {
    $focus->list_type = 'default';
}
$xtpl->assign("LIST_OPTIONS", get_select_options_with_id($app_list_strings['prospect_list_type_dom'], $focus->list_type));
global $current_user;
if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
    $record = '';
    if (!empty($_REQUEST['record'])) {
        $record = $_REQUEST['record'];
    }
    $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=" . $_REQUEST['action'] . "&from_module=" . $_REQUEST['module'] . "&record=" . $record . "'>" . get_image($image_path . "EditLayout", "border='0' alt='Edit Layout' align='bottom'") . "</a>");
}
//Add Custom Fields
require_once 'modules/DynamicFields/templates/Files/EditView.php';
$xtpl->parse("main.open_source");
$xtpl->parse("main");
$xtpl->out("main");
require_once 'include/javascript/javascript.php';
$javascript = new javascript();
$javascript->setFormName('EditView');
$javascript->setSugarBean($focus);
$javascript->addAllFields('');
$javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
echo $javascript->getScript();
示例#28
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $current_user, $mod_strings, $app_strings, $app_list_strings, $sugar_config, $locale;
     $configurator = new Configurator();
     $sugarConfig = SugarConfig::getInstance();
     $configurator->parseLoggerSettings();
     $focus = Administration::getSettings();
     /*
     if(!empty($_POST['restore'])){
         $configurator->restoreConfig();
     }
     */
     $this->ss->assign('MOD', $mod_strings);
     $this->ss->assign('APP', $app_strings);
     $this->ss->assign('APP_LIST', $app_list_strings);
     $this->ss->assign('config', $configurator->config);
     $this->ss->assign('error', $configurator->errors);
     $this->ss->assign("AUTO_REFRESH_INTERVAL_OPTIONS", get_select_options_with_id($app_list_strings['dashlet_auto_refresh_options_admin'], isset($configurator->config['dashlet_auto_refresh_min']) ? $configurator->config['dashlet_auto_refresh_min'] : 30));
     $this->ss->assign('LANGUAGES', get_languages());
     $this->ss->assign("JAVASCRIPT", get_set_focus_js() . get_configsettings_js());
     $this->ss->assign('company_logo', SugarThemeRegistry::current()->getImageURL('company_logo.png', true, true));
     $this->ss->assign("settings", $focus->settings);
     $this->ss->assign("mail_sendtype_options", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $focus->settings['mail_sendtype']));
     if (!empty($focus->settings['proxy_on'])) {
         $this->ss->assign("PROXY_CONFIG_DISPLAY", 'inline');
     } else {
         $this->ss->assign("PROXY_CONFIG_DISPLAY", 'none');
     }
     if (!empty($focus->settings['proxy_auth'])) {
         $this->ss->assign("PROXY_AUTH_DISPLAY", 'inline');
     } else {
         $this->ss->assign("PROXY_AUTH_DISPLAY", 'none');
     }
     $ini_session_val = ini_get('session.gc_maxlifetime');
     if (!empty($focus->settings['system_session_timeout'])) {
         $this->ss->assign("SESSION_TIMEOUT", $focus->settings['system_session_timeout']);
     } else {
         $this->ss->assign("SESSION_TIMEOUT", $ini_session_val);
     }
     if (!empty($configurator->config['logger']['level'])) {
         $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), $configurator->config['logger']['level']));
     } else {
         $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), ''));
     }
     if (!empty($configurator->config['lead_conv_activity_opt'])) {
         $this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), $configurator->config['lead_conv_activity_opt']));
     } else {
         $this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), ''));
     }
     if (!empty($configurator->config['logger']['file']['suffix'])) {
         $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, $configurator->config['logger']['file']['suffix']));
     } else {
         $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, ''));
     }
     if (isset($configurator->config['logger_visible'])) {
         $this->ss->assign('logger_visible', $configurator->config['logger_visible']);
     } else {
         $this->ss->assign('logger_visible', true);
     }
     $this->ss->assign('list_entries_per_listview_help', str_replace('{{listEntriesNum}}', '50', $mod_strings['TPL_LIST_ENTRIES_PER_LISTVIEW_HELP']));
     $this->ss->assign('list_entries_per_subpanel_help', str_replace('{{subpanelEntriesNum}}', '25', $mod_strings['TPL_LIST_ENTRIES_PER_SUBPANEL_HELP']));
     echo $this->getModuleTitle(false);
     $this->ss->display('modules/Configurator/tpls/EditView.tpl');
     $javascript = new javascript();
     $javascript->setFormName("ConfigureSettings");
     $javascript->addFieldGeneric("notify_fromaddress", "email", $mod_strings['LBL_NOTIFY_FROMADDRESS'], TRUE, "");
     $javascript->addFieldGeneric("notify_subject", "varchar", $mod_strings['LBL_NOTIFY_SUBJECT'], TRUE, "");
     $javascript->addFieldGeneric("proxy_host", "varchar", $mod_strings['LBL_PROXY_HOST'], TRUE, "");
     $javascript->addFieldGeneric("proxy_port", "int", $mod_strings['LBL_PROXY_PORT'], TRUE, "");
     $javascript->addFieldGeneric("proxy_password", "varchar", $mod_strings['LBL_PROXY_PASSWORD'], TRUE, "");
     $javascript->addFieldGeneric("proxy_username", "varchar", $mod_strings['LBL_PROXY_USERNAME'], TRUE, "");
     $javascript->addFieldRange("system_session_timeout", "int", $mod_strings['SESSION_TIMEOUT'], TRUE, "", 0, $ini_session_val);
     echo $javascript->getScript();
 }
    function getFormBody($prefix, $mod = '', $formname = '')
    {
        //Goodwill
        if (!ACLController::checkAccess('Paper', 'edit', true)) {
            return '';
        }
        //End Goodwill
        global $mod_strings;
        $temp_strings = $mod_strings;
        if (!empty($mod)) {
            global $current_language;
            $mod_strings = return_module_language($current_language, $mod);
        }
        global $mod_strings;
        global $app_strings;
        global $current_user;
        //Goodwill
        global $app_list_strings;
        $price_unit_options = get_select_options_with_id($app_list_strings['paper_price_unit_dom'], "Dollars");
        //End Goodwill
        $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
        $lbl_pname = $mod_strings['LBL_PNAME'];
        $lbl_fname = $mod_strings['LBL_FNAME'];
        $lbl_format = $mod_strings['LBL_SIZE'];
        $lbl_weight = $mod_strings['LBL_WEIGHT'];
        $weight_options = get_select_options_with_id($app_list_strings['paper_weight_unit_dom'], "");
        $lbl_type = $mod_strings['LBL_CHROME'];
        $type_options = get_select_options_with_id($app_list_strings['paper_chrome_dom'], "");
        $lbl_side = $mod_strings['LBL_SIDE'];
        $side_options = get_select_options_with_id($app_list_strings['paper_side_dom'], "");
        $lbl_absortion = $mod_strings['LBL_ABSORBTION'];
        $absortion_options = get_select_options_with_id($app_list_strings['paper_absorption_dom'], "");
        $lbl_texture = $mod_strings['LBL_TEXTURE'];
        $texture_options = get_select_options_with_id($app_list_strings['paper_texture_dom'], "");
        $lbl_price_unit = '';
        $user_id = $current_user->id;
        $form = <<<EOQ
\t\t\t</tr>
\t\t\t<tr>
\t\t\t<td>
\t\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t\t{$lbl_pname}<span class="required">{$lbl_required_symbol}</span><br>
\t\t\t<input name="{$prefix}pname" type="text" value=""><br></td>
\t\t\t<td>
\t\t\t{$lbl_fname} <span class="required">{$lbl_required_symbol}</span><br>
\t\t\t<input name='{$prefix}fname' type="text" value=""><br></td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t<td>

\t\t\t{$lbl_format}<br>
\t\t\t<input name='size_h' size='4' maxlength='50' type="text">x<input name='size_w' size='4' maxlength='50' type="text"><br></td>
\t\t\t<td>
\t\t\t{$lbl_weight} <br>
\t\t\t<input name='{$prefix}weight' size='5' type="text" value="">
\t\t\t<select name='{$prefix}weight_unit'>{$weight_options}</select><br></td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t<td>
\t\t\t
\t\t\t{$lbl_type}<br>
\t\t\t<select name='{$prefix}chrome'>{$type_options}</select><br></td>
\t\t\t<td>
\t\t\t{$lbl_side}<br>
\t\t\t<select name='{$prefix}side'>{$side_options}</select><br></td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t<td>
\t\t\t
\t\t\t{$lbl_absortion}<br>
\t\t\t<select name='{$prefix}absorbtion'>{$absortion_options}</select><br></td>
\t\t\t<td>
\t\t\t{$lbl_texture} <br>
\t\t\t<select name='{$prefix}texture'>{$texture_options}</select><br></td>
\t\t\t</tr>
\t\t\t
EOQ;
        require_once 'include/javascript/javascript.php';
        require_once 'modules/Paper/Paper.php';
        $javascript = new javascript();
        $javascript->setFormName($formname);
        $javascript->setSugarBean(new Paper());
        $javascript->addField('pname', 'true', $prefix);
        $javascript->addField('fname', 'true', $prefix);
        //$javascript->addField('price','false',$prefix);
        $javascript->addRequiredFields($prefix);
        $form .= $javascript->getScript();
        $mod_strings = $temp_strings;
        return $form;
    }
示例#30
0
 /**
  * Builds a template
  * This is a private function that should be called only from checkTemplate method
  *
  * @param module string module name
  * @param view string view need (eg DetailView, EditView, etc)
  * @param tpl string generic tpl to use
  * @param ajaxSave boolean parameter indicating whether or not this is coming from an Ajax call
  * @param metaDataDefs metadata definition as Array
  **/
 function buildTemplate($module, $view, $tpl, $ajaxSave, $metaDataDefs)
 {
     $this->loadSmarty();
     $cacheDir = create_cache_directory($this->templateDir . $module . '/');
     $file = $cacheDir . $view . '.tpl';
     $string = '{* Create Date: ' . date('Y-m-d H:i:s') . "*}\n";
     $this->ss->left_delimiter = '{{';
     $this->ss->right_delimiter = '}}';
     $this->ss->assign('module', $module);
     $this->ss->assign('built_in_buttons', array('CANCEL', 'DELETE', 'DUPLICATE', 'EDIT', 'FIND_DUPLICATES', 'SAVE', 'CONNECTOR'));
     $contents = $this->ss->fetch($tpl);
     //Insert validation and quicksearch stuff here
     if ($view == 'EditView' || strpos($view, 'QuickCreate') || $ajaxSave || $view == "ConvertLead") {
         global $dictionary, $beanList, $app_strings, $mod_strings;
         $mod = $beanList[$module];
         if ($mod == 'aCase') {
             $mod = 'Case';
         }
         $defs = $dictionary[$mod]['fields'];
         $defs2 = array();
         //Retrieve all panel field definitions with displayParams Array field set
         $panelFields = array();
         foreach ($metaDataDefs['panels'] as $panel) {
             foreach ($panel as $row) {
                 foreach ($row as $entry) {
                     if (empty($entry)) {
                         continue;
                     }
                     if (is_array($entry) && isset($entry['name']) && isset($entry['displayParams']) && isset($entry['displayParams']['required']) && $entry['displayParams']['required']) {
                         $panelFields[$entry['name']] = $entry;
                     }
                     if (is_array($entry)) {
                         $defs2[$entry['name']] = $entry;
                     } else {
                         $defs2[$entry] = array('name' => $entry);
                     }
                 }
                 //foreach
             }
             //foreach
         }
         //foreach
         foreach ($panelFields as $field => $value) {
             $nameList = array();
             if (!is_array($value['displayParams']['required'])) {
                 $nameList[] = $field;
             } else {
                 foreach ($value['displayParams']['required'] as $groupedField) {
                     $nameList[] = $groupedField;
                 }
             }
             foreach ($nameList as $x) {
                 if (isset($defs[$x]) && isset($defs[$x]['type']) && !isset($defs[$x]['required'])) {
                     $defs[$x]['required'] = true;
                 }
             }
         }
         //foreach
         //Create a base class with field_name_map property
         $sugarbean = new stdClass();
         $sugarbean->field_name_map = $defs;
         $sugarbean->module_dir = $module;
         $javascript = new javascript();
         $view = $view == 'QuickCreate' ? "QuickCreate_{$module}" : $view;
         $javascript->setFormName($view);
         $javascript->setSugarBean($sugarbean);
         if ($view != "ConvertLead") {
             $javascript->addAllFields('', null, true);
         }
         $validatedFields = array();
         $javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $javascript->buildStringToTranslateInSmarty('ERR_SQS_NO_MATCH_FIELD') . ': ' . $javascript->buildStringToTranslateInSmarty('LBL_ASSIGNED_TO'), 'false', '', 'assigned_user_id');
         $validatedFields[] = 'assigned_user_name';
         //Add remaining validation dependency for related fields
         //1) a relate type as defined in vardefs
         //2) set in metadata layout
         //3) not have validateDepedency set to false in metadata
         //4) have id_name in vardef entry
         //5) not already been added to Array
         foreach ($sugarbean->field_name_map as $name => $def) {
             if ($def['type'] == 'relate' && isset($defs2[$name]) && (!isset($defs2[$name]['validateDependency']) || $defs2[$name]['validateDependency'] === true) && isset($def['id_name']) && !in_array($name, $validatedFields)) {
                 if (isset($mod_strings[$def['vname']]) || isset($app_strings[$def['vname']]) || translate($def['vname'], $sugarbean->module_dir) != $def['vname']) {
                     $vname = $def['vname'];
                 } else {
                     $vname = "undefined";
                 }
                 $javascript->addToValidateBinaryDependency($name, 'alpha', $javascript->buildStringToTranslateInSmarty('ERR_SQS_NO_MATCH_FIELD') . ': ' . $javascript->buildStringToTranslateInSmarty($vname), !empty($def['required']) ? 'true' : 'false', '', $def['id_name']);
                 $validatedFields[] = $name;
             }
         }
         //foreach
         $contents .= "{literal}\n";
         $contents .= $javascript->getScript();
         $contents .= $this->createQuickSearchCode($defs, $defs2, $view, $module);
         $contents .= "{/literal}\n";
     } else {
         if (preg_match('/^SearchForm_.+/', $view)) {
             global $dictionary, $beanList, $app_strings, $mod_strings;
             $mod = $beanList[$module];
             if ($mod == 'aCase') {
                 $mod = 'Case';
             }
             $defs = $dictionary[$mod]['fields'];
             $contents .= '{literal}';
             $contents .= $this->createQuickSearchCode($defs, array(), $view);
             $contents .= '{/literal}';
         }
     }
     //if
     //Remove all the copyright comments
     $contents = preg_replace('/\\{\\*[^\\}]*?\\*\\}/', '', $contents);
     if ($fh = @sugar_fopen($file, 'w')) {
         fputs($fh, $contents);
         fclose($fh);
     }
     $this->ss->left_delimiter = '{';
     $this->ss->right_delimiter = '}';
 }