[Vtigercrm-developers] BUG -> in vtiger 6.1 SVN 14176 (hardcoded callback in listview search and sort_by)

Rishab K rishab.k at vtiger.com
Wed Aug 6 09:10:27 GMT 2014


I meant in your case Override the Function *getListSearchTemplateName()* of
/layouts/vlayout/uitypes/Base.php in
your


*/modules/CustomModule/uitypes/*

*or add *

*public function getListSearchTemplateName() {        return
'uitypes/MyMultiSelectFieldSearchView.tpl';*
*    }*

In your MyCustomPicklist.php under

*/modules/CustomModule/uitypes/*


On Wed, Aug 6, 2014 at 1:06 PM, Holbok István <holbok at gmail.com> wrote:

>  Dear Rishab,
>
> Thank you very much for the support.
> May my English was not enough good to explain my findings.
>
> I am using overrided *ListViewContents.tpl* under
> /layouts/vlayout/modules/CustomModule/ and the template works well.
> I have just included a line before the red below:
>
>
>  {*include
> file=vtemplate_path($FIELD_UI_TYPE_MODEL->getListSearchTemplateName(),$MODULE_NAME*
> )
>                     FIELD_MODEL= $LISTVIEW_HEADER
> SEARCH_INFO=$SEARCH_DETAILS[$LISTVIEW_HEADER->getName()]
> USER_MODEL=$CURRENT_USER_MODEL}
>
> {$FIELD_UI_TYPE_MODEL->getListSearchTemplateName()}  to write out to the
> screen the template names used in different column.
>
> In the custom multipicklist column was listed the right template name:
> *uitypes/MyMultiSelectFieldSearchView.tpl*
> And this template name is defined by the
> .../modules/CustomModule/uitypes/MyMultipicklist.php  with overriding the
> Function *getListSearchTemplateName()* for that uitype only.
>
> The template name is OK, vtiger find in any case the *right template name*,
> but in sort and search vtiger looking for this right name in the wrong
> directory.
>
> I did the suggested ovveride in the modules/Vtiger/uitypes/Base.php ->
> modules/CustomModule/uitypes/Base.php
>
> BUT when clicking to the listview header to sort the columns e.g. by
> Record Label the too same error appeared.
>
> The vtiger looking for the right template name in the incorrect directory.
> The right directory will be:
> *.../layouts/vlayout/modules/CustomModule/uitypes/*
>
> vtiger looking for the right template name in the
> *.../layouts/vlayout/modules/Vtiger/uitypes/*
>
> So overriding the Function *getListSearchTemplateName()* in the
> modules/Vtiger/uitypes/Base.php is not a right solution.
> Even the Function *getListSearchTemplateName()* in the
> modules/Vtiger/uitypes/Multipicklist.php is already overrided in it works -
> generates the right name.
>
> My opinion is that the .../modules/Vtiger/models/ListView.php fails inside
> the function getListViewHeaders() or in function
> getListViewEntries($pagingModel).
> query_generator or listview_controller
>
> Do the these entities manipulate the templates somewhere?
>
>
> Regards:
> *István*
>
>
>
>  2014.08.06. 8:30 keltezéssel, Rishab K írta:
>
>
>
>> 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.
>> Unable to load template file '
>> *modules/Vtiger/uitypes/MyMultiSelectFieldSearchView.tpl*' in '*modules/*
>> *CustomModule/ListViewContents.tpl*'
>
>
>  Istavan,
>
>  The template name of ListViewSearch and Sort is not hard coded.
>
>  In ListViewContents.tpl under /layouts/vlayout/modules/Vtiger/
> around line 80,81
>
>  {*include
> file=vtemplate_path($FIELD_UI_TYPE_MODEL->getListSearchTemplateName(),$MODULE_NAME*
> )
>                     FIELD_MODEL= $LISTVIEW_HEADER
> SEARCH_INFO=$SEARCH_DETAILS[$LISTVIEW_HEADER->getName()]
> USER_MODEL=$CURRENT_USER_MODEL}
>
>  The above line marked in red loads the Template file for the respective
> FieldUitype.
>
>  So in your case Override the Function *getListSearchTemplateName() *of
> /layouts/vlayout/uitypes/Base.php
> to serve your purpose.
> Please review.
>
>  Regards,
> Rishab
>
>
> On Mon, Aug 4, 2014 at 10:08 PM, Holbok István <holbok at gmail.com> wrote:
>
>>  Dear vtiger Team,
>>
>> As per Rishab's suggestion of 07/22 I have created a custom UIType
>> (special multiselect picklist) for my custom module.
>>
>> I have created:
>>
>> *.../layouts/vlayout/modules/CustomModule/uitypes/MyMultiSelectFieldSearchView.tpl*
>> and
>> *.../layouts/vlayout/modules/CustomModule/uitypes/MyMultiPicklist.tpl*
>> and did the necessary modification for my purposes.
>>
>> I have also created the necessary service files:
>> *.../modules/**CustomModule/uitypes/MyMultipicklist.php*  and
>> *.../modules/**CustomModule/models/Field.php*  to serve the template
>> with data.
>>
>> The class *CustomModule**_Field_Model* extends *Vtiger_Field_Model* and
>> class *CustomModule**_MyMultipicklist_UIType* extends
>> *Vtiger_Base_UIType* .
>>
>> With rewriting the display related methods in the above mentioned 2
>> classes the custom UIType field started work in my custom module.
>> The listview, the detailvew and the editview also showed the necessary
>> field data in the necessary display format.
>>
>> 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
>> ".../layouts/vlayout/modules/CustomModule/uitypes/MyMultiPicklist.tpl".
>>
>> *But clicking* 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:
>>
>> Unable to load template file '
>> *modules/Vtiger/uitypes/MyMultiSelectFieldSearchView.tpl*' in '*modules/*
>> *CustomModule/ListViewContents.tpl*'
>>
>> Copying file
>> '.../layouts/vlayout/modules/CustomModule/uitypes/MyMultiSelectFieldSearchView.tpl'
>> to the directory
>> '.../modules/Vtiger/uitypes/MyMultiSelectFieldSearchView.tpl' the template
>> error resolved.
>>
>> 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.
>>
>>
>> --
>> üdvözlettel:
>>
>> *Holbok István*
>>
>> +3670-342-0900
>> *e-mail:* holbok at gmail.com
>> *SkyPe:* holboki
>>
>>
>> _______________________________________________
>> http://www.vtiger.com/
>>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140806/e7dc736c/attachment-0001.html>


More information about the vtigercrm-developers mailing list