*/
public $fields = false;
- public $postOldVersions = false;
+ public $postStats = false;
/**
* Constructor
*/
public function entryPostProcessing($r, $a)
{
- if ( $this->postOldVersions ) {
+ if ( $this->postStats ) {
// Get sites that have old versions of this plugin.
+ $r['oldProdVersions'] = $this->wpdb->get_results(
+ $this->wpdb->prepare(
+ "SELECT S.name
+ FROM " . GLM_MEMBERS_PLUGINS_PLUGIN_DB_PREFIX . "sites S
+ LEFT OUTER JOIN " . GLM_MEMBERS_PLUGINS_PLUGIN_DB_PREFIX . "site_plugins SP ON (S.id = SP.site)
+ WHERE SP.plugin = %d
+ AND prod_version != %s
+ AND prod_version != '-'",
+ $r['id'],
+ $r['latest_version']
+ ),
+ ARRAY_A
+ );
$r['oldDevVersions'] = $this->wpdb->get_results(
$this->wpdb->prepare(
"SELECT S.name
FROM " . GLM_MEMBERS_PLUGINS_PLUGIN_DB_PREFIX . "sites S
LEFT OUTER JOIN " . GLM_MEMBERS_PLUGINS_PLUGIN_DB_PREFIX . "site_plugins SP ON (S.id = SP.site)
- WHERE SP.plugin = %d",
- $r['id']
+ WHERE SP.plugin = %d
+ AND dev_version != %s
+ AND dev_version != '-'",
+ $r['id'],
+ $r['latest_version']
),
ARRAY_A
);
// Get list of Plugins.
// For this list display sites that need an update.
- // $Plugins->postOldVersions = true;
+ $Plugins->postStats = true;
$plugins = $Plugins->getResults( array( 'order' => 'T.name' ) );
// echo '<pre>$plugins: ' . print_r( $plugins, true ) . '</pre>';
</div>
</div>
-<div class="glma-row">
- <div class="glma-small-4 glma-columns">
- <div class="glma-row">
- <div class="glma-small-5 glma-columns">
- </div>
- <div class="glma-small-5 glma-columns">
- </div>
- <div class="glma-small-5 glma-columns">
- </div>
- </div>
- </div>
-</div>
+<table class="stack hover">
+ <tr>
+ <th class="text-left">Plugin</th>
+ <th class="text-left">Latest Version</th>
+ <th class="text-left">Prod Sites needing updates</th>
+ <th class="text-left">Dev Sites needing updates</th>
+ </tr>
+ {foreach $plugins as $plugin}
+ <tr>
+ <td><a href="{$thisUrl}?page={$thisPage}&glm_action=plugins&option=view&plugin_id={$plugin.id}">{$plugin.name}</a></td>
+ <td>{$plugin.latest_version}</td>
+ <td>{count($plugin.oldProdVersions)}</td>
+ <td>{count($plugin.oldDevVersions)}</td>
+ </tr>
+ {/foreach}
+</table>
{include file='admin/footer.html'}