diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2012-12-05 17:35:10 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2012-12-05 17:35:10 +0100 |
commit | d6c87445aa63af62cf5b93d546807afc2429e7fd (patch) | |
tree | 762949a7f574ed7883f0bcfddbf560e15a965037 | |
parent | f3bcc1d514bb75557a2da8404b468e4e34e76d95 (diff) | |
parent | d8b74774531bf854695f6b1497a405bc78b54559 (diff) | |
download | bugzilla-d6c87445aa63af62cf5b93d546807afc2429e7fd.tar.gz bugzilla-d6c87445aa63af62cf5b93d546807afc2429e7fd.tar.xz |
merged with bugzilla/4.2
-rw-r--r-- | Bugzilla/User.pm | 29 | ||||
-rw-r--r-- | Bugzilla/WebService/Bug.pm | 4 | ||||
-rwxr-xr-x | contrib/bz_webservice_demo.pl | 30 |
3 files changed, 51 insertions, 12 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 0b4c1c867..151919bf8 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -2213,6 +2213,35 @@ Returns a hashref with tag IDs as key, and a hashref with tag 'id', =back +=head2 Saved Recent Bug Lists + +=over + +=item C<recent_searches> + +Returns an arrayref of L<Bugzilla::Search::Recent> objects +containing the user's recent searches. + +=item C<recent_search_containing(bug_id)> + +Returns a L<Bugzilla::Search::Recent> object that contains the most recent +search by the user for the specified bug id. Retuns undef if no match is found. + +=item C<recent_search_for(bug)> + +Returns a L<Bugzilla::Search::Recent> object that contains a search by the +user. Uses the list_id of the current loaded page, or the referrer page, and +the bug id if that fails. Finally it will check the BUGLIST cookie, and create +an object based on that, or undef if it does not exist. + +=item C<save_last_search> + +Saves the users most recent search in the database if logged in, or in the +BUGLIST cookie if not logged in. Parameters are bug_ids, order, vars and +list_id. + +=back + =head2 Account Lockout =over diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 1722086cd..4018cfa6e 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -2604,7 +2604,9 @@ these bugs. =item C<data> -B<Required> C<base64> The content of the attachment. +B<Required> C<base64> or C<string> The content of the attachment. +If the content of the attachment is not ASCII text, you must encode +it in base64 and declare it as the C<base64> type. =item C<file_name> diff --git a/contrib/bz_webservice_demo.pl b/contrib/bz_webservice_demo.pl index 104151d85..72ec58a88 100755 --- a/contrib/bz_webservice_demo.pl +++ b/contrib/bz_webservice_demo.pl @@ -287,24 +287,32 @@ if ($bug_id) { =head2 Retrieving Product Information -Call C<Product.get_product> with the name of the product you want to know more -of. +Call C<Product.get> with the name of the product you want to know more of. The call will return a C<Bugzilla::Product> object. =cut if ($product_name) { - $soapresult = $proxy->call('Product.get_product', $product_name); + $soapresult = $proxy->call('Product.get', {'names' => [$product_name]}); _die_on_fault($soapresult); - $result = $soapresult->result; - - if (ref($result) eq 'HASH') { - foreach (keys(%$result)) { - print "$_: $$result{$_}\n"; + $result = $soapresult->result()->{'products'}->[0]; + + # Iterate all entries, the values may be scalars or array refs with hash refs. + foreach my $key (sort(keys %$result)) { + my $value = $result->{$key}; + + if (ref($value)) { + my $counter = 0; + foreach my $hash (@$value) { + while (my ($innerKey, $innerValue) = each %$hash) { + print "$key.$counter.$innerKey: $innerValue\n"; + } + ++$counter; } - } - else { - print "$result\n"; + } + else { + print "$key: $value\n" + } } } |