Skip to content

Achilles - #12

Draft
dcarani2 wants to merge 11 commits into
masterfrom
achilles
Draft

dcarani2 wants to merge 11 commits into
masterfrom
achilles

Conversation

@dcarani2

Copy link
Copy Markdown
Collaborator

Initial overview to verify Bootstrap migration was successful and did not create any obvious security issues, as this was generated with the Help of AI

igb and others added 11 commits September 12, 2025 09:29
JS now reads data-restrict-lamination attr set by PHP rather than
re-hardcoding paper type IDs. Added temporary console.log for debugging.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Finish option IDs changed with DB reseed (None=8, Laminating=22,
not 1 and 2). PHP now identifies lamination by name and stamps
data-is-lamination attr. JS reads the attr instead of hardcoding.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@dcarani2
dcarani2 requested review from joerleigh and rbdavid August 27, 2026 18:41

///////Month///////
$month_html = "<select class='form-control' name='month'>";
$year_html = "<select class='form-select' name='year'>";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It switched "month" to "year" here for some reason, but then continued to use $month_html below even though it's now uninitialized

}
?>
<a class='btn btn-sm btn-primary' href='<?php echo $_SERVER['PHP_SELF'] . "?year=" . $previous_year; ?>'>Previous Year</a>
<a class='btn btn-sm btn-primary' href='<?php echo $_SERVER['PHP_SELF'] . "?year=" . $next_year; ?>'>Next Year</a>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It removed the functionality where (I think) it's disabling the next button if we're looking at the current year already

for ($i=$min_year; $i<=date("Y");$i++) {
if ($i == $year) { $year_html .= "<option value='" . $i . "' selected='true'>" . $i . "</option>"; }
else { $year_html .= "<option value='" . $i . "'>" . $i . "</option>"; }
$min_year = max(functions::get_minimal_year($db), date("Y") - 50); // Last 20 years max

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment says 20, but the math is subtracting 50

if ($i == $year) { $year_html .= "<option value='" . $i . "' selected='true'>" . $i . "</option>"; }
else { $year_html .= "<option value='" . $i . "'>" . $i . "</option>"; }
$min_year = max(functions::get_minimal_year($db), date("Y") - 50); // Last 20 years max
$current_year = date("Y");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$current_year could be moved up a line and used in the $min_year calculation

Comment thread html/step2.php
}

// Check if selected paper type is Graphic Matte Canvas (17, 18) or Fine Art Watercolor (7)
$restrictLamination = in_array($selectedPaperTypeId, [17, 18, 7]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than hard-coding paper type IDs here (and below on line 40), I would add a boolean field to the paper type table to track whether each type allows lamination. That way, we won't have to change the code when adding future paper types, and we're also not relying on certain paper types having certain ID numbers.

Comment thread html/step2.php

$dataAttr = $isLamination ? " data-is-lamination='true'" : "";

if ($isLamination && $restrictLamination) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little unclear on what these if statements are checking. A couple of them look like they do the same thing. And don't these get overridden by the javascript below that runs on page load anyway?

@joerleigh joerleigh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I think the bootstrap migration looks fine, apart from the sections I commented on. I mostly suggested minor tweaks except for the database structure change which is a little more involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants