Skip to content

Commit

Permalink
Merge pull request #180 from globaldyne/v10.9
Browse files Browse the repository at this point in the history
V10.9
  • Loading branch information
globaldyne authored Aug 11, 2024
2 parents 155185a + 9aced63 commit ee46374
Show file tree
Hide file tree
Showing 37 changed files with 1,668 additions and 1,480 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# CHANGELOG
### Version 10.9
- Sys update check improvements
- Dashboard page updates
- Set datatable entries to the middle
- Sell formula PDF export updates
- Fix a bug causing json import for ingredients to fail
- Include EINECS when adding ingredient entry from compositions
- Compostion page updates and improvements
- Hide privacy tab for ingredients as is not yet utilised
- Tech data page updates
- Update synonyms backend to json format
- If Prohibition is selected in ingredient usage and limits then the usage values set to 0
- Rewrite backend for usage and limits update
- To Declare option is now moved under Udage and Limits section for ingredients
- Fix materials not updating corrrectly when added in the cart
- Added CSV export for cart ingredients
- Added a toast message for the cart actions
- Added a toast message when adding an ingredient to the cart in Make Formula
- CSS clean-up

### Version 10.8
- Fix API key update not returning error in correct format
- Rewrite API page
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ RUN microdnf --setopt=tsflags=nodocs -y install \
openssl \
mysql \
ncurses \
nginx
nginx


RUN microdnf clean all && rm -rf /var/cache/yum/*

RUN sed -i \
-e 's~^;date.timezone =$~date.timezone = UTC~g' \
Expand All @@ -40,6 +39,9 @@ RUN sed -i \
ENV LANG en_GB.UTF-8

ADD . /html
RUN if [ -f .git/COMMIT_EDITMSG ]; then \
cat .git/COMMIT_EDITMSG | sed -n 's/^\[\(.*\)\].*/\[\1\]/p' > /html/COMMIT; \
fi

ADD scripts/php-fpm/www.conf /etc/php-fpm.d/www.conf
ADD scripts/php-fpm/php-fpm.conf /etc/php-fpm.conf
Expand All @@ -50,7 +52,9 @@ ADD scripts/reset_pass.sh /usr/bin/reset_pass.sh
RUN chmod +x /usr/bin/entrypoint.sh
RUN chmod +x /usr/bin/reset_pass.sh


RUN rm -rf /html/.git /html/.github
RUN microdnf clean all && rm -rf /var/cache/yum/*

WORKDIR /html
STOPSIGNAL SIGQUIT
Expand Down
3 changes: 1 addition & 2 deletions LIMITATIONS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#Limitations

- No support for enviroments like XAMPP
- Own vhost is required if run outide docker
- No support for enviroments like XAMPP
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.8
10.9
55 changes: 35 additions & 20 deletions core/checkVer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,40 @@
require_once(__ROOT__.'/inc/sec.php');
require_once(__ROOT__.'/func/pvFileGet.php');

$app_ver = $_GET['app_ver'];
if($app_ver){
$githubVer = 'https://raw.githubusercontent.com/globaldyne/parfumvault/master/VERSION.md';
$githubREL = 'https://raw.githubusercontent.com/globaldyne/parfumvault/master/releasenotes.md';

$docUrl = 'https://www.perfumersvault.com/knowledge-base/how-to-update-pv-to-its-latest-version/';
$data = trim(pv_file_get_contents($githubVer));
$gitHubRep = 'https://github.com/globaldyne/parfumvault/archive/refs/tags/v'.$data.'.zip';

if($app_ver < $data){
if(file_exists('/config/.DOCKER') == TRUE || getenv('PLATFORM') == 'CLOUD'){
$response["success"] = '<strong>New <a href="'.$gitHubRep.'" target="_blank">version ('.$data.')</a> is availale!</strong> Please refer <a href="'.$docUrl.'" target="_blank">here</a> for update instructions.';
echo json_encode($response);
}else{
$response["success"] = '<strong>New <a href="'.$gitHubRep.'" target="_blank">version ('.$data.')</a> is availale!</strong> <a href="#" data-bs-toggle="modal" data-bs-target="#sysUpgradeDialog" data-ver="'.$githubVer.'">Upgrade available.</a>';
echo json_encode($response);
}
}
// Sanitize input
$app_ver = filter_input(INPUT_GET, 'app_ver', FILTER_SANITIZE_STRING);

if ($app_ver) {
$githubVerUrl = 'https://raw.githubusercontent.com/globaldyne/parfumvault/master/VERSION.md';
$githubRelUrl = 'https://raw.githubusercontent.com/globaldyne/parfumvault/master/releasenotes.md';

$docUrl = 'https://www.perfumersvault.com/knowledge-base/how-to-update-pv-to-its-latest-version/';

// Fetch the latest version from GitHub
$data = trim(pv_file_get_contents($githubVerUrl));

if ($data === false) {
$response["error"] = 'Failed to retrieve version information. Please try again later.';
echo json_encode($response);
http_response_code(500);
exit;
}

$gitHubRep = 'https://github.com/globaldyne/parfumvault/archive/refs/tags/v'.$data.'.zip';

if (version_compare($app_ver, $data, '<')) {
$response["success"] = '<strong>New <a href="'.$gitHubRep.'" target="_blank">version ('.$data.')</a> is available!</strong>';
$response["success"] .= file_exists('/config/.DOCKER') === TRUE || getenv('PLATFORM') === 'CLOUD'
? ' Please refer <a href="'.$docUrl.'" target="_blank">here</a> for update instructions.'
: ' <a href="#" data-bs-toggle="modal" data-bs-target="#sysUpgradeDialog" data-ver="'.$githubVerUrl.'">Upgrade available.</a>';
echo json_encode($response);
} else {
$response["info"] = 'No updates available.';
echo json_encode($response);
}
} else {
$response["error"] = 'Invalid version provided.';
echo json_encode($response);
http_response_code(400);
}

return;
?>
1 change: 0 additions & 1 deletion css/sb-admin-2.css
Original file line number Diff line number Diff line change
Expand Up @@ -9597,7 +9597,6 @@ a:focus {
}

.bg-gradient-primary {
background-color: #4e73df;
background-image: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
background-size: cover;
}
Expand Down
4 changes: 2 additions & 2 deletions css/vault.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tr.noBorder td {
.table th,
.table td {
padding: 0.2rem;
vertical-align: top;
vertical-align: middle;
border-top: 1px solid #e3e6f0;
}

Expand Down Expand Up @@ -273,7 +273,7 @@ tr.strikeout td:before {
border-top-right-radius: 0;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
padding: 10px 10px 10px 150px;
padding: 10px 250px 10px 250px;
box-sizing: border-box;
}

Expand Down
2 changes: 1 addition & 1 deletion db/schema.ver
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.8
10.9
28 changes: 14 additions & 14 deletions func/countCart.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php
if (!defined('pvault_panel')){ die('Not Found');}

function countCart($conn ){

$c = mysqli_num_rows(mysqli_query($conn, "SELECT id FROM cart"));

if($c == '0'){
return NULL;
}else{
return $c;
}
}

<?php
if (!defined('pvault_panel')){ die('Not Found');}

function countCart(){
global $conn;
$c = mysqli_num_rows(mysqli_query($conn, "SELECT id FROM cart"));

if($c == '0'){
return NULL;
}else{
return $c;
}
}

?>
Loading

0 comments on commit ee46374

Please sign in to comment.