Index: /trunk/admin/batch_manager.php =================================================================== --- /trunk/admin/batch_manager.php (revision 28086) +++ /trunk/admin/batch_manager.php (revision 28087) @@ -86,5 +86,5 @@ { $_SESSION['bulk_manager_filter']['level'] = $_POST['filter_level']; - + if (isset($_POST['filter_level_include_lower'])) { @@ -93,5 +93,5 @@ } } - + if (isset($_POST['filter_dimension_use'])) { @@ -111,7 +111,12 @@ } } + + if (isset($_POST['filter_search_use'])) + { + $_SESSION['bulk_manager_filter']['search']['q'] = $_POST['q']; + } } // filters from url -else if (isset($_GET['filter'])) +elseif (isset($_GET['filter'])) { if (!is_array($_GET['filter'])) @@ -119,11 +124,11 @@ $_GET['filter'] = explode(',', $_GET['filter']); } - + $_SESSION['bulk_manager_filter'] = array(); - + foreach ($_GET['filter'] as $filter) { list($type, $value) = explode('-', $filter); - + switch ($type) { @@ -131,5 +136,5 @@ $_SESSION['bulk_manager_filter']['prefilter'] = $value; break; - + case 'album': if (is_numeric($value)) @@ -138,5 +143,5 @@ } break; - + case 'tag': if (is_numeric($value)) @@ -146,5 +151,5 @@ } break; - + case 'level': if (is_numeric($value) && in_array($value, $conf['available_permission_levels'])) @@ -179,5 +184,5 @@ ;'; $filter_sets[] = array_from_query($query, 'element_id'); - + break; @@ -189,5 +194,5 @@ ;'; $filter_sets[] = array_from_query($query, 'image_id'); - + break; @@ -207,5 +212,5 @@ $filter_sets[] = array_from_query($query, 'id'); } - + break; @@ -235,5 +240,5 @@ $filter_sets[] = array_diff($all_elements, $linked_to_virtual); - + break; @@ -247,5 +252,5 @@ ;'; $filter_sets[] = array_from_query($query, 'id'); - + break; @@ -259,5 +264,5 @@ ;'; $filter_sets[] = array_from_query($query, 'id'); - + break; @@ -281,5 +286,5 @@ ;'; $filter_sets[] = array_from_query($query, 'id'); - + break; @@ -291,5 +296,5 @@ $filter_sets[] = array_from_query($query, 'id'); - + break; } @@ -326,5 +331,5 @@ $operator = '<='; } - + $query = ' SELECT id @@ -375,5 +380,5 @@ $where_clause[] = 'width/height < '.($_SESSION['bulk_manager_filter']['dimension']['max_ratio']+0.01); } - + $query = ' SELECT id @@ -383,4 +388,11 @@ $filter_sets[] = array_from_query($query, 'id'); +} + +if (isset($_SESSION['bulk_manager_filter']['search'])) +{ + include_once( PHPWG_ROOT_PATH .'include/functions_search.inc.php' ); + $res = get_quick_search_results($_SESSION['bulk_manager_filter']['search']['q'], array('permissions'=>false)); + $filter_sets[] = $res['items']; } Index: /trunk/admin/batch_manager_global.php =================================================================== --- /trunk/admin/batch_manager_global.php (revision 28086) +++ /trunk/admin/batch_manager_global.php (revision 28087) @@ -87,5 +87,5 @@ $action = $_POST['selectAction']; - + if ('remove_from_caddie' == $action) { @@ -148,5 +148,5 @@ l10n('Information data registered in database') ); - + // let's refresh the page because we the current set might be modified if ('no_album' == $page['prefilter']) @@ -172,5 +172,5 @@ l10n('Information data registered in database') ); - + // let's refresh the page because we the current set might be modified if ('no_album' == $page['prefilter']) @@ -225,5 +225,5 @@ l10n('Information data registered in database') ); - + // let's refresh the page because the current set might be modified redirect($redirect_url); @@ -238,5 +238,5 @@ $_POST['author'] = null; } - + $datas = array(); foreach ($collection as $image_id) @@ -262,5 +262,5 @@ $_POST['title'] = null; } - + $datas = array(); foreach ($collection as $image_id) @@ -278,5 +278,5 @@ ); } - + // date_creation if ('date_creation' == $action) @@ -309,5 +309,5 @@ ); } - + // privacy_level if ('level' == $action) @@ -336,5 +336,5 @@ } } - + // add_to_caddie if ('add_to_caddie' == $action) @@ -342,5 +342,5 @@ fill_caddie($collection); } - + // delete if ('delete' == $action) @@ -665,9 +665,9 @@ SELECT id,path,representative_ext,file,filesize,level,name,width,height,rotation FROM '.IMAGES_TABLE; - + if ($is_category) { $category_info = get_cat_info($_SESSION['bulk_manager_filter']['category']); - + $conf['order_by'] = $conf['order_by_inside_category']; if (!empty($category_info['image_order'])) Index: /trunk/admin/themes/default/template/batch_manager_global.tpl =================================================================== --- /trunk/admin/themes/default/template/batch_manager_global.tpl (revision 28086) +++ /trunk/admin/themes/default/template/batch_manager_global.tpl (revision 28087) @@ -666,4 +666,13 @@ + +
@@ -677,4 +686,5 @@ + {'Remove all filters'|@translate} Index: /trunk/include/functions_search.inc.php =================================================================== --- /trunk/include/functions_search.inc.php (revision 28086) +++ /trunk/include/functions_search.inc.php (revision 28087) @@ -1194,5 +1194,5 @@ * @return array */ -function get_quick_search_results($q, $super_order_by, $images_where='') +function get_quick_search_results($q, $options) { global $conf; @@ -1255,24 +1255,33 @@ } + $permissions = !isset($options['permissions']) ? true : $options['permissions']; + $where_clauses = array(); $where_clauses[]='i.id IN ('. implode(',', $ids) . ')'; - if (!empty($images_where)) + if (!empty($options['images_where')) { $where_clauses[]='('.$images_where.')'; } - $where_clauses[] = get_sql_condition_FandF( - array - ( - 'forbidden_categories' => 'category_id', - 'visible_categories' => 'category_id', - 'visible_images' => 'i.id' - ), - null,true - ); + if ($permissions) + { + $where_clauses[] = get_sql_condition_FandF( + array + ( + 'forbidden_categories' => 'category_id', + 'visible_categories' => 'category_id', + 'visible_images' => 'i.id' + ), + null,true + ); + } $query = ' -SELECT DISTINCT(id) - FROM '.IMAGES_TABLE.' i - INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id +SELECT DISTINCT(id) FROM '.IMAGES_TABLE.' i'; + if ($permissions) + { + $query .= ' + INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id'; + } + $query .= ' WHERE '.implode("\n AND ", $where_clauses)."\n". $conf['order_by']; @@ -1306,5 +1315,5 @@ else { - return get_quick_search_results($search['q'], $super_order_by, $images_where); + return get_quick_search_results($search['q'], array('super_order_by'=>$super_order_by, 'images_where'=>$images_where) ); } } Index: /trunk/include/ws_functions/pwg.images.php =================================================================== --- /trunk/include/ws_functions/pwg.images.php (revision 28086) +++ /trunk/include/ws_functions/pwg.images.php (revision 28087) @@ -295,5 +295,5 @@ * @option string key */ -function ws_images_addComment($params, &$service) +function ws_images_addComment($params, $service) { $query = ' @@ -355,5 +355,5 @@ * @option int comments_per_page */ -function ws_images_getInfo($params, &$service) +function ws_images_getInfo($params, $service) { global $user, $conf; @@ -580,5 +580,5 @@ * @option float rate */ -function ws_images_rate($params, &$service) +function ws_images_rate($params, $service) { $query = ' @@ -621,5 +621,5 @@ * @option string order (optional) */ -function ws_images_search($params, &$service) +function ws_images_search($params, $service) { include_once(PHPWG_ROOT_PATH .'include/functions_search.inc.php'); @@ -639,6 +639,8 @@ $search_result = get_quick_search_results( $params['query'], - $super_order_by, - implode(' AND ', $where_clauses) + array( + 'super_order_by' => $super_order_by, + 'images_where' => implode(' AND ', $where_clauses) + ) ); @@ -705,5 +707,5 @@ * @option int level */ -function ws_images_setPrivacyLevel($params, &$service) +function ws_images_setPrivacyLevel($params, $service) { global $conf; @@ -738,5 +740,5 @@ * @option int rank */ -function ws_images_setRank($params, &$service) +function ws_images_setRank($params, $service) { // does the image really exist? @@ -821,5 +823,5 @@ * @option int position */ -function ws_images_add_chunk($params, &$service) +function ws_images_add_chunk($params, $service) { global $conf; @@ -878,5 +880,5 @@ * @option string sum */ -function ws_images_addFile($params, &$service) +function ws_images_addFile($params, $service) { ws_logfile(__FUNCTION__.', input : '.var_export($params, true)); @@ -971,5 +973,5 @@ * @option int image_id (optional) */ -function ws_images_add($params, &$service) +function ws_images_add($params, $service) { global $conf, $user; @@ -1134,5 +1136,5 @@ * @option int image_id (optional) */ -function ws_images_addSimple($params, &$service) +function ws_images_addSimple($params, $service) { global $conf; @@ -1248,5 +1250,5 @@ * @option string filename_list (optional) */ -function ws_images_exist($params, &$service) +function ws_images_exist($params, $service) { ws_logfile(__FUNCTION__.' '.var_export($params, true)); @@ -1321,5 +1323,5 @@ * @option string file_sum */ -function ws_images_checkFiles($params, &$service) +function ws_images_checkFiles($params, $service) { ws_logfile(__FUNCTION__.', input : '.var_export($params, true)); @@ -1393,5 +1395,5 @@ * @option string multiple_value_mode */ -function ws_images_setInfo($params, &$service) +function ws_images_setInfo($params, $service) { include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); @@ -1529,5 +1531,5 @@ * @option string pwg_token */ -function ws_images_delete($params, &$service) +function ws_images_delete($params, $service) { if (get_pwg_token() != $params['pwg_token']) @@ -1566,5 +1568,5 @@ * @param mixed[] $params */ -function ws_images_checkUpload($params, &$service) +function ws_images_checkUpload($params, $service) { include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php'); Index: /trunk/language/en_UK/help/quick_search.html =================================================================== --- /trunk/language/en_UK/help/quick_search.html (revision 28087) +++ /trunk/language/en_UK/help/quick_search.html (revision 28087) @@ -0,0 +1,129 @@ +By default all searched terms must match. Searches are case-insesitive.
+ +quoted phrase + "search"+ |
+Use quotes to search for an exact word or phrase. + "george washington" |
+
either term + OR search + |
+Add a OR between words. + john OR bill |
+
exclude + NOT search + -search+ |
+Add a dash (-) or NOT before a word to exclude from search. Note that NOT acts as a filtering operator so you cannot have a search containing only NOT operators. You cannot combine OR with NOT (john OR NOT billis not valid) + george washington NOT bush |
+
grouping + () + |
++ (mother OR father) AND (daugther OR son) |
+
tag:+ |
+Searches only in tag names without looking at photo titles or descriptions. + tag:john, tag:(john OR bill) |
+
photo:+ |
++ |
file:+ |
+Searches by file name. | +
created: + taken:+ |
+Searches photos by taken date + taken:2003photos taken in 2003 + taken:20035, taken:2003-5, taken:2003-05photos from may 2003 + taken:2003..2008photos from 2003 to 2008 + taken:>2008, taken:2008*, taken:2008..photos afteer Jan 1st 2008 + |
+
posted:+ |
++ |
width: + height:+ |
++ |
size:+ |
++ |
ratio:+ |
++ |
hits:+ |
++ |
score:+ |
++ |