Prepare module opensurvey for 'Form' type.

This commit is contained in:
Laurent Destailleur 2015-11-04 11:08:46 +01:00
parent d5b77bdc5f
commit 81f0b516b9
5 changed files with 78 additions and 5 deletions

View File

@ -250,4 +250,31 @@ CREATE TABLE llx_product_pricerules
var_min_percent FLOAT NOT NULL -- Min price discount over general price
);
ALTER TABLE llx_product ADD COLUMN price_autogen TINYINT(1) DEFAULT 0;
ALTER TABLE llx_product_pricerules ADD CONSTRAINT unique_level UNIQUE (level);
ALTER TABLE llx_product_pricerules ADD CONSTRAINT unique_level UNIQUE (level);
-- Delete deprecated fields
ALTER TABLE llx_opensurvey_sondage DROP COLUMN survey_link_visible;
ALTER TABLE llx_opensurvey_sondage DROP INDEX idx_id_sondage_admin;
ALTER TABLE llx_opensurvey_sondage DROP COLUMN id_sondage_admin;
ALTER TABLE llx_opensurvey_sondage DROP COLUMN canedit;
ALTER TABLE llx_opensurvey_sondage DROP COLUMN origin;
DROP TABLE llx_opensurvey_sujet_studs;
CREATE TABLE llx_opensurvey_formquestions (
rowid INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY,
id_sondage VARCHAR(16),
question TEXT,
available_answers TEXT -- List of available answers
) ENGINE=InnoDB;
CREATE TABLE llx_opensurvey_user_formanswers (
fk_user_survey INTEGER NOT NULL,
fk_question INTEGER NOT NULL,
reponses TEXT
) ENGINE=InnoDB;

View File

@ -0,0 +1,24 @@
-- ============================================================================
-- Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
-- ============================================================================
CREATE TABLE llx_opensurvey_formquestions (
rowid INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY,
id_sondage VARCHAR(16),
question TEXT,
available_answers TEXT -- List of available answers
) ENGINE=InnoDB;

View File

@ -24,10 +24,10 @@ CREATE TABLE llx_opensurvey_sondage (
fk_user_creat integer NOT NULL,
titre TEXT NOT NULL,
date_fin DATETIME NOT NULL,
format VARCHAR(2) NOT NULL,
format VARCHAR(2) NOT NULL, -- 'A' = Text choice (choices are saved into sujet field), 'D' = Date choice (choices are saved into sujet field), 'F' = Form survey
mailsonde tinyint NOT NULL DEFAULT 0,
allow_comments tinyint NOT NULL DEFAULT 1,
allow_spy tinyint NOT NULL DEFAULT 1,
tms TIMESTAMP,
sujet TEXT
) ENGINE=InnoDB;
sujet TEXT, -- Not filled if format = 'F'. Question are into table llx_opensurvey_formquestions
) ENGINE=InnoDB;

View File

@ -0,0 +1,22 @@
-- ============================================================================
-- Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
-- ============================================================================
CREATE TABLE llx_opensurvey_user_formanswers (
fk_user_survey INTEGER NOT NULL,
fk_question INTEGER NOT NULL,
reponses TEXT
) ENGINE=InnoDB;

View File

@ -19,6 +19,6 @@ CREATE TABLE llx_opensurvey_user_studs (
id_users INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
nom VARCHAR(64) NOT NULL,
id_sondage VARCHAR(16) NOT NULL,
reponses VARCHAR(100) NOT NULL,
reponses VARCHAR(100) NOT NULL, -- Not used for 'F' surveys
tms timestamp
) ENGINE=InnoDB;