class ClientConfiguration extends Portlets {
- public function onInit($param) {
- parent::onInit($param);
- $this->Status->setActionClass($this);
- }
-
public function configure($clientId) {
$clientdata = $this->Application->getModule('api')->get(array('clients', 'show', $clientId))->output;
$this->ShowClient->Text = implode(PHP_EOL, $clientdata);
public function openJob($sender, $param) {
$jobid = $param->CallbackParameter;
- $this->getPage()->JobConfiguration->configure($jobid);
+ $params = array(
+ 'prev_window' => 'ClientWindow'
+ );
+ $this->getPage()->JobConfiguration->configure($jobid, $params);
}
}
?>
public $verifyOptions = array('jobname' => 'Verify by Job Name', 'jobid' => 'Verify by JobId');
- public function configure($jobId, $params = array()) {
- $jobdata = $this->Application->getModule('api')->get(array('jobs', $jobId))->output;
+ public function configure($jobid, $params = array()) {
+ $jobdata = $this->Application->getModule('api')->get(array('jobs', $jobid))->output;
$this->JobName->Text = $jobdata->job;
$this->JobID->Text = $jobdata->jobid;
$joblog = $this->Application->getModule('api')->get(array('joblog', $jobdata->jobid))->output;
- $runningJobStates = $this->Application->getModule('misc')->getRunningJobStates();
- if (in_array($jobdata->jobstatus, $runningJobStates)) {
+ $running_job_states = $this->Application->getModule('misc')->getRunningJobStates();
+ if (in_array($jobdata->jobstatus, $running_job_states)) {
$this->Estimation->CssClass = 'textbox-auto wheel-loader';
} else {
$this->Estimation->CssClass = 'textbox-auto';
}
$this->Storage->dataBind();
- $runningJobStates = $this->Application->getModule('misc')->getRunningJobStates();
- $isJobRunning = in_array($jobdata->jobstatus, $runningJobStates);
+ $isJobRunning = in_array($jobdata->jobstatus, $running_job_states);
$this->Priority->Text = ($jobdata->priorjobid == 0) ? self::DEFAULT_JOB_PRIORITY : $jobdata->priorjobid;
$this->DeleteButton->Visible = true;
$this->Run->Display = 'Dynamic';
$this->EstimateLine->Display = 'Dynamic';
$this->Status->Visible = true;
+ if (key_exists('prev_window', $params)) {
+ $this->GoBack->Value = $params['prev_window'];
+ $this->getPage()->getCallbackClient()->show('job_go_back');
+ } else {
+
+ $this->getPage()->getCallbackClient()->hide('job_go_back');
+ }
}
public function status($sender, $param) {
$jobdata = $this->Application->getModule('api')->get(array('jobs', $this->JobID->Text))->output;
- $runningJobStates = $this->Application->getModule('misc')->getRunningJobStates();
- if (in_array($jobdata->jobstatus, $runningJobStates)) {
+ $running_job_states = $this->Application->getModule('misc')->getRunningJobStates();
+ if (in_array($jobdata->jobstatus, $running_job_states)) {
$this->RefreshStart->Value = true;
} else {
$this->RefreshStart->Value = false;
<com:TContent ID="ConfigurationWindowContent">
<com:TActivePanel DefaultButton="Run">
<h4><%[ Job: ]%> [ <com:TActiveLabel ID="JobID" /> ] <com:TActiveLabel ID="JobName" Style="word-break: break-all;" /></h4>
+ <com:TActiveHiddenField ID="GoBack" />
+ <script type="text/javascript">
+ var job_go_back = function() {
+ var prev_window = document.getElementById('<%=$this->GoBack->ClientID%>').value;
+ if (prev_window) {
+ ConfigurationWindow.getObj(prev_window).show();
+ }
+ };
+ </script>
+ <a id="job_go_back" href="javascript:void(0)" onclick="job_go_back()" style="display: none"><strong>« <%[ Go back ]%></strong></a>
<span class="text tab tab_active" rel="job_actions_tab"><%[ Actions ]%></span>
<span class="text tab" rel="job_console_tab"><%[ Console status ]%></span>
<hr class="tabs" />