" . T_("Any collected data and the limesurvey instrument will NOT be deleted") . "
";
- print "
" . T_("The questionnaire will be deleted from queXS including call history, cases, case notes, respondent details, appointments and the links between operators, clients and the questionnaire") . "
";
- print "
" . T_("Please confirm you wish to delete the questionnaire") . "
";
-
- print "";
-}
-else
-{
- $columns = array("description","enabledisable","modify","deletee");
- $titles = array(T_("Questionnaire"),T_("Enable/Disable"),T_("Modify"),T_("Delete"));
-
- $sql = "SELECT
- description,
- CASE WHEN enabled = 0 THEN
- CONCAT('" . TQ_("Enable") . "')
- ELSE
- CONCAT('" . TQ_("Disable") . "')
- END
- as enabledisable,
- CONCAT('" . TQ_("Modify"). "') as modify,
- CONCAT('" . TQ_("Delete"). "') as deletee
- FROM questionnaire";
-
- $rs = $db->GetAll($sql);
-
-
- xhtml_table($rs,$columns,$titles);
-}
-
-
-xhtml_foot();
-
-
-?>
+
+ * @copyright Australian Consortium for Social and Political Research Incorporated (ACSPRI) 2011
+ * @package queXS
+ * @subpackage admin
+ * @link http://www.acspri.org.au/ queXS was writen for ACSPRI
+ * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
+ *
+ */
+
+/**
+ * Configuration file
+ */
+include ("../config.inc.php");
+
+/**
+ * Database file
+ */
+include ("../db.inc.php");
+
+/**
+ * XHTML functions
+ */
+include ("../functions/functions.xhtml.php");
+
+/**
+ * Input functions
+ */
+include("../functions/functions.input.php");
+
+/**
+ * CKEditor
+ */
+include("../include/ckeditor/ckeditor.php");
+
+global $db;
+
+$css = array(
+"../include/bootstrap-3.3.2/css/bootstrap.min.css",
+"../include/bootstrap-3.3.2/css/bootstrap-theme.min.css",
+"../include/font-awesome-4.3.0/css/font-awesome.css",
+"../include/bootstrap-toggle/css/bootstrap-toggle.min.css",
+"../css/custom.css"
+ );
+$js_head = array(
+"../js/jquery-2.1.3.min.js",
+"../include/bootstrap-3.3.2/js/bootstrap.min.js"
+ );
+$js_foot = array(
+"../js/new.js",
+"../include/bootstrap-toggle/js/bootstrap-toggle.min.js",
+"../js/bootstrap-confirmation.js",
+"../js/custom.js"
+ );
+
+if (isset($_POST['questionnaire_id']) && isset($_POST['submit']))
+{
+ //Delete the questionnaire
+
+ $questionnaire_id = intval($_POST['questionnaire_id']);
+
+ $db->StartTrans();
+
+ $sql = "DELETE FROM `appointment`
+ WHERE case_id IN
+ (SELECT case_id
+ FROM `case`
+ WHERE questionnaire_id = $questionnaire_id)";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `call`
+ WHERE case_id IN
+ (SELECT case_id
+ FROM `case`
+ WHERE questionnaire_id = $questionnaire_id)";
+
+ $db->Execute($sql);
+
+
+ $sql = "DELETE FROM `call_attempt`
+ WHERE case_id IN
+ (SELECT case_id
+ FROM `case`
+ WHERE questionnaire_id = $questionnaire_id)";
+
+ $db->Execute($sql);
+
+
+ $sql = "DELETE FROM `case_availability`
+ WHERE case_id IN
+ (SELECT case_id
+ FROM `case`
+ WHERE questionnaire_id = $questionnaire_id)";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `case_note`
+ WHERE case_id IN
+ (SELECT case_id
+ FROM `case`
+ WHERE questionnaire_id = $questionnaire_id)";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `contact_phone`
+ WHERE case_id IN
+ (SELECT case_id
+ FROM `case`
+ WHERE questionnaire_id = $questionnaire_id)";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `respondent`
+ WHERE case_id IN
+ (SELECT case_id
+ FROM `case`
+ WHERE questionnaire_id = $questionnaire_id)";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `client_questionnaire`
+ WHERE questionnaire_id = $questionnaire_id";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `operator_questionnaire`
+ WHERE questionnaire_id = $questionnaire_id";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `questionnaire_availability`
+ WHERE questionnaire_id = $questionnaire_id";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `questionnaire_prefill`
+ WHERE questionnaire_id = $questionnaire_id";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `questionnaire_sample`
+ WHERE questionnaire_id = $questionnaire_id";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `questionnaire_sample_exclude_priority`
+ WHERE questionnaire_id = $questionnaire_id";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `questionnaire_sample_quota`
+ WHERE questionnaire_id = $questionnaire_id";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `questionnaire_sample_quota_row`
+ WHERE questionnaire_id = $questionnaire_id";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `questionnaire_sample_quota_row_exclude`
+ WHERE questionnaire_id = $questionnaire_id";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `shift_report`
+ WHERE shift_id IN
+ (SELECT shift_id
+ FROM `shift`
+ WHERE questionnaire_id = $questionnaire_id)";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `shift`
+ WHERE questionnaire_id = $questionnaire_id";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `case`
+ WHERE questionnaire_id = $questionnaire_id";
+
+ $db->Execute($sql);
+
+ $sql = "DELETE FROM `questionnaire`
+ WHERE questionnaire_id = $questionnaire_id";
+
+ $db->Execute($sql);
+
+ $db->CompleteTrans();
+}
+
+if (isset($_GET['disable']))
+{
+ $questionnaire_id = intval($_GET['disable']);
+
+ $sql = "UPDATE questionnaire
+ SET enabled = 0
+ WHERE questionnaire_id = '$questionnaire_id'";
+
+ $db->Execute($sql);
+}
+
+if (isset($_GET['enable']))
+{
+ $questionnaire_id = intval($_GET['enable']);
+
+ $sql = "UPDATE questionnaire
+ SET enabled = 1
+ WHERE questionnaire_id = '$questionnaire_id'";
+
+ $db->Execute($sql);
+}
+
+if (isset($_POST['update']) && isset($_GET['modify']))
+{
+ $questionnaire_id = intval($_GET['modify']);
+
+ $ras =0;
+ $rws = 0;
+ $rs = 0;
+ $respsc = 0;
+ $referral = 0;
+ if (isset($_POST['ras'])) $ras = 1;
+ if (isset($_POST['rws'])) $rws = 1;
+ if (isset($_POST['respsc'])) $respsc = 1;
+ if (isset($_POST['referral'])) $referral = 1;
+
+ $name = $db->qstr(html_entity_decode($_POST['description'],ENT_QUOTES,'UTF-8'));
+ if (isset($_POST['rs_intro']))
+ {
+ $rs = 1;
+ $rs_intro = $db->qstr(html_entity_decode($_POST['rs_intro'],ENT_QUOTES,'UTF-8'));
+ $rs_project_intro = $db->qstr(html_entity_decode($_POST['rs_project_intro'],ENT_QUOTES,'UTF-8'));
+ $rs_callback = $db->qstr(html_entity_decode($_POST['rs_callback'],ENT_QUOTES,'UTF-8'));
+ $rs_answeringmachine = $db->qstr(html_entity_decode($_POST['rs_answeringmachine'],ENT_QUOTES,'UTF-8'));
+ }
+ $info = $db->qstr(html_entity_decode($_POST['info'],ENT_QUOTES,'UTF-8'));
+ $rs_project_end = $db->qstr(html_entity_decode($_POST['rs_project_end'],ENT_QUOTES,'UTF-8'));
+
+ $sql = "UPDATE questionnaire
+ SET description = $name, info = $info, rs_project_end = $rs_project_end, restrict_appointments_shifts = '$ras', restrict_work_shifts = '$rws', self_complete = $respsc, referral = $referral
+ WHERE questionnaire_id = '$questionnaire_id'";
+
+ $db->Execute($sql);
+
+ if ($rs)
+ {
+ $sql = "UPDATE questionnaire
+ SET rs_intro = $rs_intro, rs_project_intro = $rs_project_intro, rs_callback = $rs_callback, rs_answeringmachine = $rs_answeringmachine
+ WHERE questionnaire_id = '$questionnaire_id'";
+ $db->Execute($sql);
+ }
+
+ if ($respsc == 1)
+ {
+ $lime_mode = $db->qstr($_POST['lime_mode'],get_magic_quotes_gpc());
+ $lime_template = $db->qstr($_POST['lime_template'],get_magic_quotes_gpc());
+ $lime_endurl = $db->qstr($_POST['lime_endurl'],get_magic_quotes_gpc());
+
+ $sql = "UPDATE questionnaire
+ SET lime_mode = $lime_mode, lime_template = $lime_template, lime_endurl = $lime_endurl
+ WHERE questionnaire_id = $questionnaire_id";
+ $db->Execute($sql);
+ }
+}
+
+if (isset($_GET['modify']))
+{
+ $questionnaire_id = intval($_GET['modify']);
+
+ $sql = "SELECT *
+ FROM questionnaire
+ WHERE questionnaire_id = $questionnaire_id";
+ $rs = $db->GetRow($sql);
+
+ $referral = $testing = $rws = $ras = $rsc = "checked=\"checked\"";
+ $rscd = "";
+
+ $aio = $qbq = $gat = "";
+ if ($rs['lime_mode'] == "survey") $aio = "selected=\"selected\"";
+ if ($rs['lime_mode'] == "question") $qbq = "selected=\"selected\"";
+ if ($rs['lime_mode'] == "group") $gat = "selected=\"selected\"";
+
+ if ($rs['restrict_appointments_shifts'] != 1) $ras = "";
+ if ($rs['restrict_work_shifts'] != 1) $rws = "";
+ if ($rs['testing'] != 1) $testing = "";
+ if ($rs['referral'] != 1) $referral = "";
+ if ($rs['self_complete'] == 0)
+ {
+ $rsc = "";
+ $rscd = "style='display:none;'";
+ }
+
+ xhtml_head(T_("Modify Questionnaire "),true,$css,$js_head, false, false, false, " " . "$rs[description]" . "");
+
+ $CKEditor = new CKEditor();
+ $CKEditor->basePath = "../include/ckeditor/";
+
+ $ckeditorConfig = array("toolbar" => array(array("tokens","-","Source"),
+ array("Cut","Copy","Paste","PasteText","PasteFromWord","-","Print","SpellChecker"),
+ array("Undo","Redo","-","Find","Replace","-","SelectAll","RemoveFormat"),
+ array('Link','Unlink','Anchor'),
+ array('Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'),
+ array('About'),
+ "/",
+ array("Bold","Italic","Underline","Strike","-","Subscript","Superscript"),
+ array("NumberedList","BulletedList","-","Outdent","Indent","Blockquote"),
+ array('JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'),
+ array('BidiLtr', 'BidiRtl'),
+ array('Styles','Format','Font','FontSize'),
+ array('TextColor','BGColor')),
+ "extraPlugins" => "tokens");
+?>
+
" . T_("Any collected data and the limesurvey instrument will NOT be deleted") . "
";
+ print "
" . T_("The questionnaire will be deleted from queXS including call history, cases, case notes, respondent details, appointments and the links between operators, clients and the questionnaire") . "
";
+ print "
" . T_("Please confirm you wish to delete the questionnaire") . "
') as description,
+ CASE WHEN enabled = 0 THEN
+ CONCAT(' " . TQ_("Disabled") . " ')
+ ELSE
+ CONCAT(' " . TQ_("Enabled") . " ')
+ END as status,
+ CASE WHEN enabled = 0 THEN
+ CONCAT(' ')
+ ELSE
+ CONCAT(' ')
+ END as enabledisable,
+ CONCAT('') as modify,
+ CONCAT('') as inlime,
+ CASE WHEN enabled = 0 THEN
+ CONCAT('')
+ ELSE
+ CONCAT('')
+ END as shifts,
+ CASE WHEN enabled = 0 THEN
+ CONCAT('')
+ ELSE
+ CONCAT('')
+ END as prefill,
+ CASE WHEN enabled = 1 THEN
+ CONCAT('')
+ ELSE
+ CONCAT('')
+ END as deletee,
+ CASE WHEN enabled = 0 THEN
+ CONCAT('')
+ ELSE
+ CONCAT('')
+ END as outcomes,
+ CONCAT('') as calls,
+ CASE WHEN enabled = 0 THEN
+ CONCAT('')
+ ELSE
+ CONCAT('')
+ END as dataout,
+ CASE WHEN enabled = 0 THEN
+ CONCAT('')
+ ELSE
+ CONCAT('')
+ END as assample,
+ CASE WHEN enabled = 0 THEN
+ CONCAT('')
+ ELSE
+ CONCAT('')
+ END as casestatus
+ FROM questionnaire";
+ $rs = $db->GetAll($sql);
+
+ $columns = array("qid","description","status","enabledisable","outcomes","calls","casestatus","shifts","assample","dataout","modify","inlime","prefill","deletee");
+ xhtml_table($rs,$columns,false,"table-hover table-condensed ");
+
+print "
";
+}
+xhtml_foot($js_foot);
+?>
+
\ No newline at end of file
diff --git a/admin/samplelist.php b/admin/samplelist.php
index 1e63e2af..9f8ee985 100644
--- a/admin/samplelist.php
+++ b/admin/samplelist.php
@@ -1,284 +1,315 @@
-
- * @copyright Australian Consortium for Social and Political Research Incorporated (ACSPRI) 2013
- * @package queXS
- * @subpackage admin
- * @link http://www.acspri.org.au/software queXS was writen for ACSPRI
- * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
- *
- */
-
-/**
- * Configuration file
- */
-include_once(dirname(__FILE__).'/../config.inc.php');
-
-/**
- * Database
- */
-include_once(dirname(__FILE__).'/../db.inc.php');
-
-/**
- * XHTML functions
- */
-include_once(dirname(__FILE__).'/../functions/functions.xhtml.php');
-
-
-
-if (isset($_POST['submitr']))
-{
- $sample_import_id = intval($_POST['sample_import_id']);
-
- $sql = "UPDATE sample_import
- SET description = " . $db->qstr($_POST['description']) . "
- WHERE sample_import_id = $sample_import_id";
-
- $db->Execute($sql);
-
- $_GET['rename'] = $sample_import_id;
-}
-
-if (isset($_POST['submit']))
-{
- $sample_import_id = intval($_POST['sample_import_id']);
-
- unset($_POST['submit']);
- unset($_POST['sample_import_id']);
-
- foreach($_POST as $p)
- {
- $sql = "DELETE FROM sample_var
- WHERE var LIKE " . $db->qstr($p) . "
- AND sample_id IN
- (SELECT sample_id
- FROM sample
- WHERE import_id = $sample_import_id)";
-
- $db->Execute($sql);
-
- }
-
- $_GET['edit'] = $sample_import_id;
-}
-
-if (isset($_POST['submitvp']))
-{
- $sample_import_id = intval($_POST['sample_import_id']);
-
- unset($_POST['submitvp']);
- unset($_POST['sample_import_id']);
-
- $db->StartTrans();
-
- $sql = "UPDATE sample_import_var_restrict
- SET `restrict` = 1
- WHERE sample_import_id = $sample_import_id";
-
- $db->Execute($sql);
-
- foreach($_POST as $p => $val)
- {
- $sql = "UPDATE sample_import_var_restrict
- SET `restrict` = 0
- WHERE sample_import_id = $sample_import_id
- AND `var` LIKE " . $db->qstr($p);
-
- $db->Execute($sql);
- }
-
- $db->CompleteTrans();
-
- $_GET['view'] = $sample_import_id;
-}
-
-if (isset($_GET['rename']))
-{
- xhtml_head(T_("Rename"),true,array("../css/table.css"));
-
- $sample_import_id = intval($_GET['rename']);
-
- $sql = "SELECT description
- FROM sample_import
- WHERE sample_import_id = $sample_import_id";
-
- $rs = $db->GetOne($sql);
-
- print "
";
-
- ?>
-
- GetOne($sql);
-
- $sql = "SELECT si.description, sv.val, sv.var,
- CONCAT('') as box,
- sir.restrict IS NULL as existss
- FROM sample_import as si
- JOIN `sample` as s ON (s.import_id = si.sample_import_id AND s.sample_id = $sample_id)
- JOIN sample_var as sv ON (sv.sample_id = s.sample_id)
- LEFT JOIN sample_import_var_restrict as sir ON (sir.sample_import_id = si.sample_import_id AND sir.var = sv.var)
- WHERE si.sample_import_id = $sample_import_id";
-
- $rs = $db->GetAll($sql);
-
- //if not in restrict table, then insert
- foreach($rs as $r)
- {
- if ($r['existss'] == 1)
- {
- $sql = "INSERT INTO sample_import_var_restrict (sample_import_id,var,`restrict`)
- VALUES ($sample_import_id,'{$r['var']}',0)";
-
- $db->Execute($sql);
- }
- }
-
- print "
" . T_("Select which fields from this sample should be able to be viewed by operators") . "
";
-
- ?>
-
- ') as box
- FROM sample_import as si, sample_var as sv, sample as s
- WHERE si.sample_import_id = $sample_import_id
- AND sv.sample_id = s.sample_id
- AND s.import_id = si.sample_import_id
- GROUP BY sv.var";
-
- $rs = $db->GetAll($sql);
-
- print "
";
+$columns = array("id","description","status","enabledisable","calls","did","vp","rname", "ssearch");
+//$titles = array(T_("ID"),T_("Sample"), T_("Call History"),T_("Enable/Disable"), T_("Status"), T_("Deidentify"), T_("View"), T_("Rename"), T_("Search"));
+xhtml_table($rs,$columns, false, "table-hover table-condensed ");
+
+xhtml_foot($js_foot);
+?>
+
\ No newline at end of file
diff --git a/admin/samplesearch.php b/admin/samplesearch.php
index 4e2fedd0..159c1ba5 100644
--- a/admin/samplesearch.php
+++ b/admin/samplesearch.php
@@ -1,166 +1,195 @@
-
- * @copyright Deakin University 2007,2008
- * @package queXS
- * @subpackage admin
- * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility
- * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
- *
- *
- */
-
-/**
- * Configuration file
- */
-include("../config.inc.php");
-
-/**
- * Database file
- */
-include ("../db.inc.php");
-
-/**
- * XHTML functions
- */
-include("../functions/functions.xhtml.php");
-
-
-/**
- * Input functions
- */
-include("../functions/functions.input.php");
-
-global $db;
-
-
-if (isset($_GET['sample_id']))
-{
- //need to remove this sample record from the sample
-
- $sample_id = bigintval($_GET['sample_id']);
-
- $db->StartTrans();
-
- $sql = "DELETE FROM sample_var
- WHERE sample_id = '$sample_id'";
-
- $db->Execute($sql);
-
- $sql = "DELETE FROM sample
- WHERE sample_id = '$sample_id'";
-
- $db->Execute($sql);
-
- $db->CompleteTrans();
-}
-
-
-$sample_import_id = false;
-if (isset($_GET['sample_import_id'])) $sample_import_id = bigintval($_GET['sample_import_id']);
-
-xhtml_head(T_("Search sample"),true,array("../css/table.css"),array("../js/window.js"));
-print "
" . T_("Select a sample from the list below") . "
";
-
-$sql = "SELECT sample_import_id as value,description, CASE WHEN sample_import_id = '$sample_import_id' THEN 'selected=\'selected\'' ELSE '' END AS selected
- FROM sample_import";
-
-$r = $db->GetAll($sql);
-
-if(!empty($r))
- display_chooser($r,"sample_import_id","sample_import_id");
-
-if ($sample_import_id != false)
-{
- if (isset($_GET['search']))
- {
- $search = $db->qstr($_GET['search']);
-
- $sql = "SELECT sv.sample_id, CASE WHEN c.case_id IS NULL THEN CONCAT('" . TQ_("No cases yet assigned: Delete this sample record") . "') ELSE CONCAT('" . TQ_("Assigned to questionnaire: ") . "', q.description, '') END as link
- FROM sample_var AS sv
- JOIN (sample as s) ON (s.import_id = '$sample_import_id' and sv.sample_id = s.sample_id)
- LEFT JOIN (`case` AS c, questionnaire AS q) ON ( c.sample_id = sv.sample_id AND q.questionnaire_id = c.questionnaire_id )
- WHERE sv.val LIKE $search
- GROUP BY s.sample_id,c.case_id";
-
- $r = $db->GetAll($sql);
-
- if (empty($r))
- print "
" . T_("No records in this sample match this search criteria") . "
";
+}
+xhtml_foot($js_foot);
+?>
+
\ No newline at end of file
diff --git a/css/custom.css b/css/custom.css
index 8d2dbc67..b203ce04 100644
--- a/css/custom.css
+++ b/css/custom.css
@@ -2,7 +2,7 @@
body {
/*
font-size: 1.5em;
-line-height: 1.3em;*/
+line-height: 1.5em;*/
/* color: #515a63; or #666 */
/*padding-top: 0px;*/
background:#EEEFF2;
@@ -61,3 +61,17 @@ border-color: gray;
background-color:#CED95B;
border-color: blue;
}
+.fa{
+text-shadow: 1px 2px 1px #ababab;
+}
+.h1, h1 {
+font-weight: 500;
+text-shadow: 2px 2px 3px #ababab;
+}
+.h2, .h3, h2, h3 {
+text-shadow: 1px 2px 1px #ababab;
+}
+.h1, .h2, .h3, h1, h2, h3 {
+margin-bottom: 0.4em;
+margin-top: 0.4em;
+}
\ No newline at end of file
diff --git a/include/bootstrap-toggle/LICENSE b/include/bootstrap-toggle/LICENSE
new file mode 100644
index 00000000..88bb5abf
--- /dev/null
+++ b/include/bootstrap-toggle/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2011-2014 Min Hur, The New York Times Company
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/include/bootstrap-toggle/README.md b/include/bootstrap-toggle/README.md
new file mode 100644
index 00000000..2fda963b
--- /dev/null
+++ b/include/bootstrap-toggle/README.md
@@ -0,0 +1,169 @@
+# Bootstrap Toggle
+Bootstrap Toggle is a highly flexible Bootstrap plugin that converts checkboxes into toggles.
+
+Visit http://www.bootstraptoggle.com for demos.
+
+## Getting Started
+
+### Installation
+You can [download](https://github.com/minhur/bootstrap-toggle/archive/master.zip) the latest version of Bootstrap Toggle or use CDN to load the library.
+
+`Warning` If you are using Bootstrap v2.3.2, use `bootstrap2-toggle.min.js` and `bootstrap2-toggle.min.css` instead.
+
+```html
+
+
+```
+
+### Bower Install
+```bash
+bower install bootstrap-toggle
+```
+
+## Usage
+
+### Basic example
+Simply add `data-toggle="toggle"` to convert checkboxes into toggles.
+
+```html
+
+```
+
+### Stacked checkboxes
+Refer to Bootstrap Form Controls documentation to create stacked checkboxes. Simply add `data-toggle="toggle"` to convert checkboxes into toggles.
+
+```html
+
+
+
+
+
+
+```
+
+### Inline Checkboxes
+Refer to Bootstrap Form Controls documentation to create inline checkboxes. Simply add `data-toggle="toggle"` to a convert checkboxes into toggles.
+
+```html
+
+
+
+```
+
+## API
+
+### Initialize by JavaScript
+Initialize toggles with id `toggle-one` with a single line of JavaScript.
+
+```html
+
+
+```
+
+### Options
+Options can be passed via data attributes or JavaScript. For data attributes, append the option name to `data-`, as in `data-on="Enabled"`.
+
+```html
+
+
+
+```
+
+Name|Type|Default|Description|
+---|---|---|---
+on|string/html|"On"|Text of the on toggle
+off|string/html|"Off"|Text of the off toggle
+size|string|"normal"|Size of the toggle. Possible values are `large`, `normal`, `small`, `mini`.
+onstyle|string|"primary"|Style of the on toggle. Possible values are `default`, `primary`, `success`, `info`, `warning`, `danger`
+offstyle|string|"default"|Style of the off toggle. Possible values are `default`, `primary`, `success`, `info`, `warning`, `danger`
+style|string| |Appends the value to the class attribute of the toggle. This can be used to apply custom styles. Refer to Custom Styles for reference.
+width|integer|*null*|Sets the width of the toggle. if set to *null*, width will be calculated.
+height|integer|*null*|Sets the height of the toggle. if set to *null*, height will be calculated.
+
+### Methods
+Methods can be used to control toggles directly.
+
+```html
+
+```
+
+Method|Example|Description
+---|---|---
+initialize|$('#toggle-demo').bootstrapToggle()|Initializes the toggle plugin with options
+destroy|$('#toggle-demo').bootstrapToggle('destroy')|Destroys the toggle
+on|$('#toggle-demo').bootstrapToggle('on')|Sets the toggle to 'On' state
+off|$('#toggle-demo').bootstrapToggle('off')|Sets the toggle to 'Off' state
+toggle|$('#toggle-demo').bootstrapToggle('toggle')|Toggles the state of the toggle
+enable|$('#toggle-demo').bootstrapToggle('enable')|Enables the toggle
+disable|$('#toggle-demo').bootstrapToggle('disable')|Disables the toggle
+
+## Events
+
+### Event Propagation
+Note All events are propagated to and from input element to the toggle.
+
+You should listen to events from the `` directly rather than look for custom events.
+
+```html
+
+
+
+```
+
+### API vs Input
+This also means that using the API or Input to trigger events will work both ways.
+
+```html
+
+
+
+
+
+
+```
+
+## Demos
+
+Visit http://www.bootstraptoggle.com for demos.
diff --git a/include/bootstrap-toggle/css/bootstrap-toggle.css b/include/bootstrap-toggle/css/bootstrap-toggle.css
new file mode 100644
index 00000000..057d08b3
--- /dev/null
+++ b/include/bootstrap-toggle/css/bootstrap-toggle.css
@@ -0,0 +1,83 @@
+/*! ========================================================================
+ * Bootstrap Toggle: bootstrap-toggle.css v2.2.0
+ * http://www.bootstraptoggle.com
+ * ========================================================================
+ * Copyright 2014 Min Hur, The New York Times Company
+ * Licensed under MIT
+ * ======================================================================== */
+
+
+.checkbox label .toggle,
+.checkbox-inline .toggle {
+ margin-left: -20px;
+ margin-right: 5px;
+}
+
+.toggle {
+ position: relative;
+ overflow: hidden;
+}
+.toggle input[type="checkbox"] {
+ display: none;
+}
+.toggle-group {
+ position: absolute;
+ width: 200%;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ transition: left 0.35s;
+ -webkit-transition: left 0.35s;
+ -moz-user-select: none;
+ -webkit-user-select: none;
+}
+.toggle.off .toggle-group {
+ left: -100%;
+}
+.toggle-on {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 50%;
+ margin: 0;
+ border: 0;
+ border-radius: 0;
+}
+.toggle-off {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 50%;
+ right: 0;
+ margin: 0;
+ border: 0;
+ border-radius: 0;
+}
+.toggle-handle {
+ position: relative;
+ margin: 0 auto;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ height: 100%;
+ width: 0px;
+ border-width: 0 1px;
+}
+
+.toggle.btn { min-width: 59px; min-height: 34px; }
+.toggle-on.btn { padding-right: 24px; }
+.toggle-off.btn { padding-left: 24px; }
+
+.toggle.btn-lg { min-width: 79px; min-height: 45px; }
+.toggle-on.btn-lg { padding-right: 31px; }
+.toggle-off.btn-lg { padding-left: 31px; }
+.toggle-handle.btn-lg { width: 40px; }
+
+.toggle.btn-sm { min-width: 50px; min-height: 30px;}
+.toggle-on.btn-sm { padding-right: 20px; }
+.toggle-off.btn-sm { padding-left: 20px; }
+
+.toggle.btn-xs { min-width: 35px; min-height: 22px;}
+.toggle-on.btn-xs { padding-right: 12px; }
+.toggle-off.btn-xs { padding-left: 12px; }
+
diff --git a/include/bootstrap-toggle/css/bootstrap-toggle.min.css b/include/bootstrap-toggle/css/bootstrap-toggle.min.css
new file mode 100644
index 00000000..0d42ed09
--- /dev/null
+++ b/include/bootstrap-toggle/css/bootstrap-toggle.min.css
@@ -0,0 +1,28 @@
+/*! ========================================================================
+ * Bootstrap Toggle: bootstrap-toggle.css v2.2.0
+ * http://www.bootstraptoggle.com
+ * ========================================================================
+ * Copyright 2014 Min Hur, The New York Times Company
+ * Licensed under MIT
+ * ======================================================================== */
+.checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px}
+.toggle{position:relative;overflow:hidden}
+.toggle input[type=checkbox]{display:none}
+.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none}
+.toggle.off .toggle-group{left:-100%}
+.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0}
+.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0}
+.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px}
+.toggle.btn{min-width:59px;min-height:34px}
+.toggle-on.btn{padding-right:24px}
+.toggle-off.btn{padding-left:24px}
+.toggle.btn-lg{min-width:79px;min-height:45px}
+.toggle-on.btn-lg{padding-right:31px}
+.toggle-off.btn-lg{padding-left:31px}
+.toggle-handle.btn-lg{width:40px}
+.toggle.btn-sm{min-width:50px;min-height:30px}
+.toggle-on.btn-sm{padding-right:20px}
+.toggle-off.btn-sm{padding-left:20px}
+.toggle.btn-xs{min-width:35px;min-height:22px}
+.toggle-on.btn-xs{padding-right:12px}
+.toggle-off.btn-xs{padding-left:12px}
\ No newline at end of file
diff --git a/include/bootstrap-toggle/js/bootstrap-toggle.js b/include/bootstrap-toggle/js/bootstrap-toggle.js
new file mode 100644
index 00000000..533914ed
--- /dev/null
+++ b/include/bootstrap-toggle/js/bootstrap-toggle.js
@@ -0,0 +1,180 @@
+/*! ========================================================================
+ * Bootstrap Toggle: bootstrap-toggle.js v2.2.0
+ * http://www.bootstraptoggle.com
+ * ========================================================================
+ * Copyright 2014 Min Hur, The New York Times Company
+ * Licensed under MIT
+ * ======================================================================== */
+
+
+ +function ($) {
+ 'use strict';
+
+ // TOGGLE PUBLIC CLASS DEFINITION
+ // ==============================
+
+ var Toggle = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, this.defaults(), options)
+ this.render()
+ }
+
+ Toggle.VERSION = '2.2.0'
+
+ Toggle.DEFAULTS = {
+ on: 'On',
+ off: 'Off',
+ onstyle: 'primary',
+ offstyle: 'default',
+ size: 'normal',
+ style: '',
+ width: null,
+ height: null
+ }
+
+ Toggle.prototype.defaults = function() {
+ return {
+ on: this.$element.attr('data-on') || Toggle.DEFAULTS.on,
+ off: this.$element.attr('data-off') || Toggle.DEFAULTS.off,
+ onstyle: this.$element.attr('data-onstyle') || Toggle.DEFAULTS.onstyle,
+ offstyle: this.$element.attr('data-offstyle') || Toggle.DEFAULTS.offstyle,
+ size: this.$element.attr('data-size') || Toggle.DEFAULTS.size,
+ style: this.$element.attr('data-style') || Toggle.DEFAULTS.style,
+ width: this.$element.attr('data-width') || Toggle.DEFAULTS.width,
+ height: this.$element.attr('data-height') || Toggle.DEFAULTS.height
+ }
+ }
+
+ Toggle.prototype.render = function () {
+ this._onstyle = 'btn-' + this.options.onstyle
+ this._offstyle = 'btn-' + this.options.offstyle
+ var size = this.options.size === 'large' ? 'btn-lg'
+ : this.options.size === 'small' ? 'btn-sm'
+ : this.options.size === 'mini' ? 'btn-xs'
+ : ''
+ var $toggleOn = $('