Bug 38663 - Add additional fields to libraries
Summary: Add additional fields to libraries
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Pedro Amorim
QA Contact: Baptiste Wojtkowski (bwoj)
URL:
Keywords:
Depends on: 38662
Blocks: 38457
  Show dependency treegraph
 
Reported: 2024-12-10 11:14 UTC by Pedro Amorim
Modified: 2025-01-20 13:19 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement lets you add additional fields to libraries (Koha administration > Additional parameters > Additional fields ).
Version(s) released in:
Circulation function:


Attachments
Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC (1.54 KB, patch)
2024-12-10 15:18 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38663: Preparation: Change record_id to varchar: database (2.41 KB, patch)
2024-12-10 15:18 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38663: Add libraries table to additional fields admin screen (1.28 KB, patch)
2024-12-10 15:18 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38663: DBIC: Add AdditionalFields to Library (1.27 KB, patch)
2024-12-10 15:18 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38663: Add AdditionalFields to Library (4.84 KB, patch)
2024-12-10 15:18 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38663: Add AdditionalFields to Library (5.21 KB, patch)
2024-12-11 10:30 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC (1.61 KB, patch)
2024-12-19 13:10 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: Preparation: Change record_id to varchar: database (2.48 KB, patch)
2024-12-19 13:10 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: Add libraries table to additional fields admin screen (1.34 KB, patch)
2024-12-19 13:10 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: DBIC: Add AdditionalFields to Library (1.34 KB, patch)
2024-12-19 13:10 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: Add AdditionalFields to Library (5.28 KB, patch)
2024-12-19 13:10 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: (follow-up) Hide additional fields input appropriately (1.44 KB, patch)
2024-12-19 13:10 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC (1.61 KB, patch)
2025-01-08 09:29 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38663: Preparation: Change record_id to varchar: database (2.48 KB, patch)
2025-01-08 09:29 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38663: Add libraries table to additional fields admin screen (1.34 KB, patch)
2025-01-08 09:29 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38663: DBIC: Add AdditionalFields to Library (1.34 KB, patch)
2025-01-08 09:29 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38663: Add AdditionalFields to Library (5.28 KB, patch)
2025-01-08 09:29 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38663: (follow-up) Hide additional fields input appropriately (1.44 KB, patch)
2025-01-08 09:29 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC (1.65 KB, patch)
2025-01-08 10:09 UTC, David Nind
Details | Diff | Splinter Review
Bug 38663: Preparation: Change record_id to varchar: database (2.52 KB, patch)
2025-01-08 10:09 UTC, David Nind
Details | Diff | Splinter Review
Bug 38663: Add libraries table to additional fields admin screen (1.39 KB, patch)
2025-01-08 10:09 UTC, David Nind
Details | Diff | Splinter Review
Bug 38663: DBIC: Add AdditionalFields to Library (1.38 KB, patch)
2025-01-08 10:09 UTC, David Nind
Details | Diff | Splinter Review
Bug 38663: Add AdditionalFields to Library (5.32 KB, patch)
2025-01-08 10:09 UTC, David Nind
Details | Diff | Splinter Review
Bug 38663: (follow-up) Hide additional fields input appropriately (1.48 KB, patch)
2025-01-08 10:09 UTC, David Nind
Details | Diff | Splinter Review
Bug 38663: (follow-up) Heading - Admin to Administration (1.13 KB, patch)
2025-01-09 17:14 UTC, David Nind
Details | Diff | Splinter Review
Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC (1.72 KB, patch)
2025-01-20 11:18 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: Preparation: Change record_id to varchar: database (2.59 KB, patch)
2025-01-20 11:18 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: Add libraries table to additional fields admin screen (1.46 KB, patch)
2025-01-20 11:18 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: DBIC: Add AdditionalFields to Library (1.45 KB, patch)
2025-01-20 11:19 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: Add AdditionalFields to Library (5.39 KB, patch)
2025-01-20 11:19 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: (follow-up) Hide additional fields input appropriately (1.55 KB, patch)
2025-01-20 11:19 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: (follow-up) Heading - Admin to Administration (1.19 KB, patch)
2025-01-20 11:19 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: (QA follow-up) Removed superflous IF (1.47 KB, patch)
2025-01-20 11:19 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC (1.72 KB, patch)
2025-01-20 13:18 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38663: Preparation: Change record_id to varchar: database (2.59 KB, patch)
2025-01-20 13:18 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38663: Add libraries table to additional fields admin screen (1.46 KB, patch)
2025-01-20 13:19 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38663: DBIC: Add AdditionalFields to Library (1.45 KB, patch)
2025-01-20 13:19 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38663: Add AdditionalFields to Library (5.38 KB, patch)
2025-01-20 13:19 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38663: (follow-up) Hide additional fields input appropriately (1.55 KB, patch)
2025-01-20 13:19 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38663: (follow-up) Heading - Admin to Administration (1.26 KB, patch)
2025-01-20 13:19 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38663: (QA follow-up) Removed superflous IF (1.53 KB, patch)
2025-01-20 13:19 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2024-12-10 11:14:30 UTC

    
Comment 1 Pedro Amorim 2024-12-10 15:18:37 UTC
Created attachment 175355 [details] [review]
Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC
Comment 2 Pedro Amorim 2024-12-10 15:18:39 UTC
Created attachment 175356 [details] [review]
Bug 38663: Preparation: Change record_id to varchar: database

record_if in the additional_field_values is an int(11)
This works for most cases, but in the branches case, the id column is
actually a varchar (branchcode).
This patch updates the column to accomodate for this.
Comment 3 Pedro Amorim 2024-12-10 15:18:41 UTC
Created attachment 175357 [details] [review]
Bug 38663: Add libraries table to additional fields admin screen
Comment 4 Pedro Amorim 2024-12-10 15:18:43 UTC
Created attachment 175358 [details] [review]
Bug 38663: DBIC: Add AdditionalFields to Library
Comment 5 Pedro Amorim 2024-12-10 15:18:45 UTC
Created attachment 175359 [details] [review]
Bug 38663: Add AdditionalFields to Library

Test plan, k-t-d:
1) Add a new additional field to 'branches':
  <staff_url>/cgi-bin/koha/admin/additional-fields.pl?tablename=branches
2) Click 'New field'. Add a name. Click Save.
3) Repeat step 2 but repeatable. Repeat again for 2 more of AV category
   (one repeatable, one not repeatable)
4) Edit a library:
  <staff_url>/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode=CPL
5) Input various values in the different additional fields. Click
   'Submit'
6) Visit the detail page of the library and verify the additional fields
   data is displayed correctly:
<staff_url>/cgi-bin/koha/admin/branches.pl?op=view&branchcode=CPL
Comment 6 Pedro Amorim 2024-12-11 10:30:51 UTC
Created attachment 175370 [details] [review]
Bug 38663: Add AdditionalFields to Library

Test plan, k-t-d:
1) Add a new additional field to 'branches':
  <staff_url>/cgi-bin/koha/admin/additional-fields.pl?tablename=branches
2) Click 'New field'. Add a name. Click Save.
3) Repeat step 2 but repeatable. Repeat again for 2 more of AV category
   (one repeatable, one not repeatable)
4) Edit a library:
  <staff_url>/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode=CPL
5) Input various values in the different additional fields. Click
   'Submit'
6) Visit the detail page of the library and verify the additional fields
   data is displayed correctly:
<staff_url>/cgi-bin/koha/admin/branches.pl?op=view&branchcode=CPL
Comment 7 David Cook 2024-12-12 04:21:26 UTC
It's a good question. Historically, I think we'd say branches should be converted to have a branch_id. 

Once upon a time, reserve_id didn't exist (see Bug 7065), but that was a long time ago and a different set of circumstances... (e.g. it didn't have a primary key at all)

Technically, I suppose we could keep branchcode as the PK, and maybe just add an autoincrementing branch_id int(11) with a UNIQUE constraint. 

I don't know enough about additional_field_values to know if that would be workable or not though
Comment 8 David Cook 2024-12-12 04:23:01 UTC
One day, it would be cool to switch from autoincrementing integers to UUIDs, which are less prone to enumeration attacks, but that's a whole other story...
Comment 9 Martin Renvoize (ashimema) 2024-12-19 13:10:05 UTC
Created attachment 175757 [details] [review]
Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2024-12-19 13:10:08 UTC
Created attachment 175758 [details] [review]
Bug 38663: Preparation: Change record_id to varchar: database

record_if in the additional_field_values is an int(11)
This works for most cases, but in the branches case, the id column is
actually a varchar (branchcode).
This patch updates the column to accomodate for this.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize (ashimema) 2024-12-19 13:10:10 UTC
Created attachment 175759 [details] [review]
Bug 38663: Add libraries table to additional fields admin screen

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize (ashimema) 2024-12-19 13:10:13 UTC
Created attachment 175760 [details] [review]
Bug 38663: DBIC: Add AdditionalFields to Library

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize (ashimema) 2024-12-19 13:10:16 UTC
Created attachment 175761 [details] [review]
Bug 38663: Add AdditionalFields to Library

Test plan, k-t-d:
1) Add a new additional field to 'branches':
  <staff_url>/cgi-bin/koha/admin/additional-fields.pl?tablename=branches
2) Click 'New field'. Add a name. Click Save.
3) Repeat step 2 but repeatable. Repeat again for 2 more of AV category
   (one repeatable, one not repeatable)
4) Edit a library:
  <staff_url>/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode=CPL
5) Input various values in the different additional fields. Click
   'Submit'
6) Visit the detail page of the library and verify the additional fields
   data is displayed correctly:
<staff_url>/cgi-bin/koha/admin/branches.pl?op=view&branchcode=CPL

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize (ashimema) 2024-12-19 13:10:18 UTC
Created attachment 175762 [details] [review]
Bug 38663: (follow-up) Hide additional fields input appropriately

This patch hides the additional fields input on the library add/edit
page when there are no additional fields defined for libraries.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 15 David Nind 2025-01-03 19:42:39 UTC
The patches no longer apply - sha1/fake ancestor error:

git bz apply 38663

Bug 38663 - Add additional fields to libraries

175757 - Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC
175758 - Bug 38663: Preparation: Change record_id to varchar: database
175759 - Bug 38663: Add libraries table to additional fields admin screen
175760 - Bug 38663: DBIC: Add AdditionalFields to Library
175761 - Bug 38663: Add AdditionalFields to Library
175762 - Bug 38663: (follow-up) Hide additional fields input appropriately

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC
Applying: Bug 38663: Preparation: Change record_id to varchar: database
Applying: Bug 38663: Add libraries table to additional fields admin screen
error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt).
error: could not build fake ancestor
Patch failed at 0001 Bug 38663: Add libraries table to additional fields admin screen
Comment 16 Pedro Amorim 2025-01-06 10:21:13 UTC
(In reply to David Nind from comment #15)
> The patches no longer apply - sha1/fake ancestor error:

Hi! Can't reproduce, sorry! Just tested twice on up to date with main branch, it applies. Can you please double-check? Thanks!
Comment 17 David Cook 2025-01-06 22:34:40 UTC
(In reply to Pedro Amorim from comment #16)
> (In reply to David Nind from comment #15)
> > The patches no longer apply - sha1/fake ancestor error:
> 
> Hi! Can't reproduce, sorry! Just tested twice on up to date with main
> branch, it applies. Can you please double-check? Thanks!

Yeah, I have the same problem as David N.

You probably won't have that problem, Pedro, as you'll have the git ancestor in your repo while we don't. (In this case, it looks like 62e85cc3eab is the ancestor that you'll have which isn't in the upstream main branch. It might be interesting to see what that hash resolves to in your repo using "git show".)

If you can fetch the latest upstream and then rebase against that main branch, that should fix the problem for us.
Comment 18 David Cook 2025-01-06 22:37:32 UTC
(In reply to David Cook from comment #17)
> If you can fetch the latest upstream and then rebase against that main
> branch, that should fix the problem for us.

The rebase is necessary, because if you did "git checkout -b bug_38663 origin/main" and then did "git bz apply 38663" it probably would work for you, because you have that ancestor elsewhere in your repo referenced by some other branch, tag, or just a dangling reference that hasn't been garbage collected yet.
Comment 19 Pedro Amorim 2025-01-08 09:29:40 UTC
Created attachment 176214 [details] [review]
Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 20 Pedro Amorim 2025-01-08 09:29:43 UTC
Created attachment 176215 [details] [review]
Bug 38663: Preparation: Change record_id to varchar: database

record_if in the additional_field_values is an int(11)
This works for most cases, but in the branches case, the id column is
actually a varchar (branchcode).
This patch updates the column to accomodate for this.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 21 Pedro Amorim 2025-01-08 09:29:45 UTC
Created attachment 176216 [details] [review]
Bug 38663: Add libraries table to additional fields admin screen

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 22 Pedro Amorim 2025-01-08 09:29:48 UTC
Created attachment 176217 [details] [review]
Bug 38663: DBIC: Add AdditionalFields to Library

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 23 Pedro Amorim 2025-01-08 09:29:50 UTC
Created attachment 176218 [details] [review]
Bug 38663: Add AdditionalFields to Library

Test plan, k-t-d:
1) Add a new additional field to 'branches':
  <staff_url>/cgi-bin/koha/admin/additional-fields.pl?tablename=branches
2) Click 'New field'. Add a name. Click Save.
3) Repeat step 2 but repeatable. Repeat again for 2 more of AV category
   (one repeatable, one not repeatable)
4) Edit a library:
  <staff_url>/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode=CPL
5) Input various values in the different additional fields. Click
   'Submit'
6) Visit the detail page of the library and verify the additional fields
   data is displayed correctly:
<staff_url>/cgi-bin/koha/admin/branches.pl?op=view&branchcode=CPL

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 24 Pedro Amorim 2025-01-08 09:29:53 UTC
Created attachment 176219 [details] [review]
Bug 38663: (follow-up) Hide additional fields input appropriately

This patch hides the additional fields input on the library add/edit
page when there are no additional fields defined for libraries.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 25 David Nind 2025-01-08 10:09:10 UTC
Created attachment 176220 [details] [review]
Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 26 David Nind 2025-01-08 10:09:13 UTC
Created attachment 176221 [details] [review]
Bug 38663: Preparation: Change record_id to varchar: database

record_if in the additional_field_values is an int(11)
This works for most cases, but in the branches case, the id column is
actually a varchar (branchcode).
This patch updates the column to accomodate for this.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 27 David Nind 2025-01-08 10:09:15 UTC
Created attachment 176222 [details] [review]
Bug 38663: Add libraries table to additional fields admin screen

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 28 David Nind 2025-01-08 10:09:18 UTC
Created attachment 176223 [details] [review]
Bug 38663: DBIC: Add AdditionalFields to Library

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 29 David Nind 2025-01-08 10:09:21 UTC
Created attachment 176224 [details] [review]
Bug 38663: Add AdditionalFields to Library

Test plan, k-t-d:
1) Add a new additional field to 'branches':
  <staff_url>/cgi-bin/koha/admin/additional-fields.pl?tablename=branches
2) Click 'New field'. Add a name. Click Save.
3) Repeat step 2 but repeatable. Repeat again for 2 more of AV category
   (one repeatable, one not repeatable)
4) Edit a library:
  <staff_url>/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode=CPL
5) Input various values in the different additional fields. Click
   'Submit'
6) Visit the detail page of the library and verify the additional fields
   data is displayed correctly:
<staff_url>/cgi-bin/koha/admin/branches.pl?op=view&branchcode=CPL

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 30 David Nind 2025-01-08 10:09:23 UTC
Created attachment 176225 [details] [review]
Bug 38663: (follow-up) Hide additional fields input appropriately

This patch hides the additional fields input on the library add/edit
page when there are no additional fields defined for libraries.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 31 David Nind 2025-01-08 10:13:26 UTC
Added my signoff. Patches apply, works as per the test plan.

Testing notes (using KTD):
1. Apply the patches.
2. Update the database: updatedatabase
3. Run DBIC: dbic
4. Restart everything: restart_all
Comment 32 Baptiste Wojtkowski (bwoj) 2025-01-09 13:12:16 UTC
Everything works find and QA tool passes. Implementation is the same as for other additional fields so it makes sense to me.

Concerning the code I'm wondering why there is a double if here ?

>                [% IF CAN_user_parameters_manage_libraries %]    
>                    <h3>Admin</h3>    
>                    <ul>    
>                        [% IF CAN_user_parameters_manage_libraries %]    
>                            [% WRAPPER table_option value="branches" %]<span>Libraries</span>[% END %]    
>                        [% END %]    
>                    </ul>    
>                [% END %]    

I also tested other values to verify nothing is broken by record_id type changes, looks fine.
Comment 33 Pedro Amorim 2025-01-09 13:21:34 UTC
(In reply to Baptiste Wojtkowski (bwoj) from comment #32)
> Everything works find and QA tool passes. Implementation is the same as for
> other additional fields so it makes sense to me.
> 
> Concerning the code I'm wondering why there is a double if here ?
> 
> >                [% IF CAN_user_parameters_manage_libraries %]    
> >                    <h3>Admin</h3>    
> >                    <ul>    
> >                        [% IF CAN_user_parameters_manage_libraries %]    
> >                            [% WRAPPER table_option value="branches" %]<span>Libraries</span>[% END %]    
> >                        [% END %]    
> >                    </ul>    
> >                [% END %]    
> 
> I also tested other values to verify nothing is broken by record_id type
> changes, looks fine.

Hey, that's a good observation. I opted for this pattern approach as the initial IF should be an OR of all child IFs. It's just so happens that in this case there is only 1 child IF, but more entries may be added under 'Admin' in the future. To better understand what I mean here see the 'Acquisitions' section of the code right above it.
Having said that, this same pattern is not present on the other subsequent IFs below so, yeah, up for discussion.
I agree with either way and don't feel strongly about it, but I believe that was the reason.
Comment 34 David Nind 2025-01-09 17:14:53 UTC
Created attachment 176296 [details] [review]
Bug 38663: (follow-up) Heading - Admin to Administration

Signed-off-by: David Nind <david@davidnind.com>
Comment 35 Baptiste Wojtkowski (bwoj) 2025-01-10 08:36:18 UTC
I understand the reason when you explain it, but I feel like double check will be weird in the code as long as we don't add multiple options, so I'd rather say let's not double check as long as we don't need.
Comment 36 Pedro Amorim 2025-01-10 09:22:55 UTC
(In reply to Baptiste Wojtkowski (bwoj) from comment #35)
> I understand the reason when you explain it, but I feel like double check
> will be weird in the code as long as we don't add multiple options, so I'd
> rather say let's not double check as long as we don't need.

Makes sense. I agree.
Comment 37 Martin Renvoize (ashimema) 2025-01-20 11:18:52 UTC
Created attachment 176781 [details] [review]
Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 38 Martin Renvoize (ashimema) 2025-01-20 11:18:55 UTC
Created attachment 176782 [details] [review]
Bug 38663: Preparation: Change record_id to varchar: database

record_if in the additional_field_values is an int(11)
This works for most cases, but in the branches case, the id column is
actually a varchar (branchcode).
This patch updates the column to accomodate for this.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 39 Martin Renvoize (ashimema) 2025-01-20 11:18:58 UTC
Created attachment 176783 [details] [review]
Bug 38663: Add libraries table to additional fields admin screen

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 40 Martin Renvoize (ashimema) 2025-01-20 11:19:01 UTC
Created attachment 176784 [details] [review]
Bug 38663: DBIC: Add AdditionalFields to Library

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 41 Martin Renvoize (ashimema) 2025-01-20 11:19:04 UTC
Created attachment 176785 [details] [review]
Bug 38663: Add AdditionalFields to Library

Test plan, k-t-d:
1) Add a new additional field to 'branches':
  <staff_url>/cgi-bin/koha/admin/additional-fields.pl?tablename=branches
2) Click 'New field'. Add a name. Click Save.
3) Repeat step 2 but repeatable. Repeat again for 2 more of AV category
   (one repeatable, one not repeatable)
4) Edit a library:
  <staff_url>/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode=CPL
5) Input various values in the different additional fields. Click
   'Submit'
6) Visit the detail page of the library and verify the additional fields
   data is displayed correctly:
<staff_url>/cgi-bin/koha/admin/branches.pl?op=view&branchcode=CPL

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 42 Martin Renvoize (ashimema) 2025-01-20 11:19:07 UTC
Created attachment 176786 [details] [review]
Bug 38663: (follow-up) Hide additional fields input appropriately

This patch hides the additional fields input on the library add/edit
page when there are no additional fields defined for libraries.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 43 Martin Renvoize (ashimema) 2025-01-20 11:19:09 UTC
Created attachment 176787 [details] [review]
Bug 38663: (follow-up) Heading - Admin to Administration

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 44 Martin Renvoize (ashimema) 2025-01-20 11:19:12 UTC
Created attachment 176788 [details] [review]
Bug 38663: (QA follow-up) Removed superflous IF

As requested, I've removed the superflous IF statement in the template..
I'll likely be adding it back in as part of the next patch series, but
it makes the history clear this way.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 45 Martin Renvoize (ashimema) 2025-01-20 11:20:46 UTC
Fancy finishing up the QA here and adding your stamp Baptiste :)
Comment 46 Baptiste Wojtkowski (bwoj) 2025-01-20 13:18:56 UTC
Created attachment 176797 [details] [review]
Bug 38663: [DONT PUSH] Preparation: Change record_id to varchar: DBIC

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 47 Baptiste Wojtkowski (bwoj) 2025-01-20 13:18:59 UTC
Created attachment 176799 [details] [review]
Bug 38663: Preparation: Change record_id to varchar: database

record_if in the additional_field_values is an int(11)
This works for most cases, but in the branches case, the id column is
actually a varchar (branchcode).
This patch updates the column to accomodate for this.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 48 Baptiste Wojtkowski (bwoj) 2025-01-20 13:19:03 UTC
Created attachment 176800 [details] [review]
Bug 38663: Add libraries table to additional fields admin screen

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 49 Baptiste Wojtkowski (bwoj) 2025-01-20 13:19:06 UTC
Created attachment 176801 [details] [review]
Bug 38663: DBIC: Add AdditionalFields to Library

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 50 Baptiste Wojtkowski (bwoj) 2025-01-20 13:19:09 UTC
Created attachment 176802 [details] [review]
Bug 38663: Add AdditionalFields to Library

Test plan, k-t-d:
1) Add a new additional field to 'branches':
  <staff_url>/cgi-bin/koha/admin/additional-fields.pl?tablename=branches
2) Click 'New field'. Add a name. Click Save.
3) Repeat step 2 but repeatable. Repeat again for 2 more of AV category
   (one repeatable, one not repeatable)
4) Edit a library:
  <staff_url>/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode=CPL
5) Input various values in the different additional fields. Click
   'Submit'
6) Visit the detail page of the library and verify the additional fields
   data is displayed correctly:
<staff_url>/cgi-bin/koha/admin/branches.pl?op=view&branchcode=CPL

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 51 Baptiste Wojtkowski (bwoj) 2025-01-20 13:19:13 UTC
Created attachment 176803 [details] [review]
Bug 38663: (follow-up) Hide additional fields input appropriately

This patch hides the additional fields input on the library add/edit
page when there are no additional fields defined for libraries.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 52 Baptiste Wojtkowski (bwoj) 2025-01-20 13:19:16 UTC
Created attachment 176804 [details] [review]
Bug 38663: (follow-up) Heading - Admin to Administration

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 53 Baptiste Wojtkowski (bwoj) 2025-01-20 13:19:20 UTC
Created attachment 176805 [details] [review]
Bug 38663: (QA follow-up) Removed superflous IF

As requested, I've removed the superflous IF statement in the template..
I'll likely be adding it back in as part of the next patch series, but
it makes the history clear this way.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>