2

アクションサブスクライバーでコントローラーを作成しました

このような

class LeadsController extends SugarController
{
public function action_subscriber()
{   
    $this->view = 'sub';     
}  
}

検索フォームにサブスクライバーとして呼び出されるボタンを追加しました

検索を実行したい場合は、そのボタンをクリックして、SUGAR.savedViews.setChooser(); を呼び出しています。SUGAR.ajaxUI.submitForm(this.form); SearchFormGeneric.tpl のこの 2 つの関数

<input tabindex='2' title='go_select' id='go_select_b' ondblclick="SUGAR.savedViews.setChooser(); SUGAR.ajaxUI.submitForm(this.form);" class='button' type='button' name='subscriber' value='Subscriber'/>

しかし、ボタンをクリックすると、

モジュール=リード&アクション=インデックス

サブスクライバーと呼ばれるアクションでロジックを記述しているので、カスタム ボタンをクリックすると で検索する必要があります。

モジュール=リード&アクション=購読者

「SUGAR.savedViews.setChooser(); SUGAR.ajaxUI.submitForm(this.form); この関数のクリック時のアクションを変更するにはどうすればよいですか?

この SUGAR.ajaxUI.submitForm(document.forms['DetailView']); で検索します。郵便で

これに関連する投稿を見つけて、この SUGAR.ajaxUI.submitForm(document.forms['SubView']); のようなことを試しましたが、うまくいきませんでした。

これに関連する他の投稿

誰でもこれについて私を案内できますか????

4

1 に答える 1

1

最終的に解決策が得られたので、検索ビューのカスタムボタンに基づいて検索を変更しようとしていました。

そのため、以下の検索ビューに移動します: suitecrm/custom/include/SearchForm/tpls/SearchFormGeneric.tpl

ボタンを追加します

{if $module eq 'o_order'}
    <input tabindex='2' title='Subscribers' id='get_report' onclick ="SUGAR.ajaxUI.submitForm(this.form);" class='button' type='submit' name='button' value='Subscribers'/>
{/if}

検索条件に基づいてリストを生成するメソッドの下に条件を置きます

に行く: suitecrm/custom/modules/o_order/views/view.list.php

クエリに基づいてリストデータを生成している関数は listViewProcess() です

    public function listViewProcess()        // genrating listview 
{
    $this->processSearchForm();
    $this->lv->searchColumns = $this->searchForm->searchColumns;
    if(!$this->headers)
        return;
    if(empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false){
        $this->lv->ss->assign("SEARCH",true);
        $this->lv->setup($this->seed, 'include/ListView/ListViewGeneric.tpl', $this->where, $this->params);
        $savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']);
        $configObject = new Configurator();
        $configObject->loadConfig();
        $configObject->config['save_query'] = 'no';
        $configObject->saveConfig();
        echo $this->lv->display();
        if($_REQUEST['button']=='Subscriber'){
            $this->getpdf($this->where);
        }
    }
}

そのため、検索条件をパラメータとして getpdf() 関数に渡しています

管理者ログインから修復と再構築を行うだけで、変更を確認できます。

これが誰かに役立つことを願っています!

于 2015-02-09T09:04:07.463 に答える