diff --git a/app/Controller/Customfilter.php b/app/Controller/Customfilter.php index c403cb4b8..80d18a179 100644 --- a/app/Controller/Customfilter.php +++ b/app/Controller/Customfilter.php @@ -115,6 +115,10 @@ class Customfilter extends Base if (! isset($values['is_shared'])) { $values += array('is_shared' => 0); } + + if (! isset($values['append'])) { + $values += array('append' => 0); + } list($valid, $errors) = $this->customFilter->validateModification($values); diff --git a/app/Model/CustomFilter.php b/app/Model/CustomFilter.php index 2c485247c..b7ccdf99f 100644 --- a/app/Model/CustomFilter.php +++ b/app/Model/CustomFilter.php @@ -40,7 +40,8 @@ class CustomFilter extends Base self::TABLE.'.project_id', self::TABLE.'.filter', self::TABLE.'.name', - self::TABLE.'.is_shared' + self::TABLE.'.is_shared', + self::TABLE.'.append' ) ->asc(self::TABLE.'.name') ->join(User::TABLE, 'id', 'user_id') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 37894dbd2..6ece27852 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,12 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 90; +const VERSION = 91; + +function version_91($pdo) +{ + $pdo->exec("ALTER TABLE custom_filters ADD COLUMN append TINYINT(1) DEFAULT 0"); +} function version_90($pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index 2a446e408..d4fae317c 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -6,7 +6,12 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 70; +const VERSION = 71; + +function version_71($pdo) +{ + $pdo->exec("ALTER TABLE custom_filters ADD COLUMN append BOOLEAN DEFAULT '0'"); +} function version_70($pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index 633c90a71..2b9ceadc6 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -6,7 +6,12 @@ use Core\Security; use PDO; use Model\Link; -const VERSION = 85; +const VERSION = 86; + +function version_86($pdo) +{ + $pdo->exec("ALTER TABLE custom_filters ADD COLUMN append INTEGER DEFAULT 0"); +} function version_85($pdo) { diff --git a/app/Template/custom_filter/add.php b/app/Template/custom_filter/add.php index d4e102b31..61df148c8 100644 --- a/app/Template/custom_filter/add.php +++ b/app/Template/custom_filter/add.php @@ -15,6 +15,8 @@ user->isProjectManagementAllowed($project['id'])): ?> = $this->form->checkbox('is_shared', t('Share with all project members'), 1) ?> + + = $this->form->checkbox('append', t('Append filter (instead of replacement)'), 1) ?>