This is an old revision of the document!


3. special Modifications

Non-English Languages and Readonly Users or Conditions in References

If you would like create Conditions with Reference Fields or have users in the vtigerCRM System, which don't have write permission for records, you have to make the following change:
Otherwise these Users won't see any colors in this read-only records.

1. OPEN /SMARTY/TEMPLATES/DETAILVIEW.TPL
{if $EDIT_PERMISSION eq 'yes' && $display_type neq '2' && $_readonly eq '0'}
  {* Performance Optimization Control *}
  {if !empty($DETAILVIEW_AJAX_EDIT) }
    {include file="DetailViewUI.tpl"}
  {else}
    {include file="DetailViewFields.tpl"}
  {/if}
  {* END *}
{else}
  {include file="DetailViewFields.tpl"}
{/if}
3. INSERT AFER THIS LINES
<td style='display:none;width:0px;' id="colorizer_{$data.fldname}" uitype='{$data.ui}' vtValue='{$keyval|@htmlentities|replace:"'":""|replace:'"':""}'></td>
4. Repeat this modification also in /Smarty/Templates/Inventory/InventoryDetailView.tpl


Setup of dynamically changed color

If you would see any colors directly after changes of a value in DetailView, you have to insert these two snippets into one vtiger Core file.

1. Open: /includes/js/dtlviewajax.js
2. Search:
if(module == 'Users') {
  data += "&form_token=" + (document.getElementsByName('form_token')[0].value);
}
3. Insert after this lines:
colorizerNewTagValue = tagValue;
4. Search:
else if(response.responseText.indexOf(":#:SUCCESS")>-1) {
5. At the end of this block

(directly after $(“vtbusy_info”).style.display=”none”; )

INSERT:
/** SWARNAT EDIT START **/
colorizer_after_change(fieldName, colorizerNewTagValue);
/** SWARNAT EDIT ENDE **/

Now all settings will be applied directly.

Show colors in ListView

You could show your color settings inside ListView with some limitations.
You have to insert a snippet into one vTigerCRM core sourcefile, because with basic functions, the extension couldn’t interact with the ListView.

If you don't use vtigerCRM in english, you have to check the last part.

CHANGES FOR VTIGERCRM < 5.4

1. open /Smarty/templates/ListViewEntries.tpl
2. go to end of File
3. insert before
{include_php file='./modules/Colorizer/ListViewGenerator.php'}
4. Probably you have to clear the directory Smarty/templates_c/

CHANGES FOR VTIGERCRM 5.40

1. open /modules/Vtiger/ListView.php
2. search (End of File)
?>
3. insert before
// Changed Stefan Warnat COLORIZER START
require_once("modules/Colorizer/ListViewGenerator.php");
// Changed Stefan Warnat COLORIZER ENDE


CHANGES FOR VTIGER SYSTEMS USING OTHER LANGUAGE THAN ENGLISH

1. open /include/utils/ListViewUtils.php
2. search
vtmodule='$module'
3. insert after
vtvalue='".strip_tags(str_replace("'", "\\'", $value))."'
4. Open /include/ListView/ListViewController.php
5. search:
vtmodule='$module'
6. insert after
vtvalue='".str_replace("'", "\\'", $rawValue)."'

Now the format settings are shown in ListView

Limitations

  • The Actions don’t work, because there are no blocks to collapse/hide.
  • If you have define complex conditions, the color only will applied, if all columns used in conditions are shown in filter