]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Lists loading optiomalization and replace server side sorting to client...
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 9 Nov 2014 16:31:45 +0000 (17:31 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 9 Nov 2014 16:36:48 +0000 (17:36 +0100)
22 files changed:
gui/baculum/protected/JavaScript/configuration-window.js
gui/baculum/protected/JavaScript/slide-window.js
gui/baculum/protected/Pages/Home.page
gui/baculum/protected/Portlets/BButton.php
gui/baculum/protected/Portlets/ClientConfiguration.tpl
gui/baculum/protected/Portlets/ClientList.php
gui/baculum/protected/Portlets/ClientList.tpl
gui/baculum/protected/Portlets/JobConfiguration.tpl
gui/baculum/protected/Portlets/JobList.php
gui/baculum/protected/Portlets/JobList.tpl
gui/baculum/protected/Portlets/JobRunConfiguration.tpl
gui/baculum/protected/Portlets/JobRunList.php
gui/baculum/protected/Portlets/JobRunList.tpl
gui/baculum/protected/Portlets/PoolConfiguration.tpl
gui/baculum/protected/Portlets/PoolList.php
gui/baculum/protected/Portlets/PoolList.tpl
gui/baculum/protected/Portlets/SlideWindow.tpl
gui/baculum/protected/Portlets/StorageList.php
gui/baculum/protected/Portlets/StorageList.tpl
gui/baculum/protected/Portlets/VolumeConfiguration.tpl
gui/baculum/protected/Portlets/VolumeList.php
gui/baculum/protected/Portlets/VolumeList.tpl

index d6cd0847f6be925dbb5303b66538c4ecee735813..6bd47ae08260733481c477613dc837cf3493e6fa 100644 (file)
@@ -36,13 +36,12 @@ var ConfigurationWindowClass = new Class.create({
        is_progress: function() {
                return $(this.progress_id).getStyle('display') == 'block';
        },
-       openConfigurationWindow: function(request, slideWindowObj) {
+       openConfigurationWindow: function(slideWindowObj) {
                if(this.is_progress() === false) {
                        this.progress(true);
                        if(slideWindowObj.isFullSize() === true) {
                                slideWindowObj.resetSize();
                        }
-                       request.dispatch();
                }
        }
 });
index 869d7c5234ec96f8bab66f75eb6a428a97d48b3e..9a485546d90a7410249fc53cc16dedeaade9b592 100644 (file)
@@ -7,6 +7,10 @@ var SlideWindowClass = Class.create({
        fullSizeEl : null,
        search: null,
        toolbar: null,
+       configurationObj: null,
+       loadRequest : null,
+       repeaterEl: null,
+       gridEl: null,
 
        size: {
                widthNormal : '437px',
@@ -154,6 +158,39 @@ var SlideWindowClass = Class.create({
                }.bind(this));
        },
 
+       setConfigurationObj: function(obj) {
+               this.configurationObj = obj;
+       },
+
+       setWindowElementsEvent: function(repeaterEl, gridEl, requestObj) {
+               this.repeaterEl = repeaterEl;
+               this.gridEl = gridEl;
+               this.loadRequest = requestObj;
+               this.setLoadRequest();
+       },
+
+       setLoadRequest: function() {
+               var dataList = [];
+               if($(this.gridEl)) {
+                       dataList = $(this.gridEl).select('tr');
+                       this.makeSortable();
+               } else if ($(this.repeaterEl + '_Container')) {
+                       dataList = $(this.repeaterEl + '_Container').select('div.slide-window-element');
+               }
+
+               dataList.each(function(tr) {
+                       $(tr).observe('click', function() {
+                               var el = $(tr).down('input')
+                               if(el) {
+                                       var val = el.getValue();
+                                       this.loadRequest.ActiveControl.CallbackParameter = val;
+                                       this.loadRequest.dispatch();
+                                       this.configurationObj.openConfigurationWindow(this);
+                               }
+                       }.bind(this, tr));
+               }.bind(this));
+       },
+
        isConfigurationOpen: function() {
                var is_open = false;
                $$(this.elements.configurationWindows, this.elements.configurationProgress).each(function(el) {
@@ -165,6 +202,43 @@ var SlideWindowClass = Class.create({
                return is_open;
        },
 
+       sortTable: function (col, reverse) {
+               var table = document.getElementById(this.gridEl);
+               var tb = table.tBodies[0], tr = Array.prototype.slice.call(tb.rows, 0), i;
+               reverse = -((+reverse) || -1);
+               tr = tr.sort(function (a, b) {
+                       var val;
+                       var val_a = a.cells[col].textContent.trim();
+                       var val_b = b.cells[col].textContent.trim();
+                       if (!isNaN(parseFloat(val_a)) && isFinite(val_a) && !isNaN(parseFloat(val_b)) && isFinite(val_b)) {
+                               val = val_a - val_b
+                       } else {
+                               val = val_a.localeCompare(val_b);
+                       }
+                       return reverse * (val);
+               });
+               for(i = 0; i < tr.length; ++i) tb.appendChild(tr[i]);
+       },
+
+       makeSortable: function () {
+               var self = this;
+               var table = document.getElementById(this.gridEl);
+               table.tHead.style.cursor = 'pointer';
+               var th = table.tHead, i;
+               th && (th = th.rows[0]) && (th = th.cells);
+               if (th) {
+                       i = th.length;
+               } else {
+                       return;
+               }
+               while (--i >= 0) (function (i) {
+                       var dir = 1;
+                       th[i].addEventListener('click', function () {
+                               self.sortTable(i, (dir = 1 - dir));
+                       });
+               }(i));
+       },
+
        setSearch: function() {
                var search_pattern = new RegExp(this.search.value)
                $$('div[id="' + this.windowId + this.elements.containerSuffix + '"] div.' + this.elements.contentItems).each(function(value){
index 8e7ca3221b7d81c02e1e264c43fc76f875b95683..ea96fb0a443f2a8bb0050ba349cd284c85f5bd32 100644 (file)
@@ -6,12 +6,13 @@
                <div id="directors"><com:TLabel ForControl="Director" Text="<%[ Director: ]%>" /> <com:TActiveDropDownList ID="Director" OnTextChanged="director" /></div>
                </div>
                <div id="menu-left">
-                       <com:TActiveButton ID="StorageBtn" CssClass="storage-btn" Attributes.onmouseover="javascript:showTip(this, 'Storage Daemons', 'Configuration of storage daemons.');" ClientSide.OnLoading="$('<%=$this->StorageWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'block'});" ClientSide.OnComplete="$('<%=$this->StorageWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});<%=$this->StorageBtn->ClientID%>SlideWindow.setElementsCount();" />
-                       <com:TActiveButton ID="ClientBtn" CssClass="client-btn" Attributes.onmouseover="javascript:showTip(this, 'Clients', 'Configuration of clients daemons.');" ClientSide.OnLoading="$('<%=$this->ClientWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'block'});" ClientSide.OnComplete="$('<%=$this->ClientWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});<%=$this->ClientBtn->ClientID%>SlideWindow.setElementsCount();" />
-                       <com:TActiveButton ID="MediaBtn" CssClass="media-btn" Attributes.onmouseover="javascript:showTip(this, 'Volumes', 'Management of volumes.');" ClientSide.OnLoading="$('<%=$this->VolumeWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'block'});" ClientSide.OnComplete="$('<%=$this->VolumeWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});<%=$this->MediaBtn->ClientID%>SlideWindow.setElementsCount();" />
-                       <com:TActiveButton ID="PoolBtn" CssClass="pool-btn" Attributes.onmouseover="javascript:showTip(this, 'Pools', 'Management of volumes pools.');" ClientSide.OnLoading="$('<%=$this->PoolWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'block'});" ClientSide.OnComplete="$('<%=$this->PoolWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});<%=$this->PoolBtn->ClientID%>SlideWindow.setElementsCount();" />
-                       <com:TActiveButton ID="JobBtn" CssClass="job-btn" Attributes.onmouseover="javascript:showTip(this, 'Jobs', 'Jobs settings.');" ClientSide.OnLoading="$('<%=$this->JobWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'block'});" ClientSide.OnComplete="$('<%=$this->JobWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});<%=$this->JobBtn->ClientID%>SlideWindow.setElementsCount();" />
-                       <com:TActiveButton ID="JobRunBtn" CssClass="jobrun-btn" Attributes.onmouseover="javascript:showTip(this, 'Run job', 'Starting jobs.');" ClientSide.OnLoading="$('<%=$this->JobRunWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'block'});" ClientSide.OnComplete="$('<%=$this->JobRunWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});<%=$this->JobRunBtn->ClientID%>SlideWindow.setElementsCount();" />
+                       <com:TActiveButton ID="StorageBtn" CssClass="storage-btn" Attributes.onmouseover="javascript:showTip(this, 'Storage Daemons', 'Configuration of storage daemons.');" ClientSide.OnLoading="$('<%=$this->StorageWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'block'});" ClientSide.OnComplete="$('<%=$this->StorageWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});<%=$this->StorageBtn->ClientID%>SlideWindow.setElementsCount();storageSlideWindowObj.setWindowElementsEvent('<%=$this->StorageWindow->Repeater->ClientID%>', '<%=$this->StorageWindow->DataGrid->ClientID%>', <%=$this->StorageWindow->DataElementCall->ActiveControl->Javascript%>);" />
+                       <com:TActiveButton ID="ClientBtn" CssClass="client-btn" Attributes.onmouseover="javascript:showTip(this, 'Clients', 'Configuration of clients daemons.');" ClientSide.OnLoading="$('<%=$this->ClientWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'block'});" ClientSide.OnComplete="$('<%=$this->ClientWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});<%=$this->ClientBtn->ClientID%>SlideWindow.setElementsCount();clientSlideWindowObj.setWindowElementsEvent('<%=$this->ClientWindow->Repeater->ClientID%>', '<%=$this->ClientWindow->DataGrid->ClientID%>', <%=$this->ClientWindow->DataElementCall->ActiveControl->Javascript%>);" />
+                       <com:TActiveButton ID="MediaBtn" CssClass="media-btn" Attributes.onmouseover="javascript:showTip(this, 'Volumes', 'Management of volumes.');" ClientSide.OnLoading="$('<%=$this->VolumeWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'block'});" ClientSide.OnComplete="$('<%=$this->VolumeWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});<%=$this->MediaBtn->ClientID%>SlideWindow.setElementsCount();volumeSlideWindowObj.setWindowElementsEvent('<%=$this->VolumeWindow->Repeater->ClientID%>', '<%=$this->VolumeWindow->DataGrid->ClientID%>', <%=$this->VolumeWindow->DataElementCall->ActiveControl->Javascript%>);" />
+
+                       <com:TActiveButton ID="PoolBtn" CssClass="pool-btn" Attributes.onmouseover="javascript:showTip(this, 'Pools', 'Management of volumes pools.');" ClientSide.OnLoading="$('<%=$this->PoolWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'block'});" ClientSide.OnComplete="$('<%=$this->PoolWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});<%=$this->PoolBtn->ClientID%>SlideWindow.setElementsCount();poolSlideWindowObj.setWindowElementsEvent('<%=$this->PoolWindow->Repeater->ClientID%>', '<%=$this->PoolWindow->DataGrid->ClientID%>', <%=$this->PoolWindow->DataElementCall->ActiveControl->Javascript%>);" />
+                       <com:TActiveButton ID="JobBtn" CssClass="job-btn" Attributes.onmouseover="javascript:showTip(this, 'Jobs', 'Jobs settings.');" ClientSide.OnLoading="$('<%=$this->JobWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'block'});" ClientSide.OnComplete="$('<%=$this->JobWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});<%=$this->JobBtn->ClientID%>SlideWindow.setElementsCount();jobSlideWindowObj.setWindowElementsEvent('<%=$this->JobWindow->Repeater->ClientID%>', '<%=$this->JobWindow->DataGrid->ClientID%>', <%=$this->JobWindow->DataElementCall->ActiveControl->Javascript%>);" />
+                       <com:TActiveButton ID="JobRunBtn" CssClass="jobrun-btn" Attributes.onmouseover="javascript:showTip(this, 'Run job', 'Starting jobs.');" ClientSide.OnLoading="$('<%=$this->JobRunWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'block'});" ClientSide.OnComplete="$('<%=$this->JobRunWindow->Controls[0]->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});<%=$this->JobRunBtn->ClientID%>SlideWindow.setElementsCount();jobRunSlideWindowObj.setWindowElementsEvent('<%=$this->JobRunWindow->Repeater->ClientID%>', '<%=$this->JobRunWindow->DataGrid->ClientID%>', <%=$this->JobRunWindow->DataElementCall->ActiveControl->Javascript%>);" />
                        <com:TActiveButton CssClass="restore-btn" OnClick="restore" Attributes.onmouseover="javascript:showTip(this, 'Restore', 'Restore wizard.');" />
                        <com:TActiveButton ID="SettingsWizardBtn" CssClass="setting-btn" OnClick="configuration" Attributes.onmouseover="javascript:showTip(this, 'Settings', 'Management settings wizard.');" />
                </div>
index 7631a99579c7aea9561342bdac818624307ac5d7..4f5e8ef66462fa166a9eac798736a2350df27581 100644 (file)
@@ -45,9 +45,9 @@ class BButton extends Portlets{
                $this->Visible = $param;
        }
 
-       public function getVisible() {
+       public function getVisible($checkParents = true) {
                return $this->Visible;
        }
 }
 
-?>
\ No newline at end of file
+?>
index f0aed64fa24a1d44e47f3dce97b0a64e4c4921f7..f98b8bf45bc4f0b93d99aa185b07649772d2701f 100644 (file)
@@ -36,7 +36,7 @@
                        <div class="text"><com:TLabel ForControl="AutoPrune" Text="<%[ AutoPrune: ]%>" /></div>
                        <div class="field"><com:TActiveCheckBox ID="AutoPrune" AutoPostBack="false" /></div>
                </div>
-               <com:TCallback ID="ReloadClients" OnCallback="Page.ClientWindow.prepareData" />
+               <com:TCallback ID="ReloadClients" OnCallback="Page.ClientWindow.prepareData" ClientSide.OnComplete="clientSlideWindowObj.setLoadRequest();" />
                <script type="text/javascript">
                                function <%=$this->getPage()->ClientConfiguration->getMaster()->ClientID%>reloadWindow() {
                                        var callback = <%= $this->ReloadClients->ActiveControl->Javascript %>;
index 01c152b05388a133c8d723153e2a7e058f7a2db0..1ea74be41c8c3c521920daa7be6d01d491241f4f 100644 (file)
@@ -41,13 +41,17 @@ class ClientList extends Portlets {
                                $params = $this->getUrlParams('clients', $this->getPage()->ClientWindow->ID);
                                $clients = $this->Application->getModule('api')->get($params);
                                $isDetailView = $_SESSION['view' . $this->getPage()->ClientWindow->ID] == 'details';
-                               $clientsList = $this->Application->getModule('misc')->objectToArray($clients->output);
-                               $this->RepeaterShow->Visible = !$isDetailView;
-                               $this->Repeater->DataSource = $isDetailView === false ? $clientsList : array();
-                               $this->Repeater->dataBind();
-                               $this->DataGridShow->Visible = $isDetailView;
-                               $this->DataGrid->DataSource = $isDetailView === true ?  $clientsList : array();
-                               $this->DataGrid->dataBind();
+                               if($isDetailView === true) {
+                                       $this->RepeaterShow->Visible = false;
+                                       $this->DataGridShow->Visible = true;
+                                       $this->DataGrid->DataSource = $this->Application->getModule('misc')->objectToArray($clients->output);
+                                       $this->DataGrid->dataBind();
+                               } else {
+                                       $this->RepeaterShow->Visible = true;
+                                       $this->DataGridShow->Visible = false;
+                                       $this->Repeater->DataSource = $clients->output;
+                                       $this->Repeater->dataBind();
+                               }
                        }
                }
        }
@@ -75,4 +79,4 @@ class ClientList extends Portlets {
                }
        }
 }
-?>
\ No newline at end of file
+?>
index 8142c24c1b3731ae39e7a6c10ffa26f989194761..0c2341ebfd0c7142fef798b676212fb481d9a238 100644 (file)
@@ -1,29 +1,19 @@
 <%@ MasterClass="Application.Portlets.SlideWindow"%>
 <com:TContent ID="SlideWindowContent">
+       <script type="text/javascript">
+               document.observe("dom:loaded", function() {
+                       clientConfigurationWindow = ConfigurationWindow<%=$this->getPage()->ClientConfiguration->getMaster()->ClientID%>;
+                       clientSlideWindowObj = <%=$this->getPage()->ClientWindow->ShowID%>SlideWindow;
+                       clientSlideWindowObj.setConfigurationObj(clientConfigurationWindow);
+               });
+       </script>
        <com:TActivePanel ID="RepeaterShow">
-               <script type="text/javascript">
-                       document.observe("dom:loaded", function() {
-                               clientConfigurationWindow = ConfigurationWindow<%=$this->getPage()->ClientConfiguration->getMaster()->ClientID%>;
-                               clientSlideWindowObj = <%=$this->getPage()->ClientWindow->ShowID%>SlideWindow;
-                       });
-               </script>
                <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']%>
+                               <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>
-                               <com:TCallback ID="ClientElementCall" OnCallback="Page.ClientWindow.configure" ActiveControl.CallbackParameter="<%=@$this->DataItem['clientid']%>">
-                                       <prop:ClientSide.OnComplete>
-                                               clientConfigurationWindow.show();
-                                               clientConfigurationWindow.progress(false);
-                                       </prop:ClientSide.OnComplete>
-                               </com:TCallback>
-                               <script type="text/javascript">
-                                       $('<%=$this->ClientElement->ClientID%>').observe('click', function() {
-                                               var request = <%= $this->ClientElementCall->ActiveControl->Javascript %>;
-                                               clientConfigurationWindow.openConfigurationWindow(request, clientSlideWindowObj);
-                                       });
-                               </script>
                        </prop:ItemTemplate>
                </com:TActiveRepeater>
        </com:TActivePanel>
@@ -31,7 +21,7 @@
                <com:TActiveDataGrid
                        ID="DataGrid"
                        AutoGenerateColumns="false"
-                       AllowSorting="true"
+                       AllowSorting="false"
                        OnSortCommand="sortDataGrid"
                        CellPadding="5px"
                        CssClass="window-section-detail"
                >
                        <com:TActiveTemplateColumn HeaderText="Client name" SortExpression="name">
                                <prop:ItemTemplate>
-                                       <com:TPanel ID="ClientTableElement"><%=$this->getParent()->Data['name']%></com:TPanel>
-                                       <com:TCallback ID="ClientTableElementCall" OnCallback="Page.ClientWindow.configure" ActiveControl.CallbackParameter="<%=$this->getParent()->Data['clientid']%>">
-                                               <prop:ClientSide.OnComplete>
-                                                       clientConfigurationWindow.show();
-                                                       clientConfigurationWindow.progress(false);
-                                               </prop:ClientSide.OnComplete>
-                                       </com:TCallback>
-                                       <script type="text/javascript">
-                                               $('<%=$this->ClientTableElement->ClientID%>').up('tr').observe('click', function() {
-                                                       var request = <%= $this->ClientTableElementCall->ActiveControl->Javascript %>;
-                                                       clientConfigurationWindow.openConfigurationWindow(request, clientSlideWindowObj);
-                                               });
-                                       </script>
+                                       <div><%=$this->getParent()->Data['name']%></div>
+                                       <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->Data['clientid']%>" />
                                </prop:ItemTemplate>
                        </com:TActiveTemplateColumn>
                        <com:TActiveTemplateColumn ItemStyle.HorizontalAlign="Center" HeaderText="AutoPrune" SortExpression="autoprune">
@@ -72,4 +51,7 @@
                        </com:TActiveTemplateColumn>
                </com:TActiveDataGrid>
        </com:TActivePanel>
+       <com:TCallback ID="DataElementCall" OnCallback="Page.ClientWindow.configure">
+               <prop:ClientSide OnComplete="clientConfigurationWindow.show();clientConfigurationWindow.progress(false);" />
+       </com:TCallback>
 </com:TContent>
index cd8fd6e5dd3074b52c326434838436791b5b4e1a..f1bd05b433ba35f64bcfc12fb3378165db35d280 100644 (file)
@@ -47,7 +47,7 @@
                                <com:TActiveCustomValidator ID="PriorityValidator" ValidationGroup="JobGroup" ControlToValidate="Priority" ErrorMessage="<%[ Priority value must be integer greather than 0. ]%>" ControlCssClass="validation-error" Display="None" OnServerValidate="priorityValidator" ClientSide.OnValidationError="IsInvalid<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%> = true" />
                        </div>
                </div>
-               <com:TCallback ID="ReloadJobs" OnCallback="Page.JobWindow.prepareData" />
+               <com:TCallback ID="ReloadJobs" OnCallback="Page.JobWindow.prepareData" ClientSide.OnComplete="jobSlideWindowObj.setLoadRequest();" />
                <script type="text/javascript">
                                function <%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>reloadWindow() {
                                        var callback = <%= $this->ReloadJobs->ActiveControl->Javascript %>;
index 484e92152cc8caa8faa555580fe46aa421ac078a..37b8777c27ccd3d19353c1cc13e4df94fdac5975 100644 (file)
@@ -86,17 +86,22 @@ class JobList extends Portlets {
                                $params = $this->getUrlParams('jobs', $this->getPage()->JobWindow->ID);
                                $jobs = $this->Application->getModule('api')->get($params);
                                $isDetailView = $_SESSION['view' . $this->getPage()->JobWindow->ID] == 'details';
-                               $this->RepeaterShow->Visible = !$isDetailView;
-                               $this->Repeater->DataSource = $isDetailView == false ? $jobs->output : array();
-                               $this->Repeater->dataBind();
-                               $this->DataGridShow->Visible = $isDetailView;
-                               $this->DataGrid->DataSource = $isDetailView === true ? $this->Application->getModule('misc')->objectToArray($jobs->output) : array();
-                               $this->DataGrid->dataBind();
+                               if($isDetailView === true) {
+                                       $this->RepeaterShow->Visible = false;
+                                       $this->DataGridShow->Visible = true;
+                                       $this->DataGrid->DataSource = $this->Application->getModule('misc')->objectToArray($jobs->output);
+                                       $this->DataGrid->dataBind();
+                               } else {
+                                       $this->RepeaterShow->Visible = true;
+                                       $this->DataGridShow->Visible = false;
+                                       $this->Repeater->DataSource = $jobs->output;
+                                       $this->Repeater->dataBind();
+                               }
                        }
                }
        }
 
-    public function sortDataGrid($sender, $param) {
+       public function sortDataGrid($sender, $param) {
                $params = $this->getUrlParams('jobs', $this->getPage()->JobWindow->ID);
                $data = $this->Application->getModule('api')->get($params)->output;
                $data = $this->Application->getModule('misc')->objectToArray($data);
index d20d0ddc41c63f09a5cb395c4a4fc56762da2bef..bd4bf6cf34282076dcd3532d5f60ef61caba1114 100644 (file)
@@ -1,29 +1,19 @@
 <%@ MasterClass="Application.Portlets.SlideWindow" %>
 <com:TContent ID="SlideWindowContent">
+       <script type="text/javascript">
+               document.observe("dom:loaded", function() {
+                       jobConfigurationWindow = ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>;
+                       jobSlideWindowObj = <%=$this->getPage()->JobWindow->ShowID%>SlideWindow;
+                       jobSlideWindowObj.setConfigurationObj(jobConfigurationWindow);
+               });
+       </script>
        <com:TActivePanel ID="RepeaterShow">
-               <script type="text/javascript">
-                       document.observe("dom:loaded", function() {
-                               jobConfigurationWindow = ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>;
-                               jobSlideWindowObj = <%=$this->getPage()->JobWindow->ShowID%>SlideWindow;
-                       });
-               </script>
        <com:TActiveRepeater ID="Repeater">
                <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>
-                       <com:TCallback ID="JobElementCall" OnCallback="Page.JobWindow.configure" ActiveControl.CallbackParameter="<%=@$this->DataItem->jobid%>">
-                               <prop:ClientSide.OnComplete>
-                                       jobConfigurationWindow.show();
-                                       jobConfigurationWindow.progress(false);
-                               </prop:ClientSide.OnComplete>
-                       </com:TCallback>
-                       <script type="text/javascript">
-                               $('<%=$this->JobElement->ClientID%>').observe('click', function() {
-                                       var request = <%= $this->JobElementCall->ActiveControl->Javascript %>;
-                                       jobConfigurationWindow.openConfigurationWindow(request, jobSlideWindowObj);
-                               });
-                       </script>
                </prop:ItemTemplate>
        </com:TActiveRepeater>
        </com:TActivePanel>
@@ -31,7 +21,7 @@
        <com:TActiveDataGrid
                ID="DataGrid"
                AutoGenerateColumns="false"
-               AllowSorting="true"
+               AllowSorting="false"
                OnSortCommand="sortDataGrid"
                CellPadding="5px"
                CssClass="window-section-detail"
                />
                <com:TActiveTemplateColumn HeaderText="Job name" SortExpression="name">
                        <prop:ItemTemplate>
-                               <com:TPanel ID="JobTableElement"><%=$this->getParent()->Data['name']%></com:TPanel>
-                               <com:TCallback ID="JobTableElementCall" OnCallback="Page.JobWindow.configure" ActiveControl.CallbackParameter="<%=$this->getParent()->Data['jobid']%>">
-                                       <prop:ClientSide.OnComplete>
-                                               jobConfigurationWindow.show();
-                                               jobConfigurationWindow.progress(false);
-                                       </prop:ClientSide.OnComplete>
-                               </com:TCallback>
-                               <script type="text/javascript">
-                                       $('<%=$this->JobTableElement->ClientID%>').up('tr').observe('click', function() {
-                                               var request = <%= $this->JobTableElementCall->ActiveControl->Javascript %>;
-                                               jobConfigurationWindow.openConfigurationWindow(request, jobSlideWindowObj);
-                                       });
-                               </script>
+                               <div><%=$this->getParent()->Data['name']%></div>
+                                <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->Data['jobid']%>" />
                        </prop:ItemTemplate>
                </com:TActiveTemplateColumn>
                <com:TActiveTemplateColumn ItemTemplate="<%=$this->getPage()->JobWindow->getJobType($this->getParent()->Data['type'])%>" SortExpression="type">
@@ -83,4 +62,7 @@
                />
        </com:TActiveDataGrid>
        </com:TActivePanel>
+       <com:TCallback ID="DataElementCall" OnCallback="Page.JobWindow.configure">
+               <prop:ClientSide OnComplete="jobConfigurationWindow.show();jobConfigurationWindow.progress(false);" />
+       </com:TCallback>
 </com:TContent>
index f58cb06db6bc05fd87b800d9821507db7ac9fb9c..76c1bc902c233e61834e63210ca770eb0a2bec24 100644 (file)
@@ -47,7 +47,7 @@
                                <com:TActiveCustomValidator ID="PriorityValidator" ValidationGroup="JobRunGroup" ControlToValidate="Priority" ErrorMessage="<%[ Priority value must be integer greather than 0. ]%>" ControlCssClass="validation-error" Display="None" OnServerValidate="priorityValidator" ClientSide.OnValidationError="IsInvalid<%=$this->getPage()->JobRunConfiguration->ClientID%> = true" />
                        </div>
                </div>
-               <com:TCallback ID="ReloadJobs" OnCallback="Page.JobRunWindow.prepareData" />
+               <com:TCallback ID="ReloadJobs" OnCallback="Page.JobRunWindow.prepareData" ClientSide.OnComplete="jobRunSlideWindowObj.setLoadRequest();" />
                <script type="text/javascript">
                                function <%=$this->getPage()->JobRunConfiguration->ClientID%>reloadWindow() {
                                        var callback = <%= $this->ReloadJobs->ActiveControl->Javascript %>;
index 307c4e9297aa9956d1e3e2438b4387590f285d98..fba2ef7f7886370e8e1f062e57ed20666070eaaf 100644 (file)
@@ -49,12 +49,18 @@ class JobRunList extends Portlets {
                                $jobTasks = $this->Application->getModule('api')->get($params)->output;
                                $jobs = $this->prepareJobs($jobTasks);
                                $isDetailView = $_SESSION['view' . $this->getPage()->JobRunWindow->ID] == 'details';
-                               $this->RepeaterShow->Visible = !$isDetailView;
-                               $this->Repeater->DataSource = $isDetailView === false ? $jobs : array();
-                               $this->Repeater->dataBind();
-                               $this->DataGridShow->Visible = $isDetailView;
-                               $this->DataGrid->DataSource = $isDetailView === true ? $jobs : array();
-                               $this->DataGrid->dataBind();
+
+                               if($isDetailView === true) {
+                                       $this->RepeaterShow->Visible = false;
+                                       $this->DataGridShow->Visible = true;
+                                       $this->DataGrid->DataSource = $jobs;
+                                       $this->DataGrid->dataBind();
+                               } else {
+                                       $this->RepeaterShow->Visible = true;
+                                       $this->DataGridShow->Visible = false;
+                                       $this->Repeater->DataSource = $jobs;
+                                       $this->Repeater->dataBind();
+                               }
                        }
                }
        }
index e7b8066c9376225dfacb9fda35f1bb03f5d9587c..82fa83838d519cfaffeabf11f2c4ced29894d625 100644 (file)
@@ -1,30 +1,21 @@
 <%@ MasterClass="Application.Portlets.SlideWindow" %>
 <com:TContent ID="SlideWindowContent">
+       <script type="text/javascript">
+               document.observe("dom:loaded", function() {
+                       jobRunConfigurationWindow = ConfigurationWindow<%=$this->getPage()->JobRunConfiguration->getMaster()->ClientID%>;
+                       jobRunSlideWindowObj = <%=$this->getPage()->JobRunWindow->ShowID%>SlideWindow;
+                       jobRunSlideWindowObj.setConfigurationObj(jobRunConfigurationWindow);
+               });
+       </script>
        <com:TActivePanel ID="RepeaterShow">
-               <script type="text/javascript">
-                       document.observe("dom:loaded", function() {
-                               jobRunConfigurationWindow = ConfigurationWindow<%=$this->getPage()->JobRunConfiguration->getMaster()->ClientID%>;
-                               jobRunSlideWindowObj = <%=$this->getPage()->JobRunWindow->ShowID%>SlideWindow;
-                       });
-               </script>
        <com:TActiveRepeater ID="Repeater">
                <prop:ItemTemplate>
                        <%=($this->getPage()->JobRunWindow->oldDirector != $this->DataItem['director']) ? '<div class="window-section"><span>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>
-                       <com:TCallback ID="JobRunElementCall" OnCallback="Page.JobRunWindow.configure" ActiveControl.CallbackParameter="<%=@$this->DataItem['name']%>">
-                               <prop:ClientSide.OnComplete>
-                                       jobRunConfigurationWindow.show();
-                                       jobRunConfigurationWindow.progress(false);
-                               </prop:ClientSide.OnComplete>
-                       </com:TCallback>
-                       <script type="text/javascript">
-                               $('<%=$this->JobRunElement->ClientID%>').observe('click', function() {
-                                       var request = <%= $this->JobRunElementCall->ActiveControl->Javascript %>;
-                                       jobRunConfigurationWindow.openConfigurationWindow(request, jobRunSlideWindowObj);
-                               });
-                       </script>
                        <%=!($this->getPage()->JobRunWindow->oldDirector = $this->DataItem['director'])%>
                </prop:ItemTemplate>
        </com:TActiveRepeater>
@@ -33,7 +24,7 @@
        <com:TActiveDataGrid
                ID="DataGrid"
                AutoGenerateColumns="false"
-               AllowSorting="true"
+               AllowSorting="false"
                OnSortCommand="sortDataGrid"
                CellPadding="5px"
                CssClass="window-section-detail"
        >
                <com:TActiveTemplateColumn HeaderText="Job name" SortExpression="name">
                        <prop:ItemTemplate>
-                               <com:TPanel ID="JobRunTableElement"><%=$this->getParent()->DataItem['name']%></com:TPanel>
-                               <com:TCallback ID="JobRunTableElementCall" OnCallback="Page.JobRunWindow.configure" ActiveControl.CallbackParameter="<%=$this->getParent()->DataItem['name']%>">
-                                       <prop:ClientSide.OnComplete>
-                                               jobRunConfigurationWindow.show();
-                                               jobRunConfigurationWindow.progress(false);
-                                       </prop:ClientSide.OnComplete>
-                               </com:TCallback>
-                               <script type="text/javascript">
-                                       $('<%=$this->JobRunTableElement->ClientID%>').up('tr').observe('click', function() {
-                                               var request = <%= $this->JobRunTableElementCall->ActiveControl->Javascript %>;
-                                               jobRunConfigurationWindow.openConfigurationWindow(request, jobRunSlideWindowObj);
-                                       });
-                               </script>
+                               <div><%=$this->getParent()->DataItem['name']%></div>
+                                <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->DataItem['name']%>" />
                        </prop:ItemTemplate>
                </com:TActiveTemplateColumn>
                <com:TActiveBoundColumn
@@ -65,4 +45,7 @@
                        />
        </com:TActiveDataGrid>
        </com:TActivePanel>
+       <com:TCallback ID="DataElementCall" OnCallback="Page.JobRunWindow.configure">
+               <prop:ClientSide OnComplete="jobRunConfigurationWindow.show();jobRunConfigurationWindow.progress(false);" />
+       </com:TCallback>
 </com:TContent>
index 5777174ca8e1ae937cd08ecfe7e1efb5bdf21ce6..fea8b97880c91a1c36e6030ea8e509e9843b3a95 100644 (file)
@@ -80,7 +80,7 @@
                        <div class="text"><com:TLabel ForControl="ActionOnPurge" Text="<%[ Action on purge: ]%>" /></div>
                        <div class="field"><com:TActiveCheckBox ID="ActionOnPurge" AutoPostBack="false" /></div>
                </div>
-               <com:TCallback ID="ReloadPools" OnCallback="Page.PoolWindow.prepareData" />
+               <com:TCallback ID="ReloadPools" OnCallback="Page.PoolWindow.prepareData" ClientSide.OnComplete="poolSlideWindowObj.setLoadRequest();" />
                <script type="text/javascript">
                                function <%=$this->getPage()->PoolConfiguration->getMaster()->ClientID%>reloadWindow() {
                                        var callback = <%= $this->ReloadPools->ActiveControl->Javascript %>;
index 98d5147798a307c3d0bbdf747834cc027b4ff450..7a1dd0437f056ff4f198b28167c3fa34604f624c 100644 (file)
@@ -40,12 +40,17 @@ class PoolList extends Portlets {
                                $params = $this->getUrlParams('pools', $this->getPage()->PoolWindow->ID);
                                $pools = $this->Application->getModule('api')->get($params);
                                $isDetailView = $_SESSION['view' . $this->getPage()->PoolWindow->ID] == 'details';
-                               $this->RepeaterShow->Visible = !$isDetailView;
-                               $this->Repeater->DataSource = $isDetailView === false ? $pools->output : array();
-                               $this->Repeater->dataBind();
-                               $this->DataGridShow->Visible = $isDetailView;
-                               $this->DataGrid->DataSource = $isDetailView === true ? $this->Application->getModule('misc')->objectToArray($pools->output) : array();
-                               $this->DataGrid->dataBind();
+                               if($isDetailView === true) {
+                                       $this->RepeaterShow->Visible = false;
+                                       $this->DataGridShow->Visible = true;
+                                       $this->DataGrid->DataSource = $this->Application->getModule('misc')->objectToArray($pools->output);
+                                       $this->DataGrid->dataBind();
+                               } else {
+                                       $this->RepeaterShow->Visible = true;
+                                       $this->DataGridShow->Visible = false;
+                                       $this->Repeater->DataSource = $pools->output;
+                                       $this->Repeater->dataBind();
+                               }
                        }
                }
        }
@@ -72,4 +77,4 @@ class PoolList extends Portlets {
                }
        }
 }
-?>
\ No newline at end of file
+?>
index cc261164c02418e04742da53e11bff6d3c960337..1d5dd63bc47d0ba6c8ff8f96e3cdef336b0802a2 100644 (file)
@@ -1,29 +1,19 @@
 <%@ MasterClass="Application.Portlets.SlideWindow"%>
 <com:TContent ID="SlideWindowContent">
+       <script type="text/javascript">
+               document.observe("dom:loaded", function() {
+                       poolConfigurationWindow = ConfigurationWindow<%=$this->getPage()->PoolConfiguration->getMaster()->ClientID%>;
+                       poolSlideWindowObj = <%=$this->getPage()->PoolWindow->ShowID%>SlideWindow;
+                       poolSlideWindowObj.setConfigurationObj(poolConfigurationWindow);
+               });
+       </script>
        <com:TActivePanel ID="RepeaterShow">
-               <script type="text/javascript">
-                       document.observe("dom:loaded", function() {
-                               poolConfigurationWindow = ConfigurationWindow<%=$this->getPage()->PoolConfiguration->getMaster()->ClientID%>;
-                               poolSlideWindowObj = <%=$this->getPage()->PoolWindow->ShowID%>SlideWindow;
-                       });
-               </script>
                <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>
-                               <com:TCallback ID="PoolElementCall" OnCallback="Page.PoolWindow.configure" ActiveControl.CallbackParameter="<%=@$this->DataItem->poolid%>">
-                                       <prop:ClientSide.OnComplete>
-                                               poolConfigurationWindow.show();
-                                               poolConfigurationWindow.progress(false);
-                                       </prop:ClientSide.OnComplete>
-                               </com:TCallback>
-                               <script type="text/javascript">
-                                       $('<%=$this->PoolElement->ClientID%>').observe('click', function() {
-                                               var request = <%= $this->PoolElementCall->ActiveControl->Javascript %>;
-                                               poolConfigurationWindow.openConfigurationWindow(request, poolSlideWindowObj);
-                                       });
-                               </script>
                        </prop:ItemTemplate>
                </com:TActiveRepeater>
        </com:TActivePanel>
@@ -32,7 +22,7 @@
                <com:TActiveDataGrid
                        ID="DataGrid"
                        AutoGenerateColumns="false"
-                       AllowSorting="true"
+                       AllowSorting="false"
                        OnSortCommand="sortDataGrid"
                        CellPadding="5px"
                        CssClass="window-section-detail"
                >
                        <com:TActiveTemplateColumn HeaderText="Pool name" SortExpression="name">
                                <prop:ItemTemplate>
-                                       <com:TPanel ID="PoolTableElement"><%=$this->getParent()->Data['name']%></com:TPanel>
-                                       <com:TCallback ID="PoolTableElementCall" OnCallback="Page.PoolWindow.configure" ActiveControl.CallbackParameter="<%=$this->getParent()->Data['poolid']%>">
-                                               <prop:ClientSide.OnComplete>
-                                                       poolConfigurationWindow.show();
-                                                       poolConfigurationWindow.progress(false);
-                                               </prop:ClientSide.OnComplete>
-                                       </com:TCallback>
-                                       <script type="text/javascript">
-                                               $('<%=$this->PoolTableElement->ClientID%>').up('tr').observe('click', function() {
-                                                       var request = <%= $this->PoolTableElementCall->ActiveControl->Javascript %>;
-                                                       poolConfigurationWindow.openConfigurationWindow(request, poolSlideWindowObj);
-                                               });
-                                       </script>
+                                       <div><%=$this->getParent()->Data['name']%></div>
+                                       <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->Data['poolid']%>" />
                                </prop:ItemTemplate>
                        </com:TActiveTemplateColumn>
                        <com:TActiveBoundColumn
@@ -79,4 +58,7 @@
                        </com:TActiveTemplateColumn>
                </com:TActiveDataGrid>
        </com:TActivePanel>
+       <com:TCallback ID="DataElementCall" OnCallback="Page.PoolWindow.configure">
+               <prop:ClientSide OnComplete="poolConfigurationWindow.show();poolConfigurationWindow.progress(false);" />
+       </com:TCallback>
 </com:TContent>
index 875ab8bb21d509c8e80db1d398ea8e3750ae47ee..73d618eddbd8a54685a1fe7a4061634e551ed647 100644 (file)
@@ -28,6 +28,7 @@
                        </prop:ClientSide.OnLoading>
                        <prop:ClientSide.OnComplete>
                                $('<%=$this->UniqueID%>-slide-window-progress').setStyle({'display': 'none'});
+                               <%=$this->ShowID%>SlideWindow.setLoadRequest();
                        </prop:ClientSide.OnComplete>
                </com:TCallback>
                        <script type="text/javascript">
index 33050d93fb7af18d40be4ee5c81d689ce4560928..6180afe5afd7778f9f22f6e872b0605921e6c8ab 100644 (file)
@@ -40,17 +40,22 @@ class StorageList extends Portlets {
                                $params = $this->getUrlParams('storages', $this->getPage()->StorageWindow->ID);
                                $storages = $this->Application->getModule('api')->get($params);
                                $isDetailView = $_SESSION['view' . $this->getPage()->StorageWindow->ID] == 'details';
-                               $this->RepeaterShow->Visible = !$isDetailView;
-                               $this->Repeater->DataSource = $isDetailView === false ? $storages->output : array();
-                               $this->Repeater->dataBind();
-                               $this->DataGridShow->Visible = $isDetailView;
-                               $this->DataGrid->DataSource = $isDetailView === true ? $this->Application->getModule('misc')->objectToArray($storages->output) : array();
-                               $this->DataGrid->dataBind();
+                               if($isDetailView === true) {
+                                       $this->RepeaterShow->Visible = false;
+                                       $this->DataGridShow->Visible = true;
+                                       $this->DataGrid->DataSource = $this->Application->getModule('misc')->objectToArray($storages->output);
+                                       $this->DataGrid->dataBind();
+                               } else {
+                                       $this->RepeaterShow->Visible = true;
+                                       $this->DataGridShow->Visible = false;
+                                       $this->Repeater->DataSource = $storages->output;
+                                       $this->Repeater->dataBind();
+                               }
                        }
                }
        }
 
-    public function sortDataGrid($sender, $param) {
+       public function sortDataGrid($sender, $param) {
                $params = $this->getUrlParams('storages', $this->getPage()->StorageWindow->ID);
                $data = $this->Application->getModule('api')->get($params)->output;
                $data = $this->Application->getModule('misc')->objectToArray($data);
index cac63cf395d08e3aa5f88ecac66927636d010942..f4e573f1eb72160f7b012cea46d27f2064bc8d1d 100644 (file)
@@ -1,29 +1,19 @@
 <%@ MasterClass="Application.Portlets.SlideWindow" %>
 <com:TContent ID="SlideWindowContent">
+       <script type="text/javascript">
+               document.observe("dom:loaded", function() {
+                       storageConfigurationWindow = ConfigurationWindow<%=$this->getPage()->StorageConfiguration->getMaster()->ClientID%>;
+                       storageSlideWindowObj = <%=$this->getPage()->StorageWindow->ShowID%>SlideWindow;
+                       storageSlideWindowObj.setConfigurationObj(storageConfigurationWindow);
+               });
+       </script>
        <com:TActivePanel ID="RepeaterShow">
-               <script type="text/javascript">
-                       document.observe("dom:loaded", function() {
-                               storageConfigurationWindow = ConfigurationWindow<%=$this->getPage()->StorageConfiguration->getMaster()->ClientID%>;
-                               storageSlideWindowObj = <%=$this->getPage()->StorageWindow->ShowID%>SlideWindow;
-                       });
-               </script>
                <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>
-                               <com:TCallback ID="StorageElementCall" OnCallback="Page.StorageWindow.configure" ActiveControl.CallbackParameter="<%=@$this->DataItem->storageid%>">
-                                       <prop:ClientSide.OnComplete>
-                                               storageConfigurationWindow.show();
-                                               storageConfigurationWindow.progress(false);
-                                       </prop:ClientSide.OnComplete>
-                               </com:TCallback>
-                               <script type="text/javascript">
-                                       $('<%=$this->StorageElement->ClientID%>').observe('click', function() {
-                                               var request = <%= $this->StorageElementCall->ActiveControl->Javascript %>;
-                                               storageConfigurationWindow.openConfigurationWindow(request, storageSlideWindowObj);
-                                       });
-                               </script>
                        </prop:ItemTemplate>
                </com:TActiveRepeater>
        </com:TActivePanel>
@@ -31,7 +21,7 @@
                <com:TActiveDataGrid
                        ID="DataGrid"
                        AutoGenerateColumns="false"
-                       AllowSorting="true"
+                       AllowSorting="false"
                        OnSortCommand="sortDataGrid"
                        CellPadding="5px"
                        CssClass="window-section-detail"
                >
                        <com:TActiveTemplateColumn HeaderText="Storage name" SortExpression="name">
                                <prop:ItemTemplate>
-                                       <com:TPanel ID="StorageTableElement"><%=$this->getParent()->Data['name']%></com:TPanel>
-                                       <com:TCallback ID="StorageTableElementCall" OnCallback="Page.StorageWindow.configure" ActiveControl.CallbackParameter="<%=$this->getParent()->Data['storageid']%>">
-                                               <prop:ClientSide.OnComplete>
-                                                       storageConfigurationWindow.show();
-                                                       storageConfigurationWindow.progress(false);
-                                               </prop:ClientSide.OnComplete>
-                                       </com:TCallback>
-                                       <script type="text/javascript">
-                                               $('<%=$this->StorageTableElement->ClientID%>').up('tr').observe('click', function() {
-                                                       var request = <%= $this->StorageTableElementCall->ActiveControl->Javascript %>;
-                                                       storageConfigurationWindow.openConfigurationWindow(request, storageSlideWindowObj);
-                                               });
-                                       </script>
+                                       <div><%=$this->getParent()->Data['name']%></div>
+                                       <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->Data['storageid']%>" />
                                </prop:ItemTemplate>
                        </com:TActiveTemplateColumn>
                        <com:TActiveTemplateColumn HeaderText="Autochanger" SortExpression="autochanger" ItemStyle.HorizontalAlign="Center">
@@ -62,4 +41,7 @@
                        </com:TActiveTemplateColumn>
                </com:TActiveDataGrid>
        </com:TActivePanel>
+       <com:TCallback ID="DataElementCall" OnCallback="Page.StorageWindow.configure">
+               <prop:ClientSide OnComplete="storageConfigurationWindow.show();storageConfigurationWindow.progress(false);" />
+       </com:TCallback>
 </com:TContent>
index 70934be0ffafe571fa8ffcb90c7bcf823468c7ce..14e18eef5f4014f8b0b92a096059f11b1f81814c 100644 (file)
@@ -76,7 +76,7 @@
                        <div class="text"><com:TLabel ForControl="InChanger" Text="<%[ In changer: ]%>" /></div>
                        <div class="field"><com:TActiveCheckBox ID="InChanger" AutoPostBack="false" /></div>
                </div>
-               <com:TCallback ID="ReloadVolumes" OnCallback="Page.VolumeWindow.prepareData" />
+               <com:TCallback ID="ReloadVolumes" OnCallback="Page.VolumeWindow.prepareData" ClientSide.OnComplete="volumeSlideWindowObj.setLoadRequest();" />
                <script type="text/javascript">
                                function <%=$this->getPage()->VolumeConfiguration->getMaster()->ClientID%>reloadWindow() {
                                        if(typeof(IsInvalid<%=$this->getPage()->VolumeConfiguration->getMaster()->ClientID%>) == 'undefined') {
index c805e8cd15a8b12663109dea11410bb777bb4ced..9272ebbc1efb60aab33500f3e60f2c2323bdd091 100644 (file)
@@ -45,12 +45,18 @@ class VolumeList extends Portlets {
                                array_push($params, '?showpools=1');
                                $volumes = $this->Application->getModule('api')->get($params);
                                $isDetailView = $_SESSION['view' . $this->getPage()->VolumeWindow->ID] == 'details';
-                               $this->RepeaterShow->Visible = !$isDetailView;
-                               $this->Repeater->DataSource = $volumes->output;
-                               $this->Repeater->dataBind();
-                               $this->DataGridShow->Visible = $isDetailView;
-                               $this->DataGrid->DataSource = $this->Application->getModule('misc')->objectToArray($volumes->output);
-                               $this->DataGrid->dataBind();
+                               if($isDetailView === true) {
+                                       $this->RepeaterShow->Visible = false;
+                                       $this->DataGridShow->Visible = true;
+                                       $this->DataGrid->DataSource = $this->Application->getModule('misc')->objectToArray($volumes->output);
+                                       $this->DataGrid->dataBind();
+
+                               } else {
+                                       $this->Repeater->DataSource = $volumes->output;
+                                       $this->Repeater->dataBind();
+                                       $this->RepeaterShow->Visible = true;
+                                       $this->DataGridShow->Visible = false;
+                               }
                        }
                }
        }
@@ -75,7 +81,7 @@ class VolumeList extends Portlets {
                return $data;
        }
 
-    public function sortDataGrid($sender, $param) {
+       public function sortDataGrid($sender, $param) {
                $params = $this->getUrlParams('volumes', $this->getPage()->VolumeWindow->ID);
                array_push($params, '?showpools=1');
                $data = $this->Application->getModule('api')->get($params)->output;
index 0c0de85d4e1c92a4c2e42da9c5b0613c3c9c08e4..1a60b7c46aa802e6c266d65920da677516608ada 100644 (file)
@@ -1,31 +1,21 @@
 <%@ MasterClass="Application.Portlets.SlideWindow" %>
 <com:TContent ID="SlideWindowContent">
-       <com:TActivePanel ID="RepeaterShow">
        <script type="text/javascript">
                document.observe("dom:loaded", function() {
                        volumeConfigurationWindow = ConfigurationWindow<%=$this->getPage()->VolumeConfiguration->getMaster()->ClientID%>;
                        volumeSlideWindowObj = <%=$this->getPage()->VolumeWindow->ShowID%>SlideWindow;
+                       volumeSlideWindowObj.setConfigurationObj(volumeConfigurationWindow);
                });
        </script>
+       <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>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'))) ? 'When expire: ' . date( 'Y-m-d H:i:s', (strtotime($this->DataItem->lastwritten) + $this->DataItem->volretention)) : ''%> Last written: <%=!empty($this->DataItem->lastwritten) ? $this->DataItem->lastwritten : '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>
-                       <com:TCallback ID="VolumeElementCall" OnCallback="Page.VolumeWindow.configure" ActiveControl.CallbackParameter="<%=@$this->DataItem->mediaid%>">
-                               <prop:ClientSide.OnComplete>
-                                       volumeConfigurationWindow.show();
-                                       volumeConfigurationWindow.progress(false);
-                               </prop:ClientSide.OnComplete>
-                       </com:TCallback>
-                       <script type="text/javascript">
-                               $('<%=$this->VolumeElement->ClientID%>').observe('click', function() {
-                                       var request = <%= $this->VolumeElementCall->ActiveControl->Javascript %>;
-                                       volumeConfigurationWindow.openConfigurationWindow(request, volumeSlideWindowObj);
-                               });
-                       </script>
                        <%=!(isset($this->DataItem->pool->name) ? ($this->getPage()->VolumeWindow->oldPool = $this->DataItem->pool->name) : false)%>
                </prop:ItemTemplate>
        </com:TActiveRepeater>
@@ -34,7 +24,7 @@
        <com:TActiveDataGrid
                ID="DataGrid"
                AutoGenerateColumns="false"
-               AllowSorting="true"
+               AllowSorting="false"
                OnSortCommand="sortDataGrid"
                CellPadding="5px"
                CssClass="window-section-detail"
        >
                <com:TActiveTemplateColumn HeaderText="Volume name" SortExpression="volumename">
                        <prop:ItemTemplate>
-                               <com:TPanel ID="VolumeTableElement"><%=$this->getParent()->Data['volumename']%></com:TPanel>
-                               <com:TCallback ID="VolumeTableElementCall" OnCallback="Page.VolumeWindow.configure" ActiveControl.CallbackParameter="<%=$this->getParent()->Data['mediaid']%>">
-                                       <prop:ClientSide.OnComplete>
-                                               volumeConfigurationWindow.show();
-                                               volumeConfigurationWindow.progress(false);
-                                       </prop:ClientSide.OnComplete>
-                               </com:TCallback>
-                               <script type="text/javascript">
-                                       $('<%=$this->VolumeTableElement->ClientID%>').up('tr').observe('click', function() {
-                                               var request = <%= $this->VolumeTableElementCall->ActiveControl->Javascript %>;
-                                               volumeConfigurationWindow.openConfigurationWindow(request, volumeSlideWindowObj);
-                                       });
-                               </script>
+                               <div><%=$this->getParent()->Data['volumename']%></div>
+                               <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->Data['mediaid']%>" />
                        </prop:ItemTemplate>
                </com:TActiveTemplateColumn>
                <com:TActiveBoundColumn
@@ -81,4 +60,7 @@
                />
        </com:TActiveDataGrid>
        </com:TActivePanel>
+       <com:TCallback ID="DataElementCall" OnCallback="Page.VolumeWindow.configure">
+               <prop:ClientSide OnComplete="volumeConfigurationWindow.show();volumeConfigurationWindow.progress(false);" />
+       </com:TCallback>
 </com:TContent>