Changeset 3137153
- Timestamp:
- 08/18/2024 12:56:16 AM (7 months ago)
- Location:
- wp-easy-crm
- Files:
-
- 39 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-easy-crm/trunk/easy-crm.php
r3136896 r3137153 4 4 * Plugin Name: Easy CRM 5 5 * Description: Collect new leads, manage clients, quotations, invoices, tasks and more for your entire team 6 * Version: 1.0.2 36 * Version: 1.0.24 7 7 * Author: IT-iCO SRL 8 8 * Author URI: https://it-ico.com -
wp-easy-crm/trunk/readme.txt
r3136896 r3137153 4 4 Requires at least: 5.9 5 5 Tested up to: 6.6.1 6 Stable tag: 1.0.2 36 Stable tag: 1.0.24 7 7 Contributors: sunnysonic 8 8 License: GPLv2 or later … … 60 60 61 61 == Changelog == 62 63 = 1.0.24 = 64 * fixed issue on saving date when marking invoice as paid 65 * hovering over invoice/quote name in client profile shows now line items of invoice/quote 66 * hovering over invoice/quote name in invoice list of main menu shows now line items of invoice/quote 62 67 63 68 = 1.0.23 = -
wp-easy-crm/trunk/views/addQuote.php
r3136889 r3137153 21 21 22 22 if (!empty($action)) { 23 24 23 25 24 if ($action == "delete") { … … 77 76 } 78 77 if ($action == "markpaid") { 79 80 // Update the quote status to "paid" and set the created_at field81 78 $updated = $wpdb->update( 82 79 $quoteTable, 83 80 array( 84 81 'quotestatus' => 'paid', 85 ' created_at' => sanitize_text_field($registration_date)82 'lastupdate_at' => sanitize_text_field($registration_date) 86 83 ), 87 84 array('id' => $quoteid), … … 93 90 ); 94 91 92 // Debugging: Log the SQL query 93 error_log($wpdb->last_query); 94 95 95 if ($updated !== false) { 96 96 $msg = "<div class='updated update'>".esc_html(__('quote / invoice successfully marked as paid. You can return to the client profile or wait until you are redirected to the client profile.', 'wp-easy-crm'))."</div>"; 97 97 98 // Redirect to the specified URL99 // Wait for 2 seconds and then redirect100 98 echo "<script> 101 99 setTimeout(function() { … … 107 105 } 108 106 } 107 109 108 110 109 -
wp-easy-crm/trunk/views/clientProfile.php
r3136896 r3137153 8 8 $quotesInvoiceTable = $wpdb->prefix . 'quoteclient'; 9 9 $accregionTable = $wpdb->prefix . 'eacraccountingregion'; 10 $quoteItemTable = $wpdb->prefix . 'lineitemquote'; 10 11 11 12 … … 192 193 animation: wiggle 0.3s ease-in-out 2; /* Increase the duration to 1.5 seconds */ 193 194 } 195 196 .tooltip { 197 position: relative; 198 display: inline-block; 199 cursor: pointer; 200 } 201 202 .tooltip .tooltiptext { 203 visibility: hidden; 204 width: 300px; /* Adjust the width if needed */ 205 background-color: #333; 206 color: #fff; 207 text-align: left; 208 padding: 5px; 209 border-radius: 5px; 210 position: absolute; 211 z-index: 1; 212 bottom: 100%; /* Position above the element */ 213 left: calc(50% + 160px); /* Shift to the right by the width of the WordPress menu */ 214 transform: translateX(-50%); 215 white-space: normal; /* Allow wrapping and line breaks */ 216 } 217 218 .tooltip:hover .tooltiptext { 219 visibility: visible; 220 } 221 222 223 194 224 195 225 </style> … … 294 324 295 325 }); 326 327 //tooltip show 328 document.addEventListener('DOMContentLoaded', function () { 329 const tooltipElements = document.querySelectorAll('[data-tooltip]'); 330 const adminMenuWidth = document.getElementById('adminmenuwrap').offsetWidth; // Get the width of the WordPress admin menu 331 332 tooltipElements.forEach(function (elem) { 333 const tooltipText = elem.getAttribute('data-tooltip'); 334 const tooltipDiv = document.createElement('div'); 335 tooltipDiv.className = 'tooltiptext'; 336 tooltipDiv.innerHTML = tooltipText; 337 338 const wrapper = document.createElement('span'); 339 wrapper.className = 'tooltip'; 340 elem.parentNode.insertBefore(wrapper, elem); 341 wrapper.appendChild(elem); 342 wrapper.appendChild(tooltipDiv); 343 344 // Adjust tooltip position based on admin menu width 345 tooltipDiv.style.left = `calc(50% + ${adminMenuWidth}px)`; 346 }); 347 }); 348 349 350 351 296 352 </script> 297 353 … … 322 378 <?php 323 379 324 function make_links_clickable($text) {380 function make_links_clickable($text) { 325 381 // Match URLs with http:// or https:// 326 382 $text = preg_replace( … … 345 401 346 402 return $text; 347 }403 } 348 404 349 405 if(count($alllogs) > 0){ … … 443 499 444 500 if($singlequote['quotestatus'] == "quote" || $singlequote['quotestatus'] == "cancelled"){ 445 echo '<td class="column-columnname" style="width:20%">'.'<a href="admin.php?page=wp-easy-crm-quoteview"eid='.$singlequote['id'].'">QUO-00'.esc_html($singlequote['id']).'</a></td>'; 446 447 } 448 else{ 449 //is invoice 450 echo '<td class="column-columnname" style="width:20%">'.'<a href="admin.php?page=wp-easy-crm-quoteview"eid='.$singlequote['id'].'">INV-00'.esc_html($singlequote['id']).'</a></td>'; 451 452 } 501 //is Quote 502 $lineItems = $wpdb->get_results( 503 $wpdb->prepare( 504 "SELECT * FROM $quoteItemTable WHERE quoteidfk = %d", 505 $singlequote['id'] 506 ), 507 ARRAY_A 508 ); 509 510 $lineItemsTooltip = ''; 511 if (!empty($lineItems)) { 512 foreach ($lineItems as $item) { 513 $lineItemsTooltip .= esc_html($item['lineitem']) . ' (Qty: ' . esc_html($item['quantity']) . ', Price: ' . esc_html($item['price']) . ', Tax: ' . esc_html($item['tax']) . '%)<br>'; 514 } 515 } else { 516 $lineItemsTooltip = 'No line items available'; 517 } 518 519 echo '<td class="column-columnname" style="width:20%">'.'<a href="admin.php?page=wp-easy-crm-quoteview"eid='.$singlequote['id'].'" data-tooltip="'.esc_attr($lineItemsTooltip).'">QUO-00'.esc_html($singlequote['id']).'</a></td>'; 520 } else { 521 // Is invoice 522 $lineItems = $wpdb->get_results( 523 $wpdb->prepare( 524 "SELECT * FROM $quoteItemTable WHERE quoteidfk = %d", 525 $singlequote['id'] 526 ), 527 ARRAY_A 528 ); 529 530 $lineItemsTooltip = ''; 531 if (!empty($lineItems)) { 532 foreach ($lineItems as $item) { 533 $lineItemsTooltip .= esc_html($item['lineitem']) . ' (Qty: ' . esc_html($item['quantity']) . ', Price: ' . esc_html($item['price']) . ', Tax: ' . esc_html($item['tax']) . '%)<br>'; 534 } 535 } else { 536 $lineItemsTooltip = 'No line items available'; 537 } 538 539 echo '<td class="column-columnname" style="width:20%">'.'<a href="admin.php?page=wp-easy-crm-quoteview"eid='.$singlequote['id'].'" data-tooltip="'.esc_attr($lineItemsTooltip).'">INV-00'.esc_html($singlequote['id']).'</a></td>'; 540 } 541 542 453 543 454 544 if($singlequote['quotestatus'] == "quote"){ -
wp-easy-crm/trunk/views/quotationsInvoices.php
r3106848 r3137153 2 2 global $wpdb; 3 3 $quotesInvoiceTable = $wpdb->prefix . 'quoteclient'; 4 $quoteItemTable = $wpdb->prefix . 'lineitemquote'; 4 5 $clientTable = $wpdb->prefix . 'clients'; 5 6 $accregionTable = $wpdb->prefix . 'eacraccountingregion'; … … 93 94 if(count($allquotes) > 0){ 94 95 ?> 96 <style> 97 .tooltip { 98 position: relative; 99 display: inline-block; 100 cursor: pointer; 101 } 102 103 .tooltip .tooltiptext { 104 visibility: hidden; 105 width: 300px; /* Adjust the width if needed */ 106 background-color: #333; 107 color: #fff; 108 text-align: left; 109 padding: 5px; 110 border-radius: 5px; 111 position: absolute; 112 z-index: 1; 113 bottom: 100%; /* Position above the element */ 114 left: calc(50% + 160px); /* Shift to the right by the width of the WordPress menu */ 115 transform: translateX(-50%); 116 white-space: normal; /* Allow wrapping and line breaks */ 117 } 118 119 .tooltip:hover .tooltiptext { 120 visibility: visible; 121 } 122 123 124 125 </style> 95 126 96 127 <script> … … 124 155 }); 125 156 }); 157 158 //tooltip show 159 document.addEventListener('DOMContentLoaded', function () { 160 const tooltipElements = document.querySelectorAll('[data-tooltip]'); 161 const adminMenuWidth = document.getElementById('adminmenuwrap').offsetWidth; // Get the width of the WordPress admin menu 162 163 tooltipElements.forEach(function (elem) { 164 const tooltipText = elem.getAttribute('data-tooltip'); 165 const tooltipDiv = document.createElement('div'); 166 tooltipDiv.className = 'tooltiptext'; 167 tooltipDiv.innerHTML = tooltipText; 168 169 const wrapper = document.createElement('span'); 170 wrapper.className = 'tooltip'; 171 elem.parentNode.insertBefore(wrapper, elem); 172 wrapper.appendChild(elem); 173 wrapper.appendChild(tooltipDiv); 174 175 // Adjust tooltip position based on admin menu width 176 tooltipDiv.style.left = `calc(50% + ${adminMenuWidth}px)`; 177 }); 178 }); 179 180 126 181 </script> 127 182 … … 177 232 178 233 if($singlequote['quotestatus'] == "quote" || $singlequote['quotestatus'] == "cancelled"){ 179 echo '<td class="column-columnname" style="width:20%">'.'<a href="admin.php?page=wp-easy-crm-quoteview"eid='.$singlequote['id'].'">QUO-00'.esc_html($singlequote['id']).'</a></td>'; 234 //is Quote 235 $lineItems = $wpdb->get_results( 236 $wpdb->prepare( 237 "SELECT * FROM $quoteItemTable WHERE quoteidfk = %d", 238 $singlequote['id'] 239 ), 240 ARRAY_A 241 ); 242 243 $lineItemsTooltip = ''; 244 if (!empty($lineItems)) { 245 foreach ($lineItems as $item) { 246 $lineItemsTooltip .= esc_html($item['lineitem']) . ' (Qty: ' . esc_html($item['quantity']) . ', Price: ' . esc_html($item['price']) . ', Tax: ' . esc_html($item['tax']) . '%)<br>'; 247 } 248 } else { 249 $lineItemsTooltip = 'No line items available'; 250 } 251 252 echo '<td class="column-columnname" style="width:20%">'.'<a href="admin.php?page=wp-easy-crm-quoteview"eid='.$singlequote['id'].'" data-tooltip="'.esc_attr($lineItemsTooltip).'">QUO-00'.esc_html($singlequote['id']).'</a></td>'; 180 253 } else { 181 //is invoice 182 echo '<td class="column-columnname" style="width:20%">'.'<a href="admin.php?page=wp-easy-crm-quoteview"eid='.$singlequote['id'].'">INV-00'.esc_html($singlequote['id']).'</a></td>'; 183 } 254 // Is invoice 255 $lineItems = $wpdb->get_results( 256 $wpdb->prepare( 257 "SELECT * FROM $quoteItemTable WHERE quoteidfk = %d", 258 $singlequote['id'] 259 ), 260 ARRAY_A 261 ); 262 263 $lineItemsTooltip = ''; 264 if (!empty($lineItems)) { 265 foreach ($lineItems as $item) { 266 $lineItemsTooltip .= esc_html($item['lineitem']) . ' (Qty: ' . esc_html($item['quantity']) . ', Price: ' . esc_html($item['price']) . ', Tax: ' . esc_html($item['tax']) . '%)<br>'; 267 } 268 } else { 269 $lineItemsTooltip = 'No line items available'; 270 } 271 272 echo '<td class="column-columnname" style="width:20%">'.'<a href="admin.php?page=wp-easy-crm-quoteview"eid='.$singlequote['id'].'" data-tooltip="'.esc_attr($lineItemsTooltip).'">INV-00'.esc_html($singlequote['id']).'</a></td>'; 273 } 184 274 185 275 if($singlequote['quotestatus'] == "quote"){
Note: See TracChangeset
for help on using the changeset viewer.