Add Dropdown Field to personal details

Pre-requisites, Installation Instructions and Implemenation Assisstance
Post Reply
thell
Posts:2
Joined:Sat Nov 07, 2020 11:51 am
Add Dropdown Field to personal details

Post by thell » Sat Nov 07, 2020 11:58 am

Hello,
I am trying to add a dropdown field to Personal Details.
I hava added the field to the form
Added the column to employees table
Created a table to have the option values

I am getting this error : "Uncaught Exception: DaoException: Couldn't find class State". I have created a StateDao also.

Please help

rajitha
Posts:48
Joined:Tue Feb 11, 2020 9:54 am

Re: Add Dropdown Field to personal details

Post by rajitha » Tue Nov 10, 2020 6:47 am

Hi,
Did you tried below method,

1. Go to Custom Fields screen
Screenshot from 2020-11-10 11-50-01.png
Screenshot from 2020-11-10 11-50-01.png (57.17KiB)Viewed 11056 times
2. Create custom field
Screenshot from 2020-11-10 11-51-37.png
Screenshot from 2020-11-10 11-51-37.png (18.11KiB)Viewed 11056 times
3. Check whether it's comming in particular screen
Screenshot from 2020-11-10 11-52-13.png
Screenshot from 2020-11-10 11-52-13.png (56.23KiB)Viewed 11056 times

thell
Posts:2
Joined:Sat Nov 07, 2020 11:51 am

Re: Add Dropdown Field to personal details

Post by thell » Sat Nov 14, 2020 3:28 pm

Thank you,
I dont want to use the custom field. I have been able to fix that but I have an issue.

It displays the form but just like nationality in EmployeePersonalDetailsForm, $widgets['cmbState']->setDefault($this->employee->emp_state); throws the error below.

Also when i print out $this->employee in the form above, it doesn't show the state field that has been added to te hs_hhr_employee table.

On my localhost it selects the state and save to the database, but on my hosted server(Godaddy), it show this error is my error log.

Sat 14 Nov 2020 02:01:07 PM UTC,165 [21134] ERROR filter.ExceptionCatcherFilter - Uncaught Exception: Doctrine_Record_UnknownPropertyException: Unknown record property / related component "emp_state" on "Employee" in /home//public_html/symfony/lib/vendor/lexpress/doctrine1/lib/Doctrine/Record/Filter/Standard.php:55
Stack trace:
#0 /home//public_html/symfony/lib/vendor/lexpress/doctrine1/lib/Doctrine/Record.php(1394): Doctrine_Record_Filter_Standard->filterGet(Object(Employee), 'emp_state')
#1 /home//public_html/symfony/lib/vendor/lexpress/doctrine1/lib/Doctrine/Record.php(1349): Doctrine_Record->_get('emp_state', true)
#2 /home//public_html/symfony/lib/vendor/lexpress/doctrine1/lib/Doctrine/Access.php(72): Doctrine_Record->get('emp_state')
#3 /home//public_html/symfony/plugins/orangehrmPimPlugin/lib/form/EmployeePersonalDetailsForm.php(224): Doctrine_Access->__get('emp_state')
#4 /home//public_html/symfony/plugins/orangehrmPimPlugin/lib/form/EmployeePersonalDetailsForm.php(125): EmployeePersonalDetailsForm->getPersonalInfoWidgets()
#5 /home//public_html/symfony/lib/vendor/symfony/lib/form/sfForm.class.php(75): EmployeePersonalDetailsForm->configure()
#6 /home//public_html/symfony/lib/vendor/symfony/lib/form/addon/sfFormSymfony.class.php(35): sfForm->__construct(Array, Array, true)
#7 /home//public_html/symfony/plugins/orangehrmPimPlugin/modules/pim/actions/viewPersonalDetailsAction.class.php(80): sfFormSymfony->__construct(Array, Array, true)
#8 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(967): viewPersonalDetailsAction->execute(Object(sfWebRequest))
#9 /home//public_html/symfony/plugins/orangehrmCorePlugin/lib/filter/orangehrmExecutionFilter.php(42): sfExecutionFilter->executeAction(Object(viewPersonalDetailsAction))
#10 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(962): orangehrmExecutionFilter->executeAction(Object(viewPersonalDetailsAction))
#11 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(948): sfExecutionFilter->handleAction(Object(sfFilterChain), Object(viewPersonalDetailsAction))
#12 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): sfExecutionFilter->execute(Object(sfFilterChain))
#13 /home//public_html/symfony/lib/vendor/symfony/lib/filter/sfCommonFilter.class.php(29): sfFilterChain->execute()
#14 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): sfCommonFilter->execute(Object(sfFilterChain))
#15 /home//public_html/symfony/plugins/orangehrmCorePlugin/lib/filter/orangehrmPostExecutionFilter.php(22): sfFilterChain->execute()
#16 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): orangehrmPostExecutionFilter->execute(Object(sfFilterChain))
#17 /home//public_html/symfony/apps/orangehrm/lib/filter/ModuleFilter.php(56): sfFilterChain->execute()
#18 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): ModuleFilter->execute(Object(sfFilterChain))
#19 /home//public_html/symfony/plugins/orangehrmCorePlugin/lib/authorization/filter/ohrmAuthorizationFilter.php(101): sfFilterChain->execute()
#20 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): ohrmAuthorizationFilter->execute(Object(sfFilterChain))
#21 /home//public_html/symfony/apps/orangehrm/lib/filter/SessionInfoFetcherFilter.php(67): sfFilterChain->execute()
#22 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): SessionInfoFetcherFilter->execute(Object(sfFilterChain))
#23 /home//public_html/symfony/apps/orangehrm/lib/filter/OrangeI18NFilter.php(58): sfFilterChain->execute()
#24 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): OrangeI18NFilter->execute(Object(sfFilterChain))
#25 /home//public_html/symfony/apps/orangehrm/lib/filter/ExceptionCatcherFilter.php(26): sfFilterChain->execute()
#26 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): ExceptionCatcherFilter->execute(Object(sfFilterChain))
#27 /home//public_html/symfony/lib/vendor/symfony/lib/filter/sfBasicSecurityFilter.class.php(72): sfFilterChain->execute()
#28 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): sfBasicSecurityFilter->execute(Object(sfFilterChain))
#29 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1009): sfFilterChain->execute()
#30 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): sfRenderingFilter->execute(Object(sfFilterChain))
#31 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(685): sfFilterChain->execute()
#32 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(320): sfController->forward('pim', 'viewPersonalDet...')
#33 /home//public_html/symfony/plugins/orangehrmPimPlugin/modules/pim/actions/viewMyDetailsAction.class.php(29): sfAction->forward('pim', 'viewPersonalDet...')
#34 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(967): viewMyDetailsAction->execute(Object(sfWebRequest))
#35 /home//public_html/symfony/plugins/orangehrmCorePlugin/lib/filter/orangehrmExecutionFilter.php(42): sfExecutionFilter->executeAction(Object(viewMyDetailsAction))
#36 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(962): orangehrmExecutionFilter->executeAction(Object(viewMyDetailsAction))
#37 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(948): sfExecutionFilter->handleAction(Object(sfFilterChain), Object(viewMyDetailsAction))
#38 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): sfExecutionFilter->execute(Object(sfFilterChain))
#39 /home//public_html/symfony/lib/vendor/symfony/lib/filter/sfCommonFilter.class.php(29): sfFilterChain->execute()
#40 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): sfCommonFilter->execute(Object(sfFilterChain))
#41 /home//public_html/symfony/plugins/orangehrmCorePlugin/lib/filter/orangehrmPostExecutionFilter.php(22): sfFilterChain->execute()
#42 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): orangehrmPostExecutionFilter->execute(Object(sfFilterChain))
#43 /home//public_html/symfony/apps/orangehrm/lib/filter/ModuleFilter.php(56): sfFilterChain->execute()
#44 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): ModuleFilter->execute(Object(sfFilterChain))
#45 /home//public_html/symfony/plugins/orangehrmCorePlugin/lib/authorization/filter/ohrmAuthorizationFilter.php(101): sfFilterChain->execute()
#46 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): ohrmAuthorizationFilter->execute(Object(sfFilterChain))
#47 /home//public_html/symfony/apps/orangehrm/lib/filter/SessionInfoFetcherFilter.php(67): sfFilterChain->execute()
#48 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): SessionInfoFetcherFilter->execute(Object(sfFilterChain))
#49 /home//public_html/symfony/apps/orangehrm/lib/filter/OrangeI18NFilter.php(58): sfFilterChain->execute()
#50 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): OrangeI18NFilter->execute(Object(sfFilterChain))
#51 /home//public_html/symfony/apps/orangehrm/lib/filter/ExceptionCatcherFilter.php(26): sfFilterChain->execute()
#52 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): ExceptionCatcherFilter->execute(Object(sfFilterChain))
#53 /home//public_html/symfony/lib/vendor/symfony/lib/filter/sfBasicSecurityFilter.class.php(72): sfFilterChain->execute()
#54 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): sfBasicSecurityFilter->execute(Object(sfFilterChain))
#55 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1009): sfFilterChain->execute()
#56 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(1044): sfRenderingFilter->execute(Object(sfFilterChain))
#57 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(685): sfFilterChain->execute()
#58 /home//public_html/symfony/cache/orangehrm/prod/config/config_core_compile.yml.php(2773): sfController->forward('pim', 'viewMyDetails')
#59 /home//public_html/symfony/lib/vendor/symfony/lib/util/sfContext.class.php(179): sfFrontWebController->dispatch()
#60 /home//public_html/symfony/web/index.php(22): sfContext->dispatch()
#61 {main}

AlexEreft
Posts:1
Joined:Wed Nov 18, 2020 12:21 am

Add Dropdown Field to personal details

Post by AlexEreft » Thu Nov 19, 2020 10:55 pm

While I can see the age, height, weight, etc. on the final PDF version of the character sheet, my characters personal details -- that large text field where I inputted my backstory -- does not get printed. Is that going to get changed, to where I can include that in the print-out?

Also, I noticed that age wont go higher than 75. Would that change if a race is included? Or will there be an option to have a character of any age?

rajitha
Posts:48
Joined:Tue Feb 11, 2020 9:54 am

Re: Add Dropdown Field to personal details

Post by rajitha » Tue Nov 24, 2020 4:18 am

Hi @thell,
Can you try,
$widgets['cmbState']->setDefault($this->employee->getEmpStatus());

Please refer symfony/lib/model/doctrine/orangehrmPimPlugin/base/BaseEmployee.class.php

Thanks,

Vimme1999
Posts:1
Joined:Sat Dec 05, 2020 7:04 am

Re: Add Dropdown Field to personal details

Post by Vimme1999 » Sat Dec 05, 2020 7:13 am

I have found here proper guide about use of personal detail in dropdown field which is very helpful for me.

Post Reply