Changeset 24834
- Timestamp:
- Oct 10, 2013, 1:07:45 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin.php
r20609 r24834 190 190 'U_CAT_UPDATE'=> $link_start.'site_update&site=1', 191 191 'U_RATING'=> $link_start.'rating', 192 'U_RECENT_SET'=> $link_start.'batch_manager& cat=recent',192 'U_RECENT_SET'=> $link_start.'batch_manager&filter=prefilter-last_import', 193 193 'U_BATCH'=> $link_start.'batch_manager', 194 194 'U_TAGS'=> $link_start.'tags', … … 223 223 array( 224 224 'NB_PHOTOS_IN_CADDIE' => $nb_photos_in_caddie, 225 'U_CADDIE' => $link_start.'batch_manager& cat=caddie',225 'U_CADDIE' => $link_start.'batch_manager&filter=prefilter-caddie', 226 226 ) 227 227 ); -
trunk/admin/batch_manager.php
r23746 r24834 44 44 check_input_parameter('selection', $_POST, true, PATTERN_ID); 45 45 46 46 47 // +-----------------------------------------------------------------------+ 47 48 // | initialize current set | 48 49 // +-----------------------------------------------------------------------+ 49 50 51 // filters from form 50 52 if (isset($_POST['submitFilter'])) 51 53 { … … 110 112 } 111 113 } 112 else if (isset($_GET['cat'])) 113 { 114 if ('caddie' == $_GET['cat']) 115 { 116 $_SESSION['bulk_manager_filter'] = array( 117 'prefilter' => 'caddie' 118 ); 119 } 120 else if ('recent' == $_GET['cat']) 121 { 122 $_SESSION['bulk_manager_filter'] = array( 123 'prefilter' => 'last import' 124 ); 125 } 126 else if (is_numeric($_GET['cat'])) 127 { 128 $_SESSION['bulk_manager_filter'] = array( 129 'category' => $_GET['cat'] 130 ); 131 } 132 } 133 else if (isset($_GET['tag'])) 134 { 135 if (is_numeric($_GET['tag'])) 136 { 137 $_SESSION['bulk_manager_filter'] = array( 138 'tags' => array($_GET['tag']), 139 'tag_mode' => 'AND', 140 ); 141 } 142 } 143 144 if (!isset($_SESSION['bulk_manager_filter'])) 114 // filters from url 115 else if (isset($_GET['filter'])) 116 { 117 if (!is_array($_GET['filter'])) 118 { 119 $_GET['filter'] = explode(',', $_GET['filter']); 120 } 121 122 $_SESSION['bulk_manager_filter'] = array(); 123 124 foreach ($_GET['filter'] as $filter) 125 { 126 list($type, $value) = explode('-', $filter); 127 128 switch ($type) 129 { 130 case 'prefilter': 131 $_SESSION['bulk_manager_filter']['prefilter'] = $value; 132 break; 133 134 case 'album': 135 if (is_numeric($value)) 136 { 137 $_SESSION['bulk_manager_filter']['category'] = $value; 138 } 139 break; 140 141 case 'tag': 142 if (is_numeric($value)) 143 { 144 $_SESSION['bulk_manager_filter']['tags'] = array($value); 145 $_SESSION['bulk_manager_filter']['tag_mode'] = 'AND'; 146 } 147 break; 148 149 case 'level': 150 if (is_numeric($value) && in_array($value, $conf['available_permission_levels'])) 151 { 152 $_SESSION['bulk_manager_filter']['level'] = $value; 153 } 154 break; 155 } 156 } 157 } 158 159 if (empty($_SESSION['bulk_manager_filter'])) 145 160 { 146 161 $_SESSION['bulk_manager_filter'] = array( … … 151 166 // echo '<pre>'; print_r($_SESSION['bulk_manager_filter']); echo '</pre>'; 152 167 153 // depending on the current filter (in session), we find the appropriate 154 // photos 168 // depending on the current filter (in session), we find the appropriate photos 155 169 $filter_sets = array(); 156 170 if (isset($_SESSION['bulk_manager_filter']['prefilter'])) 157 171 { 158 if ('caddie' == $_SESSION['bulk_manager_filter']['prefilter']) 159 { 172 switch ($_SESSION['bulk_manager_filter']['prefilter']) 173 { 174 case 'caddie': 160 175 $query = ' 161 176 SELECT element_id … … 167 182 array_from_query($query, 'element_id') 168 183 ); 169 }170 171 if ('favorites' == $_SESSION['bulk_manager_filter']['prefilter']) 172 {184 185 break; 186 187 case 'favorites': 173 188 $query = ' 174 189 SELECT image_id … … 180 195 array_from_query($query, 'image_id') 181 196 ); 182 }183 184 if ('last import'== $_SESSION['bulk_manager_filter']['prefilter']) 185 {197 198 break; 199 200 case 'last_import': 186 201 $query = ' 187 202 SELECT MAX(date_available) AS date … … 201 216 ); 202 217 } 203 }204 205 if ('with no virtual album' == $_SESSION['bulk_manager_filter']['prefilter']) 206 {218 219 break; 220 221 case 'no_virtual_album': 207 222 // we are searching elements not linked to any virtual category 208 223 $query = ' … … 232 247 array_diff($all_elements, $linked_to_virtual) 233 248 ); 234 }235 236 if ('with no album' == $_SESSION['bulk_manager_filter']['prefilter']) 237 {249 250 break; 251 252 case 'no_album': 238 253 $query = ' 239 254 SELECT … … 247 262 array_from_query($query, 'id') 248 263 ); 249 }250 251 if ('with no tag' == $_SESSION['bulk_manager_filter']['prefilter']) 252 {264 265 break; 266 267 case 'no_tag': 253 268 $query = ' 254 269 SELECT … … 262 277 array_from_query($query, 'id') 263 278 ); 264 }265 266 267 if ('duplicates' == $_SESSION['bulk_manager_filter']['prefilter']) 268 {279 280 break; 281 282 283 case 'duplicates': 269 284 // we could use the group_concat MySQL function to retrieve the list of 270 285 // image_ids but it would not be compatible with PostgreSQL, so let's 271 286 // perform 2 queries instead. We hope there are not too many duplicates. 272 273 287 $query = ' 274 288 SELECT file … … 289 303 array_from_query($query, 'id') 290 304 ); 291 }292 293 if ('all photos' == $_SESSION['bulk_manager_filter']['prefilter']) 294 {305 306 break; 307 308 case 'all_photos': 295 309 $query = ' 296 310 SELECT id … … 299 313 300 314 $filter_sets[] = array_from_query($query, 'id'); 315 316 break; 301 317 } 302 318 … … 404 420 $page['cat_elements_id'] = $current_set; 405 421 422 406 423 // +-----------------------------------------------------------------------+ 407 424 // | first element to display | … … 424 441 } 425 442 443 426 444 // +-----------------------------------------------------------------------+ 427 445 // | Tabs | … … 443 461 $tabsheet->assign(); 444 462 463 445 464 // +-----------------------------------------------------------------------+ 446 465 // | tags | … … 452 471 ;'; 453 472 $template->assign('tags', get_taglist($query, false)); 473 454 474 455 475 // +-----------------------------------------------------------------------+ -
trunk/admin/batch_manager_global.php
r24526 r24834 113 113 add_tags($tag_ids, $collection); 114 114 115 if (' with notag' == $page['prefilter'])115 if ('no_tag' == $page['prefilter']) 116 116 { 117 117 redirect($redirect_url); … … 150 150 151 151 // let's refresh the page because we the current set might be modified 152 if (' with noalbum' == $page['prefilter'])152 if ('no_album' == $page['prefilter']) 153 153 { 154 154 redirect($redirect_url); 155 155 } 156 156 157 if (' with no virtualalbum' == $page['prefilter'])157 if ('no_virtual_album' == $page['prefilter']) 158 158 { 159 159 $category_info = get_cat_info($_POST['associate']); … … 174 174 175 175 // let's refresh the page because we the current set might be modified 176 if (' with noalbum' == $page['prefilter'])176 if ('no_album' == $page['prefilter']) 177 177 { 178 178 redirect($redirect_url); 179 179 } 180 180 181 if (' with no virtualalbum' == $page['prefilter'])181 if ('no_virtual_album' == $page['prefilter']) 182 182 { 183 183 $category_info = get_cat_info($_POST['move']); … … 436 436 array('ID' => 'caddie', 'NAME' => l10n('Caddie')), 437 437 array('ID' => 'favorites', 'NAME' => l10n('Your favorites')), 438 array('ID' => 'last 439 array('ID' => ' with noalbum', 'NAME' => l10n('With no album')),440 array('ID' => ' with notag', 'NAME' => l10n('With no tag')),438 array('ID' => 'last_import', 'NAME' => l10n('Last import')), 439 array('ID' => 'no_album', 'NAME' => l10n('With no album')), 440 array('ID' => 'no_tag', 'NAME' => l10n('With no tag')), 441 441 array('ID' => 'duplicates', 'NAME' => l10n('Duplicates')), 442 array('ID' => 'all 442 array('ID' => 'all_photos', 'NAME' => l10n('All')) 443 443 ); 444 444 … … 446 446 { 447 447 array_push($prefilters, 448 array('ID' => ' with no virtualalbum', 'NAME' => l10n('With no virtual album'))448 array('ID' => 'no_virtual_album', 'NAME' => l10n('With no virtual album')) 449 449 ); 450 450 } … … 461 461 'START' => $page['start'], 462 462 'U_DISPLAY'=>$base_url.get_query_string_diff(array('display')), 463 'F_ACTION'=>$base_url.get_query_string_diff(array('cat','start','tag' )),463 'F_ACTION'=>$base_url.get_query_string_diff(array('cat','start','tag','filter')), 464 464 ) 465 465 ); -
trunk/admin/cat_list.php
r19703 r24834 323 323 { 324 324 $tpl_cat['U_MANAGE_ELEMENTS']= 325 $base_url.'batch_manager& cat='.$category['id'];325 $base_url.'batch_manager&filter=album-'.$category['id']; 326 326 } 327 327 -
trunk/admin/cat_modify.php
r19703 r24834 253 253 $template->assign( 254 254 'U_MANAGE_ELEMENTS', 255 $base_url.'batch_manager& cat='.$category['id']255 $base_url.'batch_manager&filter=album-'.$category['id'] 256 256 ); 257 257 -
trunk/admin/photos_add_direct.php
r19703 r24834 58 58 ); 59 59 60 redirect(get_root_url().'admin.php?page=batch_manager& cat=caddie');60 redirect(get_root_url().'admin.php?page=batch_manager&filter=prefilter-caddie'); 61 61 } 62 62 -
trunk/admin/tags.php
r19703 r24834 462 462 $tag['counter'] = intval(@$tag_counters[ $tag['id'] ]); 463 463 $tag['U_VIEW'] = make_index_url(array('tags'=>array($tag))); 464 $tag['U_EDIT'] = 'admin.php?page=batch_manager& tag='.$tag['id'];464 $tag['U_EDIT'] = 'admin.php?page=batch_manager&filter=tag-'.$tag['id']; 465 465 466 466 $alt_names = trigger_event('get_tag_alt_names', array(), $raw_name);
Note: See TracChangeset
for help on using the changeset viewer.