<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body smarttemplateinserted="true" text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Dear Rishab,<br>
      <br>
      Thank you very much for the support.<br>
      May my English was not enough good to explain my findings.<br>
      <br>
      I am using overrided <b>ListViewContents.tpl</b> under
      /layouts/vlayout/modules/CustomModule/ and the template works
      well.<br>
      I have just included a line before the red below:<br>
      <br>
      <div>
        <div>{<b><font color="#ff0000">include
file=vtemplate_path($FIELD_UI_TYPE_MODEL->getListSearchTemplateName(),$MODULE_NAME</font></b>)</div>
        <div>                    FIELD_MODEL= $LISTVIEW_HEADER
          SEARCH_INFO=$SEARCH_DETAILS[$LISTVIEW_HEADER->getName()]
          USER_MODEL=$CURRENT_USER_MODEL}</div>
      </div>
      <br>
      {$FIELD_UI_TYPE_MODEL->getListSearchTemplateName()}  to write
      out to the screen the template names used in different column.<br>
      <br>
      In the custom multipicklist column was listed the right template
      name: <b>uitypes/MyMultiSelectFieldSearchView.tpl</b><br>
      And this template name is defined by the
      .../modules/CustomModule/uitypes/MyMultipicklist.php  with
      overriding the Function <b>getListSearchTemplateName()</b> for
      that uitype only.<br>
      <br>
      The template name is OK, vtiger find in any case the <b>right
        template name</b>, but in sort and search vtiger looking for
      this right name in the wrong directory.<br>
      <br>
      I did the suggested ovveride in the
      modules/Vtiger/uitypes/Base.php ->
      modules/CustomModule/uitypes/Base.php<br>
      <br>
      BUT when clicking to the listview header to sort the columns e.g.
      by Record Label the too same error appeared.<br>
      <br>
      The vtiger looking for the right template name in the incorrect
      directory.<br>
      The right directory will be: <b>.../layouts/vlayout/modules/CustomModule/uitypes/</b><br>
      <br>
      vtiger looking for the right template name in the <b>.../layouts/vlayout/modules/Vtiger/uitypes/</b><br>
      <br>
      So overriding the Function <b>getListSearchTemplateName()</b> in
      the modules/Vtiger/uitypes/Base.php is not a right solution.<br>
      Even the Function <b>getListSearchTemplateName()</b> in the
      modules/Vtiger/uitypes/Multipicklist.php is already overrided in
      it works - generates the right name.<br>
      <br>
      My opinion is that the .../modules/Vtiger/models/ListView.php
      fails inside the function getListViewHeaders() or in function
      getListViewEntries($pagingModel).<br>
      query_generator or listview_controller <br>
      <br>
      Do the these entities manipulate the templates somewhere?<br>
      <br>
      <br>
      <div class="moz-signature">Regards:<br>
        <b>István</b><br>
        <br>
        <br>
        <br>
      </div>
      2014.08.06. 8:30 keltezéssel, Rishab K írta:<br>
    </div>
    <blockquote class=" cite"
id="mid_CAHU_C_kNNBkc_qRPNB1ApAUzOnOB3s83pvXsdki7ysbU9YH5Qw_mail_gmail_com"
cite="mid:CAHU-C+kNNBkc=qRPNB1ApAUzOnOB3s83pvXsdki7ysbU9YH5Qw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div> <br>
        </div>
        <blockquote id="Cite_3915955" class="gmail_quote cite"
          style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
            style="font-family:arial,sans-serif;font-size:13px"></span><span
            style="font-family:arial,sans-serif;font-size:13px">It
            indicates the sort_by and search javascript functions on the
            listview screen use a hardcoded path to the templates and
            did not use the callback to the CustomModule directory.</span><span
            style="font-family:arial,sans-serif;font-size:13px"><br>
          </span><span
            style="color:rgb(204,0,0);font-family:arial,sans-serif;font-size:15px">Unable
            to load template file '</span><b
            style="color:rgb(204,0,0);font-family:arial,sans-serif;font-size:15px">modules/Vtiger/uitypes/MyMultiSelectFieldSearchView.tpl</b><span
style="color:rgb(204,0,0);font-family:arial,sans-serif;font-size:15px">'
            in '</span><b
            style="color:rgb(204,0,0);font-family:arial,sans-serif;font-size:15px">modules/</b><b
style="color:rgb(204,0,0);font-family:arial,sans-serif;font-size:15px"><b><b>CustomModule</b></b>/ListViewContents.tpl</b><span
style="color:rgb(204,0,0);font-family:arial,sans-serif;font-size:15px">'</span></blockquote>
        <div><br>
        </div>
        <div>Istavan,</div>
        <div><br>
        </div>
        <div>The template name of ListViewSearch and Sort is not hard
          coded.</div>
        <div><br>
        </div>
        <div>In ListViewContents.tpl under
          /layouts/vlayout/modules/Vtiger/ </div>
        <div>around line 80,81</div>
        <div><br>
        </div>
        <div>
          <div>{<b><font color="#ff0000">include
file=vtemplate_path($FIELD_UI_TYPE_MODEL->getListSearchTemplateName(),$MODULE_NAME</font></b>)</div>
          <div>                    FIELD_MODEL= $LISTVIEW_HEADER
            SEARCH_INFO=$SEARCH_DETAILS[$LISTVIEW_HEADER->getName()]
            USER_MODEL=$CURRENT_USER_MODEL}</div>
        </div>
        <div><br>
        </div>
        <div>The above line marked in red loads the Template file for
          the respective FieldUitype.</div>
        <div><br>
        </div>
        <div>So in your case Override the Function <b>getListSearchTemplateName()
          </b>of /layouts/vlayout/uitypes/Base.php</div>
        <div>to serve your purpose. </div>
        <div>Please review.</div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Rishab</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Mon, Aug 4, 2014 at 10:08 PM, Holbok
          István <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:holbok@gmail.com" target="_blank">holbok@gmail.com</a>></span>
          wrote:<br>
          <blockquote id="Cite_4485184" class="gmail_quote cite"
            style="margin:0 0 0 .8ex;border-left:1px #ccc
            solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF"> Dear vtiger Team,<br>
              <br>
              As per Rishab's suggestion of 07/22 I have created a
              custom UIType (special multiselect picklist) for my custom
              module.<br>
              <br>
              I have created:<br>
              <b>.../layouts/vlayout/modules/CustomModule/uitypes/MyMultiSelectFieldSearchView.tpl</b>  

              and<br>
              <b>.../layouts/vlayout/modules/CustomModule/uitypes/MyMultiPicklist.tpl</b>  

              and did the necessary modification for my purposes.<br>
              <br>
              I have also created the necessary service files:<br>
              <b>.../modules/</b><b><b>CustomModule</b>/uitypes/MyMultipicklist.php</b> 
              and<br>
              <b>.../modules/</b><b><b><b>CustomModule</b></b>/models/Field.php</b> 
              to serve the template with data.<br>
              <br>
              The class <b>CustomModule</b><b>_Field_Model</b> extends
              <b>Vtiger_Field_Model</b> and class <b>CustomModule</b><b>_MyMultipicklist_UIType</b>
              extends <b>Vtiger_Base_UIType</b> .<br>
              <br>
              With rewriting the display related methods in the above
              mentioned 2 classes the custom UIType field started work
              in my custom module.<br>
              The listview, the detailvew and the editview also showed
              the necessary field data in the necessary display format.<br>
              <br>
              The listview loaded the template from the file
              ".../layouts/vlayout/modules/CustomModule/uitypes/MyMultiSelectFieldSearchView.tpl"

              and the detailview and editview loaded the template from
              the<br>
".../layouts/vlayout/modules/CustomModule/uitypes/MyMultiPicklist.tpl".<br>
              <br>
              <big><big><b>But clicking</b></big></big> to the header of
              the listview to get sort by some field or search by some
              field (does not matter what was the search field) I have
              received a template error:<br>
              <font color="#cc0000"><br>
                <big>Unable to load template file '<b>modules/Vtiger/uitypes/MyMultiSelectFieldSearchView.tpl</b>'
                  in '<b>modules/</b><b><b><b>CustomModule</b></b>/ListViewContents.tpl</b>'</big></font><br>
              <br>
              Copying file
              '.../layouts/vlayout/modules/CustomModule/uitypes/MyMultiSelectFieldSearchView.tpl'

              to the directory
              '.../modules/Vtiger/uitypes/MyMultiSelectFieldSearchView.tpl'
              the template error resolved.<br>
              <br>
              It indicates the sort_by and search javascript functions
              on the listview screen use a hardcoded path to the
              templates and did not use the callback to the CustomModule
              directory.<span class="HOEnZb"><font color="#888888"><br>
                  <br>
                  <br>
                  <div>-- <br>
                    üdvözlettel:<br>
                    <br>
                    <b>Holbok István</b><br>
                    <br>
                    +3670-342-0900<br>
                    <b>e-mail:</b> <a moz-do-not-send="true"
                      href="mailto:holbok@gmail.com" target="_blank">holbok@gmail.com</a><br>
                    <b>SkyPe:</b> holboki<br>
                    <br>
                  </div>
                </font></span></div>
            <br>
            _______________________________________________<br>
            <a moz-do-not-send="true" href="http://www.vtiger.com/"
              target="_blank">http://www.vtiger.com/</a><br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <br>
  </body>
</html>