diff --git a/application/controllers/admin/surveyadmin.php b/application/controllers/admin/surveyadmin.php index 5f884075d4f..e13fa17320c 100644 --- a/application/controllers/admin/surveyadmin.php +++ b/application/controllers/admin/surveyadmin.php @@ -333,7 +333,7 @@ public function changetemplate($iSurveyID, $template) $survey->save(); $oTemplateConfiguration = $survey->surveyTemplateConfiguration; - $oTemplateConfiguration->templates_name = $sTemplate; + $oTemplateConfiguration->template_name = $sTemplate; $oTemplateConfiguration->save(); } diff --git a/application/helpers/update/updatedb_helper.php b/application/helpers/update/updatedb_helper.php index 1f33187c39c..7b8a6a135e4 100644 --- a/application/helpers/update/updatedb_helper.php +++ b/application/helpers/update/updatedb_helper.php @@ -799,7 +799,7 @@ function upgradeTemplateTables304($oDB) 'description' => 'TEXT', 'last_update' => 'DATETIME DEFAULT NULL', 'owner_id' => 'INT(11) DEFAULT NULL', - 'extends_templates_name' => 'string(150) DEFAULT NULL', + 'extends_template_name' => 'string(150) DEFAULT NULL', 'PRIMARY KEY (name)' )); @@ -820,7 +820,7 @@ function upgradeTemplateTables304($oDB) 'files_folder' => 'files', 'description' => "LimeSurvey Advanced Template
A template with custom options to show what it's possible to do with the new engines. Each template provider will be able to offer its own option page (loaded from template)", 'owner_id' => '1', - 'extends_templates_name' => '', + 'extends_template_name' => '', )); // Add minimal template @@ -840,7 +840,7 @@ function upgradeTemplateTables304($oDB) 'files_folder' => 'files', 'description' => 'LimeSurvey Minimal Template
A clean and simple base that can be used by developers to create their own solution.', 'owner_id' => '1', - 'extends_templates_name' => '', + 'extends_template_name' => '', )); @@ -862,14 +862,14 @@ function upgradeTemplateTables304($oDB) 'files_folder' => 'files', 'description' => "LimeSurvey Advanced Template
A template extending default, to show the inheritance concept. Notice the options, differents from Default.
uses FezVrasta's Material design theme for Bootstrap 3", 'owner_id' => '1', - 'extends_templates_name' => 'default', + 'extends_template_name' => 'default', )); // Add template configuration table $oDB->createCommand()->createTable('{{template_configuration}}', array( 'id' => 'pk', - 'templates_name' => 'string(150) NOT NULL', + 'template_name' => 'string(150) NOT NULL', 'sid' => 'int(11) DEFAULT NULL', 'gsid' => 'int(11) DEFAULT NULL', 'uid' => 'int(11) DEFAULT NULL', @@ -886,7 +886,7 @@ function upgradeTemplateTables304($oDB) // Add global configuration for Advanced Template $oDB->createCommand()->insert('{{template_configuration}}', array( 'id' => '1', - 'templates_name' => 'default', + 'template_name' => 'default', 'files_css' => '{"add": ["css/template.css", "css/animate.css"]}', 'files_js' => '{"add": ["scripts/template.js"]}', 'files_print_css' => '{"add":"css/print_template.css",}', @@ -901,7 +901,7 @@ function upgradeTemplateTables304($oDB) // Add global configuration for Minimal Template $oDB->createCommand()->insert('{{template_configuration}}', array( 'id' => '2', - 'templates_name' => 'minimal', + 'template_name' => 'minimal', 'files_css' => '{"add": ["css/template.css"]}', 'files_js' => '{"add": ["scripts/template.js"]}', 'files_print_css' => '{"add":"css/print_template.css",}', @@ -915,7 +915,7 @@ function upgradeTemplateTables304($oDB) // Add global configuration for Material Template $oDB->createCommand()->insert('{{template_configuration}}', array( 'id' => '3', - 'templates_name' => 'material', + 'template_name' => 'material', 'files_css' => '{"add": ["css/template.css", "css/bootstrap-material-design.css", "css/ripples.min.css"]}', 'files_js' => '{"add": ["scripts/template.js", "scripts/material.js", "scripts/ripples.min.js"]}', 'files_print_css' => '{"add":"css/print_template.css",}', diff --git a/application/models/Template.php b/application/models/Template.php index 876155aeea3..0ab6de565c9 100644 --- a/application/models/Template.php +++ b/application/models/Template.php @@ -51,14 +51,14 @@ public function rules() return array( array('name, title, creation_date', 'required'), array('owner_id', 'numerical', 'integerOnly'=>true), - array('name, author, extends_templates_name', 'length', 'max'=>150), + array('name, author, extends_template_name', 'length', 'max'=>150), array('folder, version, api_version, view_folder, files_folder', 'length', 'max'=>45), array('title', 'length', 'max'=>100), array('author_email, author_url', 'length', 'max'=>255), array('copyright, license, description, last_update', 'safe'), // The following rule is used by search(). // @todo Please remove those attributes that should not be searched. - array('name, folder, title, creation_date, author, author_email, author_url, copyright, license, version, api_version, view_folder, files_folder, description, last_update, owner_id, extends_templates_name', 'safe', 'on'=>'search'), + array('name, folder, title, creation_date, author, author_email, author_url, copyright, license, version, api_version, view_folder, files_folder, description, last_update, owner_id, extends_template_name', 'safe', 'on'=>'search'), ); } @@ -94,7 +94,7 @@ public function attributeLabels() 'description' => 'Description', 'last_update' => 'Last Update', 'owner_id' => 'Owner', - 'extends_templates_name' => 'Extends Templates Name', + 'extends_template_name' => 'Extends Templates Name', ); } @@ -487,7 +487,7 @@ public function search() $criteria->compare('description',$this->description,true); $criteria->compare('last_update',$this->last_update,true); $criteria->compare('owner_id',$this->owner_id); - $criteria->compare('extends_templates_name',$this->extends_templates_name,true); + $criteria->compare('extends_template_name',$this->extends_template_name,true); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, diff --git a/application/models/TemplateConfiguration.php b/application/models/TemplateConfiguration.php index 668b404f0f0..12473106cee 100644 --- a/application/models/TemplateConfiguration.php +++ b/application/models/TemplateConfiguration.php @@ -19,7 +19,7 @@ * * The followings are the available columns in table '{{template_configuration}}': * @property string $id - * @property string $templates_name + * @property string $template_name * @property string $gsid * @property string $sid * @property string $files_css @@ -89,13 +89,13 @@ public function rules() // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( - array('templates_name', 'required'), + array('template_name', 'required'), array('id, sid, gsid', 'numerical', 'integerOnly'=>true), - array('templates_name', 'length', 'max'=>150), + array('template_name', 'length', 'max'=>150), array('cssframework_name', 'length', 'max'=>45), array('files_css, files_js, files_print_css, options, cssframework_css, cssframework_js, packages_to_load', 'safe'), // The following rule is used by search(). - array('id, templates_name, sid, gsid, files_css, files_js, files_print_css, options, cssframework_name, cssframework_css, cssframework_js, packages_to_load', 'safe', 'on'=>'search'), + array('id, template_name, sid, gsid, files_css, files_js, files_print_css, options, cssframework_name, cssframework_css, cssframework_js, packages_to_load', 'safe', 'on'=>'search'), ); } @@ -105,7 +105,7 @@ public function rules() public function relations() { return array( - 'template' => array(self::HAS_ONE, 'Template', array('name' => 'templates_name')), + 'template' => array(self::HAS_ONE, 'Template', array('name' => 'template_name')), ); } @@ -116,7 +116,7 @@ public function attributeLabels() { return array( 'id' => 'ID', - 'templates_name' => 'Templates Name', + 'template_name' => 'Templates Name', 'sid' => 'Sid', 'gsid' => 'Gsid', 'files_css' => 'Files Css', @@ -138,8 +138,8 @@ public function attributeLabels() */ public static function getInstanceFromTemplateName($sTemplateName){ return self::model()->find( - 'templates_name=:templates_name AND sid IS NULL AND gsid IS NULL', - array(':templates_name'=>$sTemplateName) + 'template_name=:template_name AND sid IS NULL AND gsid IS NULL', + array(':template_name'=>$sTemplateName) ); } @@ -158,8 +158,8 @@ public static function getInstanceFromSurveyGroup($iSurveyGroupId, $sTemplateNam $criteria = new CDbCriteria(); $criteria->addCondition('gsid=:gsid'); - $criteria->addCondition('templates_name=:templates_name'); - $criteria->params = array('gsid' => $iSurveyGroupId, 'templates_name' => $sTemplateName); + $criteria->addCondition('template_name=:template_name'); + $criteria->params = array('gsid' => $iSurveyGroupId, 'template_name' => $sTemplateName); $oTemplateConfigurationModel = TemplateConfiguration::model()->find($criteria); // No specific template configuration for this surveygroup => create one @@ -192,8 +192,8 @@ public static function getInstanceFromSurveyId($iSurveyId, $sTemplateName=null){ $criteria = new CDbCriteria(); $criteria->addCondition('sid=:sid'); - $criteria->addCondition('templates_name=:templates_name'); - $criteria->params = array('sid' => $iSurveyId, 'templates_name' => $sTemplateName); + $criteria->addCondition('template_name=:template_name'); + $criteria->params = array('sid' => $iSurveyId, 'template_name' => $sTemplateName); $oTemplateConfigurationModel = TemplateConfiguration::model()->find($criteria); @@ -264,7 +264,7 @@ public function search() $criteria->addCondition('gsid IS NULL'); $criteria->compare('id',$this->id); - $criteria->compare('templates_name',$this->templates_name,true); + $criteria->compare('template_name',$this->template_name,true); $criteria->compare('files_css',$this->files_css,true); $criteria->compare('files_js',$this->files_js,true); $criteria->compare('files_print_css',$this->files_print_css,true); @@ -324,12 +324,12 @@ public static function importManifest($sTemplateName) $oNewTemplate->files_folder = $oEditTemplateDb->files_folder; //$oNewTemplate->description TODO: a more complex modal whith email, author, url, licence, desc, etc $oNewTemplate->owner_id = Yii::app()->user->id; - $oNewTemplate->extends_templates_name = $oEditedTemplate->oMotherTemplate->sTemplateName; + $oNewTemplate->extends_template_name = $oEditedTemplate->oMotherTemplate->sTemplateName; if ($oNewTemplate->save()){ $oNewTemplateConfiguration = new TemplateConfiguration; - $oNewTemplateConfiguration->templates_name = $oEditedTemplate->sTemplateName; - $oNewTemplateConfiguration->templates_name = $oEditedTemplate->sTemplateName; + $oNewTemplateConfiguration->template_name = $oEditedTemplate->sTemplateName; + $oNewTemplateConfiguration->template_name = $oEditedTemplate->sTemplateName; $oNewTemplateConfiguration->options = json_encode($oEditedTemplate->oOptions); @@ -551,8 +551,8 @@ protected function removeFileFromPackage( $sPackageName, $sType, $aSettings ) */ protected function setMotherTemplates() { - if(!empty($this->template->extends_templates_name)){ - $sMotherTemplateName = $this->template->extends_templates_name; + if(!empty($this->template->extends_template_name)){ + $sMotherTemplateName = $this->template->extends_template_name; $this->oMotherTemplate = TemplateConfiguration::getInstanceFromTemplateName($sMotherTemplateName); $this->oMotherTemplate->prepareTemplateRendering($sMotherTemplateName, null); if ($this->oMotherTemplate->checkTemplate()){ @@ -630,8 +630,8 @@ protected function getOptionKey($key){ protected function addMotherTemplatePackage($packages) { - if (!empty($this->template->extends_templates_name)){ - $sMotherTemplateName = (string) $this->template->extends_templates_name; + if (!empty($this->template->extends_template_name)){ + $sMotherTemplateName = (string) $this->template->extends_template_name; $packages[] = 'survey-template-'.$sMotherTemplateName; } return $packages; @@ -731,7 +731,7 @@ public function getParentConfiguration(){ } //in the endcheck for general global template - $this->oParentTemplate = Template::getTemplateConfiguration($this->templates_name, null, null); + $this->oParentTemplate = Template::getTemplateConfiguration($this->template_name, null, null); $this->oParentTemplate->bUseMagicInherit = $this->bUseMagicInherit; return $this->oParentTemplate; } diff --git a/application/models/TemplateManifest.php b/application/models/TemplateManifest.php index f00e1287c43..9f6ebe4d38e 100644 --- a/application/models/TemplateManifest.php +++ b/application/models/TemplateManifest.php @@ -169,7 +169,7 @@ public function getFilesForPackages($type, $oRTemplate) */ public function addFileReplacementInDB($sFile, $sType) { - $oTemplateConfigurationModels = TemplateConfiguration::model()->findAllByAttributes(array('templates_name'=>$this->sTemplateName)); + $oTemplateConfigurationModels = TemplateConfiguration::model()->findAllByAttributes(array('template_name'=>$this->sTemplateName)); foreach($oTemplateConfigurationModels as $oTemplateConfigurationModel){ $oTemplateConfigurationModel->addFileReplacement($sFile, $sType); } diff --git a/installer/sql/create-mssql.sql b/installer/sql/create-mssql.sql index d4d23aafb4b..b4c2e667945 100644 --- a/installer/sql/create-mssql.sql +++ b/installer/sql/create-mssql.sql @@ -538,16 +538,7 @@ CREATE TABLE [prefix_users] ( -- --- Table structure for table templates --- -CREATE TABLE [prefix_templates] ( -[folder] nvarchar(50) NOT NULL, -[creator] int NOT NULL, -PRIMARY KEY ([folder]) -); - --- --- Table structure & data for boxes +-- Table boxes -- CREATE TABLE prefix_boxes ( @@ -590,7 +581,7 @@ create index [saved_control_idx2] on [prefix_saved_control] ([sid]); create index [parent_qid_idx] on [prefix_questions] ([parent_qid]); -- --- Notification table +-- Table notifications -- CREATE TABLE prefix_notifications ( [id] int NOT NULL IDENTITY, @@ -610,36 +601,36 @@ CREATE INDEX [notif_index] ON [prefix_notifications] ([entity_id],[entity],[stat CREATE INDEX [notif_hash_index] ON [prefix_notifications] ([hash]); -- --- User settings table +-- Table settings_user -- CREATE TABLE prefix_settings_user ( + [id] int NOT NULL IDENTITY , [uid] int NOT NULL, [entity] varchar(15) NULL, [entity_id] varchar(31) NULL, [stg_name] varchar(63) NOT NULL, [stg_value] nvarchar(max) NULL, - PRIMARY KEY ([uid], [entity], [entity_id], [stg_name]) + PRIMARY KEY ([id]) ); -- -- Surveymenu -- - CREATE TABLE prefix_surveymenu ( - [id] int(11) NOT NULL , - [parent_id] int(11) NULL, - [survey_id] int(11) NULL, - [user_id] int(11) NULL, - [ordering] int(11) DEFAULT '0', - [level] int(11) DEFAULT '0', + [id] int NOT NULL IDENTITY, + [parent_id] int NULL, + [survey_id] int NULL, + [user_id] int NULL, + [ordering] int DEFAULT '0', + [level] int DEFAULT '0', [title] NVARCHAR(255) NOT NULL DEFAULT '', [position] VARCHAR(255) NOT NULL DEFAULT 'side', [description] NVARCHAR(MAX) , - [active] int(1) NOT NULL DEFAULT '0', + [active] int NOT NULL DEFAULT '0', [changed_at] datetime NULL, - [changed_by] int(11) NOT NULL DEFAULT '0', - [created_at] datetime NOT NULL DEFAULT, - [created_by] int(11) NOT NULL DEFAULT '0', + [changed_by] int NOT NULL DEFAULT '0', + [created_at] datetime NOT NULL, + [created_by] int NOT NULL DEFAULT '0', PRIMARY KEY ([id]) ); @@ -649,17 +640,19 @@ create index [order_index] on [prefix_surveymenu] ([ordering]); create index [title_index] on [prefix_surveymenu] ([title]); -INSERT INTO [prefix_surveymenu] VALUES (1,NULL,NULL,NULL,0,0,'surveymenu','side','Main survey menu',NOW(),0,NOW(),0); -INSERT INTO [prefix_surveymenu] VALUES (2,NULL,NULL,NULL,0,0,'quickmenue','collapsed','quickmenu',NOW(),0,NOW(),0); +INSERT INTO [prefix_surveymenu] ([parent_id],[survey_id],[user_id],[ordering],[level],[title],[position],[description],[active],[changed_at],[changed_by],[created_at],[created_by]) +VALUES (NULL,NULL,NULL,0,0,'surveymenu','side','Main survey menu',1,SYSDATETIME(),0,SYSDATETIME(),0); +INSERT INTO [prefix_surveymenu] ([parent_id],[survey_id],[user_id],[ordering],[level],[title],[position],[description],[active],[changed_at],[changed_by],[created_at],[created_by]) +VALUES (NULL,NULL,NULL,0,0,'quickmenue','collapsed','quickmenu',1,SYSDATETIME(),0,SYSDATETIME(),0); -- -- Surveymenu entries -- CREATE TABLE prefix_surveymenu_entries ( [id] int NOT NULL IDENTITY (1,1) PRIMARY KEY, - [menu_id] int(11) NULL, - [user_id] int(11) NULL, - [ordering] int(11) DEFAULT '0', + [menu_id] int NULL, + [user_id] int NULL, + [ordering] int DEFAULT '0', [name] VARCHAR(255) NOT NULL DEFAULT '', [title] NVARCHAR(255) NOT NULL DEFAULT '', [menu_title] NVARCHAR(255) NOT NULL DEFAULT '', @@ -677,59 +670,59 @@ CREATE TABLE prefix_surveymenu_entries ( [data] NVARCHAR(max) NULL, [getdatamethod] VARCHAR(255) NOT NULL DEFAULT '', [language] VARCHAR(255) NOT NULL DEFAULT 'en-GB', - [active] int(1) NOT NULL DEFAULT '0', + [active] int NOT NULL DEFAULT '0', [changed_at] datetime NULL, - [changed_by] int(11) NOT NULL DEFAULT '0', + [changed_by] int NOT NULL DEFAULT '0', [created_at] datetime NOT NULL, - [created_by] int(11) NOT NULL DEFAULT '0' + [created_by] int NOT NULL DEFAULT '0' ); -create index [order_index] on [prefix_surveymenu] ([ordering]); -create index [user_index] on [prefix_surveymenu] ([user]); -create index [title_index] on [prefix_surveymenu] ([title]); -create index [menu_title_index] on [prefix_surveymenu] ([menu_title]); - -SET IDENTITY_INSERT [prefix_surveymenu_entries] ON; - -INSERT INTO [prefix_surveymenu_entries] VALUES -(1,1,NULL,1,'overview','Survey overview','Overview','Open general survey overview and quick action','list','fontawesome','','admin/survey/sa/view','','','','','','','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(2,1,NULL,2,'generalsettings','Edit survey general settings','General settings','Open general survey settings','gears','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_generaloptions_panel','','surveysettings','read',NULL,'_generalTabEditSurvey','en-GB',1, NOW(),0,NOW(),0), -(3,1,NULL,3,'surveytexts','Edit survey text elements','Survey texts','Edit survey text elements','file-text-o','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/tab_edit_view','','surveylocale','read',NULL,'_getTextEditData','en-GB',1, NOW(),0,NOW(),0), -(4,1,NULL,4,'template_options','Template options','Template options','Edit Template options for this survey','paint-brush','fontawesome','','admin/templateoptions/sa/updatesurvey','','','','','templates','read','{"render": {"link": { "pjaxed": false, "data": {"surveyid": ["survey","sid"], "gsid":["survey","gsid"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(5,1,NULL,5,'participants','Survey participants','Survey participants','Go to survey participant and token settings','user','fontawesome','','admin/tokens/sa/index/','','','','','surveysettings','update','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(6,1,NULL,6,'presentation','Presentation & navigation settings','Presentation','Edit presentation and navigation settings','eye-slash','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_presentation_panel','','surveylocale','read',NULL,'_tabPresentationNavigation','en-GB',1, NOW(),0,NOW(),0), -(7,1,NULL,7,'publication','Publication and access control settings','Publication & access','Edit settings for publicationa and access control','key','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_publication_panel','','surveylocale','read',NULL,'_tabPublicationAccess','en-GB',1, NOW(),0,NOW(),0), -(8,1,NULL,8,'surveypermissions','Edit surveypermissions','Survey permissions','Edit permissions for this survey','lock','fontawesome','','admin/surveypermission/sa/view/','','','','','surveysecurity','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(9,1,NULL,9,'tokens','Token handling','Participant tokens','Define how tokens should be treated or generated','users','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_tokens_panel','','surveylocale','read',NULL,'_tabTokens','en-GB',1, NOW(),0,NOW(),0), -(10,1,NULL,10,'quotas','Edit quotas','Survey quotas','Edit quotas for this survey.','tasks','fontawesome','','admin/quotas/sa/index/','','','','','quotas','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(11,1,NULL,11,'assessments','Edit assessments','Assessments','Edit and look at the asessements for this survey.','comment-o','fontawesome','','admin/assessments/sa/index/','','','','','assessments','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(12,1,NULL,12,'notification','Notification and data management settings','Data management','Edit settings for notification and data management','feed','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_notification_panel','','surveylocale','read',NULL,'_tabNotificationDataManagement','en-GB',1, NOW(),0,NOW(),0), -(13,1,NULL,13,'emailtemplates','Email templates','Email templates','Edit the templates for invitation, reminder and registration emails','envelope-square','fontawesome','','admin/emailtemplates/sa/index/','','','','','assessments','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(14,1,NULL,14,'panelintegration','Edit survey panel integration','Panel integration','Define panel integrations for your survey','link','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_integration_panel','','surveylocale','read',NULL,'_tabPanelIntegration','en-GB',1, NOW(),0,NOW(),0), -(15,1,NULL,15,'resources','Add/Edit resources to the survey','Resources','Add/Edit resources to the survey','file','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_resources_panel','','surveylocale','read',NULL,'_tabResourceManagement','en-GB',1, NOW(),0,NOW(),0), -(16,2,NULL,1,'activateSurvey','Activate survey','Activate survey','Activate survey','play','fontawesome','','admin/survey/sa/activate','','','','','surveyactivation','update','{\"render\": {\"isActive\": false, \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(17,2,NULL,2,'deactivateSurvey','Stop this survey','Stop this survey','Stop this survey','stop','fontawesome','','admin/survey/sa/deactivate','','','','','surveyactivation','update','{\"render\": {\"isActive\": true, \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(18,2,NULL,3,'testSurvey','Go to survey','Go to survey','Go to survey','cog','fontawesome','','survey/index/','','','','','','','{\"render\"\: {\"link\"\: {\"external\"\: true, \"data\"\: {\"sid\"\: [\"survey\",\"sid\"], \"newtest\"\: \"Y\", \"lang\"\: [\"survey\",\"language\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(19,2,NULL,4,'listQuestions','List questions','List questions','List questions','list','fontawesome','','admin/survey/sa/listquestions','','','','','surveycontent','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(20,2,NULL,5,'listQuestionGroups','List question groups','List question groups','List question groups','th-list','fontawesome','','admin/survey/sa/listquestiongroups','','','','','surveycontent','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(21,2,NULL,6,'generalsettings','Edit survey general settings','General settings','Open general survey settings','gears','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_generaloptions_panel','','surveysettings','read',NULL,'_generalTabEditSurvey','en-GB',1, NOW(),0,NOW(),0), -(22,2,NULL,7,'surveypermissions','Edit surveypermissions','Survey permissions','Edit permissions for this survey','lock','fontawesome','','admin/surveypermission/sa/view/','','','','','surveysecurity','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(23,2,NULL,8,'quotas','Edit quotas','Survey quotas','Edit quotas for this survey.','tasks','fontawesome','','admin/quotas/sa/index/','','','','','quotas','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(24,2,NULL,9,'assessments','Edit assessments','Assessments','Edit and look at the asessements for this survey.','comment-o','fontawesome','','admin/assessments/sa/index/','','','','','assessments','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(25,2,NULL,10,'emailtemplates','Email templates','Email templates','Edit the templates for invitation, reminder and registration emails','envelope-square','fontawesome','','admin/emailtemplates/sa/index/','','','','','surveylocale','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(26,2,NULL,11,'surveyLogicFile','Survey logic file','Survey logic file','Survey logic file','sitemap','fontawesome','','admin/expressions/sa/survey_logic_file/','','','','','surveycontent','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0), -(27,2,NULL,12,'tokens','Token handling','Participant tokens','Define how tokens should be treated or generated','user','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_tokens_panel','','surveylocale','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','_tabTokens','en-GB',1, NOW(),0,NOW(),0), -(28,2,NULL,13,'cpdb','Central participant database','Central participant database','Central participant database','users','fontawesome','','admin/participants/sa/displayParticipants','','','','','tokens','read','{render\: {\"link\"\: {}}','','en-GB',1, NOW(),0,NOW(),0), -(29,2,NULL,14,'responses','Responses','Responses','Responses','icon-browse','iconclass','','admin/responses/sa/browse/','','','','','responses','read','{\"render\"\: {\"isActive\"\: true}}','','en-GB',1, NOW(),0,NOW(),0), -(30,2,NULL,15,'statistics','Statistics','Statistics','Statistics','bar-chart','fontawesome','','admin/statistics/sa/index/','','','','','statistics','read','{\"render\"\: {\"isActive\"\: true}}','','en-GB',1, NOW(),0,NOW(),0), -(31,2,NULL,16,'reorder','Reorder questions/question groups','Reorder questions/question groups','Reorder questions/question groups','icon-organize','iconclass','','admin/survey/sa/organize/','','','','','surveycontent','update','{\"render\": {\"isActive\": false, \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, NOW(),0,NOW(),0); -SET IDENTITY_INSERT [prefix_surveymenu_entries] ON; +create index [menu_id_index] on [prefix_surveymenu_entries] ([menu_id]); +create index [ordering_index] on [prefix_surveymenu_entries] ([ordering]); +create index [title_index] on [prefix_surveymenu_entries] ([title]); +create index [menu_title_index] on [prefix_surveymenu_entries] ([menu_title]); + + +INSERT INTO [prefix_surveymenu_entries] ([menu_id],[user_id],[ordering],[name],[title],[menu_title],[menu_description],[menu_icon],[menu_icon_type],[menu_class],[menu_link],[action],[template],[partial],[classes],[permission],[permission_grade],[data],[getdatamethod],[language],[active],[changed_at],[changed_by],[created_at],[created_by]) VALUES +(1,NULL,1,'overview','Survey overview','Overview','Open general survey overview and quick action','list','fontawesome','','admin/survey/sa/view','','','','','','','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,2,'generalsettings','Edit survey general settings','General settings','Open general survey settings','gears','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_generaloptions_panel','','surveysettings','read',NULL,'_generalTabEditSurvey','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,3,'surveytexts','Edit survey text elements','Survey texts','Edit survey text elements','file-text-o','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/tab_edit_view','','surveylocale','read',NULL,'_getTextEditData','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,4,'template_options','Template options','Template options','Edit Template options for this survey','paint-brush','fontawesome','','admin/templateoptions/sa/updatesurvey','','','','','templates','read','{"render": {"link": { "pjaxed": false, "data": {"surveyid": ["survey","sid"], "gsid":["survey","gsid"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,5,'participants','Survey participants','Survey participants','Go to survey participant and token settings','user','fontawesome','','admin/tokens/sa/index/','','','','','surveysettings','update','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,6,'presentation','Presentation & navigation settings','Presentation','Edit presentation and navigation settings','eye-slash','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_presentation_panel','','surveylocale','read',NULL,'_tabPresentationNavigation','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,7,'publication','Publication and access control settings','Publication & access','Edit settings for publicationa and access control','key','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_publication_panel','','surveylocale','read',NULL,'_tabPublicationAccess','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,8,'surveypermissions','Edit surveypermissions','Survey permissions','Edit permissions for this survey','lock','fontawesome','','admin/surveypermission/sa/view/','','','','','surveysecurity','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,9,'tokens','Token handling','Participant tokens','Define how tokens should be treated or generated','users','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_tokens_panel','','surveylocale','read',NULL,'_tabTokens','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,10,'quotas','Edit quotas','Survey quotas','Edit quotas for this survey.','tasks','fontawesome','','admin/quotas/sa/index/','','','','','quotas','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,11,'assessments','Edit assessments','Assessments','Edit and look at the asessements for this survey.','comment-o','fontawesome','','admin/assessments/sa/index/','','','','','assessments','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,12,'notification','Notification and data management settings','Data management','Edit settings for notification and data management','feed','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_notification_panel','','surveylocale','read',NULL,'_tabNotificationDataManagement','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,13,'emailtemplates','Email templates','Email templates','Edit the templates for invitation, reminder and registration emails','envelope-square','fontawesome','','admin/emailtemplates/sa/index/','','','','','assessments','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,14,'panelintegration','Edit survey panel integration','Panel integration','Define panel integrations for your survey','link','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_integration_panel','','surveylocale','read',NULL,'_tabPanelIntegration','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(1,NULL,15,'resources','Add/Edit resources to the survey','Resources','Add/Edit resources to the survey','file','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_resources_panel','','surveylocale','read',NULL,'_tabResourceManagement','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,1,'activateSurvey','Activate survey','Activate survey','Activate survey','play','fontawesome','','admin/survey/sa/activate','','','','','surveyactivation','update','{\"render\": {\"isActive\": false, \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,2,'deactivateSurvey','Stop this survey','Stop this survey','Stop this survey','stop','fontawesome','','admin/survey/sa/deactivate','','','','','surveyactivation','update','{\"render\": {\"isActive\": true, \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,3,'testSurvey','Go to survey','Go to survey','Go to survey','cog','fontawesome','','survey/index/','','','','','','','{\"render\"\: {\"link\"\: {\"external\"\: true, \"data\"\: {\"sid\"\: [\"survey\",\"sid\"], \"newtest\"\: \"Y\", \"lang\"\: [\"survey\",\"language\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,4,'listQuestions','List questions','List questions','List questions','list','fontawesome','','admin/survey/sa/listquestions','','','','','surveycontent','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,5,'listQuestionGroups','List question groups','List question groups','List question groups','th-list','fontawesome','','admin/survey/sa/listquestiongroups','','','','','surveycontent','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,6,'generalsettings','Edit survey general settings','General settings','Open general survey settings','gears','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_generaloptions_panel','','surveysettings','read',NULL,'_generalTabEditSurvey','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,7,'surveypermissions','Edit surveypermissions','Survey permissions','Edit permissions for this survey','lock','fontawesome','','admin/surveypermission/sa/view/','','','','','surveysecurity','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,8,'quotas','Edit quotas','Survey quotas','Edit quotas for this survey.','tasks','fontawesome','','admin/quotas/sa/index/','','','','','quotas','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,9,'assessments','Edit assessments','Assessments','Edit and look at the asessements for this survey.','comment-o','fontawesome','','admin/assessments/sa/index/','','','','','assessments','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,10,'emailtemplates','Email templates','Email templates','Edit the templates for invitation, reminder and registration emails','envelope-square','fontawesome','','admin/emailtemplates/sa/index/','','','','','surveylocale','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,11,'surveyLogicFile','Survey logic file','Survey logic file','Survey logic file','sitemap','fontawesome','','admin/expressions/sa/survey_logic_file/','','','','','surveycontent','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,12,'tokens','Token handling','Participant tokens','Define how tokens should be treated or generated','user','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_tokens_panel','','surveylocale','read','{\"render\": { \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','_tabTokens','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,13,'cpdb','Central participant database','Central participant database','Central participant database','users','fontawesome','','admin/participants/sa/displayParticipants','','','','','tokens','read','{render\: {\"link\"\: {}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,14,'responses','Responses','Responses','Responses','icon-browse','iconclass','','admin/responses/sa/browse/','','','','','responses','read','{\"render\"\: {\"isActive\"\: true}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,15,'statistics','Statistics','Statistics','Statistics','bar-chart','fontawesome','','admin/statistics/sa/index/','','','','','statistics','read','{\"render\"\: {\"isActive\"\: true}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0), +(2,NULL,16,'reorder','Reorder questions/question groups','Reorder questions/question groups','Reorder questions/question groups','icon-organize','iconclass','','admin/survey/sa/organize/','','','','','surveycontent','update','{\"render\": {\"isActive\": false, \"link\": {\"data\": {\"surveyid\": [\"survey\",\"sid\"]}}}}','','en-GB',1, SYSDATETIME(),0,SYSDATETIME(),0); + -- ----------------------------------------------------- -- Table prefix_templates -- ----------------------------------------------------- CREATE TABLE prefix_templates ( + [id] int NOT NULL IDENTITY (1,1) PRIMARY KEY, [name] nVARCHAR(150) NOT NULL, [folder] varchar(45) NULL, [title] nvarchar(100) NOT NULL, @@ -745,9 +738,8 @@ CREATE TABLE prefix_templates ( [files_folder] varchar(45) NOT NULL, [description] nvarchar(max) NULL, [last_update] datetime NULL, - [owner_id] int(11) NULL, - [extends_templates_name] nvarchar(150) NULL, - PRIMARY KEY ([name]) + [owner_id] int NULL, + [extends_templates_name] nvarchar(150) NULL ); @@ -757,7 +749,7 @@ INSERT INTO [prefix_templates] VALUES INSERT INTO [prefix_templates] VALUES ('minimal', 'minimal', 'Minimal Template', '2017-07-12 10:00:00', 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', 'LimeSurvey Minimal Template
A clean and simple base that can be used by developers to create their own solution.', NULL, 1, ''); INSERT INTO [prefix_templates] VALUES - ('material', 'material', 'Material Template', '2017-07-12 10:00:00', 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', "LimeSurvey Advanced Template
A template extending default, to show the inheritance concept. Notice the options, differents from Default.
uses FezVrasta's Material design theme for Bootstrap 3", NULL, 1, 'default'); + ('material', 'material', 'Material Template', '2017-07-12 10:00:00', 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', 'LimeSurvey Advanced Template
A template extending default, to show the inheritance concept. Notice the options, differents from Default.
uses FezVrasta''s Material design theme for Bootstrap 3', NULL, 1, 'default'); -- ----------------------------------------------------- @@ -765,10 +757,10 @@ INSERT INTO [prefix_templates] VALUES -- ----------------------------------------------------- CREATE TABLE prefix_template_configuration ( [id] int NOT NULL IDENTITY (1,1) PRIMARY KEY, - [templates_name] nvarchar(150) NOT NULL, - [sid] int(11) NULL, - [gsid] int(11) NULL, - [uid] int(11) NULL, + [template_name] nvarchar(150) NOT NULL, + [sid] int NULL, + [gsid] int NULL, + [uid] int NULL, [files_css] nvarchar(max) NULL, [files_js] nvarchar(max) NULL, [files_print_css] nvarchar(max) NULL, @@ -781,41 +773,34 @@ CREATE TABLE prefix_template_configuration ( [packages_rtl] nvarchar(max) NULL ); -SET IDENTITY_INSERT [prefix_template_configuration] ON; -INSERT INTO [prefix_template_configuration] VALUES - (1,'default',NULL,NULL,NULL,'{"add": ["css/template.css", "css/animate.css"]}','{"add": ["scripts/template.js"]}','{"add":"css/print_template.css",}','{"ajaxmode":"off","brandlogo":"on", "boxcontainer":"on", "backgroundimage":"on","animatebody":"on","bodyanimation":"fadeInRight","animatequestion":"off","questionanimation":"flipInX","animatealert":"off","alertanimation":"shake"}','bootstrap','{"replace": [["css/bootstrap.css","css/flatly.css"]]}','','','',''); -INSERT INTO prefix_template_configuration VALUES - (2, 'minimal', NULL, NULL, NULL, '{"add": ["css/template.css"]}', '{"add": ["scripts/template.js"]}', '{"add":"css/print_template.css",}', '{}', 'bootstrap', '{}', '', '', '', ''); -INSERT INTO prefix_template_configuration VALUES - (3,'material',NULL,NULL,NULL,'{"add": ["css/template.css", "css/bootstrap-material-design.css", "css/ripples.min.css"]}','{"add": ["scripts/template.js", "scripts/material.js", "scripts/ripples.min.js"]}','{"add":"css/print_template.css",}','{"ajaxmode":"off","brandlogo":"on", "animatebody":"on","bodyanimation":"fadeInRight","animatequestion":"off","questionanimation":"flipInX","animatealert":"off","alertanimation":"shake"}','bootstrap','{"replace": [["css/bootstrap.css","css/bootstrap.css"]]}','','','',''); -SET IDENTITY_INSERT [prefix_template_configuration] OFF; +INSERT INTO [prefix_template_configuration] ([template_name],[sid],[gsid],[uid],[files_css],[files_js],[files_print_css],[options],[cssframework_name],[cssframework_css],[cssframework_js],[packages_to_load],[packages_ltr],[packages_rtl]) VALUES + ('default',NULL,NULL,NULL,'{"add": ["css/template.css", "css/animate.css"]}','{"add": ["scripts/template.js"]}','{"add":"css/print_template.css",}','{"ajaxmode":"off","brandlogo":"on", "boxcontainer":"on", "backgroundimage":"on","animatebody":"on","bodyanimation":"fadeInRight","animatequestion":"off","questionanimation":"flipInX","animatealert":"off","alertanimation":"shake"}','bootstrap','{"replace": [["css/bootstrap.css","css/flatly.css"]]}','','','',''), + ('minimal', NULL, NULL, NULL, '{"add": ["css/template.css"]}', '{"add": ["scripts/template.js"]}', '{"add":"css/print_template.css",}', '{}', 'bootstrap', '{}', '', '', '', ''), + ('material',NULL,NULL,NULL,'{"add": ["css/template.css", "css/bootstrap-material-design.css", "css/ripples.min.css"]}','{"add": ["scripts/template.js", "scripts/material.js", "scripts/ripples.min.js"]}','{"add":"css/print_template.css",}','{"ajaxmode":"off","brandlogo":"on", "animatebody":"on","bodyanimation":"fadeInRight","animatequestion":"off","questionanimation":"flipInX","animatealert":"off","alertanimation":"shake"}','bootstrap','{"replace": [["css/bootstrap.css","css/bootstrap.css"]]}','','','',''); -- ----------------------------------------------------- -- Table prefix_surveys_groups -- ----------------------------------------------------- CREATE TABLE [prefix_surveys_groups] ( - [gsid] int(11) NOT NULL PRIMARY KEY, + [gsid] int NOT NULL PRIMARY KEY, [name] varchar(45) NOT NULL, [title] varchar(100) NULL, [template] varchar(128) NULL DEFAULT 'default', [description] nvarchar(max) NULL, - [order] int(11) NOT NULL, - [owner_uid] int(11) NULL, - [parent_id] int(11) NULL, + [sortorder] int NOT NULL, + [owner_uid] int NULL, + [parent_id] int NULL, [created] datetime NULL, [modified] datetime NULL, - [created_by] int(11) NOT NULL + [created_by] int NOT NULL ); -SET IDENTITY_INSERT [prefix_surveys_groups] ON; INSERT INTO [prefix_surveys_groups] ([gsid], [name], [title], [description], [sortorder], [owner_uid], [parent_id], [created], [modified], [created_by]) VALUES (1, 'default', 'Default Survey Group', 'LimeSurvey core default survey group', 0, 1, NULL, '2017-07-20 17:09:30', '2017-07-20 17:09:30', 1); -SET IDENTITY_INSERT [prefix_surveys_groups] ON; - -- -- Version Info -- -INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '314'); +INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '315'); diff --git a/installer/sql/create-mysql.sql b/installer/sql/create-mysql.sql index 2ff8a2f52bb..6a615a71bcc 100644 --- a/installer/sql/create-mysql.sql +++ b/installer/sql/create-mysql.sql @@ -544,7 +544,7 @@ CREATE TABLE `prefix_users` ( -- --- Table structure & data for table boxes +-- Table boxes -- CREATE TABLE IF NOT EXISTS `prefix_boxes` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -585,7 +585,7 @@ CREATE INDEX `quota_idx2` ON `prefix_quota` (`sid`); CREATE INDEX `parent_qid_idx` ON `prefix_questions` (`parent_qid`); -- --- Notification table +-- Table notifications -- CREATE TABLE IF NOT EXISTS `prefix_notifications` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -605,7 +605,7 @@ CREATE TABLE IF NOT EXISTS `prefix_notifications` ( ) ENGINE=MYISAM CHARACTER SET utf8mb4 ; -- --- User settings table +-- Table settings_user -- CREATE TABLE IF NOT EXISTS `prefix_settings_user` ( `id` int(11) NOT NULL auto_increment, @@ -620,7 +620,6 @@ CREATE TABLE IF NOT EXISTS `prefix_settings_user` ( -- -- Surveymenu -- - CREATE TABLE `prefix_surveymenu` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parent_id` int(11) DEFAULT NULL, @@ -675,10 +674,10 @@ CREATE TABLE `prefix_surveymenu_entries` ( `created_at` datetime NOT NULL, `created_by` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `menu_id` (`menu_id`), - KEY `ordering` (`ordering`), - KEY `title` (`title`(191)), - KEY `menu_title` (`menu_title`(191)) + KEY `menu_id_index` (`menu_id`), + KEY `ordering_index` (`ordering`), + KEY `title_index` (`title`(191)), + KEY `menu_title_index` (`menu_title`(191)) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; @@ -720,6 +719,7 @@ INSERT INTO `prefix_surveymenu_entries` VALUES -- Table prefix_templates -- ----------------------------------------------------- CREATE TABLE `prefix_templates` ( + `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, `folder` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `title` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, @@ -737,17 +737,17 @@ CREATE TABLE `prefix_templates` ( `last_update` datetime DEFAULT NULL, `owner_id` int(11) DEFAULT NULL, `extends_templates_name` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`name`) + PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO `prefix_templates` VALUES - ('default', 'default', 'Advanced Template', '2017-07-12 10:00:00', 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', "LimeSurvey Advanced Template
A template with custom options to show what it's possible to do with the new engines. Each template provider will be able to offer its own option page (loaded from template)", NULL, 1, ''); + (1,'default', 'default', 'Advanced Template', '2017-07-12 10:00:00', 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', "LimeSurvey Advanced Template
A template with custom options to show what it's possible to do with the new engines. Each template provider will be able to offer its own option page (loaded from template)", NULL, 1, ''); INSERT INTO `prefix_templates` VALUES - ('minimal', 'minimal', 'Minimal Template', '2017-07-12 10:00:00', 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', 'LimeSurvey Minimal Template
A clean and simple base that can be used by developers to create their own solution.', NULL, 1, ''); + (2,'minimal', 'minimal', 'Minimal Template', '2017-07-12 10:00:00', 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', 'LimeSurvey Minimal Template
A clean and simple base that can be used by developers to create their own solution.', NULL, 1, ''); INSERT INTO `prefix_templates` VALUES - ('material', 'material', 'Material Template', '2017-07-12 10:00:00', 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', "LimeSurvey Advanced Template
A template extending default, to show the inheritance concept. Notice the options, differents from Default.
uses FezVrasta's Material design theme for Bootstrap 3", NULL, 1, 'default'); + ('material', 'material', 'Material Template', '2017-07-12 10:00:00', 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', 'LimeSurvey Advanced Template
A template extending default, to show the inheritance concept. Notice the options, differents from Default.
uses FezVrasta''s Material design theme for Bootstrap 3', NULL, 1, 'default'); -- ----------------------------------------------------- @@ -755,7 +755,7 @@ INSERT INTO `prefix_templates` VALUES -- ----------------------------------------------------- CREATE TABLE `prefix_template_configuration` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `templates_name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, + `template_name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, `sid` int(11) DEFAULT NULL, `gsid` int(11) DEFAULT NULL, `uid` int(11) DEFAULT NULL, @@ -790,7 +790,7 @@ CREATE TABLE `prefix_surveys_groups` ( `title` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `template` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT 'default', `description` text COLLATE utf8mb4_unicode_ci, - `order` int(11) NOT NULL, + `sortorder` int(11) NOT NULL, `owner_uid` int(11) DEFAULT NULL, `parent_id` int(11) DEFAULT NULL, `created` datetime DEFAULT NULL, @@ -808,4 +808,4 @@ INSERT INTO `prefix_surveys_groups` (`gsid`, `name`, `title`, `description`, `or -- -- Version Info -- -INSERT INTO `prefix_settings_global` VALUES ('DBVersion', '314'); +INSERT INTO `prefix_settings_global` VALUES ('DBVersion', '315');