Changeset 8422 for trunk/admin
- Timestamp:
- Jan 1, 2011, 3:35:52 PM (14 years ago)
- Location:
- trunk/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/batch_manager.php
r8419 r8422 193 193 } 194 194 195 if ('with no tag' == $_SESSION['bulk_manager_filter']['prefilter']) 196 { 197 $query = ' 198 SELECT 199 id 200 FROM '.IMAGES_TABLE.' 201 LEFT JOIN '.IMAGE_TAG_TABLE.' ON id = image_id 202 WHERE tag_id is null 203 ;'; 204 array_push( 205 $filter_sets, 206 array_from_query($query, 'id') 207 ); 208 } 209 210 195 211 if ('duplicates' == $_SESSION['bulk_manager_filter']['prefilter']) 196 212 { -
trunk/admin/batch_manager_global.php
r8417 r8422 65 65 // +-----------------------------------------------------------------------+ 66 66 67 // $page['prefilter'] is a shortcut to test if the current filter contains a 68 // given prefilter. The idea is to make conditions simpler to write in the 69 // code. 70 $page['prefilter'] = 'none'; 71 if (isset($_SESSION['bulk_manager_filter']['prefilter'])) 72 { 73 $page['prefilter'] = $_SESSION['bulk_manager_filter']['prefilter']; 74 } 75 76 // $page['category'] is a shortcut to test if the current filter contains a 77 // given category. The idea is the same as for prefilter 78 $page['category'] = -1; 79 if (isset($_SESSION['bulk_manager_filter']['category'])) 80 { 81 $page['category'] = $_SESSION['bulk_manager_filter']['category']; 82 } 83 84 $redirect_url = get_root_url().'admin.php?page='.$_GET['page']; 85 67 86 if (isset($_POST['submit'])) 68 87 { … … 86 105 pwg_query($query); 87 106 107 if ('caddie' == $page['prefilter']) 108 { 109 redirect($redirect_url); 110 } 111 88 112 // if we are here in the code, it means that the user is currently 89 113 // displaying the caddie content, so we have to remove the current … … 96 120 $tag_ids = get_fckb_tag_ids($_POST['add_tags']); 97 121 add_tags($tag_ids, $collection); 122 123 if ('with no tag' == $page['prefilter']) 124 { 125 redirect(get_root_url().'admin.php?page='.$_GET['page']); 126 } 98 127 } 99 128 … … 126 155 127 156 // let's refresh the page because we the current set might be modified 128 $redirect_url = get_root_url().'admin.php?page='.$_GET['page']; 129 redirect($redirect_url); 157 if ('with no album' == $page['prefilter']) 158 { 159 redirect($redirect_url); 160 } 161 162 if ('with no virtual album' == $page['prefilter']) 163 { 164 $category_info = get_cat_info($_POST['associate']); 165 if (empty($category_info['dir'])) 166 { 167 redirect($redirect_url); 168 } 169 } 130 170 } 131 171 … … 164 204 165 205 // let's refresh the page because we the current set might be modified 166 $redirect_url = get_root_url().'admin.php?page='.$_GET['page'];167 206 redirect($redirect_url); 168 207 } … … 262 301 $datas 263 302 ); 303 304 if (isset($_SESSION['bulk_manager_filter']['level'])) 305 { 306 if ($_POST['level'] < $_SESSION['bulk_manager_filter']['level']) 307 { 308 redirect($redirect_url); 309 } 310 } 264 311 } 265 312 … … 301 348 array_push($page['errors'], l10n('You need to confirm deletion')); 302 349 } 350 } 351 352 // synchronize metadata 353 if ('metadata' == $action) 354 { 355 $query = ' 356 SELECT id, path 357 FROM '.IMAGES_TABLE.' 358 WHERE id IN ('.implode(',', $collection).') 359 ;'; 360 $id_to_path = array(); 361 $result = pwg_query($query); 362 while ($row = pwg_db_fetch_assoc($result)) 363 { 364 $id_to_path[$row['id']] = $row['path']; 365 } 366 367 update_metadata($id_to_path); 368 369 array_push( 370 $page['infos'], 371 l10n('Metadata synchronized from file') 372 ); 303 373 } 304 374 } … … 478 548 ); 479 549 550 // metadata 551 include_once( PHPWG_ROOT_PATH.'admin/site_reader_local.php'); 552 $site_reader = new LocalSiteReader('./'); 553 $used_metadata = implode( ', ', $site_reader->get_metadata_attributes()); 554 555 $template->assign( 556 array( 557 'used_metadata' => $used_metadata, 558 ) 559 ); 560 480 561 // +-----------------------------------------------------------------------+ 481 562 // | global mode thumbnails | -
trunk/admin/themes/default/template/batch_manager_global.tpl
r8419 r8422 349 349 <option value="with no virtual album" {if $filter.prefilter eq 'with no virtual album'}selected="selected"{/if}>{'with no virtual album'|@translate}</option> 350 350 {/if} 351 <option value="with no tag" {if $filter.prefilter eq 'with no tag'}selected="selected"{/if}>{'with no tag'|@translate}</option> 351 352 <option value="duplicates" {if $filter.prefilter eq 'duplicates'}selected="selected"{/if}>{'duplicates'|@translate}</option> 352 <!-- <option value="with no tag">with no tag</option> -->353 353 </select> 354 354 </li> … … 485 485 <option value="date_creation">{'Set creation date'|@translate}</option> 486 486 <option value="level">{'Who can see these photos?'|@translate}</option> 487 <option value="metadata">{'synchronize metadata'|@translate}</option> 487 488 {if ($IN_CADDIE)} 488 489 <option value="remove_from_caddie">{'Remove from caddie'|@translate}</option> … … 567 568 </div> 568 569 570 <!-- metadata --> 571 <div id="action_metadata" class="bulkAction"> 572 </div> 573 569 574 <p id="applyActionBlock" style="display:none" class="actionButtons"> 570 575 <input id="applyAction" class="submit" type="submit" value="{'Apply action'|@translate}" name="submit"> <span id="applyOnDetails"></span></p>
Note: See TracChangeset
for help on using the changeset viewer.