[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 06:30:24 GMT 2014


> 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/2ff775ca/attachment.html>


More information about the vtigercrm-developers mailing list