diff --git a/modules/backend/widgets/Filter.php b/modules/backend/widgets/Filter.php index 99e2721e3..154b98015 100644 --- a/modules/backend/widgets/Filter.php +++ b/modules/backend/widgets/Filter.php @@ -473,6 +473,17 @@ class Filter extends WidgetBase $this->allScopes[$name] = $scopeObj; } } + + /** + * Programatically remove a scope, used for extensibility. + * @param string $scopeName Scope name + */ + public function removeScope($scopeName) + { + if (isset($this->allScopes[$scopeName])) { + unset($this->allScopes[$scopeName]); + } + } /** * Creates a filter scope object from name and configuration. diff --git a/modules/system/assets/ui/js/input.preset.js b/modules/system/assets/ui/js/input.preset.js index dbccc0172..495af6a03 100644 --- a/modules/system/assets/ui/js/input.preset.js +++ b/modules/system/assets/ui/js/input.preset.js @@ -247,14 +247,14 @@ if ($el.val().length && $el.val() != prefix) return - $el.val(prefix) + $el.val(prefix).trigger('oc.inputPreset.afterUpdate') this.$src = $(options.inputPreset, parent), this.$src.on('keyup', function() { if (self.cancelled) return - $el.val(prefix + self.formatValue()) + $el.val(prefix + self.formatValue()).trigger('oc.inputPreset.afterUpdate') }) this.$el.on('change', function() { diff --git a/modules/system/classes/UpdateManager.php b/modules/system/classes/UpdateManager.php index 6e6948ece..0f1120687 100644 --- a/modules/system/classes/UpdateManager.php +++ b/modules/system/classes/UpdateManager.php @@ -119,7 +119,7 @@ class UpdateManager */ public function update() { - $firstUp = !Schema::hasTable('migrations'); + $firstUp = !Schema::hasTable($this->getMigrationTableName()); if ($firstUp) { $this->repository->createRepository(); $this->note('Migration table created'); @@ -337,7 +337,7 @@ class UpdateManager } } - Schema::dropIfExists('migrations'); + Schema::dropIfExists($this->getMigrationTableName()); return $this; } @@ -874,4 +874,13 @@ class UpdateManager { return base64_encode(hash_hmac('sha512', http_build_query($data, '', '&'), base64_decode($secret), true)); } + + // + // Internals + // + + protected function getMigrationTableName() + { + return Config::get('database.migrations', 'migrations'); + } } diff --git a/modules/system/database/migrations/2014_10_01_000010_Db_Jobs.php b/modules/system/database/migrations/2014_10_01_000010_Db_Jobs.php index d00239bd7..c04fcc96f 100644 --- a/modules/system/database/migrations/2014_10_01_000010_Db_Jobs.php +++ b/modules/system/database/migrations/2014_10_01_000010_Db_Jobs.php @@ -7,7 +7,7 @@ class DbJobs extends Migration { public function up() { - Schema::create('jobs', function (Blueprint $table) { + Schema::create($this->getTableName(), function (Blueprint $table) { $table->engine = 'InnoDB'; $table->bigIncrements('id'); $table->string('queue'); @@ -22,6 +22,11 @@ class DbJobs extends Migration public function down() { - Schema::dropIfExists('jobs'); + Schema::dropIfExists($this->getTableName()); + } + + protected function getTableName() + { + return Config::get('queue.connections.database.table', 'jobs'); } } diff --git a/modules/system/database/migrations/2015_10_01_000018_Db_FailedJobs.php b/modules/system/database/migrations/2015_10_01_000018_Db_FailedJobs.php index 4c528d879..ec9012d39 100644 --- a/modules/system/database/migrations/2015_10_01_000018_Db_FailedJobs.php +++ b/modules/system/database/migrations/2015_10_01_000018_Db_FailedJobs.php @@ -7,7 +7,7 @@ class DbFailedJobs extends Migration { public function up() { - Schema::create('failed_jobs', function (Blueprint $table) { + Schema::create($this->getTableName(), function (Blueprint $table) { $table->engine = 'InnoDB'; $table->increments('id'); $table->text('connection'); @@ -19,6 +19,11 @@ class DbFailedJobs extends Migration public function down() { - Schema::dropIfExists('failed_jobs'); + Schema::dropIfExists($this->getTableName()); + } + + protected function getTableName() + { + return Config::get('queue.failed.table', 'failed_jobs'); } } diff --git a/modules/system/database/migrations/2016_10_01_000020_Db_System_Timestamp_Fix.php b/modules/system/database/migrations/2016_10_01_000020_Db_System_Timestamp_Fix.php index 5a2c8d4a9..c1ce81107 100644 --- a/modules/system/database/migrations/2016_10_01_000020_Db_System_Timestamp_Fix.php +++ b/modules/system/database/migrations/2016_10_01_000020_Db_System_Timestamp_Fix.php @@ -10,24 +10,11 @@ use October\Rain\Database\Updates\Migration; */ class DbSystemTimestampFix extends Migration { - protected $coreTables = [ - 'deferred_bindings', - 'failed_jobs' => 'failed_at', - 'system_files', - 'system_event_logs', - 'system_mail_layouts', - 'system_mail_templates', - 'system_plugin_history' => 'created_at', - 'system_plugin_versions' => 'created_at', - 'system_request_logs', - 'system_revisions', - ]; - public function up() { DbDongle::disableStrictMode(); - foreach ($this->coreTables as $table => $columns) { + foreach ($this->getCoreTables() as $table => $columns) { if (is_int($table)) { $table = $columns; $columns = ['created_at', 'updated_at']; @@ -41,4 +28,22 @@ class DbSystemTimestampFix extends Migration { // ... } + + protected function getCoreTables() + { + $failedJobsTable = Config::get('queue.failed.table', 'failed_jobs'); + + return [ + 'deferred_bindings', + $failedJobsTable => 'failed_at', + 'system_files', + 'system_event_logs', + 'system_mail_layouts', + 'system_mail_templates', + 'system_plugin_history' => 'created_at', + 'system_plugin_versions' => 'created_at', + 'system_request_logs', + 'system_revisions', + ]; + } }