Description
Kyle M Hall (khall)
2012-07-12 15:32:45 UTC
Created attachment 10799 [details] [review] Bug 8431 - Increase the borrower attribute field size from 64 characters to 255 Some libraries would like to store more verbose data in a borrower attribute field. This commit increases the maximum length of a borrower attribute from 64 characters to 255 characters. The description of this database update is "Add system preference IntranetSlipPrinterJS." Created attachment 11088 [details] [review] Bug 8431 - Increase the borrower attribute field size from 64 characters to 255 Some libraries would like to store more verbose data in a borrower attribute field. This commit increases the maximum length of a borrower attribute from 64 characters to 255 characters. Tested * Upgrade to 3.09.00.XXX done (Increase the maximum size of a borrower attribute value) Checked the db borrower_attributes | CREATE TABLE `borrower_attributes` ( `borrowernumber` int(11) NOT NULL, `code` varchar(10) NOT NULL, `attribute` varchar(255) DEFAULT NULL, `password` varchar(64) DEFAULT NULL, KEY `borrowernumber` (`borrowernumber`), KEY `code_attribute` (`code`,`attribute`), CONSTRAINT `borrower_attributes_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `borrower_attributes_ibfk_2` FOREIGN KEY (`code`) REFERENCES `borrower_attribute_types` (`code`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | Created attachment 11097 [details] [review] [SIGNED-OFF] Bug 8431 - Increase the borrower attribute field size from 64 characters to 255 Some libraries would like to store more verbose data in a borrower attribute field. This commit increases the maximum length of a borrower attribute from 64 characters to 255 characters. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> QA Comments: The patch modifies the DB structure but template must be modified too. At least member/memberentrygen.tt: <input id="patron_attr_1" type="text" name="patron_attr_1" value="" maxlength="64"> I didn't verify if others occurrences exist. Created attachment 11113 [details] [review] Bug 8431 - Followup - Increase maxlength for borrower attributes text input Created attachment 11114 [details] [review] Bug 8431 - Followup - Switch from text input to textarea Switch the text input to a textarea will make editing larger borrower attritube values much easier. Since modern browsers allow for dynamic resizing of textareas, we can keep it small by default and let the library resize it if neccessary. I know this is minor, but a textarea needs both a "rows" attribute and a "cols" attribute in order to be valid. Our validity score may not be 100% but let's not introduce new issues. Created attachment 11150 [details] [review] Bug 8431 - Followup - Switch from text input to textarea Switch the text input to a textarea will make editing larger borrower attritube values much easier. Since modern browsers allow for dynamic resizing of textareas, we can keep it small by default and let the library resize it if neccessary. Created attachment 11166 [details] [review] [SIGNED-OFF] Bug 8431 - Followup - Switch from text input to textarea Created attachment 11167 [details] [review] Bug 8431 - Follow-up - Correct and consolidate JavaScript for clearing rows This follow-up consolidates the JavaScript for clearing the contents of a row of patron attributes while expanding it to include all inputs, selects, and textareas within that row. Previously password-type fields would be excluded. Created attachment 11169 [details] [review] Bug 8431 [SIGNED-OFF][FOLLOW-UP] Increase the borrower attribute field size from 64 characters to 255 This follow-up consolidates the JavaScript for clearing the contents of a row of patron attributes while expanding it to include all inputs, selects, and textareas within that row. Previously password-type fields would be excluded. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> 1st patch: just increases size of field in new and upgraded installs. Passed QA 2nd patch: changes input to text area to accomodate new size. Passed QA 3rd patch: jQuery consolidation of input clearing. Passed QA. A small problem that require a follow-up before I push the patch: * enter an attribute on 2 (or more lines) * save the patron * the attribute is displayed on 1 line (CR not replaced by <br/>) MArking failed QA. switch back to passed QA once you've added a fix (should just require a |html in the template) Created attachment 12106 [details] [review] Bug 8431 - Followup - Use TT filter html_line_break on extended attributes. (In reply to comment #16) > Created attachment 12106 [details] [review] > Bug 8431 - Followup - Use TT filter html_line_break on extended attributes. Thx for the follow-up, but you missed that is is also neede in moremember.tt and opac-userupdate.pl I've updated the 2 templates in a follow-up Patch pushed |