* Fix#36510 advance pg sequence after forced-rowid dictionary insert (#38741)
Dictionary entry creation in admin/dict.php computes $newid = MAX(rowid)+1
in PHP and INSERTs with that rowid explicitly. On PostgreSQL the matching
serial sequence (<table>_rowid_seq) is never told about the manually
chosen value, so the next auto-increment insert (the next dictionary
entry, or any other code path that pulls from the same sequence) hits a
duplicate-key error mis-reported to the user as
'already existing record'.
Bump the sequence with setval(pg_get_serial_sequence(...), GREATEST(MAX,1))
right after a successful forced-rowid INSERT, gated on $db->type == 'pgsql'
so MySQL/MariaDB behaviour is unchanged.
Diagnosis by @hregis (#36510).
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
* Fix#35661 drop duplicated ref segment in notify pdf path (#38746)
The fixed-target branch of Notify::send built the PDF path as
"$dir_output/$ref/$ref.pdf" while $dir_output already includes the
get_exdir(...) ref subdirectory. The double ref segment made
dol_is_file always fail and the PDF was never attached when a
notification was routed to a fixed email address. The matching block
just above for user/group targets has always used the correct
"$dir_output/$ref.pdf" form.
Drop the extra ref segment so both branches produce the same path.
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
* Fix#38614 align extrafield help-row position with create form (#38753)
In admin/extrafields the create page renders the Help tooltip row right
after Totalizable, before the Css rows. The edit page renders it after
all Css rows, so jumping from create to edit visually moves the field
without any meaningful reason.
Move the <tr class="help"> row in admin_extrafields_edit.tpl.php to the
same position as in admin_extrafields_add.tpl.php (after Totalizable,
before Css edit). Pure markup ordering, no logic change.
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
* Fix#36782#34780 strip the 'hidden' class when toggling the attach-file form
The button that opens the new-file form does jQuery('.divattachnewfile').toggle()
to show/hide it. The element is initially printed with class='hidden' (line 1443).
jQuery toggle() switches the inline display property but leaves the class
in place. When a theme stylesheet ships a '.hidden { display: none !important }'
rule, the inline 'display: block' set by toggle() is overridden and the form
stays invisible while the file picker still opens.
Call removeClass('hidden') alongside toggle() so the inline display wins on
the first open.
Signed-off-by: Dolicraft <contact@dolicraft.com>
---------
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
In FormFile::list_of_documents(), when the user clicks the "+ New" button to reveal the upload form (showhideaddbutton), the JS handler triggers jQuery("input[type='file']").click(). This selector matches every <input type="file"> on the page, opening the OS file picker once per match. Users with multiple file inputs in the DOM (e.g. another hidden upload form, an editor's media browser, modules with their own attachers) have to dismiss the file dialog several times before being able to drag-drop or browse normally.
Fix: scope the selector to the form that was just shown:
- jQuery("input[type='file']").click();
+ jQuery(".divattachnewfile input[type='file']").first().click();
No regression on pages with a single .divattachnewfile. Reproduces on any *document.php tab where a hidden second <input type="file"> is present.
* FIX : Wrong entity to download document
* MODIFICATION : Remplacement de l'ID d'entité par l'objet dans les fonctions de gestion des fichiers pour une meilleure cohérence.
* Update files.lib.php
* Update files.lib.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* NEW: add share option for URL link in attachement
* NEW: fix#33456
* NEW: shared link on links
* NEW: shared link on links
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>