2

SugarCRM で条件付きで詳細ビューのボタンを非表示にする方法は?

特定の詳細:

アカウントモジュールで、DetailViewページから条件付きで削除ボタンを非表示にしたい場合、表示/非表示の条件をどこに置くことができますか。

前もって感謝します。

4

2 に答える 2

1

/custom/modules/Account/metadata/detailviewdefs.phpでこれを変更できるはずです

これに次のようなものを追加します。

if (your condition) {
    unset($viewdefs['Accounts']['DetailView']['templateMeta']['form']['buttons'][2])
    //2 being the index of the DELETE button
}

次に、次を実行する必要があります:[管理]->[修復]->[クイック修復と再構築]

于 2012-09-26T18:16:13.660 に答える
1

SugarCRM Pro版の場合

custom/modules/MODULE_NAME/metadata/detailviewdefs.phpファイルを編集し、必要に応じて$viewdefs[$module_name]['DetailView']['templateMeta']['form']配列を変更する必要があります。デフォルトでは、この配列はほとんどすべてのモジュールで空です。

例:

// Place this code on the end of a file.

// This line remove all buttons
$viewdefs[$module_name]['DetailView']['templateMeta']['form']['buttons'] = array();

// This will add some buttons according to your conditions:
if (condition for edit button = true)
    $viewdefs[$module_name]['DetailView']['templateMeta']['form']['buttons'][] = 'EDIT';
if (condition for duplicate button = true)
    $viewdefs[$module_name]['DetailView']['templateMeta']['form']['buttons'][] = 'DUPLICATE';
if (condition for delete button = true)
    $viewdefs[$module_name]['DetailView']['templateMeta']['form']['buttons'][] = 'DELETE';

このファイルを変更するたびに、Admin -> Repair -> Quick Repair and Rebuild を実行することを忘れないでください。

于 2013-04-26T17:41:25.583 に答える