Skip to content

Commit

Permalink
Bug fixes and Feature Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Vodhin authored Dec 6, 2024
1 parent fe8ce93 commit 3cd0616
Show file tree
Hide file tree
Showing 5 changed files with 703 additions and 680 deletions.
2 changes: 2 additions & 0 deletions e_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
}
unset($ESTPLUG,$k,$v);

//getperms('P') --> is now --> e_user_model::checkPluginAdminPerms()

// define current user's premissions
if(ADMINPERMS === '0'){
define("EST_USERPERM", 4);
Expand Down
23 changes: 23 additions & 0 deletions estate_defs.php
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ function estGetSubDivDta($subd_idx,$subd_city=0){
$media = estGetMediaRows($subd_idx,0);
if($dbRow1 = $sql->retrieve('estate_subdiv', '*', 'subd_idx="'.$subd_idx.'"',true)){
$RET = array_merge($dbRow1[0],$media);
//$RET['features']['sub'] = $sql->retrieve('estate_featurelist', '*', 'featurelist_lev="0" AND featurelist_levidx="'.$subd_idx.'"',true);
}
else{
$RET = array('subd_idx'=>0,'subd_city'=>0,'subd_name'=>'','subd_type'=>2,'subd_url'=>'','subd_hoaname'=>'','subd_hoaweb'=>'','subd_hoareq'=>0,'subd_hoafee'=>0,'subd_hoafrq'=>0,'subd_hoaappr'=>0,'subd_hoaland'=>0,'subd_landfee'=>0,'subd_landfreq'=>0,'subd_description'=>'');
Expand All @@ -727,6 +728,7 @@ function estGetSubDivDta($subd_idx,$subd_city=0){
if($subd_city == 0 && intval($RET['subd_city']) > 0){$subd_city = intval($RET['subd_city']);}
if($dbRow1b = $sql->retrieve('estate_city', '*', 'city_idx="'.$subd_city.'"',true)){
$RET = array_merge($RET,$dbRow1b[0]);
//$RET['features']['city'] = $sql->retrieve('estate_featurelist', '*', 'featurelist_lev="3" ',true); //AND featurelist_levidx="'.$subd_city.'"
}
else{
$RET['city_idx'] = 0;
Expand All @@ -739,6 +741,27 @@ function estGetSubDivDta($subd_idx,$subd_city=0){
}


/*
if($fcats = $sql->retrieve('estate_featcats', '*', 'WHERE NOT featcat_lev = "2"',true)){
foreach($fcats as $fk=>$fv){
if(!is_array($RET['fcat'][$fv['featcat_lev']])){$RET['fcat'][$fv['featcat_lev']] = array();}
array_push($RET['fcat'][$fv['featcat_lev']],$fv);
}
}
*/
//$RET['fcat'] = $sql->retrieve('estate_featcats', '*', 'WHERE NOT featcat_lev = "2" ORDER BY featcat_lev ASC',true);

/*
$TQRY = "SELECT #estate_features.*, #estate_featcats.* FROM #estate_features LEFT JOIN #estate_featcats ON feature_cat = featcat_idx WHERE NOT featcat_lev = '2'";
if($sql->gen($TQRY)){
$fi = 0;
while($rows = $sql->fetch()){
$RET['fcat'][$fi] = $rows;
$fi++;
}
}
*/

$RET['spaces'] = array('city'=>array(),'subd'=>array());


Expand Down
25 changes: 12 additions & 13 deletions estate_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,19 @@ function install_post($var){
else{$msg->addWarning('<div>'.EST_INST_INITSETUP.': '.EST_GEN_AGENT.' '.EST_GEN_PROFILES.'<ul><li>'.EST_INST_FISRTAGENTFAIL.'</li></ul></div>');}


//load Preset Data
/** inserts some preset data into the following tables:
* estate_zoning
* estate_listypes
* estate_states
* estate_featcats
* estate_features
* estate_subdivcats
* estate_group
**/

if($sql->isEmpty('estate_features')){
$ret3 = e107::getXml(true)->e107Import(e_PLUGIN."estate/xml/features.xml");
$ret3 = e107::getXml(true)->e107Import(e_PLUGIN."estate/xml/presets.xml");
if(!empty($ret3['success'])){
$msg->addSuccess(EST_INST_FEATURES1);
}
Expand All @@ -65,21 +75,10 @@ function install_post($var){
}


if($sql->isEmpty('estate_states')){
$ret3 = e107::getXml(true)->e107Import(e_PLUGIN."estate/xml/states.xml");
if(!empty($ret3['success'])){
$msg->addSuccess(EST_INST_STATES1);
}
if(!empty($ret3['failed'])){
$msg->addError(EST_INST_STATES2);
$msg->addDebug(print_a($ret3['failed'],true));
}
}

//load Sample Property
if($sql->isEmpty('estate_properties')){
$ret3 = e107::getXml(true)->e107Import(e_PLUGIN."estate/xml/sample_prop.xml");
if(!empty($ret3['success'])){

$propMSG = EST_INST_SAMPLEPROP1;
if(intval($MAINAGTID) > 0){
if($sql->update("estate_properties","prop_agent='".$MAINAGTID."', prop_agency='1' WHERE prop_idx='1' LIMIT 1")){
Expand Down
1 change: 0 additions & 1 deletion estate_sidebar_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
}

if(!is_array($MENUTMPL) && isset($EST_PREF['template_menu_ord'])){
echo '<div>Pref Menu Loaded</div>';
if(is_array($EST_PREF['template_menu_ord'])){$MENUTMPL = $EST_PREF['template_menu_ord'];}
elseif(trim($EST_PREF['template_menu_ord']) !== ''){$MENUTMPL = e107::unserialize($EST_PREF['template_menu_ord']);}
}
Expand Down
Loading

0 comments on commit 3cd0616

Please sign in to comment.