? a
? l.patch
? l10n_server_split_2.patch
? l10n_server_split_status.patch
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	7 Mar 2008 22:20:33 -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 {
+display: block;
+}
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	7 Mar 2008 22:20:36 -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	7 Mar 2008 22:20:38 -0000
@@ -60,7 +60,7 @@ function l10n_community_translate_page($
   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 +79,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,  $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.
@@ -99,14 +105,11 @@ function l10n_community_filter_form($pro
            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)
-  );
 
   $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,19 +141,56 @@ function l10n_community_filter_form($pro
       '#default_value' => isset($release) ? $release : 'all',
     );
   }
-  
-  $form['filters']['status'] = array(
+  //$form['filters']['status'] = array('#tree' => TRUE);
+  $form['filters']['translation'] = 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>'
+  );
+
+  $form['filters']['advanced'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Advanced settings'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE
+   );
+  $form['filters']['advanced']['suggestion'] = array(
+    '#type' => 'radios',
+    '#title' => t('Suggestion'),
+    '#options' => $suggestion_options,
+    '#default_value' => $status & (L10N_STATUS_HAS_SUGGESTION | L10N_STATUS_NO_SUGGESTION),
+    '#prefix' => '<div class="l10n-advanced-suggestion-filter">',
+    '#suffix' => '</div>'
+  );
+  $form['filters']['advanced']['is'] = array(
+    '#type' => 'item',
+    '#title' => t('Is'),
+    '#prefix' => '<div class="l10n-advanced-by-form">'
+    );
+  $form['filters']['advanced']['suggestedtranslated'] = array(
+    '#type' => 'radios',
+    '#options' => array(1 => t('suggested'), 2 => t('translated'))
   );
+  $form['filters']['advanced']['translated'] = array(
+    '#type' => 'textfield',
+    '#title' => t('by'),
+    '#prefix' => '<div class="l10n-advanced-user-form">',
+    '#suffix' => '</div></div>',
+    '#autocomplete_path' => 'user/autocomplete',
+    '#default_value' => $suggested,
+  );
+
+
   $form['filters']['submit'] = array(
     '#value' => t('Filter'),
     '#type' => 'submit',
@@ -160,6 +200,12 @@ function l10n_community_filter_form($pro
     '#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;
 }
 
@@ -199,7 +245,8 @@ function l10n_community_filter_form_subm
       }
     }
     if (!empty($form['status'])) {
-      $_SESSION['l10n_community']['status'] = intval($form['status']);
+      // Combined status field, bitwise OR
+      $_SESSION['l10n_community']['status'] = intval($form['status']['translation']) | intval($form['status']['suggestion']);
     }
     if (!empty($form['search'])) {
       $_SESSION['l10n_community']['search'] = $form['search'];
@@ -607,36 +654,30 @@ 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 ($status & 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 ($status & L10N_STATUS_NO_SUGGESTION) {
+      $status_sql .= " AND t.has_suggestion = 0";
   }
+  $sql .= $status_sql;
+  $sql_count .= $status_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
