Aaron Posted January 17, 2012 Report Share Posted January 17, 2012 Can anybody tell me how to add a training notes field somewhere. The field is just to add a record of training sessions and general notes etc. Any ideas are appreciated. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted January 17, 2012 Administrators Report Share Posted January 17, 2012 Add a custom field, make it private so only admins can see (if that's what you want) Quote Link to comment Share on other sites More sharing options...
Aaron Posted January 24, 2012 Author Report Share Posted January 24, 2012 how do I make it private? Quote Link to comment Share on other sites More sharing options...
Aaron Posted January 28, 2012 Author Report Share Posted January 28, 2012 bump Quote Link to comment Share on other sites More sharing options...
Aaron Posted January 30, 2012 Author Report Share Posted January 30, 2012 bump Quote Link to comment Share on other sites More sharing options...
freshJet Posted January 30, 2012 Report Share Posted January 30, 2012 Have you tried looking? Quote Link to comment Share on other sites More sharing options...
tutmeister Posted January 30, 2012 Report Share Posted January 30, 2012 Look at the code for the admin panel and you'll see and if else clause for admin and non-admin. Re-use that code. Quote Link to comment Share on other sites More sharing options...
Aaron Posted February 1, 2012 Author Report Share Posted February 1, 2012 I added a training notes row in the database, looking for the code to display it now Quote Link to comment Share on other sites More sharing options...
Jeff Posted February 1, 2012 Report Share Posted February 1, 2012 <?php if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) { echo '<li><a href="'.fileurl('/admin').'" target="_blank">Admin Center</a></li>'; } ?> Change ("/admin") to the tpl file you want to lock to non-admin. Change "Admin Center" to the title of the page your are linking to. Quote Link to comment Share on other sites More sharing options...
Aaron Posted February 1, 2012 Author Report Share Posted February 1, 2012 I've made the custom field, I want only admins to be able to see it but it still shows up in the edit user profile page in the pilot center, I dont want it to show up ther so what do I do, I think it's something in here I need to change: /core/common/SettingsData.class.php Quote Link to comment Share on other sites More sharing options...
Jeff Posted February 1, 2012 Report Share Posted February 1, 2012 In the /admin/index.php/settings/customfields you will see two drop-down boxes in there when adding a custom field. Show in User Profile? Show During Registration? Answer "Yes" if you want those fields shown on those pages. Answer "No" if you do not want those fields shown on those pages. Quote Link to comment Share on other sites More sharing options...
Aaron Posted February 1, 2012 Author Report Share Posted February 1, 2012 Found this in the settingsdata, notice the section in comments, I tryed using that but it kept giving syntax error, I put a 0 on the end of the public and showinregister, so that when the numbers in there are equal to or greater than 0 I want it to show up in profile, the training notes I already put to -1 for both. Any ideas? public static function getField($fieldid) { $fieldid = intval($fieldid); return DB::get_row("SELECT * FROM '.TABLE_PREFIX.'customfields WHERE fieldid='.$fieldid'"); } /* Edit a custom field to be used in a profile $data= array('fieldid'=>, 'title'=>, 'value'=>, 'type'=>, 'public'=>, 'showinregistration'=>); */ Quote Link to comment Share on other sites More sharing options...
Aaron Posted February 2, 2012 Author Report Share Posted February 2, 2012 I fixed it added the code below: <?php if($customfields) { foreach($customfields as $field) { if($field->fieldname=='TRAINING_NOTES') { } else { ..... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.