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) {
}
}
- 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) {
}
}
-?>
\ No newline at end of file
+?>
<div class="field"><com:TActiveDropDownList ID="PoolLabel" CssClass="textbox" /></div>
</div>
<div class="button" style="margin-top: 10px;">
- <com:BActiveButton ID="LabelButton" Text="<%[ Label ]%>" CausesValidation="true" ValidationGroup="VolumesActionGroup" />
+ <com:BActiveButton ID="LabelButton" Text="<%[ Label ]%>" CausesValidation="true" ValidationGroup="VolumesActionGroup" OnClick="labelVolume" />
</div>
</com:TActivePanel>
<div class="line"><com:TActiveRadioButton ID="UpdateSlots" GroupName="VolumeAction" OnCallback="setUpdateSlots" ActiveControl.ClientSide.OnComplete="window.scrollTo(0, document.body.scrollHeight);" /><com:TLabel ForControl="UpdateSlots" Text="<%[ Update slots using barcodes ]%>" /></div>
<div class="field"><com:TActiveTextBox ID="SlotsUpdateSlots" CssClass="textbox" /></div>
</div>
<div class="button" style="margin-top: 10px;">
- <com:BActiveButton ID="UpdateSlotsButton" Text="<%[ Update barcodes slots ]%>" CausesValidation="true" ValidationGroup="VolumesActionGroup" />
+ <com:BActiveButton ID="UpdateSlotsButton" Text="<%[ Update barcodes slots ]%>" CausesValidation="true" ValidationGroup="VolumesActionGroup" OnClick="updateSlots" />
</div>
</com:TActivePanel>
<div class="line"><com:TActiveRadioButton ID="UpdateSlotsScan" GroupName="VolumeAction" OnCallback="setUpdateSlotsScan" ActiveControl.ClientSide.OnComplete="window.scrollTo(0, document.body.scrollHeight);" /><com:TLabel ForControl="UpdateSlotsScan" Text="<%[ Update slots without barcodes ]%>" /></div>
<div class="field"><com:TActiveTextBox ID="SlotsUpdateSlotsScan" CssClass="textbox" /></div>
</div>
<div class="button" style="margin-top: 10px;">
- <com:BActiveButton ID="UpdateSlotsScanButton" Text="<%[ Update slots scan ]%>" CausesValidation="true" ValidationGroup="VolumesActionGroup" />
+ <com:BActiveButton ID="UpdateSlotsScanButton" Text="<%[ Update slots scan ]%>" CausesValidation="true" ValidationGroup="VolumesActionGroup" OnClick="updateSlotsScan" />
</div>
</com:TActivePanel>
</com:TActivePanel>