diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f1edd68..a183c14e 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,23 @@ # CHANGELOG +### Version 10.8 +- Fix API key update not returning error in correct format +- Rewrite API page +- Rewrite About page +- Try to get measurement unit from ingredient supplier first for ingredient search in formulation +- Table border removed from tables +- Added support for a dark theme +- Complete rewrite for Finished Product page +- Various minor improvements for Formula view +- Rewrite Sell Formula for BS5 +- Added a font size when exporting a PDF in Sell Formula +- Added brand logo when exporting a PDF in Sell Formula +- Added opacity for watermak in Sell Formula page +- Replaced PDF export in Sell Formula with the native DataTables function +- Removed the space from ml2L function when appending the measurement unit +- Default PV Logo update +- Refactor of validateFormula() function +- Renamed clone formula to duplicate + ### Version 10.7 - Removed ingredient purity and dilutant from Finished Product page for cleaner view - Moved IFRA doc to a modal window diff --git a/VERSION.md b/VERSION.md index 4e74f9f0..f5d39891 100755 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -10.7 +10.8 diff --git a/core/finished_formula_data.php b/core/finished_formula_data.php new file mode 100644 index 00000000..c403a14b --- /dev/null +++ b/core/finished_formula_data.php @@ -0,0 +1,216 @@ + $inval_materials ); + +$response['compliance'] = $compliance; +$response['meta'] = $m; + + +header('Content-Type: application/json; charset=utf-8'); +echo json_encode($response); +return; +?> \ No newline at end of file diff --git a/core/full_formula_data.php b/core/full_formula_data.php index efe21318..bab7e72c 100644 --- a/core/full_formula_data.php +++ b/core/full_formula_data.php @@ -163,8 +163,9 @@ $chName = mysqli_fetch_array(mysqli_query($conn,"SELECT chemical_name FROM ingredients WHERE name = '".$formula['ingredient']."'")); $ingName = $chName['chemical_name']; } - $r['formula_ingredient_id'] = (int)$formula['id']; - $r['fid'] = (string)$meta['name']; //TODO + $r['formula_ingredient_id'] = (int)$formula['id']; + $r['formula_name'] = (string)$meta['name']; + $r['fid'] = (string)$meta['fid']; //TODO if($settings['grp_formula'] == '1'){ $r['ingredient']['profile'] = (string)$ing_q['profile'] ?: 'Unknown'; @@ -277,7 +278,7 @@ if($m['total_ingredients'] != 0 && !$_POST['search']){ - if( validateFormula($meta['fid'], $_GET['final_total_ml'] ?: 100, $new_conc, $mg['total_mg'], $_GET['val_cat']?: $defCatClass, $settings['qStep'], $conn) == TRUE){ + if( validateFormula($meta['fid'], $_GET['final_total_ml'] ?: 100, $new_conc, $mg['total_mg'], $_GET['val_cat']?: $defCatClass, $settings['qStep']) == TRUE){ $val_status = 1; $val_msg = 'Your formula contains materials, exceeding and/or missing IFRA standards. Please alter your formula.'; } diff --git a/core/list_ingredients_simple.php b/core/list_ingredients_simple.php index dc833539..81dcb79d 100644 --- a/core/list_ingredients_simple.php +++ b/core/list_ingredients_simple.php @@ -35,7 +35,7 @@ $i = 0; foreach ($ingredients as $ingredient) { - + $supp = getIngSupplier($ingredient['id'],1,$conn); $r['id'] = (int)$ingredient['id']; $r['name'] = (string)$ingredient['name']; $r['IUPAC'] = (string)$ingredient['INCI']?: 'N/A'; @@ -45,7 +45,8 @@ $r['description'] = (string)$ingredient['odor'] ?: 'N/A'; $r['physical_state'] = (int)$ingredient['physical_state'] ?: 1; $r['profile'] = (string)$ingredient['profile'] ?: 'Uknwown'; - $r['stock'] = (float)number_format(getIngSupplier($ingredient['id'],1,$conn)['stock'], $settings['qStep']) ?: 0; + $r['stock'] = (float)number_format($supp['stock'], $settings['qStep']) ?: 0; + $r['mUnit'] = (string)$supp['mUnit']; $rx[]=$r; $i++; diff --git a/css/bootstrap-tagsinput.css b/css/bootstrap-tagsinput.css index 7fced300..514fc5e4 100644 --- a/css/bootstrap-tagsinput.css +++ b/css/bootstrap-tagsinput.css @@ -4,7 +4,7 @@ */ .bootstrap-tagsinput { - background-color: #fff; + background-color: var( --bs-body-bg); border: 1px solid #ccc; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); display: inline-block; @@ -42,7 +42,7 @@ } .bootstrap-tagsinput .tag { margin-right: 2px; - color: white; + color: var( --bs-light ); } .bootstrap-tagsinput .tag [data-role="remove"] { margin-left: 8px; diff --git a/css/ifraCert.css b/css/ifraCert.css index c06cb7b5..94926ea4 100644 --- a/css/ifraCert.css +++ b/css/ifraCert.css @@ -1,56 +1,64 @@ -@page { - margin-right: 0.69in; - margin-top: 0.39in; - margin-bottom: 0.59in; -} - -p { - margin-bottom: 0in; - direction: ltr; - color: #000000; - widows: 2; - orphans: 2; -} - -p.western { - font-family: "Times New Roman", serif; - font-size: 10pt; -} - -p.cjk { - font-family: "Times New Roman", serif; - font-size: 10pt -} - -p.ctl { - font-family: "Times New Roman", serif; - font-size: 10pt; -} - -h1 { - margin-top: 0in; - margin-bottom: 0in; - direction: ltr; - color: #000000; - text-align: center; - widows: 2; - orphans: 2; -} - -h1.western { - font-family: "Helvetica 45 Light", "Vrinda", sans-serif; - font-size: 16pt; - font-style: italic; -} - -h1.cjk { - font-family: "Times New Roman", serif; - font-size: 16pt; - font-style: italic; -} - -h1.ctl { - font-family: "Helvetica 45 Light", "Vrinda", sans-serif; - font-size: 10pt; - font-weight: normal; -} +@page { + margin-right: 0.69in; + margin-top: 0.39in; + margin-bottom: 0.59in; +} + +p { + margin-bottom: 0in; + direction: ltr; + color: var(--bs-body-color); + widows: 2; + orphans: 2; +} + +p.western { + font-family: "Times New Roman", serif; + font-size: 10pt; +} + +p.cjk { + font-family: "Times New Roman", serif; + font-size: 10pt +} + +p.ctl { + font-family: "Times New Roman", serif; + font-size: 10pt; +} + +h1 { + margin-top: 0in; + margin-bottom: 0in; + direction: ltr; + color: var(--bs-body-color); + text-align: center; + widows: 2; + orphans: 2; +} + +h1.western { + font-family: "Helvetica 45 Light", "Vrinda", sans-serif; + font-size: 16pt; + font-style: italic; +} + +h1.cjk { + font-family: "Times New Roman", serif; + font-size: 16pt; + font-style: italic; +} + +h1.ctl { + font-family: "Helvetica 45 Light", "Vrinda", sans-serif; + font-size: 10pt; + font-weight: normal; +} + +body { + background-color: var(--bs-body-bg); + color: var(--bs-body-color); + margin: 0; + padding: 0; + font-family: var(--bs-body-font-family); /* Use Bootstrap's default font */ +} diff --git a/css/jquery-ui.css b/css/jquery-ui.css index d394bd2d..d263017d 100755 --- a/css/jquery-ui.css +++ b/css/jquery-ui.css @@ -898,20 +898,20 @@ body .ui-tooltip { font-size: 1em; } .ui-widget.ui-widget-content { - border: 1px solid #c5c5c5; + border: 1px solid var(--bs-border-color); } .ui-widget-content { - border: 1px solid #dddddd; - background: #ffffff; - color: #333333; + border: 1px solid var(--bs-border-color); + background: var(--bs-body-bg); + color: var(--bs-body-color); } .ui-widget-content a { - color: #333333; + color: var(--bs-body-color); } .ui-widget-header { - border: 1px solid #dddddd; - background: #e9e9e9; - color: #333333; + border: 1px solid var(--bs-border-color); + background: var(--bs-body-bg); + color: var(--bs-body-color); font-weight: bold; } .ui-widget-header a { @@ -929,10 +929,10 @@ body .ui-tooltip { works properly when clicked or hovered */ html .ui-button.ui-state-disabled:hover, html .ui-button.ui-state-disabled:active { - border: 1px solid #c5c5c5; - background: #f6f6f6; + border: 1px solid var(--bs-border-color); + background: var( --bs-body-bg); font-weight: normal; - color: #454545; + color: var( --bs-body-color); } .ui-state-default a, .ui-state-default a:link, @@ -941,7 +941,7 @@ a.ui-button, a:link.ui-button, a:visited.ui-button, .ui-button { - color: #454545; + color: var( --bs-body-color); text-decoration: none; } .ui-state-hover, @@ -952,10 +952,10 @@ a:visited.ui-button, .ui-widget-header .ui-state-focus, .ui-button:hover, .ui-button:focus { - border: 1px solid #cccccc; - background: #ededed; + border: 1px solid var(--bs-border-color); + background: var( --bs-body-bg); font-weight: normal; - color: #2b2b2b; + color: var( --bs-body-color); } .ui-state-hover a, .ui-state-hover a:hover, @@ -967,7 +967,7 @@ a:visited.ui-button, .ui-state-focus a:visited, a.ui-button:hover, a.ui-button:focus { - color: #2b2b2b; + color: var( --bs-tertiary-color); text-decoration: none; } @@ -980,15 +980,15 @@ a.ui-button:focus { a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover { - border: 1px solid #003eff; + border: 1px solid var(--bs-border-color); background: #007fff; font-weight: normal; - color: #ffffff; + color: var( --bs-body-color); } .ui-icon-background, .ui-state-active .ui-icon-background { - border: #003eff; - background-color: #ffffff; + border: var(--bs-border-color); + background-color: var( --bs-body-bg); } .ui-state-active a, .ui-state-active a:link, @@ -1002,12 +1002,12 @@ a.ui-button:active, .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { - border: 1px solid #dad55e; - background: #fffa90; - color: #777620; + border: 1px solid var(--bs-border-color); + background: var( --bs-body-bg); + color: var( --bs-body-color); } .ui-state-checked { - border: 1px solid #dad55e; + border: 1px solid var(--bs-border-color); background: #fffa90; } .ui-state-highlight a, @@ -1018,7 +1018,7 @@ a.ui-button:active, .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error { - border: 1px solid #f1a899; + border: 1px solid var(--bs-border-color); background: #fddfdf; color: #5f3f3f; } diff --git a/css/makeFormula.css b/css/makeFormula.css index 69b6bfa5..c8828433 100644 --- a/css/makeFormula.css +++ b/css/makeFormula.css @@ -1,5 +1,5 @@ .table { - --bs-table-bg: initial; + --bs-table-bg: var(--bs-body-bg); } table.dataTable { font-size: x-large !important; diff --git a/css/sb-admin-2.css b/css/sb-admin-2.css index c8ffdd67..7e506ef5 100755 --- a/css/sb-admin-2.css +++ b/css/sb-admin-2.css @@ -11,27 +11,7 @@ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ :root { - --blue: #4e73df; - --indigo: #6610f2; - --purple: #6f42c1; - --pink: #e83e8c; - --red: #e74a3b; - --orange: #fd7e14; - --yellow: #f6c23e; - --green: #1cc88a; - --teal: #20c9a6; - --cyan: #36b9cc; - --white: #fff; - --gray: #858796; - --gray-dark: #5a5c69; - --primary: #4e73df; - --secondary: #858796; - --success: #1cc88a; - --info: #36b9cc; - --warning: #f6c23e; - --danger: #e74a3b; - --light: #f8f9fc; - --dark: #5a5c69; + --breakpoint-xs: 0; --breakpoint-sm: 576px; --breakpoint-md: 768px; @@ -165,7 +145,6 @@ a { } a:hover { - color: #224abe; text-decoration: underline; } @@ -535,11 +514,6 @@ kbd kbd { font-weight: 700; } -pre { - display: block; - font-size: 87.5%; - color: #3a3b45; -} pre code { font-size: inherit; @@ -1366,27 +1340,7 @@ pre code { } } -.table { - width: 100%; - margin-bottom: 1rem; - color: #858796; -} -.table th, -.table td { - padding: 0.75rem; - vertical-align: top; - border-top: 1px solid #e3e6f0; -} - -.table thead th { - vertical-align: bottom; - border-bottom: 2px solid #e3e6f0; -} - -.table tbody + tbody { - border-top: 2px solid #e3e6f0; -} .table-sm th, .table-sm td { @@ -1614,11 +1568,7 @@ pre code { background-color: rgba(0, 0, 0, 0.075); } -.table .thead-dark th { - color: #fff; - background-color: #5a5c69; - border-color: #6c6e7e; -} + .table .thead-light th { color: #6e707e; @@ -1626,29 +1576,7 @@ pre code { border-color: #e3e6f0; } -.table-dark { - color: #fff; - background-color: #5a5c69; -} -.table-dark th, -.table-dark td, -.table-dark thead th { - border-color: #6c6e7e; -} - -.table-dark.table-bordered { - border: 0; -} - -.table-dark.table-striped tbody tr:nth-of-type(odd) { - background-color: rgba(255, 255, 255, 0.05); -} - -.table-dark.table-hover tbody tr:hover { - color: #fff; - background-color: rgba(255, 255, 255, 0.075); -} @media (max-width: 575.98px) { .table-responsive-sm { @@ -5376,13 +5304,13 @@ a.badge-dark:focus, a.badge-dark.focus { font-size: 1.5rem; font-weight: 700; line-height: 1; - color: #000; + color: var(--bs-body-color); text-shadow: 0 1px 0 #fff; opacity: .5; } .close:hover { - color: #000; + color: var(--bs-secondary-color); text-decoration: none; } @@ -9570,7 +9498,7 @@ a:focus { } #wrapper #content-wrapper { - background-color: #f8f9fc; + background-color: var(--bs-body-bg); width: 100%; overflow-x: hidden; } diff --git a/css/select2.css b/css/select2.css index f274e9fd..68c00569 100644 --- a/css/select2.css +++ b/css/select2.css @@ -48,7 +48,7 @@ -webkit-appearance: none; } .select2-dropdown { - background-color: white; + background-color: var(--bs-body-bg); border: 1px solid #aaa; border-radius: 4px; box-sizing: border-box; @@ -128,11 +128,11 @@ white-space: nowrap !important; } .select2-container--default .select2-selection--single { - background-color: #fff; + background-color: var(--bs-body-bg); border: 1px solid #aaa; border-radius: 4px; } .select2-container--default .select2-selection--single .select2-selection__rendered { - color: #444; + color: var( --bs-body-color); line-height: 28px; } .select2-container--default .select2-selection--single .select2-selection__clear { cursor: pointer; diff --git a/css/vault.css b/css/vault.css index ec62854d..6197f556 100755 --- a/css/vault.css +++ b/css/vault.css @@ -73,7 +73,9 @@ html { background-color:#FFF; } -a { text-decoration: none; } +a { + text-decoration: none; +} .navbar { position: relative; @@ -328,7 +330,7 @@ tr.strikeout td:before { } .loader-text { - color: #000; + color: var( --bs-body-color); font-family: arial, sans-serif; text-align:center; } @@ -436,8 +438,8 @@ formula td, table.table th { .mgmIngHeader { font-size: 3rem; line-height: 3rem; - color: #004372; - background: white; + color: var( --bs-body-color); + background: var( --bs-body-bg); } .mgmIngHeader-with-separator::after { content: ''; @@ -466,7 +468,7 @@ formula td, table.table th { font-size: 1.875rem; margin-top: 0.9375rem; display: block; - background: white; + background: var( --bs-body-bg); } .mgm-row-xl > .mgm-row-inner > .mgm-column { @@ -494,7 +496,7 @@ formula td, table.table th { } .mgm-cat-in { - color: #444444; + color: var( --bs-body-color); font-size: 0.825rem; text-transform: uppercase; font-weight: 300; @@ -520,7 +522,7 @@ formula td, table.table th { .listIngName { font-size: 1.1rem; line-height: 2rem; - color: #004372; + color: var( --bs-body-color); /* background: white; */ font-weight: bolder; } @@ -610,7 +612,7 @@ formula td, table.table th { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; font-size: 0.85rem; - color: #444444; + color: var( --bs-body-color); font-weight: 300; } @@ -619,12 +621,12 @@ formula td, table.table th { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; font-size: 0.85rem; - color: #444444; + color: var( --bs-body-color); font-weight: 300; } .mgm-ing-bk { - background-color: white; + background-color: var( --bs-body-bg); } .ing_ico_list { @@ -646,7 +648,7 @@ formula td, table.table th { } .mgm-ing-theme { - background-color: fff; + background-color: var( --bs-body-bg); /* background-image: linear-gradient(to bottom, transparent, white 75%), url("/img/molecule.png"); background-repeat: no-repeat; @@ -755,7 +757,7 @@ table.fixedHeader-floating { } .pv_gen_li { - color: #23527c; + color: var( --bs-body-color); } .advanced_search_box { @@ -784,7 +786,7 @@ table.fixedHeader-floating { font-size: 1.2rem; display: inline; font-weight: bold; - color: #77716f !important + color: var( --bs-secondary-color ) !important; } .pv_exclusions { @@ -843,7 +845,7 @@ body { } .add-new-ing-sel { - color: #337ab7; + color: var( --bs-body-color); display: inline-table; padding: 14px 14px 14px 8px; height: 22px; @@ -867,7 +869,7 @@ body { .select_search_deep { font-size: medium; - color: black; + color: var( --bs-body-color); display: inline; text-align: right; align-self: start; @@ -909,12 +911,12 @@ body { margin: 5px; border-width: thin; } - +/* .bootstrap-select.disabled, .bootstrap-select > .disabled { cursor: not-allowed; background-color: #eee; } - +*/ .shared-formula-accept { float: right; border: none; @@ -1061,11 +1063,11 @@ body { #customer_name, #formula_name { display: inline; } - +/* table.dataTable thead tr { background-color: #cececec9 !important; } - +*/ table#tdDataPending.dataTable tbody tr:hover { background-color: #ae9292; } @@ -1082,6 +1084,10 @@ table#tdDataPending.dataTable thead:hover { transform: scale(1.05); } +.pv-transition td { + background-color: var(--bs-secondary-bg); +} + .schedule_details { font-size: medium; font-style: normal; @@ -1094,7 +1100,6 @@ table#tdDataPending.dataTable thead:hover { } .pv_point_gen_color { - color: #23527c !important; cursor: pointer !important; font-style: normal; } @@ -1202,13 +1207,8 @@ hr.hr-text::before { .text-reset { color:inherit!important } -.link-primary { - color:#0d6efd -} -.link-primary:focus, -.link-primary:hover { - color:#0a58ca -} + + .link-secondary { color:#6c757d } @@ -1468,4 +1468,22 @@ th.dt-center, td.dt-center { .bg-banned a { color: inherit; text-decoration: none; -} \ No newline at end of file +} + +.btn-outline-pv-2 { + display: block; + width: 100%; + padding: .375rem .75rem; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: var(--bs-body-color); + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-color: var(--bs-body-bg); + background-clip: padding-box; + border: var(--bs-border-width) solid var(--bs-border-color); + border-radius: var(--bs-border-radius); + transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out; +} diff --git a/db/pvault.sql b/db/pvault.sql index 02d4b180..f0b83d99 100755 --- a/db/pvault.sql +++ b/db/pvault.sql @@ -327,7 +327,8 @@ CREATE TABLE `settings` ( `pv_scale_host` varchar(255) COLLATE utf8_general_ci NOT NULL DEFAULT 'localhost', `pv_scale_enabled` INT NOT NULL DEFAULT '0', `pv_host` VARCHAR(255) NOT NULL DEFAULT 'localhost', - `sds_disclaimer` MEDIUMTEXT NOT NULL DEFAULT 'PLEASE ADD A PROPER DISCLAIMER MESSAGE' + `sds_disclaimer` MEDIUMTEXT NOT NULL DEFAULT 'PLEASE ADD A PROPER DISCLAIMER MESSAGE', + `bs_theme` VARCHAR(255) NOT NULL DEFAULT 'light' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; INSERT INTO `settings` (`id`, `currency`, `top_n`, `heart_n`, `base_n`, `chem_vs_brand`, `grp_formula`, `brandName`, `brandAddress`, `brandEmail`, `brandPhone`, `brandLogo`) VALUES diff --git a/db/schema.ver b/db/schema.ver index 4e74f9f0..f5d39891 100644 --- a/db/schema.ver +++ b/db/schema.ver @@ -1 +1 @@ -10.7 +10.8 diff --git a/db/updates/update_10.7-10.8.sql b/db/updates/update_10.7-10.8.sql new file mode 100644 index 00000000..1222f195 --- /dev/null +++ b/db/updates/update_10.7-10.8.sql @@ -0,0 +1 @@ +ALTER TABLE `settings` ADD `bs_theme` VARCHAR(255) NOT NULL DEFAULT 'light' AFTER `sds_disclaimer`; \ No newline at end of file diff --git a/func/apiCheckAuth.php b/func/apiCheckAuth.php index 9ae304c5..c87bfd68 100644 --- a/func/apiCheckAuth.php +++ b/func/apiCheckAuth.php @@ -3,8 +3,9 @@ function apiCheckAuth($username, $password ,$dbhost, $dbuser, $dbpass, $dbname){ $conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname) or die ('Error connecting to database'); - $row = mysqli_fetch_assoc(mysqli_query($conn,"SELECT id FROM users WHERE username='$username' AND password=PASSWORD('$password')")); - return $row['id']; + $row = mysqli_fetch_assoc(mysqli_query($conn,"SELECT id FROM users WHERE username='$username' AND password=PASSWORD('$password')")); + + return $row['id']; } ?> diff --git a/func/getIngSupplier.php b/func/getIngSupplier.php index 62a6bdc3..d664ddb8 100644 --- a/func/getIngSupplier.php +++ b/func/getIngSupplier.php @@ -4,7 +4,7 @@ function getIngSupplier($ingID,$getStock,$conn){ if($getStock == 1){ - $result = mysqli_fetch_array(mysqli_query($conn, "SELECT SUM(stock) AS stock FROM suppliers WHERE ingID = '$ingID'")); + $result = mysqli_fetch_array(mysqli_query($conn, "SELECT mUnit, SUM(stock) AS stock FROM suppliers WHERE ingID = '$ingID'")); }else{ $q = mysqli_query($conn, "SELECT ingSupplierID,supplierLink,status FROM suppliers WHERE ingID = '$ingID'"); while($r = mysqli_fetch_array($q)){ diff --git a/func/ml2L.php b/func/ml2L.php index a625663d..2d24ef58 100644 --- a/func/ml2L.php +++ b/func/ml2L.php @@ -6,7 +6,7 @@ function ml2L($ml, $s=2, $mUnit){ if($ml > 1000){ $conv = number_format($ml/1000, $s) .'L'; }else{ - $conv = number_format($ml, $s).' '.$mUnit; + $conv = number_format($ml, $s).$mUnit; } return $conv; diff --git a/func/validateFormula.php b/func/validateFormula.php index 1a674ef4..0e603071 100644 --- a/func/validateFormula.php +++ b/func/validateFormula.php @@ -1,42 +1,60 @@ diff --git a/img/logo_def.png b/img/logo_def.png index 4775d2d7..65eab2d6 100644 Binary files a/img/logo_def.png and b/img/logo_def.png differ diff --git a/index.php b/index.php index 1db7709a..0094339a 100755 --- a/index.php +++ b/index.php @@ -31,7 +31,7 @@ ?> - + diff --git a/js/bootstrap-select.js b/js/bootstrap-select.js index 02686b31..e4e2b990 100755 --- a/js/bootstrap-select.js +++ b/js/bootstrap-select.js @@ -3522,7 +3522,7 @@ classNames.DIVIDER = 'dropdown-divider'; classNames.SHOW = 'show'; - classNames.BUTTONCLASS = 'btn-light'; + classNames.BUTTONCLASS = 'btn-outline-pv-2'; classNames.POPOVERHEADER = 'popover-header'; classNames.ICONBASE = ''; classNames.TICKICON = 'bs-ok-default'; diff --git a/js/fullformula.view.js b/js/fullformula.view.js index ea5d8f1b..e274cae2 100644 --- a/js/fullformula.view.js +++ b/js/fullformula.view.js @@ -248,14 +248,15 @@ $("#formula").on("click", ".open-replace-dialog", function () { }, processResults: function(data) { return { - results: $.map(data.data, function(obj) { + results: $.map(data.data, function(ingData) { return { - id: obj.name, - description: obj.description, - cas: obj.cas, - stock: obj.stock, - physical_state: obj.physical_state, - name: obj.name + id: ingData.name, + description: ingData.description, + cas: ingData.cas, + stock: ingData.stock, + physical_state: ingData.physical_state, + name: ingData.name, + mUnit: ingData.mUnit } }) @@ -286,12 +287,8 @@ $("#formula").on("click", ".open-replace-dialog", function () { return 'No ingredient found...'; } - var measureIn; - if (ingredientData.physical_state == '1'){ - measureIn = 'mL'; - }else if (ingredientData.physical_state == '2'){ - measureIn = 'grams'; - } + let measureIn = ingredientData.mUnit || (ingredientData.physical_state == '1' ? 'mL' : ingredientData.physical_state == '2' ? 'grams' : ''); + var $container = $( "
" + diff --git a/js/mgmIngredient.js b/js/mgmIngredient.js index b6304e32..4e1b1f47 100644 --- a/js/mgmIngredient.js +++ b/js/mgmIngredient.js @@ -190,9 +190,9 @@ $('#cloneIng').on('click', '[id*=cloneME]', function () { dataType: 'json', success: function (data) { if(data.success){ - msg = '
x' + data.success + '
'; + msg = '
x' + data.success + '
'; }else if(data.error){ - msg = '
x' + data.error + '
'; + msg = '
x' + data.error + '
'; } $('#clone_msg').html(msg); } diff --git a/js/select2-v3-ingredient.js b/js/select2-v3-ingredient.js index ff35edb1..07e442ce 100644 --- a/js/select2-v3-ingredient.js +++ b/js/select2-v3-ingredient.js @@ -61,17 +61,18 @@ $(document).ready(function(){ $(".select2-totalRecords").html(''); } return { - results: $.map(data.data, function(obj) { + results: $.map(data.data, function(ingData) { return { - id: obj.id, - name: obj.name, - IUPAC: obj.IUPAC, - cas: obj.cas, - ingType: obj.type, - description: obj.description, - physical_state: obj.physical_state, - stock: obj.stock, - profile: obj.profile + id: ingData.id, + name: ingData.name, + IUPAC: ingData.IUPAC, + cas: ingData.cas, + ingType: ingData.type, + description: ingData.description, + physical_state: ingData.physical_state, + stock: ingData.stock, + profile: ingData.profile, + mUnit: ingData.mUnit } }) }; @@ -80,7 +81,7 @@ $(document).ready(function(){ } }).on('select2:open', () => { - $(".select2-search:not(:has(a))").prepend('
Create new ingredient
'); + $(".select2-search:not(:has(a))").prepend('
Create new ingredient
'); $(".select2-search:not(:has(i))").append('
'); @@ -112,13 +113,8 @@ $(document).ready(function(){ return 'No ingredient found...'; } - var measureIn; - if (ingredientData.physical_state == '1'){ - measureIn = 'mL'; - }else if (ingredientData.physical_state == '2'){ - measureIn = 'grams'; - } - + let measureIn = ingredientData.mUnit || (ingredientData.physical_state == '1' ? 'mL' : ingredientData.physical_state == '2' ? 'grams' : ''); + var $container = $( "
" + "
" + @@ -166,20 +162,20 @@ $(document).ready(function(){ data: { filter: "purity", id: ingID - }, + }, dataType: 'json', success: function (data) { - if(ingType == 'Solvent'){ - $("#concentration").prop("disabled", true); - $("#dilutant").prop("disabled", true); - $("#concentration").val(100); - $("#dilutant").val('None'); - }else{ - $("#concentration").prop("disabled", false); - $("#concentration").val(data.purity).trigger("input");; - } - $("#quantity").prop("disabled", false); - $("#quantity").val(); + if(ingType == 'Solvent'){ + $("#concentration").prop("disabled", true); + $("#dilutant").prop("disabled", true); + $("#concentration").val(100); + $("#dilutant").val('None'); + }else{ + $("#concentration").prop("disabled", false); + $("#concentration").val(data.purity).trigger("input");; + } + $("#quantity").prop("disabled", false); + $("#quantity").val(); } }); diff --git a/login.php b/login.php index 7cdacf05..579b392c 100755 --- a/login.php +++ b/login.php @@ -15,8 +15,7 @@ ?> - - + @@ -95,7 +94,7 @@
-

Please login

+

Please login

@@ -125,7 +124,7 @@ ?>
diff --git a/pages/IFRA.php b/pages/IFRA.php index 8c298c07..118f324e 100755 --- a/pages/IFRA.php +++ b/pages/IFRA.php @@ -7,7 +7,7 @@
@@ -34,7 +34,7 @@
Toggle column: Structure - Last publication
- +
diff --git a/pages/bottles.php b/pages/bottles.php index 846e1216..96cb32e3 100644 --- a/pages/bottles.php +++ b/pages/bottles.php @@ -7,48 +7,39 @@ $supplier[] = $suppliers; } ?> -
-
-
-

Bottles

-
-
-
-
Structure
- -
-
- - -
-
- -
- - - - - - - - - - - - - -
NameSize (ml)PriceSupplierPiecesCreatedUpdated
+
+
+

Bottles

+
+
+
+
+ + -
-
+
+
+ + + + + + + + + + + + + +
NameSize (ml)PriceSupplierPiecesCreatedUpdated
+