Actualiser assets/js/app.js
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
This commit is contained in:
@@ -9493,6 +9493,28 @@ function showAddForm() {
|
||||
${currentProduct.weight_info ? `<p style="font-size:0.8rem;color:var(--text-light)">${escapeHtml(currentProduct.weight_info)}</p>` : ''}
|
||||
</div>
|
||||
`;
|
||||
|
||||
// --- PATCH : Injection du bouton "Modifier la fiche produit" ---
|
||||
// On vérifie si le bouton n'existe pas déjà pour éviter les doublons
|
||||
if (!document.getElementById('btn-edit-product-shortcut')) {
|
||||
// On cherche le bouton vert "Aggiungi" dans la page add
|
||||
const submitBtn = document.querySelector('#page-add button[type="submit"]');
|
||||
if (submitBtn) {
|
||||
const editBtn = document.createElement('button');
|
||||
editBtn.type = 'button';
|
||||
editBtn.id = 'btn-edit-product-shortcut';
|
||||
editBtn.className = 'btn btn-large';
|
||||
editBtn.innerText = '✏️ Modifier la fiche produit (Catégorie)';
|
||||
editBtn.style.cssText = 'margin-bottom: 15px; background-color: #1976d2; color: white; width: 100%; border: none; border-radius: 8px; padding: 12px; font-size: 16px; font-weight: bold; cursor: pointer; display: block;';
|
||||
|
||||
// On lie le clic à notre fonction de bascule
|
||||
editBtn.onclick = switchToProductEditFromStock;
|
||||
|
||||
// Insérer le bouton juste au-dessus du bouton vert "Enregistrer/Aggiungi"
|
||||
submitBtn.parentNode.insertBefore(editBtn, submitBtn);
|
||||
}
|
||||
}
|
||||
|
||||
// Set unit selector
|
||||
const unit = currentProduct.unit || 'pz';
|
||||
const unitSelect = document.getElementById('add-unit');
|
||||
|
||||
Reference in New Issue
Block a user