Sunday, 2010-08-15

*** Joins: paulr (~paul@cpc1-enfi9-0-0-cust389.hari.cable.virginmedia.com)04:56
*** Quits: giallu (~giallu@fedora/giallu) (Ping timeout: 264 seconds)05:02
*** Joins: istvanb (56ade708@gateway/web/freenode/ip.86.173.231.8)06:48
*** Joins: dhx_m (~anonymous@c122-107-170-247.eburwd5.vic.optusnet.com.au)06:48
istvanbhi there06:49
istvanbis there any documentation exists for the mantis php functions? I mean like the user_get_email($t_recipient) etc?06:50
istvanbyesterday I have spent a quite reasonable amount of time to write my function, which did exactly the same as the user_get_email :)06:51
*** Quits: dhx_m (~anonymous@c122-107-170-247.eburwd5.vic.optusnet.com.au) (Remote host closed the connection)07:38
paulristvanb: you could try http://www.mantisforge.org/cruisecontrol/buildresults/mantisbt?tab=documentation07:40
paulrprobablyu more specifically http://www.mantisforge.org/cruisecontrol/artifacts/mantisbt/20100802185453/api/elementindex.html07:41
* paulr hopes dhx is coming back07:41
istvanbthanks man07:41
istvanbI will try07:41
istvanbI am working on a mantis plugin07:41
istvanbif I am done, who can revise it?07:42
paulr?07:42
istvanbI guess if I create a plugin somebody has to check it07:44
istvanbis that true?07:44
istvanbI am also wondering if I can get a help for my plugin from a developer. I have no experience in php at all (however have a coding history of 15 years), so this is my first project07:48
paulri'm sure people will answer questions if you get stuck07:53
istvanbok07:56
istvanbI have a question then, maybe you can answer it07:56
paulrtry07:56
istvanbI'd like to create a multiple selection box with all the user groups (admin, reporter, viewer etc)07:56
istvanbI have found the following function:07:56
istvanb<?php print_project_access_levels_option_list (null) ?>;07:57
istvanbthe problem with this: it also adds the [default access level] at the first element07:57
istvanbI dont want this to be there07:57
istvanbdo you know how the exclude this?07:58
paulrprint_project_access_levels_option_list only shows access levels below the person viewing it08:01
paulri didn't realise it added a default08:01
paulrand at least, can't see where it adds default08:01
istvanbok, then let me rephrase08:02
istvanbI need a box displaying the access levels (all of them). I am stuck with the function above, any solution would be fine for me08:02
paulrcould always make your own function using  print_project_access_levels_option_list as a base08:09
paulrfor nwo08:09
istvanbok08:11
istvanbnow I see why it displays the default level08:11
istvanbin the print api definition08:12
istvanbthereis a line echo '<option value="' . DEFAULT_ACCESS_LEVEL . '"';08:12
istvanbif I comment this then the defult level is gone08:12
istvanbhowever I rather somehow eliminate it from my list instead of writing my own function. Would be much better and easier to understand08:13
paulrwhat version are you developing against?08:16
istvanb1.2.0 or above08:16
istvanbhowever my plugin is using only very basic functionalities so probably it would work with previous versions as well08:16
paulrhttp://git.mantisbt.org/?p=mantisbt.git;a=commitdiff;h=101d87befda99950e7df8cabe2af5f1d4b7591be08:17
paulrseems that's changed in trunk :)08:17
istvanbis this for the 1.2.2?08:20
istvanbon my PC I have 1.2.108:20
paulrprobably more 1.3-dev08:24
istvanbyeah08:24
istvanb$t_access_levels_enum_string = config_get( 'access_levels_enum_string' ); $t_enum_values = MantisEnum::getValues( $t_access_levels_enum_string ); foreach ( $t_enum_values as $t_enum_value )  { $t_access_level = get_enum_element( 'access_levels', $t_enum_value ); echo '<option value="' . $t_enum_value . '"'; check_selected( $p_val, $t_enum_value ); echo '>' . $t_access_level . '</option>'; }08:29
istvanbok08:29
istvanbI have copied the stuff from the print api08:29
istvanband deleted some lines08:29
istvanbit seems to be working for me08:29
istvanbits quite difficult to code something if you dont know the language:)08:30
istvanbis there any specific php development tool, which has the feature to display the function definition easily?08:31
istvanbbecause now I always have to search the files to find the funtion definition08:32
paulrnot sure08:34
paulrI tend to know mantis' code fairly well08:34
paulrso know where to look08:34
istvanb:)08:35
istvanbeasy for you then :)08:36
istvanbok, next question08:40
istvanbhow can I add my pluginpage to the menu bar at the top (where the my view etc tabs are)08:41
paulrpretty sure there's an event08:52
istvanbnext question08:54
istvanbI am on the config page08:54
istvanband the button redirect me to the config_edit.php08:54
istvanbwith the gpc command I can get the content of a specific field from the config.php08:55
istvanbgpc_get_int( 'sajat_blabla_threshold', ADMINISTRATOR );08:55
istvanbwhat the ADMINISTRATOR means here?08:55
paulriirc, default value08:57
istvanbiirc? whats that?08:57
paulrif I recall08:57
istvanboh :)08:58
istvanbnow08:58
istvanblets say I set a value to reporter than press the button08:58
istvanbhopefully it sets the variable to reporter, and then redirects me to the config.php08:59
istvanbthe enum shows Admin again08:59
istvanbis this expected, or it should show reporter and I made a mistake?08:59
istvanbits a mistake09:00
paulrcheck_selected( $p_val, $t_enum_value )09:00
paulrdepends what you pass in as $p_val09:00
paulror load in or whatever09:00
istvanbwhen I do the same with the tasks plugin09:00
istvanbit shows what I have set09:00
istvanbgeez its not easy to start coding in php :)09:01
istvanbok, now I have it09:02
istvanbthis is resolved09:02
istvanbI have queried back something else, thats why it displayed admin all the time09:02
istvanbso now I have a config.php and a config_edit.php which should work fine09:05
istvanbI also have the page which realizes the function I'd like to achive09:05
istvanbso somehow depending on the access level I have to make the function page accessible for the users09:06
istvanbdo you have a clue how to do this?09:06
istvanbok... its enough from geeky stuff for today :)09:20
istvanbmaybe I will continoue later:)09:20
istvanbtake care all!09:20
*** Quits: istvanb (56ade708@gateway/web/freenode/ip.86.173.231.8) (Quit: Page closed)09:23
*** Joins: dhx_m (~anonymous@c122-107-170-247.eburwd5.vic.optusnet.com.au)10:48
paulrlo dhx_m11:42
paulrgone to bed yet?11:42
*** Joins: hcl2_ (~hardcorel@75.41.110.112)12:29
* paulr pokes nuclear_eclipse13:14
paulrsiebrand: lo?15:16
*** Joins: djSupport (~djsupport@94-193-2-113.zone7.bethere.co.uk)16:26
*** Joins: fanno (~Morten@90.184.93.233)17:49
paulrwow17:58
paulrthis code is like17:58
paulrspaghetti17:59
*** Joins: Renegade15 (Renegade@unaffiliated/renegade15)18:03
Renegade15good evening18:03
paulrdo you like  spaghetti?18:05
Renegade15as a god or as food?18:06
paulrin php :)18:06
Renegade15I would rather prefer straight-forward code, if that's the question.18:07
* paulr waits patiently for dhx :)18:08
Renegade15I'm having a weird issue with plugin_lang_get(): I have a MantisColumn-derived class in a second file, and I'm trying to get a language string in there. In the primary file, plugin_lang_get('string name', 'plugin name') works fine - in the second file, the exact same (copy-pasted) code gives me an Application Error 300, claiming the string doesn't exist18:08
Renegade15what's confusing me is that the error includes the manufactured string name, so obviously it did call the function and tried to get the string - so it shouldn't be a scope issue o_O18:09
Renegade15the only thing that stands out to me is that the string name in the error doesn't include the s_ prefix, but as said - the exact same code works in the primary file18:10
Renegade15does anyone have any idea what could be going wrong?18:10
paulrthat's a nuclear_eclipse type of question18:11
paulrheh18:11
Renegade15I figured18:11
* Renegade15 pokes nuclear_eclipse 18:11
Renegade15so while I'm waiting for the God of Plugins...what's this about spaghetti?18:15
Renegade15is mantis being invaded by goto?18:15
* micahg sighs...goto18:18
paulrwell,18:24
micahgtry{assert(!defined(NOSTALGIC_FOR_BASIC));}catch exception(){goto 1975;} :)18:24
paulrwhen a helper function calls a custom function that calls18:24
paulr:)18:24
Renegade15reminds me of the notification e-mail code I was looking at yesterday18:26
Renegade15speaking of which, I have another, unrelated weird issue18:26
paulrcustom functions need to die18:26
paulr:)18:26
paulrmantis is great - you can configure everything :)18:26
paulrbut that's also a downside18:27
paulras whenever someone asks something18:27
paulrwithout looking yourself18:27
nuclear_eclipseRenegade15: are you sure the lang string is defined correctly for your plugin?  ie it should be defined as $s_plugin_PLUGINNAME_some_string = ...18:27
paulryou've got no chance :)18:27
Renegade15notification e-mails pertaining to bug updates and stuff show a normal url to the bug; notification e-mails about bug notes apparently show the absolute server path instead. I believe the dev reporting the problem implied it happened for notes added by the source code integration user account. Any ideas what could cause that?18:27
Renegade15nuclear_eclipse: As said in the description, I tried the exact same code in the primary file and it worked as expected18:28
Renegade15so yes, I'm sure18:28
paulrnuclear_eclipse: I think i've managed to sync the stuff I did in february :)18:28
nuclear_eclipseI have no other idea, I've never had that problem18:28
paulr(almost)!18:28
Renegade15weird18:30
nuclear_eclipseRenegade15: my only other suggestion is to post the code, and I can take some time to look it over and see if I can find the problem (not tonight though)18:30
paulrnuclear_eclipse: check i've not broken anything today too ;p18:31
* nuclear_eclipse is afraid to look18:31
paulrwell, I did the lang_api change18:32
paulrwhich dhx/(maybe you) reviewed before18:32
CIA-103Mantisbt: paul * rd4c9fb68cbde /core/lang_api.php: Update lang api for new language files18:32
paulrand changed logging a bit18:32
CIA-103Mantisbt: paul * r272bde39d6e0 /bug_view_inc.php: compress_api.php is included by core.php18:32
CIA-103Mantisbt: paul * rcad0ad10f410 /lang/ (50 files): Convert language files to array format18:32
CIA-103Mantisbt: paul * r3ea2997ae1b2 / (12 files in 7 dirs): Diagnostic Logging18:32
CIA-103Mantisbt: paul * rf15d1bfa8139 /core/custom_function_api.php: Arguments for config_get are incorrect - order should be user,project18:32
CIA-103Mantisbt: paul * r8b4f607488f2 /core/helper_api.php: This block of code, is currently pointless:18:32
nuclear_eclipsepaulr: one question, does your lang_api change break the way plugins currently work?18:32
paulrI dont think so18:32
Renegade15on principle, sure, though there's really not much to look at - it works in one file, and doesn't work in the other. The only difference is that it's not directly in the class declaration (only via required_once), but that's what I'm passing the base name for; the same approach is working fine for plugin_table18:32
paulrit's backwards compatible18:33
paulri.e.18:33
paulrstring / array formats18:33
paulri've had german strings + english array18:33
paulrenglish strings + german array18:33
nuclear_eclipseok18:33
paulrand it's shown language i'd expect i.e. german/english18:33
paulri've also tested all language files18:33
paulrto be fair, I've not tested plugin's specifically today18:33
nuclear_eclipsepaulr: would be greatly appreciated if you did taht18:34
paulrneed to know if I need to add @author's tags back into the converted files or whether CREDITS is still up to date18:34
paulrI still get german/english plugins for graphs18:35
paulrthe logging change was to try to start to tidy up18:36
paulrand maybe be a bit more useful18:36
* paulr would kinda like to simplify some of the config *a bit*18:37
paulralbeit, we ofc need all the thresholds etc18:37
paulrif i've broken something18:37
paulremail me paul@mantisforge.org18:37
paulrand it appears in my IM client now18:37
Renegade15okay18:54
* Renegade15 pokes nuclear_eclipse 18:55
Renegade15I got it to work18:57
Renegade15but the how is not exactly clearing things up for me18:57
Renegade15I simply added a single line $foo = plugin_lang_get('option_desc_prefix', 'TripleI'); before requiring the second file, and that magically made all strings load properly18:59
Renegade15is it possible plugin strings aren't loaded until a load request comes from inside the plugin class or something?18:59
paulr# This function prints the custom buttons on the current view page based on specified bug id19:02
paulr# and the context.  The printing of the buttons will typically call html_button() from19:02
paulr# html_api.php.  For each button, this function needs to generate the enclosing '<td>' and '</td>'.19:02
paulrfunction custom_function_default_print_bug_view_page_custom_buttons( $p_bug_id ) {19:02
* paulr ponders19:02
nuclear_eclipseRenegade15: hmm19:03
Renegade15just checked, it also works without the base name parameter within the plugin class...so basically, as long as there's at least one language request beforehand in the primary file/plugin class, it works fine externally19:03
Renegade15looks to me like "external" calls simply don't trigger loading19:03
*** Quits: fanno (~Morten@90.184.93.233) (Quit: Leaving.)19:14
*** Quits: paulr (~paul@cpc1-enfi9-0-0-cust389.hari.cable.virginmedia.com) ()19:39
*** Quits: scribe9343423 (~scribe934@static.96.23.63.178.clients.your-server.de) (Remote host closed the connection)20:00
*** Joins: scribe9343423 (~scribe934@static.96.23.63.178.clients.your-server.de)20:00
*** Quits: hcl2_ (~hardcorel@75.41.110.112) (Read error: Operation timed out)21:52
*** Quits: Renegade15 (Renegade@unaffiliated/renegade15) (Quit: If the chat tips over, save the angels.)23:15

Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!