<!-- volumes (media) endpoints-->
<url ServiceParameter="API.Volumes" pattern="api/volumes/" />
<url ServiceParameter="API.Volumes" pattern="api/volumes/limit/{limit}/" parameters.limit="\d+" />
- <url ServiceParameter="API.Volumes" pattern="api/volumes/withpools/" />
- <url ServiceParameter="API.Volumes" pattern="api/volumes/withpools/limit/{limit}/" parameters.limit="\d+" />
<url ServiceParameter="API.Volume" pattern="api/volumes/{id}/" parameters.id="\d+" />
<url ServiceParameter="API.VolumePrune" pattern="api/volumes/prune/{id}/" parameters.id="\d+" />
<url ServiceParameter="API.VolumePurge" pattern="api/volumes/purge/{id}/" parameters.id="\d+" />
if (actions_btn.length === 1) {
actions_btn[0].addEventListener('mouseup', function(e) {
var row = self.getGridRowUnderCursor(e);
- var el = $(row).find('input[type=hidden]');
+ var el = $(row).find('div[data-type="item_value"]');
if(el.length === 1) {
- self.actionsRequest.setCallbackParameter(el[0].value);
+ self.actionsRequest.setCallbackParameter(el[0].getAttribute('rel'));
self.actionsRequest.dispatch();
}
});
}
var set_callback_parameter = function(element) {
- var el = $(element).find('input[type=hidden]')
- if(el.length === 1) {
- var val = el[0].value;
+ var val;
+ if ($('#' + this.gridEl).length === 1) {
+ var el = $(element).find('div[data-type="item_value"]')
+ if (el.length === 1) {
+ val = el[0].getAttribute('rel');
+ }
+ } else if ($('#' + this.repeaterEl).length === 1) {
+ val = element.getAttribute('rel');
+ }
+ if (val) {
this.openConfigurationById(val);
}
}.bind(this);
});
}.bind(this));
Formatters.set_formatters();
- this.revertSortingFromCookie();
+ if (grid.length === 1) {
+ this.revertSortingFromCookie();
+ }
},
openConfigurationById: function(id) {
},
setActions: function() {
var checkboxes = this.getCheckboxes();
- checkboxes.each(function(index, el) {
+ $(checkboxes).each(function(index, el) {
$(el).on('change', function() {
var is_checked = this.isAnyChecked(checkboxes);
if(is_checked === true && !this.areActionsOpen()) {
<com:TActivePanel ID="RepeaterShow">
<com:TActiveRepeater ID="Repeater">
<prop:ItemTemplate>
- <com:TPanel ID="ClientElement" CssClass="slide-window-element" ToolTip="<%=@$this->DataItem->uname%>">
- <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/client-icon.png" alt="" /><%=@$this->DataItem->name%>
- <input type="hidden" name="<%=$this->ClientID%>" value="<%=isset($this->DataItem->clientid) ? $this->DataItem->clientid : ''%>" />
- </com:TPanel>
+ <div data-type="item_value" rel="<%#$this->DataItem->clientid%>" class="slide-window-element" title="<%=@$this->DataItem->uname%>">
+ <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/client-icon.png" alt="" /><%#$this->DataItem->name%>
+ </div>
</prop:ItemTemplate>
</com:TActiveRepeater>
</com:TActivePanel>
>
<com:TActiveTemplateColumn HeaderText="<%[ Client name ]%>" SortExpression="name">
<prop:ItemTemplate>
- <div><%=$this->getParent()->Data['name']%></div>
- <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->Data['clientid']%>" />
+ <div data-type="item_value" rel="<%=$this->getParent()->Data['clientid']%>"><%=$this->getParent()->Data['name']%></div>
</prop:ItemTemplate>
</com:TActiveTemplateColumn>
<com:TActiveTemplateColumn ItemStyle.HorizontalAlign="Center" HeaderText="AutoPrune" SortExpression="autoprune">
<com:TActivePanel ID="RepeaterShow" EnableViewState="false">
<com:TActiveRepeater ID="Repeater" EnableViewState="false">
<prop:ItemTemplate>
- <com:TPanel ID="JobElement" CssClass="slide-window-element">
- <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/job-icon.png" alt="" /> [<%=@$this->DataItem->jobid%>] <%=@$this->DataItem->name%>
- <input type="hidden" name="<%=$this->ClientID%>" value="<%=isset($this->DataItem->jobid) ? $this->DataItem->jobid : ''%>" />
- </com:TPanel>
+ <div data-type="item_value" rel="<%#$this->DataItem->jobid%>" class="slide-window-element">
+ <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/job-icon.png" alt="" /> [<%#$this->DataItem->jobid%>] <%#$this->DataItem->name%>
+ </div>
</prop:ItemTemplate>
</com:TActiveRepeater>
</com:TActivePanel>
/>
<com:TActiveTemplateColumn HeaderText="<%[ Job name ]%>" SortExpression="name">
<prop:ItemTemplate>
- <div title="<%=$this->getParent()->Data['name']%>"><%=$this->getPage()->JobWindow->formatJobName($this->getParent()->Data['name'])%></div>
- <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->Data['jobid']%>" />
+ <div data-type="item_value" rel="<%=$this->getParent()->Data['jobid']%>" title="<%=$this->getParent()->Data['name']%>"><%=$this->getPage()->JobWindow->formatJobName($this->getParent()->Data['name'])%></div>
</prop:ItemTemplate>
</com:TActiveTemplateColumn>
<com:TActiveTemplateColumn ItemTemplate="<%=isset($this->getPage()->JobWindow->jobTypes[$this->getParent()->Data['type']]) ? $this->getPage()->JobWindow->jobTypes[$this->getParent()->Data['type']] : ''%>" SortExpression="type">
<com:TActiveRepeater ID="Repeater">
<prop:ItemTemplate>
<%=($this->getPage()->JobRunWindow->oldDirector != $this->DataItem['director']) ? '<div class="window-section"><span>' . Prado::localize('Director:') . ' ' . $this->DataItem['director'] . '<span></div>': ''%>
- <com:TPanel ID="JobRunElement" CssClass="slide-window-element" >
- <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/job-icon.png" alt="" /> <%=@$this->DataItem['name']%>
- <input type="hidden" name="<%=$this->ClientID%>" value="<%=isset($this->DataItem['name']) ? $this->DataItem['name'] : ''%>" />
-
- </com:TPanel>
+ <div data-type="item_value" rel="<%#$this->DataItem['name']%>" class="slide-window-element">
+ <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/job-icon.png" alt="" /> <%#$this->DataItem['name']%>
+ </div>
<%=!($this->getPage()->JobRunWindow->oldDirector = $this->DataItem['director'])%>
</prop:ItemTemplate>
</com:TActiveRepeater>
>
<com:TActiveTemplateColumn HeaderText="<%[ Job name ]%>" SortExpression="name">
<prop:ItemTemplate>
- <div><%=$this->getParent()->DataItem['name']%></div>
- <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->DataItem['name']%>" />
+ <div data-type="item_value" rel="<%=$this->getParent()->DataItem['name']%>"><%=$this->getParent()->DataItem['name']%></div>
</prop:ItemTemplate>
</com:TActiveTemplateColumn>
<com:TActiveBoundColumn
<com:TActivePanel ID="RepeaterShow">
<com:TActiveRepeater ID="Repeater">
<prop:ItemTemplate>
- <com:TPanel ID="PoolElement" CssClass="slide-window-element">
- <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/pool.png" alt="" /><%=@$this->DataItem->name%>
- <input type="hidden" name="<%=$this->ClientID%>" value="<%=isset($this->DataItem->poolid) ? $this->DataItem->poolid : ''%>" />
- </com:TPanel>
+ <div data-type="item_value" rel="<%#$this->DataItem->poolid%>" class="slide-window-element">
+ <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/pool.png" alt="" /><%#$this->DataItem->name%>
+ </div>
</prop:ItemTemplate>
</com:TActiveRepeater>
</com:TActivePanel>
>
<com:TActiveTemplateColumn HeaderText="Pool name" SortExpression="name">
<prop:ItemTemplate>
- <div><%=$this->getParent()->Data['name']%></div>
- <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->Data['poolid']%>" />
+ <div data-type="item_value" rel="<%=$this->getParent()->Data['poolid']%>"><%=$this->getParent()->Data['name']%></div>
</prop:ItemTemplate>
</com:TActiveTemplateColumn>
<com:TActiveBoundColumn
<com:TActivePanel ID="RepeaterShow">
<com:TActiveRepeater ID="Repeater">
<prop:ItemTemplate>
- <com:TPanel ID="StorageElement" CssClass="slide-window-element">
- <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/server-storage-icon.png" alt="" /><%=@$this->DataItem->name%>
- <input type="hidden" name="<%=$this->ClientID%>" value="<%=isset($this->DataItem->storageid) ? $this->DataItem->storageid : ''%>" />
- </com:TPanel>
+ <div data-type="item_value" rel="<%#$this->DataItem->storageid%>" class="slide-window-element">
+ <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/server-storage-icon.png" alt="" /><%#$this->DataItem->name%>
+ </div>
</prop:ItemTemplate>
</com:TActiveRepeater>
</com:TActivePanel>
>
<com:TActiveTemplateColumn HeaderText="<%[ Storage name ]%>" SortExpression="name">
<prop:ItemTemplate>
- <div><%=$this->getParent()->Data['name']%></div>
- <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->Data['storageid']%>" />
+ <div data-type="item_value" rel="<%=$this->getParent()->Data['storageid']%>"><%=$this->getParent()->Data['name']%></div>
</prop:ItemTemplate>
</com:TActiveTemplateColumn>
<com:TActiveTemplateColumn HeaderText="<%[ Autochanger ]%>" SortExpression="autochanger" ItemStyle.HorizontalAlign="Center">
public $ID;
public $buttonID;
public $windowTitle;
- public $pools;
- public $oldPool;
public $view;
public function setID($id) {
}
public function prepareData($sender, $param) {
- $params = $this->getUrlParams(array('volumes', 'withpools'), $this->getPage()->VolumeWindow->ID);
+ $params = $this->getUrlParams(array('volumes'), $this->getPage()->VolumeWindow->ID);
$volumes = $this->Application->getModule('api')->get($params);
$isDetailView = $_SESSION['view' . $this->getPage()->VolumeWindow->ID] == 'details';
if($isDetailView === true) {
}
public function sortDataGrid($sender, $param) {
- $params = $this->getUrlParams(array('volumes', 'withpools'), $this->getPage()->VolumeWindow->ID);
+ $params = $this->getUrlParams(array('volumes'), $this->getPage()->VolumeWindow->ID);
$data = $this->Application->getModule('api')->get($params)->output;
$data = $this->Application->getModule('misc')->objectToArray($data);
$this->DataGrid->DataSource = $this->sortData($data, $param->SortExpression, $sender->UniqueID);
<com:TActivePanel ID="RepeaterShow">
<com:TActiveRepeater ID="Repeater">
<prop:ItemTemplate>
- <%=(isset($this->DataItem->pool->name) && $this->getPage()->VolumeWindow->oldPool != $this->DataItem->pool->name) ? '<div class="window-section"><span>' . Prado::localize('Pool:') . ' ' . $this->DataItem->pool->name . '<span></div>': ''%>
- <com:TPanel ID="VolumeElement" CssClass="slide-window-element" ToolTip="<%=(isset($this->DataItem->recycle) && $this->DataItem->recycle == 1 && !empty($this->DataItem->lastwritten) && in_array($this->DataItem->volstatus, array('Full', 'Used'))) ? Prado::localize('When expire:') . date( 'Y-m-d H:i:s', (strtotime($this->DataItem->lastwritten) + $this->DataItem->volretention)) : ''%> <%=Prado::localize('Last written:')%> <%=!empty($this->DataItem->lastwritten) ? $this->DataItem->lastwritten : Prado::localize('never written')%>">
- <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/media-icon.png" alt="" /><%=@$this->DataItem->volumename%>
- <div id="<%=isset($this->DataItem->volumename) ? $this->DataItem->volumename : ''%>_sizebar" class="status-bar-<%=isset($this->DataItem->volstatus) ? strtolower($this->DataItem->volstatus) : ''%>"><%=isset($this->DataItem->volstatus) ? $this->DataItem->volstatus : ''%></div>
- <input type="hidden" name="<%=$this->ClientID%>" value="<%=isset($this->DataItem->mediaid) ? $this->DataItem->mediaid : ''%>" />
- </com:TPanel>
- <%=!(isset($this->DataItem->pool->name) ? ($this->getPage()->VolumeWindow->oldPool = $this->DataItem->pool->name) : false)%>
+ <div data-type="item_value" rel="<%#$this->DataItem->mediaid%>" class="slide-window-element" title="<%#($this->DataItem->recycle == 1 && !empty($this->DataItem->lastwritten) && in_array($this->DataItem->volstatus, array('Full', 'Used'))) ? Prado::localize('When expire:') . date( ' Y-m-d H:i:s', (strtotime($this->DataItem->lastwritten) + $this->DataItem->volretention)) : ''%> <%=Prado::localize('Last written:')%> <%=!empty($this->DataItem->lastwritten) ? $this->DataItem->lastwritten : Prado::localize('never written')%>">
+ <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/media-icon.png" alt="" /><%#$this->DataItem->volumename%>
+ <div id="<%#$this->DataItem->volumename%>_sizebar" class="status-bar-<%#strtolower($this->DataItem->volstatus)%>"><%#$this->DataItem->volstatus%></div>
+ </div>
</prop:ItemTemplate>
</com:TActiveRepeater>
</com:TActivePanel>
</com:TTemplateColumn>
<com:TActiveTemplateColumn HeaderText="<%[ Volume name ]%>" SortExpression="volumename">
<prop:ItemTemplate>
- <div title="<%=$this->getParent()->Data['volumename']%>"><%=$this->getPage()->VolumeWindow->formatVolumeField($this->getParent()->Data['volumename'])%></div>
- <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->Data['mediaid']%>" />
+ <div data-type="item_value" rel="<%=$this->getParent()->Data['mediaid']%>" title="<%=$this->getParent()->Data['volumename']%>"><%=$this->getPage()->VolumeWindow->formatVolumeField($this->getParent()->Data['volumename'])%></div>
</prop:ItemTemplate>
</com:TActiveTemplateColumn>
<com:TActiveBoundColumn