/** * 检查目录是否存在 * @return Int * @author weizhifeng **/ protected function dir_exist() { //对当前的目录进行检查 if (isset($this->post['dir_id'])) { $folder_id = (int) $this->post['dir_id']; } else { //检查站点有没有根目录,如没有则添加 $check_count = $this->kc_folder->count(array('where' => array('site_id' => 1, 'level_depth' => 1))); if ($check_count <= 0) { $root_folder = array('site_id' => 1, 'parent_id' => '0', 'sub_folder_ids' => '', 'name' => 'image', 'level_depth' => 1, 'date_add' => date('Y-m-d H:i:s'), 'date_upd' => date('Y-m-d H:i:s')); $folder_id = $this->kc_folder->create($root_folder); } else { $root_folder = $this->kc_folder->lists(array('where' => array('site_id' => 1, 'level_depth' => 1))); $folder_id = $root_folder[0]['id']; } } // 检查目录是否存在 $folder = $this->kc_folder->get($folder_id); if ($folder['id'] == 0) { $this->error_msg(Kohana::lang('o_kc.folder_not_exist')); } else { return $folder_id; } }
<?php $min_width = 250; foreach ($statuses as $status) { $min_width += 100; } $min_width = max(960, $min_width); $header = array('project' => $project, 'report' => $report, 'meta' => $report_obj->get_meta(), 'min_width' => $min_width, 'css' => array('styles/reset.css' => 'all', 'styles/view.css' => 'all', 'styles/print.css' => 'print'), 'js' => array('js/jquery.js', 'js/highcharts.js')); $GI->load->view('report_plugins/layout/header', $header); ?> <?php $stats = obj::create(); $stats->passed_count = 0; $stats->retest_count = 0; $stats->failed_count = 0; $stats->untested_count = 0; $stats->blocked_count = 0; $stats->custom_status1_count = 0; $stats->custom_status2_count = 0; $stats->custom_status3_count = 0; $stats->custom_status4_count = 0; $stats->custom_status5_count = 0; $stats->custom_status6_count = 0; $stats->custom_status7_count = 0; foreach ($runs as $r) { $stats->passed_count += $r->passed_count; $stats->retest_count += $r->retest_count; $stats->failed_count += $r->failed_count; $stats->untested_count += $r->untested_count; $stats->blocked_count += $r->blocked_count;