Description
morgane alonso
2016-08-04 07:20:44 UTC
Code : Server source code : http://git.biblibre.com/biblibre/koha-mana Client source code integrated in Koha : http://git.biblibre.com/biblibre/kohac/commits/koha-mana Hi Alonso, Just glancing a little bit thru your Koha code, I see you introduce Koha::Branch. Did you see Koha::Library already? Confusingly true :) Quick code review: 1/ The default value for the new pref should be "off" 2/ Tabulation chars should be replaced with 4 tabs 3/ $tmp is rarely a correct variable name :) 4/ Additional fields are displayed (but not taken into account) on the mana subscriptions search form 5/ The Koha::Branch[es] should not be added, use Koha::Librar[y|ies] instead 6/ Share> "Language of your sharing" is hidden on the right. 7/ "The export is done, thank you for your contribution." => It should not be yellow (alert) but green (message) (In reply to Jonathan Druart from comment #3) > 2/ Tabulation chars should be replaced with 4 tabs Hope that this is not a recursive rule.. (In reply to Marcel de Rooy from comment #4) > > 2/ Tabulation chars should be replaced with 4 tabs > > Hope that this is not a recursive rule.. It is a rule for all new files added to Koha and for all changed lines in patches. https://wiki.koha-community.org/wiki/Coding_Guidelines#PERL6:_Indentation (In reply to Marcel de Rooy from comment #2) > Hi Alonso, > Just glancing a little bit thru your Koha code, I see you introduce > Koha::Branch. Did you see Koha::Library already? Confusingly true :) Hi Marcel de Rooy, I don't see it, sorry! I'll change that and use the right Koha object. (In reply to Jonathan Druart from comment #3) > Quick code review: > > 1/ The default value for the new pref should be "off" > > 2/ Tabulation chars should be replaced with 4 tabs > > 3/ $tmp is rarely a correct variable name :) > > 4/ Additional fields are displayed (but not taken into account) on the mana > subscriptions search form > > 5/ The Koha::Branch[es] should not be added, use Koha::Librar[y|ies] instead > > 6/ Share> "Language of your sharing" is hidden on the right. > > 7/ "The export is done, thank you for your contribution." => It should not > be yellow (alert) but green (message) 1/ Paul says that it's better to have "on" in default value to promote the use of Mana (he'll discuss about it later) 2/3/7/ I'll clean my code 4/ the flied "deprecated" is not used yet because I didn't have the time to code the comment feature where librarians can say if a model is deprecated. I can remove the flied if you prefer. 5/ I'll do that 6/ Fixed Thanks for all your comments! I will do my best to apply them all. For features like this that have you communicate with an external server should definitely turned off by default in my opinion. You can promote in other ways. Created attachment 56175 [details] [review] Bug 17047 add mana syspref Add the system preference to enable or disable mana webservice on koha. Created attachment 56176 [details] [review] Bug 17047 add frequencies and numberpattern in subscription class Created attachment 56177 [details] [review] Bug 17047 ability to search subscription model on mana - add a class SharedContent.pm to communicate with mana server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for mana - create datatable in mana-subscription-search-result.inc to show results from a research on mana - modify serials-search.pl to manage research on mana Created attachment 56178 [details] [review] Bug 17047 ability to share a subscription to mana - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a mana subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to mana Created attachment 56179 [details] [review] Bug 17047 ability to import a subscription model from mana - modify subscription-add.tt and subscription.pl to manage a import from mana during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with mana server during a asubscription creation - add a function in Subscription.pm to have all the info for a mana research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from mana server and not already created on the koha database, and modify the tests of the said functions Created attachment 56180 [details] [review] Bug 17047 Add unit tests Created attachment 56181 [details] [review] Bug 17047 - Use Koha::Libraries instead of GetBranches Here is a test plan: - Install and run a Mana server as described in the README file: http://git.biblibre.com/biblibre/koha-mana/blob/master/README.md, - apply this patch on Koha, - change the $MANA_IP variable in Koha/SharedContent.pm with the one used by your Mana server (may be http://localhost:5000 for a local instance), - go to a subscription detail page (cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=xx) and click on the share button in the toolbar. - check that the subscription has been recorded in the Mana database (subscription table), - in Koha, remove this subscription and the related frequency and numbering pattern, - go to the biblio detail page of the related deleted subscription (cgi-bin/koha/catalogue/detail.pl?biblionumber=xx), - click on New -> new subscription in the toolbar - click on next on the first step form. On the second step you should get the message: " Frequency and Numbering pattern have been already proposed for this subscription on Mana [...]", - click on "here", choose the subscription (Use) and finish the new subscription. - check that the subscription has been created with the corresponding frequency and numbering pattern. Is it ready for testing? Created attachment 59728 [details] [review] Bug 17047 - Don't create numberpattern if the same exists Created attachment 59729 [details] [review] Bug 17047 - Remove action column from mana search result table Remember, test plan is here: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17047#c16 Created attachment 59931 [details] [review] Bug 17047 - Don't show action column (use link) on mana search page (In reply to morgane alonso from comment #0) > RFC : > https://wiki.koha-community.org/wiki/SharingDatasBetweenKohas_rfc > > Progress of the Mana features : > https://wiki.koha-community.org/wiki/Mana_central_database One question... why is it "Statistics management" and not "Reports management"? Hi David, I think that we use the "reports" word on the code, the term "statistic" is used only on the RFC. Created attachment 61905 [details] [review] Bug 17047: Add report, factorize code, add a comment feature Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redisigned to improve the user experience - New Feature : report a record. - peoples can now report a weird report - if a record is reported a lot of time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - Added the syspref "AutoShareWithMana", which enables to select which fields you want to share automatically with mana API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) - Factorize a lot of code in order to improve the speed of next developments SytemPreferences: Mana Activation: - add a field "no, let me think" at the syspref "Mana" - as long as this field is selected, messages ask if user want to activate it messages in pages: - Administration - Add-subscription(page 2) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with mana (automatically not set) Report Share - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana - New feature: search report in Mana Knowledge Base with keywords - New feature: load reports from Mana Comment Resources - The comments can now be manually added - On a resource mana datatable, you can now see comments, add comment and vote for comments you think pertinent - Comments are NOT dynamically generated on the table you need to reload the page when you vote Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => mana shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can comment. To comment, click on report mistake. For now, you only can chose "other". - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Created attachment 62045 [details] [review] Bug 17047 add mana syspref Add the system preference to enable or disable mana webservice on koha. Created attachment 62046 [details] [review] Bug 17047 add frequencies and numberpattern in subscription class Created attachment 62047 [details] [review] Bug 17047 ability to search subscription model on mana - add a class SharedContent.pm to communicate with mana server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for mana - create datatable in mana-subscription-search-result.inc to show results from a research on mana - modify serials-search.pl to manage research on mana Created attachment 62048 [details] [review] Bug 17047 ability to share a subscription to mana - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a mana subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to mana Created attachment 62049 [details] [review] Bug 17047 ability to import a subscription model from mana - modify subscription-add.tt and subscription.pl to manage a import from mana during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with mana server during a asubscription creation - add a function in Subscription.pm to have all the info for a mana research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from mana server and not already created on the koha database, and modify the tests of the said functions Created attachment 62050 [details] [review] Bug 17047 Add unit tests Created attachment 62051 [details] [review] Bug 17047 - Use Koha::Libraries instead of GetBranches Created attachment 62052 [details] [review] Bug 17047 - Don't create numberpattern if the same exists Created attachment 62053 [details] [review] Bug 17047 - Don't show action column (use link) on mana search page Created attachment 62054 [details] [review] Bug 17047: Add report, factorize code, add a comment feature Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redisigned to improve the user experience - New Feature : report a record. - peoples can now report a weird report - if a record is reported a lot of time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - Added the syspref "AutoShareWithMana", which enables to select which fields you want to share automatically with mana API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) - Factorize a lot of code in order to improve the speed of next developments SytemPreferences: Mana Activation: - add a field "no, let me think" at the syspref "Mana" - as long as this field is selected, messages ask if user want to activate it messages in pages: - Administration - Add-subscription(page 2) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with mana (automatically not set) Report Share - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana - New feature: search report in Mana Knowledge Base with keywords - New feature: load reports from Mana Comment Resources - The comments can now be manually added - On a resource mana datatable, you can now see comments, add comment and vote for comments you think pertinent - Comments are NOT dynamically generated on the table you need to reload the page when you vote Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => mana shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can comment. To comment, click on report mistake. For now, you only can chose "other". - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Verified that, with mana OFF, nothing changes & Koha still working : * SQL => everything is OK * subscriptions => ERROR On the logs I see: Use of uninitialized value $loggedinuser in string ne at /home/koha/src/Koha/SharedContent.pm line 89. Can't call method "email" on an undefined value at /home/koha/src/Koha/SharedContent.pm line 91. Some QA comments: * patch description : "2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml" => not very clear. Better "copy in your koha-conf.xml the 3 lines about mana configuration the 3 lines you'll find in $KOHA_SRC/etc/koha-conf.xml" * some "+# Copyright ByWater Solutions 2015" => Yikes, it's Biblibre 2017, not ByWater 2015 ;-) * Not sure we should use Koha/Reports.pm & Report.pm. Why not something related to Mana (ie: Koha/Mana/Reports.pm, Koha/Mana/Reports.pm) [this is a question] * Some "+# Copyright 2016 BibLibre Morgane Alonso" => you're Baptiste, not Morgane (and we're now 2017) (In reply to Paul Poulain from comment #35) > * Not sure we should use Koha/Reports.pm & Report.pm. Why not something > related to Mana (ie: Koha/Mana/Reports.pm, Koha/Mana/Reports.pm) [this is a > question] They make sense to me, they are related to the (badly named) table saved_sql > * Some "+# Copyright 2016 BibLibre Morgane Alonso" => you're Baptiste, not > Morgane (and we're now 2017) After a very quick look at the code it seems that it is some code written by Morgane and moved by Baptiste, sounds right to keep it. Created attachment 62075 [details] [review] Bug 17047: Add report, factorize code, add a comment feature Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redisigned to improve the user experience - New Feature : report a record. - peoples can now report a weird report - if a record is reported a lot of time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - Added the syspref "AutoShareWithMana", which enables to select which fields you want to share automatically with mana API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) - Factorize a lot of code in order to improve the speed of next developments SytemPreferences: Mana Activation: - add a field "no, let me think" at the syspref "Mana" - as long as this field is selected, messages ask if user want to activate it messages in pages: - Administration - Add-subscription(page 2) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with mana (automatically not set) Report Share - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana - New feature: search report in Mana Knowledge Base with keywords - New feature: load reports from Mana Comment Resources - The comments can now be manually added - On a resource mana datatable, you can now see comments, add comment and vote for comments you think pertinent - Comments are NOT dynamically generated on the table you need to reload the page when you vote Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => mana shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can comment. To comment, click on report mistake. For now, you only can chose "other". - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Created attachment 62465 [details] [review] Bug 17047: Add security token against spam, Rework messages from Mana. - A syspref contains an authentication token - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages ar now correctly displayed and there shouldn't be any crash when mana answer wrong/doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => mana shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Comments. - On any table containing mana search results, you can comment. To comment, click on report mistake. For now, you only can chose "other". - If you click on other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. - If to a result has been reported a lot (>5, >10 and >15), it should appear differently 8 - For each precedent test, try to send wrong datas, to delete the security token, to send nothing: it should send you a propper message. Created attachment 62475 [details] [review] Bug 17047: Add security token against spam, Rework messages from Mana. - A syspref contains an authentication token - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages ar now correctly displayed and there shouldn't be any crash when mana answer wrong/doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => mana shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Comments. - On any table containing mana search results, you can comment. To comment, click on report mistake. For now, you only can chose "other". - If you click on other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. - If to a result has been reported a lot (>5, >10 and >15), it should appear differently 8 - For each precedent test, try to send wrong datas, to delete the security token, to send nothing: it should send you a propper message. Created attachment 62485 [details] [review] Bug 17047: Add security token against spam, Rework messages from Mana. - A syspref contains an authentication token - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages ar now correctly displayed and there shouldn't be any crash when mana answer wrong/doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => mana shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Comments. - On any table containing mana search results, you can comment. To comment, click on report mistake. For now, you only can chose "other". - If you click on other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. - If to a result has been reported a lot (>5, >10 and >15), it should appear differently 8 - For each precedent test, try to send wrong datas, to delete the security token, to send nothing: it should send you a propper message. Extensive testing : == Mana set to "No, let me think about it" == * subscriptions => no change, still working: - The subscription add says "You haven't activated the Mana Knowledge Base, click here to configure." as expected - add OK - view OK * sql reports => no change, still working (nothing related to mana visible) => OK == Mana set to OFF == * subscriptions => no change, still working * sql reports => no change, still working => OK == Mana set to ON == * AutoShare = nothing * I create a token for Mana by entering my firstname, lastname, email. I receive the email and can validate the token by clicking on the link in the email === Testing subscriptions === * I create a subscription => OK * I see the button "share" after validating creation * hitting "share" button, I get a confirmation box and a "thanks for sharing" message once I've confirmed * I create a new subscription, on the same biblio. - when reaching the 2nd screen of subscription-add, I see the box "something found in mana, quick fill". I select "quick fill", and select the subscription displayed. - the pattern & periodicity are now filled - I validate the subscription-add => OK I've also verified that, as the pattern & frequency already exist, they're not duplicated, the existing ones are used. === Testing SQL reports === * trying to share a report - go to SQL report - in the actions list (on the right), I see the option "share" - I click on "share", a popup appear asking me to enter more than 20 chars in name and description to enable sharing => OK - I update the name & description, hit "share" again - I validate the sharing * trying to retrieve a shared report - go to guided-reports page - hit the Quick search link on "You want more reports? Check the Mana Knowledge Base " - search what I've shared - click "use" - nothing visible happen. After talking with Baptiste, there's no redirect to the report that has been derived from Mana-KB. Baptiste will send a follow-up ASAP. Created attachment 62540 [details] [review] Bug 17047: minor corrections on report share - Use a report now redirects on the created report Created attachment 62542 [details] [review] Bug 17047 add mana syspref Add the system preference to enable or disable mana webservice on koha. Created attachment 62543 [details] [review] Bug 17047 add frequencies and numberpattern in subscription class Created attachment 62544 [details] [review] Bug 17047 ability to search subscription model on mana - add a class SharedContent.pm to communicate with mana server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for mana - create datatable in mana-subscription-search-result.inc to show results from a research on mana - modify serials-search.pl to manage research on mana Created attachment 62545 [details] [review] Bug 17047 ability to share a subscription to mana - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a mana subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to mana Created attachment 62546 [details] [review] Bug 17047 ability to import a subscription model from mana - modify subscription-add.tt and subscription.pl to manage a import from mana during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with mana server during a asubscription creation - add a function in Subscription.pm to have all the info for a mana research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from mana server and not already created on the koha database, and modify the tests of the said functions Created attachment 62547 [details] [review] Bug 17047 Add unit tests Created attachment 62548 [details] [review] Bug 17047 - Use Koha::Libraries instead of GetBranches Created attachment 62549 [details] [review] Bug 17047 - Don't create numberpattern if the same exists Created attachment 62550 [details] [review] Bug 17047 - Don't show action column (use link) on mana search page Created attachment 62551 [details] [review] Bug 17047: Add report, factorize code, add a comment feature Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redisigned to improve the user experience - New Feature : report a record. - peoples can now report a weird report - if a record is reported a lot of time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - Added the syspref "AutoShareWithMana", which enables to select which fields you want to share automatically with mana API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) - Factorize a lot of code in order to improve the speed of next developments SytemPreferences: Mana Activation: - add a field "no, let me think" at the syspref "Mana" - as long as this field is selected, messages ask if user want to activate it messages in pages: - Administration - Add-subscription(page 2) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with mana (automatically not set) Report Share - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana - New feature: search report in Mana Knowledge Base with keywords - New feature: load reports from Mana Comment Resources - The comments can now be manually added - On a resource mana datatable, you can now see comments, add comment and vote for comments you think pertinent - Comments are NOT dynamically generated on the table you need to reload the page when you vote Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => mana shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can comment. To comment, click on report mistake. For now, you only can chose "other". - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Created attachment 62552 [details] [review] Bug 17047: Add security token against spam, Rework messages from Mana. - A syspref contains an authentication token - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages ar now correctly displayed and there shouldn't be any crash when mana answer wrong/doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => mana shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Comments. - On any table containing mana search results, you can comment. To comment, click on report mistake. For now, you only can chose "other". - If you click on other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. - If to a result has been reported a lot (>5, >10 and >15), it should appear differently 8 - For each precedent test, try to send wrong datas, to delete the security token, to send nothing: it should send you a propper message. Created attachment 62553 [details] [review] Bug 17047: minor corrections on report share Created attachment 62589 [details] [review] Bug 17047: Add report_group as shared attribute Created attachment 62591 [details] [review] Bug 17047 add mana syspref Add the system preference to enable or disable mana webservice on koha. Created attachment 62592 [details] [review] Bug 17047 add frequencies and numberpattern in subscription class Created attachment 62593 [details] [review] Bug 17047 ability to search subscription model on mana - add a class SharedContent.pm to communicate with mana server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for mana - create datatable in mana-subscription-search-result.inc to show results from a research on mana - modify serials-search.pl to manage research on mana Created attachment 62594 [details] [review] Bug 17047 ability to share a subscription to mana - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a mana subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to mana Created attachment 62595 [details] [review] Bug 17047 ability to import a subscription model from mana - modify subscription-add.tt and subscription.pl to manage a import from mana during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with mana server during a asubscription creation - add a function in Subscription.pm to have all the info for a mana research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from mana server and not already created on the koha database, and modify the tests of the said functions Created attachment 62596 [details] [review] Bug 17047 - Don't create numberpattern if the same exists Created attachment 62597 [details] [review] Bug 17047 Add unit tests Created attachment 62598 [details] [review] Bug 17047: Add report, factorize code, add a comment feature Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redisigned to improve the user experience - New Feature : report a record. - peoples can now report a weird report - if a record is reported a lot of time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - Added the syspref "AutoShareWithMana", which enables to select which fields you want to share automatically with mana API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) - Factorize a lot of code in order to improve the speed of next developments SytemPreferences: Mana Activation: - add a field "no, let me think" at the syspref "Mana" - as long as this field is selected, messages ask if user want to activate it messages in pages: - Administration - Add-subscription(page 2) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with mana (automatically not set) Report Share - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana - New feature: search report in Mana Knowledge Base with keywords - New feature: load reports from Mana Comment Resources - The comments can now be manually added - On a resource mana datatable, you can now see comments, add comment and vote for comments you think pertinent - Comments are NOT dynamically generated on the table you need to reload the page when you vote Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => mana shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can comment. To comment, click on report mistake. For now, you only can chose "other". - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Created attachment 62599 [details] [review] Bug 17047: Add security token against spam, Rework messages from Mana. - A syspref contains an authentication token - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages ar now correctly displayed and there shouldn't be any crash when mana answer wrong/doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => mana shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Comments. - On any table containing mana search results, you can comment. To comment, click on report mistake. For now, you only can chose "other". - If you click on other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. - If to a result has been reported a lot (>5, >10 and >15), it should appear differently 8 - For each precedent test, try to send wrong datas, to delete the security token, to send nothing: it should send you a propper message. Created attachment 62603 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Created attachment 62604 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Created attachment 62605 [details] [review] Bug 17047 Mana-KB, Add unit tests Created attachment 62606 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Created attachment 62607 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Created attachment 62768 [details]
Mana-KB documentation
Created attachment 63476 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Created attachment 63601 [details] [review] Bug 17047: Correct encoding issues Modify the function manaRequest in order to set the right encoding format (UTF-8). Could you rebase please? I am getting: fatal: sha1 information is lacking or useless (installer/data/mysql/sysprefs.sql). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 17047 SQL reports management with Mana-KB Created attachment 63618 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Created attachment 63619 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Created attachment 63620 [details] [review] Bug 17047 Mana-KB, Add unit tests Created attachment 63621 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Created attachment 63622 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Created attachment 63623 [details] [review] Bug 17047: Correct encoding issues Modify the function manaRequest in order to set the right encoding format (UTF-8). Hum.. it tried to rebase it but it applyied without any problem.. I just reuploadad it, could you please try again ? (In reply to Baptiste from comment #80) > Hum.. it tried to rebase it but it applyied without any problem.. > > I just reuploadad it, could you please try again ? Now it applies, I had to do something wrong... anyway, going to test it Had some trouble applying it. Can you rebase - I think it's an easy one in koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt Thanks! Created attachment 64484 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail Created attachment 64530 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail It's still not applying cleanly for me. I would love to sign off on this and get it towards the next step! If I sign off on it - I'll start begging for some QAers. I'm using the latest version of kohadevbox - maybe try applying it there and rebasing this? Thanks! Hi ! It is on my todo list, I'll rebase it soon, take a bit time cause it concerns tests I didn't change by myself and I'm not pretty sure ;) Created attachment 64618 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Created attachment 64619 [details] [review] Bug 17047: subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Created attachment 64620 [details] [review] Bug 17047 Mana-KB, Add unit tests Created attachment 64621 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Created attachment 64622 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Created attachment 64623 [details] [review] Bug 17047: Correct encoding issues Modify the function manaRequest in order to set the right encoding format (UTF-8). Created attachment 64624 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail Rebased on master Created attachment 64625 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Created attachment 64626 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Created attachment 64627 [details] [review] Bug 17047 Mana-KB, Add unit tests Created attachment 64628 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Created attachment 64629 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Created attachment 64630 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Created attachment 64631 [details] [review] Bug 17047: Correct encoding issues Modify the function manaRequest in order to set the right encoding format (UTF-8). Created attachment 64632 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail Created attachment 64633 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Created attachment 64634 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Created attachment 64635 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Created attachment 64636 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Created attachment 64637 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Created attachment 64638 [details] [review] Bug 17047 Mana-KB, Add unit tests Created attachment 64639 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Created attachment 64640 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Created attachment 64641 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Created attachment 64642 [details] [review] Bug 17047: Correct encoding issues Modify the function manaRequest in order to set the right encoding format (UTF-8). Created attachment 64643 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail Correctly rebased on Master this time (I hope so) Created attachment 64648 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Created attachment 64649 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Created attachment 64650 [details] [review] Bug 17047 Mana-KB, Add unit tests Created attachment 64651 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Created attachment 64652 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Created attachment 64653 [details] [review] Bug 17047: Correct encoding issues Modify the function manaRequest in order to set the right encoding format (UTF-8). Created attachment 64654 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail Created attachment 64706 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" Created attachment 64962 [details] [review] Bug 17047: Minor changes - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) Hi Whilst going through this http://git.biblibre.com/biblibre/koha-mana/blob/master/README.md to install Mana I run the following command: plackup -r -R lib -E production bin/app.psgi And I get the following output: Error while loading /home/vagrant/kohaclone/koha-mana/bin/app.psgi: Can't locate Dancer2/Plugin/REST.pm in @INC (you may need to install the Dancer2::Plugin::REST module) (@INC contains: /home/vagrant/kohaclone/koha-mana/bin/../lib ~/kohaclone /home/vagrant/qa-test-tools /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at /home/vagrant/kohaclone/koha-mana/bin/../lib/Mana.pm line 8. I try to install the Dancer2/Plugin/REST package using the command: sudo apt-get install libdancer2-plugin-rest-perl However the package cannot be found. I have tried many different variations of the name without any success (and I cannot find any help with this online) therefore can someone please inform me of the correct command to install the Dancer2/Plugin/REST package? Created attachment 65058 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 65059 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 65060 [details] [review] Bug 17047 Mana-KB, Add unit tests Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 65061 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 65062 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 65063 [details] [review] Bug 17047: Correct encoding issues Modify the function manaRequest in order to set the right encoding format (UTF-8). Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 65064 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 65065 [details] [review] Bug 17047: Minor changes - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> I am getting some errors. I will fill this out later - in a rush at the moment. Giving presentation on this in a few minutes. Created attachment 65773 [details] [review] Bug 17047 [QA Followup] - Misc minor fixes The "use" button for grabbing a report from the search results of the mana reports - did not work. when creating a new serial subscription it was not able to complete - it threw an error. Searching serials in mana did not return any results. just a blank status code. (In reply to Brendan Gallagher from comment #135) > The "use" button for grabbing a report from the search results of the mana > reports - did not work. It works for me. Can you check you have the column saved_sql.mana_id ? It may be an updatedatabase issue. > > when creating a new serial subscription it was not able to complete - it > threw an error. Patch is coming. > > Searching serials in mana did not return any results. just a blank status > code. Patch is coming. Created attachment 66667 [details] [review] Bug 17047 - Fix an error when cretaing subscription Created attachment 66668 [details] [review] Bug 17047 - Fix mana search Created attachment 66987 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures Created attachment 67003 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures Created attachment 67004 [details] [review] Bug 17047 [QA Followup] - Fix up database schema change, add to kohastructure.sql Created attachment 67005 [details] [review] Bug 17047 [QA Followup] - Update schema files Created attachment 67006 [details] [review] Bug 17047 [QA Followup] - Remove javascript debugger call Created attachment 67009 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67010 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67011 [details] [review] Bug 17047 Mana-KB, Add unit tests Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67012 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67013 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67014 [details] [review] Bug 17047: Correct encoding issues Modify the function manaRequest in order to set the right encoding format (UTF-8). Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67015 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67016 [details] [review] Bug 17047: Minor changes - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67017 [details] [review] Bug 17047 [QA Followup] - Misc minor fixes Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67018 [details] [review] Bug 17047 - Fix an error when cretaing subscription Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67019 [details] [review] Bug 17047 - Fix mana search Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67020 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67021 [details] [review] Bug 17047 [QA Followup] - Fix up database schema change, add to kohastructure.sql Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67022 [details] [review] Bug 17047 [QA Followup] - Update schema files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 67023 [details] [review] Bug 17047 [QA Followup] - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> QA Notes: 1) Interface is a bit rough around the edges. Could probably use some Owen magic to clean it up ; ) 2) It appears that the whitespace/newlines on reports are not preserved correctly. It would be nice to keep the original formatting of shared reports instead of the long run-on queries that result. Hi I am in the process of testing bug 18618 on kohadevbox and I installed the Mana server by following the steps outlined here: http://git.biblibre.com/biblibre/koha-mana/blob/master/README.md I then applied the patches attached to bug 17047, changed the $MANA_IP address to http://localhost:5000 because I am using a local instance Mana server. Then when I tried to submit the form for creating a Mana token, the form is not returning a security token instead it is returning the following error when I display the outcome of the result js object in activatemana.js: ({msg:"An error occurred, mana server returned: URL must be absolute", code:400}) Does anyone have idea as to the reason why the /cgi-bin/koha/svc/mana/getToken is not successfully returning a security token? (In reply to Alex Buckley from comment #160) > Does anyone have idea as to the reason why the > /cgi-bin/koha/svc/mana/getToken is not successfully returning a security > token? This needs an answer Quick code review: 1/ Please squash patches when possible to ease readability 2/ Some strings are not translatable (at least "Subscription found on Mana Knowledge Base") 3/ Please fix indentation 4/ Remove use of onclick attribute 5/ - [% INCLUDE 'serials-toolbar.inc' %] + [% INCLUDE 'serials-toolbar.inc' mana_id = mana_id %] Not sure it is needed 6/ + 'mana_success' => $input->param('mana_success'), CGI->param raises warning called in list context (there are other occurrences) 7/ subroutines added in serials/subscription-add.pl smell 8/ serials/subscription-add.pl + my $mana_id; + if ( $query->param('mana_id') ne "" ) { + $mana_id = $query->param('mana_id'); + Koha::SharedContent::manaIncrementRequest("subscription",$mana_id, "nbofusers"); + } + else { + $mana_id = undef; + } => the else block is useless 9/ Too many "use" statements in serials/subscription-detail.pl 10/ script names in svc/mana are not consistent 11/ +my $templatename; +$templatename = "mana/mana-".$input->param( "resource" )."-search-result.tt"; That smells too. There are only 2 files, list them (same for other occurrences). 12/ Test coverage for Koha::SharedContent is nonexistent 13/ Why tests have been removed from t/db_dependent/Serials/GetFictiveIssueNumber.t 14/ No reference of mana_config from debian/templates/koha-conf-site.xml.in 15/ hide_marc appears twice in sysprefs.sql 16/ CDATA close tag removed from guided_reports_start.tt, looks wrong How can we open issue on http://git.biblibre.com/biblibre/koha-mana I'd like a more complete README to run the server and the tests. Created attachment 69034 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 69035 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 69036 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 69037 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 69038 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 69039 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 69040 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add. Created attachment 69041 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add. Alex should this be set back to "signed qa" or even "passed qa"? (In reply to Brendan Gallagher from comment #173) > Alex should this be set back to "signed qa" or even "passed qa"? Hello Brendan. Sorry no. Here is a QA fix. I have to do some code refacto and fonctional changes (moving the comment feature from the mana results table) Also, unit tests are missing for Koha::Subscription::Numberpatterns::new_or_existing Created attachment 69091 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Can I get an answer to my comments 162-164? Can you rebase please? Created attachment 70203 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 70204 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 70205 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 70206 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 70208 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 70209 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 70210 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Created attachment 70211 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Tried testing, seems to be some issues: 1 - Template code in subscription-add.js file breaks serial biblio search: 620 //[% IF Koha.Preference('Mana') == 1 %] 2 - When I attempt to save a serial: Variable "$loggedinuser" is not available at /home/vagrant/kohaclone/serials/subscription-add.pl line 371. Variable "$template" is not available at /home/vagrant/kohaclone/serials/subscription-add.pl line 372. Variable "$loggedinuser" is not available at /home/vagrant/kohaclone/serials/subscription-add.pl line 371. Variable "$template" is not available at /home/vagrant/kohaclone/serials/subscription-add.pl line 372. Can't use string ("koha_login_context") as a HASH ref while "strict refs" in use at /home/vagrant/kohaclone/Koha/Subscription/Numberpatterns.pm line 63. 3 - Blank modal when attempting to share report with no notes 4 - Internal server error when trying to share a new report with notes: Use of uninitialized value $loggedinuser in string ne at /home/vagrant/kohaclone/Koha/SharedContent.pm line 106. Can't call method "first_valid_email_address" on an undefined value at /home/vagrant/kohaclone/Koha/SharedContent.pm line 108. I stopped testing at this point Created attachment 70561 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent I have applied the patch propertly, but I am not able to make the local mana server work.. I follow all instructions. I have installed in a kohadev server, I had to install manual via cpan some of the perl packages, everything seems to goes fine.. but on localhost:5000 nothing appears.. is that the normal behaviour? PID/Program name tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN 2814/plackup tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:45397 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN - tcp6 0 0 :::41475 :::* LISTEN - tcp6 0 0 :::111 :::* LISTEN - tcp6 0 0 :::8080 :::* LISTEN - tcp6 0 0 :::80 :::* LISTEN - tcp6 0 0 :::22 :::* LISTEN - tcp6 0 0 ::1:25 :::* LISTEN - (In reply to Hugo Agud from comment #189) > I have applied the patch propertly, but I am not able to make the local mana > server work.. I follow all instructions. > > I have installed in a kohadev server, I had to install manual via cpan some > of the perl packages, everything seems to goes fine.. but on localhost:5000 > nothing appears.. is that the normal behaviour? > > PID/Program name > tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN > 2814/plackup > tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN > - > tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN > - > tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN > - > tcp 0 0 0.0.0.0:45397 0.0.0.0:* LISTEN > - > tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN > - > tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN > - > tcp6 0 0 :::41475 :::* LISTEN > - > tcp6 0 0 :::111 :::* LISTEN > - > tcp6 0 0 :::8080 :::* LISTEN > - > tcp6 0 0 :::80 :::* LISTEN > - > tcp6 0 0 :::22 :::* LISTEN > - > tcp6 0 0 ::1:25 :::* LISTEN > - Hello Hugo, You can use the test server: https://mana-test.koha-community.org Dear Alex thank you very much! we have added this line to Shared our $MANA_IP = "https://mana-test.koha-community.org"; and we have been able to work. REPORTS: We have been able to download reports from MANA BUT they are not able to execute because it dissapears spaces between orders.. we have got to review and separate some statements in order to make it works. We have NOT been able to upload a report or a serial patter , the systema it claims Can't call method "first_valid_email_address" on an undefined value at /home/vagrant/kohaclone/Koha/SharedContent.pm line 108. We have checked that the user has primary and secondary email and the library has also a library defined... (perhas it needs to be registered in MANA? we have not been able to register in MANA using syspref. Orex Digital (XXXXX) Primary email:info@orex.es Secondary email: info@orex.es SERIAL We have added a serial with a issn that MANA manage and it never finds it No subscription found on Mana Knowledge Base :( Please feel free to share you pattern with all others librarians once you are done Reviewing logs... dozens of Use of uninitialized value in concatenation (.) or string at /home/vagrant/kohaclone/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-subscription-search-result.inc line 53. Use of uninitialized value in concatenation (.) or string at /home/vagrant/kohaclone/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-subscription-search-result.inc line 53. (In reply to Jonathan Druart from comment #177) > Can I get an answer to my comments 162-164? Still waiting for that, I am switching to FQA until I get what I asked 4 months ago, to avoid testers to lose their time. Created attachment 70874 [details] [review] Bug 17047 - Fix retrieving Mana token To be clear with the job done since Jonathan's QA: > Comment 161 - /cgi-bin/koha/svc/mana/getToken is not successfully returning a security token? Fixed > Comment 162 and Comment 163 Fixed > Comment 164 - How can we open issue on http://git.biblibre.com/biblibre/koha-mana We plan to move Mana server sources on Koha community repository > Comment 164 - I'd like a more complete README to run the server and the tests. http://git.biblibre.com/biblibre/koha-mana/blob/master/README.md. Need to be completed I will work on Comment 191 as soon as possible good morning I have applied last patch 'Fix reteiving Mana Token' I am able to get token but I am not able to share anything with mana, same error than before Use of uninitialized value $loggedinuser in string ne at /home/vagrant/kohaclone/Koha/SharedContent.pm line 106. Can't call method "first_valid_email_address" on an undefined value at /home/vagrant/kohaclone/Koha/SharedContent.pm line 108. Created attachment 72660 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 72661 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 72662 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 72663 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 72664 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 72665 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 72666 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Created attachment 72667 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Created attachment 72668 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Created attachment 72669 [details] [review] Bug 17047 - Fix retrieving Mana token Created attachment 72670 [details] [review] Bug 17047 - Remove changes on Koha/Schema/Result/SavedSql.pm and Subscription.pm - mana.inc included twice (In reply to Hugo Agud from comment #191) > Dear Alex > > thank you very much! we have added this line to Shared > > our $MANA_IP = "https://mana-test.koha-community.org"; > > and we have been able to work. > > REPORTS: > We have been able to download reports from MANA BUT they are not able to > execute because it dissapears spaces between orders.. we have got to review > and separate some statements in order to make it works. Yes, there is bad reports in Mana database. They came here when the share method was broken. We should clear them now. > > We have NOT been able to upload a report or a serial patter , the systema it > claims Can't call method "first_valid_email_address" on an undefined value > at /home/vagrant/kohaclone/Koha/SharedContent.pm line 108. Works for me. But i did some little changes today. Can you apply them and test again? > > We have checked that the user has primary and secondary email and the > library has also a library defined... (perhas it needs to be registered in > MANA? we have not been able to register in MANA using syspref. > > Orex Digital (XXXXX) > > Primary email:info@orex.es > Secondary email: info@orex.es > > SERIAL > We have added a serial with a issn that MANA manage and it never finds it > > No subscription found on Mana Knowledge Base :( > > Please feel free to share you pattern with all others librarians once you > are done > > > > > Reviewing logs... > > dozens of > Use of uninitialized value in concatenation (.) or string at > /home/vagrant/kohaclone/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana- > subscription-search-result.inc line 53. > Use of uninitialized value in concatenation (.) or string at > /home/vagrant/kohaclone/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana- > subscription-search-result.inc line 53. Created attachment 73699 [details] [review] Bug 17047 - Move mana JS and put correct subscription id when sharing Hello Alex, This patch is not applying. There are a few merge conflicts. -JesseM Created attachment 73737 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 73738 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 73739 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 73740 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 73741 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 73742 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 73743 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Created attachment 73744 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Created attachment 73745 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Created attachment 73746 [details] [review] Bug 17047 - Fix retrieving Mana token Created attachment 73747 [details] [review] Bug 17047 - Remove changes on Koha/Schema/Result/SavedSql.pm and Subscription.pm - mana.inc included twice Created attachment 73748 [details] [review] Bug 17047 - Move mana JS and put correct subscription id when sharing Getting some errors in the plack logs while testing. Use of uninitialized value $ressourcetype in ucfirst at /home/vagrant/kohaclone/Koha/SharedContent.pm line 123. Use of uninitialized value $ressourcetype in ucfirst at /home/vagrant/kohaclone/Koha/SharedContent.pm line 124. Can't locate object method "get_sharable_info" via package "Koha::" (perhaps you forgot to load "Koha::"?) at /home/vagrant/kohaclone/Koha/SharedContent.pm line 125. Created attachment 73975 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 73976 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 73977 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 73978 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 73979 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 73980 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 73981 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 73982 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 73983 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 73984 [details] [review] Bug 17047 - Fix retrieving Mana token Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 73985 [details] [review] Bug 17047 - Remove changes on Koha/Schema/Result/SavedSql.pm and Subscription.pm - mana.inc included twice Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Created attachment 73986 [details] [review] Bug 17047 - Move mana JS and put correct subscription id when sharing Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Is there a plan to avoid never-ending rebases? (In reply to Alex Arnaud from comment #194) > > Comment 164 - How can we open issue on http://git.biblibre.com/biblibre/koha-mana > We plan to move Mana server sources on Koha community repository > > > Comment 164 - I'd like a more complete README to run the server and the tests. > http://git.biblibre.com/biblibre/koha-mana/blob/master/README.md. Need to be > completed What about these two points? (In reply to Jonathan Druart from comment #236) > Is there a plan to avoid never-ending rebases? > > > (In reply to Alex Arnaud from comment #194) > > > Comment 164 - How can we open issue on http://git.biblibre.com/biblibre/koha-mana > > We plan to move Mana server sources on Koha community repository > > > > > Comment 164 - I'd like a more complete README to run the server and the tests. > > http://git.biblibre.com/biblibre/koha-mana/blob/master/README.md. Need to be > > completed > > What about these two points? I think only the second point needs an answer. What do you miss on the README file? (In reply to Jonathan Druart from comment #236) > Is there a plan to avoid never-ending rebases? > Make QA and push? :p I can get back to this one when the documentation to test locally (server too) will be completed. Created attachment 76673 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 76674 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 76675 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 76676 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 76677 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 76678 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 76679 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 76680 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 76681 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 76682 [details] [review] Bug 17047 - Fix retrieving Mana token Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 76683 [details] [review] Bug 17047 - Remove changes on Koha/Schema/Result/SavedSql.pm and Subscription.pm - mana.inc included twice Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 76684 [details] [review] Bug 17047 - Move mana JS and put correct subscription id when sharing Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) (In reply to Jonathan Druart from comment #239) > I can get back to this one when the documentation to test locally (server > too) will be completed. I have updated the README.md of Mana server. There you'll find a link to the documentation of Mana feature in Koha. And a documentation on Mana server (install and use). Also i've just rebased the 12 patches above. 1. Unit tests: [kohadev-koha@kohadevbox:/home/vagrant/kohaclone (BZ17047_s) ✹ ✭]% prove -r t/db_dependent/Koha/SharedContent.t t/db_dependent/Koha/Subscription* t/db_dependent/Serial* t/db_dependent/Koha/SharedContent.t ................ Name "Koha::SharedContent::MANA_IP" used only once: possible typo at t/db_dependent/Koha/SharedContent.t line 44. t/db_dependent/Koha/Subscription.t ................. "my" variable $builder masks earlier declaration in same scope at t/db_dependent/Koha/Subscription.t line 38. t/db_dependent/Koha/Subscription.t ................. 1/9 Can't call method "biblionumber" on an undefined value at /home/vagrant/kohaclone/Koha/Subscription.pm line 143. # Looks like your test exited with 255 just after 8. t/db_dependent/Koha/Subscription.t ................. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 1/9 subtests t/db_dependent/Serials/ReNewSubscription.t ......... Undefined subroutine &Koha::SharedContent::manaGetRequestWithId called at /home/vagrant/kohaclone/C4/Serials.pm line 303. 2. QA script: FAIL koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt FAIL forbidden patterns forbidden pattern: Do *not* include full path to js files, use the Asset TT plugin (bug 20538) (line 196) forbidden pattern: intranet-tmpl should certainly replaced with [% interface %] (line 196) FAIL t/db_dependent/Koha/SharedContent.t FAIL valid Name "Koha::SharedContent::MANA_IP" used only once: possible typo FAIL t/db_dependent/Koha/Subscription.t FAIL valid "my" variable $builder masks earlier declaration in same scope About MANA_IP, you should move it to a Koha::SharedContent method. It would be the only way to retrieve mana_config from the config. It will help to handle non-existent/invalid entry. Moreover I think we should avoid having config at package level (because of usage of Memcached and Plack). It will be easy to mock with mock_config. 3. There is a CamelCase/snake_case mix in method's names - Message on the admin page - click here, then you enable, then? We should link to a documentation page. - log_path is not in the default yaml file or specify in any docs. I did not manage to configure the server config file to make it work locally. Can you share a working example please? - What is supposed to happen when I click on "Send" in the ManaToken syspref block? There is a wrong error handling, as my server is not setup properly, I click and nothing happens. Created attachment 78215 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 78216 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 78217 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 78218 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 78219 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 78220 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 78221 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 78222 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 78223 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 78224 [details] [review] Bug 17047 - Fix retrieving Mana token Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 78225 [details] [review] Bug 17047 - Remove changes on Koha/Schema/Result/SavedSql.pm and Subscription.pm - mana.inc included twice Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 78226 [details] [review] Bug 17047 - Move mana JS and put correct subscription id when sharing Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 78227 [details] [review] Bug 17047: Fix unit tests Replace MANA_IP variable with subroutine Fix QA script warnings Created attachment 78228 [details] [review] Bug 17047: Koha::SharedContent subs snake casing/renaming manaRequest => process_request manaIncrementRequest => increment_entity_value manaPostRequest => send_entity prepareSharedData => prepare_entity_data manaGetRequestWithId => get_entity_by_id manaGetRequest => search_entities buildRequest => build_request manaUrl => get_sharing_url (In reply to Jonathan Druart from comment #253) > 1. Unit tests: > [kohadev-koha@kohadevbox:/home/vagrant/kohaclone (BZ17047_s) ✹ ✭]% prove -r > t/db_dependent/Koha/SharedContent.t t/db_dependent/Koha/Subscription* > t/db_dependent/Serial* > t/db_dependent/Koha/SharedContent.t ................ Name > "Koha::SharedContent::MANA_IP" used only once: possible typo at > t/db_dependent/Koha/SharedContent.t line 44. > > t/db_dependent/Koha/Subscription.t ................. "my" variable $builder > masks earlier declaration in same scope at > t/db_dependent/Koha/Subscription.t line 38. > t/db_dependent/Koha/Subscription.t ................. 1/9 Can't call method > "biblionumber" on an undefined value at > /home/vagrant/kohaclone/Koha/Subscription.pm line 143. > # Looks like your test exited with 255 just after 8. > t/db_dependent/Koha/Subscription.t ................. Dubious, test returned > 255 (wstat 65280, 0xff00) > Failed 1/9 subtests > > t/db_dependent/Serials/ReNewSubscription.t ......... Undefined subroutine > &Koha::SharedContent::manaGetRequestWithId called at > /home/vagrant/kohaclone/C4/Serials.pm line 303. > > > 2. QA script: > > FAIL koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt > FAIL forbidden patterns > forbidden pattern: Do *not* include full path to js files, > use the Asset TT plugin (bug 20538) (line 196) > forbidden pattern: intranet-tmpl should certainly replaced > with [% interface %] (line 196) > > > FAIL t/db_dependent/Koha/SharedContent.t > FAIL valid > Name "Koha::SharedContent::MANA_IP" used only once: possible > typo > > FAIL t/db_dependent/Koha/Subscription.t > FAIL valid > "my" variable $builder masks earlier declaration in same > scope > > > About MANA_IP, you should move it to a Koha::SharedContent method. It would > be the only way to retrieve mana_config from the config. > It will help to handle non-existent/invalid entry. Moreover I think we > should avoid having config at package level (because of usage of Memcached > and Plack). It will be easy to mock with mock_config. > > 3. There is a CamelCase/snake_case mix in method's names Fixed Created attachment 78229 [details] [review] Bug 17047: Koha::SharedContent subs snake casing/renaming manaRequest => process_request manaIncrementRequest => increment_entity_value manaPostRequest => send_entity prepareSharedData => prepare_entity_data manaGetRequestWithId => get_entity_by_id manaGetRequest => search_entities buildRequest => build_request manaUrl => get_sharing_url (In reply to Jonathan Druart from comment #254) > - Message on the admin page - click here, then you enable, then? We should > link to a documentation page. > > - log_path is not in the default yaml file or specify in any docs. > I did not manage to configure the server config file to make it work > locally. Can you share a working example please? I don't know what your are talking about for these 2 points > > - What is supposed to happen when I click on "Send" in the ManaToken syspref > block? There is a wrong error handling, as my server is not setup properly, > I click and nothing happens. You are supposed to receive an email containing a link to activate your Mana account. Like this one: " Hello Alex Arnaud, Someone asked on 2018-08-28 for an authentication on the Mana KB webservice. To activate your account definitively, please click on the following link and follow the instruction https://mana-test.koha-community.org/registration?id=DnX************************ " It works for me because i set the official Mana server url in Koha. May be you are using a locale one? (In reply to Alex Arnaud from comment #271) > (In reply to Jonathan Druart from comment #254) > > - Message on the admin page - click here, then you enable, then? We should > > link to a documentation page. IIRC there is a link on the admin page, which point to the syspref. But it's not clear what "mana" is and what need to be done to configure/use it correctly. I suggested to add a link to point to a documentation page (wiki or manual) > > - log_path is not in the default yaml file or specify in any docs. > > I did not manage to configure the server config file to make it work > > locally. Can you share a working example please? Server-side, I am trying to make it work locally to test the whole things. I did not manage to get a working config file to make the server run properly. > > - What is supposed to happen when I click on "Send" in the ManaToken syspref > > block? There is a wrong error handling, as my server is not setup properly, > > I click and nothing happens. > > You are supposed to receive an email containing a link to activate your Mana > account. Like this one: > > " > Hello Alex Arnaud, > Someone asked on 2018-08-28 for an authentication on the Mana KB > webservice. To activate your account definitively, please click on the > following link and follow the instruction > https://mana-test.koha-community.org/ > registration?id=DnX************************ > > " > > It works for me because i set the official Mana server url in Koha. May be > you are using a locale one? Yes, the server I am using does not return a correct message and nothing happens when I click, which means errors are not handled correctly in JS code. (In reply to Jonathan Druart from comment #272) > IIRC there is a link on the admin page, which point to the syspref. But it's > not clear what "mana" is and what need to be done to configure/use it > correctly. I suggested to add a link to point to a documentation page (wiki > or manual) I didn't write all the code, so i may have missed something: I don't see any "Mana" link on the admin page. > > > > - log_path is not in the default yaml file or specify in any docs. > > > I did not manage to configure the server config file to make it work > > > locally. Can you share a working example please? > > Server-side, I am trying to make it work locally to test the whole things. I > did not manage to get a working config file to make the server run properly. Quite complicated to solve server side problems from here. At which step are you stuck ? Did you get errors? I can take a moment to help you (with screen share) to set up the server when you are available. > > > Yes, the server I am using does not return a correct message and nothing > happens when I click, which means errors are not handled correctly in JS > code. Work to be done. Created attachment 79868 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79869 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79870 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79871 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79872 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79874 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79877 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79878 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79879 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79880 [details] [review] Bug 17047 - Fix retrieving Mana token Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79881 [details] [review] Bug 17047 - Remove changes on Koha/Schema/Result/SavedSql.pm and Subscription.pm - mana.inc included twice Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79882 [details] [review] Bug 17047 - Move mana JS and put correct subscription id when sharing Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79883 [details] [review] Bug 17047: Fix unit tests Replace MANA_IP variable with subroutine Fix QA script warnings Created attachment 79884 [details] [review] Bug 17047: Koha::SharedContent subs snake casing/renaming manaRequest => process_request manaIncrementRequest => increment_entity_value manaPostRequest => send_entity prepareSharedData => prepare_entity_data manaGetRequestWithId => get_entity_by_id manaGetRequest => search_entities buildRequest => build_request manaUrl => get_sharing_url Created attachment 79885 [details] [review] Bug 17047: add a dedicated page for Mana setup Created attachment 79886 [details] [review] Bug 17047: [DO NOT PUSH] provide staff-global.css Created attachment 79887 [details] [review] Bug 17047: [DO NOT PUSH] provides schema files Created attachment 79888 [details] [review] Bug 17047: Fix reports sharing Work done: - Add a dedicated page for configuring Mana, - provides css and schema files in separated patches, - fix report sharing (probably broken by a rebase), - On server side: update config.yaml. Was missing some keys Applying: Bug 17047 SQL reports management with Mana-KB error: sha1 information is lacking or useless (installer/data/mysql/sysprefs.sql). Created attachment 79922 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79923 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79924 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79925 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79926 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79927 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79928 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79929 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79930 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79931 [details] [review] Bug 17047 - Fix retrieving Mana token Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79932 [details] [review] Bug 17047 - Remove changes on Koha/Schema/Result/SavedSql.pm and Subscription.pm - mana.inc included twice Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79933 [details] [review] Bug 17047 - Move mana JS and put correct subscription id when sharing Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Created attachment 79934 [details] [review] Bug 17047: Fix unit tests Replace MANA_IP variable with subroutine Fix QA script warnings Created attachment 79935 [details] [review] Bug 17047: Koha::SharedContent subs snake casing/renaming manaRequest => process_request manaIncrementRequest => increment_entity_value manaPostRequest => send_entity prepareSharedData => prepare_entity_data manaGetRequestWithId => get_entity_by_id manaGetRequest => search_entities buildRequest => build_request manaUrl => get_sharing_url Created attachment 79936 [details] [review] Bug 17047: add a dedicated page for Mana setup Created attachment 79937 [details] [review] Bug 17047: [DO NOT PUSH] provide staff-global.css Created attachment 79938 [details] [review] Bug 17047: [DO NOT PUSH] provides schema files Created attachment 79939 [details] [review] Bug 17047: Fix reports sharing In the system preferences there isn't a place to fill out a request for a mana token anymore. Did I miss something in the comments that I don't need to get a token anymore? (In reply to Brendan Gallagher from comment #312) > In the system preferences there isn't a place to fill out a request for a > mana token anymore. Did I miss something in the comments that I don't need > to get a token anymore? Hi brendan, There's now a page on admin/admin-home, like for HEA (bottom right, close to the hea page ;) ) oh very cool Paul! Thanks! Hi, If I filled registration and cliked on activation link, I was on 404 page. So registration wasn't confirmed. I'm not able to test comunication between Kohadexbox and Mana. What I can to do? Mana will be great tool :-) Mike (In reply to Michal Denar from comment #315) > Hi, > If I filled registration and cliked on activation link, I was on 404 page. > So registration wasn't confirmed. I'm not able to test comunication between > Kohadexbox and Mana. What I can to do? > > Mana will be great tool :-) > > Mike Hello Mike, I your mana config points to mana-test.koha-community.org, it's normal. Mana server is temporarily unavailable. Created attachment 80183 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80184 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80185 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80186 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80187 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80188 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80189 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80190 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80191 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80192 [details] [review] Bug 17047 - Fix retrieving Mana token Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80193 [details] [review] Bug 17047 - Remove changes on Koha/Schema/Result/SavedSql.pm and Subscription.pm - mana.inc included twice Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80194 [details] [review] Bug 17047 - Move mana JS and put correct subscription id when sharing Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80195 [details] [review] Bug 17047: Fix unit tests Replace MANA_IP variable with subroutine Fix QA script warnings Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80196 [details] [review] Bug 17047: Koha::SharedContent subs snake casing/renaming manaRequest => process_request manaIncrementRequest => increment_entity_value manaPostRequest => send_entity prepareSharedData => prepare_entity_data manaGetRequestWithId => get_entity_by_id manaGetRequest => search_entities buildRequest => build_request manaUrl => get_sharing_url Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80197 [details] [review] Bug 17047: add a dedicated page for Mana setup Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80198 [details] [review] Bug 17047: [DO NOT PUSH] provide staff-global.css Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80199 [details] [review] Bug 17047: [DO NOT PUSH] provides schema files Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80200 [details] [review] Bug 17047: Fix reports sharing Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> *** Bug 12710 has been marked as a duplicate of this bug. *** Created attachment 80471 [details] [review] Bug 17047: [DO NOT PUSH] provide staff-global.css Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80472 [details] [review] Bug 17047: [DO NOT PUSH] provides schema files Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80473 [details] [review] Bug 17047: Fix reports sharing Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Cannot apply, there is something wrong (patches order?) error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt). Created attachment 80907 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80908 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80909 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80910 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80911 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80912 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80913 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80914 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80915 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80916 [details] [review] Bug 17047 - Fix retrieving Mana token Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80917 [details] [review] Bug 17047 - Remove changes on Koha/Schema/Result/SavedSql.pm and Subscription.pm - mana.inc included twice Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80918 [details] [review] Bug 17047 - Move mana JS and put correct subscription id when sharing Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80919 [details] [review] Bug 17047: Fix unit tests Replace MANA_IP variable with subroutine Fix QA script warnings Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80920 [details] [review] Bug 17047: Koha::SharedContent subs snake casing/renaming manaRequest => process_request manaIncrementRequest => increment_entity_value manaPostRequest => send_entity prepareSharedData => prepare_entity_data manaGetRequestWithId => get_entity_by_id manaGetRequest => search_entities buildRequest => build_request manaUrl => get_sharing_url Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80921 [details] [review] Bug 17047: add a dedicated page for Mana setup Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80922 [details] [review] Bug 17047: [DO NOT PUSH] provide staff-global.css Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80923 [details] [review] Bug 17047: [DO NOT PUSH] provides schema files Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 80924 [details] [review] Bug 17047: Fix reports sharing Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> I will try to have a look at this one before the feature freeze to evaluate if this could be part of 18.11. Could you catch possible QA failures (update the QA script repo and run it over the whole patchset)? It would also help to have a remote branch with the stack up-to-date (the one on the biblibre repo is 18 months old), I tried to rebase but got: error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt). Created attachment 81935 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81936 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81937 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81938 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81939 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81940 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81941 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81942 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81943 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81944 [details] [review] Bug 17047 - Fix retrieving Mana token Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81945 [details] [review] Bug 17047 - Remove changes on Koha/Schema/Result/SavedSql.pm and Subscription.pm - mana.inc included twice Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81946 [details] [review] Bug 17047 - Move mana JS and put correct subscription id when sharing Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81947 [details] [review] Bug 17047: Fix unit tests Replace MANA_IP variable with subroutine Fix QA script warnings Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81948 [details] [review] Bug 17047: Koha::SharedContent subs snake casing/renaming manaRequest => process_request manaIncrementRequest => increment_entity_value manaPostRequest => send_entity prepareSharedData => prepare_entity_data manaGetRequestWithId => get_entity_by_id manaGetRequest => search_entities buildRequest => build_request manaUrl => get_sharing_url Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81949 [details] [review] Bug 17047: add a dedicated page for Mana setup Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81950 [details] [review] Bug 17047: [DO NOT PUSH] provide staff-global.css Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81951 [details] [review] Bug 17047: [DO NOT PUSH] provides schema files Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81952 [details] [review] Bug 17047: Fix reports sharing Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 81968 [details] [review] Bug 17047: [QA tool] add template filters (In reply to Jonathan Druart from comment #358) > I will try to have a look at this one before the feature freeze to evaluate > if this could be part of 18.11. > > Could you catch possible QA failures (update the QA script repo and run it > over the whole patchset)? Done => nothing to fix. Also, i run the tools on joubu/qa-test-tools-issue_3 branch which caused my last patch. > > It would also help to have a remote branch with the stack up-to-date (the > one on the biblibre repo is 18 months old), I tried to rebase but got: > error: sha1 information is lacking or useless > (koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt). Which repo ? github, biblibre ? Mana server ? All patches are rebased here. Alex, could you rebase this patch set again? I'd like to QA it! Created attachment 83863 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83864 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83865 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83866 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83867 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83868 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83869 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83870 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83871 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83872 [details] [review] Bug 17047 - Fix retrieving Mana token Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83873 [details] [review] Bug 17047 - Remove changes on Koha/Schema/Result/SavedSql.pm and Subscription.pm - mana.inc included twice Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83874 [details] [review] Bug 17047 - Move mana JS and put correct subscription id when sharing Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83875 [details] [review] Bug 17047: Fix unit tests Replace MANA_IP variable with subroutine Fix QA script warnings Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83876 [details] [review] Bug 17047: Koha::SharedContent subs snake casing/renaming manaRequest => process_request manaIncrementRequest => increment_entity_value manaPostRequest => send_entity prepareSharedData => prepare_entity_data manaGetRequestWithId => get_entity_by_id manaGetRequest => search_entities buildRequest => build_request manaUrl => get_sharing_url Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83877 [details] [review] Bug 17047: add a dedicated page for Mana setup Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83878 [details] [review] Bug 17047: [DO NOT PUSH] provide staff-global.css Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83879 [details] [review] Bug 17047: [DO NOT PUSH] provides schema files Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83880 [details] [review] Bug 17047: Fix reports sharing Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 83881 [details] [review] Bug 17047: [QA tool] add template filters Created attachment 83892 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83893 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83894 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83895 [details] [review] Bug 17047 security token agst flooding for Mana-KB Rework messages from Mana-KB. - Add A syspref contains an authentication token. The token will be used to prevent anaonymous flooding of Mana-KB - To get an Authentication token, you have to fill a form and validate your e-mail address - Messages return codes are now correctly displayed and there shouldn't be any crash when Mana-KB webservices return a wrong answer or doesn't answer Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83896 [details] [review] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83897 [details] [review] Bug 17047 [QA Followup] - Fix misc koha-qa.pl failures - Fix up database schema change, add to kohastructure.sql - Update schema files - Remove javascript debugger call Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83898 [details] [review] Bug 17047 - [QA Followup] - Fix untranslatable strings - Remove onclick html attribute - Remove useless passing of mana_id variable in serials-toolbar.inc - Remove using CGI::param in list context - remove new subs from serials/subscription-add.pl - remov Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83899 [details] [review] Bug 17047 - Move ability to comment mana entities from search results table to report/subscription detail page + code refactoring Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83900 [details] [review] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83901 [details] [review] Bug 17047 - Fix retrieving Mana token Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83902 [details] [review] Bug 17047 - Remove changes on Koha/Schema/Result/SavedSql.pm and Subscription.pm - mana.inc included twice Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83903 [details] [review] Bug 17047 - Move mana JS and put correct subscription id when sharing Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83904 [details] [review] Bug 17047: Fix unit tests Replace MANA_IP variable with subroutine Fix QA script warnings Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83905 [details] [review] Bug 17047: Koha::SharedContent subs snake casing/renaming manaRequest => process_request manaIncrementRequest => increment_entity_value manaPostRequest => send_entity prepareSharedData => prepare_entity_data manaGetRequestWithId => get_entity_by_id manaGetRequest => search_entities buildRequest => build_request manaUrl => get_sharing_url Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83906 [details] [review] Bug 17047: add a dedicated page for Mana setup Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83907 [details] [review] Bug 17047: [DO NOT PUSH] provide staff-global.css Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83908 [details] [review] Bug 17047: [DO NOT PUSH] provides schema files Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83909 [details] [review] Bug 17047: Fix reports sharing Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83910 [details] [review] Bug 17047: [QA tool] add template filters Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83911 [details] [review] Bug 17047 [QA Followup] - Fixes to make unit tests pass Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 83912 [details] [review] Bug 17047 [QA Followup] - Don't enable by default Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 84142 [details] [review] Bug 17047: QA fixes: - don't search subscriptions when mana is disabled, - subscription detail page: don't show share button or search link if Mana is disabled, - fix report sharing, - submit report search form by pressing enter, - add a waittin Created attachment 84145 [details] [review] Bug 17047: QA fixes: - don't search subscriptions when mana is disabled, - subscription detail page: don't show share button or search link if Mana is disabled, - fix report sharing, - submit report search form by pressing enter, - add a waittin foo Created attachment 84210 [details] [review] Bug 17047: (follow-up) Improve mana messages, enable by default, show messages if not configured (In reply to Nick Clemens from comment #422) > Created attachment 84210 [details] [review] [review] > Bug 17047: (follow-up) Improve mana messages, enable by default, show > messages if not configured Hi Alex, I added a followup to enable by default, show a helpful tip if not configured, and updated some language - if this one is okay can you remove the third option from the syspref, squash the followups and then I think we can push this one. -Nick Hi all, as this means you are communicating with an external server, I am not sure if we should enable by default. I think all those should be opt-in choices. Even an IP address is considered personal data. So last comment doesn't get missed (it's a looong bug) (In reply to Katrin Fischer from comment #424) > Hi all, as this means you are communicating with an external server, I am > not sure if we should enable by default. I think all those should be opt-in > choices. Even an IP address is considered personal data. If it the syspref is set to 0, BUT there is no mana token, there's no communication. The patch just remove the syspref value "I haven't decided" and replace it by "set to yes + no token = the librarian hasn't decided" And the token is set only when the library ask for it by clicking on the "get token button". Hi Paul, thx for replying! I've applied the patches and taken a look at the configuration page. What's the difference between the 'no' and 'no, let me think about it'? Where is it explained? I think as the system preference reads "Enable request to Mana Webservice" this is not clear to the user that there is no communication without the token. I would feel better if we left to "no". We can still advertise Mana of course - I am not against the service at all, but I feel we should be consistent and clear about protecting user's privacy. Noticing while testing: commmit messages are a bit messy and not following guidelines (old patch, I know, but easy to fix). I even volunteer doing it :) Created attachment 84260 [details] [review] Bug 17047 add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 84261 [details] [review] Bug 17047 subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 84262 [details] [review] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 84263 [details] [review] Bug 17047: add a dedicated page for Mana setup Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 84264 [details] [review] Bug 17047: [DO NOT PUSH] provide staff-global.css Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 84265 [details] [review] Bug 17047: [DO NOT PUSH] provides schema files Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> (In reply to Nick Clemens from comment #423) > (In reply to Nick Clemens from comment #422) > > Created attachment 84210 [details] [review] [review] [review] > > Bug 17047: (follow-up) Improve mana messages, enable by default, show > > messages if not configured > > Hi Alex, > > I added a followup to enable by default, show a helpful tip if not > configured, and updated some language - if this one is okay can you remove > the third option from the syspref, squash the followups and then I think we > can push this one. > > -Nick Hi Nick, Removed the third option, restore the IGNORE in SQL statement to make it idempotent and did a big squash. (In reply to Katrin Fischer from comment #427) > Hi Paul, thx for replying! > > I've applied the patches and taken a look at the configuration page. What's > the difference between the 'no' and 'no, let me think about it'? Where is it > explained? I think as the system preference reads "Enable request to Mana > Webservice" this is not clear to the user that there is no communication > without the token. I would feel better if we left to "no". We can still > advertise Mana of course - I am not against the service at all, but I feel > we should be consistent and clear about protecting user's privacy. > > Noticing while testing: commmit messages are a bit messy and not following > guidelines (old patch, I know, but easy to fix). I even volunteer doing it :) Hello Katrin, It was a way to promote the feature (i say "it was" since we decided to remove this third option). "No, let me think about it" was the default choice, and, in this case, the user saw a message telling him he has not decided yet to use or not Mana. You can communicate with Mana if you did not set a token. You can retrieve subscriptions and reports but not share them. (In reply to Alex Arnaud from comment #435) guidelines (old patch, I know, but easy to fix). I even volunteer doing it :) > > Hello Katrin, > > It was a way to promote the feature (i say "it was" since we decided to > remove this third option). > "No, let me think about it" was the default choice, and, in this case, the > user saw a message telling him he has not decided yet to use or not Mana. > > You can communicate with Mana if you did not set a token. You can retrieve > subscriptions and reports but not share them. Thx Alex for clearing this up! In this case I really think we should default to no, like we do for other external services like Covers, Hea etc. I see the file attached. What could be a good way to provide that information to the users interested in Mana? We could update the wiki page: https://wiki.koha-community.org/wiki/Mana_central_database. Adding the information to the manual might also be good. (In reply to Katrin Fischer from comment #436) > Thx Alex for clearing this up! In this case I really think we should default > to no, like we do for other external services like Covers, Hea etc. mana defaulted to yes/no token is similar to "I haven't explicitly decided". If we set it to "no" by default, then the library can miss the feature. I want to avoid the hea case where the default set to "no" result in many libraries missing the feature, and not saying "I don't want to share". the proposed behavior is harmless from privacy as well as from ergonomics point of view. So I really think we must not default to "no" and the proposed change is fine. Hea is a good example of something we could have promoted better: how many libraries are not sharing because they don't know that hea exist vs not sharing because they don't want to share ? I want to avoid this behavior. > I see the file attached. What could be a good way to provide that > information to the users interested in Mana? > > We could update the wiki page: > https://wiki.koha-community.org/wiki/Mana_central_database. Adding the > information to the manual might also be good. I agree with promoting & documenting. But that's not enough, many libraries don't read the doc, or don't investigate. Add the case where an IT makes upgrade and the library don't even know... So making mana visible in the staff interface, to be sure the librarian chose, and not only "don't know" is the way to go. Hea is actually sending data. While it's not personal data, I still think having Hea turned off by default was the only way to go. We should not create an application that is calling home without asking. I actually liked your approach with the third option - turn off, but show a message to give them a note. Maybe this idea could be explored further? But ultimately it would be nice to get more opinions on this, because we won't agree :) (In reply to Katrin Fischer from comment #438) > Hea is actually sending data. While it's not personal data, I still think > having Hea turned off by default was the only way to go. We should not > create an application that is calling home without asking. > > I actually liked your approach with the third option - turn off, but show a > message to give them a note. Maybe this idea could be explored further? > > But ultimately it would be nice to get more opinions on this, because we > won't agree :) Hey, but we agree !!! I fully agree that we don't want to activate HEA by default ! The mistake we made, was to set it OFF by default. The right approach would have been to have "undecided yet" by default. And show the "please, look at HEA, there's some important decision we want YOU do take". So the library can be warned they have a decision to take, a choice to make. I'm sure that it would have been resulting in more libraries sharing. That's what I wanted to avoid with MANA, and that's what's Kyle patch improve: our initial dev was a syspref with 3 status (explicit yes, explicit no, no explicit decision), and kyle found a way to have those 3 options with a binary syspref and the token * syspref=yes / token empty => no explicit decision * syspref=yes / token filled => explicit decision * syspref=no => explicit decision do you agree that we agree ? :D "No undecided" sounds fine to me indeed :) But I wonder if this is really the behaviur of the current patches? I think it said "Enabled" when I test installed the other day. But I won't have time for another test the next days :( (In reply to Katrin Fischer from comment #440) > "No undecided" sounds fine to me indeed :) > > But I wonder if this is really the behaviur of the current patches? I think > it said "Enabled" when I test installed the other day. But I won't have time > for another test the next days :( Katrin, Does that means you are ok for the third option (the so called "No, let me think about it") as described above ? (In reply to Alex Arnaud from comment #441) > (In reply to Katrin Fischer from comment #440) > > "No undecided" sounds fine to me indeed :) > > > > But I wonder if this is really the behaviur of the current patches? I think > > it said "Enabled" when I test installed the other day. But I won't have time > > for another test the next days :( > > Katrin, > > Does that means you are ok for the third option (the so called "No, let me > think about it") as described above ? Yes, if I understood the feature correctly, I would be fine. I understand it would mean off by default, but with an information to the user that they might want to turn it on. Turning it yes or no would turn the message off. Created attachment 84323 [details] [review] Bug 17047: add Mana-KB syspref Add the system preference to enable or disable Mana-KB webservice on koha. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 84324 [details] [review] Bug 17047: subscriptions management with Mana-KB - add a class SharedContent.pm to communicate with Mana-KB server - add a link in serials-menu.inc to serials_search.pl to open a mana-subscription research form - modify the research form in serials-search.tt to show the right fields for Mana-KB - create datatable in mana-subscription-search-result.inc to show results from a research on Mana-KB - modify serials-search.pl to manage research on Mana-KB - add a mana_id to subscription table - add a share button on serials-toolbar.inc and a modal to ask the language of the share and to alert if the subscription is already link to a Mana-KB subscription model - add function in C4/Serials to get all the info for a subscription sharing - modify subscription-detail.pl to manage sharing to Mana-KB - modify subscription-add.tt and subscription.pl to manage a import from Mana-KB during a subscription creation - add 2 script in svc for ajax calling from subscription-add.tt to communicate with Mana-KB server during a asubscription creation - add a function in Subscription.pm to have all the info for a Mana-KB research from a biblionumber - modify functions used by subscription-add.pl in C4/Serials to manage a frequency which came from Mana-KB server and not already created on the koha database, and modify the tests of the said functions Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 84325 [details] [review] Bug 17047: SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB Test plan: 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example) <!-- URL of the mana KB server --> <!-- alternative value http://mana-test.koha-community.org to query the test server --> <mana_config>https://mana-kb.koha-community.org</mana_config> 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - Search the syspref ManaToken and follow the instructions 5 - subscriptions - Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled) - Share this serial with Mana-KB (on the serial individual's page there must be a Share button) - Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 6 - SQL Report - Create a new SQL report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it with mana => you will have a success message - On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 7 - Report mistakes. - On any table containing Mana-KB search results, you can report a mistake and add a comment. 8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 84326 [details] [review] Bug 17047: add a dedicated page for Mana setup Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 84327 [details] [review] Bug 17047: Add a third option for Mana system preference This adds the "No, let me think about it" option. It is the default option. If the Mana system preference is set to "No, let me think about it", the user is warned on the admin home page that he has not decided yet to use or not Mana knowlegde base. Created attachment 84328 [details] [review] Bug 17047: [DO NOT PUSH] provide staff-global.css Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 84329 [details] [review] Bug 17047: [DO NOT PUSH] provides schema files Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> I re-added the third "No, let me think about it" option. Also, reword the commit message to be consistent with the naming conventions. Need a signoff for this last patch. Created attachment 84332 [details] [review] Bug 17047: Add a third option for Mana system preference This adds the "No, let me think about it" option. It is the default option. If the Mana system preference is set to "No, let me think about it", the user is warned on the admin home page that he has not decided yet to use or not Mana knowlegde base. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Awesome work all! This adds Mana with default setting 'No,let me think about it' which advertises the feature. I think before release we may want to consider a way to move this to a yes/no, but I think it will help advertise for testing and usage before release. Pushed to master for 19.05 This enhancement will not be backported to the 18.11.x series. Please add POD to Koha::SharedContent: perldoc Koha/SharedContent.pm DESCRIPTION Package for accessing shared content via Mana Package Functions process_request increment_entity_value send_entity prepare_entity_data get_entity_by_id search_entities build_request get_sharing_url (In reply to Jonathan Druart from comment #454) > Please add POD to Koha::SharedContent: > > perldoc Koha/SharedContent.pm > > DESCRIPTION > Package for accessing shared content via Mana > > Package Functions > process_request > increment_entity_value > send_entity > prepare_entity_data > get_entity_by_id > search_entities > build_request > get_sharing_url Moved to Bug 22358 - Add POD to Koha::SharedContent A couple of things wrong in serials/subscription-add.pl 1. 447 if ( defined( $query->param('mana_id') ) ) { It's always defined, you wanted to test with "" 2. 375 if ( (C4::Context->preference('Mana')) and ( grep { $_ eq "subscription" } split(/,/, C4::Context->preference('AutoShareWithMana'))) ){ Mana == 2 == let me think about it => I am not expecting to reach Koha::SharedContent in that case *** Bug 17045 has been marked as a duplicate of this bug. *** (In reply to Jonathan Druart from comment #456) > A couple of things wrong in serials/subscription-add.pl > > 1. > 447 if ( defined( $query->param('mana_id') ) ) { > > It's always defined, you wanted to test with "" > > 2. > 375 if ( (C4::Context->preference('Mana')) and ( grep { $_ eq > "subscription" } split(/,/, C4::Context->preference('AutoShareWithMana'))) ){ > > Mana == 2 == let me think about it > => I am not expecting to reach Koha::SharedContent in that case Should we move this to a separate bug as well? t/db_dependent/Koha/SharedContent.t:C4::Context->set_userenv(0,0,0, ->set_userenv should no longer be used in tests. See bug 21817. (In reply to Katrin Fischer from comment #458) > (In reply to Jonathan Druart from comment #456) > > A couple of things wrong in serials/subscription-add.pl > > > > 1. > > 447 if ( defined( $query->param('mana_id') ) ) { > > > > It's always defined, you wanted to test with "" > > > > 2. > > 375 if ( (C4::Context->preference('Mana')) and ( grep { $_ eq > > "subscription" } split(/,/, C4::Context->preference('AutoShareWithMana'))) ){ > > > > Mana == 2 == let me think about it > > => I am not expecting to reach Koha::SharedContent in that case > > Should we move this to a separate bug as well? See bug 22849, I would have expected someone else to deal with that. I have opened the bug report, it's blocker for 19.05 IMO. Comments should not be ignored, even when the work is pushed. (In reply to Jonathan Druart from comment #459) > t/db_dependent/Koha/SharedContent.t:C4::Context->set_userenv(0,0,0, > > ->set_userenv should no longer be used in tests. See bug 21817. See bug 22850. Comment on attachment 84325 [details] [review] Bug 17047: SQL reports management with Mana-KB Hidden gem in https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84325&action=diff&headers=0#a/reports/guided_reports.pl_sec3 ➟ 185 'mana_success' => $input->param('mana_success'), 186 'mana_success' => scalar $input->param('mana_success'), "Double Mana" feature, but of course that's the hash so first one useless + more: it generates warning: /koha/intranet/cgi-bin/reports/guided_reports.pl line 188 |