From bd0d8a26d9837b7bb71740856ebcb6df1a84d226 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 17 Feb 2012 17:44:49 +0000 Subject: implemented type of pv note diff --git a/rhimport-rs b/rhimport-rs index 1f2ed59..3d9d4f5 100755 --- a/rhimport-rs +++ b/rhimport-rs @@ -113,9 +113,9 @@ for my $entry ($feed->entries) { print "summary:\n" . $sum_title . "\n\n" . $sum_text . "\n"; - rhimport::pv_add_note($sum_title, $sum_text, $PV_ID, sprintf("%04d-%02d-%02d", $import_date[0], $import_date[1], $import_date[2]), 'n'); + rhimport::pv_add_note($sum_title, $sum_text, $PV_ID, sprintf("%04d-%02d-%02d", $import_date[0], $import_date[1], $import_date[2]), 1); print "\n"; - rhimport::pv_add_note($sum_title, $sum_text, $PV_ID, sprintf("%04d-%02d-%02d", $import_date_reb[0], $import_date_reb[1], $import_date_reb[2]), 'r'); + rhimport::pv_add_note($sum_title, $sum_text, $PV_ID, sprintf("%04d-%02d-%02d", $import_date_reb[0], $import_date_reb[1], $import_date_reb[2]), 2); print "\n"; last; diff --git a/rhimport.pm b/rhimport.pm index d9b1097..e0bc11d 100644 --- a/rhimport.pm +++ b/rhimport.pm @@ -330,10 +330,12 @@ sub delete_file sub pv_add_note { my ( $title, $text, $id, $date, $type ) = @_; - $type = 'n' if undef($type); + $type = 1 if undef($type); + # 0 -> Cancelation + # 1 -> Recommandation + # 2 -> Repitition - # TODO: implement type as soon pv supports this - my @script = ('/usr/bin/ssh', 'root@intranet', 'addnote', $id, $date); + my @script = ('/usr/bin/ssh', 'root@intranet', 'addnote', $id, $date, $type); my ($reader, $writer, $error ) = ( new IO::Handle, new IO::Handle, new IO::Handle ); $writer->autoflush(1); -- cgit v0.10.2