PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
sitepress-multilingual-cms
/
classes
/
upgrade
/
commands
<?php namespace WPML\TM\Upgrade\Commands; class ResetTranslatorOfAutomaticJobs implements \IWPML_Upgrade_Command { /** @var bool $result */ private $result = false; public function run_admin() { global $wpdb; $automatic_column_exists = $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}icl_translate_job` LIKE 'automatic'" ); if ( ! $automatic_column_exists ) { // No need to reset translator of automatic jobs // as this site never used automatic translation. // Return true to mark this upgrade as done. return true; } $subquery = " SELECT job_id, rid FROM {$wpdb->prefix}icl_translate_job WHERE job_id IN ( SELECT MAX(job_id) FROM {$wpdb->prefix}icl_translate_job GROUP BY rid ) AND automatic = 1 "; $rowsToUpdate = $wpdb->get_results( $subquery ); if ( count( $rowsToUpdate ) ) { $rids = \wpml_prepare_in( array_column( $rowsToUpdate, 'rid' ), '%d' ); $sql = " UPDATE {$wpdb->prefix}icl_translation_status translation_status SET translation_status.translator_id = 0 WHERE translation_status.rid IN ( $rids ) "; $wpdb->query( $sql ); $jobIds = \wpml_prepare_in( array_column( $rowsToUpdate, 'job_id' ), '%d' ); $sql = " UPDATE {$wpdb->prefix}icl_translate_job SET translator_id = 0 WHERE job_id IN ( $jobIds ) "; $wpdb->query( $sql ); } $this->result = true; return $this->result; } /** * Unused. * * @return null */ public function run_ajax() { return null; } /** * Unused. * * @return null */ public function run_frontend() { return null; } /** * @return bool */ public function get_results() { return $this->result; } }
[-] AddAteSyncCountToTranslationJob.php
[edit]
[-] AddCountryColumnToLanguages.php
[edit]
[-] class-wpml-upgrade-add-location-column-to-strings.php
[edit]
[-] class-wpml-upgrade-fix-non-admin-cap.php
[edit]
[-] class-wpml-tm-add-tp-revision-and-ts-status-columns-to-core-status.php
[edit]
[-] class-wpml-upgrade-media-duplication-in-core.php
[edit]
[-] class-wpml-upgrade-add-editor-column-to-icl-translate-job.php
[edit]
[-] class-wpml-tm-add-tp-revision-and-ts-status-columns-to-translation-status.php
[edit]
[-] class-wpml-add-uuid-column-to-translation-status.php
[edit]
[-] class-wpml-tm-upgrade-wpml-site-id-ate.php
[edit]
[-] class-wpml-upgrade-media-without-language.php
[edit]
[-] ResetTranslatorOfAutomaticJobs.php
[edit]
[+]
SynchronizeSourceIdOfATEJobs
[-] class-wpml-upgrade-add-wrap-column-to-strings.php
[edit]
[-] class-wpml-tm-add-tpid-column-to-translation-status.php
[edit]
[-] AddTranslationManagerCapToAdmin.php
[edit]
[-] AddContextIndexToStrings.php
[edit]
[-] class-wpml-upgrade-wpml-site-id-remaining.php
[edit]
[-] DropCodeLocaleIndexFromLocaleMap.php
[edit]
[-] class-wpml-upgrade-table-translate-job-for-3-9-0.php
[edit]
[-] AddAteCommunicationRetryColumnToTranslationStatus.php
[edit]
[-] AddStatusIndexToStringTranslations.php
[edit]
[-] class-disable-options-autoloading.php
[edit]
[+]
abstracts
[-] AddTMAllowedOption.php
[edit]
[-] AddReviewStatusColumnToTranslationStatus.php
[edit]
[-] class-wpml-upgrade-element-type-length-and-collation.php
[edit]
[-] AddStringPackageIdtIndexToStrings.php
[edit]
[-] class-wpml-tm-upgrade-service-redirect-to-field.php
[edit]
[-] wpml-upgrade-admin-users-languages.php
[edit]
[-] CreateAteDownloadQueueTable.php
[edit]
[-] RemoveRestDisabledNotice.php
[edit]
[-] AddAutomaticColumnToIclTranslateJob.php
[edit]
[-] class-wpml-tm-upgrade-translation-priorities-for-posts.php
[edit]
[-] class-wpml-tm-upgrade-default-editor-for-old-jobs.php
[edit]
[-] MigrateAteRepository.php
[edit]
[-] class-wpml-upgrade-add-word-count-column-to-strings.php
[edit]
[-] class-wpml-upgrade-remove-translation-services-transient.php
[edit]
[-] class-wpml-upgrade-display-mode-for-posts.php
[edit]
[-] wpml-tm-upgrade-cancel-orphan-jobs.php
[edit]
[+]
..
[-] AddPrimaryKeyToLocaleMap.php
[edit]
[-] ATEProxyUpdateRewriteRules.php
[edit]
[-] class-wpml-upgrade-wpml-site-id.php
[edit]
[-] class-wpml-upgrade-add-wrap-column-to-translate.php
[edit]
[-] wpml-upgrade-chinese-flags.php
[edit]
[-] RefreshTranslationServices.php
[edit]