Jump to content

Recommended Posts

  • Moderators
Posted

hey Nabeel i found maby a potentioal big bug in the system

iff i delete a pilot who has flown it will also delete his flown hours so could it be possible to keep the hours

Posted

HI

I have same problem .

If I delete Aircraft, it will also delete all report with  that aircraft . and I have same problem with 

flight plane.

and if I change Aircraft registration , it will also change all reports with that registration .

I think all data are variable in phpvms and new data replace with old data. if you can change to fix data ,all problem will solve .

(create a table for aircraft deleted and ... )

  • Moderators
Posted

normaly all flightplans(you mean flightschedule correct) are standalone so iff you change a flight schedulle all previus filed pirep will stay the same.

i think its normal iff you change a aircraft registration it will change all the rest ok not iff you are switshing between airlines but iff you use it in 1 airline and you change the reg it doenst mather.

  • Administrators
Posted

We should really not be deleteing pilots in the roster and such. - Instead we should be retireing the pilot. The total hours flown for each pilot is a field in the pilots table so when you delete the row for the pilot you delete the total hours as well. If you want to include the hours in your VA the sql select just needs to be changed to reflect including retired pilots hours in the total hour count.

  • Administrators
Posted

@faraz

Do not delete aircraft - uncheck the "enabled" option in the admin for that aircraft if you do not want to use it, then create a new aircaft you want and assign the schedules from the old aircraft to it if you want to. The other info will not be lost or unavailable that way.

  • Moderators
Posted

We should really not be deleteing pilots in the roster and such. - Instead we should be retireing the pilot. The total hours flown for each pilot is a field in the pilots table so when you delete the row for the pilot you delete the total hours as well. If you want to include the hours in your VA the sql select just needs to be changed to reflect including retired pilots hours in the total hour count.

normaly i would say you are correct but than the pilotlist in de admin part will becoume endles

and i i want to deney a pilot accas to his account dew to some sore off malpractise what then

i will refrase may question nabeel is it possible to have a better search for the pilot side like the one on the schedulle side

  • Administrators
Posted

How about adding a setting in the settings table for retired-


INSERT INTO `phpvms_settings` (`friendlyname`, `name`, `value`, `descrip`, `core`) VALUES
('Show Retired Pilots', 'SHOW_RETIRED', 'true', 'show retired pilots in pilot lists', 1);

then in your pilots_list.tpl in the admin/tem,plates folder find


foreach($allpilots as $pilot)
{

and add right below it ->


if(SettingsData::GetSettingValue('SHOW_RETIRED') == 'false' && $pilot->retired <> 0)
    { continue; }

You can add the same thing in the public pilots list as well.

You will now have an option in the admin/general settings list to enable or disable the viewing of retired pilots.

As far as letting them login uncomment lines 267 thru 271 in your Auth.class.php file and it will disable logins for retired pilots.

Hope this is what you are thinking.

8)

  • Administrators
Posted

I'll add an option in app.config and stuff for disabled pilot, would that help?

The problem with deleting pilots - it will delete their PIREPs too, the reason being there will be orphaned entries in the tables, and my queries join tables tables on things like the pilotid and the airline, aircraft, etc - if you remove a pilot and there are orphaned entries, these queries don't make sense anymore. I can see how it makes sense if you delete a pilot, their pireps shouldn't be removed, since in real life, you fire a pilot, their flights don't magically disappear. I'll take a look at this and see if it can easily be done (I suspect it's just changing my query from an INNER JOIN to a LEFT JOIN, which it might be already...)

As for pilot search, do you mean filter, or programmatically? There is a PilotData::findPilots() function, but I guess you mean a filter, which I can add in...

Posted

This works great thanks!

One question on the edited files.  I'm assuming that the auth_class.php files will be overwriting when I update.  If I add the auth_class.php to my skins folder will it still work?  I know I can't add the admin/template/pilots_list.tpl there because I already have my normal pilots_list.tpl stored there.

  • 2 months later...
  • Administrators
Posted

I wouldn't use the settings table since I'm going to be removing that at some point, most settings are moving into app.config for 2.1. Beyond 2.1 I'm removing that table since it eliminates a few calls.

  • 1 month later...
Posted

Sorry for bumping an old post but I was wondering if you ever figured out what to do with retired pilots showing on the admin site or with deleting them? I've got about half a dozen pilots that don't fly for me anymore that have filed PIREPs and I'd love to delete them so they don't clutter up the admin pilot list. I looked for settings in app.config and I didn't find any. What would be great is if there is no way to delete the pilot without messing up the reports would be to have a on / off switch to hide Retired pilots on the admin pilot list.

Thanks,.

Keith

Guest lorathon
Posted

Maybe it would be best to add a third category to the retired.

0 = Active

1 = Retired

2 = Deleted

Leave the pilot in the table but just ignore any "2" when looks at a pilot list

  • Administrators
Posted

Maybe it would be best to add a third category to the retired.

0 = Active

1 = Retired

2 = Deleted

Leave the pilot in the table but just ignore any "2" when looks at a pilot list

I think this is what I'm gonna end up doing, but it will end up touching alot of code/have to change look ups to ignore a status of 2

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...