From: Marcin Haba Date: Sat, 29 Nov 2014 17:17:09 +0000 (+0100) Subject: baculum: Tweak split volume tools actions for new buttons X-Git-Tag: Release-7.2.0~111 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=723846012937deb187b5638c31197d491c4befee;p=bacula%2Fbacula baculum: Tweak split volume tools actions for new buttons --- diff --git a/gui/baculum/protected/Portlets/VolumesTools.php b/gui/baculum/protected/Portlets/VolumesTools.php index 538f135cb5..ba2a614e28 100644 --- a/gui/baculum/protected/Portlets/VolumesTools.php +++ b/gui/baculum/protected/Portlets/VolumesTools.php @@ -29,13 +29,6 @@ class VolumesTools extends Portlets { public $slotsPattern = '^[0-9\-\,]+$'; public $drivePattern = '^[0-9]+$'; - public function onInit($param) { - parent::onInit($param); - $this->LabelButton->setActionClass($this); - $this->UpdateSlotsButton->setActionClass($this); - $this->UpdateSlotsScanButton->setActionClass($this); - } - public function onLoad($param) { parent::onLoad($param); if(!$this->getPage()->IsPostBack) { @@ -61,46 +54,41 @@ class VolumesTools extends Portlets { } } - public function save($sender, $param) { - switch($sender->getParent()->ID) { - case $this->LabelButton->ID: { - if($this->LabelNameValidator->isValid === false) { - return; - } - $cmd = array('label'); - if($this->Barcodes->Checked == true) { - $cmd[] = 'barcodes'; - $cmd[] = 'slots="' . $this->SlotsLabel->Text . '"'; - } else { - $cmd[] = 'volume="' . $this->LabelName->Text . '"'; - } - $cmd[] = 'drive="' . $this->DriveLabel->Text . '"'; - $cmd[] = 'storage="'. $this->StorageLabel->SelectedItem->Text . '"'; - $cmd[] = 'pool="'. $this->PoolLabel->SelectedItem->Text . '"'; - $this->getPage()->Console->CommandLine->Text = implode(' ', $cmd); - $this->getPage()->Console->sendCommand($sender, $param); - break; - } - case $this->UpdateSlotsButton->ID: { - $cmd = array('update'); - $cmd[] = 'slots="' . $this->SlotsUpdateSlots->Text . '"'; - $cmd[] = 'drive="' . $this->DriveUpdateSlots->Text . '"'; - $cmd[] = 'storage="'. $this->StorageUpdateSlots->SelectedItem->Text . '"'; - $this->getPage()->Console->CommandLine->Text = implode(' ', $cmd); - $this->getPage()->Console->sendCommand($sender, $param); - break; - } - case $this->UpdateSlotsScanButton->ID: { - $cmd = array('update'); - $cmd[] = 'slots="' . $this->SlotsUpdateSlotsScan->Text . '"'; - $cmd[] = 'scan'; - $cmd[] = 'drive="' . $this->DriveUpdateSlotsScan->Text . '"'; - $cmd[] = 'storage="'. $this->StorageUpdateSlotsScan->SelectedItem->Text . '"'; - $this->getPage()->Console->CommandLine->Text = implode(' ', $cmd); - $this->getPage()->Console->sendCommand($sender, $param); - break; - } + public function labelVolume($sender, $param) { + if($this->LabelNameValidator->isValid === false) { + return; } + $cmd = array('label'); + if($this->Barcodes->Checked == true) { + $cmd[] = 'barcodes'; + $cmd[] = 'slots="' . $this->SlotsLabel->Text . '"'; + } else { + $cmd[] = 'volume="' . $this->LabelName->Text . '"'; + } + $cmd[] = 'drive="' . $this->DriveLabel->Text . '"'; + $cmd[] = 'storage="'. $this->StorageLabel->SelectedItem->Text . '"'; + $cmd[] = 'pool="'. $this->PoolLabel->SelectedItem->Text . '"'; + $this->getPage()->Console->CommandLine->Text = implode(' ', $cmd); + $this->getPage()->Console->sendCommand($sender, $param); + } + + public function updateSlots($sender, $param) { + $cmd = array('update'); + $cmd[] = 'slots="' . $this->SlotsUpdateSlots->Text . '"'; + $cmd[] = 'drive="' . $this->DriveUpdateSlots->Text . '"'; + $cmd[] = 'storage="'. $this->StorageUpdateSlots->SelectedItem->Text . '"'; + $this->getPage()->Console->CommandLine->Text = implode(' ', $cmd); + $this->getPage()->Console->sendCommand($sender, $param); + } + + public function updateSlotsScan($sender, $param) { + $cmd = array('update'); + $cmd[] = 'slots="' . $this->SlotsUpdateSlotsScan->Text . '"'; + $cmd[] = 'scan'; + $cmd[] = 'drive="' . $this->DriveUpdateSlotsScan->Text . '"'; + $cmd[] = 'storage="'. $this->StorageUpdateSlotsScan->SelectedItem->Text . '"'; + $this->getPage()->Console->CommandLine->Text = implode(' ', $cmd); + $this->getPage()->Console->sendCommand($sender, $param); } public function setBarcodes($sender, $param) { @@ -183,4 +171,4 @@ class VolumesTools extends Portlets { } } -?> \ No newline at end of file +?> diff --git a/gui/baculum/protected/Portlets/VolumesTools.tpl b/gui/baculum/protected/Portlets/VolumesTools.tpl index 55f361b5a1..96ad58bc37 100644 --- a/gui/baculum/protected/Portlets/VolumesTools.tpl +++ b/gui/baculum/protected/Portlets/VolumesTools.tpl @@ -44,7 +44,7 @@
- +
@@ -62,7 +62,7 @@
- +
@@ -80,7 +80,7 @@
- +