OS Property support center

Change Agent Register Form Field...

  • andersen
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 10 months ago #32606 by andersen
Change Agent Register Form Field... was created by andersen
hi Dam,

i want to change the dropdown form field, to a text box field in Agent Register > Agent Information > Company, so that user cna type in company whatever they want.

i know how to edit BUT dont want to blow my install.

* can you tell me the files & DB table to edit?

thanks!

Andersen

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #32607 by Mr. Dam
Replied by Mr. Dam on topic Re: Change Agent Register Form Field...
Hi Andersen,
It seems you don't want to have the relation between companies and agents. You want to show company of agent as normal text field. It's ok, you can add new field in table : #__osrs_agents (company_name varchar 255), and modify the file agent.html.php, the code
<?php echo $lists?>
is used to show the dropdown select list of companies, you can change it to text field.
you also need to modify code in "showing" data. Instead of retrieve company information from #__osrs_companies, you only need to get company_name field in #__osrs_agents.
There is some files you need to modify:
components > com_osproperty > classes > agent.php
components > com_osproperty > classes > agent.html.php
Good luck
Dam

Please Log in or Create an account to join the conversation.

  • andersen
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 10 months ago #32610 by andersen
Replied by andersen on topic Re: Change Agent Register Form Field...
WOW thanks for the fast response!

- agent.php i edit around line 1525
$db->setQuery("select id as value, company_name as text from #__osrs_agents where published = '1' order by company_name");

-agent.html.php around line 4469
<?php echo JText::_('OS_COMPANY')?>

</td>

<td>

<input type="company name" name="company_name" id="company_name" size="255" class="inputbox" /><span class="required">(*)</span>

</td>

</tr>

page not returning... :ohmy:
prototype.homesperson2person.com/compone...ent_register&Itemid=

- i did DBase insert row in table "osrs_agents", company_name AFTER company_id, VARCHAR, 255 Characters, UTF8_general_ci, null, NULL (Default)

what am i doing wrong?

thanks soo much!

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #32613 by Mr. Dam
Replied by Mr. Dam on topic Re: Change Agent Register Form Field...
Hi,
You don't need to edit agent.php
$db->setQuery("select id as value, company_name as text from #__osrs_agents where published = '1' order by company_name");
Because it doesn't relate to your purpose anymore.
Modify:
<input type="text" name="company_name" id="company_name" size="255" class="inputbox" /><span class="required">
And you need to hack into agent.php to save the value of company_name
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • andersen
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 10 months ago #32631 by andersen
Replied by andersen on topic Re: Change Agent Register Form Field...
Dam Dang! :blink:

allmost there but i dont know where to hack it?
(("hack into agent.php to save the value of company_name"))

PLEASE tell me which line? i tried for hours...thought 1505?

thank you Dam

Andersen

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #32661 by Mr. Dam
Replied by Mr. Dam on topic Re: Change Agent Register Form Field...
Hi,
In file agent.html.php, function agentRegisterForm
replace
<?php echo $lists?>
by
<input type="company name" name="company_name" id="company_name" size="255" class="inputbox" />
In
administrator > components > com_osproperty > tables > agent.php
add
var $company_name = null;
after
var $published = null;

After that, when user register to become agent and he enter company_name, value of that field will be saved into database.
But you will need to modify some other places like showing data.
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • andersen
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 10 months ago #32671 by andersen
Replied by andersen on topic Re: Change Agent Register Form Field...
GREAT! thank you very much.

can you help me with "showing data" places? which places?
with this last part i am 100% blessed and can complete it.

i keep messing up your brilliant code :sick:

thanks you!

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #32674 by Mr. Dam
Replied by Mr. Dam on topic Re: Change Agent Register Form Field...
Hi,
In file agent.php, please find and remove line : $agent->company_name = $company->company_name;
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • andersen
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 10 months ago #32685 by andersen
Replied by andersen on topic Re: Change Agent Register Form Field...
Dam,

i cant thank you enough! I CANT GET IT TO WORK my site is just blank :(

- i;ve done each step exactly
- please peek at the enclosed edited files, at this point im just dying to know what i did wrong?
Attachments:

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #32740 by Mr. Dam
Replied by Mr. Dam on topic Re: Change Agent Register Form Field...
Hi,
Please send your site information with super admin account, ftp account to : damdt@joomservices.com. I will help you to change it.
Thanks
Dam

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamNguyen Phu Quan