php - SugarCRM 按需将 TextField 转换为 DropDown

标签 php manifest sugarcrm

类似的问题以前在这里发布过,但它仅适用于 On-Site SugarCRM 实例(也是很久以前的事)。

在我的例子中,我想在我无权访问配置文件的按需实例上将“账单国家/地区”字段从“TextField”更改为“DropDdown”。我该怎么做?

到目前为止,我已经使用模块加载器尝试了不同的 PHP 文件,但它也不起作用。

请在下面找到我的 PHP 脚本:

<?php

$manifest = array(
    'acceptable_sugar_flavors' => array('CE', 'PRO', 'CORP', 'ENT', 'ULT'),
    'acceptable_sugar_versions' => array(
        'exact_matches' => array(),
        'regex_matches' => array(
            0 => '6\\.5\\.(.*?)',
            1 => '6\\.7\\.(.*?)',
            2 => '7\\.2\\.(.*?)',
            3 => '7\\.2\\.(.*?)\\.(.*?)',
            4 => '7\\.5\\.(.*?)\\.(.*?)',
            5 => '7\\.6\\.(.*?)\\.(.*?)'
        ),
    ),
    'name' => 'Textfield to Dropdown',
    'description' => 'Converting Billing Country textfield to Dropdown Field',
    'author' => 'myname',
    'icon' => '',
    'is_uninstallable' => true,
    'published_date' => '2015-01-09 19:00:00',
    'type' => 'module',
    'version' => '1.0',
);

$dictionary['Account']['fields']['billing_address_country']['type'] = 'enum';
$dictionary['Account']['fields']['billing_address_country']['ext1'] = 'countries_dom';

模块加载正常,但快速修复后没有任何变化。我也尝试使用以下变量:

$dictionary['Account']['fields']['billing_address_country']['isDropDown']=yes;

和...

$dictionary['Account']['fields']['billing_address_country']['Options']='countries_dom';

谁能告诉我我做错了什么?如果您有任何帮助或指导,我将不胜感激。请指教。

干杯, H

附言我正在使用 SugarCRM On-Demand 版本 7.6.1

最佳答案

您需要创建 manifest.php 文件并将其指向您要复制/上传以进行自定义的文件:

list .php:

<?php

$manifest = array(
    'built_in_version' => '7.6.1.0',
    'acceptable_sugar_versions' =>
        array(
            0 => '',
        ),
    'acceptable_sugar_flavors' =>
        array(
            0 => 'PRO',
            1 => 'CORP',
            2 => 'ENT',
            3 => 'ULT',
        ),
    'readme' => '',
    'key' => 'SO',
    'author' => 'Eric',
    'description' => 'Convert Accounts Billing Country TextField to Enum',
    'icon' => '',
    'is_uninstallable' => true,
    'name' => 'TextFieldToDropdownPkg',
    'published_date' => '2016-01-10 03:01:01',
    'type' => 'module',
    'version' => 1452378413,
    'remove_tables' => 'prompt',
);

$installdefs = array(
    'id' => 'TextFieldToDropdownPkg',
    'copy' => array(
        0 => array(
            'from' => '<basepath>/custom/Extension/modules/Accounts/Ext/Vardefs/custom_billing_address_country.php',
            'to' => 'custom/Extension/modules/Accounts/Ext/Vardefs/custom_billing_address_country.php',
        ),
    ),
);

然后创建:

custom/Extension/modules/Accounts/Ext/Vardefs/custom_billing_address_country.php

<?php

$dictionary['Account']['fields']['billing_address_country']['comments']='Country for primary address';
$dictionary['Account']['fields']['billing_address_country']['group']='primary_address';
$dictionary['Account']['fields']['billing_address_country']['options']='countries_dom';
$dictionary['Account']['fields']['billing_address_country']['type']='enum';

压缩这些文件并使用 Module Loader。

关于php - SugarCRM 按需将 TextField 转换为 DropDown,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34701726/

相关文章:

java - 从 Android 设备访问 SQL DB 时,我的 httpEntity 返回 null,任何人都可以告诉我这是为什么吗?

php - 保护通过 PHP 上传到服务器的文件

Android Manifest 如何用 Flavor Activity 替换 Activity

java - 主类不能设置为现有类

java - SugarCRM 访问被拒绝编号 40

PHP set_time_limit() 不起作用,安全模式已关闭

linux - 无法使用 ffmpeg 从 Smooth Streaming Manifest 文件获取信息

javascript - 从 Sugarcrm 中的 QuickCreate 中删除必填字段

soa - Sugar CRM SOAP get_entry_list

php - mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows 等...期望参数 1 是资源