当前位置: 首页>>代码示例>>PHP>>正文


PHP javascript::setSugarBean方法代码示例

本文整理汇总了PHP中javascript::setSugarBean方法的典型用法代码示例。如果您正苦于以下问题:PHP javascript::setSugarBean方法的具体用法?PHP javascript::setSugarBean怎么用?PHP javascript::setSugarBean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javascript的用法示例。


在下文中一共展示了javascript::setSugarBean方法的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;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:39,代码来源:Forms.php

示例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;
    }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:49,代码来源:NoteFormBase.php

示例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}&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;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:50,代码来源:Forms.php

示例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;
    }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:41,代码来源:EmailTemplateFormBase.php

示例5: buildTemplate

 /**
  * 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
//.........这里部分代码省略.........
开发者ID:vsanth,项目名称:dynamic-crm,代码行数:101,代码来源:TemplateHandler.php

示例6: processJsForSelectorField

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;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:21,代码来源:Selector.php

示例7: 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}&nbsp;<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']}&nbsp;<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=''>&nbsp;<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']}&nbsp;<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}&nbsp;<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;
    }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:69,代码来源:QuoteFormBase.php

示例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}&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;
    }
开发者ID:sunmo,项目名称:snowlotus,代码行数:63,代码来源:MeetingFormBase.php

示例9: javascript

$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();
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:EditView.php

示例10: array

    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') {
            $default_pl_focus = $pl_focus;
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:31,代码来源:WizardMarketing.php

示例11: 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;
    }
开发者ID:omusico,项目名称:sugar_work,代码行数:44,代码来源:LeadFormBase.php

示例12: 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}&nbsp;<span class="required">{$lbl_required_symbol}</span><br>
\t\t\t<input name='name' type="text" value=""><br>
\t\t\t{$lbl_list_type}&nbsp;<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;
    }
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:37,代码来源:ProspectListFormBase.php

示例13: 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}&nbsp;<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;
    }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:78,代码来源:SupplierFormBase.php

示例14: javascript

     if (isset($_REQUEST['return_id'])) {
         $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
     } else {
         if (!empty($_REQUEST['record'])) {
             $xtpl->assign("RETURN_ID", $_REQUEST['record']);
         }
     }
     if (!empty($xtpl_data['STATUS']) && $xtpl_data['STATUS'] > 0) {
         $xtpl_data['STATUS_CHECKED'] = 'checked';
     }
     $xtpl->assign('IFRAME', $xtpl_data);
     $xtpl->parse('main');
     $xtpl->out('main');
     $javascript = new javascript();
     $javascript->setFormName('EditView');
     $javascript->setSugarBean($iFrame);
     $javascript->addAllFields('');
     echo $javascript->getScript();
 } else {
     if (!empty($_REQUEST['delete']) || !empty($_REQUEST['listview']) || empty($_REQUEST['record']) && empty($_REQUEST['edit'])) {
         $button_title = $app_strings['LBL_NEW_BUTTON_LABEL'];
         $sugar_config['disable_export'] = true;
         $iFrame = new iFrame();
         $ListView = new ListView();
         $where = '';
         if (!is_admin($current_user)) {
             $where = "created_by='{$current_user->id}'";
         }
         $ListView->initNewXTemplate('modules/iFrames/ListView.html', $mod_strings);
         $ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE'] . '&nbsp;');
         $ListView->setQuery($where, "", "name", "IFRAME");
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:index.php

示例15: 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>&nbsp;<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;
    }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:30,代码来源:FeedFormBase.php


注:本文中的javascript::setSugarBean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。