Skip to content

Commit

Permalink
Bring over CRM PR #2834
Browse files Browse the repository at this point in the history
  • Loading branch information
coder-karen committed Feb 7, 2023
1 parent 32c3253 commit 3eb6dc8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
24 changes: 7 additions & 17 deletions projects/plugins/crm/admin/dashboard/main.page.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,29 +620,19 @@ function jpcrm_render_dashboard_page() {
<tbody>
<?php
foreach ( $latest_cust as $cust ) {
$avatar = '';
if ( isset( $cust ) && isset( $cust['email'] ) ) {
$avatar = zeroBSCRM_getGravatarURLfromEmail( $cust['email'], 25 );
}
$fname = '';
if ( isset( $cust ) && isset( $cust['fname'] ) ) {
$fname = $cust['fname'];
}
$lname = '';
if ( isset( $cust ) && isset( $cust['lname'] ) ) {
$lname = $cust['lname'];
}
$status = '';
if ( isset( $cust ) && isset( $cust['status'] ) ) {
$status = $cust['status'];
}
// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase -- to be refactored.
$avatar = ( isset( $cust ) && isset( $cust['id'] ) ) ? $zbs->DAL->contacts->getContactAvatar( $cust['id'] ) : '';
$fname = ( isset( $cust ) && isset( $cust['fname'] ) ) ? $cust['fname'] : '';
$lname = ( isset( $cust ) && isset( $cust['lname'] ) ) ? $cust['lname'] : '';
$status = ( isset( $cust ) && isset( $cust['status'] ) ) ? $cust['status'] : '';
// phpcs:enable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
if ( empty( $status ) ) {
$status = __( 'None', 'zero-bs-crm' );
}
?>
<tr>
<td><?php echo esc_html( $cust['id'] ); ?></td>
<td><img class='img-rounded' alt='<?php esc_attr_e( 'Contact Image', 'zero-bs-crm', '' ); ?>' src='<?php echo esc_attr( $avatar ); ?>'/></td>
<td><img class='img-rounded jpcrm-avatar-small' alt='<?php esc_attr_e( 'Contact Image', 'zero-bs-crm' ); ?>' src='<?php echo esc_attr( $avatar ); ?>'/></td>
<td><div class='mar'><?php echo esc_html( $fname ); ?></div></td>
<td><div class='mar'><?php echo esc_html( $lname ); ?></div></td>
<td class='zbs-s <?php echo esc_attr( 'zbs-' . $zbs->DAL->makeSlug( $status ) ); ?>'><div><?php echo esc_html( $status ); ?></div></td>
Expand Down
4 changes: 4 additions & 0 deletions projects/plugins/crm/sass/ZeroBSCRM.admin.homedash.scss
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ h1, h2, h3, h4, h5, h6 {
margin-right:5px;
}

.jpcrm-avatar-small {
width: 25px;
}

.zbs-s div{
background: #ddd;
color:white;
Expand Down

0 comments on commit 3eb6dc8

Please sign in to comment.