Merge branch 'ent-12260-cuando-haces-el-cambio-de-grupo-en-un-agente-el-icono-se-queda-petado' into 'develop'

Ent 12260 cuando haces el cambio de grupo en un agente el icono se queda petado

See merge request artica/pandorafms!6587
This commit is contained in:
Matias Didier 2023-11-28 14:14:26 +00:00
commit 447e788ab3
2 changed files with 8 additions and 1 deletions

View File

@ -84,6 +84,9 @@ if (is_ajax() === true) {
} }
$group = db_get_row('tgrupo', 'id_grupo', $id_group); $group = db_get_row('tgrupo', 'id_grupo', $id_group);
if (str_contains($group['icon'], '.png') === true) {
$group['folder'] = 'groups_small/';
}
echo json_encode($group); echo json_encode($group);
return; return;

View File

@ -331,9 +331,13 @@
id_group: id_group id_group: id_group
}, },
function(data) { function(data) {
let routeImg =
typeof data.folder === "undefined"
? "images/"
: "images/" + data.folder;
$("img", config.spanPreview).attr( $("img", config.spanPreview).attr(
"src", "src",
"images/" + data["icon"] routeImg + data["icon"]
); );
$("a", config.spanPreview).attr("href", hrefNew); $("a", config.spanPreview).attr("href", hrefNew);
}, },