Changeset 2426605
- Timestamp:
- 11/26/2020 01:49:10 PM (5 years ago)
- Location:
- officegest/trunk
- Files:
-
- 1 added
- 6 edited
-
officegest.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
src/Controllers/SyncEcoautoPartsInventory.php (added)
-
src/OfficeGestDBModel.php (modified) (2 diffs)
-
src/Plugin.php (modified) (2 diffs)
-
src/Templates/Containers/Settings/Articles.php (modified) (2 diffs)
-
src/Templates/EcoAuto/Utils.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
officegest/trunk/officegest.php
r2420184 r2426605 5 5 * Plugin URI: https://www.officegest.com/woocommerce 6 6 * Description: A forma mais fácil de ligar a sua loja online com a sua faturação. 7 * Version: 1.0.3 37 * Version: 1.0.34 8 8 * Author: OfficeGest 9 9 * Author URI: https://www.officegest.com … … 275 275 $row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '". DB_NAME ."' AND table_name = 'officegest_articles' AND column_name = 'updated_at'" ); 276 276 if(empty($row)){ 277 $wpdb->query("ALTER TABLE officegest_articles ADD updated_at TIMESTAMP DEFAULT current_timestamp");277 $wpdb->query("ALTER TABLE officegest_articles ADD updated_at TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"); 278 278 } 279 279 $row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '". DB_NAME ."' AND table_name = 'officegest_eco_parts' AND column_name = 'created_at'" ); … … 283 283 $row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '". DB_NAME ."' AND table_name = 'officegest_eco_parts' AND column_name = 'updated_at'" ); 284 284 if(empty($row)){ 285 $wpdb->query("ALTER TABLE officegest_eco_parts ADD updated_at TIMESTAMP DEFAULT current_timestamp");285 $wpdb->query("ALTER TABLE officegest_eco_parts ADD updated_at TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"); 286 286 } 287 287 $row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '". DB_NAME ."' AND table_name = 'officegest_eco_processes' AND column_name = 'created_at'" ); … … 291 291 $row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '". DB_NAME ."' AND table_name = 'officegest_eco_processes' AND column_name = 'updated_at'" ); 292 292 if(empty($row)){ 293 $wpdb->query("ALTER TABLE officegest_eco_processes ADD updated_at TIMESTAMP DEFAULT current_timestamp");293 $wpdb->query("ALTER TABLE officegest_eco_processes ADD updated_at TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"); 294 294 } 295 295 -
officegest/trunk/readme.txt
r2420184 r2426605 5 5 Tested up to: 5.5 6 6 Requires PHP: 5.6 7 Stable tag: 1.0.3 37 Stable tag: 1.0.34 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 33 33 34 34 == Changelog == 35 = 1.0.34 = 36 Fix inventory sync 37 35 38 = 1.0.33 = 36 39 Update import ecoauto parts images -
officegest/trunk/src/OfficeGestDBModel.php
r2420184 r2426605 1901 1901 1902 1902 /** 1903 * Clear ecoauto parts inventory 1903 * Clear ecoauto parts inventory in woocommerce 1904 1904 */ 1905 1905 public static function clearEcoAutoParts() … … 1927 1927 if (empty($result)){ 1928 1928 $p = new WC_Product_Simple($product->ID); 1929 $p->post_status='trash'; 1930 $p->save(); 1929 wp_update_post( array( 'ID' => $p->get_id(), 'post_status' => 'trash' ) ); 1931 1930 } 1932 1931 } -
officegest/trunk/src/Plugin.php
r2420184 r2426605 232 232 $this->syncEcoautoPartsImages(); 233 233 break; 234 235 case 'forcesyncpartsinventory': 236 $this->forceSyncPartsInventory(); 237 break; 234 238 235 239 case 'deubug': … … 487 491 488 492 /** 493 * Force to sync woocommerce part with ecoauto last inventory 494 */ 495 private function forceSyncPartsInventory() { 496 ini_set( 'memory_limit',-1); 497 ini_set( 'max_execution_time',-1); 498 $forceSyncParts = (new Controllers\SyncEcoautoPartsInventory())->run(); 499 if ($forceSyncParts->countFoundRecord() > 0) { 500 add_settings_error('officegest', 'officegest-sync-pecas-woo-updated', __('Foram criadas ' . $forceSyncParts->countFoundRecord() . ' peças.' ), 'updated'); 501 } 502 } 503 504 /** 489 505 * Force to run officegest ecoauto processes sync 490 506 */ -
officegest/trunk/src/Templates/Containers/Settings/Articles.php
r2420007 r2426605 123 123 </td> 124 124 </tr> 125 <?php } ?> 125 126 <tr> 126 127 <th scope="row" class="titledesc"> … … 143 144 </td> 144 145 </tr> 145 <?php } ?>146 146 </tbody> 147 147 </table> -
officegest/trunk/src/Templates/EcoAuto/Utils.php
r2420007 r2426605 11 11 href='<?= admin_url('admin.php?page=ecoauto&tab=utils&action=forcesyncparts') ?>'> 12 12 <?= __('Importação das Peças') ?> 13 </a> 14 </td> 15 </tr> 16 <tr> 17 <th style="padding: 2rem"> 18 <strong class="name"><?= __('Inventário') ?></strong> 19 <p class='description'><?= __('Atualizar Inventário de Peças do Woocommerce') ?></p> 20 </th> 21 <td class="run-tool" style="padding: 2rem; text-align: right"> 22 <a class="button button-large" 23 href='<?= admin_url('admin.php?page=ecoauto&tab=utils&action=forcesyncpartsinventory') ?>'> 24 <?= __('Atualizar peças Woocommerce') ?> 13 25 </a> 14 26 </td>
Note: See TracChangeset
for help on using the changeset viewer.