Skip to content

Commit e1a2006

Browse files
authored
Merge pull request #200 from globaldyne/v12.3
V12.3
2 parents f7ed422 + 8d6bbe0 commit e1a2006

19 files changed

+43
-43
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ inc/config.php
88
*.swp
99
t.php
1010
tests/
11-
modules/suppliers/pvOnlineBK.json
12-
modules/suppliers/pvOnlineBK.php
11+
modules/suppliers/pvLibraryBK.json
12+
modules/suppliers/pvLibraryBK.php

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# CHANGELOG
2+
### Version 12.3
3+
- Fix API log file
4+
- PV Online has been renamed to PV Library
5+
26
### Version 12.2
37
- Docker file update
48
- Fixed document upload for ingredients returning incorrect results

VERSION.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.2
1+
12.3

api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
define('pvault_panel', TRUE);
33
define('__ROOT__', dirname(__FILE__));
4-
define('LOG_PATH', __ROOT__ . '/logs/');
4+
define('LOG_PATH', '/tmp/logs/');
55
define('DEFAULT_IMAGE', __ROOT__ . '/img/pv_molecule.png');
66
define('LOG_API_FILE', 'pv-api.log');
77

core/core.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
require_once(__ROOT__.'/inc/product.php');
88
require_once(__ROOT__.'/func/labelMap.php');
99
require_once(__ROOT__.'/func/get_formula_notes.php');
10-
require_once(__ROOT__.'/func/pvOnline.php');
10+
require_once(__ROOT__.'/func/pvPost.php');
1111
require_once(__ROOT__.'/func/pvFileGet.php');
1212
require_once(__ROOT__.'/func/validateInput.php');
1313
require_once(__ROOT__.'/func/sanChar.php');
@@ -558,11 +558,11 @@
558558

559559
}
560560

561-
//PVOnline Single Import
562-
if($_POST['action'] == 'import' && $_POST['source'] == 'PVOnline' && $_POST['kind'] == 'ingredient' && $_POST['ing_id']){
561+
//PVLibrary Single Import
562+
if($_POST['action'] == 'import' && $_POST['source'] == 'PVLibrary' && $_POST['kind'] == 'ingredient' && $_POST['ing_id']){
563563
$id = mysqli_real_escape_string($conn, $_POST['ing_id']);
564564

565-
$jAPI = $pvOnlineAPI.'?request=ingredients&src=PV_PRO&id='.$id;
565+
$jAPI = $pvLibraryAPI.'?request=ingredients&src=PV_PRO&id='.$id;
566566
$jsonData = json_decode(pv_file_get_contents($jAPI), true);
567567

568568
if($jsonData['error']){
@@ -3064,7 +3064,7 @@ function formatVal($num){
30643064

30653065
$id = mysqli_real_escape_string($conn, $_POST['fid']);
30663066

3067-
$jAPI = $pvOnlineAPI.'?request=MarketPlace&action=get&id='.$id;
3067+
$jAPI = $pvLibraryAPI.'?request=MarketPlace&action=get&id='.$id;
30683068
$jsonData = json_decode(pv_file_get_contents($jAPI), true);
30693069

30703070
if($jsonData['error']){
@@ -3147,7 +3147,7 @@ function formatVal($num){
31473147
'contactReason' => $contactReason
31483148
];
31493149

3150-
$req = json_decode(pvPost($pvOnlineAPI, $data));
3150+
$req = json_decode(pvPost($pvLibraryAPI, $data));
31513151
if($req->success){
31523152
$response['success'] = $req->success;
31533153
}else{
@@ -3191,7 +3191,7 @@ function formatVal($num){
31913191
'reportReason' => $reportReason
31923192
];
31933193

3194-
$req = json_decode(pvPost($pvOnlineAPI, $data));
3194+
$req = json_decode(pvPost($pvLibraryAPI, $data));
31953195
if($req->success){
31963196
$response['success'] = $req->success;
31973197
}else if($req->error){

db/pvault.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ CREATE TABLE `settings` (
342342
`multi_dim_perc` INT NOT NULL DEFAULT '0',
343343
`defCatClass` VARCHAR(255) NOT NULL DEFAULT 'cat4',
344344
`defPercentage` VARCHAR(255) NOT NULL DEFAULT 'max_percentage',
345-
`pv_online_api_url` varchar(255) COLLATE utf8_general_ci NOT NULL DEFAULT 'https://online.perfumersvault.com/api-data/api.php',
345+
`pv_library_api_url` varchar(255) COLLATE utf8_general_ci NOT NULL DEFAULT 'https://library.perfumersvault.com/api-data/api.php',
346346
`api` INT NOT NULL DEFAULT '0',
347347
`api_key` VARCHAR(255) NULL,
348348
`editor` int(11) NOT NULL DEFAULT 1 COMMENT '1 = Inline, 2 = Advanced',

db/schema.ver

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.2
1+
12.3

db/updates/update_12.2-12.3.sql

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
UPDATE `settings` SET `pv_online_api_url` = 'https://library.perfumersvault.com/api-data/api.php' WHERE `settings`.`id` = 1;
2+
ALTER TABLE `settings` CHANGE `pv_online_api_url` `pv_library_api_url` VARCHAR(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT 'https://library.perfumersvault.com/api.php';

func/pvOnline.php func/pvPost.php

File renamed without changes.

inc/settings.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88

99
$pubChemApi = 'https://pubchem.ncbi.nlm.nih.gov/rest';
10-
$pvOnlineAPI = $settings['pv_online_api_url'];
10+
$pvLibraryAPI = $settings['pv_library_api_url'];
1111
?>

index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ function chkUpdate() {
285285
} elseif ($_GET['do'] == 'settings') {
286286
require_once(__ROOT__.'/pages/settings.php');
287287
} elseif ($_GET['do'] == 'marketplace') {
288-
require_once(__ROOT__.'/pages/views/pvOnline/marketPlace.php');
288+
require_once(__ROOT__.'/pages/views/pvLibrary/marketPlace.php');
289289
} elseif ($_GET['do'] == 'statistics') {
290290
require_once(__ROOT__.'/pages/statistics.php');
291291
} elseif ($_GET['do'] == 'IFRA') {

js/settings.tabs.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ $(document).ready(function() {
3737
get_maintenance();
3838
});
3939

40-
$('#pvOnline_tab').on( 'click', function () {
41-
get_pvonline();
40+
$('#pvLibrary_tab').on( 'click', function () {
41+
get_pvlibrary();
4242
});
4343

4444
$('#api_tab').on( 'click', function () {

modules/suppliers/pvLibrary.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id":"pvLibrary",
3+
"name":"PV Library",
4+
"slug":"pvLibary",
5+
"version":"1.0.1",
6+
"fileName":"pvLibrary",
7+
"icon":"fas fa-cloud"
8+
}

modules/suppliers/pvOnline.php modules/suppliers/pvLibrary.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require_once(__ROOT__.'/inc/sec.php');
55
require_once(__ROOT__.'/inc/opendb.php');
66
require_once(__ROOT__.'/inc/settings.php');
7-
require_once(__ROOT__.'/func/pvOnline.php');
7+
require_once(__ROOT__.'/func/pvPost.php');
88

99

1010
$row = isset($_POST['start']) ? (int)$_POST['start'] : 0;
@@ -27,7 +27,7 @@
2727
];
2828

2929
// Make API request and decode the JSON response
30-
$output = json_decode(pvPost($pvOnlineAPI, $data));
30+
$output = json_decode(pvPost($pvLibraryAPI, $data));
3131

3232
// Initialize response array
3333
$rx = [];
@@ -78,7 +78,7 @@
7878

7979
// Prepare final response
8080
$response = [
81-
'source' => 'PVOnline',
81+
'source' => 'PVLibrary',
8282
'draw' => isset($_POST['draw']) ? (int) $_POST['draw'] : 0,
8383
'recordsTotal' => (int) ($output->ingredientsTotal ?? 0),
8484
'recordsFiltered' => (int) ($output->ingredientsFiltered ?? 0),

modules/suppliers/pvOnline.json

-8
This file was deleted.

pages/ingredients.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
});
202202

203203
list_ingredients();
204-
var pvOnlineAPI = '<?php echo $pvOnlineAPI; ?>';
204+
var pvLibraryAPI = '<?php echo $pvLibraryAPI; ?>';
205205
$(function () {
206206
$(".input-group-btn .dropdown-menu li a").click(function () {
207207
var selText = $(this).html();

pages/listIngredients.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ function iProfile(data, type, row, meta){
320320
return '<img src="/img/pv_molecule.png" class="img_ing_prof"/>';
321321
}
322322
}else{
323-
return '<i class="pv_point_gen" rel="tip" title="Not available in PV Online">N/A</i>';
323+
return '<i class="pv_point_gen" rel="tip" title="Not available in PV Library">N/A</i>';
324324
}
325325
};
326326

@@ -333,7 +333,7 @@ function iStock(data, type, row, meta){
333333
if(meta.settings.json.source == 'local'){
334334
return '<a class="popup-link" rel="tip" title="'+ingUnit+'" href="/pages/views/ingredients/ingSuppliers.php?id=' + row.id + '&standAlone=1">' + data + '</a>';
335335
}else{
336-
return '<i class="pv_point_gen" rel="tip" title="Not available in PV Online">N/A</i>';
336+
return '<i class="pv_point_gen" rel="tip" title="Not available in PV Library">N/A</i>';
337337
}
338338
};
339339

@@ -400,7 +400,7 @@ function iDocs(data, type, row){
400400

401401

402402
function actions(data, type, row, meta){
403-
if(meta.settings.json.source == 'PVOnline'){
403+
if(meta.settings.json.source == 'PVLibrary'){
404404
data = '<div class="dropdown">' +
405405
'<button type="button" class="btn" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fas fa-ellipsis-v"></i></button>' +
406406
'<ul class="dropdown-menu dropdown-menu-right">' +
@@ -474,7 +474,7 @@ function actions(data, type, row, meta){
474474

475475
bootbox.dialog({
476476
title: "Confirm ingredient import",
477-
message : 'Import <strong>'+ ing.Name +'</strong>\'s data from PVOnline? <hr/><div class="alert alert-warning"><strong>Please note: data maybe incorrect and/or incomplete, you should validate them after import.</strong></div>',
477+
message : 'Import <strong>'+ ing.Name +'</strong>\'s data from PVLibrary? <hr/><div class="alert alert-warning"><strong>Please note: data maybe incorrect and/or incomplete, you should validate them after import.</strong></div>',
478478
buttons :{
479479
main: {
480480
label : "Import",
@@ -486,7 +486,7 @@ className : "btn-warning",
486486
type: 'POST',
487487
data: {
488488
action: "import",
489-
source: "PVOnline",
489+
source: "PVLibrary",
490490
kind: "ingredient",
491491
ing_id: ing.ID,
492492
},

pages/views/pvOnline/marketPlace.php pages/views/pvLibrary/marketPlace.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function extrasShow() {
133133

134134
var tableMarket = $("#all-table-market").DataTable({
135135
ajax: {
136-
url: '<?=$pvOnlineAPI?>',
136+
url: '<?=$pvLibraryAPI?>',
137137
type: 'POST',
138138
dataType: 'json',
139139
timeout: 5000,

releasenotes.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
Whats New in v12.2
1+
Whats New in v12.3
22
--------------------------
3-
- IMPORTANT: User has to be recreated after updating to this release
4-
- Added available API calls endpoint table
5-
- Forgot password wording update
6-
- User password is now using a stronger encryption algorithm
7-
- Fixed document upload for ingredients returning incorrect results
8-
- Update login method
9-
- Major re-write and improvements for the API
3+
- PV Online has been renamed to PV Library
104
- This release may include more changes, for full details please refer to the CHANGELOG

0 commit comments

Comments
 (0)