Re: [MRBS-general] FW: Auto filling out Full Description box
Brought to you by:
jberanek
From: Campbell M. <cam...@gm...> - 2013-12-09 14:37:07
|
Yes, that should be correct. Can you insert var_dump($name); var_dump($custom_fields); var_dump($POST); var_dump($HTTP_POST_VARS); just after $name=$custom_fields['Teacher']; and tell me what you get. Thanks, Campbell From: Max Goulden [mailto:ma...@fm...] Sent: 09 December 2013 14:19 To: ma...@ca...; 'General purpose list (support/developers/users)' Subject: RE: [MRBS-general] FW: Auto filling out Full Description box $var = VAR_PREFIX . $field['name']; $custom_fields[$field['name']] = get_form_var($var, $f_type); if (($f_type == 'int') && ($custom_fields[$field['name']] === '')) { $custom_fields[$field['name']] = NULL; } } } $name=$custom_fields['Teacher']; // (3) Clean up the form variables // ------------------------------- // Form validation checks. Normally checked for client side. // Don't bother with them if this is an Ajax request. if (!$ajax) { if ($name == '') { invalid_booking(get_vocab('must_set_description')); } Is that correct as this give the older error "Invalid Booking you must set a brief description for the booking.." Max From: Campbell Morrison [mailto:cam...@gm...] Sent: 09 December 2013 2:04 PM To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] FW: Auto filling out Full Description box Should be $name=$custom_fields['Teacher']; // (3) Clean up the form variables // ------------------------------- // Form validation checks. Normally checked for client side. // Don't bother with them if this is an Ajax request. if (!$ajax) { if ($name == '') From: Max Goulden [mailto:ma...@fm...] Sent: 09 December 2013 13:59 To: ma...@ca... <mailto:ma...@ca...> ; 'General purpose list (support/developers/users)' Subject: RE: [MRBS-general] FW: Auto filling out Full Description box these are the lines I have adjusted; // (3) Clean up the form variables // ------------------------------- // Form validation checks. Normally checked for client side. // Don't bother with them if this is an Ajax request. if (!$ajax) { if $name=$custom_fields['Teacher']; It throws up another error "Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /volume1/web/room/edit_entry_handler.php on line 150" Max From: Campbell Morrison [mailto:cam...@gm...] Sent: 09 December 2013 11:53 AM To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] FW: Auto filling out Full Description box You need to get rid of that name box and also overwrite the name field with the teacher by inserting $name = $custom_fields['Teacher']; at line 142 in edit_entry_handler.php Campbell From: Max Goulden [mailto:ma...@fm...] Sent: 06 December 2013 15:55 To: ma...@ca... <mailto:ma...@ca...> ; 'General purpose list (support/developers/users)' Subject: RE: [MRBS-general] FW: Auto filling out Full Description box I did but that just get rid of the name 'box' and give you the error 'Invalid booking...' Max From: Campbell Morrison [mailto:cam...@gm...] Sent: 06 December 2013 3:50 PM To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] FW: Auto filling out Full Description box Looks like you haven't commented out the Brief Description field in edit_entry.php (line 1132 - see below) Campbell From: Max Goulden [mailto:ma...@fm...] Sent: 06 December 2013 15:45 To: ma...@ca... <mailto:ma...@ca...> ; 'General purpose list (support/developers/users)' Subject: RE: [MRBS-general] FW: Auto filling out Full Description box I put that in edit_entry_handler line 150 but still getting the error as attached Max From: Campbell Morrison [mailto:cam...@gm...] Sent: 06 December 2013 1:48 PM To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] FW: Auto filling out Full Description box OK. Sorry, it should have been $name = $custom_fields['Teacher']; Campbell From: Max Goulden [mailto:ma...@fm...] Sent: 06 December 2013 13:44 To: ma...@ca... <mailto:ma...@ca...> ; 'General purpose list (support/developers/users)' Subject: RE: [MRBS-general] FW: Auto filling out Full Description box Not a mistake... No worries I understand how picky php is with capitals, so had already put them in. Max From: Campbell Morrison [mailto:cam...@gm...] Sent: 06 December 2013 1:37 PM To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] FW: Auto filling out Full Description box Sorry - hope you spotted my mistake and used $name = $Teacher; and not $name = $teacher; Campbell From: Max Goulden [mailto:ma...@fm...] Sent: 06 December 2013 13:30 To: ma...@ca... <mailto:ma...@ca...> ; 'General purpose list (support/developers/users)' Subject: RE: [MRBS-general] FW: Auto filling out Full Description box like this $select_options['entry.Teacher'] = array('Mrs1', 'Miss1', 'Mrs2', 'Miss2'); $select_options['entry.Form'] = array('VR', 'VAE', 'VY', 'VHG'); $select_options['entry.Subject'] = array('Maths', 'English', 'Science', 'Art'); From: Campbell Morrison [mailto:cam...@gm...] Sent: 06 December 2013 1:19 PM To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] FW: Auto filling out Full Description box How have you made the drop_down array for the teacher? Have you used $select_options? Can you post your $select_options here, anonymising names if necessary? Campbell From: Max Goulden [mailto:ma...@fm...] Sent: 06 December 2013 13:17 To: ma...@ca... <mailto:ma...@ca...> ; 'General purpose list (support/developers/users)' Subject: RE: [MRBS-general] FW: Auto filling out Full Description box yes its showing the back ground colour From: Campbell Morrison [mailto:cam...@gm...] Sent: 06 December 2013 1:09 PM To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] FW: Auto filling out Full Description box So how do you know that the booking has been made? Has the colour of the slot changed? Campbell From: Max Goulden [mailto:ma...@fm...] Sent: 06 December 2013 12:46 To: ma...@ca... <mailto:ma...@ca...> ; 'General purpose list (support/developers/users)' Subject: RE: [MRBS-general] FW: Auto filling out Full Description box Do you mean that you can see a slot booked out because the colour has changed, but that there's no description in the box? yes nothing to click (before it was what was ever enter into the 'name' box showed up and was selectable). Max From: Campbell Morrison [mailto:cam...@gm...] Sent: 06 December 2013 12:15 PM To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] FW: Auto filling out Full Description box Sorry, not quite sure what you mean. Do you mean that you can see a slot booked out because the colour has changed, but that there's no description in the box? If so what happens when you click on the slot - is the description filled in on the view_entry page? Campbell From: Max Goulden [mailto:ma...@fm...] Sent: 06 December 2013 12:00 To: ma...@ca... <mailto:ma...@ca...> ; 'General purpose list (support/developers/users)' Subject: RE: [MRBS-general] FW: Auto filling out Full Description box Nearly there... It won't echo what should be automatically transferred into the "name". So you can see by the missing lines in the calendar view that something is booked out but no txt to click onto to see the booking. Max From: Campbell Morrison [mailto:cam...@gm...] Sent: 06 December 2013 9:56 AM To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] FW: Auto filling out Full Description box You need to overwrite the $name variable much earlier in edit_entry_handler.php, so that there's something there before the check for an empty field. I'd do it as soon as all the custom form variables have been read in, ie about line 142 in the 1.4.10 version. $name = $teacher; By the way, in edit_entry.php there's no need to comment out the function at lines 231-252. Just comment out the line where it's called line 1132, ie // create_field_entry_name(); Campbell From: Max Goulden [mailto:ma...@fm...] Sent: 06 December 2013 09:45 To: ma...@ca... <mailto:ma...@ca...> ; 'General purpose list (support/developers/users)' Subject: RE: [MRBS-general] FW: Auto filling out Full Description box Sorry but I keep getting this coming up "Invalid booking You must set a brief description for the booking. Please go back and enter one." In edit_entry.php I have commented out lines 231-252 starts function create_field_entry_name.. also line 1131 case 'name':... and in the file edit_entry_handler.php changed line 584 $booking ['name'] = $Teacher; Again thanks Max From: Campbell Morrison [mailto:cam...@gm...] Sent: 03 December 2013 6:00 PM To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] FW: Auto filling out Full Description box OK - well same thing, except overwrite $name (as the brief description is called, a little confusingly). Campbell From: Max Goulden [mailto:ma...@fm...] Sent: 03 December 2013 17:54 To: ma...@ca... <mailto:ma...@ca...> ; 'General purpose list (support/developers/users)' Subject: RE: [MRBS-general] FW: Auto filling out Full Description box Sorry Just got back and realised I had commented out the "Brief description" comment (in an earlier session), THIS is where I need the information from peoples selection to automatically go(hope that makes sense) Again your help is much appreciated as I have only just started to learn php, and this seems like an ideal project to do. Max From: Campbell Morrison [mailto:cam...@gm...] Sent: 03 December 2013 11:00 AM To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] FW: Auto filling out Full Description box OK, I understand. You'd need to modify MRBS to do this and so would need some knowledge of PHP. However the changes are fairly small. The easiest thing to do would be to - Remove/comment out the description field from the edit_entry.php page - In edit_entry_handler.php overwrite $description with the teacher, form and subject information This would achieve the result you want, though the teacher/form/subject information would be replicated in the database, which wouldn't be seen by your users and also whenever the description field appears in MRBS, eg in viewentry.php and reports. You could fix that by commenting out those fields as well. Campbell From: Max Goulden [mailto:ma...@fm...] Sent: 03 December 2013 10:37 To: ma...@ca... <mailto:ma...@ca...> ; 'General purpose list (support/developers/users)' Subject: RE: [MRBS-general] FW: Auto filling out Full Description box Thanks for the reply. Only because it what they see looking at the general calendar i.e. what in the description box From: Campbell Morrison [mailto:cam...@gm...] Sent: 03 December 2013 9:47 AM To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] FW: Auto filling out Full Description box If you already have the Teacher, Form and Subject information do you need to replicate it in the Description? Campbell From: Max Goulden [mailto:ma...@fm...] Sent: 03 December 2013 09:43 To: mrb...@li... <mailto:mrb...@li...> Subject: [MRBS-general] FW: Auto filling out Full Description box Hi, I am new to php, and finding your time tabling system looks as though it would be very useful to the school where I work. What I am trying to do is auto filling out the description box with drop down arrays I have made below it i.e. Teacher, Form, Subject so that teachers using it would not have to fill in the description's box. See attached Thanks for any help. Hurlingham School Ltd. is a company registered in England and Wales. Registered number:03921517. Registered office: 122 Putney Bridge Road, London SW15 2NQ. |