Skip to content

Commit

Permalink
Merge pull request #2615 from phili67/phili67-photo-thumbnail-update
Browse files Browse the repository at this point in the history
thumbnail update
  • Loading branch information
phili67 committed Apr 16, 2024
2 parents 0ac1618 + 69a5271 commit a24b055
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 24 deletions.
34 changes: 23 additions & 11 deletions src/skin/js/pastoralcare/PastoralCareDashboard.js
Expand Up @@ -14,11 +14,13 @@ $(function() {
title:i18next.t("Name"),
data:'LastName',
render: function(data, type, full, meta) {
res = '';
let res = '';
if (window.CRM.bThumbnailIconPresence) {
res += '<img src="' + window.CRM.root + '/api/persons/' + full.PersonID + '/thumbnail" alt="User Image" class="user-image initials-image" width="35" height="35"> ';
} else {
res += '<img src="' + window.CRM.root + '/Images/Person.png" class="initials-image direct-chat-img " width="50" height="50"> ';
}
return res + '<img src="' + window.CRM.root + '/Images/Person.png" class="initials-image direct-chat-img " width="50" height="50"> <a href="' + window.CRM.root + "/v2/people/person/view/" + full.PersonID + '">'+ data + '</a>';
return res + '<a href="' + window.CRM.root + "/v2/people/person/view/" + full.PersonID + '">'+ data + '</a>';
}
},
{
Expand Down Expand Up @@ -90,11 +92,13 @@ $(function() {
title:i18next.t("Name"),
data:'LastName',
render: function(data, type, full, meta) {
res = '';
let res = '';
if (window.CRM.bThumbnailIconPresence) {
res += '<img src="' + window.CRM.root + ' /api/persons/' + full.Id + '/thumbnail" alt="User Image" class="user-image initials-image" width="35" height="35"> ';
} else {
res += '<img src="' + window.CRM.root + '/Images/Person.png" class="initials-image direct-chat-img " width="50" height="50"> ';
}
return res + '<img src="' + window.CRM.root + '/Images/Person.png" class="initials-image direct-chat-img " width="50" height="50"> <a href="' + window.CRM.root + "/v2/pastoralcare/person/" + full.Id + '">'+ data + "</a>";
return res + '<a href="' + window.CRM.root + "/v2/pastoralcare/person/" + full.Id + '">'+ data + "</a>";
}
},
{
Expand Down Expand Up @@ -147,11 +151,13 @@ $(function() {
title:i18next.t("Name"),
data:'Name',
render: function(data, type, full, meta) {
res = '';
let res = '';
if (window.CRM.bThumbnailIconPresence) {
res += '<img src="' + window.CRM.root + '/api/families/' + full.Id + '/thumbnail" alt="User Image" class="user-image initials-image" width="35" height="35"> ';
} else {
res += '<img src="' + window.CRM.root + '/Images/Family.png" class="initials-image direct-chat-img " width="50" height="50"> ';
}
return res + '<img src="' + window.CRM.root + '/Images/Family.png" class="initials-image direct-chat-img " width="50" height="50"> <a href="' + window.CRM.root + "/v2/pastoralcare/family/" + full.Id + '">'+ data + "</a>";
return res + '<a href="' + window.CRM.root + "/v2/pastoralcare/family/" + full.Id + '">'+ data + "</a>";
}
},
{
Expand Down Expand Up @@ -196,11 +202,13 @@ $(function() {
title:i18next.t("Name"),
data:'Name',
render: function(data, type, full, meta) {
res = '';
let res = '';
if (window.CRM.bThumbnailIconPresence) {
res += '<img src="' + window.CRM.root + '/api/persons/' + full.PersonID + '/thumbnail" alt="User Image" class="user-image initials-image" width="35" height="35"> ';
} else {
res += '<img src="' + window.CRM.root + '/Images/Person.png" class="initials-image direct-chat-img " width="50" height="50"> ';
}
return res + '<img src="' + window.CRM.root + '/Images/Person.png" class="initials-image direct-chat-img " width="50" height="50"> <a href="' + window.CRM.root + "/v2/pastoralcare/person/" + full.PersonID + '">'+ data + "</a>";
return res + '<a href="' + window.CRM.root + "/v2/pastoralcare/person/" + full.PersonID + '">'+ data + "</a>";
}
},
{
Expand Down Expand Up @@ -253,11 +261,13 @@ $(function() {
title:i18next.t("Name"),
data:'LastName',
render: function(data, type, full, meta) {
res = '';
let res = '';
if (window.CRM.bThumbnailIconPresence) {
res += '<img src="' + window.CRM.root + '/api/persons/' + full.Id + '/thumbnail" alt="User Image" class="user-image initials-image" width="35" height="35"> ';
} else {
res += '<img src="' + window.CRM.root + '/Images/Person.png" class="initials-image direct-chat-img " width="50" height="50"> ';
}
return res + '<img src="' + window.CRM.root + '/Images/Person.png" class="initials-image direct-chat-img " width="50" height="50"> <a href="' + window.CRM.root + "/v2/pastoralcare/person/" + full.Id + '">'+ data + "</a>";
return res + '<a href="' + window.CRM.root + "/v2/pastoralcare/person/" + full.Id + '">'+ data + "</a>";
}
},
{
Expand Down Expand Up @@ -313,8 +323,10 @@ $(function() {
res = '';
if (window.CRM.bThumbnailIconPresence) {
res += '<img src="' + window.CRM.root + '/api/persons/' + full.Id + '/thumbnail" alt="User Image" class="user-image initials-image" width="35" height="35"> ';
} else {
res += '<img src="' + window.CRM.root + '/Images/Person.png" class="initials-image direct-chat-img " width="50" height="50"> ';
}
return res + '<img src="' + window.CRM.root + '/Images/Person.png" class="initials-image direct-chat-img " width="50" height="50"> <a href="' + window.CRM.root + "/v2/pastoralcare/person/" + full.Id + '">'+ data + "</a>";
return res + '<a href="' + window.CRM.root + "/v2/pastoralcare/person/" + full.Id + '">'+ data + "</a>";
}
},
{
Expand Down
6 changes: 4 additions & 2 deletions src/skin/js/pastoralcare/PastoralCareMembersList.js
Expand Up @@ -33,11 +33,13 @@ $(function() {
title: i18next.t("Last Name (Family Name)"),
data: 'LastName',
render: function (data, type, full, meta) {
res = '';
let res = '';
if (window.CRM.bThumbnailIconPresence) {
res += '<img src="/api/persons/' + full.Id + '/thumbnail" alt="User Image" class="user-image initials-image" width="35" height="35"> ';
} else {
res += '<img src="' + window.CRM.root + '/Images/Person.png" class="initials-image direct-chat-img " width="50" height="50"> ';
}
return res + '<img src="' + window.CRM.root + '/Images/Person.png" class="initials-image direct-chat-img " width="50" height="50"> <a href="' + window.CRM.root + "/v2/pastoralcare/person/" + full.Id + '">'+ data + '</a> ('+ i18next.t("Family Name") +' : <a href="' + window.CRM.root + "/v2/pastoralcare/family/" + full.FamilyId + '">' + full.FamilyName + "</a>)";
return res + '<a href="' + window.CRM.root + "/v2/pastoralcare/person/" + full.Id + '">'+ data + '</a> ('+ i18next.t("Family Name") +' : <a href="' + window.CRM.root + "/v2/pastoralcare/family/" + full.FamilyId + '">' + full.FamilyName + "</a>)";
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/skin/js/sundayschool/SundaySchoolClassView.js
Expand Up @@ -59,7 +59,7 @@ $(function() {
' </div>' +
' <div class="card-body">';

res += data.teachers[i].img;
res += data.teachers[i].img.replace('"50"', '"100"');

if (data.teachersProps[i][data.teachers[i]['per_ID']] != false) {
res += ' <p>' + data.teachersProps[i][data.teachers[i]['per_ID']] + '</p>';
Expand Down
3 changes: 1 addition & 2 deletions src/v2/templates/cart/cartToFamily.php
Expand Up @@ -232,8 +232,7 @@
<tr>
<td class="text-center"><?= $count++ ?></td>
<td>
<img src="<?= SystemURLs::getRootPath() ?>/api/persons/<?= $ormCartItem->getId() ?>/thumbnail"
class="direct-chat-img"> &nbsp <a
<?= $ormCartItem->getJPGPhotoDatas() ?> &nbsp <a
href="<?= $sRootPath ?>/v2/people/person/view/<?= $ormCartItem->getId() ?>"><?= OutputUtils::FormatFullName($ormCartItem->getTitle(), $ormCartItem->getFirstName(), $ormCartItem->getMiddleName(), $ormCartItem->getLastName(), $ormCartItem->getSuffix(), 1) ?></a>
</td>
<td class="text-center">
Expand Down
12 changes: 4 additions & 8 deletions src/v2/templates/pastoralcare/pastoralcarelistforuser.php
Expand Up @@ -9,6 +9,7 @@
*
******************************************************************************/

use EcclesiaCRM\Base\PersonQuery;
use EcclesiaCRM\dto\SystemURLs;
use EcclesiaCRM\dto\SystemConfig;

Expand All @@ -35,21 +36,16 @@
<tbody>
<?php
foreach ($members as $member) {
$person = PersonQuery::create()->findOneById($member['FollowedPersonPerId']);
?>
<tr>
<td>
<?php if ($member['FollowedPersonPerId'] != NULL) { ?>
<img
src="<?= SystemURLs::getRootPath() ?>/api/persons/<?= $member['FollowedPersonPerId'] ?>/thumbnail"
width="40" height="40"
class="initials-image img-circle"/>
<?= $person->getJPGPhotoDatas() ?>
<a href="<?= SystemURLs::getRootPath() ?>/v2/pastoralcare/person/<?= $member['FollowedPersonPerId'] ?>"
class="user-link"><?= _("Person") ?> : <?= $member['FollowedPersonFirstName']." ".$member['FollowedPersonLastName'] ?> </a>
<?php } else { ?>
<img
src="<?= SystemURLs::getRootPath() ?>/api/families/<?= $member['FollowedFamID'] ?>/thumbnail"
width="40" height="40"
class="initials-image img-circle"/>
<?= $person->getJPGPhotoDatas() ?>
<a href="<?= SystemURLs::getRootPath() ?>/v2/pastoralcare/family/<?= $member['FollowedFamID'] ?>"
class="user-link"><?= _("Family") ?> : <?= $member['FollowedFamName'] ?> </a>
<?php } ?>
Expand Down

0 comments on commit a24b055

Please sign in to comment.