Plugin Directory

Changeset 3027495


Ignore:
Timestamp:
01/26/2024 07:43:05 PM (14 months ago)
Author:
sunnysonic
Message:

responsiveness for mobile added

Location:
wp-easy-crm
Files:
38 added
6 edited

Legend:

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

    r3025425 r3027495  
    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.13
     6 * Version:           1.0.14
    77 * Author:            IT-iCO SRL
    88 * Author URI:        https://it-ico.com
     
    661661    wp_register_script( 'datatables', plugin_dir_url( __FILE__ ).'scripts/datatables.min.js', array( 'jquery' ) );
    662662    wp_enqueue_script( 'datatables' );
     663    wp_register_script( 'datatablesresponsive', plugin_dir_url( __FILE__ ).'scripts/dataTables.responsive.min.js', array( 'jquery' ) );
     664    wp_enqueue_script( 'datatablesresponsive' );
    663665    wp_register_script( 'html2pdf', plugin_dir_url( __FILE__ ).'scripts/html2pdf.bundle.min.js', array( 'jquery' ) );
    664666    wp_enqueue_script( 'html2pdf' );
  • wp-easy-crm/trunk/readme.txt

    r3025425 r3027495  
    44Requires at least: 5.9
    55Tested up to: 6.4.2
    6 Stable tag: 1.0.13
     6Stable tag: 1.0.14
    77Contributors: sunnysonic
    88License: GPLv2 or later
     
    6060
    6161== Changelog ==
     62
     63= 1.0.14 =
     64* tested wordpress 6.4.2
     65* mobile usability improved on all pages
     66* show more button in client profile made bigger and centered on overflowing content
    6267
    6368= 1.0.13 =
  • wp-easy-crm/trunk/views/clientProfile.php

    r3024884 r3027495  
    102102
    103103<div><h1 style="float:left"><?php _e( 'Client Contact Profile', 'wp-easy-crm' );?> || <?php echo esc_html($row_details['clientname']) ?></h1>
    104 <a href="admin.php?page=wp-easy-crm&id=<?php echo $row_details['id'];?>&action=deleteclient" style="float:right;margin-left:20px;margin-top:12px;" onclick="return eacr_confirmDeleteSuppl();"><?php _e( 'delete client', 'wp-easy-crm' );?></a><br/></div>
     104<a href="admin.php?page=wp-easy-crm&id=<?php echo $row_details['id'];?>&action=deleteclient" style="float:right;margin-left:20px;margin-top:12px;" class="delete-client-link" onclick="return eacr_confirmDeleteSuppl();"><?php _e( 'delete client', 'wp-easy-crm' );?></a><br/></div>
    105105<br/><br/>
    106106
     
    126126</br></br><code><b><?php _e( 'Address:', 'wp-easy-crm' );?></b> <?php echo esc_html($row_details['direccion']) ?> <b>Accounting Region:</b> <?php echo esc_html($accountingRegionName) ?> </code>
    127127</br></br><code><b><?php _e( 'Note:', 'wp-easy-crm' );?></b> <?php echo esc_html($row_details['nota']) ?></code>
     128
     129<style>
     130    @media (max-width: 767px) { /* Adjust max-width as needed for your target mobile breakpoint */
     131    .delete-client-link {
     132        display: none;
     133    }
     134    .editcolumn {
     135        display: none;
     136    }
     137    #wpcontent {
     138        padding-left: 5px !important;
     139        padding-right: 5px !important;
     140    }
     141}
     142</style>
     143
     144<script>
     145jQuery(document).ready(function() {
     146    // Inject CSS to hide sorting arrows and minimize thead height
     147    var css = `
     148    table.dataTable thead th {
     149        border: 0;
     150        padding: 0;
     151        height: 1px;
     152        font-size: 0;
     153    }
     154    table.dataTable thead .sorting,
     155    table.dataTable thead .sorting_asc,
     156    table.dataTable thead .sorting_desc,
     157    table.dataTable thead .sorting_asc_disabled,
     158    table.dataTable thead .sorting_desc_disabled {
     159        background-image: none !important;
     160    }`;
     161    var style = document.createElement('style');
     162    if (style.styleSheet) {
     163        style.styleSheet.cssText = css;
     164    } else {
     165        style.appendChild(document.createTextNode(css));
     166    }
     167    document.getElementsByTagName('head')[0].appendChild(style);
     168
     169    // Add an empty thead and initialize DataTables
     170    jQuery('table').each(function() {
     171        var emptyThead = jQuery('<thead><tr></tr></thead>');
     172        var numCols = jQuery(this).find('tbody tr:first td').length;
     173        for (var i = 0; i < numCols; i++) {
     174            emptyThead.find('tr').append('<th></th>');
     175        }
     176        jQuery(this).prepend(emptyThead);
     177
     178        // Initialize DataTables with specific options
     179        jQuery(this).DataTable({
     180            responsive: {
     181                details: {
     182                    type: 'column',
     183                    target: 0 // Target the second column (index starts at 0)
     184                }
     185            },
     186            paging: false,        // Disable pagination
     187            searching: false,     // Hide the search box
     188            info: false,          // Hide table information summary
     189            lengthChange: false,  // Hide length menu (number of rows per page selector)
     190            ordering: false       // Disable ordering (sorting)
     191        });
     192    });
     193});
     194</script>
     195
     196
     197
     198
     199
     200
     201
     202
    128203
    129204<!--Activity Log section-->
     
    263338                    echo '<td class="column-columnname">'.esc_html($singlequote['lastupdate_at']).'</td>';
    264339
    265                     echo '<td class="column-columnname"><a href="admin.php?page=wp-easy-crm-addquote&action=edit&quoteid='.esc_html($singlequote['id']).'&id='.esc_html($id).'">'.__( 'edit', 'wp-easy-crm' ).'</a>
     340                    echo '<td class="column-columnname editcolumn"><a href="admin.php?page=wp-easy-crm-addquote&action=edit&quoteid='.esc_html($singlequote['id']).'&id='.esc_html($id).'">'.__( 'edit', 'wp-easy-crm' ).'</a>
    266341                    | <a onclick="return eacr_confirmDeleteQuote();" href="admin.php?page=wp-easy-crm-addquote&action=delete&quoteid='.esc_html($singlequote['id']).'&id='.esc_html($id).'">'.__( 'delete', 'wp-easy-crm' ).'</a></td>';
    267342                   
     
    295370            showMoreBtn.style.color = 'white'; // White text
    296371            showMoreBtn.style.border = 'none';
    297             showMoreBtn.style.padding = '5px 10px';
    298             showMoreBtn.style.marginTop = '5px';
     372            showMoreBtn.style.padding = '10px 10px';
     373            showMoreBtn.style.marginTop = '10px';
    299374            showMoreBtn.style.cursor = 'pointer';
    300             showMoreBtn.style.borderRadius = '5px';
     375            showMoreBtn.style.borderRadius = '10px';
     376            showMoreBtn.style.display = 'block'; // Set display to block
     377            showMoreBtn.style.marginLeft = 'auto'; // Align to center horizontally
     378            showMoreBtn.style.marginRight = 'auto'; // Align to center horizontally
    301379
    302380            // Append the button after the table
  • wp-easy-crm/trunk/views/listClients.php

    r3025425 r3027495  
    275275
    276276
    277 //can possibly be deleted below january 2024
    278 // if ( current_user_can( 'editor' ) || current_user_can( 'shop_manager' ) ) {
    279 //     // The current user is either an editor or a shop manager
    280 //     // Ensure $selected_regions is an array of integers
    281 //         $selected_regions = array_map('intval', $selected_regions);
    282 
    283 //         // Create a string of comma-separated values from the $selected_regions array
    284 //         $selected_regions_str = implode(',', $selected_regions);
    285 
    286 //         if (!empty($selected_regions_str)) {
    287 //             $allclients = $wpdb->get_results(
    288 //                 $wpdb->prepare(
    289 //                     "SELECT * FROM $clientTable WHERE idaccountingregionfk IN (%s) ORDER BY clientname",
    290 //                     $selected_regions_str
    291 //                 ),
    292 //                 ARRAY_A
    293 //             );
    294 //         } else {
    295 //             // Handle the case where there are no selected regions
    296 //             $allclients = array();
    297 //         }
    298 
    299 // } else if ( current_user_can( 'administrator' ) ) {
    300 //     // The current user is an administrator
    301 //     $allclients = $wpdb->get_results(
    302 
    303 //         $wpdb->prepare(
    304 //                     "SELECT * from $clientTable ORDER BY clientname",""
    305 //         ),ARRAY_A
    306 //     );
    307 // }
    308 
    309 
    310 
    311 
    312277if(count($allclients) > 0){
    313278
     
    317282    jQuery(document).ready(function ($) {
    318283
    319         var table = $('#clientstable').DataTable(
    320         {
    321         order: [[7, 'desc']],
    322         "iDisplayLength": 12,
    323         "columnDefs": [
    324         { "width": "4%", "targets": 0 } // Adjust the width of the first column
    325                     ]
    326         }
    327     );
     284        var table = $('#clientstable').DataTable({
     285            order: [[7, 'desc']],
     286            "iDisplayLength": 12,
     287            "columnDefs": [
     288                { "width": "4%", "targets": 0 } // Adjust the width of the first column
     289            ],
     290            responsive: {
     291                details: {
     292                    type: 'column',
     293                    target: 2 // Target the second column (index starts at 0)
     294                }
     295            },
     296        });
     297   
    328298        $('#buttonshowall').on('click', function() {
    329299            event.preventDefault(); // Prevent the default anchor behavior
     
    379349
    380350<style>
     351
     352@media (max-width: 767px) { /* Adjust max-width as needed for your target mobile breakpoint */
     353    #wpcontent {
     354        padding-left: 5px !important;
     355        padding-right: 5px !important;
     356    }
     357}
    381358    .dot {
    382359    height: 16px;
     
    407384
    408385    <h1><?php _e( 'Client Contacts', 'wp-easy-crm' );?></h1>
    409     <table class="wp-list-table widefat fixed striped table-view-list posts" id="clientstable" cellspacing="0" style="padding:20px;padding-left:10px;padding-right:10px">
     386    <table class="wp-list-table widefat fixed striped table-view-list posts" id="clientstable" cellspacing="0" style="padding:20px;padding-left:10px;padding-right:10px;max-width:100%">
    410387    <thead>
    411388    <tr>
  • wp-easy-crm/trunk/views/quotationsInvoices.php

    r3025425 r3027495  
    121121        $('#tableinvoices').DataTable(
    122122        {
     123            responsive: {
     124                details: {
     125                    type: 'column',
     126                    target: 1 // Target the second column (index starts at 0)
     127                }
     128            },
    123129        order: [[4, 'desc']],
    124130         "iDisplayLength": 12,
    125131
    126         }
     132        },
     133       
    127134    );
    128135
  • wp-easy-crm/trunk/views/tasks.php

    r3025425 r3027495  
    169169            "pageLength": -1,  // Initially show all rows
    170170            "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],  // Dropdown for number of rows to be displayed per page
    171             "order": [[4, 'asc']] // Replace 'columnIndex' with the index of the end-date column
    172 
     171            "order": [[4, 'asc']], // Replace 'columnIndex' with the index of the end-date column
     172            responsive: {
     173                details: {
     174                    type: 'column',
     175                    target: 1 // Target the second column (index starts at 0)
     176                }
     177            },
    173178        });
    174179        var recenttaskstable = $('#tablerecenttasks').DataTable({
    175180            "pageLength": -1,  // Initially show all rows
    176181            "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],  // Dropdown for number of rows to be displayed per page
    177             "order": [[4, 'asc']] // Replace 'columnIndex' with the index of the end-date column
    178 
     182            "order": [[4, 'asc']], // Replace 'columnIndex' with the index of the end-date column
     183            responsive: {
     184                    details: {
     185                        type: 'column',
     186                        target: 1 // Target the second column (index starts at 0)
     187                    }
     188                },
    179189        });
    180190
Note: See TracChangeset for help on using the changeset viewer.