-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cost history enhancements #30
Conversation
Please feel free to reject this pull request -- I'm a git novice and have probably made a mess of things by mixing the code I'm working on to implement cost history tracking for our libraries with the Ajax-related code refactoring (in which I broke out each case in ajax_{forms,htmldata,processing}.php to a separate file). I would be happy to supply a patch against your master branch if that works better for you and you're interested in picking up the refactor. |
Thanks for your work on this. Is all of this code ready for testing and adding to the master repository? Your comment suggests that the cost history tracking code is still in progress. If that code is not ready for publishing, then please submit a new pull request containing just the refactored code, as you suggested. Again, thanks for contributing! |
As you can see, I've made a lot more changes. The code is pretty stable now, though; we're running it in a "sandbox" instance and it seems to be working just fine. Note: When I created the pull request I targeted your master branch but in retrospect that's a poor choice. |
We've passed our two week window on this one. Are we ready to merge it in? |
I have not tested this, but if it's passing other people's tests, then merge away. There seem to be some conflicts in the pull request though, so someone should probably look into that. |
Paul H., can you review and address the conflicts that Jeffrey mentioned? |
We are testing this after all. I've installed it on our test sever and our e-resources librarian will be taking a look at it soon. I'll report back any issues we encounter. |
Note for other testers, here is how I tested this patch. adding another remote source:git remote add flo https://github.com/fenway-libraries-online/coral-resources.git preparing the DB update and running itperl -i -pe "s/DATABASE_NAME/coral_resources_prod/g" install/protected/update_1.2_flo.sql updating configurationvi admin/configuration.ini restarting apache:/etc/init.d/apache2 restart |
Another problem : the DB update. It's too complex, without reason. the DB name will be provided when the file is run on mysql: |
How do I see the conflicts? |
Dates in US format area silly oversight on my part. :-( Display date format should IMO be a config file setting. I'll look into that. |
That's bizarre that you lost acquisition types. I'll fix that. I'll also remove the spurious |
Finally, the percent increase could be implemented in different ways; we chose to make it reflect the change in total expenditures from year to year, regardless of fund. However, when we presented the enhancement to our own internal customers -- the ERM librarians who worked on the spec -- they decided that they didn't want a percentage increase display after all, because they found it distracting and unhelpful. So perhaps the solution is to drop it from the enhancement. |
Le 20/02/2015 22:56, Paul Hoffman a écrit :
PS : when coming into date problems, the best solution is usually to Paul Poulain, Associé-gérant / co-owner |
Le 20/02/2015 23:01, Paul Hoffman a écrit :
Paul Poulain, Associé-gérant / co-owner |
Could someone please tell me how to view the conflicts in this pull request? I haven't been able to figure this out. |
Here's some info about resolving conflicts https://help.github.com/articles/resolving-a-merge-conflict-from-the-command-line/ |
That info is for committers; it doesn't help me. |
The commit conflicts that are preventing an automatic merge are what I was On Tue Feb 24 2015 at 2:57:22 PM Paul Hoffman notifications@github.com
|
Right -- and thanks for pointing me to the info you found -- but I don't know how to see which commit conflicts are preventing an automatic merge. I'm guessing that I need to clone the master repo anew, then attempt to merge my commits, but I can't quite get my head around how to do that. |
I see what you mean. I guess changes were made on the master branch between This page shows you the commits that the Master Resource module has This page shows the commits and changes you've made on your fork that Anywhere the same lines are changed or a file has been deleted will need to I hope that helps. On Tue Feb 24 2015 at 4:08:33 PM Paul Hoffman notifications@github.com
|
I have fixed the conflicts and successfully rebased onto the latest HEAD (commit 357fe9f). Or at least I believe that is so; GitHub still says that the pull request contains merge conflicts. (Do I need to submit a new pull request???) I have also fixed the problem with the DB upgrade SQL. Could someone please check to see if this looks OK before I proceed with fixing the date problem and deleting the percent change code? Finally, I would feel better having this enhancement committed onto a separate branch and then merged into master; is there some reason not to create a branch for significant changes such as this? |
I'd suggest that any major development should be merged by hand, not by using GitHub's auto-merge feature. You could comment on the GitHub issue and add a link to your latest branch. Then one or two people can test your branch and comment on the issue that they approve (or any concerns they have). When a few people are happy with it, someone can pull your branch to their own machine, merge it with master, and push it to the main GitHub repository. At that point it is considered "released" to the community, so we would need to change the version number, provide information about installing and using the changes, announce to the community, etc. Does that sound like a reasonable workflow to everyone? |
That sounds good to me. Here's a link: https://github.com/fenway-libraries-online/coral-resources The latest branch is master. |
I'm looking at the SQL code for upgrading to 1.1 and 1.2 (install/protected/update_1.1.sql and install/protected/update_1.2.sql) and they both have |
DATABASE_NAME is not useless; the upgrade script uses it:
|
From my quick investigation, it looks like the DATABASE_NAME prefix could be removed from the SQL file without causing harm to the installation/upgrade process. But I would want someone to test that. In general, I think there are better ways for accessing a specific database, such as the mysql_select_db() function that CORAL already uses. So I am happy for us to remove the prefix and the code that uses it. But that is not a necessary change right now, and it would slow down the process of releasing this code. I recommend that @PaulPoulain create a github "issue" for that change so we can address it separately, and if it is causing a lot of trouble for testing the db scripts, we can address it quickly. |
I've been going around in circles trying to fix the date picker bug that Paul Poulain spotted in the "Edit cost history" box. I figured out that I have to re-add date pickers when the user clicks on the "Add" button, so that the added row will get a date picker for each of its two date fields:
And indeed when I make that change works, in a way -- it adds a date picker to every date field, which means that the date fields that already existed on the page now have two date pickers. :-( So I tried this, which should (I think) remove the date pickers; now the code looks like this:
And indeed it does that, sort of -- the date pickers are removed, and the only date pickers are in the newly added row. Any ideas how to fix this? Should we just go ahead and merge the pull request with this bug present? |
Never mind, I figured it out. The fix is a hack, though -- it requires duplicating some code from jquery.datepicker, because the version we're using doesn't have the functionality we need. Here's the final addition just FTR; I'll commit the change in a minute:
|
Remington, are you OK with merging this now? |
-Check out the new code through GitHub https://github.com/ndlibersa/resources/ | ||
-If needed manually copy and overwrite all the files into the exiting resources directory. | ||
-Do not replace the existing directory. This will cause you to lose any settings, documents, etc. That you may have. Copying the new files over the existing files and replacing them will ensure you get the changes needed but not removing additional files. | ||
-Ensure that your your configuration file (/admin/configuration.ini) is still correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate word "your your", one should be removed.
Hm, the date picker fix does look pretty hacky. I'm impressed that you figured it out, but I think it's best if we can find a better way. So my colleague and I installed this branch, tested it, and found a slightly simpler fix. Tell me what you think. You should be able to replace your whole change with the following four lines: // Remove datepickers from clone Looking into it a little more, it seems we are on a very old version of jQuery, and an even older version of the date picker plugin. Ultimately, we need to upgrade CORAL to a modern version of jQuery and make sure we keep up with new versions in the future. But for now, I will create a separate issue for that. |
I've committed your revised fix. I agree on postponing a jQuery upgrade for now, FWIW. |
Also, regarding @PaulPoulain 's problem of losing acquisition types, maybe that was a misunderstanding? In our testing, we didn't lose those values, but we noticed they were moved to a separate edit form. And the new cost history form contains an empty "Cost Details" dropdown which might have been the cause of confusion. @PaulPoulain does that explain the problem you had? It might help to include some default values with this branch. I'm not really sure what the intended use of that dropdown is. @nkuitse can you comment on that and/or supply some default entries for the CostDetails table? |
The spec we worked up for the enhancement says the new CostDetails table "provides a controlled entry list for use at the institution's discretion" and my reading of things is that it's a way to give people a flexible (but controlled) way to categorize subscriptions or payments that is orthogonal to the payment type and fund, and that avoids shoehorning stuff into free-text notes. The only examples given in the spec are "FTE", "FTE 25", and "FTE 26". I've asked Kelly for clarification in case she has any additional insights -- she was deeply involved in the writing of the spec, which I was not. |
Kelly has the same take on CostDetails. Any chance of merging today or early next week? |
I still want to make sure @PaulPoulain wasn't experiencing a different bug. If he can confirm that his data wasn't actually lost, then we can prepare to merge. I'll try to catch him on IRC on Monday. |
@nkuitse I think we still need some user documentation for this branch. I see the upgrade instructions, but nothing about how to use the new features. |
@nkuitse you might be able to use the original spec to update existing user guide |
Where is the existing user guide? Our docs for 1.3 are here: https://docs.google.com/document/d/1tFLgc55hXSoU7aQ-pHjm09JAQaO40cZcIQ64LuGFb7Q/edit?usp=sharing I've generated a PDF of this but don't see where to put it. |
OK, I tried to test again, and, good news, the acquisition type empty does not come from the patch. It came from my sample database, that had it empty. Sorry for the useless warning. About the datepicker, I'm not sure I understand: applying only this patch, I still have the dates in US format. But I should ignore the problem, because it will be fixed by a jquery upgrade ? If yes, I'm fine with that, you can merge this patch imo. |
I'm glad to hear that the acquisition types weren't deleted. As for the US-centric display of dates -- it's not right, but it seems that's the way dates have always been displayed in CORAL Resources so at least we're not making matters worse. |
I have added a GitHub issue for improving the display of dates (issue #38). Otherwise, I believe this branch is ready to be merged into master. Thanks @nkuitse for the updated user guide. The PDF could be added to the CORAL website once we get login accounts figured out. @PaulPoulain are you able to work on that? Anything you need from us? |
am I able to work on that => you mean date display ? |
(and maybe the jquery update will help us fixing this annoying problem) |
Remington, do you want to go ahead and do the merge? We can post the updated guide to the discussion listserv until it has a permanent home on the website. |
@nkuitse can you email me, bjheet@gmail.com, your PDF copy of the updated resources module user guide? We'll replace the existing one on the coral website with it. @remocrevo would you mind handling the merge? I think we are ready. @nkuitse you may want to start crafting an announcement and get ready to send it to coral-erm@listserv.nd.edu. I think its past time to get this one finished and out there. |
I've just sent Ben the PDF. We'll work on an announcement. Thanks again! |
I've broken ajax_*.php down into separate files, one for each case in the three big switch statements.