Modernization of the Data Entry Interface#645
Merged
Conversation
Improve fdt.php: The Validate() JS now clones parent CSS into the validation popup, applies modern styling, shows clearer error/info output (including a FontAwesome success icon), and renders the FDT table consistently. Added handling/validation for TAB field type and extended checks for picklists, input types, rows, subfield counts, and other edge cases. Minor HTML/JS/PHP cleanups (self-closing tags, variable spacing) and UI tweaks (preloader markup, grid includes).
Introduce a new SUBFIELDS_INLINE configuration option (Y/N) in the database settings form and add corresponding language entries. Updates: adds radio field in editar_abcd_def.php to let admins choose whether group subfields are displayed inline or in a popup, and adds related labels and tooltip strings (ft_tab, set_SUBFIELDS_INLINE, set_TIP_SUBFIELDS_INLINE) in dbadmin.tab.
Press the UI button to expand the record editing area. As it is not possible to click any buttons on the toolbar whilst editing is active, there is no point in displaying it. This action adds a button to hide/show the toolbar. It also automatically hides the toolbar during editing, providing the cataloguer with more screen space.
Introduce a new editor module and refactor data entry rendering to use renderer/helper classes. Added editor/ loader, helpers (CalendarHelper, ConfigHelper, SubfieldHelper), multiple renderers (Check, Group, HtmlArea, Repeatable, Select, Tab, Table, Text), a small JS helper, and README. Updated dibujarhojaentrada.php to require the editor loader and replace large procedural rendering functions with calls to the new helpers/renderers (CalendarHelper::render, HtmlAreaRenderer::render, SubfieldHelper::extract/decode, RepeatableRenderer::render, SelectRenderer::..., TableRenderer::render, CheckRenderer::render, TextRenderer::render, etc.). Also updated scripts_dataentry.php permissions/mode change. Purpose: modularize and encapsulate field rendering logic for improved maintainability and extensibility.
Introduce inc_wait.php, a reusable include that renders a hidden loading spinner (Font Awesome: fas fa-circle-notch fa-spin) for the ABCD application. The file contains header metadata and simple markup for a #preloader element; include it where needed and toggle the #preloader display via JavaScript to show or hide the spinner during background operations.
Remove the embedded <style> block for the loading overlay (#loading and #loading-image) from www/htdocs/central/common/header.php, and clean up/normalize indentation and spacing in the client IP check block. The PHP logic remains unchanged; this is primarily a style removal and formatting cleanup.
Remove hardcoded preloader <img> and use ../common/inc_wait.php to reuse the shared waiting indicator. Also trim a stray trailing space after headCSS in the report window generation. No behavioral changes intended aside from using the centralized wait component.
Unify and simplify page loading UI: add a script in the footer to hide the shared #preloader, remove a duplicate preloader hide call from fdt.php, and update menu_modificardb.php to show #preloader when actions are triggered. menu_modificardb.php now includes ../common/inc_wait.php (shared preloader markup), removes the old #loading element, and updates the Update() JS to toggle the preloader. Also includes markup/formatting cleanup and minor reflow of HTML/PHP blocks to keep the UI consistent and reduce duplicated code.
Add www/htdocs/assets/js/main.js containing global scripts to hide the preloader on window load and a robust CambiarLenguaje() function that updates the URL via URL.searchParams (with element existence fail-safes). Replace inline preloader script in www/htdocs/central/common/footer.php with a <script src="/assets/js/main.js"></script> include and remove the old inline CambiarLenguaje implementation. Also minor comment wording adjusted when checking session/login. This centralizes client-side behavior, prevents errors on pages without the preloader/language selector, and makes language switching cleaner.
Refine form layout and tab UI code: update table cell padding to horizontal-only, reduce label column width from 300px to 250px, and comment out the explicit input border in CSS for a cleaner look (www/htdocs/assets/css/main.css). In the dataentry renderer (www/htdocs/central/dataentry/dibujarhojaentrada.php) translate/clarify comments to English, scope hiding of the '+' action button behind ConfigHelper::isInlineSubfieldsEnabled(), tweak header right margin for visual alignment, and clean up PHP tag/whitespace. These changes improve form alignment and ensure the '+' button is only hidden when inline subfields are enabled.
Replace htmlspecialchars for tab titles with a simple encoding-agnostic str_replace to escape quotes and angle brackets, avoiding empty strings with ISO-8859-1 encodings. Applied to www/htdocs/central/dataentry/dibujarhojaentrada.php and www/htdocs/central/dataentry/editor/renderers/TabRenderer.php. Also updated some inline comments/translation and minor formatting; tab rendering logic and structure remain unchanged.
Commented out several stripslashes() calls across dataentry scripts (actualizarregistro.php, default_update.php, fmt.php) to avoid unwanted un-escaping. In fmt.php also refactored the zero-result branch: set Opcion to "ninguna", render the search form block with safer HTML output using htmlspecialchars() for the expression and result (reducing XSS risk), normalize result checks (string or int), and tidy footer inclusion logic. These changes improve compatibility and output safety when handling submitted expressions and tag values.
Remove the hard-coded '(Modo Inline)' and '(Modo Tabela)' span labels from GroupRenderer and TableRenderer headers to declutter the UI and avoid displaying static mode indicators. Updated files: GroupRenderer.php, TableRenderer.php.
Introduce a full tooltip implementation for the help tab (a.tooltip): hidden balloon span with styling, arrow (::after), hover visibility/opacity transitions, box-shadow, and icon hover color. Also adjust .table-fdt-four input/textarea max-width from calc(100% - 150px) to calc(100% - 80px) to allow wider form fields.
Cleanup and reformat dirs_explorer.php: normalize spacing, variable initialization, and string concatenation; tidy permission checks and path construction. Ensure directory creation uses recursive mkdir and validate root path with is_dir. Move UI markup into .formContent and keep form hidden fields generation. Rework JavaScript in Encabezamiento(): CopiarImagen now handles textarea (appends with newline) vs input (replaces and closes window), MostrarImagen now opens ../common/show_image.php, and other client-side helpers simplified. Also reorganized icon types setup and related settings. Mostly stylistic and small behavioral improvements to file selection/preview logic.
Introduce a new UploadRenderer to centralize rendering of FDT type U fields with a drag-and-drop modal, progress UI and localized strings. Hook UploadRenderer into loader.php and replace inline upload UI in TableRenderer, TextRenderer and editarocurrencias.js to call the new renderer/functions. Update scripts_dataentry.php to open upload/select windows with explicit query params (base/storein), and modernize SelectArchivo/EnviarArchivo usage. Extend upload_img.php to handle batch AJAX uploads and return JSON filenames while preserving legacy single-window behavior. Minor fix in dirs_explorer and language additions for new upload UI strings.
Normalize encoding-related entries in Spanish and Portuguese admin.tab files for both Linux and Windows examples (fix malformed accented characters). Add new upload UI strings (drag_drop, click_browse, or_drag, files_here, sending, error_upload, error_server, upload_success) for Spanish/Portuguese and add hide_top_bar/show_top_bar keys to Portuguese files. Changes applied to www/bases-examples_{Linux,Windows}/lang/{es,pt}/admin.tab.
Tweak UI/layout behavior for data entry pages: reduce .abcd-tab-btn padding to 10px (remove extra horizontal padding), add JS in PrepararFormato() to hide the Expand/Collapse button (searching by ID or class), and mark the form as having tabs. In inicio_main.php, toggle iframeHeader along with iframeMenu when collapsing/expanding and simplify the main iframe height calculation by removing the redundant headerHeight subtraction so iframeMain height is computed from Todobody minus currentMenuHeight.
Add support for a MARC Indicator field type in the dbadmin FDT: introduce field_type["IND"] in fdt_include.php and add the corresponding localization key ft_ind to the English dbadmin.tab. This enables handling and display of MARC indicators in data entry definitions.
Treat 'IND' cell type as an indicator in FDT validation: allow IND in the list of types that don't require a tag, consider IND a valid parent for subfields, and permit IND to continue loops without incrementing the subfield count. Also update the printed window title from Portuguese to English ("Validation Report") and remove a trailing blank line at EOF. These changes enable proper validation and reporting for indicator fields.
Change UploadRenderer::injectAssets from private to public to allow external code to trigger asset injection. No functional changes to the method body; the single-injection guard (self::$assetsInjected) remains intact. Affects www/htdocs/central/dataentry/editor/renderers/UploadRenderer.php.
Add native support for FDT 'IND' lines and treat them alongside 'S' subfield defs; read IND/S blocks from global FDT or local vars. Mark subfield defs with an is_ind flag, emit data-is-ind attributes in inline inputs, and parse/store indicator values separately so inline rendering builds MARC21-compliant strings (indicators + subfields). Improve extraction logic, sanitize formatting, add upload/explore controls for 'U' types and ensure unique IDs for cloned rows, and update JS to include indicators when composing the hidden tag value.
Prevent undefined index notices by checking that $arrHttp['Opcion'] is set before comparing it to 'ver'. Ensures institutional_info.php is only included when 'encabezado' is present and 'Opcion' equals 'ver'.
Refactor plantilladeingreso.php to be compatible with PHP 8.2 and improve readability. Trim/normalize values, adjust spacing, and harden checks to avoid undefined index/deprecation issues. Change FDT inheritance logic so inherited blocks skip standalone subfields (types 'S' and 'IND') and refine matching between base and current FDT lines. Also fix leader.fdt lookup and loading, and simplify variable handling and control flow for clarity.
Consolidate the display of the database name, charset and MAXMFN and centralize error/warning handling into a single, styled HTML block for improved readability and maintainability.
Several UI and behavior fixes across the dataentry editor: - dibujarhojaentrada.php: In PrepararFormato(), skip field defs whose type is 'S' or 'IND' so indicator-only lines are not processed for rendering. - GroupRenderer.php: Minor table/CSS tweaks — add border-collapse, adjust zebra-row background color, apply consistent bottom borders to cells (including row number and content cells), and clean up row HTML. Also update the client-side renumbering routine to re-apply zebra background when rows are added/removed. - UploadRenderer.php: After inserting uploaded filenames into the target input/textarea, dispatch a 'change' event so any listeners react to the new value (fixes downstream update issues). These changes improve visual consistency and ensure proper handling of indicator fields and upload-driven updates.
Modify CSS and FDT script to correct column sizing and UX for FDT files. - www/htdocs/assets/css/main.css: force box-sizing: content-box !important for td, set monospace font and add comments to ensure padding grows outward so FDT column widths match exact character counts (ensuring 14 columns fit 14 chars). - www/htdocs/central/dbadmin/fdt.php: normalize echoed FDT flags with semicolons, add isFDT detection based on file extension, and when editing an FDT hide grid column 20 (with an alternative commented block that would disable and gray the cells and prevent checks). This improves layout accuracy and hides an irrelevant column for FDTs.
Refactor autoincrement handling to prevent race conditions by using an exclusive flock() on the control_number.cn file. If the file is missing it is initialized to 0, then opened in c+ mode, the current value is read, incremented, backed up (control_number.bak), truncated and overwritten atomically, and the lock released. Preserves optional zero-padding via max_cn_length and returns false on lock failure.
Add 'bt bt-red' CSS classes to the close input in www/htdocs/central/dataentry/show.php to apply consistent button styling.
Set $lang from $_SESSION["lang"] in loan_objects_add.php and add it to the global list used by Print_page. This ensures the language selection is available when rendering the page (e.g. header/lang includes). Also includes minor whitespace/formatting adjustments around the includes.
Initialize and normalize control_number.cn (create with 0 if missing, treat empty as 0), compute next control number and apply leading-zero padding when max_inventory_length is configured. Add a styled UI widget with an autofill button that inserts the next padded inventory number into tag30 and triggers CheckInventory(). Also update language file to include the new 'autofill' label. Improves UX and ensures consistent inventory numbering.
Replace legacy image icons with fontawesome-styled action buttons (view/edit/delete) in copies_edit_browse.php, reorganize action cell markup and labels for clarity and accessibility. Clean up PHP/JS formatting and indentation, consolidate and reformat JS functions (Validar, EnviarForma, picklist helpers), and tidy HTML structure and form layout in copies_edit_read.php. Minor refactor and whitespace fixes in LeerFdt and other sections for readability; no behavioral logic changes beyond UI/markup improvements.
Revise FDT table styling and update template markup to enforce a tighter, non-wrapping layout. CSS was refactored to target td-based column classes (td.table-fdt-one/two/three/four), set explicit widths with !important, collapse spacing and ensure the white background stretches across the table. The PHP template (dibujarhojaentrada.php) was updated to apply the new td classes and inline styles for the title and input cells, to emit a wrapped inner table with no borders, and to adjust label/input cell markup so buttons and inputs don't break or wrap. These changes improve alignment and prevent layout regressions in the data-entry form.
Major refactor of menu_main.php: replace the previous dhtmlX/dhtmlXToolbar implementation with a standard HTML/CSS toolbar using FontAwesome icons and responsive styles. Reorganized header and docblock, tightened session handling (call die after redirect), adjusted includes and language handling, and improved database selection fallback logic. Safer file handling: check for .fst, tesaurus and def files before reading and store FST lines in an array. Formats and worksheets are now read into arrays with fallbacks for language paths. Inline JS functions were modernized and simplified (FocoEn, GenerarDespliegue, GenerarWks, Diccionario, AbrirAyuda, EditarFormato, etc.), and CSS rules added to keep iframe/toolbar height stable and responsive. Functional behavior and permission checks are preserved while improving readability and maintainability.
Avoid returning early for all options when the DB is locked by allowing the 'home' and 'administrar' options to proceed (prevents those pages from crashing). Also adjust the default savedMenuHeight from 77 to 95 to better match actual menu content and avoid layout issues.
In dibujarhojaentrada.php, skip generating TAB and H/L header/accordion UI elements when in read-only mode (arrHttp["ver"] == "S") so the view-only (ALL) display doesn't produce interactive controls. Also insert a dashed horizontal separator into repeating field values when rendering the ALL view to visually separate entries. Minor cleanup: adjusted valortag handling and updated inline comments to English.
Add server-side detection for def/.../typeofrecord.tab and set a $typeofrecord flag when the file exists. Pass the flag to the client by setting top.typeofrecord in the load handler so the UI can react to the presence of typeofrecord definitions. Also adjust a JS comment to English and ensure the main frame synchronization logic remains unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The modernization of the Data Entry (Cataloging) interface in ABCD has been successfully completed, moving away from the monolithic architecture and legacy dependencies of the user interface in favor of a modern, high-performance, and easily maintainable architecture.
Key Refactorings:
dhtmlXlibrary, a heavy and rigid dependency that relied on pixel-perfect JavaScript object initialization. This was replaced by semantic HTML and CSS Flexbox, resulting in a lighter codebase and faster browser rendering.lock_db) caused the global toolbar to freeze. By implementing a surgical "bypass" ininicio_main.php, we now ensure that critical navigation functions—such as "Home" and "Admin/Config"—remain accessible, allowing users to safely unlock databases without forced browser refreshes..dat), and Worksheets (.wks), all while maintaining seamless communication with the legacy Iframe architecture.typeofrecord.tabworkflow, which had been previously bypassed during the interface cleanup.Impact:
This refactoring marks a significant step in transitioning ABCD from a traditional Integrated Library System (ILS) to a more modular Library Services Platform (LSP). By cleaning up the core rendering engine and restoring logical control flow, the system is now significantly more stable, developer-friendly, and ready for future integrations via REST APIs.