Skip to content
Snippets Groups Projects
Commit a4a129e9 authored by Jared Hancock's avatar Jared Hancock
Browse files

upgrade: Add new flags field to %form_field

This will be used for greater flexibility in visibility and requirement
settings.
parent 0766c092
Branches
Tags
No related merge requests found
...@@ -424,7 +424,7 @@ class DynamicFormField extends VerySimpleModel { ...@@ -424,7 +424,7 @@ class DynamicFormField extends VerySimpleModel {
var $_field; var $_field;
const FLAG_ENABLED = 0x0001; const FLAG_ENABLED = 0x0001;
const FLAG_STORABLE = 0x0002; const FLAG_EXT_STORED = 0x0002; // Value stored outside of form_entry_value
const FLAG_CLOSE_REQUIRED = 0x0004; const FLAG_CLOSE_REQUIRED = 0x0004;
const FLAG_MASK_CHANGE = 0x0010; const FLAG_MASK_CHANGE = 0x0010;
......
...@@ -407,7 +407,7 @@ class FormField { ...@@ -407,7 +407,7 @@ class FormField {
*/ */
function isStorable() { function isStorable() {
return (($this->get('flags') & 2) == 0); return (($this->get('flags') & DynamicFormField::FLAG_EXT_STORED) == 0);
} }
/** /**
......
7c218d81e84b304c1436326c26ace09d 1ee831c854fe9f35115a3e672916bb91
/** /**
* @signature d7480e1c31a1f20d6954ecbb342722d3 * @signature 1ee831c854fe9f35115a3e672916bb91
* @version v1.9.5 * @version v1.9.6
* @title Make editable content translatable * @title Make editable content translatable
* *
* This patch adds support for translatable administratively editable * This patch adds support for translatable administratively editable
......
/** /**
* @signature 7c218d81e84b304c1436326c26ace09d * @signature 1ee831c854fe9f35115a3e672916bb91
* @version v1.9.6 * @version v1.9.6
* @title Make editable content translatable and add queues * @title Make editable content translatable and add queues
* *
...@@ -172,7 +172,41 @@ CREATE TABLE `%TABLE_PREFIX%queue` ( ...@@ -172,7 +172,41 @@ CREATE TABLE `%TABLE_PREFIX%queue` (
primary key (`id`) primary key (`id`)
) DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
-- Add flags field to form field
ALTER TABLE `%TABLE_PREFIX%form_field`
ADD `flags` INT UNSIGNED NOT NULL DEFAULT '1' AFTER `form_id`;
-- Flag field stored in the system elsewhere as nonstorable locally.
UPDATE `%TABLE_PREFIX%form_field` A1 JOIN `%TABLE_PREFIX%form` A2 ON(A2.id=A1.form_id)
SET A1.`flags` = 3
WHERE A2.`type` = 'U' AND A1.`name` IN('name','email');
UPDATE `%TABLE_PREFIX%form_field` A1 JOIN `%TABLE_PREFIX%form` A2 ON(A2.id=A1.form_id)
SET A1.`flags`=3
WHERE A2.`type`='O' AND A1.`name` IN('name');
set @client_edit = (
select value from `%TABLE_PREFIX%config` where `key` = 'allow_client_updates');
-- Transfer previous visibility and requirement settings to new flag field
UPDATE `%TABLE_PREFIX%form_field` SET `flags` = `flags` |
CASE WHEN `private` = 0 and @client_edit = 1 THEN CONV(3300, 16, 10)
WHEN `private` = 0 and @client_edit = 0 THEN CONV(3100, 16, 10)
WHEN `private` = 1 THEN CONV(3000, 16, 10)
WHEN `private` = 2 and @client_edit = 1 THEN CONV(300, 16, 10) END
WHEN `private` = 2 and @client_edit = 0 THEN CONV(100, 16, 10) END
| CASE WHEN `required` = 0 THEN 0
WHEN `required` = 1 THEN CONV(4400, 16, 10)
WHEN `required` = 2 THEN CONV(400, 16, 10)
WHEN `required` = 3 THEN CONV(4000, 16, 10) END
| IF(`edit_mask` & 1, CONV(20, 16, 10), 0)
| IF(`edit_mask` & 2, CONV(40000, 16, 10), 0)
| IF(`edit_mask` & 4, CONV(10000, 16, 10), 0)
| IF(`edit_mask` & 8, CONV(20000, 16, 10), 0)
| IF(`edit_mask` & 16, CONV(10, 16, 10), 0)
| IF(`edit_mask` & 32, CONV(40, 16, 10), 0);
-- Finished with patch -- Finished with patch
UPDATE `%TABLE_PREFIX%config` UPDATE `%TABLE_PREFIX%config`
SET `value` = '7c218d81e84b304c1436326c26ace09d' SET `value` = '1ee831c854fe9f35115a3e672916bb91'
WHERE `key` = 'schema_signature' AND `namespace` = 'core'; WHERE `key` = 'schema_signature' AND `namespace` = 'core';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment