Rosanne DiMesio : Improve maintainerView

Jeremy Newman jnewman at winehq.org
Fri May 19 13:52:15 CDT 2017


Module: appdb
Branch: master
Commit: 9182149367270c198deddae128cd9302d1bbdfb6
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=9182149367270c198deddae128cd9302d1bbdfb6

Author: Rosanne DiMesio <dimesio at earthlink.net>
Date:   Fri May 19 13:10:34 2017 -0500

Improve maintainerView

The table (available only to admins) now displays entries sorted by maintainer
name rather than userid and adds columns for the maintainer's login id and last time connected.

Signed-off-by: Rosanne DiMesio <dimesio at earthlink.net>
Signed-off-by: Jeremy Newman <jnewman at codeweavers.com>

---

 include/maintainerView.php | 40 ++++++++++++++++++++++++++++------------
 1 file changed, 28 insertions(+), 12 deletions(-)

diff --git a/include/maintainerView.php b/include/maintainerView.php
index 7fe1462..8c88c3d 100644
--- a/include/maintainerView.php
+++ b/include/maintainerView.php
@@ -42,12 +42,14 @@ class maintainerView
     public function objectGetHeader()
     {
         $oTableRow = new TableRow();
-        $oTableRow->AddTextCell('Submission date');
         $oTableRow->AddTextCell('Maintainer');
+        $oTableRow->AddTextCell('Login');
+        $oTableRow->AddTextCell('Submission date');
+        $oTableRow->AddTextCell('Last connected');
         $oTableRow->AddTextCell('Application');
         $oTableRow->AddTextCell('Version');
         $oTableRow->AddTextCell('Action');
-        $oTableRow->SetClass('color4');
+        $oTableRow->SetClass('color3');
         $oTableRow->SetStyle('color: white;');
 
         return $oTableRow;
@@ -87,6 +89,7 @@ class maintainerView
 
         $oTable->SetCellPadding(3);
         $oTable->SetCellSpacing(0);
+        $oTable->SetWidth('100%');
 
         $oHeader = $this->objectGetHeader();
         $oTable->AddRow($oHeader);
@@ -106,8 +109,16 @@ class maintainerView
             $oCell->SetStyle($sStyle.' border-left: thin solid;');
             $oTableRow->AddCell($oCell);
 
-            $oCell = new TableCell($oUser->objectMakeLink());
-            $oCell->SetStyle($sStyle);
+            $oCell = new TableCell('');
+            $oCell->SetStyle($sStyle.' border-left: thin solid;');
+            $oTableRow->AddCell($oCell);
+                        
+            $oCell = new TableCell('');
+            $oCell->SetStyle($sStyle.' border-left: thin solid;');
+            $oTableRow->AddCell($oCell);
+                          
+            $oCell = new TableCell('');
+            $oCell->SetStyle($sStyle.' border-left: thin solid;');
             $oTableRow->AddCell($oCell);
             
             $iMaintainedApps = maintainer::GetMaintainerCountForUserId($iUserId, true);    
@@ -128,8 +139,8 @@ class maintainerView
 
             $oTableRow->SetClass('color4');
             $oTable->AddRow($oTableRow);
-
-            /* Show all apps/versions that the user maintainers */
+            
+            /* Show all apps/versions that the user maintains */
             $hAppResult = query_parameters("SELECT * FROM appMaintainers WHERE userId = '?'", $oMaintainerView->iUserId);
             for($i = 0; $oAppRow = query_fetch_object($hAppResult); $i++)
             {
@@ -149,19 +160,22 @@ class maintainerView
                     $sVersionText = $oVersion->sName;
                 }
 
-                $oTableRow->AddTextCell(print_date(mysqldatetime_to_unixtimestamp($oMaintainer->aSubmitTime)));
                 $oTableRow->AddTextCell($oUser->objectMakeLink());
+                $oTableRow->AddTextCell($oUser->sEmail);
+                $oTableRow->AddTextCell(print_date(mysqldatetime_to_unixtimestamp($oMaintainer->aSubmitTime)));
+                $oTableRow->AddTextCell(print_date(mysqldatetime_to_unixtimestamp($oUser->sStamp)));
                 $oTableRow->AddTextCell($oApp->objectMakeLink());
                 $oTableRow->AddTextCelL($sVersionText);
 
-                $oTableRow->AddTextCell('[<a href="'.$oNewOM->makeUrl('delete', $oMaintainer->objectGetId()).'">delete</a>]');
+                $oTableRow->AddTextCell('<a href="'.$oNewOM->makeUrl('delete', $oMaintainer->objectGetId()).'
+                    "class="btn btn-default btn-sm"><i class="fa fa-trash"></i> delete</a>');
 
                 $oTable->AddRow($oTableRow);
             }
         }
 
-        echo $oTable->GetString();
-    }
+        echo $oTable->GetString();    
+     }
 
     function objectGetItemsPerPage($sState = 'accepted')
     {
@@ -177,8 +191,10 @@ class maintainerView
 
         $sLimit = objectManager::getSqlLimitClause($iRows, $iStart, 'maintainerView');
 
-        $sQuery = "SELECT DISTINCT(userId) FROM appMaintainers WHERE state = '?'$sLimit";
-        $hResult = query_parameters($sQuery, $sState);
+       // get available maintainers
+        $sQuery = "SELECT * FROM appMaintainers, user_list WHERE appMaintainers.userId = user_list.userid";
+        $sQuery.= " AND state='accepted' GROUP BY appMaintainers.userid ORDER BY realname, email;";
+        $hResult = query_parameters($sQuery);
 
         return $hResult;
     }




More information about the wine-cvs mailing list