1 <%@ MasterClass="Application.Web.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" />
96 <com:TWizardStep ID="Step3" Title="<%[ Step 3 - select files to restore ]%>" StepType="Auto">
97 <table id="restore-browser">
100 <div id="restore-browser-files-loading" style="display: none"></div>
101 <div id="restore-browser-files">
104 AutoGenerateColumns="false"
106 HeaderStyle.CssClass="file-browser-header"
107 CssClass="file-browser-detail"
108 ItemStyle.CssClass="file-browser-element"
109 DataKeyField="fileid">
111 <div class="file-browser-watermark" style="padding: 150px 10px">
112 <%[ It seems that there is no files for choosing or file records in database for this job has been purged (file retention period expired) ]%>
114 </prop:EmptyTemplate>
115 <com:TActiveTemplateColumn ID="PathField">
117 <com:TDraggable ID="FileElementLeft" Revert="false" Handle="<%=$this->FileElementLeft->ClientID%>" Ghosting="true" CssClass="draggable">
118 <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']) : '/'%>
119 <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()->excluded_elements_from_add)%>" Text="<%[ Add ]%>" />
121 <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']%>">
122 <prop:ClientSide.OnLoading>
123 document.getElementById('restore-browser-files-loading').style.display = 'block';
124 </prop:ClientSide.OnLoading>
125 <prop:ClientSide.OnComplete>
126 document.getElementById('restore-browser-files-loading').style.display = 'none';
127 </prop:ClientSide.OnComplete>
129 <script type="text/javascript">
130 document.getElementById('<%=$this->FileElementLeft->ClientID%>').addEventListener('mouseup', function(event) {
131 var el = event.target || event.srcElement;
133 el.style.position = 'static';
134 el.style.top = '-1px';
135 el.style.left = '-1px';
137 var fel = document.getElementById('<%=$this->FileElementLeft->ClientID%>');
138 fel.style.position = 'static';
139 fel.style.top = '-1px';
140 fel.style.left = '-1px';
143 document.getElementById('<%=$this->FileElementLeft->ClientID%>').addEventListener('click', function(event) {
144 var el = event.target || event.srcElement;
145 var vposition = el.style.left;
146 if(vposition == null || vposition == '0px'){
149 var request = <%=$this->FileElementCall->ActiveControl->Javascript %>;
155 </com:TActiveTemplateColumn>
156 </com:TActiveDataGrid>
160 <div id="restore-browser-versions">
162 ID="VersionsDataGrid"
164 AutoGenerateColumns="false"
166 CssClass="file-browser-detail"
167 ItemStyle.CssClass="file-browser-element"
168 DataKeyField="fileid"
171 <div class="file-browser-watermark">
172 <%[ For see a file versions please click file on the left files browser. ]%>
174 </prop:EmptyTemplate>
175 <com:TActiveTemplateColumn>
177 <com:TDraggable ID="FileElementToRestore" Revert="false" Handle="<%=$this->FileElementToRestore->ClientID%>" Ghosting="true" CssClass="draggable" Style="float: left">
178 <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file'%>" />
179 <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']) : ''%>
181 <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 ]%>"/>
182 <script type="text/javascript">
183 $('#<%=$this->FileElementToRestore->ClientID%>').on('mouseup', function(event) {
184 var el = event.target || event.srcElement;
186 el.style.position = 'static';
190 var fetr = document.getElementById('<%=$this->FileElementToRestore->ClientID%>');
191 fetr.style.position = 'static';
197 </com:TActiveTemplateColumn>
198 </com:TActiveDataGrid>
203 <td style="vertical-align: bottom;">
204 <div id="restore-browser-selected">
205 <com:TDropContainer ID="SelectedVersionsDropper" Height="100%" Width="100%"
206 AcceptCssClass="draggable"
207 OnDrop="addFileToRestore"
208 OnCallback="refreshSelectedFiles"
211 ID="SelectedVersionsDataGrid"
213 AutoGenerateColumns="false"
215 CssClass="file-browser-detail"
216 ItemStyle.CssClass="file-browser-element"
217 DataKeyField="fileid"
220 <div class="file-browser-watermark" style="padding: 50px 10px">
221 <%[ 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 ]%>
223 </prop:EmptyTemplate>
224 <com:TActiveTemplateColumn>
226 <com:TPanel ID="FileElement" Style="clear: both">
227 <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'] : ''%>"/>
228 <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file'%>" />
229 <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']) : ''%>
232 </com:TActiveTemplateColumn>
233 </com:TActiveDataGrid>
234 </com:TDropContainer>
240 <com:TWizardStep ID="Step4" Title="<%[ Step 4 - select destination for restore ]%>" StepType="Auto">
242 <div class="text"><com:TLabel ForControl="RestoreClient" Text="<%[ Restore to client: ]%>" /></div>
244 <com:TActiveDropDownList ID="RestoreClient" CssClass="textbox" OnLoad="setRestoreClients" CausesValidation="false" />
248 <div class="text"><com:TLabel ForControl="RestorePath" Text="<%[ Restore to directory: ]%>" /></div>
249 <div class="field"><com:TTextBox ID="RestorePath" CssClass="textbox" Width="350px" Text="/tmp/restore" /></div>
252 <com:TWizardStep ID="Step5" Title="<%[ Step 5 - options for restore ]%>" StepType="Auto">
254 <div class="text"><com:TLabel ForControl="RestoreJob" Text="<%[ Restore job: ]%>" /></div>
256 <com:TActiveDropDownList ID="RestoreJob" CssClass="textbox" Width="350px" CausesValidation="false" />
260 <div class="text"><com:TLabel ForControl="ReplaceFiles" Text="<%[ Replace files: ]%>" /></div>
262 <com:TDropDownList ID="ReplaceFiles" CssClass="textbox" Width="350px" CausesValidation="false">
263 <com:TListItem Value="never" Text="<%[ do not replace files ]%>" />
264 <com:TListItem Value="ifolder" Text="<%[ if files from restore are older]%>" />
265 <com:TListItem Value="ifnewer" Text="<%[ if files from restore are newer]%>" />
266 <com:TListItem Value="always" Text="<%[ always replace files ]%>" />
271 <div class="text"><com:TLabel ForControl="RestoreJobPriority" Text="<%[ Restore job priority: ]%>" /></div>
273 <com:TTextBox ID="RestoreJobPriority" CssClass="textbox" CausesValidation="false" Width="60px" MaxLength="5" Text="10" />
277 <com:TWizardStep ID="Step6" Title="<%[ Step 6 - Finish ]%>" StepType="Finish">
279 <legend><%[ Source parameters ]%></legend>
281 <div class="text"><%[ Backup data from client: ]%></div>
282 <div class="field bold"><%=$this->BackupClientName->SelectedValue%></div>
285 <div class="text"><%[ Backup selection method: ]%></div>
286 <div class="field bold">
287 <com:TLabel Text="<%[ Only selected backup ]%>" Visible="<%=$this->OnlySelectedBackupSelection->Checked%>" />
288 <com:TLabel Text="<%[ Group most recent backups ]%>" Visible="<%=$this->GroupBackupSelection->Checked%>" />
292 <div class="text"><%[ Backup for restore: ]%></div>
293 <div class="field bold">
294 <com:TLabel Text="<%=@$this->getModule('api')->get(array('jobs', $this->BackupToRestore->SelectedValue))->output->job%>" Visible="<%=$this->OnlySelectedBackupSelection->Checked%>" />
295 <com:TLabel Text="<%=$this->GroupBackupToRestore->SelectedValue%>" Visible="<%=$this->GroupBackupSelection->Checked%>" />
298 <com:TPanel Visible="<%=$this->GroupBackupSelection->Checked%>">
300 <div class="text"><%[ FileSet for restore: ]%></div>
301 <div class="field bold"><%=$this->GroupBackupFileSet->SelectedValue%></div>
306 <legend><%[ Files for restore ]%></legend>
308 <div class="text"><%[ Selected directories count: ]%></div>
309 <div class="field bold"><%=isset($this->getRestoreElements(true)->dirid) ? count($this->getRestoreElements(true)->dirid) : '0'%></div>
312 <div class="text"><%[ Selected files count: ]%></div>
313 <div class="field bold"><%=isset($this->getRestoreElements(true)->fileid) ? count($this->getRestoreElements(true)->fileid) : '0'%></div>
317 <legend><%[ Destination parameters ]%></legend>
319 <div class="text"><%[ Restore to client: ]%></div>
320 <div class="field bold"><%=$this->RestoreClient->SelectedValue%></div>
323 <div class="text"><%[ Restore to path: ]%></div>
324 <div class="field bold"><%=$this->RestorePath->Text%></div>
328 <legend><%[ Restore job options ]%></legend>
330 <div class="text"><%[ Restore job: ]%></div>
331 <div class="field bold"><%=$this->RestoreJob->Text%></div>
334 <div class="text"><%[ Replace files: ]%></div>
335 <div class="field bold">
336 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'never'%>" Text="<%[ do not replace files ]%>"/>
337 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'ifolder'%>" Text="<%[ if files from restore are older]%>"/>
338 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'ifnewer'%>" Text="<%[ if files from restore are newer]%>"/>
339 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'always'%>" Text="<%[ always replace files ]%>"/>
343 <div class="text"><%[ Restore job priority: ]%></div>
344 <div class="field bold"><%=$this->RestoreJobPriority->Text%></div>