Plugin Directory

Changeset 3030705


Ignore:
Timestamp:
02/02/2024 06:22:22 PM (14 months ago)
Author:
sunnysonic
Message:

task widget improved with more information

Location:
wp-easy-crm
Files:
37 added
3 edited

Legend:

Unmodified
Added
Removed
  • wp-easy-crm/trunk/easy-crm.php

    r3027665 r3030705  
    44 * Plugin Name:       Easy CRM
    55 * Description:       Collect new leads, manage clients, quotations, invoices, tasks and more for your entire team
    6  * Version:           1.0.16
     6 * Version:           1.0.17
    77 * Author:            IT-iCO SRL
    88 * Author URI:        https://it-ico.com
     
    477477    $myuserid = get_current_user_id();
    478478    $taskTable = $wpdb->prefix . 'task';
     479    $clientTable = $wpdb->prefix . 'clients';
    479480    $allmyopentasks = $wpdb->get_results(
    480481        $wpdb->prepare(
     
    484485       
    485486            if(count($allmyopentasks) > 0){
    486                 foreach($allmyopentasks as $singletask){
     487                // Reverse the order of tasks
     488                $reversedTasks = array_reverse($allmyopentasks);
     489                foreach($reversedTasks as $singletask){
    487490                    echo '<div style="display: flex;">';
    488491
     
    499502                            if($clientid != 0)
    500503                            {
    501                                 echo '<a class="button button-secondary" href="admin.php?page=wp-easy-crm-perfil&id='.$clientid.'">'.__('Client Profile', 'wp-easy-crm').'</a><span> </span>';
     504                                //get client name
     505                                $clientdetails = $wpdb->get_row($wpdb->prepare("SELECT * FROM $clientTable WHERE id = %d", $clientid));
     506                                $clientname = $clientdetails->clientname;
     507
     508                                echo '<a class="button button-secondary" href="admin.php?page=wp-easy-crm-perfil&id='.$clientid.'">'.$clientname.'</a><span> </span>';
     509
    502510                            }
    503511                            else
     
    505513                                echo '<a class="button button-secondary" href="admin.php?page=wp-easy-crm-tasks">'.__('Tasks', 'wp-easy-crm').'</a><span> </span>';
    506514                            }
    507                         echo '</div>';
     515                        echo '</div>';                       
    508516                   
    509517                    echo '</div>';
    510518                    echo '<hr/>';
     519                    //get start and enddate of task
     520                        // Assuming $singletask['start_at'] is a string representing a date and time
     521                        $startDateTimeString = $singletask['start_at'];
     522                        $endDateTimeString = $singletask['end_at'];
     523                        $startDateTime = new DateTime($startDateTimeString); // Convert string to DateTime object
     524                        $endDateTime = new DateTime($endDateTimeString); // Convert string to DateTime object
     525                        $currentDateTime = new DateTime(); // Current date and time
     526
     527                        // Now, you can safely compare the DateTime objects and format them
     528                        if ($startDateTime <= $currentDateTime) {
     529                            // Start date has passed or is today
     530                            echo '<span style="color: rgba(255, 0, 0, 0.5);font-weight: bold;">Start: ' . htmlspecialchars($startDateTime->format('Y-m-d')) . '</span>';
     531                        } else {
     532                            // Start date is in the future
     533                            echo '<span style="color: black;">Start: ' . htmlspecialchars($startDateTime->format('Y-m-d')) . '</span>';
     534                        }
     535
     536                        // Additionally, checking the end date
     537                        if ($endDateTime <= $currentDateTime) {
     538                            // End date has passed
     539                            echo '<span style="color: rgba(255, 0, 0, 0.5);font-weight: bold;margin-left: 1em;">Due: ' . htmlspecialchars($endDateTime->format('Y-m-d')) . '</span>';
     540                        } else {
     541                            // End date is in the future
     542                            echo '<span style="color: black;margin-left: 1em;">Due: ' . htmlspecialchars($endDateTime->format('Y-m-d')) . '</span>';
     543                        }
     544
     545                    echo '<hr/><hr/>';
    511546
    512547                }
  • wp-easy-crm/trunk/readme.txt

    r3027665 r3030705  
    33Donate link: https://www.paypal.com/donate/?hosted_button_id=73ZZVYDUTMHME
    44Requires at least: 5.9
    5 Tested up to: 6.4.2
    6 Stable tag: 1.0.16
     5Tested up to: 6.4.3
     6Stable tag: 1.0.17
    77Contributors: sunnysonic
    88License: GPLv2 or later
     
    6161== Changelog ==
    6262
    63 = 1.0.15 =
     63= 1.0.17 =
     64* tested wordpress 6.4.3
     65* show more buttons in client profile now wider and with animation to not miss it
     66* my open tasks widget on the dashboard now showing start/end date and client name on button
     67* open task widget now shows tasks from oldest to newest
     68
     69= 1.0.16 =
    6470* tested wordpress 6.4.2
    6571* Buttons added to filter by accounting region / country on clientlist if several are present for the users with general access
  • wp-easy-crm/trunk/views/clientProfile.php

    r3027665 r3030705  
    139139        padding-right: 5px !important;
    140140    }
    141 }
     141   
     142}
     143
     144/* Add this CSS for the wiggle animation */
     145@keyframes wiggle {
     146  0%, 100% {
     147    transform: rotate(-5deg); /* Increase the rotation angle for a stronger effect */
     148  }
     149  50% {
     150    transform: rotate(5deg); /* Increase the rotation angle for a stronger effect */
     151  }
     152}
     153.wiggle {
     154  animation: wiggle 0.3s ease-in-out 2; /* Increase the duration to 1.5 seconds */
     155}
     156
    142157</style>
    143158
     
    197212        });
    198213    });
     214
     215
    199216});
    200217</script>
     
    356373</div>
    357374<script>
    358     document.addEventListener('DOMContentLoaded', (event) => {
     375document.addEventListener('DOMContentLoaded', (event) => {
    359376    document.querySelectorAll('table').forEach(function(table) {
    360377        let rows = table.querySelectorAll('tr');
     
    383400            showMoreBtn.style.marginLeft = 'auto'; // Align to center horizontally
    384401            showMoreBtn.style.marginRight = 'auto'; // Align to center horizontally
     402            showMoreBtn.style.minWidth = '200px'; // Minimum width of 200px
     403            //showMoreBtn.style.fontWeight = 'bold'; // Make font bold
     404
    385405
    386406            // Append the button after the table
     
    399419        }
    400420    });
     421
     422    // Function to add wiggle effect
     423    function addWiggleEffect() {
     424        document.querySelectorAll('.show-more-btn').forEach(function(showMoreBtn) {
     425            var elementPosition = showMoreBtn.getBoundingClientRect().top;
     426            var screenPosition = window.innerHeight;
     427            if (elementPosition < screenPosition && elementPosition > 0) {
     428                showMoreBtn.classList.add('wiggle');
     429            } else {
     430                showMoreBtn.classList.remove('wiggle');
     431            }
     432        });
     433    }
     434
     435    // Apply wiggle effect to elements in view on load
     436    addWiggleEffect();
     437
     438    // Apply wiggle effect to elements when scrolling
     439    window.addEventListener('scroll', addWiggleEffect);
    401440});
    402 
    403441</script>
     442
    404443<!-- Hook for Projects and other modules to be added -->
    405444<?php
Note: See TracChangeset for help on using the changeset viewer.