<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">Hi Rishab,<br>
      <br>
      It was exactly done before my letter.<br>
      And today morning I went through again all the steps.<br>
      <br>
      And it works, except by clicking search or sort on the header of
      the listview table.<br>
      <br>
      At the normal list view vtiger uses the overrided Function
      getListSearchTemplateName() from the
      /modules/CustomModule/uitypes/MyCustomPicklist.php<br>
      It is easy to control turning on the debug function and putting a
      $log->debug('I am here :-) '); row to the function overrided
      Function getListSearchTemplateName().<br>
      <br>
      When I am going to the listview the call of overrided Function
      getListSearchTemplateName() happened and it return the necessary 
      'uitypes/MyMultiSelectFieldSearchView.tpl' string, and it parsed
      well.<br>
      <br>
      When I am clicking to<b> a header field to sort by record_id</b>,
      the call of overrided Function getListSearchTemplateName()
      happened again and it return the necessary 
      'uitypes/MyMultiSelectFieldSearchView.tpl' string as well, but in
      this case the <b>string parsed wrong</b> and vtiger looks for the
      template in the Vtiger directory instead of the CustomModule
      layout directory.<br>
      It is also checked. Copying the template from the CustomModule
      layout directory to the Vtiger layout directory the error message
      did not appear.<br>
      <br>
      So there should be a directory parse bug inside somewhere.<br>
      <br>
      regards:<br>
      Istvan<br>
      <br>
      <div class="moz-signature"><br>
        <br>
      </div>
      2014.08.06. 11:10 keltezéssel, Rishab K írta:<br>
    </div>
    <blockquote class=" cite"
id="mid_CAHU_C_nq4a18tHO7t15YdhQzRYCHtQJ8TLhdyLdjU1bnPScwfw_mail_gmail_com"
cite="mid:CAHU-C+nq4a18tHO7t15YdhQzRYCHtQJ8TLhdyLdjU1bnPScwfw@mail.gmail.com"
      type="cite">
      <div dir="ltr"><span style="font-family:arial,sans-serif">I meant
          in your case Override the Function </span><span
          style="font-family:arial,sans-serif"><font color="#ff0000"><b>getListSearchTemplateName()</b></font> </span><span
          style="font-family:arial,sans-serif">of
          /layouts/vlayout/uitypes/Base.</span><span
          style="font-family:arial,sans-serif">php in </span><br>
        <div><span style="font-family:arial,sans-serif">your</span></div>
        <div><span style="font-family:arial,sans-serif"><br>
          </span></div>
        <div><b><span
              style="font-family:arial,sans-serif;color:rgb(255,0,0)">/modules/CustomModule/uitypes/</span><span
              style="font-family:arial,sans-serif"><br>
            </span></b></div>
        <div><font color="#ff0000"><span
              style="font-family:arial,sans-serif"><b><br>
              </b></span></font></div>
        <div><font color="#ff0000"><span
              style="font-family:arial,sans-serif"><b>or add </b></span></font></div>
        <div><font color="#ff0000"><span
              style="font-family:arial,sans-serif"><b><br>
              </b></span></font></div>
        <div><font face="arial, sans-serif" color="#ff0000"><b>
              <div style="">public function getListSearchTemplateName()
                {</div>
              <div style="">
                        return 'uitypes/<span style="font-family:arial"><span
                    style="font-family:arial,sans-serif">MyMultiSelectFieldSearchView.tpl</span></span>
                <div style="display:inline!important">';</div>
              </div>
            </b></font><font face="arial, sans-serif">
            <div style="color:rgb(255,0,0)">
              <b>    }</b></div>
            <div style="color:rgb(255,0,0)"><br>
            </div>
            <div><font color="#000000">In your MyCustomPicklist.php
                under </font></div>
            <div><font color="#000000"><br>
              </font></div>
            <div><span style="color:rgb(255,0,0)"><b>/modules/CustomModule/uitypes/</b></span><font
                color="#000000"><span style="font-size:15px"><br>
                </span></font></div>
          </font></div>
        <div class="gmail_extra"><br>
          <br>
          <div class="gmail_quote">On Wed, Aug 6, 2014 at 1:06 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_7320570" 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">
              <div text="#000000" bgcolor="#FFFFFF">
                <div>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:
                  <div class=""><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>
                  </div>
                  {$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>Regards:<br>
                    <b>István</b><br>
                    <br>
                    <br>
                    <br>
                  </div>
                  2014.08.06. 8:30 keltezéssel, Rishab K írta:<br>
                </div>
                <div>
                  <div class="h5">
                    <blockquote class=" cite" id="Cite_417454"
                      type="cite">
                      <div dir="ltr">
                        <div> <br>
                        </div>
                        <blockquote id="Cite_7992537" 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_5603238"
                            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">
                            <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><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>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
    <br>
  </body>
</html>