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;
    }
示例#2
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;
}
示例#3
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 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;
    }
    function getWideFormBody($prefix, $mod = '', $formname = '', $contact = '', $portal = true)
    {
        if (!ACLController::checkAccess('Ink', 'edit', true)) {
            return '';
        }
        require_once 'modules/Ink/Ink.php';
        if (empty($ink)) {
            $ink = new Ink();
        }
        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_first_name = $mod_strings['LBL_FIRST_NAME'];
        $lbl_last_name = $mod_strings['LBL_LAST_NAME'];
        $lbl_phone = $mod_strings['LBL_OFFICE_PHONE'];
        $lbl_address = $mod_strings['LBL_PRIMARY_ADDRESS'];
        if (isset($ink->assigned_user_id)) {
            $user_id = $ink->assigned_user_id;
        } else {
            $user_id = $current_user->id;
        }
        $lbl_email_address = $mod_strings['LBL_EMAIL_ADDRESS'];
        $salutation_options = get_select_options_with_id($app_list_strings['salutation_dom'], $ink->salutation);
        if (isset($ink->lead_source)) {
            $lead_source_options = get_select_options_with_id($app_list_strings['lead_source_dom'], $ink->lead_source);
        } else {
            $lead_source_options = get_select_options_with_id($app_list_strings['lead_source_dom'], '');
        }
        $form = "";
        if ($formname == 'ConvertProspect') {
            $lead_source_label = "<td class='dataLabel'>&nbsp;</td>";
            $lead_source_field = "<td class='dataField'>&nbsp;</td>";
        } else {
            $lead_source_label = "<td class='dataLabel' nowrap>{$mod_strings['LBL_LEAD_SOURCE']}</td>";
            $lead_source_field = "<td class='dataField'><select name='{$prefix}lead_source'>{$lead_source_options}</select></td>";
        }
        $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<table border='0' celpadding="0" cellspacing="0" width='100%'>
\t\t<tr>
\t\t<td  nowrap class='dataLabel'>{$lbl_first_name}</td>
\t\t<td  class='dataLabel'>{$lbl_last_name}&nbsp;<span class="required">{$lbl_required_symbol}</span></td>
\t\t<td class='dataLabel' nowrap>{$mod_strings['LBL_TITLE']}</td>
\t\t<td class='dataLabel' nowrap>{$mod_strings['LBL_DEPARTMENT']}</td>
\t\t</tr>
\t\t<tr>
\t\t<td class='dataField'><select name='{$prefix}salutation'>{$salutation_options}</select>&nbsp;<input name="{$prefix}first_name" type="text" value="{$ink->first_name}"></td>
\t\t<td class='dataField'><input name='{$prefix}last_name' type="text" value="{$ink->last_name}"></td>
\t\t<td class='dataField' nowrap><input name='{$prefix}title' type="text" value="{$ink->title}"></td>
\t\t<td class='dataField' nowrap><input name='{$prefix}department' type="text" value="{$ink->department}"></td>
\t\t</tr>
\t\t<tr>
\t\t<td nowrap colspan='4' class='dataLabel'>{$lbl_address}</td>
\t\t</tr>

\t\t<tr>
\t\t<td nowrap colspan='4' class='dataField'><textarea cols='80' rows='2' name='{$prefix}primary_address_street'>{$ink->primary_address_street}</textarea></td>
\t\t</tr>

\t\t<tr>
\t\t<td class='dataLabel'>{$mod_strings['LBL_CITY']}</td>
\t\t<td class='dataLabel'>{$mod_strings['LBL_STATE']}</td>
\t\t<td class='dataLabel'>{$mod_strings['LBL_POSTAL_CODE']}</td>
\t\t<td class='dataLabel'>{$mod_strings['LBL_COUNTRY']}</td>
\t\t</tr>

\t\t<tr>
\t\t<td class='dataField'><input name='{$prefix}primary_address_city'  maxlength='100' value='{$ink->primary_address_city}'></td>
\t\t<td class='dataField'><input name='{$prefix}primary_address_state'  maxlength='100' value='{$ink->primary_address_state}'></td>
\t\t<td class='dataField'><input name='{$prefix}primary_address_postalcode'  maxlength='100' value='{$ink->primary_address_postalcode}'></td>
\t\t<td class='dataField'><input name='{$prefix}primary_address_country'  maxlength='100' value='{$ink->primary_address_country}'></td>
\t\t</tr>


\t\t<tr>
\t\t<td nowrap class='dataLabel'>{$lbl_phone}</td>
\t\t<td nowrap class='dataLabel'>{$mod_strings['LBL_MOBILE_PHONE']}</td>
\t\t<td nowrap class='dataLabel'>{$mod_strings['LBL_FAX_PHONE']}</td>
\t\t<td nowrap class='dataLabel'>{$mod_strings['LBL_HOME_PHONE']}</td>
\t\t</tr>

\t\t<tr>
\t\t<td nowrap class='dataField'><input name='{$prefix}phone_work' type="text" value="{$ink->phone_work}"></td>
\t\t<td nowrap class='dataField'><input name='{$prefix}phone_mobile' type="text" value="{$ink->phone_mobile}"></td>
\t\t<td nowrap class='dataField'><input name='{$prefix}phone_fax' type="text" value="{$ink->phone_fax}"></td>
\t\t<td nowrap class='dataField'><input name='{$prefix}phone_home' type="text" value="{$ink->phone_home}"></td>
\t\t</tr>

\t\t<tr>
\t\t<td class='dataLabel' nowrap>{$lbl_email_address}</td>
\t\t<td class='dataLabel' nowrap>{$mod_strings['LBL_OTHER_EMAIL_ADDRESS']}</td>
\t\t<td class='dataLabel' nowrap>{$mod_strings['LBL_OTHER_PHONE']}</td>
\t\t{$lead_source_label}
\t\t</tr>

\t\t<tr>
\t\t<td class='dataField' nowrap><input name='{$prefix}email1' type="text" value="{$ink->email1}"></td>
\t\t<td class='dataField' nowrap><input name='{$prefix}email2' type="text" value="{$ink->email2}"></td>
\t\t<td class='dataField' nowrap><input name='{$prefix}phone_other' type="text" value="{$ink->phone_other}"></td>\t\t
\t\t{$lead_source_field}
\t\t</tr>

\t\t<tr>
\t\t<td nowrap colspan='4' class='dataLabel'>{$mod_strings['LBL_DESCRIPTION']}</td>
\t\t</tr>
\t\t<tr>
\t\t<td nowrap colspan='4' class='dataField'><textarea cols='80' rows='4' name='{$prefix}description' >{$ink->description}</textarea></td>
\t\t</tr>
EOQ;
        //carry forward custom lead fields common to inks during Lead Conversion
        $tempContact = new Contact();
        if (method_exists($ink, 'convertCustomFieldsForm')) {
            $ink->convertCustomFieldsForm($form, $tempContact, $prefix);
        }
        unset($tempContact);
        $form .= <<<EOQ

\t\t</table>
\t\t<input type='hidden' name='{$prefix}department'  value='{$ink->department}'>
\t\t<input type='hidden' name='{$prefix}phone_other'  value='{$ink->phone_other}'>
\t\t<input type='hidden' name='{$prefix}alt_address_street'  value='{$ink->alt_address_street}'>
\t\t<input type='hidden' name='{$prefix}alt_address_city' value='{$ink->alt_address_city}'><input type='hidden' name='{$prefix}alt_address_state'   value='{$ink->alt_address_state}'><input type='hidden' name='{$prefix}alt_address_postalcode'   value='{$ink->alt_address_postalcode}'><input type='hidden' name='{$prefix}alt_address_country'  value='{$ink->alt_address_country}'>
\t\t<input type='hidden' name='{$prefix}do_not_call'  value='{$ink->do_not_call}'>
\t\t<input type='hidden' name='{$prefix}email_opt_out'  value='{$ink->email_opt_out}'>
EOQ;
        if ($portal == true) {
            if (isset($ink->portal_name)) {
                $form .= "<input type='hidden' name='{$prefix}portal_name'  value='{$ink->portal_name}'>";
            } else {
                $form .= "<input type='hidden' name='{$prefix}portal_name'  value=''>";
            }
            if (isset($ink->portal_app)) {
                $form .= "<input type='hidden' name='{$prefix}portal_app'  value='{$ink->portal_app}'>";
            } else {
                $form .= "<input type='hidden' name='{$prefix}portal_app'  value=''>";
            }
            if (!empty($ink->portal_name) && !empty($ink->portal_app)) {
                $form .= "<input name='{$prefix}portal_active' type='hidden' size='25'  value='1' >";
            }
            if (isset($ink->portal_password)) {
                $form .= "<input type='password' name='{$prefix}portal_password1'  value='{$ink->portal_password}'>";
                $form .= "<input type='password' name='{$prefix}portal_password'  value='{$ink->portal_password}'>";
                $form .= "<input name='{$prefix}old_portal_password' type='hidden' size='25'  value='{$ink->portal_password}' >";
            } else {
                $form .= "<input type='password' name='{$prefix}portal_password1'  value=''>";
                $form .= "<input type='password' name='{$prefix}portal_password'  value=''>";
                $form .= "<input name='{$prefix}old_portal_password' type='hidden' size='25'  value='' >";
            }
        }
        require_once 'include/javascript/javascript.php';
        require_once 'modules/Contacts/Contact.php';
        $javascript = new javascript();
        $javascript->setFormName($formname);
        $javascript->setSugarBean(new Contact());
        $javascript->addField('email1', 'false', $prefix);
        $javascript->addField('email2', 'false', $prefix);
        $javascript->addRequiredFields($prefix);
        $form .= $javascript->getScript();
        $mod_strings = $temp_strings;
        return $form;
    }
    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;
    }
示例#7
0
    $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();
            }
        }
    }
    echo $js;
    //rsmith
}
示例#8
0
\t  \tvar thelink="<a href='" + text + "''" + ">'" + SUGAR.language.get('KBDocuments', 'LBL_DEFAULT_LINK_TEXT') + "'</a>";
\t  \tinsert_variable_html(thelink);
\t  }
\t  </SCRIPT>
EOQ;
$javascript = new javascript();
$javascript->setFormName('EditView');
$javascript->setSugarBean($focus);
//$javascript->addAllFields('');
//add custom fields to validation
foreach ($javascript->sugarbean->field_name_map as $field => $value) {
    if (isset($value['custom_type'])) {
        if ($value['custom_type'] != 'link') {
            //pass in required flag if set to required
            if (isset($value['required']) && $value['required']) {
                $javascript->addField($field, true);
            } else {
                //if not required, then just pass in to validate
                $javascript->addField($field, false);
            }
        }
    }
}
$javascript->addFieldGeneric('kbdocument_name', '', 'LBL_ARTICLE_TITLE', 'true');
$javascript->addFieldGeneric('assigned_user_name', 'varchar', $mod_strings['LBL_ARTICLE_AUTHOR'], 'true');
$javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_ARTICLE_AUTHOR'], 'false', '', 'assigned_user_id');
$javascript->addToValidateBinaryDependency('kbdoc_approver_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_ARTICLE_APPROVED_BY'], 'false', '', 'kbdoc_approver_id');
$javascript->addFieldGeneric('kbdocument_revision_number', '', 'LBL_DOC_VERSION', 'true');
$javascript->addFieldGeneric('team_name', 'varchar', $app_strings['LBL_TEAM'], 'true');
$javascript->addToValidateBinaryDependency('team_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_TEAM'], 'false', '', 'team_id');
$javascript->addFieldGeneric('tiny_vals', '', 'LBL_ARTICLE_BODY', 'true');
示例#9
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('Tasks', 'edit', true)) {
        return '';
    }
    require_once 'include/time.php';
    global $app_strings, $mod_strings, $app_list_strings;
    global $current_user;
    global $theme;
    // Unimplemented until jscalendar language files are fixed
    // global $current_language;
    // global $default_language;
    // global $cal_codes;
    $user_id = $current_user->id;
    $default_status = $mod_strings['LBL_DEFAULT_STATUS'];
    $default_priority = $mod_strings['LBL_DEFAULT_PRIORITY'];
    $default_parent_type = $app_list_strings['record_type_default_key'];
    // Unimplemented until jscalendar language files are fixed
    // $cal_lang = (empty($cal_codes[$current_language])) ? $cal_codes[$default_language] : $cal_codes[$current_language];
    $cal_lang = "en";
    $cal_dateformat = parse_calendardate($app_strings['NTC_DATE_FORMAT']);
    $ntc_time_format = '(' . getDisplayTimeFormat() . ')';
    $ampm = AMPMMenu('', '');
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $the_form .= <<<EOQ
\t\t<form name="TaskSave" onSubmit="return check_form('TaskSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="module" value="Tasks">
\t\t\t<input type="hidden" name="record" value="">
\t\t\t<input type="hidden" name="status" value="{$default_status}">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
\t\t\t<input type="hidden" name="priority" value="{$default_priority}">
\t\t\t<input type="hidden" name="parent_type" value="{$default_parent_type}">
\t\t\t<input type="hidden" name="action" value="Save">
\t\t\t<input type="hidden" name="date_due_flag">
\t\t<p>{$mod_strings['LBL_NEW_FORM_SUBJECT']} <span class="required">{$app_strings['LBL_REQUIRED_SYMBOL']}</span><br>
\t\t<input name='name' type="text" value=""><br>
\t\t{$mod_strings['LBL_NEW_FORM_DUE_DATE']}&nbsp;<span class="dateFormat">{$app_strings['NTC_DATE_FORMAT']}</span><br>
\t\t<input name='date_due' maxlength="10" onblur="parseDate(this, '{$cal_dateformat}');" id='jscal_field' type="text" value=""> <img src="themes/{$theme}/images/jscalendar.gif" alt="{$app_strings['LBL_ENTER_DATE']}"  id="jscal_trigger" align="absmiddle"><br>
\t\t{$mod_strings['LBL_NEW_FORM_DUE_TIME']}&nbsp;<span class="dateFormat">{$ntc_time_format}</span><br>
\t\t<input name='time_due' maxlength='5' type="text">&nbsp;{$ampm}</p>
\t\t<p><input title="{$app_strings['LBL_SAVE_BUTTON_TITLE']}" accessKey="{$app_strings['LBL_SAVE_BUTTON_KEY']}" class="button" type="submit" name="button" value="{$app_strings['LBL_SAVE_BUTTON_LABEL']}" ></p>
\t\t</form>
\t\t<script type="text/javascript">
\t\tCalendar.setup ({
\t\t\tinputField : "jscal_field", ifFormat : "{$cal_dateformat}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1
\t\t});
\t\t</script>
EOQ;
    require_once 'include/javascript/javascript.php';
    require_once 'modules/Tasks/Task.php';
    $javascript = new javascript();
    $javascript->setFormName('TaskSave');
    $javascript->setSugarBean(new Task());
    $javascript->addRequiredFields('');
    $javascript->addField('date_due', false, '');
    $javascript->addField('time_due', false, '');
    $the_form .= $javascript->getScript();
    $the_form .= get_left_form_footer();
    return $the_form;
}
示例#10
0
    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;
    }