+
Cas "CASE VIDE" (Aucune faction nulle part)
@@ -1561,7 +1589,7 @@ function editStatus(data) {
}
function resetRuleForm() {
document.getElementById('ruleForm').reset();
- document.getElementById('rule_id').value = 0;
+ document.getElementById('rule_id').value = 0; document.getElementById('rule_combine').value = 'OR';
updateMSLabel('ms_orb');
updateMSLabel('ms_terr');
}
diff --git a/handler.txt b/handler.txt
new file mode 100644
index 0000000..e69de29
diff --git a/patch_admin_final.php b/patch_admin_final.php
new file mode 100644
index 0000000..40b32e2
--- /dev/null
+++ b/patch_admin_final.php
@@ -0,0 +1,155 @@
+ 0) {
+ $stmt = $db->prepare("UPDATE celestial_object_status_rules SET name = ?, status_id = ?, profile_id = ?, priority = ?, orbital_count_op = ?, orbital_count_val = ?, terrestrial_count_op = ?, terrestrial_count_val = ?, orbital_dominance = ?, terrestrial_dominance = ?, is_empty_case = ? WHERE id = ?");
+ $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $id]);
+ } else {
+ $stmt = $db->prepare("INSERT INTO celestial_object_status_rules (name, status_id, profile_id, priority, orbital_count_op, orbital_count_val, terrestrial_count_op, terrestrial_count_val, orbital_dominance, terrestrial_dominance, is_empty_case) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
+ $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case]);
+ }';
+
+$new_h = ' $is_empty_case = isset($_POST[\'is_empty_case\']) ? 1 : 0;
+ $combine_mode = $_POST[\'combine_mode\'] ?? \'OR\';
+
+ if ($id > 0) {
+ $stmt = $db->prepare("UPDATE celestial_object_status_rules SET name = ?, status_id = ?, profile_id = ?, priority = ?, orbital_count_op = ?, orbital_count_val = ?, terrestrial_count_op = ?, terrestrial_count_val = ?, orbital_dominance = ?, terrestrial_dominance = ?, is_empty_case = ?, combine_mode = ? WHERE id = ?");
+ $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $combine_mode, $id]);
+ } else {
+ $stmt = $db->prepare("INSERT INTO celestial_object_status_rules (name, status_id, profile_id, priority, orbital_count_op, orbital_count_val, terrestrial_count_op, terrestrial_count_val, orbital_dominance, terrestrial_dominance, is_empty_case, combine_mode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
+ $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $combine_mode]);
+ }';
+
+if (strpos($content, $old_h) !== false) {
+ $content = str_replace($old_h, $new_h, $content);
+ echo "Handler updated.\n";
+} else {
+ echo "Handler NOT found (check whitespace/indentation).\n";
+}
+
+// 2. Update UI
+$ui_block_start = '
';
+$ui_block_end = '
ENREGISTRER LA RÈGLE ';
+
+$pos_start = strpos($content, $ui_block_start);
+$pos_end = strpos($content, $ui_block_end, $pos_start);
+
+if ($pos_start !== false && $pos_end !== false) {
+ $new_ui = <<<'HTML'
+
+
+
+
+
+
+
+
+
Combinaison
+
+ OU
+ ET
+
+
(Orbital) [?] (Sol)
+
+
+
+
+
+
+
+
+ Cas "CASE VIDE" (Aucune faction nulle part)
+
+
+
+
+HTML;
+ $content = substr($content, 0, $pos_start) . $new_ui . substr($content, $pos_end);
+ echo "UI updated.\n";
+} else {
+ echo "UI NOT found.\n";
+}
+
+// 3. Update JS (resetRuleForm)
+if (strpos($content, "document.getElementById('rule_combine').value = 'OR';") === false) {
+ $content = str_replace(
+ "document.getElementById('rule_id').value = 0;",
+ "document.getElementById('rule_id').value = 0; document.getElementById('rule_combine').value = 'OR';",
+ $content
+ );
+ echo "JS updated.\n";
+}
+
+file_put_contents($file, $content);
+echo "Done.\n";
+?>
diff --git a/patch_admin_v7.php b/patch_admin_v7.php
new file mode 100644
index 0000000..32236a2
--- /dev/null
+++ b/patch_admin_v7.php
@@ -0,0 +1,162 @@
+ 0) {
+ $stmt = $db->prepare("UPDATE celestial_object_status_rules SET name = ?, status_id = ?, profile_id = ?, priority = ?, orbital_count_op = ?, orbital_count_val = ?, terrestrial_count_op = ?, terrestrial_count_val = ?, orbital_dominance = ?, terrestrial_dominance = ?, is_empty_case = ? WHERE id = ?");
+ $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $id]);
+ } else {
+ $stmt = $db->prepare("INSERT INTO celestial_object_status_rules (name, status_id, profile_id, priority, orbital_count_op, orbital_count_val, terrestrial_count_op, terrestrial_count_val, orbital_dominance, terrestrial_dominance, is_empty_case) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
+ $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case]);
+ }
+';
+
+$new_handler = '$is_empty_case = isset($_POST[\'is_empty_case\']) ? 1 : 0;
+ $combine_mode = $_POST[\'combine_mode\'] ?? \'OR\';
+
+ if ($id > 0) {
+ $stmt = $db->prepare("UPDATE celestial_object_status_rules SET name = ?, status_id = ?, profile_id = ?, priority = ?, orbital_count_op = ?, orbital_count_val = ?, terrestrial_count_op = ?, terrestrial_count_val = ?, orbital_dominance = ?, terrestrial_dominance = ?, is_empty_case = ?, combine_mode = ? WHERE id = ?");
+ $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $combine_mode, $id]);
+ } else {
+ $stmt = $db->prepare("INSERT INTO celestial_object_status_rules (name, status_id, profile_id, priority, orbital_count_op, orbital_count_val, terrestrial_count_op, terrestrial_count_val, orbital_dominance, terrestrial_dominance, is_empty_case, combine_mode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
+ $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $combine_mode]);
+ }
+';
+
+if (strpos($content, $old_handler) !== false) {
+ $content = str_replace($old_handler, $new_handler, $content);
+ echo "Handler patched.\n";
+} else {
+ echo "Handler NOT found.\n";
+}
+
+// 2. Update UI (Configuration des règles)
+$start_marker = '
';
+$end_marker = 'ENREGISTRER LA RÈGLE';
+
+$pos_start = strpos($content, $start_marker);
+$pos_end = strpos($content, $end_marker, $pos_start);
+
+if ($pos_start !== false && $pos_end !== false) {
+ // We want to replace everything from $start_marker up to just before "ENREGISTRER LA RÈGLE" button
+ // Actually the UI I prepared includes the background div.
+
+ $new_ui = <<<'HTML'
+
+
+
+
+
+
+
+
+
Combinaison
+
+ OU
+ ET
+
+
(Orbital) [?] (Sol)
+
+
+
+
+
+
+
+
+ Cas "CASE VIDE" (Aucune faction nulle part)
+
+
+HTML;
+
+ // Find where the background div ends (it should be before the button)
+ // We can find the button and look backwards for the last
before it.
+ $pos_button = strpos($content, '
ENREGISTRER LA RÈGLE');
+ $content_before_button = substr($content, 0, $pos_button);
+ $last_div_pos = strrpos($content_before_button, ' ');
+
+ // Re-verify that we are replacing the right block
+ $content = substr($content, 0, $pos_start) . $new_ui . substr($content, $pos_button);
+ echo "UI patched.\n";
+} else {
+ echo "UI NOT found.\n";
+}
+
+// 3. Update JS (resetRuleForm)
+if (strpos($content, "document.getElementById('rule_id').value = 0; document.getElementById('rule_combine').value = 'OR';") === false) {
+ $content = str_replace(
+ "document.getElementById('rule_id').value = 0;",
+ "document.getElementById('rule_id').value = 0; document.getElementById('rule_combine').value = 'OR';",
+ $content
+ );
+ echo "JS patched.\n";
+} else {
+ echo "JS already patched or not found.\n";
+}
+
+file_put_contents($file, $content);
+echo "Final save done.\n";
+?>
\ No newline at end of file
diff --git a/ui.txt b/ui.txt
new file mode 100644
index 0000000..e69de29