]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/protected/Web/Pages/RestoreWizard.page
baculum: New reworked restore wizard
[bacula/bacula] / gui / baculum / protected / Web / Pages / RestoreWizard.page
1 <%@ MasterClass="Application.Web.Layouts.Wizard" Theme="Baculum-v1"%>
2 <com:TContent ID="Wizard">
3         <com:TWizard ID="RestoreWizard"
4                 CssClass="wizard"
5                 StepStyle.CssClass="steps"
6                 HeaderStyle.CssClass="wizard-body"
7                 NavigationStyle.CssClass="navigation"
8                 UseDefaultLayout="false"
9                 ShowSideBar="false"
10                 OnPreviousButtonClick="wizardPrev"
11                 OnNextButtonClick="wizardNext"
12                 OnCancelButtonClick="wizardStop"
13                 OnCompleteButtonClick="wizardCompleted"
14                 >
15                 <prop:HeaderTemplate>
16                         <div>
17                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 0) ? 'first-active' : (($this->Parent->ActiveStepIndex === 1) ? 'first-next-active' : 'first')%>">
18                                         <div><com:TTranslate Text="Client" /></div>
19                                 </div>
20                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 1) ? 'active' : (($this->Parent->ActiveStepIndex === 2) ? 'prev-active' : 'normal')%>">
21                                         <div><com:TTranslate Text="Backup" /></div>
22                                 </div>
23                                  <div class="step step-<%=($this->Parent->ActiveStepIndex === 2) ? 'active' : (($this->Parent->ActiveStepIndex === 3) ? 'prev-active' : 'normal')%>">
24                                         <div><com:TTranslate Text="Files" /></div>
25                                 </div>
26                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 3) ? 'active' : (($this->Parent->ActiveStepIndex === 4) ? 'prev-active' : 'normal')%>">
27                                         <div><com:TTranslate Text="Where" /></div>
28                                 </div>
29                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 4) ? 'active' : (($this->Parent->ActiveStepIndex === 5) ? 'prev-active' : 'normal')%>">
30                                         <div><com:TTranslate Text="Options" /></div>
31                                 </div>
32                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 5) ? 'last-active' : (($this->Parent->ActiveStepIndex === 6) ? 'last-prev-active' : 'last')%>">
33                                         <div><com:TTranslate Text="Run" /></div>
34                                 </div>
35                                 <div id="title"><%=$this->Parent->ActiveStep->Title%><div>
36                         </div>
37                 </prop:HeaderTemplate>
38                 <prop:StartNavigationTemplate>
39                                 <div class="button-cancel"><com:BButton CommandName="Cancel" Text="<%[ Cancel ]%>" /></div>
40                                 <div class="button-prev-next"><com:BButton CommandName="NextStep" Text="<%[ Next &raquo; ]%>" /></div>
41                 </prop:StartNavigationTemplate>
42
43                 <prop:StepNavigationTemplate>
44                         <div class="button-cancel"><com:BButton CommandName="Cancel" Text="<%[ Cancel ]%>" /></div>
45                         <div class="button-prev-next">
46                                 <com:BButton CausesValidation="False" CssClass="bbutton" CommandName="PreviousStep" Text="<%[ &laquo; Previous ]%>" />
47                                 <com:BButton ID="NextButton" CommandName="NextStep" Text="<%[ Next &raquo; ]%>" Visible="<%=($this->getPage()->RestoreWizard->ActiveStepIndex != 1 || ($this->getPage()->RestoreWizard->ActiveStepIndex == 1 && $this->getPage()->BackupsToRestore->ItemCount > 0))%>" />
48                         </div>
49                 </prop:StepNavigationTemplate>
50                  
51                 <prop:FinishNavigationTemplate>
52                         <div class="button-cancel"><com:BButton CommandName="Cancel" Text="<%[ Cancel ]%>" /></div>
53                         <div class="button-prev-next">
54                         <com:BButton CausesValidation="False" CssClass="bbutton" CommandName="PreviousStep" Text="<%[ &laquo; Previous ]%>" />
55                         <com:BButton CommandName="Complete" Text="<%[ Run restore ]%>" />
56                         </div>
57                 </prop:FinishNavigationTemplate>
58                 <com:TWizardStep ID="Step1" Title="<%[ Step 1 - select source backup client ]%>" StepType="Auto">
59                         <h2><%[ Restore wizard ]%></h2>
60                         <p>
61                                 <%[ This wizard enables you to do in easy way restore files to destination Bacula Client. ]%>
62                                 <%[ To start, please select backup Client which data you want to restore. ]%>
63                         </p>
64                         <div class="line">
65                                 <div class="text"><com:TLabel ForControl="BackupClientName" Text="<%[ Backup from client: ]%>" /></div>
66                                 <div class="field">
67                                         <com:TDropDownList ID="BackupClientName" CssClass="textbox" Width="350px" CausesValidation="false" />
68                                 </div>
69                         </div>
70                 </com:TWizardStep>
71                 <com:TWizardStep ID="Step2" Title="<%[ Step 2 - select backup to restore ]%>" StepType="Auto">
72                         <p>
73                                 <%[ There are two ways to select backup to restore. Only selected backup way provides list of jobs from which there is possible to select one job. If you need the latest backups from the Client alternatively you can use Group most recent backups way which will select backups for you basing on backup job name and fileset resource. ]%>
74                         </p>
75                         <div class="line" style="margin-top: 15px">
76                                 <div class="text"><com:TLabel Text="<%[ Backup selection method: ]%>" /></div>
77                                 <div class="field">
78                                         <com:TRadioButton
79                                                 ID="OnlySelectedBackupSelection"
80                                                 GroupName="BackupSelection"
81                                                 Checked="true"
82                                                 Attributes.onclick="$('#group-backup-to-restore-field').hide(); $('#backup-to-restore-field').show();"
83                                         />
84                                         <com:TLabel ForControl="OnlySelectedBackupSelection" Text="<%[ Only selected backup ]%>" />
85                                         <com:TRadioButton
86                                                 ID="GroupBackupSelection"
87                                                 GroupName="BackupSelection"
88                                                 Attributes.onclick="$('#backup-to-restore-field').hide(); $('#group-backup-to-restore-field').show();"
89                                         />
90                                         <com:TLabel ForControl="GroupBackupSelection" Text="<%[ Group most recent backups ]%>" /></div>
91                         </div>
92                         <div id="backup-to-restore-field" style="display: <%=!$this->OnlySelectedBackupSelection->Checked ? 'none' : 'block'%>">
93                                 <div>
94                                 <p><%[ Backup for restore: ]%></p>
95                                 <com:TDataGrid
96                                         ID="BackupsToRestore"
97                                         EnableViewState="false"
98                                         AutoGenerateColumns="false"
99                                         AllowSorting="false"
100                                         CellPadding="5px"
101                                         CssClass="window-section-detail"
102                                         ItemStyle.CssClass="slide-window-element"
103                                         AlternatingItemStyle.CssClass="slide-window-element-alternating"
104                                         >
105                                         <com:TBoundColumn HeaderText="ID" DataField="jobid" />
106                                         <com:TTemplateColumn HeaderText="<%[ Job name ]%>" SortExpression="name">
107                                                 <prop:ItemTemplate>
108                                                         <div title="<%=$this->getParent()->Data['name']%>"><%=$this->getParent()->Data['name']%></div>
109                                                 </prop:ItemTemplate>
110                                         </com:TTemplateColumn>
111                                         <com:TTemplateColumn>
112                                                 <prop:HeaderText>
113                                                         <span title="<%=Prado::localize('Type')%>" style="cursor: help">T</span>
114                                                 </prop:HeaderText>
115                                                 <prop:ItemTemplate>
116                                                         <%=$this->getParent()->Data['type']%>
117                                                 </prop:ItemTemplate>
118                                         </com:TTemplateColumn>
119                                         <com:TTemplateColumn>
120                                                 <prop:HeaderText>
121                                                         <span title="<%=Prado::localize('Level')%>" style="cursor: help">L</span>
122                                                 </prop:HeaderText>
123                                                 <prop:ItemTemplate>
124                                                         <%=$this->getParent()->Data['level']%>
125                                                 </prop:ItemTemplate>
126                                         </com:TTemplateColumn>
127                                         <com:TTemplateColumn HeaderText="<%[ Job status ]%>" SortExpression="jobstatus">
128                                                 <prop:ItemTemplate>
129                                                         <div class="job-status-<%=$this->getParent()->Data['jobstatus'] == 'T' && $this->getParent()->Data['joberrors'] > 0 ? 'W' : $this->getParent()->Data['jobstatus']%>" title="<%=$this->getPage()->getModule('misc')->jobStates[$this->getParent()->Data['jobstatus'] == 'T' && $this->getParent()->Data['joberrors'] > 0 ? 'W' : $this->getParent()->Data['jobstatus']]['description']%>"><%=$this->getPage()->getModule('misc')->jobStates[$this->getParent()->Data['jobstatus']]['value']%></div>
130                                                 </prop:ItemTemplate>
131                                         </com:TTemplateColumn>
132                                         <com:TTemplateColumn HeaderText="<%[ Size ]%>" SortExpression="jobbytes">
133                                                 <prop:ItemTemplate>
134                                                         <div class="size" rel="<%=$this->getParent()->Data['jobbytes']%>"><%=$this->getParent()->Data['jobbytes']%></div>
135                                                 </prop:ItemTemplate>
136                                         </com:TTemplateColumn>
137                                         <com:TBoundColumn SortExpression="jobfiles" HeaderText="<%[ Files ]%>" DataField="jobfiles" />
138                                         <com:TTemplateColumn HeaderText="<%[ End time ]%>" SortExpression="endtime">
139                                                 <prop:ItemTemplate>
140                                                         <%=$this->getParent()->Data['endtime']%>
141                                                 </prop:ItemTemplate>
142                                         </com:TTemplateColumn>
143                                         <com:TTemplateColumn HeaderText="<%[ Select ]%>">
144                                                 <prop:ItemTemplate>
145                                                         <div class="center"><input type="radio" name="backup_to_restore" value="<%=$this->getParent()->Data['jobid']%>" /></div>
146                                                 </prop:ItemTemplate>
147                                         </com:TTemplateColumn>
148                                 </com:TDataGrid>
149                                 <script type="text/javascript">
150                                         var is_list = <%=$this->BackupsToRestore->ItemCount%> > 0;
151                                         if (is_list) {
152                                                 SlideWindow.makeSortable('<%=$this->BackupsToRestore->ClientID%>');
153                                                 SlideWindow.sortTable('<%=$this->BackupsToRestore->ClientID%>', 0, true);
154                                                 Formatters.set_formatters();
155                                                 var grid_id = '<%=$this->BackupsToRestore->ClientID%>';
156                                                 var restore_single_jobid = '<%=$this->restore_single_jobid%>';
157                                                 var rows = (
158                                                         '#' + grid_id + ' tr.' + SlideWindow.elements.contentItems + ', ' +
159                                                         '#' + grid_id + ' tr.' + SlideWindow.elements.contentAlternatingItems
160                                                 );
161                                                 $(rows).each(function(index, el) {
162                                                         $(el).on('click', function(e) {
163                                                                 var el = $(e.srcElement||e.target);
164                                                                 if (el.length === 1) {
165                                                                         el = el.parents('tr').find('input[type=radio]');
166                                                                         if (el.length === 1) {
167                                                                                 el[0].checked = true;
168                                                                         }
169                                                                 }
170                                                         });
171                                                         var radio = $(el).find('input[type=radio]')[0];
172                                                         if (restore_single_jobid === radio.value) {
173                                                                 radio.checked = true;
174                                                         }
175                                                 }.bind(this));
176                                         } else {
177                                                 document.getElementById('backup-to-restore-field').style.display = 'none';
178                                         }
179                                 </script>
180                                 </div>
181                         </div>
182                         <div id="group-backup-to-restore-field" style="display: <%=!$this->GroupBackupSelection->Checked ? 'none' : 'block'%>">
183                                 <div class="line">
184                                         <div class="text"><com:TLabel ForControl="GroupBackupToRestore" Text="<%[ Backup for restore: ]%>" /></div>
185                                         <div class="field">
186                                                 <com:TDropDownList ID="GroupBackupToRestore" CssClass="textbox" Width="350px" CausesValidation="false" />
187                                         </div>
188                                 </div>
189                                 <div class="line">
190                                         <div class="text"><com:TLabel ForControl="GroupBackupFileSet" Text="<%[ FileSet resource: ]%>" /></div>
191                                         <div class="field">
192                                                 <com:TDropDownList ID="GroupBackupFileSet" CssClass="textbox" Width="350px" CausesValidation="false" />
193                                         </div>
194                                 </div>
195                         </div>
196                         <com:TLabel Text="<%[ There is no backup for restore. Please go to previous step and select another client for restore or proceed backups for the client selected in previous step. ]%>" CssClass="validation-error-summary" Visible="<%=($this->BackupsToRestore->ItemCount == 0 && $this->GroupBackupToRestore->ItemCount == 0)%>"/>
197
198                 </com:TWizardStep>
199                 <com:TWizardStep ID="Step3" Title="<%[ Step 3 - select files to restore ]%>" StepType="Auto">
200                         <%[ Path: ]%> <com:TActiveTextBox
201                                         ID="PathField"
202                                         CssClass="textbox-auto"
203                                         Attributes.onkeydown="var keycode = (event.keyCode ? event.keyCode : event.which); if (keycode === 13) {$('<%=$this->LoadPathBtn->ClientID%>').click(); return false; } return true;"
204                                         Width="895px" />
205                         <com:TActiveLinkButton ID="LoadPathBtn" OnClick="loadPath" Text="<%[ OK ]%>">
206                                 <prop:ClientSide.OnLoading>
207                                         document.getElementById('restore-browser-files-loading').style.display = 'block';
208                                 </prop:ClientSide.OnLoading>
209                                 <prop:ClientSide.OnComplete>
210                                         document.getElementById('restore-browser-files-loading').style.display = 'none';
211                                 </prop:ClientSide.OnComplete>
212                         </com:TActiveLinkButton>
213                         <table id="restore-browser">
214                                 <tr>
215                                         <td rowspan="2">
216                                                 <div id="restore-browser-files-loading" style="display: none"></div>
217                                                 <div id="restore-browser-files">
218                                                 <com:TActiveDataGrid
219                                                         ID="DataGridFiles"
220                                                         AutoGenerateColumns="false"
221                                                         CellPadding="2px"
222                                                         ShowHeader="false"
223                                                         CssClass="file-browser-detail"
224                                                         ItemStyle.CssClass="file-browser-element"
225                                                         DataKeyField="fileid">
226                                                                 <prop:EmptyTemplate>
227                                                                         <div class="file-browser-watermark" style="padding: 200px 10px">
228                                                                                 <%[ It seems that there is no files for choosing or file records in database for this job has been purged (file retention period expired) ]%>
229                                                                         </div>
230                                                                 </prop:EmptyTemplate>
231                                                                 <com:TActiveTemplateColumn>
232                                                                         <prop:ItemTemplate>
233                                                                                 <com:TDraggable ID="FileElementLeft" Revert="false" Handle="<%=$this->FileElementLeft->ClientID%>" Ghosting="true" CssClass="draggable">
234                                                                                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file' %>" /> <%=($this->getParent()->Data['name'] != '/') ? preg_replace('/\/$/', '', $this->getParent()->Data['name']) : '/'%>
235                                                                                 <div class="restore-browser-element-size">
236                                                                                         <com:TActiveLinkButton
237                                                                                                 CssClass="link"
238                                                                                                 Style="float: right;"
239                                                                                                 OnCallback="Page.addFileToRestore"
240                                                                                                 ActiveControl.CallbackParameter="<%=isset($this->getParent()->Data['fileid']) ? $this->getParent()->Data['fileid'] : null%>"
241                                                                                                 ActiveControl.EnableUpdate="false"
242                                                                                                 Visible="<%=!in_array($this->getParent()->Data['name'], $this->getPage()->excluded_elements_from_add)%>"
243                                                                                                 Text="<%[ Add ]%>"
244                                                                                         />
245                                                                                         <span class="size" style=""><%=isset($this->getParent()->Data['lstat']['size']) ? $this->getParent()->Data['lstat']['size'] : '0'%></span>
246                                                                                 </div>
247                                                                                 </com:TDraggable>
248                                                                                 <com:TCallback ID="FileElementCall" OnCallback="Page.getVersions" ActiveControl.CallbackParameter="<%=$this->getParent()->Data['name'] . '|' . @$this->getParent()->Data['pathid'] . '|' . @$this->getParent()->Data['filenameid'] . '|' . @$this->getParent()->Data['jobid']%>">
249                                                                                         <prop:ClientSide.OnLoading>
250                                                                                                 document.getElementById('restore-browser-files-loading').style.display = 'block';
251                                                                                         </prop:ClientSide.OnLoading>
252                                                                                         <prop:ClientSide.OnComplete>
253                                                                                                 document.getElementById('restore-browser-files-loading').style.display = 'none';
254                                                                                         </prop:ClientSide.OnComplete>
255                                                                                 </com:TCallback>
256                                                                                 <script type="text/javascript">
257                                                                                         Formatters.set_formatters();
258                                                                                         document.getElementById('<%=$this->FileElementLeft->ClientID%>').addEventListener('mouseup', function(event) {
259                                                                                                 var el = event.target || event.srcElement;
260                                                                                                 if (el) {
261                                                                                                     el.style.position = 'static';
262                                                                                                     el.style.top = '-1px';
263                                                                                                     el.style.left = '-1px';
264                                                                                                 }
265                                                                                                 var fel = document.getElementById('<%=$this->FileElementLeft->ClientID%>');
266                                                                                                 fel.style.position = 'static';
267                                                                                                 fel.style.top = '-1px';
268                                                                                                 fel.style.left = '-1px';
269                                                                                         });
270                                                                                         document.getElementById('<%=$this->FileElementLeft->ClientID%>').addEventListener('click', function(event) {
271                                                                                                 var el = event.target || event.srcElement;
272                                                                                                 if (el.className == 'link') {
273                                                                                                         // 'Add' link doesn't cause sending request
274                                                                                                         return;
275                                                                                                 }
276                                                                                                 var vposition = el.style.left;
277                                                                                                 if(vposition == null || vposition == '0px'){
278                                                                                                         event.stop();
279                                                                                                 } else {
280                                                                                                         var request = <%=$this->FileElementCall->ActiveControl->Javascript %>;
281                                                                                                         request.dispatch();
282                                                                                                 }
283                                                                                         });
284                                                                                 </script>
285                                                                         </prop:ItemTemplate>
286                                                                 </com:TActiveTemplateColumn>
287                                                 </com:TActiveDataGrid>
288                                                 </div>
289                                         </td>
290                                         <td>
291                                                 <div id="restore-browser-versions">
292                                                         <com:TActiveDataGrid
293                                                                 ID="VersionsDataGrid"
294                                                                 ShowHeader="false"
295                                                                 AutoGenerateColumns="false"
296                                                                 CellPadding="2px"
297                                                                 CssClass="file-browser-detail"
298                                                                 ItemStyle.CssClass="file-browser-element"
299                                                                 DataKeyField="fileid"
300                                                         >
301                                                                 <prop:EmptyTemplate>
302                                                                         <div class="file-browser-watermark">
303                                                                                 <%[ For see a file versions please click file on the left files browser. ]%>
304                                                                         </div>
305                                                                 </prop:EmptyTemplate>
306                                                                 <com:TActiveTemplateColumn>
307                                                                         <prop:ItemTemplate>
308                                                                                 <com:TDraggable ID="FileElementToRestore" Revert="false" Handle="<%=$this->FileElementToRestore->ClientID%>" Ghosting="true" CssClass="draggable" Style="float: left">
309                                                                                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file'%>" />
310                                                                                         <span><%=$this->getParent()->Data['name']%></span> &raquo; MTIME:<%=date("Y-m-d H:i:s", $this->getParent()->Data['lstat']['mtime'])%> &raquo; <%[ Size: ]%><span class="size"><%=$this->getParent()->Data['lstat']['size']%></span>
311                                                                                 </com:TDraggable>
312                                                                                 <com:TActiveLinkButton
313                                                                                         CssClass="link"
314                                                                                         Style="float: right;"
315                                                                                         OnCallback="Page.addFileToRestore"
316                                                                                         ActiveControl.CallbackParameter="<%=isset($this->getParent()->Data['fileid']) ? $this->getParent()->Data['fileid'] : false%>"
317                                                                                         ActiveControl.EnableUpdate="false"
318                                                                                         Text="<%[ Add ]%>"
319                                                                                 />
320                                                                                 <script type="text/javascript">
321                                                                                         Formatters.set_formatters();
322                                                                                         document.getElementById('<%=$this->FileElementToRestore->ClientID%>').addEventListener('mouseover', function(event) {
323                                                                                                 var tip_fields = [
324                                                                                                         '<%[ JobId: ]%> <%=$this->getParent()->Data['jobid']%>',
325                                                                                                         '<%[ Volume: ]%> <%=$this->getParent()->Data['volname']%>',
326                                                                                                         '<%[ InChanger: ]%> <%=$this->getParent()->Data['inchanger'] ? Prado::localize('Yes') : Prado::localize('No')%>',
327                                                                                                         '<%[ Sum: ]%> <%=$this->getParent()->Data['md5']%>'
328                                                                                                 ];
329                                                                                                 showTip(this, '<%=$this->getParent()->Data['name']%>', tip_fields.join('<br />'));
330                                                                                         });
331                                                                                         document.getElementById('<%=$this->FileElementToRestore->ClientID%>').addEventListener('mouseup', function(event) {
332                                                                                                 var el = event.target || event.srcElement;
333                                                                                                 if (el) {
334                                                                                                         el.style.position = 'static';
335                                                                                                         el.style.top = 0;
336                                                                                                         el.style.left = 0;
337                                                                                                 }
338                                                                                                 var fetr = document.getElementById('<%=$this->FileElementToRestore->ClientID%>');
339                                                                                                 fetr.style.position = 'static';
340                                                                                                 fetr.style.top = 0;
341                                                                                                 fetr.style.left = 0;
342                                                                                         });
343                                                                                 </script>
344                                                                         </prop:ItemTemplate>
345                                                                 </com:TActiveTemplateColumn>
346                                                         </com:TActiveDataGrid>
347                                                         </div>
348                                         </td>
349                                 </tr>
350                                 <tr>
351                                         <td style="vertical-align: bottom;">
352                                                 <div id="restore-browser-selected">
353                                                         <com:TDropContainer ID="SelectedVersionsDropper" Height="100%" Width="100%"
354                                                                 AcceptCssClass="draggable"
355                                                                 OnDrop="addFileToRestore"
356                                                                 OnCallback="refreshSelectedFiles"
357                                                                 >
358                                                                         <com:TActiveDataGrid
359                                                                                 ID="SelectedVersionsDataGrid"
360                                                                                 ShowHeader="false"
361                                                                                 AutoGenerateColumns="false"
362                                                                                 CellPadding="2px"
363                                                                                 CssClass="file-browser-detail"
364                                                                                 ItemStyle.CssClass="file-browser-element"
365                                                                                 DataKeyField="fileid"
366                                                                         >
367                                                                         <prop:EmptyTemplate>
368                                                                                 <div class="file-browser-watermark" style="padding: 110px 10px">
369                                                                                         <%[ For add a file to restore please click 'Add' link or drag a file from frame on left or from above frame and drop it here ]%>
370                                                                                 </div>
371                                                                         </prop:EmptyTemplate>
372                                                                         <com:TActiveTemplateColumn>
373                                                                                 <prop:ItemTemplate>
374                                                                                                 <com:TPanel ID="FileElement" Style="clear: both">
375                                                                                                         <com:TActiveImageButton ImageUrl="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_close.png" Style="float: right; vertical-align: text-bottom;margin: 3px;" OnCallback="Page.removeSelectedFile" ActiveControl.CallbackParameter="<%=isset($this->getParent()->Data['fileid']) ? $this->getParent()->Data['fileid'] : ''%>"/>
376                                                                                                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file'%>" />
377                                                                                                         <span><%=$this->getParent()->Data['name']%></span> &raquo; MTIME:<%=date("Y-m-d H:i:s", $this->getParent()->Data['lstat']['mtime'])%> &raquo; <%[ Size: ]%><span class="size"><%=$this->getParent()->Data['lstat']['size']%></span>
378                                                                                                 </com:TPanel>
379                                                                                                 <script type="text/javascript">
380                                                                                                         Formatters.set_formatters();
381                                                                                                 </script>
382                                                                                 </prop:ItemTemplate>
383                                                                         </com:TActiveTemplateColumn>
384                                                                         </com:TActiveDataGrid>
385                                                                 </com:TDropContainer>
386                                                 </div>
387                                         </td>
388                                 </tr>
389                         </table>
390                 </com:TWizardStep>
391                 <com:TWizardStep ID="Step4" Title="<%[ Step 4 - select destination for restore ]%>" StepType="Auto">
392                         <div class="line">
393                                 <div class="text"><com:TLabel ForControl="RestoreClient" Text="<%[ Restore to client: ]%>" /></div>
394                                 <div class="field">
395                                         <com:TDropDownList ID="RestoreClient" CssClass="textbox" CausesValidation="false" />
396                                 </div>
397                         </div>
398                         <div class="line">
399                                 <div class="text"><com:TLabel ForControl="RestorePath" Text="<%[ Restore to directory: ]%>" /></div>
400                                 <div class="field"><com:TTextBox ID="RestorePath" CssClass="textbox" Width="350px" Text="/tmp/restore" /></div>
401                         </div>
402                         <hr style="margin-top: 50px" />
403                         <p><%[ During restore there will be used following volumes: ]%></p>
404                         <com:TRepeater ID="RestoreVolumes">
405                                 <prop:HeaderTemplate>
406                                         <table style="min-width: 450px">
407                                                 <tr>
408                                                         <th><%[ In Changer ]%></th>
409                                                         <th><%[ Volume ]%></th>
410                                                 </tr>
411                                 </prop:HeaderTemplate>
412                                 <prop:ItemTemplate>
413                                                 <tr>
414                                                         <td class="center"><com:TLabel Text="<%#($this->DataItem['inchanger'] == 1 ? Prado::localize('Yes') : Prado::localize('No'))%>" /></td>
415                                                         <td> <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/tape_tools_icon.png" alt="" /> <com:TLabel Text="<%#$this->DataItem['volume']%>" /></td>
416                                                 </tr>
417                                 </prop:ItemTemplate>
418                                 <prop:FooterTemplate>
419                                         </table>
420                                 </prop:FooterTemplate>
421                         </com:TRepeater>
422                 </com:TWizardStep>
423                 <com:TWizardStep ID="Step5" Title="<%[ Step 5 - options for restore ]%>" StepType="Auto">
424                         <div class="line">
425                                 <div class="text"><com:TLabel ForControl="RestoreJob" Text="<%[ Restore job: ]%>" /></div>
426                                 <div class="field">
427                                         <com:TDropDownList ID="RestoreJob" CssClass="textbox" Width="350px" CausesValidation="false" />
428                                 </div>
429                         </div>
430                         <div class="line">
431                                 <div class="text"><com:TLabel ForControl="ReplaceFiles" Text="<%[ Replace files: ]%>" /></div>
432                                 <div class="field">
433                                         <com:TDropDownList ID="ReplaceFiles" CssClass="textbox" Width="350px" CausesValidation="false">
434                                                 <com:TListItem Value="never" Text="<%[ do not replace files ]%>" />
435                                                 <com:TListItem Value="ifolder" Text="<%[ if files from restore are older]%>" />
436                                                 <com:TListItem Value="ifnewer" Text="<%[ if files from restore are newer]%>" />
437                                                 <com:TListItem Value="always" Text="<%[ always replace files ]%>" />
438                                         </com:TDropDownList>
439                                 </div>
440                         </div>
441                         <div class="line">
442                                 <div class="text"><com:TLabel ForControl="RestoreJobPriority" Text="<%[ Restore job priority: ]%>" /></div>
443                                 <div class="field">
444                                         <com:TTextBox ID="RestoreJobPriority" CssClass="textbox" CausesValidation="false" Width="60px" MaxLength="5" Text="10" />
445                                 </div>
446                         </div>
447                         <div class="line" style="margin-bottom: 10px">
448                                 <div class="text" style="vertical-align: top"><%[ File relocation option:  ]%></div>
449                                 <div class="field">
450                                         <input type="radio" name="file_relocation" id="file_relocation_1" value="1" onclick="switch_file_relocation_mode(this.value)" /> <label for="file_relocation_1"><%[ Do not relocate files ]%></label><br />
451                                         <input type="radio" name="file_relocation" id="file_relocation_2" value="2" onclick="switch_file_relocation_mode(this.value)" /> <label for="file_relocation_2"><%[ Relocate files with prefix and/or suffix ]%></label><br />
452                                         <input type="radio" name="file_relocation" id="file_relocation_3" value="3" onclick="switch_file_relocation_mode(this.value)" /> <label for="file_relocation_3"><%[ Relocate files with regular expression ]%></label>
453                                 </div>
454                         </div>
455                         <div id="file_relocation_prefix_suffix" style="display: none">
456                                 <div class="line">
457                                         <div class="text"><com:TLabel ForControl="RestoreStripPrefix" Text="<%[ Strip prefix: ]%>" /></div>
458                                         <div class="field">
459                                                 <com:TTextBox ID="RestoreStripPrefix" CssClass="textbox" Width="350px" CausesValidation="false" />
460                                         </div>
461                                 </div>
462                                 <div class="line">
463                                         <div class="text"><com:TLabel ForControl="RestoreAddPrefix" Text="<%[ Add prefix: ]%>" /></div>
464                                         <div class="field">
465                                                 <com:TTextBox ID="RestoreAddPrefix" CssClass="textbox" Width="350px" CausesValidation="false" />
466                                         </div>
467                                 </div>
468                                 <div class="line">
469                                         <div class="text"><com:TLabel ForControl="RestoreAddSuffix" Text="<%[ Add suffix: ]%>" /></div>
470                                         <div class="field">
471                                                 <com:TTextBox ID="RestoreAddSuffix" CssClass="textbox" Width="350px" CausesValidation="false" />
472                                         </div>
473                                 </div>
474                         </div>
475                         <div id="file_relocation_regex_where" style="display: none">
476                                 <div class="line">
477                                         <div class="text"><com:TLabel ForControl="RestoreRegexWhere" Text="<%[ RegexWhere: ]%>" /></div>
478                                         <div class="field">
479                                                 <com:TTextBox ID="RestoreRegexWhere" CssClass="textbox" Width="350px" CausesValidation="false" />
480                                         </div>
481                                 </div>
482                         </div>
483                         <script type="text/javascript">
484                                 function switch_file_relocation_mode(opt) {
485                                         var prefix_suffix_opts = document.getElementById('file_relocation_prefix_suffix');
486                                         var regex_where_opts = document.getElementById('file_relocation_regex_where');
487                                         var radio = document.getElementById('file_relocation_' + opt);
488                                         if (opt == 1) { // don't use file relocation
489                                                 prefix_suffix_opts.style.display = 'none';
490                                                 regex_where_opts.style.display = 'none';
491                                                 radio.checked = true;
492                                         } else if (opt == 2) { // use prefix/suffix relocation
493                                                 prefix_suffix_opts.style.display = '';
494                                                 regex_where_opts.style.display = 'none';
495                                                 radio.checked = true;
496                                         } else if (opt == 3) { // use regex_where relocation
497                                                 prefix_suffix_opts.style.display = 'none';
498                                                 regex_where_opts.style.display = '';
499                                                 radio.checked = true;
500                                         }
501                                 }
502                                 var relocation_opt = '<%=$this->file_relocation_opt%>';
503                                 if (relocation_opt) {
504                                         switch_file_relocation_mode(relocation_opt);
505                                 } else {
506                                         switch_file_relocation_mode(1); // default setting
507                                 }
508                         </script>
509                 </com:TWizardStep>
510                 <com:TWizardStep ID="Step6" Title="<%[ Step 6 - Finish ]%>" StepType="Finish">
511                         <fieldset>
512                                 <legend><%[ Source parameters ]%></legend>
513                                 <div class="line">
514                                         <div class="text"><%[ Backup data from client: ]%></div>
515                                         <div class="field bold"><%=$this->BackupClientName->SelectedValue%></div>
516                                 </div>
517                                 <div class="line">
518                                         <div class="text"><%[ Backup selection method: ]%></div>
519                                         <div class="field bold">
520                                                 <com:TLabel Text="<%[ Only selected backup ]%>" Visible="<%=$this->OnlySelectedBackupSelection->Checked%>" />
521                                                 <com:TLabel Text="<%[ Group most recent backups ]%>" Visible="<%=$this->GroupBackupSelection->Checked%>" />
522                                         </div>
523                                 </div>
524                                 <div class="line">
525                                         <div class="text"><%[ Backup for restore: ]%></div>
526                                         <div class="field bold">
527                                                 <com:TLabel Text="<%=$this->GroupBackupToRestore->SelectedValue%>" Visible="<%=$this->GroupBackupSelection->Checked%>" />
528                                         </div>
529                                 </div>
530                                 <com:TPanel Visible="<%=$this->GroupBackupSelection->Checked%>">
531                                         <div class="line">
532                                                 <div class="text"><%[ FileSet for restore: ]%></div>
533                                                 <div class="field bold"><%=$this->GroupBackupFileSet->SelectedValue%></div>
534                                         </div>
535                                 </com:TPanel>
536                         </fieldset>
537                         <fieldset>
538                                 <legend><%[ Files for restore ]%></legend>
539                                 <div class="line">
540                                         <div class="text"><%[ Selected directories count: ]%></div>
541                                         <div class="field bold"><%=isset($this->getRestoreElements(true)->dirid) ? count($this->getRestoreElements(true)->dirid) : '0'%></div>
542                                 </div>
543                                 <div class="line">
544                                         <div class="text"><%[ Selected files count: ]%></div>
545                                         <div class="field bold"><%=isset($this->getRestoreElements(true)->fileid) ? count($this->getRestoreElements(true)->fileid) : '0'%></div>
546                                 </div>
547                         </fieldset>
548                         <fieldset>
549                                 <legend><%[ Destination parameters ]%></legend>
550                                 <div class="line">
551                                         <div class="text"><%[ Restore to client: ]%></div>
552                                         <div class="field bold"><%=$this->RestoreClient->SelectedValue%></div>
553                                 </div>
554                                 <div class="line">
555                                         <div class="text"><%[ Restore to path: ]%></div>
556                                         <div class="field bold"><%=$this->RestorePath->Text%></div>
557                                 </div>
558                         </fieldset>
559                         <fieldset>
560                                 <legend><%[ Restore job options ]%></legend>
561                                 <div class="line">
562                                         <div class="text"><%[ Restore job: ]%></div>
563                                         <div class="field bold"><%=$this->RestoreJob->Text%></div>
564                                 </div>
565                                 <div class="line">
566                                         <div class="text"><%[ Replace files: ]%></div>
567                                         <div class="field bold">
568                                                 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'never'%>" Text="<%[ do not replace files ]%>"/>
569                                                 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'ifolder'%>" Text="<%[ if files from restore are older]%>"/>
570                                                 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'ifnewer'%>" Text="<%[ if files from restore are newer]%>"/>
571                                                 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'always'%>" Text="<%[ always replace files ]%>"/>
572                                         </div>
573                                 </div>
574                                 <div class="line">
575                                         <div class="text"><%[ Restore job priority: ]%></div>
576                                         <div class="field bold"><%=$this->RestoreJobPriority->Text%></div>
577                                 </div>
578                                 <div class="line">
579                                         <div class="text"><%[ File relocation option: ]%></div>
580                                         <div class="field bold">
581                                                 <com:TLabel Visible="<%=$this->file_relocation_opt == 1%>" Text="<%[ Do not relocate files ]%>"/>
582                                                 <com:TLabel Visible="<%=$this->file_relocation_opt == 2%>" Text="<%[ Relocate files with prefix and/or suffix ]%>"/>
583                                                 <com:TLabel Visible="<%=$this->file_relocation_opt == 3%>" Text="<%[ Relocate files with regular expression ]%>"/>
584                                         </div>
585                                 </div>
586                                 <div style="display: <%=$this->file_relocation_opt == 2 ? 'block' : 'none'%>">
587                                         <div class="line">
588                                                 <div class="text"><%[ Strip prefix: ]%></div>
589                                                 <div class="field bold"><%=$this->RestoreStripPrefix->Text%></div>
590                                         </div>
591                                         <div class="line">
592                                                 <div class="text"><%[ Add prefix: ]%></div>
593                                                 <div class="field bold"><%=$this->RestoreAddPrefix->Text%></div>
594                                         </div>
595                                         <div class="line">
596                                                 <div class="text"><%[ Add suffix: ]%></div>
597                                                 <div class="field bold"><%=$this->RestoreAddSuffix->Text%></div>
598                                         </div>
599                                 </div>
600                                 <div style="display: <%=$this->file_relocation_opt == 3 ? 'block' : 'none'%>">
601                                         <div class="line">
602                                                 <div class="text"><%[ RegexWhere: ]%></div>
603                                                 <div class="field bold"><%=$this->RestoreRegexWhere->Text%></div>
604                                         </div>
605                                 </div>
606                         </fieldset>
607                 </com:TWizardStep>
608         </com:TWizard>
609 </com:TContent>