Make Better Structure: Properties Types

More
6 years 3 weeks ago #118657 by Josh
Replied by Josh on topic Make Better Structure: Properties Types
Great addition, thanks, what about adding as statuses:
"In negotiations" or "in talks"
"On hold" or "suspended"
"Just added" or "new"
I think they would be useful...

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

More
6 years 3 weeks ago #118659 by MelanieB
Replied by MelanieB on topic Make Better Structure: Properties Types
Hi Guiseppe,

if you are willing to change some code you can do it yourself by altering a couple of files. They will get over-written when you update though so you would need to re-add your changes when you update. It may become a feature where we can add new ones that remain when we update, but till then try this: Change the following files:

1. Root > components > com_osproperty > helpers > helper.php
Find:

static function buildDropdownMarketStatus($mstatus){
$configClass = self::loadConfig();
$market_status = $configClass;
if($market_status == 1){
$marketArr = array();
$marketArr[] = JHtml::_('select.option',0,JText::_('OS_MARKET_STATUS'));
$market_status = $configClass;
if($market_status != ""){
$market_status_array = explode(",",$market_status);
if(in_array('1',$market_status_array)){
$marketArr[] = JHtml::_('select.option',1,JText::_('OS_SOLD'));
}
if(in_array('2',$market_status_array)){
$marketArr[] = JHtml::_('select.option',2,JText::_('OS_CURRENT'));
}
if(in_array('3',$market_status_array)){
$marketArr[] = JHtml::_('select.option',3,JText::_('OS_RENTED'));
}
}
return JHtml::_('select.genericlist',$marketArr,'isSold','class="input-medium chosen"','value','text',$mstatus);
}
}

static function returnMarketStatus($marketStatus){
switch ($marketStatus){
case "1":
return JText::_('OS_SOLD');
break;
case "2":
return JText::_('OS_CURRENT');
break;
case "3":
return JText::_('OS_RENTED');
break;
}
}

2. root > administrator > components > com_osproperty > classes > configuration > properties > sold.php

$market_status = array();
$market_status[0]->value = 1;
$market_status[0]->text = JText::_('OS_SOLD');

$market_status[1]->value = 2;
$market_status[1]->text = JText::_('OS_CURRENT');

$market_status[2]->value = 3;
$market_status[2]->text = JText::_('OS_RENTED');

$checkbox_market_status = array();
if (isset($configs)){
$checkbox_market_status = explode(',',$configs);
}
if($configs == "1"){
$checkbox_market_status[] = 1;
}
echo JHTML::_('select.genericlist',$market_status,'configuration[market_status][]','multiple class="chosen"','value','text',$checkbox_market_status);

Kind regards

Mel

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

More
6 years 3 weeks ago #118663 by Josh
Replied by Josh on topic Make Better Structure: Properties Types
MelanieB, you're great! So you're saying if I add e.g.
Code:
if(in_array('4',$market_status_array)){ $marketArr[] = JHtml::_('select.option',4,JText::_('OS_NEGOTIATIONS')); } case "4": return JText::_('OS_NEGOTIATIONS'); break; $market_status[3]->value = 4; $market_status[3]->text = JText::_('OS_NEGOTIATIONS'); ...and so on increasing values for further items...
in the right places (documenting it for the sake of other visitors), will it work?
Let's hope OSsolution guys will find them useful!

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

More
6 years 3 weeks ago #118665 by MelanieB
Replied by MelanieB on topic Make Better Structure: Properties Types
Hi,

Its worked perfectly for me for months. It was Dam who pointed me yhose files (credit to him).

Also, when you have added them you need to go to your configuration in backend and select the new values in the market status box.

Hope that helps. And yes documenting it here helps take a little work off the Joomdonation team :)

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

More
6 years 3 weeks ago #118666 by Marios
Replied by Marios on topic Make Better Structure: Properties Types
Hello MelanieB and Giuseppe , it will be nice if I had your emails as to check also your sites how you have implement it .
You can send it to my email at: marios.papas1 @ gmail.com
Thanks

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

More
5 years 9 months ago #122457 by Josh Cissell
Replied by Josh Cissell on topic Make Better Structure: Properties Types
Dam,

Do you have it planned to add the code changes MelanieB suggests so that we can easily add market statuses without coding and changing code every time we update?

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

More
5 years 9 months ago #122458 by Josh Cissell
Replied by Josh Cissell on topic Make Better Structure: Properties Types

MelanieB wrote: Hi,

Its worked perfectly for me for months. It was Dam who pointed me yhose files (credit to him).

Also, when you have added them you need to go to your configuration in backend and select the new values in the market status box.

Hope that helps. And yes documenting it here helps take a little work off the Joomdonation team :)


When I make the changes to those files exactly and add a new market status it doesn't show up "Available June" like the other statuses show up as Rented, Sold, etc... It shows up as OS_Available_June. Just as it is typed in the code. But the other statuses are "OS_RENTED", etc.. and show up as "Rented." Is there another file I have to edit?

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

More
5 years 9 months ago #122460 by MelanieB
Replied by MelanieB on topic Make Better Structure: Properties Types
Hi Josh that's just a language translation. You can change that in the language file or via Joomla language override. Just search for the text (as a constant) and then change it to what you want. Or open the actual override file in cpanel file manager and add it there

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

More
5 years 9 months ago #122463 by Josh Cissell
Replied by Josh Cissell on topic Make Better Structure: Properties Types

MelanieB wrote: Hi Josh that's just a language translation. You can change that in the language file or via Joomla language override. Just search for the text (as a constant) and then change it to what you want. Or open the actual override file in cpanel file manager and add it there


Thank you. I was just stumbling upon this as you sent the message. I'm having a problem for some reason though. I named it "OS_AVAILABLE_NOW" and when I search for that to make a translation change it can't find it as a value or constant. I turned on language debugging mode and when "OS_AVAILABLE_NOW" is shown on my website it has two ? marks on each side instead of two *

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

More
5 years 9 months ago #122464 by MelanieB
Replied by MelanieB on topic Make Better Structure: Properties Types
It wont exist yet. I think in the language area of Joomla where you were searching you can just create a new entry (it will go into the override file once saved) just populate the boxes on left - put "OS_AVAILABLE_NOW" in the constant and the text you want to display in the other box. You may have to select site or administrator file first when you first go into language settings so if the file you edited was in the admin iterator folder then you need to select that In Joomla. Sorry I am on a mobile so cannot see screen to be more specific.

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

Moderators: Mr. Dam