Save custom changes

Hi,

To suitcrm install the Spanish language package.
In the contacts module it shows me the field phone_movil as “MOVIL” and I need to change it to “TELEFONO CELULAR”.

Find the file in the path root /cache/modules/contacts/language/es_ES.lang.php and modify it.

The problem is when I execute the repair option, since it overwrites the changes they make.

ÂżDoes someone know how to solve this problem?

You’re just changing a cached file, that won’t work…

You should customize the file

modules/contacts/language/es_ES.lang.php

by first copying it to this

custom/modules/contacts/language/es_ES.lang.php

(create any missing subfolders as needed)

And edit the value there, then Rebuild.

See
https://pgorod.github.io/Custom-folder/
for some generic background on this.

Thank you! it worked

Now I have the following doubt, I need to change the DetailView.tpl of the contacts module.
This file is in suitecrm/cache/themes/suiteP/modules/contacts/DetailView.tpl

Where would you copy the file so you do not lose the changes?

Copy the DetailView.tpl file to suitecrm/custom/modules/contacts/DetailView.tpl
But it does not work.

No, I don’t think that’s the file you really need to change.

What exactly are you trying to achieve?

Hi,

I have 2 photo fields and I need to change the way you read the pictures.
In both fields I save the url of the images like this one http://icons.iconarchive.com/icons/icons-land/vista-people/256/Office-Customer-Male-Light-icon.png

For that I change the code of DetailView.tpl from this

to

{/if}

I also need to add google maps, but with it I need to show many location points.

SuiteCrm has the option to add google maps, but it only shows me only one location point.

The solution for this was to also modify the DetailView.tpl and use javascript to add many location points on the map.

For this reason I need to make these changes permanently.

Which DetailView.tpl are you talking about?

The DetailView.tpl of the contact module.
suitecrm/cache/themes/suiteP/modules/contacts/DetailView.tpl

Well, you’re not supposed to be doing anything on the cache folder. It’s just a cache, it can change any time…

But I can’t find a file called
modules/Contacts/DetailView.tpl

in my system.

My guess is that it’s simply this file
include/DetailView/DetailView.tpl

that gets instantiated for each module that you use. Does that file look similar to the one you’re editing? If not, try to find one that does, but not in the cache folder.

I have searched for some file that has a structure similar to the file that is in cache, but I have not found it.
So I assume that the DetailView.tpl has to be a generic file that is used in all the modules.

I’m no expert in customizations, but I think you should be editing files like these

modules/Contacts/views/view.detail.php
modules/Contacts/metadata/detailviewdefs.php

which are earlier in the process of screen construction.

You should copy each edited file in to the custom folder as described here.

If you can, grab a copy of Jim Mackin’s eBook “SuiteCRM for Developers”, that’s a great help…

I solve the problem I had with the images.
In suitecrm/include/SugarFields/Fields/ Are all the types of fields that suitecrm handles. For each type there is a folder containing the default code for them.
I overwritten the code of type IMAGE and that solves my problem.

With the subject of google maps I am still testing to find some solution. Also I have seen that you can add custom types to suitecrm. This could be another solution to what I am doing, although for the moment it has not worked for me.

Are you copying files into the custom folder, to make sure your changes are upgrade-safe? You’re not supposed to edit SuiteCRM core files in-place.

Yes, I did that, I made the modification in the custom folder

1 Like