]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/baculum/protected/Portlets/JobList.tpl
baculum: Switch to started job status just after job start
[bacula/bacula] / gui / baculum / protected / Portlets / JobList.tpl
index 0a9e4f3cb196274764fd23ef6e0a9cf4e478f35a..e79d97f9ff214511b89c272d4a2b9cd413fd5829 100644 (file)
 <%@ MasterClass="Application.Portlets.SlideWindow" %>
 <com:TContent ID="SlideWindowContent">
-       <com:TActivePanel ID="RepeaterShow">
-       <com:TActiveRepeater ID="Repeater">
+       <com:TActivePanel ID="RepeaterShow" EnableViewState="false">
+       <com:TActiveRepeater ID="Repeater" EnableViewState="false">
                <prop:ItemTemplate>
                        <com:TPanel ID="JobElement" CssClass="slide-window-element">
                                <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/job-icon.png" alt="" /> [<%=@$this->DataItem->jobid%>] <%=@$this->DataItem->name%>
+                               <input type="hidden" name="<%=$this->ClientID%>" value="<%=isset($this->DataItem->jobid) ? $this->DataItem->jobid : ''%>" />
                        </com:TPanel>
-                       <com:TCallback ID="JobElementCall" OnCallback="Page.JobWindow.configure" ActiveControl.CallbackParameter="<%=@$this->DataItem->jobid%>">
-                               <prop:ClientSide.OnComplete>
-                                       ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>.show();
-                                       ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>.progress(false);
-                                       if(<%=$this->getPage()->JobWindow->ShowID%>SlideWindow.isFullSize()) {
-                                               <%=$this->getPage()->JobWindow->ShowID%>SlideWindow.resetSize();
-                                       }
-                               </prop:ClientSide.OnComplete>
-                       </com:TCallback>
-                       <script type="text/javascript">
-                               $('<%=$this->JobElement->ClientID%>').observe('click', function() {
-                                       var request = <%= $this->JobElementCall->ActiveControl->Javascript %>;
-                                       if(ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>.is_progress() == false) {
-                                               ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>.progress(true);
-                                               request.dispatch();
-                                       }
-                               });
-                       </script>
                </prop:ItemTemplate>
        </com:TActiveRepeater>
        </com:TActivePanel>
        <com:TActivePanel ID="DataGridShow">
        <com:TActiveDataGrid
                ID="DataGrid"
+               EnableViewState="false"
                AutoGenerateColumns="false"
-               AllowSorting="true"
+               AllowSorting="false"
                OnSortCommand="sortDataGrid"
                CellPadding="5px"
                CssClass="window-section-detail"
                ItemStyle.CssClass="slide-window-element"
                AlternatingItemStyle.CssClass="slide-window-element-alternating"
        >
+               <com:TActiveTemplateColumn HeaderText="<input type='checkbox' name='actions_checkbox' onclick=SlideWindow.getObj('JobWindow').markAllChecked(this.checked)>" ItemStyle.HorizontalAlign="Center">
+                       <prop:ItemTemplate>
+                               <input type="checkbox" name="actions_checkbox" value="<%=$this->getParent()->Data['jobid']%>" id="<%=$this->getPage()->JobWindow->CheckedValues->ClientID%><%=$this->getParent()->Data['jobid']%>" rel="<%=$this->getPage()->JobWindow->CheckedValues->ClientID%>" onclick="SlideWindow.getObj('JobWindow').markChecked(this.getAttribute('rel'), this.checked, this.value, true);" />
+                       </prop:ItemTemplate>
+                </com:TActiveTemplateColumn>
                <com:TActiveBoundColumn
                        SortExpression="jobid"
                        HeaderText="ID"
                        DataField="jobid"
                        ItemStyle.HorizontalAlign="Center"
                />
-               <com:TActiveTemplateColumn HeaderText="Job name" SortExpression="name">
+               <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>
-                                               ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>.show();
-                                               ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>.progress(false);
-                                               if(<%=$this->getPage()->JobWindow->ShowID%>SlideWindow.isFullSize()) {
-                                                       <%=$this->getPage()->JobWindow->ShowID%>SlideWindow.resetSize();
-                                               }
-                                       </prop:ClientSide.OnComplete>
-                               </com:TCallback>
-                               <script type="text/javascript">
-                                       $('<%=$this->JobTableElement->ClientID%>').up('tr').observe('click', function() {
-                                               var request = <%= $this->JobTableElementCall->ActiveControl->Javascript %>;
-                                               if(ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>.is_progress() == false) {
-                                                       ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>.progress(true);
-                                                       request.dispatch();
-                                               }
-                                       });
-                               </script>
+                               <div title="<%=$this->getParent()->Data['name']%>"><%=$this->getPage()->JobWindow->formatJobName($this->getParent()->Data['name'])%></div>
+                                <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->Data['jobid']%>" />
                        </prop:ItemTemplate>
                </com:TActiveTemplateColumn>
-               <com:TActiveTemplateColumn ItemTemplate="<%=$this->getPage()->JobWindow->getJobType($this->getParent()->Data['type'])%>" SortExpression="type">
+               <com:TActiveTemplateColumn ItemTemplate="<%=isset($this->getPage()->JobWindow->jobTypes[$this->getParent()->Data['type']]) ? $this->getPage()->JobWindow->jobTypes[$this->getParent()->Data['type']] : ''%>" SortExpression="type">
                        <prop:HeaderText>
-                               <span title="Type" style="cursor: help">T</span>
+                               <span title="<%=Prado::localize('Type')%>" style="cursor: help">T</span>
                        </prop:HeaderText>
                </com:TActiveTemplateColumn>
-               <com:TActiveTemplateColumn ItemTemplate="<%=array_key_exists($this->getParent()->Data['level'], $this->getPage()->JobWindow->jobLevels) ? mb_substr($this->getPage()->JobWindow->jobLevels[$this->getParent()->Data['level']], 0, 4) : ''%>" SortExpression="level">
+               <com:TActiveTemplateColumn ItemTemplate="<%=array_key_exists($this->getParent()->Data['level'], $this->getPage()->JobWindow->jobLevels) ? $this->getPage()->JobWindow->jobLevels[$this->getParent()->Data['level']] : ''%>" SortExpression="level">
                        <prop:HeaderText>
-                               <span title="Level" style="cursor: help">L</span>
+                               <span title="<%=Prado::localize('Level')%>" style="cursor: help">L</span>
                        </prop:HeaderText>
                </com:TActiveTemplateColumn>
-               <com:TActiveTemplateColumn HeaderText="Job status" SortExpression="jobstatus">
+               <com:TActiveTemplateColumn HeaderText="<%[ Job status ]%>" SortExpression="jobstatus">
                        <prop:ItemTemplate>
-                               <div class="job-status-<%=$this->getParent()->Data['jobstatus']%>" title="<%=isset($this->getPage()->JobWindow->getJobState($this->getParent()->Data['jobstatus'])->description) ? $this->getPage()->JobWindow->getJobState($this->getParent()->Data['jobstatus'])->description : ''%>"><%=isset($this->getPage()->JobWindow->getJobState($this->getParent()->Data['jobstatus'])->value) ? $this->getPage()->JobWindow->getJobState($this->getParent()->Data['jobstatus'])->value : ''%></div>
+                               <div class="job-status-<%=isset($this->getParent()->Data['jobstatus']) ? $this->getParent()->Data['jobstatus'] : ''%>" title="<%=isset($this->getPage()->JobWindow->jobStates[$this->getParent()->Data['jobstatus']]['description']) ? $this->getPage()->JobWindow->jobStates[$this->getParent()->Data['jobstatus']]['description'] : ''%>"><%=isset($this->getPage()->JobWindow->jobStates[$this->getParent()->Data['jobstatus']]['value']) ? $this->getPage()->JobWindow->jobStates[$this->getParent()->Data['jobstatus']]['value'] : ''%></div>
+                       </prop:ItemTemplate>
+               </com:TActiveTemplateColumn>
+               <com:TActiveTemplateColumn HeaderText="<%[ Size ]%>" SortExpression="jobbytes">
+                       <prop:ItemTemplate>
+                               <div class="size" rel="<%=$this->getParent()->Data['jobbytes']%>"><%=$this->getParent()->Data['jobbytes']%></div>
+                       </prop:ItemTemplate>
+               </com:TActiveTemplateColumn>
+               <com:TActiveBoundColumn SortExpression="jobfiles" HeaderText="<%[ Files ]%>" DataField="jobfiles" />
+               <com:TActiveTemplateColumn HeaderText="<%[ End time ]%>" SortExpression="endtime">
+                       <prop:ItemTemplate>
+                               <%=$this->getParent()->Data['endtime']%>
+                               <%=in_array($this->getParent()->Data['jobstatus'], $this->getPage()->JobWindow->runningJobStates) ? '<img src="' . $this->getPage()->getTheme()->getBaseUrl() . '/loader-alter.gif" />' : ''%>
                        </prop:ItemTemplate>
                </com:TActiveTemplateColumn>
-               <com:TActiveBoundColumn
-                       SortExpression="endtime"
-                       HeaderText="End time"
-                       DataField="endtime"
-               />
        </com:TActiveDataGrid>
+       <com:TActiveHiddenField ID="CheckedValues" />
        </com:TActivePanel>
+       <com:TCallback ID="DataElementCall" OnCallback="Page.JobWindow.configure">
+               <prop:ClientSide.OnComplete>
+                       ConfigurationWindow.getObj('JobWindow').show();
+                       ConfigurationWindow.getObj('JobWindow').progress(false);
+                       status_callback_func();
+               </prop:ClientSide.OnComplete>
+       </com:TCallback>
+       <com:TCallback ID="RunJobCall" OnCallback="Page.JobWindow.run_again">
+               <prop:ClientSide.OnLoading>
+                       ConfigurationWindow.getObj('JobWindow').progress(true);
+                       var img_btn = $('run_job_again_btn');
+                       var img_src_path = img_btn.readAttribute('src').replace(/[^\/]+\S$/, '');
+                       img_btn.writeAttribute('disabled', 'disabled');
+                       img_btn.writeAttribute('src', img_src_path + 'loader.gif');
+               </prop:ClientSide.OnLoading>
+               <prop:ClientSide.OnComplete>
+                       var img_btn = $('run_job_again_btn');
+                       var img_src_path = img_btn.readAttribute('src').replace(/[^\/]+\S$/, '');
+                       img_btn.writeAttribute('src', img_src_path + 'play.png');
+                       img_btn.removeAttribute('disabled');
+                       ConfigurationWindow.getObj('JobWindow').progress(false);
+                       ConfigurationWindow.getObj('JobWindow').show();
+                       ConfigurationWindow.getObj('JobWindow').switchTabByNo(2);
+                       status_callback_func();
+                       oMonitor();
+               </prop:ClientSide.OnComplete>
+       </com:TCallback>
+       <div class="actions_btn" style="display: none">
+               <input type="image" id="run_job_again_btn" title="<%[ Run job again ]%>" src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/play.png" onclick="return false" />
+       </div>
 </com:TContent>