zoukankan      html  css  js  c++  java
  • SugarCRM 主表自定义字段

    1.创建字段
    \modules\bw_MessageSends\vardefs.php
    文本字段
    'name' =>array (
    'name' => 'name',
    'type' => 'varchar', //还有这些类型 name ,phone , enum , datetime
    'dbType' => 'varchar',
    'vname' => 'LBL_ACCOUNT_NAME', //标签名
    'reportable'=>true,
    'len' => 150,
    ),
    'HomeTel' =>array (
    'name' => 'HomeTel',
    'vname' => 'LBL_HomeTel',
    'type' => 'phone',
    'dbType' => 'varchar',
    'reportable'=>true,
    'len' => 25,
    ),

    下拉菜单字段
    'account_type' => array (
    'name' => 'account_type',
    'vname' => 'LBL_TYPE',
    'type' => 'enum',
    'options' => 'account_type_dom1',
    'reportable'=>true,
    'len'=>25,
    ),
    2.$fields_array[] 数组
    \modules\bw_Msg_MT3101s\field_arrays.php

    $fields_array['bw_Msg_MT3101'] = array (
    'column_fields' => array(
    'id',
    'date_entered',

    'message_id',//自定义字段
    'function_code',
    'message_type',
    'sender_id',
    'receiver_id',
    //BUILDER: included fields

    说明:这部分不写则sql语句生成没有自定义字段,保存不上数据库
    \include\formbase.php 文件中的 populateFromPost() 是将$_POST 的数据赋到 $focus->$field = $value 中。

    3.赋标签
    \modules\bw_MessageSends\language.php
    $mod_strings['LBL_TYPE'] = '报文编号';

    $mod_strings = array (
    'LBL_TYPE' => '发送报文管理',
    4.修复数据库
    修复数据库后vardefs.php 中的字段自动更新至数据库中
  • 相关阅读:
    p5js弹钢琴
    javascript——拖拽(完整兼容代码)
    js正则表达式和replace
    CSS最常用和实用的技巧
    优化MYSQL数据库的方法
    css默认样式
    javascript之document对象
    常见JS(JavaScript)冲突解决方法
    String对象中的正则表达式
    css去掉a标签点击后的虚线框
  • 原文地址:https://www.cnblogs.com/hailexuexi/p/1953226.html
Copyright © 2011-2022 走看看