diff options
-rwxr-xr-x | rhimport-rs | 4 | ||||
-rw-r--r-- | rhimport.pm | 8 |
2 files changed, 7 insertions, 5 deletions
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); |