diff --git a/LICENSE.md b/LICENSE.md index 63a11e3..56351c0 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,19 +1,7 @@ -Copyright (c) 2018 Netsyms Technologies. +Copyright (c) 2017-2019 Netsyms Technologies. Some rights reserved. -If you modify and redistribute this project, you must replace the branding -assets with your own. - -The branding assets include: - * the application icon - * the Netsyms N punchcard logo - * the Netsyms for Business graph logo - -If you are unsure if your usage is allowed, please contact us: -https://netsyms.com/contact -legal@netsyms.com - -All other portions of this application, -unless otherwise noted (in comments, headers, etc), are licensed as follows: +Licensed under the Mozilla Public License Version 2.0. Files without MPL header +comments, including third party code, may be under a different license. Mozilla Public License Version 2.0 ================================== diff --git a/README.md b/README.md index d54191d..fbe6b0b 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,4 @@ Setup Tips * Run `git submodule init` and `git submodule update` to install several other dependencies * Install the database using `database.mwb` or `database.sql` * Copy `settings.template.php` to `settings.php` and customize -* You'll also need to setup [AccountHub](https://source.netsyms.com/Business/AccountHub) \ No newline at end of file +* You'll also need to setup [AccountHub](https://source.netsyms.com/Business/AccountHub) diff --git a/api/index.php b/api/index.php index 8875860..23cb28c 100644 --- a/api/index.php +++ b/api/index.php @@ -10,6 +10,8 @@ require __DIR__ . '/../required.php'; require __DIR__ . '/functions.php'; require __DIR__ . '/apisettings.php'; +header("Access-Control-Allow-Origin: *"); + $VARS = $_GET; if ($_SERVER['REQUEST_METHOD'] != "GET") { $VARS = array_merge($VARS, $_POST); diff --git a/lib/FormBuilder.lib.php b/lib/FormBuilder.lib.php index fddbff2..13567cc 100644 --- a/lib/FormBuilder.lib.php +++ b/lib/FormBuilder.lib.php @@ -173,33 +173,65 @@ HTMLTOP; $required = $item["required"] ? "required" : ""; $id = empty($item["id"]) ? "" : "id=\"$item[id]\""; $pattern = empty($item["pattern"]) ? "" : "pattern=\"$item[pattern]\""; - + if (empty($item['type'])) { + $item['type'] = "text"; + } $itemhtml = ""; + $itemlabel = ""; + + if ($item['type'] == "textarea") { + $itemlabel = ""; + } else if ($item['type'] != "checkbox") { + $itemlabel = ""; + } + $strippedlabel = strip_tags($item['label']); $itemhtml .= <<
- -
+ $itemlabel +ITEMTOP; + $inputgrouptop = <<
-ITEMTOP; - if (empty($item['type']) || $item['type'] != "select") { - $itemhtml .= << -INPUT; - } else { - $itemhtml .= << SELECT; - foreach ($item['options'] as $value => $label) { - $selected = ""; - if (!empty($item['value']) && $value == $item['value']) { - $selected = " selected"; + foreach ($item['options'] as $value => $label) { + $selected = ""; + if (!empty($item['value']) && $value == $item['value']) { + $selected = " selected"; + } + $itemhtml .= "\n "; } - $itemhtml .= "\n "; - } - $itemhtml .= "\n "; + $itemhtml .= "\n "; + break; + case "checkbox": + $itemhtml .= $inputgrouptop; + $itemhtml .= << + + +
+CHECKBOX; + break; + case "textarea": + $val = htmlentities($item['value']); + $itemhtml .= << +TEXTAREA; + break; + default: + $itemhtml .= $inputgrouptop; + $itemhtml .= << +INPUT; + break; } if (!empty($item["error"])) { @@ -209,9 +241,11 @@ SELECT;
ERROR; } + if ($item["type"] != "textarea") { + $itemhtml .= "\n "; + } $itemhtml .= << - +\n \n ITEMBOTTOM; $html .= $itemhtml; @@ -224,7 +258,7 @@ ITEMBOTTOM; HTMLBOTTOM; if (!empty($this->buttons)) { - $html .= "\n
"; + $html .= "\n