← Previous day | Today | Search | Index
All times shown according to UTC.
Time | Nick | Message |
---|---|---|
18:55 | nengard | hello all - anyone around who wants to try and teach me how to read some Koha code? |
18:55 | pianohacker | I'm available. What did you have in mind? |
18:56 | nengard | hiya pianohacker :) |
18:56 | pianohacker | Hey :) |
18:56 | nengard | I am trying to tackle a bug that is bothering me - but is of minor importance at this time. # 2430 |
18:56 | I have open branchtransfers.pl and Branches.pm | |
18:57 | pianohacker | Let's see |
18:57 | nengard | I see that GetBranches pulls branches in alpha order on line 112 |
18:57 | but I'm not sure why it's not showing that way on the *.pl | |
18:57 | is it simply that ORDER BY branchname is missing the ASC? | |
18:58 | pianohacker | Nope; the order by has no effect |
18:58 | nengard | so i'm in the wrong file :) ?? |
18:58 | pianohacker | Rather than returning the branches as a list (which would preserve the ordering) |
18:58 | (you're in the right file) | |
18:59 | It returns them as a "dictionary"; a structure which has an entry for each branchcode containing the branch details | |
18:59 | Unfortunately, dictionaries have no inherent ordering | |
18:59 | So it'll display the branches in random order | |
18:59 | Does that make sense? | |
18:59 | nengard | yes |
18:59 | so far :) | |
19:00 | pianohacker | So what we really need is a function that returns a list of branches |
19:00 | nengard | so we need to add a whole new function to Branches.pm for that? |
19:00 | pianohacker | Yup |
19:00 | GetBranchList or something similar | |
19:00 | nengard | ooo - so a whole new learning experience for me ... okay here's a procedure question |
19:00 | when adding a new function | |
19:01 | do we have rules on where to add them in the file? | |
19:01 | or what notes to include? | |
19:01 | pianohacker | Hmm |
19:01 | nengard | is there a document on this on the wiki somewhere - on procedure |
19:01 | or do i just make it work? :) | |
19:01 | pianohacker | I generally add it with other functions of similar function |
19:01 | nengard | makes sense |
19:01 | pianohacker | And try to go along with the general form of the file |
19:02 | So if every other function name in the file starts with IPersonallyBelieve, I start my function name that way | |
19:02 | etc | |
19:02 | nengard | k - i'm going to try and tackle this - cause i really want to get more into the code and this is the smallest bug I can find to try on :) |
19:03 | hmm | |
19:03 | pianohacker | The only other thing to keep note of is that it's nice to add POD documentation (those sections starting with =head2 and ending with =cut) |
19:03 | nengard | there is a function that will do this :) GetBranchName() |
19:03 | no - wait ... it wan'ts a particular branch | |
19:03 | pianohacker | Yeah |
19:04 | Oh, wait | |
19:04 | There's GetBranchesLoop | |
19:04 | nengard | i saw that one |
19:06 | i don't know much about this kind of loop in Perl - how would i get this loop to sort things? | |
19:06 | pianohacker | It should already do that |
19:06 | nengard | can I just use the sort() function? |
19:06 | oh | |
19:06 | hmmmm | |
19:07 | oh way - so i need to change the pl file to use this function instead of the one it is using which is GetBranches | |
19:07 | pianohacker | Yup |
19:07 | nengard | bingo |
19:07 | okay | |
19:14 | alright - there is some essential Perl knowledge I'm missing. I changed the call to GetBranches to GetBranchesLoop | |
19:14 | and got an error | |
19:14 | I assume because the next call to GetBranch is expecting the dictionary | |
19:14 | not the results returned by the loop | |
19:14 | pianohacker | Yup |
19:15 | nengard | so - the question is ... what do i do :) hehe |
19:15 | pianohacker | I'll be right back |
19:15 | nengard | np |
19:20 | pianohacker | Okay, so $tobranchcd is the branch we want to pre-select |
19:21 | nengard | and that is our branch - right? |
19:21 | no | |
19:21 | that's the branch we're sendign to | |
19:23 | i think i picked a bug that looked easy but really isn't ..... | |
19:30 | bleh - giving up :( need to find some classes on Perl - going to water plants instead | |
19:31 | thanks pianohacker - ttyl | |
22:31 | chris | morning |
22:46 | brendan | hey good morning chris |
22:53 | chris | heya brendan, quick question do you have a gpg key? |
23:15 | brendan | hmmm... haven't looked at it... googling now |
23:16 | not sure it's the same -- but I have a public key that I generate myself | |
23:30 | chris | right, something like http://biglumber.com/x/web?ev=44011 |
23:56 | hey nate | |
23:57 | Nate | whats up chris |
23:57 | im an irc newbee | |
23:58 | chris | you'll find your way around pretty fast |
23:58 | brendan | heya nate |
23:58 | chris | the weekend is a good time to look around, its pretty quiet |
23:59 | Nate | cool im psyched to check it out |
00:00 | chris | im gonna have to head out now, to go eat yum cha, then take my son and my nephew to see the orchestra |
00:00 | Nate | sounds fun if there is one instrument i would love to master it would be the violin |
00:01 | chris | http://wotzon.com/eventlisting[…]?event_id=5021369 |
00:02 | Nate | that looks like a blast! |
00:02 | luckeeeee | |
00:02 | chris | yep, should be fun, ok, im okay here cya later :) |
00:03 | Nate | later |
03:09 | brendan | hey good night all |
05:32 | chris | brrr |
← Previous day | Today | Search | Index