diff --git a/admin/anlage_systems.php b/admin/anlage_systems.php index eda3dbb..c95eff0 100755 --- a/admin/anlage_systems.php +++ b/admin/anlage_systems.php @@ -122,8 +122,8 @@ if ($action == 'deactivate') { $title = $langs->trans('AnlagenSystems'); // Include CSS and JS -$morejs = array('/kundenkarte/js/kundenkarte.js'); -$morecss = array('/kundenkarte/css/kundenkarte.css'); +$morejs = array('/kundenkarte/js/kundenkarte.js?v=1769962608'); +$morecss = array('/kundenkarte/css/kundenkarte.css?v=1769962608'); llxHeader('', $title, '', '', 0, 0, $morejs, $morecss); diff --git a/admin/anlage_types.php b/admin/anlage_types.php index 308a555..175c1d1 100755 --- a/admin/anlage_types.php +++ b/admin/anlage_types.php @@ -248,7 +248,9 @@ if ($action == 'confirm_delete_field' && $confirm == 'yes') { } else { setEventMessages($db->lasterror(), null, 'errors'); } - $action = 'edit'; + // Redirect back to edit page to stay in the fields list + header('Location: '.$_SERVER['PHP_SELF'].'?action=edit&typeid='.$typeId.'&system='.$systemFilter); + exit; } if ($action == 'activate_field') { @@ -270,15 +272,15 @@ if ($action == 'deactivate_field') { $title = $langs->trans('AnlagenTypes'); // Include CSS and JS -$morejs = array('/kundenkarte/js/kundenkarte.js'); -$morecss = array('/kundenkarte/css/kundenkarte.css'); +$morejs = array('/kundenkarte/js/kundenkarte.js?v=1769962608'); +$morecss = array('/kundenkarte/css/kundenkarte.css?v=1769962608'); llxHeader('', $title, '', '', 0, 0, $morejs, $morecss); $head = kundenkarteAdminPrepareHead(); print dol_get_fiche_head($head, 'types', $langs->trans('ModuleKundenKarteName'), -1, 'fa-file'); -// Confirmation +// Confirmation for type deletion if ($action == 'delete') { print $form->formconfirm( $_SERVER['PHP_SELF'].'?typeid='.$typeId.'&system='.$systemFilter, @@ -291,6 +293,20 @@ if ($action == 'delete') { ); } +// Confirmation for field deletion +if ($action == 'delete_field') { + print $form->formconfirm( + $_SERVER['PHP_SELF'].'?typeid='.$typeId.'&fieldid='.$fieldId.'&system='.$systemFilter, + $langs->trans('Delete'), + $langs->trans('ConfirmDeleteField'), + 'confirm_delete_field', + '', + 'yes', + 1 + ); + $action = 'edit'; // Stay in edit mode to show the fields +} + // Add/Edit form if (in_array($action, array('create', 'edit'))) { if ($action == 'edit' && $typeId > 0) { @@ -407,19 +423,6 @@ if (in_array($action, array('create', 'edit'))) { if ($action == 'edit' && $typeId > 0) { $editFieldId = GETPOSTINT('editfield'); - // Confirmation for field deletion - if ($action == 'delete_field') { - print $form->formconfirm( - $_SERVER['PHP_SELF'].'?action=edit&typeid='.$typeId.'&fieldid='.$fieldId.'&system='.$systemFilter, - $langs->trans('Delete'), - $langs->trans('ConfirmDeleteField'), - 'confirm_delete_field', - '', - 'yes', - 1 - ); - } - print '

'; print '

'.$langs->trans('AnlagenTypeFields').'

'; @@ -513,7 +516,7 @@ if (in_array($action, array('create', 'edit'))) { print ''; print '
'; print ''; - print ''; + print ''; print '
'; print ''; print ''; @@ -524,14 +527,20 @@ if (in_array($action, array('create', 'edit'))) { print ''.$langs->trans('NoFieldsDefined').''; } - // Add new field row - print ''; + print ''; + + // Add new field form - completely separate from table + print '
'; print '
'; print ''; print ''; print ''; print ''; - + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; print ''; print ''; - - print ''; print ''; - print '
'.$langs->trans('Add').' '.$langs->trans('Field').'
'; + print ''; + print '
'; // Help box for field options print '
'; diff --git a/ajax/export_tree_pdf.php b/ajax/export_tree_pdf.php old mode 100644 new mode 100755 diff --git a/ajax/favorite_update.php b/ajax/favorite_update.php old mode 100644 new mode 100755 index ce14ba4..4c12083 --- a/ajax/favorite_update.php +++ b/ajax/favorite_update.php @@ -41,18 +41,21 @@ if (!$user->hasRight('kundenkarte', 'write')) { header('Content-Type: application/json'); $id = GETPOSTINT('id'); -$qty = GETPOSTFLOAT('qty'); +$qty = GETPOST('qty', 'alpha'); if ($id <= 0) { echo json_encode(array('error' => 'Invalid ID')); exit; } -if ($qty <= 0) { +// Simple check: just needs to be numeric +if (!is_numeric($qty)) { echo json_encode(array('error' => 'Invalid quantity')); exit; } +$qty = (float) $qty; + $favoriteProduct = new FavoriteProduct($db); $result = $favoriteProduct->fetch($id); diff --git a/ajax/icon_upload.php b/ajax/icon_upload.php old mode 100644 new mode 100755 diff --git a/ajax/type_fields.php b/ajax/type_fields.php old mode 100644 new mode 100755 diff --git a/core/modules/modKundenKarte.class.php b/core/modules/modKundenKarte.class.php index b3a6ff8..7ec7015 100755 --- a/core/modules/modKundenKarte.class.php +++ b/core/modules/modKundenKarte.class.php @@ -76,7 +76,7 @@ class modKundenKarte extends DolibarrModules $this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@kundenkarte' // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z' - $this->version = '2.0'; + $this->version = '2.5'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; diff --git a/css/kundenkarte.css b/css/kundenkarte.css index db3931e..5782ed9 100755 --- a/css/kundenkarte.css +++ b/css/kundenkarte.css @@ -1,6 +1,6 @@ /** * KundenKarte Module Styles - * Copyright (C) 2026 Alles Watt lauft + * Dark Mode Theme */ /* ======================================== @@ -8,272 +8,211 @@ ======================================== */ .kundenkarte-tree { - font-family: inherit; - padding: 10px 0; + font-family: inherit !important; + padding: 10px 0 !important; } .kundenkarte-tree-node { - position: relative; - padding-left: 20px; - margin: 2px 0; -} - -.kundenkarte-tree-node::before { - content: ''; - position: absolute; - left: 0; - top: 0; - height: 100%; - width: 1px; - background: #ddd; -} - -.kundenkarte-tree-node::after { - content: ''; - position: absolute; - left: 0; - top: 12px; - width: 15px; - height: 1px; - background: #ddd; -} - -.kundenkarte-tree-node:last-child::before { - height: 12px; + position: relative !important; + padding-left: 20px !important; + margin: 2px 0 !important; } .kundenkarte-tree-item { - display: flex; - align-items: center; - padding: 6px 10px; - border-radius: 4px; - background: #f9f9f9; - border: 1px solid #e0e0e0; - cursor: pointer; - transition: all 0.2s ease; + display: flex !important; + align-items: center !important; + padding: 8px 12px !important; + border-radius: 4px !important; + background: #2d2d2d !important; + border: 1px solid #444 !important; + cursor: pointer !important; + color: #e0e0e0 !important; } .kundenkarte-tree-item:hover { - background: #f0f0f0; - border-color: #ccc; -} - -.kundenkarte-tree-item.selected { - background: #e3f2fd; - border-color: #2196f3; + background: #3a3a3a !important; + border-color: #555 !important; } .kundenkarte-tree-toggle { - width: 20px; - height: 20px; - display: flex; - align-items: center; - justify-content: center; - margin-right: 5px; - cursor: pointer; - color: #666; -} - -.kundenkarte-tree-toggle:hover { - color: #333; - background-color: rgba(0, 0, 0, 0.1); - border-radius: 3px; + width: 20px !important; + height: 20px !important; + display: flex !important; + align-items: center !important; + justify-content: center !important; + margin-right: 5px !important; + cursor: pointer !important; + color: #aaa !important; } .kundenkarte-tree-toggle .fa-chevron-down { - transition: transform 0.2s ease; + transition: transform 0.2s ease !important; } .kundenkarte-tree-toggle.collapsed .fa-chevron-down { - transform: rotate(-90deg); + transform: rotate(-90deg) !important; } .kundenkarte-tree-icon { - width: 24px; - height: 24px; - display: flex; - align-items: center; - justify-content: center; - margin-right: 8px; - font-size: 14px; + width: 24px !important; + height: 24px !important; + display: flex !important; + align-items: center !important; + justify-content: center !important; + margin-right: 8px !important; + font-size: 14px !important; + color: #aaa !important; } .kundenkarte-tree-label { - flex: 1; - font-weight: 500; + flex: 1 !important; + font-weight: 500 !important; + color: #e0e0e0 !important; } .kundenkarte-tree-label-info { - font-weight: normal; - color: #666; - font-size: 0.9em; -} - -.kundenkarte-tree-info { - color: #888; - font-size: 0.9em; - margin-left: 10px; + font-weight: normal !important; + color: #999 !important; + font-size: 0.9em !important; } .kundenkarte-tree-actions { - display: none; - margin-left: 10px; + display: none !important; + margin-left: 10px !important; } .kundenkarte-tree-item:hover .kundenkarte-tree-actions { - display: flex; - gap: 5px; + display: flex !important; + gap: 5px !important; } .kundenkarte-tree-actions a { - padding: 2px 6px; - border-radius: 3px; - color: #666; + padding: 2px 6px !important; + border-radius: 3px !important; + color: #ccc !important; } .kundenkarte-tree-actions a:hover { - background: #ddd; - color: #333; + background: #555 !important; + color: #fff !important; } .kundenkarte-tree-children { - margin-left: 10px; - border-left: 1px dashed #ccc; - padding-left: 10px; + margin-left: 10px !important; + border-left: 2px solid #444 !important; + padding-left: 10px !important; } .kundenkarte-tree-children.collapsed { display: none !important; } -/* Tree - Type Badge */ .kundenkarte-tree-type { - font-size: 0.75em; - padding: 2px 8px; - border-radius: 10px; - background: #e0e0e0; - color: #555; - margin-left: 8px; - font-weight: normal; -} - -/* Tree - Location */ -.kundenkarte-tree-location { - font-size: 0.85em; - color: #666; - margin-left: 10px; - display: flex; - align-items: center; - gap: 4px; -} - -.kundenkarte-tree-location i { - color: #e74c3c; - font-size: 0.9em; + font-size: 0.75em !important; + padding: 2px 8px !important; + border-radius: 10px !important; + background: #444 !important; + color: #ccc !important; + margin-left: 8px !important; + font-weight: normal !important; } /* Tree - File Indicators */ .kundenkarte-tree-files { - display: inline-flex; - gap: 3px; - margin-left: 6px; - vertical-align: middle; + display: inline-flex !important; + gap: 3px !important; + margin-left: 6px !important; } .kundenkarte-tree-file-badge { - font-size: 0.8em; - padding: 2px 6px; - border-radius: 4px; - display: flex; - align-items: center; - gap: 3px; + font-size: 0.8em !important; + padding: 2px 6px !important; + border-radius: 4px !important; + display: flex !important; + align-items: center !important; + gap: 3px !important; + text-decoration: none !important; } .kundenkarte-tree-file-images { - background: #e3f2fd; - color: #1976d2; + background: #2a5a8a !important; + color: #ddd !important; } .kundenkarte-tree-file-docs { - background: #fff3e0; - color: #f57c00; + background: #8a5a2a !important; + color: #ddd !important; } /* ======================================== - HOVER TOOLTIP + TOOLTIP ======================================== */ .kundenkarte-tooltip { - position: absolute; - z-index: 1000; - background: #fff; - border: 1px solid #ccc; - border-radius: 6px; - box-shadow: 0 4px 12px rgba(0,0,0,0.15); - padding: 15px; - min-width: 300px; - max-width: 450px; - display: none; + position: absolute !important; + z-index: 1000 !important; + background: #1e1e1e !important; + border: 1px solid #555 !important; + border-radius: 6px !important; + box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important; + padding: 15px !important; + min-width: 300px !important; + max-width: 450px !important; + display: none !important; } .kundenkarte-tooltip.visible { - display: block; + display: block !important; } .kundenkarte-tooltip-header { - display: flex; - align-items: center; - margin-bottom: 10px; - padding-bottom: 10px; - border-bottom: 1px solid #eee; + display: flex !important; + align-items: center !important; + margin-bottom: 10px !important; + padding-bottom: 10px !important; + border-bottom: 1px solid #444 !important; } .kundenkarte-tooltip-icon { - font-size: 24px; - margin-right: 12px; + font-size: 24px !important; + margin-right: 12px !important; + color: #aaa !important; } .kundenkarte-tooltip-title { - font-weight: 600; - font-size: 1.1em; + font-weight: 600 !important; + font-size: 1.1em !important; + color: #e0e0e0 !important; } .kundenkarte-tooltip-type { - color: #888; - font-size: 0.9em; + color: #999 !important; + font-size: 0.9em !important; } .kundenkarte-tooltip-fields { - display: grid; - grid-template-columns: auto 1fr; - gap: 6px 12px; - font-size: 0.95em; + display: grid !important; + grid-template-columns: auto 1fr !important; + gap: 6px 12px !important; + font-size: 0.95em !important; } .kundenkarte-tooltip-field-label { - color: #666; - font-weight: 500; + color: #aaa !important; + font-weight: 500 !important; } .kundenkarte-tooltip-field-value { - color: #333; + color: #e0e0e0 !important; } -.kundenkarte-tooltip-images { - display: flex; - gap: 8px; - margin-top: 12px; - padding-top: 12px; - border-top: 1px solid #eee; - overflow-x: auto; -} - -.kundenkarte-tooltip-thumb { - width: 60px; - height: 60px; - object-fit: cover; - border-radius: 4px; - border: 1px solid #ddd; +.kundenkarte-tooltip-field-header { + grid-column: 1 / -1 !important; + font-weight: bold !important; + margin-top: 8px !important; + padding-top: 8px !important; + border-top: 1px solid #444 !important; + color: #aaa !important; } /* ======================================== @@ -281,259 +220,250 @@ ======================================== */ .kundenkarte-system-tabs-wrapper { - display: flex; - justify-content: space-between; - align-items: flex-start; - margin-bottom: 15px; - padding-bottom: 10px; - border-bottom: 2px solid #e0e0e0; + display: flex !important; + justify-content: space-between !important; + align-items: center !important; + margin-bottom: 15px !important; + padding-bottom: 10px !important; + border-bottom: 2px solid #444 !important; + flex-wrap: wrap !important; + gap: 10px !important; } .kundenkarte-system-tabs { - display: flex; - flex-wrap: wrap; - gap: 5px; - flex: 1; - align-items: center; + display: flex !important; + flex-wrap: wrap !important; + gap: 5px !important; + flex: 1 !important; + align-items: center !important; } .kundenkarte-tree-controls { - display: flex; - gap: 5px; - flex-shrink: 0; + display: flex !important; + gap: 5px !important; + flex-shrink: 0 !important; + align-items: center !important; } -.kundenkarte-tree-controls .button { - padding: 4px 10px; - font-size: 0.85em; +/* Button in system tabs row */ +.kundenkarte-system-tabs > button.button, +.kundenkarte-system-tabs > .button { + align-self: center !important; + margin-top: 0 !important; + margin-bottom: 0 !important; + vertical-align: middle !important; } .kundenkarte-system-tab { - padding: 8px 16px; - border: 1px solid #ddd; - border-radius: 4px 4px 0 0; - background: #f5f5f5; - cursor: pointer; - display: flex; - align-items: center; - gap: 8px; - transition: all 0.2s; + padding: 8px 16px !important; + border: 1px solid #555 !important; + border-radius: 4px 4px 0 0 !important; + background: #333 !important; + cursor: pointer !important; + display: flex !important; + align-items: center !important; + gap: 8px !important; + color: #ccc !important; } .kundenkarte-system-tab:hover { - background: #e8e8e8; + background: #3a3a3a !important; } .kundenkarte-system-tab.active { - background: #fff; - border-bottom-color: #fff; - margin-bottom: -2px; - padding-bottom: 10px; + background: #2d2d2d !important; + border-bottom-color: #2d2d2d !important; + margin-bottom: -2px !important; + padding-bottom: 10px !important; + color: #fff !important; } .kundenkarte-system-tab-icon { - font-size: 16px; -} - -.kundenkarte-system-tab-add { - background: transparent; - border-style: dashed; - color: #888; -} - -.kundenkarte-system-tab-add:hover { - background: #f0f0f0; - color: #333; + font-size: 16px !important; } /* ======================================== - FAVORITE PRODUCTS + BUTTONS - Dark Mode style ======================================== */ -.kundenkarte-favorites { - margin-top: 10px; +.kundenkarte-tree-controls .button, +.kundenkarte-tree-controls .button.small, +.kundenkarte-tree-controls a.button, +.kundenkarte-system-tabs .button, +.kundenkarte-system-tabs .button.small, +.kundenkarte-system-tabs button.button, +.kundenkarte-add-system-form .button, +.kundenkarte-add-system-form .button.small, +.kundenkarte-add-system-form button.button { + background: #444 !important; + background-image: linear-gradient(to bottom, #555 0%, #333 100%) !important; + border: 1px solid #666 !important; + border-radius: 3px !important; + color: #e0e0e0 !important; + cursor: pointer !important; + padding: 6px 12px !important; + font-size: 0.85em !important; + text-decoration: none !important; + display: inline-flex !important; + align-items: center !important; + gap: 5px !important; + height: auto !important; + line-height: 1.4 !important; + box-sizing: border-box !important; } +.kundenkarte-tree-controls .button:hover, +.kundenkarte-tree-controls a.button:hover, +.kundenkarte-system-tabs .button:hover, +.kundenkarte-system-tabs button.button:hover, +.kundenkarte-add-system-form .button:hover, +.kundenkarte-add-system-form button.button:hover { + background: #555 !important; + background-image: linear-gradient(to bottom, #666 0%, #444 100%) !important; + border-color: #777 !important; +} + +/* Add system form */ +.kundenkarte-add-system-form { + background: #2d2d2d !important; + border: 1px solid #444 !important; + padding: 12px 15px !important; + border-radius: 6px !important; + color: #e0e0e0 !important; +} + +.kundenkarte-add-system-form select.flat { + background: #333 !important; + border: 1px solid #555 !important; + color: #e0e0e0 !important; + padding: 5px 10px !important; + border-radius: 3px !important; +} + + +/* ======================================== + FAVORITES + ======================================== */ + .kundenkarte-favorites-add { - display: flex; - gap: 10px; - margin-bottom: 20px; - padding: 15px; - background: #f9f9f9; - border-radius: 6px; -} - -.kundenkarte-favorites-add .product-search { - flex: 1; -} - -.kundenkarte-favorites-table { - width: 100%; + display: flex !important; + gap: 10px !important; + margin-bottom: 20px !important; + padding: 15px !important; + background: #2d2d2d !important; + border: 1px solid #444 !important; + border-radius: 6px !important; } .kundenkarte-favorites-table th { - text-align: left; - padding: 10px; - background: #f5f5f5; - border-bottom: 2px solid #ddd; + text-align: left !important; + padding: 10px !important; + background: #333 !important; + color: #e0e0e0 !important; + border-bottom: 2px solid #555 !important; } .kundenkarte-favorites-table td { - padding: 10px; - border-bottom: 1px solid #eee; - vertical-align: middle; -} - -.kundenkarte-favorites-table tr:hover { - background: #f9f9f9; -} - -.kundenkarte-favorites-qty { - width: 80px; - text-align: center; + padding: 10px !important; + border-bottom: 1px solid #444 !important; + vertical-align: middle !important; } .kundenkarte-favorites-actions { - margin-top: 20px; - padding-top: 15px; - border-top: 1px solid #ddd; - display: flex; - justify-content: space-between; - align-items: center; + margin-top: 20px !important; + padding-top: 15px !important; + border-top: 1px solid #444 !important; + display: flex !important; + justify-content: space-between !important; + align-items: center !important; } -/* ======================================== - ELEMENT FORM - ======================================== */ - -.kundenkarte-element-form { - max-width: 800px; -} - -.kundenkarte-element-form .field-row { - margin-bottom: 15px; -} - -.kundenkarte-element-form label { - display: block; - margin-bottom: 5px; - font-weight: 500; -} - -.kundenkarte-element-form .required::after { - content: ' *'; - color: #e74c3c; +.kundenkarte-favorites-add .button { + background: #444 !important; + background-image: linear-gradient(to bottom, #555 0%, #333 100%) !important; + border: 1px solid #666 !important; + border-radius: 3px !important; + color: #e0e0e0 !important; + padding: 6px 12px !important; } /* ======================================== FILE GALLERY ======================================== */ -.kundenkarte-files { - margin-top: 20px; -} - .kundenkarte-files-grid { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); - gap: 15px; - margin-top: 15px; + display: grid !important; + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; + gap: 15px !important; + margin-top: 15px !important; } .kundenkarte-file-item { - border: 1px solid #ddd; - border-radius: 6px; - overflow: hidden; - background: #fff; + border: 1px solid #444 !important; + border-radius: 6px !important; + overflow: hidden !important; + background: #2d2d2d !important; } .kundenkarte-file-preview { - height: 140px; - display: flex; - align-items: center; - justify-content: center; - background: #f5f5f5; - overflow: hidden; + height: 140px !important; + display: flex !important; + align-items: center !important; + justify-content: center !important; + background: #1e1e1e !important; + overflow: hidden !important; } .kundenkarte-file-preview img { - max-width: 100%; - max-height: 100%; - object-fit: contain; -} - -.kundenkarte-file-preview embed { - width: 100%; - height: 100%; - border: none; -} - -.kundenkarte-file-preview .fa { - font-size: 48px; - color: #999; + max-width: 100% !important; + max-height: 100% !important; + object-fit: contain !important; } .kundenkarte-file-info { - padding: 10px; - font-size: 0.9em; + padding: 10px !important; + font-size: 0.9em !important; } .kundenkarte-file-name { - font-weight: 500; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + font-weight: 500 !important; + overflow: hidden !important; + text-overflow: ellipsis !important; + white-space: nowrap !important; + color: #e0e0e0 !important; } .kundenkarte-file-size { - color: #888; - font-size: 0.85em; + color: #999 !important; + font-size: 0.85em !important; } .kundenkarte-file-actions { - display: flex; - gap: 5px; - margin-top: 8px; - justify-content: center; + display: flex !important; + gap: 5px !important; + margin-top: 8px !important; + justify-content: center !important; } .kundenkarte-file-btn { - display: inline-flex; - align-items: center; - justify-content: center; - width: 28px; - height: 28px; - border-radius: 4px; - background: #f0f0f0; - color: #555; - text-decoration: none; - transition: all 0.2s; - font-size: 14px; + display: inline-flex !important; + align-items: center !important; + justify-content: center !important; + width: 28px !important; + height: 28px !important; + border-radius: 4px !important; + background: #444 !important; + color: #e0e0e0 !important; + text-decoration: none !important; } .kundenkarte-file-btn:hover { - background: #2196f3; - color: #fff; -} - -.kundenkarte-file-btn-delete { - color: #c00; + background: #555 !important; + color: #fff !important; } .kundenkarte-file-btn-delete:hover { - background: #c00; - color: #fff; -} - -.kundenkarte-file-cover { - position: absolute; - top: 5px; - right: 5px; - background: #4caf50; - color: #fff; - padding: 2px 6px; - border-radius: 3px; - font-size: 0.75em; + background: #a33 !important; } /* ======================================== @@ -541,292 +471,157 @@ ======================================== */ .kundenkarte-modal { - display: none; - position: fixed; - z-index: 10000; - left: 0; - top: 0; - width: 100%; - height: 100%; - background-color: rgba(0,0,0,0.5); - align-items: center; - justify-content: center; + display: none !important; + position: fixed !important; + z-index: 10000 !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + background-color: rgba(0,0,0,0.7) !important; + align-items: center !important; + justify-content: center !important; } .kundenkarte-modal.visible { - display: flex; + display: flex !important; } .kundenkarte-modal-content { - background-color: #fff; - border-radius: 8px; - box-shadow: 0 8px 32px rgba(0,0,0,0.3); - max-width: 600px; - width: 90%; - max-height: 80vh; - display: flex; - flex-direction: column; + background-color: #1e1e1e !important; + border-radius: 8px !important; + box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important; + max-width: 600px !important; + width: 90% !important; + max-height: 80vh !important; + display: flex !important; + flex-direction: column !important; } .kundenkarte-modal-header { - display: flex; - justify-content: space-between; - align-items: center; - padding: 15px 20px; - border-bottom: 1px solid #e0e0e0; + display: flex !important; + justify-content: space-between !important; + align-items: center !important; + padding: 15px 20px !important; + border-bottom: 2px solid #444 !important; + background: #2d2d2d !important; } .kundenkarte-modal-header h3 { - margin: 0; - font-size: 1.2em; + margin: 0 !important; + color: #e0e0e0 !important; } .kundenkarte-modal-close { - font-size: 28px; - font-weight: bold; - color: #888; - cursor: pointer; - line-height: 1; -} - -.kundenkarte-modal-close:hover { - color: #333; + font-size: 28px !important; + color: #aaa !important; + cursor: pointer !important; } .kundenkarte-modal-body { - padding: 20px; - overflow-y: auto; + padding: 20px !important; + overflow-y: auto !important; } .kundenkarte-icon-grid { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); - gap: 8px; - max-height: 400px; - overflow-y: auto; + display: grid !important; + grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)) !important; + gap: 8px !important; + max-height: 400px !important; + overflow-y: auto !important; } .kundenkarte-icon-item { - width: 50px; - height: 50px; - display: flex; - align-items: center; - justify-content: center; - border: 1px solid #e0e0e0; - border-radius: 6px; - cursor: pointer; - transition: all 0.2s; - font-size: 20px; - color: #555; + width: 50px !important; + height: 50px !important; + display: flex !important; + align-items: center !important; + justify-content: center !important; + border: 1px solid #444 !important; + border-radius: 6px !important; + cursor: pointer !important; + font-size: 20px !important; + color: #aaa !important; + background: #2d2d2d !important; } .kundenkarte-icon-item:hover { - background: #e3f2fd; - border-color: #2196f3; - color: #2196f3; - transform: scale(1.1); -} - -.kundenkarte-icon-item:hover .kundenkarte-icon-delete { - display: block !important; -} - -.kundenkarte-icon-delete:hover { - background: #900 !important; -} - -/* Icon picker button in forms */ -.kundenkarte-icon-picker-wrapper { - display: flex; - align-items: center; - gap: 10px; -} - -.kundenkarte-icon-picker-wrapper input { - flex: 1; -} - -.kundenkarte-icon-picker-btn { - padding: 5px 12px; - border: 1px solid #ccc; - border-radius: 4px; - background: #f5f5f5; - cursor: pointer; - display: flex; - align-items: center; - gap: 5px; -} - -.kundenkarte-icon-picker-btn:hover { - background: #e8e8e8; -} - -.kundenkarte-icon-preview { - width: 30px; - height: 30px; - display: flex; - align-items: center; - justify-content: center; - border: 1px solid #ddd; - border-radius: 4px; - background: #fff; - font-size: 16px; + background: #444 !important; + border-color: #666 !important; + color: #fff !important; } /* ======================================== - TAG SELECTOR (Admin) - ======================================== */ - -.kundenkarte-selected-items { - display: flex; - flex-wrap: wrap; - gap: 8px; - min-height: 30px; -} - -.kundenkarte-tag { - display: inline-flex; - align-items: center; - gap: 6px; - padding: 4px 10px; - background: #e3f2fd; - border: 1px solid #90caf9; - border-radius: 16px; - font-size: 0.9em; - color: #1565c0; -} - -.kundenkarte-tag-remove { - cursor: pointer; - font-weight: bold; - font-size: 1.2em; - line-height: 1; - color: #1976d2; - margin-left: 2px; -} - -.kundenkarte-tag-remove:hover { - color: #c62828; -} - -/* ======================================== - IMAGES POPUP - ======================================== */ - -.kundenkarte-images-popup { - padding: 5px; -} - -.kundenkarte-images-grid { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); - gap: 8px; - max-width: 350px; -} - -.kundenkarte-images-thumb { - display: block; - width: 80px; - height: 80px; - border-radius: 4px; - overflow: hidden; - border: 1px solid #ddd; - transition: transform 0.2s, box-shadow 0.2s; -} - -.kundenkarte-images-thumb:hover { - transform: scale(1.05); - box-shadow: 0 2px 8px rgba(0,0,0,0.2); - border-color: #2196f3; -} - -.kundenkarte-images-thumb img { - width: 100%; - height: 100%; - object-fit: cover; -} - -/* ======================================== - DOCUMENTS POPUP - Visual cards with icons - ======================================== */ - -.kundenkarte-docs-popup { - padding: 5px; -} - -.kundenkarte-docs-grid { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); - gap: 8px; - max-width: 350px; -} - -.kundenkarte-docs-card { - display: flex; - flex-direction: column; - align-items: center; - padding: 10px 5px; - border-radius: 6px; - border: 1px solid #e0e0e0; - background: #f9f9f9; - text-decoration: none; - transition: all 0.2s ease; - width: 80px; -} - -.kundenkarte-docs-card:hover { - transform: scale(1.05); - box-shadow: 0 2px 8px rgba(0,0,0,0.15); - border-color: #2196f3; - background: #fff; -} - -.kundenkarte-docs-card-icon { - font-size: 36px; - margin-bottom: 6px; -} - -.kundenkarte-docs-card-name { - font-size: 0.75em; - color: #333; - text-align: center; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - max-width: 70px; -} - -/* Tree icon clickable */ -.kundenkarte-tree-icon.kundenkarte-tooltip-trigger { - cursor: help; -} - -/* File badges as links */ -a.kundenkarte-tree-file-badge { - text-decoration: none; - cursor: pointer; -} - -a.kundenkarte-tree-file-badge:hover { - transform: scale(1.1); -} - -/* ======================================== - PDF PREVIEW (smaller, no toolbar) + PDF PREVIEW ======================================== */ .kundenkarte-pdf-preview-wrapper { - width: 100%; - height: 100%; - overflow: hidden; - position: relative; + width: 100% !important; + height: 100% !important; + overflow: hidden !important; + position: relative !important; } .kundenkarte-pdf-preview-frame { - width: 200%; - height: 200%; - border: none; - transform: scale(0.5); - transform-origin: top left; - pointer-events: none; + width: 200% !important; + height: 200% !important; + border: none !important; + transform: scale(0.5) !important; + transform-origin: top left !important; + pointer-events: none !important; +} + +/* ======================================== + IMAGES/DOCS POPUP + ======================================== */ + +.kundenkarte-images-grid, +.kundenkarte-docs-grid { + display: grid !important; + grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important; + gap: 8px !important; + max-width: 350px !important; +} + +.kundenkarte-images-thumb { + display: block !important; + width: 80px !important; + height: 80px !important; + border-radius: 4px !important; + overflow: hidden !important; + border: 2px solid #444 !important; +} + +.kundenkarte-images-thumb img { + width: 100% !important; + height: 100% !important; + object-fit: cover !important; +} + +.kundenkarte-docs-card { + display: flex !important; + flex-direction: column !important; + align-items: center !important; + padding: 10px 5px !important; + border-radius: 6px !important; + border: 1px solid #444 !important; + background: #2d2d2d !important; + text-decoration: none !important; + width: 80px !important; +} + +.kundenkarte-docs-card-icon { + font-size: 36px !important; + margin-bottom: 6px !important; + color: #aaa !important; +} + +.kundenkarte-docs-card-name { + font-size: 0.75em !important; + color: #e0e0e0 !important; + text-align: center !important; + overflow: hidden !important; + text-overflow: ellipsis !important; + white-space: nowrap !important; + max-width: 70px !important; } diff --git a/js/kundenkarte.js b/js/kundenkarte.js index 98d821d..3deb50b 100755 --- a/js/kundenkarte.js +++ b/js/kundenkarte.js @@ -381,9 +381,9 @@ for (var key in data.fields) { if (data.fields.hasOwnProperty(key)) { var field = data.fields[key]; - // Handle header fields as section titles + // Handle header fields as section titles (must span both grid columns) if (field.type === 'header') { - html += '' + this.escapeHtml(field.label) + ''; + html += '' + this.escapeHtml(field.label) + ''; } else if (field.value) { html += '' + this.escapeHtml(field.label) + ':'; html += '' + this.escapeHtml(field.value) + ''; diff --git a/sql/llx_kundenkarte_anlage_contact.sql b/sql/llx_kundenkarte_anlage_contact.sql old mode 100644 new mode 100755 diff --git a/sql/llx_kundenkarte_favorite_products_contact.sql b/sql/llx_kundenkarte_favorite_products_contact.sql old mode 100644 new mode 100755 diff --git a/sql/llx_kundenkarte_societe_system_contact.sql b/sql/llx_kundenkarte_societe_system_contact.sql old mode 100644 new mode 100755 diff --git a/tabs/anlagen.php b/tabs/anlagen.php index c273ac6..96cff0c 100755 --- a/tabs/anlagen.php +++ b/tabs/anlagen.php @@ -286,8 +286,10 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && $permissiontodelete) * View */ +// Use Dolibarr standard button classes + $title = $langs->trans('TechnicalInstallations').' - '.$object->name; -llxHeader('', $title, '', '', 0, 0, array('/kundenkarte/js/kundenkarte.js'), array('/kundenkarte/css/kundenkarte.css')); +llxHeader('', $title, '', '', 0, 0, array('/kundenkarte/js/kundenkarte.js?v=1769963241'), array('/kundenkarte/css/kundenkarte.css?v=1769964233')); // Prepare tabs $head = societe_prepare_head($object); @@ -364,7 +366,7 @@ if ($permissiontoadd) { // Get systems not yet enabled for this customer $availableSystems = array_diff_key($allSystems, $customerSystems); if (!empty($availableSystems)) { - print ''; } @@ -394,7 +396,7 @@ print '
'; // End kundenkarte-system-tabs-wrapper // Add system form (hidden by default) if ($permissiontoadd && !empty($availableSystems)) { - print ''; // End kundenkarte-system-tabs-wrapper // Add system form (hidden by default) if ($permissiontoadd && !empty($availableSystems)) { - print ''; if ($permissiontoadd) { - print ''; } diff --git a/tabs/favoriteproducts.php b/tabs/favoriteproducts.php index 07ced6a..f807ee9 100755 --- a/tabs/favoriteproducts.php +++ b/tabs/favoriteproducts.php @@ -99,11 +99,11 @@ if ($action == 'delete' && $permissiontodelete) { if ($action == 'updateqty' && $permissiontoadd) { $favid = GETPOSTINT('favid'); - $qty = GETPOSTFLOAT('qty'); + $qty = GETPOST('qty', 'alpha'); - if ($favid > 0 && $qty > 0) { + if ($favid > 0 && is_numeric($qty)) { $favoriteProduct->fetch($favid); - $favoriteProduct->qty = $qty; + $favoriteProduct->qty = (float) $qty; $result = $favoriteProduct->update($user); } header('Location: '.$_SERVER['PHP_SELF'].'?id='.$id); @@ -150,8 +150,10 @@ if ($action == 'confirm_generateorder' && $confirm == 'yes' && $permissiontoadd) * View */ +// Use Dolibarr standard button classes + $title = $langs->trans('FavoriteProducts').' - '.$object->name; -llxHeader('', $title); +llxHeader('', $title, '', '', 0, 0, array('/kundenkarte/js/kundenkarte.js?v=1769963241'), array('/kundenkarte/css/kundenkarte.css?v=1769964233')); // Fetch favorites $favorites = $favoriteProduct->fetchAllBySociete($id); @@ -197,7 +199,7 @@ if ($permissiontoadd) { print '
'; print ''; - print ''; + print ''; print ''; print '
'; @@ -281,7 +283,7 @@ if (is_array($favorites) && count($favorites) > 0) { print ''; print '
'; print ''; - print ''; + print ''; print '
'; print ''; @@ -322,7 +324,7 @@ if (is_array($favorites) && count($favorites) > 0) { print ''; if ($permissiontoadd) { - print ''; }