Changeset 8403 for trunk/admin


Ignore:
Timestamp:
Dec 31, 2010, 12:58:14 PM (13 years ago)
Author:
plg
Message:

feature 2089: add the "not_linked" feature as "with no virtual album" in the
new Batch Manager.

Location:
trunk/admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/batch_manager.php

    r8399 r8403  
    5555  if (isset($_POST['filter_prefilter_use']))
    5656  {
    57     $prefilters = array('caddie', 'last import', 'with no album', 'with no tag');
     57    $prefilters = array('caddie', 'last import', 'with no album', 'with no tag', 'with no virtual album');
    5858    if (in_array($_POST['filter_prefilter'], $prefilters))
    5959    {
     
    144144        );
    145145    }
     146  }
     147
     148  if ('with no virtual album' == $_SESSION['bulk_manager_filter']['prefilter'])
     149  {
     150    // we are searching elements not linked to any virtual category
     151    $query = '
     152 SELECT id
     153   FROM '.IMAGES_TABLE.'
     154 ;';
     155    $all_elements = array_from_query($query, 'id');
     156 
     157    $query = '
     158 SELECT id
     159   FROM '.CATEGORIES_TABLE.'
     160   WHERE dir IS NULL
     161 ;';
     162    $virtual_categories = array_from_query($query, 'id');
     163    if (!empty($virtual_categories))
     164    {
     165      $query = '
     166 SELECT DISTINCT(image_id)
     167   FROM '.IMAGE_CATEGORY_TABLE.'
     168   WHERE category_id IN ('.implode(',', $virtual_categories).')
     169 ;';
     170      $linked_to_virtual = array_from_query($query, 'image_id');
     171    }
     172
     173    array_push(
     174      $filter_sets,
     175      array_diff($all_elements, $linked_to_virtual)
     176      );
    146177  }
    147178}
     
    195226//  $page['cat_elements_id'] = array();
    196227
    197 //  else if ('not_linked' == $_GET['cat'])
    198 //  {
    199 //    $page['title'] = l10n('Not linked elements');
    200 //    $template->assign(array('U_ACTIVE_MENU' => 5 ));
    201 // 
    202 //    // we are searching elements not linked to any virtual category
    203 //    $query = '
    204 //  SELECT id
    205 //    FROM '.IMAGES_TABLE.'
    206 //  ;';
    207 //    $all_elements = array_from_query($query, 'id');
    208 // 
    209 //    $linked_to_virtual = array();
    210 // 
    211 //    $query = '
    212 //  SELECT id
    213 //    FROM '.CATEGORIES_TABLE.'
    214 //    WHERE dir IS NULL
    215 //  ;';
    216 //    $virtual_categories = array_from_query($query, 'id');
    217 //    if (!empty($virtual_categories))
    218 //    {
    219 //      $query = '
    220 //  SELECT DISTINCT(image_id)
    221 //    FROM '.IMAGE_CATEGORY_TABLE.'
    222 //    WHERE category_id IN ('.implode(',', $virtual_categories).')
    223 //  ;';
    224 //      $linked_to_virtual = array_from_query($query, 'image_id');
    225 //    }
    226 // 
    227 //    $page['cat_elements_id'] = array_diff($all_elements, $linked_to_virtual);
    228 //  }
    229228//  else if ('duplicates' == $_GET['cat'])
    230229//  {
  • trunk/admin/batch_manager_global.php

    r8398 r8403  
    121121      array($_POST['associate'])
    122122      );
     123
     124    $_SESSION['page_infos'] = array(
     125      l10n('Information data registered in database')
     126      );
     127   
     128    // let's refresh the page because we the current set might be modified
     129    $redirect_url = get_root_url().'admin.php?page='.$_GET['page'];
     130    redirect($redirect_url);
    123131  }
    124132
     
    150158      pwg_query($query);
    151159
    152       // we remove the dissociated images if we are currently displaying the
    153       // category to dissociate from.
    154       //
    155       // TODO we can display the photo of a given album without the $_GET['cat']
    156       if (is_numeric($_GET['cat']) and $_POST['dissociate'] == $_GET['cat'])
    157       {
    158         $page['cat_elements_id'] = array_diff(
    159           $page['cat_elements_id'],
    160           $dissociables
    161           );
    162       }
    163     }
    164 
    165     update_category($_POST['dissociate']);
     160      update_category($_POST['dissociate']);
     161     
     162      $_SESSION['page_infos'] = array(
     163        l10n('Information data registered in database')
     164        );
     165     
     166      // let's refresh the page because we the current set might be modified
     167      $redirect_url = get_root_url().'admin.php?page='.$_GET['page'];
     168      redirect($redirect_url);
     169    }
    166170  }
    167171
  • trunk/admin/maintenance.php

    r8126 r8403  
    154154  $advanced_features,
    155155  array(
    156     'CAPTION' => l10n('Not linked elements'),
    157     'URL' => get_root_url().'admin.php?page=element_set&cat=not_linked'
    158     )
    159   );
    160 
    161 array_push(
    162   $advanced_features,
    163   array(
    164156    'CAPTION' => l10n('Files with same name in more than one physical album'),
    165157    'URL' => get_root_url().'admin.php?page=element_set&cat=duplicates'
  • trunk/admin/themes/default/template/batch_manager_global.tpl

    r8398 r8403  
    354354          <option value="caddie" {if $filter.prefilter eq 'caddie'}selected="selected"{/if}>caddie</option>
    355355          <option value="last import" {if $filter.prefilter eq 'last import'}selected="selected"{/if}>last import</option>
     356{if $ENABLE_SYNCHRONIZATION}
     357          <option value="with no virtual album" {if $filter.prefilter eq 'with no virtual album'}selected="selected"{/if}>with no virtual album</option>
     358{/if}
    356359<!--          <option value="with no album">with no album</option> -->
    357360<!--          <option value="with no virtual album">with no virtual album</option> -->
Note: See TracChangeset for help on using the changeset viewer.