Jump to content

Recommended Posts

Posted

Hello,I'd like to submit two patches for two bugs I found in phpvms, svn version:(1) in the pirep report page, the dropdown menu shows all airlines, regardless of being or not active.PATCH:

--- core/modules/PIREPS/PIREPS.php	2008-09-27 21:02:38.000000000 +0100+++ core/modules/PIREPS/PIREPS.php.new	2008-09-28 15:37:21.000000000 +0100@@ -155,7 +155,7 @@ 		Template::Set('pirepfields', PIREPData::GetAllFields()); 		Template::Set('bid', SchedulesData::GetBid($this->get->id)); // get the bid info 		Template::Set('allairports', OperationsData::GetAllAirports());-		Template::Set('allairlines', OperationsData::GetAllAirlines());+		Template::Set('allairlines', OperationsData::GetAllAirlines(true)); 		Template::Set('allaircraft', OperationsData::GetAllAircraft()); 		 		Template::Show('pirep_new.tpl');

(2) I found a bit more complicated to show custom fields in the pilots list template, so I updated the comment and sample code.PATCH:

--- core/templates/pilots_list.tpl	2008-09-01 22:10:32.000000000 +0100+++ core/templates/pilots_list.tpl.new	2008-09-28 17:01:31.000000000 +0100@@ -14,13 +14,18 @@ foreach($allpilots as $pilot) { 	/*-	 * To include additional fields,  uncomment this next line-	 * and then you can use the fields - $fields->VATSIM_ID for-	 * instance. your field name in all caps, and spaces replaced by -	 * an underscore+	 * To include additional fields,  uncomment the following lines,+         * set $fieldname to the desired field name (all caps, and spaces +         * replaced by an underscore), and use the result in $value. 	 */-	//$fields = PilotData::GetFieldData($pilot->pilotid);-	+        // $fieldname = "VATSIM_ID";+        // $value = "";+        // $fields = PilotData::GetFieldData($pilot->pilotid);+        // foreach($fields as $f) {+        //   if ($f->fieldname==$fieldname) {+        //     $value = $f->value;+        //   }+        // } ?> <tr> 	<td><a href="<?=SITE_URL?>/index.php/Pilots/reports/<?=$pilot->pilotid?>">

I'll probably have more in the near future, since I'm working hard to get phpvms working for my VA.All the best,Rodrigo Venturahttp://www.goldenjet-va.org

  • Administrators
Posted

Thanks, I've added the first patch. For the second one, I've changed how that works a bit, I just merged the fields into the main array. It's not in SVN yet, I'll commit tonight maybe, I'm adding in FSACARS support.Thanks!

  • Administrators
Posted

Actually, fields will be this now:

public function GetFieldValue($pilotid, $fieldname)

IE:

$value = PilotData::GetFieldValue($pilotid, 'VATSIM ID');

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...