summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2012-02-17 17:44:49 (GMT)
committerChristian Pointner <equinox@helsinki.at>2012-02-17 17:44:49 (GMT)
commitbd0d8a26d9837b7bb71740856ebcb6df1a84d226 (patch)
treeeb41ba44e768c0f3ed107d68254fa420ef59a206
parente08dbd3ddb76b947554fde1708edb79eb0bface1 (diff)
implemented type of pv note
-rwxr-xr-xrhimport-rs4
-rw-r--r--rhimport.pm8
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);