Code

Updated some sieve templates
[gosa.git] / gosa-si / server / events / opsi_com.pm
index 926e33d3abb7c4b7505f2ef78d7eb8124c365b20..c6fee306ac2a0b02d626b75da569738457fd5b31 100644 (file)
@@ -4,10 +4,18 @@
 
 
 package opsi_com;
+
+use strict;
+use warnings;
+
 use Exporter;
 use UNIVERSAL 'isa';
+use GOSA::GosaSupportDaemon;
+use Data::Dumper;
+use XML::Quote qw(:all);
+
+our @ISA = qw(Exporter);
 
-@ISA = qw(Exporter);
 my @events = (
     "get_events",
     "opsi_install_client",
@@ -44,13 +52,9 @@ my @events = (
     "opsi_unboundHostFromLicense",
     "opsi_test",
    );
-@EXPORT = @events;
 
-use strict;
-use warnings;
-use GOSA::GosaSupportDaemon;
-use Data::Dumper;
-use XML::Quote qw(:all);
+our @EXPORT = @events;
+
 
 BEGIN {}
 
@@ -611,7 +615,7 @@ sub opsi_get_product_properties {
             if (defined $values->{$key}){
               $vals= $values->{$key};
             }
-            $item.= "<$key>$dsc<default>".xml_quote($value)."</default>$vals</$key>";
+            $item.= "<$key>$dsc<current>".xml_quote($value)."</current>$vals</$key>";
             $item.= "</item>";
             $xml_msg=~ s/<xxx><\/xxx>/$item<xxx><\/xxx>/;
         }
@@ -1422,7 +1426,9 @@ sub opsi_getSoftwareLicenseUsagesForProductId {
        # Fetch licensePoolId for productId
        my ($res, $err) = &_getLicensePoolId('productId'=>$productId);
        if ($err){
-               return &_giveErrorFeedback($msg_hash, "cannot fetch licensePoolId for given productId : ".$res, $session_id);
+                my $out_hash = &create_xml_hash("answer_$header", $main::server_address, $source);
+                $out_hash->{result} = [];
+               return ( &create_xml_string($out_hash) );
        }
        my $licensePoolId = $res;   # We assume that there is only one pool for each productID!!!
 
@@ -2662,10 +2668,6 @@ sub _getProductStates_hash {
 sub _get_full_product_host_information {
        my %arg = ( 'hostId' => undef, @_ );
 
-       if (not defined $arg{hostId}) {
-               return ("function requires hostId as parameter", 1);
-       }
-
        my $res = &_callOpsi( method => 'getFullProductHostInformation_list',  params => [$arg{hostId}]);
        my ($res_error, $res_error_str) = &check_opsi_res($res);
        if ($res_error){ return ((caller(0))[3]." : ".$res_error_str, 1); }