1 <%@ MasterClass="Application.Layouts.Wizard" Theme="Baculum-v1"%>
2 <com:TContent ID="Wizard">
3 <com:TWizard ID="RestoreWizard"
5 StepStyle.CssClass="steps"
6 HeaderStyle.CssClass="header"
7 NavigationStyle.CssClass="navigation"
8 UseDefaultLayout="false"
10 OnCancelButtonClick="wizardStop"
11 OnCompleteButtonClick="wizardCompleted"
15 <div class="step step-<%=($this->Parent->ActiveStepIndex === 0) ? 'first-active' : (($this->Parent->ActiveStepIndex === 1) ? 'first-next-active' : 'first')%>">
16 <div><com:TTranslate Text="Client" /></div>
18 <div class="step step-<%=($this->Parent->ActiveStepIndex === 1) ? 'active' : (($this->Parent->ActiveStepIndex === 2) ? 'prev-active' : 'normal')%>">
19 <div><com:TTranslate Text="Backup" /></div>
21 <div class="step step-<%=($this->Parent->ActiveStepIndex === 2) ? 'active' : (($this->Parent->ActiveStepIndex === 3) ? 'prev-active' : 'normal')%>">
22 <div><com:TTranslate Text="Files" /></div>
24 <div class="step step-<%=($this->Parent->ActiveStepIndex === 3) ? 'active' : (($this->Parent->ActiveStepIndex === 4) ? 'prev-active' : 'normal')%>">
25 <div><com:TTranslate Text="Where" /></div>
27 <div class="step step-<%=($this->Parent->ActiveStepIndex === 4) ? 'active' : (($this->Parent->ActiveStepIndex === 5) ? 'prev-active' : 'normal')%>">
28 <div><com:TTranslate Text="Options" /></div>
30 <div class="step step-<%=($this->Parent->ActiveStepIndex === 5) ? 'last-active' : (($this->Parent->ActiveStepIndex === 6) ? 'last-prev-active' : 'last')%>">
31 <div><com:TTranslate Text="Run" /></div>
33 <div id="title"><%=$this->Parent->ActiveStep->Title%><div>
35 </prop:HeaderTemplate>
36 <prop:StartNavigationTemplate>
37 <div class="button-cancel"><com:BButton CommandName="Cancel" Text="<%[ Cancel ]%>" /></div>
38 <div class="button-prev-next"><com:BButton CommandName="NextStep" Text="<%[ Next » ]%>" /></div>
39 </prop:StartNavigationTemplate>
41 <prop:StepNavigationTemplate>
42 <div class="button-cancel"><com:BButton CommandName="Cancel" Text="<%[ Cancel ]%>" /></div>
43 <div class="button-prev-next">
44 <com:BButton CausesValidation="False" CssClass="bbutton" CommandName="PreviousStep" Text="<%[ « Previous ]%>" />
45 <com:BButton ID="NextButton" CommandName="NextStep" Text="<%[ Next » ]%>" Visible="<%=($this->getPage()->RestoreWizard->ActiveStepIndex != 1 || ($this->getPage()->RestoreWizard->ActiveStepIndex == 1 && $this->getPage()->BackupToRestore->ItemCount > 0))%>" />
47 </prop:StepNavigationTemplate>
49 <prop:FinishNavigationTemplate>
50 <div class="button-cancel"><com:BButton CommandName="Cancel" Text="<%[ Cancel ]%>" /></div>
51 <div class="button-prev-next">
52 <com:BButton CausesValidation="False" CssClass="bbutton" CommandName="PreviousStep" Text="<%[ « Previous ]%>" />
53 <com:BButton CommandName="Complete" Text="<%[ Run restore ]%>" />
55 </prop:FinishNavigationTemplate>
56 <com:TWizardStep ID="Step1" Title="<%[ Step 1 - select source backup client ]%>" StepType="Auto">
58 <div class="text"><com:TLabel ForControl="BackupClientName" Text="<%[ Backup from client: ]%>" /></div>
60 <com:TActiveDropDownList ID="BackupClientName" CssClass="textbox" Width="350px" OnLoad="setBackupClients" OnTextChanged="setJobs" CausesValidation="false" />
61 <com:TCompareValidator CssClass="validator" Display="Dynamic" ControlToValidate="BackupClientName" DataType="String" ValueToCompare="none" Operator="NotEqual" Text="<%[ Please select language. ]%>" />
65 <com:TWizardStep ID="Step2" Title="<%[ Step 2 - select backup to restore ]%>" StepType="Auto">
66 <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->BackupToRestore->ItemCount == 0 && $this->GroupBackupToRestore->ItemCount == 0)%>"/>
67 <div class="line" style="margin-top: 15px">
68 <div class="text"><com:TLabel Text="<%[ Backup selection method: ]%>" /></div>
70 <com:TActiveRadioButton ID="OnlySelectedBackupSelection" GroupName="BackupSelection" Checked="true" OnCheckedChanged="setBackupSelection" /> <com:TLabel ForControl="OnlySelectedBackupSelection" Text="<%[ Only selected backup ]%>" />
71 <com:TActiveRadioButton ID="GroupBackupSelection" GroupName="BackupSelection" OnCheckedChanged="setBackupSelection" /> <com:TLabel ForControl="GroupBackupSelection" Text="<%[ Group most recent backups ]%>" /></div>
73 <com:TActivePanel ID="BackupToRestoreField">
75 <div class="text"><com:TLabel ForControl="BackupToRestore" Text="<%[ Backup for restore: ]%>" /></div>
77 <com:TActiveDropDownList ID="BackupToRestore" CssClass="textbox" Width="350px" CausesValidation="false" OnTextChanged="resetFileBrowser" />
81 <com:TActivePanel ID="GroupBackupToRestoreField" Display="None">
83 <div class="text"><com:TLabel ForControl="GroupBackupToRestore" Text="<%[ Backup for restore: ]%>" /></div>
85 <com:TActiveDropDownList ID="GroupBackupToRestore" CssClass="textbox" Width="350px" CausesValidation="false" />
89 <div class="text"><com:TLabel ForControl="GroupBackupFileSet" Text="<%[ FileSet resource: ]%>" /></div>
91 <com:TActiveDropDownList ID="GroupBackupFileSet" CssClass="textbox" Width="350px" CausesValidation="false" />
95 <div class="text"><com:TLabel ForControl="GroupBackupStorage" Text="<%[ Storage resource: ]%>" /></div>
97 <com:TActiveDropDownList ID="GroupBackupStorage" OnInit="setStorage" CssClass="textbox" Width="350px" CausesValidation="false" />
101 <div class="text"><com:TLabel ForControl="GroupBackupPool" Text="<%[ Pool resource: ]%>" /></div>
103 <com:TActiveDropDownList ID="GroupBackupPool" OnInit="setPool" CssClass="textbox" Width="350px" CausesValidation="false" />
108 <com:TWizardStep ID="Step3" Title="<%[ Step 3 - select files to restore ]%>" StepType="Auto">
109 <table id="restore-browser">
112 <div id="restore-browser-files-loading" style="display: none"></div>
113 <div id="restore-browser-files">
116 AutoGenerateColumns="false"
118 HeaderStyle.CssClass="file-browser-header"
119 CssClass="file-browser-detail"
120 ItemStyle.CssClass="file-browser-element"
121 DataKeyField="fileid">
123 <div class="file-browser-watermark" style="padding: 150px 10px">
124 <%[ It seems that there is no files for choosing or file records in database for this job has been purged (file retention period expired) ]%>
126 </prop:EmptyTemplate>
127 <com:TActiveTemplateColumn ID="PathField">
129 <com:TDraggable ID="FileElementLeft" Revert="false" Handle="<%=$this->FileElementLeft->ClientID%>" Ghosting="true" CssClass="draggable">
130 <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']) : '/'%>
131 <com:TActiveLinkButton CssClass="link" Style="float: right;" OnCallback="Page.addFileToRestore" ActiveControl.CallbackParameter="<%=isset($this->getParent()->Data['fileid']) ? $this->getParent()->Data['fileid'] : null%>" ActiveControl.EnableUpdate="false" Visible="<%=!in_array($this->getParent()->Data['name'], $this->getPage()->excludedElementsFromAdd)%>" Text="<%[ Add ]%>" />
133 <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']%>">
134 <prop:ClientSide.OnLoading>
135 $('restore-browser-files-loading').show();
136 </prop:ClientSide.OnLoading>
137 <prop:ClientSide.OnComplete>
138 $('restore-browser-files-loading').hide();
139 </prop:ClientSide.OnComplete>
141 <script type="text/javascript">
142 document.getElementById('<%=$this->FileElementLeft->ClientID%>').addEventListener('mouseup', function(event) {
143 event.findElement('div').setStyle({'position' : 'static', 'top' : '-1px', 'left' : '-1px'});
144 $('<%=$this->FileElementLeft->ClientID%>').setStyle({'position' : 'static', 'top' : '-1px', 'left' : '-1px'});
147 document.getElementById('<%=$this->FileElementLeft->ClientID%>').addEventListener('click', function(event) {
148 var el = event.target || event.srcElement;
149 var vposition = $(el).getStyle('left');
150 if(vposition == null || vposition == '0px'){
153 var request = <%=$this->FileElementCall->ActiveControl->Javascript %>;
159 </com:TActiveTemplateColumn>
160 </com:TActiveDataGrid>
164 <div id="restore-browser-versions">
166 ID="VersionsDataGrid"
168 AutoGenerateColumns="false"
170 CssClass="file-browser-detail"
171 ItemStyle.CssClass="file-browser-element"
172 DataKeyField="fileid"
175 <div class="file-browser-watermark">
176 <%[ For see a file versions please click file on the left files browser. ]%>
178 </prop:EmptyTemplate>
179 <com:TActiveTemplateColumn>
181 <com:TDraggable ID="FileElementToRestore" Revert="false" Handle="<%=$this->FileElementToRestore->ClientID%>" Ghosting="true" CssClass="draggable" Style="float: left">
182 <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file'%>" />
183 <com:TLabel Text="<%=$this->getParent()->Data['name']%>" Width="50%" /> <%=is_array($this->getParent()->Data['lstat']) && array_key_exists('mtime', $this->getParent()->Data['lstat']) ? date("Y-m-d H:i:s", $this->getParent()->Data['lstat']['mtime']) : ''%>
185 <com:TActiveLinkButton CssClass="link" Style="float: right;" OnCallback="Page.addFileToRestore" ActiveControl.CallbackParameter="<%=isset($this->getParent()->Data['fileid']) ? $this->getParent()->Data['fileid'] : false%>" ActiveControl.EnableUpdate="false" Text="<%[ Add ]%>"/>
186 <script type="text/javascript">
187 $('<%=$this->FileElementToRestore->ClientID%>').observe('mouseup', function(event) {
188 event.findElement('div').setStyle({'position' : 'static', 'top' : '0', 'left' : '0'});
189 $('<%=$this->FileElementToRestore->ClientID%>').setStyle({'position' : 'static', 'top' : '0', 'left' : '0'});
193 </com:TActiveTemplateColumn>
194 </com:TActiveDataGrid>
199 <td style="vertical-align: bottom;">
200 <div id="restore-browser-selected">
201 <com:TDropContainer ID="SelectedVersionsDropper" Height="100%" Width="100%"
202 AcceptCssClass="draggable"
203 OnDrop="addFileToRestore"
204 OnCallback="refreshSelectedFiles"
207 ID="SelectedVersionsDataGrid"
209 AutoGenerateColumns="false"
211 CssClass="file-browser-detail"
212 ItemStyle.CssClass="file-browser-element"
213 DataKeyField="fileid"
216 <div class="file-browser-watermark" style="padding: 50px 10px">
217 <%[ 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 ]%>
219 </prop:EmptyTemplate>
220 <com:TActiveTemplateColumn>
222 <com:TPanel ID="FileElement" Style="clear: both">
223 <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'] : ''%>"/>
224 <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file'%>" />
225 <com:TLabel Text="<%=$this->getParent()->Data['name']%>" /> <%=is_array($this->getParent()->Data['lstat']) && array_key_exists('mtime', $this->getParent()->Data['lstat']) ? date("Y-m-d H:i:s", $this->getParent()->Data['lstat']['mtime']) : ''%>
228 </com:TActiveTemplateColumn>
229 </com:TActiveDataGrid>
230 </com:TDropContainer>
236 <com:TWizardStep ID="Step4" Title="<%[ Step 4 - select destination for restore ]%>" StepType="Auto">
238 <div class="text"><com:TLabel ForControl="RestoreClient" Text="<%[ Restore to client: ]%>" /></div>
240 <com:TActiveDropDownList ID="RestoreClient" CssClass="textbox" OnLoad="setRestoreClients" CausesValidation="false" />
244 <div class="text"><com:TLabel ForControl="RestorePath" Text="<%[ Restore to directory: ]%>" /></div>
245 <div class="field"><com:TTextBox ID="RestorePath" CssClass="textbox" Width="350px" Text="/tmp/restore" /></div>
248 <com:TWizardStep ID="Step5" Title="<%[ Step 5 - options for restore ]%>" StepType="Auto">
250 <div class="text"><com:TLabel ForControl="ReplaceFiles" Text="<%[ Replace files: ]%>" /></div>
252 <com:TDropDownList ID="ReplaceFiles" CssClass="textbox" Width="350px" OnLoad="setRestoreClients" CausesValidation="false">
253 <com:TListItem Value="never" Text="<%[ do not replace files ]%>" />
254 <com:TListItem Value="ifolder" Text="<%[ if files from restore are older]%>" />
255 <com:TListItem Value="ifnewer" Text="<%[ if files from restore are newer]%>" />
256 <com:TListItem Value="always" Text="<%[ always replace files ]%>" />
261 <div class="text"><com:TLabel ForControl="RestoreJobPriority" Text="<%[ Restore job priority: ]%>" /></div>
263 <com:TTextBox ID="RestoreJobPriority" CssClass="textbox" CausesValidation="false" Width="60px" MaxLength="5" Text="10" />
267 <com:TWizardStep ID="Step6" Title="<%[ Step 6 - Finish ]%>" StepType="Finish">
269 <legend><%[ Source parameters ]%></legend>
271 <div class="text"><%[ Backup data from client: ]%></div>
272 <div class="field bold"><%=$this->getModule('api')->get(array('clients', $this->BackupClientName->SelectedValue))->output->name%></div>
275 <div class="text"><%[ Backup selection method: ]%></div>
276 <div class="field bold">
277 <com:TLabel Text="<%[ Only selected backup ]%>" Visible="<%=$this->OnlySelectedBackupSelection->Checked%>" />
278 <com:TLabel Text="<%[ Group most recent backups ]%>" Visible="<%=$this->GroupBackupSelection->Checked%>" />
282 <div class="text"><%[ Backup for restore: ]%></div>
283 <div class="field bold">
284 <com:TLabel Text="<%=@$this->getModule('api')->get(array('jobs', $this->BackupToRestore->SelectedValue))->output->job%>" Visible="<%=$this->OnlySelectedBackupSelection->Checked%>" />
285 <com:TLabel Text="<%=$this->GroupBackupToRestore->SelectedValue%>" Visible="<%=$this->GroupBackupSelection->Checked%>" />
288 <com:TPanel Visible="<%=$this->GroupBackupSelection->Checked%>">
290 <div class="text"><%[ FileSet for restore: ]%></div>
291 <div class="field bold"><%=$this->GroupBackupFileSet->SelectedValue%></div>
296 <legend><%[ Files for restore ]%></legend>
298 <div class="text"><%[ Selected directories count: ]%></div>
299 <div class="field bold"><%=isset($this->getRestoreElements(true)->dirid) ? count($this->getRestoreElements(true)->dirid) : '0'%></div>
302 <div class="text"><%[ Selected files count: ]%></div>
303 <div class="field bold"><%=isset($this->getRestoreElements(true)->fileid) ? count($this->getRestoreElements(true)->fileid) : '0'%></div>
307 <legend><%[ Destination parameters ]%></legend>
309 <div class="text"><%[ Restore to client: ]%></div>
310 <div class="field bold"><%=$this->getModule('api')->get(array('clients', $this->RestoreClient->SelectedValue))->output->name%></div>
313 <div class="text"><%[ Restore to path: ]%></div>
314 <div class="field bold"><%=$this->RestorePath->Text%></div>
318 <legend><%[ Restore job options ]%></legend>
320 <div class="text"><%[ Replace files: ]%></div>
321 <div class="field bold">
322 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'never'%>" Text="<%[ do not replace files ]%>"/>
323 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'ifolder'%>" Text="<%[ if files from restore are older]%>"/>
324 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'ifnewer'%>" Text="<%[ if files from restore are newer]%>"/>
325 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'always'%>" Text="<%[ always replace files ]%>"/>
329 <div class="text"><%[ Restore job priority: ]%></div>
330 <div class="field bold"><%=$this->RestoreJobPriority->Text%></div>