Index: l10n_community.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/l10n_community.css,v
retrieving revision 1.1.2.9
diff -u -p -r1.1.2.9 l10n_community.css
--- l10n_community.css	28 Dec 2007 20:40:21 -0000	1.1.2.9
+++ l10n_community.css	10 Mar 2008 06:48:45 -0000
@@ -51,19 +51,6 @@ div.admin form {
   margin: 1em 0;
   position: relative;
 }
-#l10n-community-filter-form a {
-  position: absolute;
-  top: 1em;
-  right: 1em;
-  /*float: right;*/
-}
-#l10n-community-filter-form fieldset {
-  text-align: center;
-}
-#l10n-community-filter-form fieldset div, #l10n-community-filter-form fieldset label {
-  display: inline;
-  line-height: 2.5em;
-}
 #l10n-community-filter-form .form-text {
   width: 200px !important; 
 }
@@ -169,3 +156,23 @@ em.l10n-community-marker {
   background-color: orange;
   border-color: orange;
 }
+#l10n-community-filter-form .l10n-filter-page-link a {
+  position: absolute;
+  bottom: 1em;
+  right: 1em;
+}
+
+.l10n-inline-filter-form .form-item, .l10n-inline-filter-form label, .l10n-inline-filter-form .form-radios {
+  display: inline;
+  line-height: 2.5em;
+}
+.l10n-advanced-suggestion-filter label, .l10n-advanced-suggestion-filter *, .l10n-advanced-suggested-filter label, .l10n-advanced-suggested-filter * {
+  display: inline;
+  line-height: 2.5em;
+}
+.l10n-advanced-translated-filter *, .l10n-advanced-translated-filter label, .l10n-advanced-by-form  .form-item, .l10n-advanced-by-form .form-radios, .l10n-advanced-by-form label {
+  display: inline;
+}
+.l10n-advanced-user-form *, .l10n-advanced-user-form label {
+display: inline;
+}
Index: l10n_community.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/l10n_community.module,v
retrieving revision 1.1.2.15
diff -u -p -r1.1.2.15 l10n_community.module
--- l10n_community.module	2 Jan 2008 23:14:12 -0000	1.1.2.15
+++ l10n_community.module	10 Mar 2008 06:48:46 -0000
@@ -43,7 +43,12 @@ define('L10N_STATUS_HAS_SUGGESTION', 2);
 /**
  * Translated (and approved) strings only.
  */
-define('L10N_STATUS_TRANSLATED', 3); 
+define('L10N_STATUS_TRANSLATED', 4);
+
+/**
+ * Doesn't have suggested translations.
+ */
+define('L10N_STATUS_NO_SUGGESTION', 8);
 
 // = Core hooks ================================================================
 
Index: translate.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/translate.inc,v
retrieving revision 1.1.2.5
diff -u -p -r1.1.2.5 translate.inc
--- translate.inc	28 Dec 2007 16:40:12 -0000	1.1.2.5
+++ translate.inc	10 Mar 2008 06:48:47 -0000
@@ -46,21 +46,25 @@ function l10n_community_translate_page($
   }
   // Thankfully L10N_STATUS_ALL is 0, so non-number bad data goes to no filter. 
   $status  = intval(l10n_community_filter_value('status'));
+  $suggestion  = intval(l10n_community_filter_value('suggestion'));
+  $username  = (string) l10n_community_filter_value('username');
   $search  = (string) l10n_community_filter_value('search');
   
   // Remember cleaned data for future use.
   $_SESSION['l10n_community']['project'] = $uri;
   $_SESSION['l10n_community']['release'] = $release;
   $_SESSION['l10n_community']['status'] = $status;
+  $_SESSION['l10n_community']['suggestion'] = $suggestion;
+  $_SESSION['l10n_community']['username'] = $username;
   $_SESSION['l10n_community']['search'] = $search;
+ 
+  $output = drupal_get_form('l10n_community_filter_form', $project, $status, $suggestion, $username, $release, $search);
   
-  $output = drupal_get_form('l10n_community_filter_form', $project, $status, $release, $search);
-  
-  $strings = l10n_community_get_strings($languages[$langcode]->locale, $project, $status, $release, $search, 10);
+  $strings = l10n_community_get_strings($languages[$langcode]->locale, $project, $status, $suggestion, $username, $release, $search, 10);
   if (!count($strings)) {
     drupal_set_message(t('No strings found with this filter. Try adjusting the filter options.'));
   }
-  elseif ($perm == L10N_PERM_NONE || $mode == 'view') {
+  else if ($perm == L10N_PERM_NONE || $mode == 'view') {
     // For users without permission to translate or suggest, display the view.
     drupal_set_title(t('@language translations', array('@language' => $languages[$langcode]->name)));
     $output .= l10n_community_translate_view($strings, $languages[$langcode], $uri);
@@ -79,18 +83,24 @@ function l10n_community_translate_page($
 /**
  * Translate form filter.
  */
-function l10n_community_filter_form($project = NULL, $status = L10N_STATUS_ALL, $release = 'all', $search  = '') {
+function l10n_community_filter_form($project = NULL, $status = L10N_STATUS_ALL, $suggestion = L10N_STATUS_ALL, $username, $release = 'all', $search  = '') {
   $projects = l10n_community_get_projects();
 
   $status_options = array(
-    L10N_STATUS_ALL            => t('All'),
+    L10N_STATUS_ALL            => t('Don\'t care'),
     L10N_STATUS_UNTRANSLATED   => t('Untranslated'),
-    L10N_STATUS_HAS_SUGGESTION => t('Has suggestion'),
     L10N_STATUS_TRANSLATED     => t('Translated'),
   );
+  $suggestion_options = array(
+    L10N_STATUS_ALL            => t('Don\'t care'),
+    L10N_STATUS_HAS_SUGGESTION => t('Has suggestion'),
+    L10N_STATUS_NO_SUGGESTION => t('No suggestion'),
+  );
   $form['filters'] = array(
     '#title' => t('Show only strings where'),
     '#type' => 'fieldset',
+    '#collapsible' => TRUE,
+    '#collapse' => FALSE,
   );
   
   // Provide link to current page with filters intact for bookmarking.
@@ -98,15 +108,14 @@ function l10n_community_filter_form($pro
   $query = 'project='. urlencode(isset($project) ? $project->uri : '') .'&release='.
            urlencode(isset($release) ? $release : 'all') .'&status='.
            urlencode(isset($status) ? $status : L10N_STATUS_ALL) .'&search='.
-           urlencode(isset($search) ? $search : '') . ($page ? '&page='. $page : '');
-  $form['filters']['link'] = array(
-    '#type' => 'markup',
-    '#value' => l(t('Link to this page'), $_GET['q'], array(), $query)
-  );
+           urlencode(isset($search) ? $search : '') . ($page ? '&page='. $page : '') .'&suggestion='.
+           urlencode(isset($suggestion) ? $suggestion : '') .'&username='.
+           urlencode(isset($username) ? $username : '');
 
   $form['filters']['project'] = array(
     '#title' => t('Project'),
     '#default_value' => isset($project) ? $project->title : '',
+    '#prefix' => '<div class="l10n-inline-filter-form">',
   );
   if (($count = count($projects)) <= 30) {
     // Select widget for 1-30 projects.
@@ -138,28 +147,66 @@ function l10n_community_filter_form($pro
       '#default_value' => isset($release) ? $release : 'all',
     );
   }
-  
+  //$form['filters']['status'] = array('#tree' => TRUE);
   $form['filters']['status'] = array(
     '#title' => t('Status'),
-    '#type' => 'select',
+    '#type' => 'radios',
     '#options' => $status_options,
-    '#default_value' => $status,
+    '#default_value' => $status & (L10N_STATUS_TRANSLATED | L10N_STATUS_UNTRANSLATED),
+    '#prefix' => '<div class="l10n-status-filter">',
+    '#suffix' => '</div>'
   );
   $form['filters']['search'] = array(
     '#title' => t('Contains'),
     '#type' => 'textfield',
     '#default_value' => $search,
-    '#prefix' => '<br />',
+    '#prefix' => '<div class="l10n-status-filter">',
+    '#suffix' => '</div></div>'
+  );
+
+  $advancedcollapse = (!empty($suggestion) || !empty($username)) ? FALSE : TRUE;
+  $form['filters']['advanced'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Advanced settings'),
+    '#collapsible' => TRUE,
+    '#collapsed' => $advancedcollapse,
+   );
+  $form['filters']['advanced']['suggestion'] = array(
+    '#type' => 'radios',
+    '#title' => t('Suggestion'),
+    '#options' => $suggestion_options,
+    '#default_value' => $suggestion,
+    '#prefix' => '<div class="l10n-advanced-suggestion-filter">',
+    '#suffix' => '</div>'
+  );
+  $form['filters']['advanced']['username'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Translated by'),
+    '#prefix' => '<div class="l10n-advanced-user-form">',
+    '#suffix' => '</div>',
+    '#autocomplete_path' => 'user/autocomplete',
+    '#default_value' => $username,
+  );
+  $form['filters']['advanced']['forget'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Do not save this filter'),
+    '#description' => 'Check to disallow saving this filter to your session. Useful when searching for strings while translating in separate window.',
   );
+
   $form['filters']['submit'] = array(
     '#value' => t('Filter'),
     '#type' => 'submit',
-    '#prefix' => '<br />',
   );
   $form['filters']['reset'] = array(
     '#value' => t('Reset'),
     '#type' => 'submit',
   );
+  $form['filters']['link'] = array( 
+    '#type' => 'markup',   
+    '#value' => l(t('Link to this page'), $_GET['q'], array(), $query),
+    '#prefix' => '<div class="l10n-filter-page-link">',
+    '#suffix' => '</div>',
+  );
   return $form;
 }
 
@@ -171,9 +218,10 @@ function l10n_community_filter_form($pro
  */
 function l10n_community_filter_form_submit($form_id, &$form) {
 
   $_SESSION['l10n_community']['project'] = $_SESSION['l10n_community']['release'] = NULL;
   $_SESSION['l10n_community']['status'] = 0;
+  $_SESSION['l10n_community']['suggestion'] = 0;
+  $_SESSION['l10n_community']['username'] = '';
   $_SESSION['l10n_community']['search'] = '';
 
   // Fill up with validated values, if we do filtering.
@@ -199,8 +247,20 @@ function l10n_community_filter_form_subm
       }
     }
     if (!empty($form['status'])) {
+      // Combined status field, bitwise OR
       $_SESSION['l10n_community']['status'] = intval($form['status']);
     }
+    if (!empty($form['suggestion'])) {
+      $_SESSION['l10n_community']['suggestion'] = intval($form['suggestion']);
+    }
+    if (!empty($form['suggestedtranslated'])) {
+      // Suggested or translated by...
+      $_SESSION['l10n_community']['suggestedtranslated'] = intval($form['suggestedtranslated']);
+    }
+    if (!empty($form['username'])) {
+      // Suggested by...
+      $_SESSION['l10n_community']['username'] = $form['username'];
+    }
     if (!empty($form['search'])) {
       $_SESSION['l10n_community']['search'] = $form['search'];
     }
@@ -559,6 +619,11 @@ function theme_l10n_community_copy_butto
  *   Filter strings by status. See L10N_STATUS_ALL,
  *   L10N_STATUS_UNTRANSLATED, L10N_STATUS_HAS_SUGGESTION and
  *   L10N_STATUS_TRANSLATED.
+ * @param $suggestion
+ *   Filter strings by suggestion status. See L10n_STATUS_ALL,
+ *   L10N_HAS_SUGGESTION, L10N_NO_SUGGESTION.
+ * @param $translated
+ *   Filter string by username.
  * @param $release
  *   Release id of the particular project release to filter with.
  *   Use NULL to not filter on releases.
@@ -570,7 +635,7 @@ function theme_l10n_community_copy_butto
  * @return
  *   An array of string records from database.
  */
-function l10n_community_get_strings($langcode, $project = NULL, $status = L10N_STATUS_ALL, $release = NULL, $search = NULL, $pager = NULL) {
+function l10n_community_get_strings($langcode, $project = NULL, $status = L10N_STATUS_ALL, $suggestion = L10N_STATUS_ALL, $username = NULL, $release = NULL, $search = NULL, $pager = NULL) {
   
   $sql = $sql_count = '';
   $sql_args = array();
@@ -607,36 +672,41 @@ function l10n_community_get_strings($lan
   }
     
   // Restriction based on string status.
-  switch ($status) {
-    case L10N_STATUS_UNTRANSLATED:
+  $status_sql = '';
+  if ($status & L10N_STATUS_UNTRANSLATED) {
       // We are doing a LEFT JOIN especially to look into the case, when we have nothing 
       // to match in the translation table, but we still have the string. (We get our 
       // records in the result set in this case). The translation field is empty or
       // NULL in this case, as we are not allowing NULL there and only saving an empty
       // translation if there are suggestions but no translation yet.
-      $status_sql = " AND (t.translation is NULL OR t.translation = '')";
+      $status_sql .= " AND (t.translation is NULL OR t.translation = '')";
+  } else if ($status & L10N_STATUS_TRANSLATED) {
+      $status_sql .= " AND t.translation != ''";
       $sql .= $status_sql;
       $sql_count .= $status_sql;
-      break;
-    case L10N_STATUS_TRANSLATED:
-      $status_sql = " AND t.translation != ''";
-      $sql .= $status_sql;
-      $sql_count .= $status_sql;
-      break;
-    case L10N_STATUS_HAS_SUGGESTION:
+  }
+  if ($suggestion == L10n_STATUS_HAS_SUGGESTION) {
       // Note that we are not searching in the suggestions themselfs, only
       // the source and active translation values. The user interface underlines
       // that we are  looking for strings which have suggestions, not the
       // suggestions themselfs.
-      $status_sql = " AND t.has_suggestion = 1";
-      $sql .= $status_sql;
-      $sql_count .= $status_sql;
-      break;
-    case L10N_STATUS_ALL:
-    default:
-      // Leave query alone on this case.
-      break;
+      $status_sql .= " AND t.has_suggestion = 1";
+  } else if ($suggestion == L10N_STATUS_NO_SUGGESTION) {
+      $status_sql .= " AND t.has_suggestion = 0";
+  }
+  $sql .= $status_sql;
+  $sql_count .= $status_sql;
+
+  // Restriction based on suggestion author
+  $suggestion_sql = '';
+  if (isset($username)) {
+    $author = user_load(array('name' => $username));
+    $author = $author->uid;
+    $suggestion_sql = " AND (t.uid_entered = '%d')";
+    $sql_args[] = $author;
   }
+  $sql .= $suggestion_sql;
+  $sql_count .= $suggestion_sql;
   
   // Morph "WHERE AND" to "WHERE" and remove closing "WHERE". The first appears
   // if there was no project filtering but further filtering was made. The
