geodesicsolutions-community / geocore-community

GeoCore Community, open source classifieds and auctions software
MIT License
9 stars 6 forks source link

Strip RSS News Reader, clean up Support/Download blocks on admin home #147

Closed vicos59 closed 2 years ago

vicos59 commented 2 years ago

fixes #76

Deleted obsolete code where applicable.

Cleaned up Support and Downloads blocks in Admin Home to reflect GeoCoreCE and remove any mention of paid options.

This may need some more work. home.php is full of checks for support and download expiration and license info. I can't see where it is required. Am I good to remove that or is there some reason to leave it? downloads.tpl should also have the checks removed for expiration dates.

Also,

src\admin\templates\home\index.tpl

What is all this whitelab, turbo, and leased stuff? Should we simplify this and remove the junk? It looks like all we need to load is downloads and support templates.

            {if !$white_label and !$geoturbo_status}
                {if $is_trial_demo}
                    <div>
                        {include file='home/demo.tpl'}
                    </div>
                {else}
                    <div>
                        {if $product.leased}
                            {include file='home/leased.tpl'}
                        {else}
                            {include file='home/downloads.tpl'}
                        {/if}
                    </div>
                    <div>
                        {include file='home/support.tpl'}
                    </div>
                {/if}
vicos59 commented 2 years ago

Looks like I broke the Software Version on the Admin Home.

vicos59 commented 2 years ago

Restored the version #. It is in homeLicense.php and invoked from home.js.

Plenty of obsolete stuff that can be stripped once @jonyo has a chance to review my above comments.

vicos59 commented 2 years ago

I see you have:

$settings['latestVersion'] = $latest = geoPC::getLatestVersion();

Is latest version available to the templates? If not, how would I do that?

In src\admin\templates\home\versionAjax.tpl I see:

{$version} {$latestVersion}

but they don't work in src\admin\templates\home\downloads.tpl

jonyo commented 2 years ago

What is all this whitelab, turbo, and leased stuff?

They had a bunch of options they experimented with over the years for different payment models. If you are curious:

What I would do is remove the front end parts that are not used or needed, then look at what was removed, look at the back end and remove the stuff that tries to set it.

When I'm doing a search and destroy like this, I find it helps to keep notes. Like I make a checklist, if I remove a thing I add it to the checklist. Once I'm done I go over the checklist items, searching the code for places that still use each one. If I find one and it turns out it is still needed, I leave it. If I find another use but that other place maybe is not needed, I add it to the list and keep going. It involves lots of going over the same items until you either remove all the sub-parts then the thing itself, or you run into a place that needs it to stay so you check it off that way.

Since it is pretty heavy with the old licensing checks, I can take this one over if you want. I also have access to the original git repo so I can look at the history that might help determine if something is still needed or not. Just let me know.

jonyo commented 2 years ago

I see you have:

$settings['latestVersion'] = $latest = geoPC::getLatestVersion();

Is latest version available to the templates? If not, how would I do that?

In src\admin\templates\home\versionAjax.tpl I see:

{$version} {$latestVersion}

but they don't work in src\admin\templates\home\downloads.tpl

See these lines in the PHP:

https://github.com/geodesicsolutions-community/geocore-community/blob/d213e6bda3032950edf04f45cf4e974b80689ae3/src/admin/AJAXController/homeLicense.php#L38-L43

That is setting version, latestVersion, and is_latest in $settings. Then later it sets them in the template vars here:

https://github.com/geodesicsolutions-community/geocore-community/blob/d213e6bda3032950edf04f45cf4e974b80689ae3/src/admin/AJAXController/homeLicense.php#L80-L82

So the version, latestVersion, and is_latest are set by that, then used in the template itself here:

https://github.com/geodesicsolutions-community/geocore-community/blob/29c9ae93198748d26db182f887f67866e2da3952/src/admin/templates/home/versionAjax.tpl#L6-L8

vicos59 commented 2 years ago

Since it is pretty heavy with the old licensing checks, I can take this one over if you want. I also have access to the original git repo so I can look at the history that might help determine if something is still needed or not. Just let me know.

Then, let's do this. I'll clean up the current PR to complete this issue as defined (strip rss news from admin home and cleanup support and download blocks) and submit for approval. I just need to do some cleanup, which I will do right now. Then we can get this off the list.

Then, if there isn't already a separate issue to cleanup the remaining licensing code, I will create one. I can then take a thorough look at it. It really didn't look that complicated to me. But, I need to look closer as you suggest.

There is also code laced throughout for DEMO mode. Is DEMO mode something you planned to maintain for the future?

I would rather free you up to look at the Facebook issue.

jonyo commented 2 years ago

Is DEMO mode something you planned to maintain for the future?

I had not decided so I figured we could keep it for now.

It is to do things like show a "template selector" at the top that lets you change the style to easily see the different color options and all that.

Which reminds me, I did not do any of the color options! We had a bunch, it lets you load up a "primary" color scheme and a "secondary" color scheme. I'll see if I can find the old ones anywhere that we can start providing for download as well.

vicos59 commented 2 years ago

This is now ready for review. Only tackles the specific tasks identified in the respective issue.

Does not tackle removing any additional licensing code. That will be defined in another Issue, if it does not already exist.

vicos59 commented 2 years ago

leased - they offered leased license for a while. Think of it like "software as a service" - Where you would pay monthly, it was slightly less than what you would pay if you kept up to date with both downloads access and paid support, but if you stopped paying, it would expire the license and you would be locked out. Thus "leased". A few used it but not enough so they stopped offering it to new clients.

See #92

vicos59 commented 2 years ago

Then, if there isn't already a separate issue to cleanup the remaining licensing code, I will create one. I can then take a thorough look at it. It really didn't look that complicated to me. But, I need to look closer as you suggest.

See #150