Commit b32508a1 authored by Шакарим Сапа's avatar Шакарим Сапа

Merge remote-tracking branch 'origin/master'

parents b06f1b2e 2d5f1eca
......@@ -4,6 +4,7 @@ namespace common\modules\support\controllers;
use Yii;
use yii\filters\AccessControl;
use yii\helpers\ArrayHelper;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
......@@ -47,18 +48,16 @@ class SupportController extends Controller
public function actionIndex()
{
$client = new \Redmine\Client('http://help-russia.ru', Yii::$app->support->identity->redmine_key);
$client = $this->getClient();
$works = $client->issue->all([
'author_id' => 23
$user = $client->user->getCurrentUser();
$models = $client->issue->all([
'author_id' => $user['user']['id'],
]);
return $this->render('index', [
'works' => $works,
// 'ratings' => $ratings,
// 'tests' => $tests,
// 'approves' => $approves,
// 'accepteds' => $accepteds,
'models' => $models,
]);
}
......@@ -77,9 +76,13 @@ class SupportController extends Controller
public function actionView($id)
{
$model = $this->findModel($id);
$client = $this->getClient();
$user = $client->user->getCurrentUser();
$model = $client->issue->show($id);
if($model->author_id != Yii::$app->support->identity->support_id)
if(empty($model['issue']) || $model['issue']['author']['id'] != $user['user']['id'])
{
throw new NotFoundHttpException('Доступ запрещен!');
}
......@@ -89,22 +92,8 @@ class SupportController extends Controller
]);
}
/**
* Finds the Post model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Post the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
protected function getClient()
{
if (($model = Issue::findOne($id)) !== null)
{
return $model;
}
else
{
throw new NotFoundHttpException('The requested page does not exist.');
}
return $client = new \Redmine\Client(Settings::getValue('redmine-url'), Yii::$app->support->identity->redmine_key);
}
}
<?php
namespace common\modules\support\models\redmine;
use common\models\Settings;
class IssueHelper
{
public static function sort($issues)
{
$settings = [
[
'statuses' => explode(',', Settings::getValue('support-status-work')),
'title' => 'Задачи в работе',
],
[
'statuses' => explode(',', Settings::getValue('support-status-new')),
'title' => 'Задачи на оценке',
],
[
'statuses' => explode(',', Settings::getValue('support-status-test')),
'title' => 'Задачи на тестировании',
],
[
'statuses' => explode(',', Settings::getValue('support-status-approve')),
'title' => 'Задачи ожидающие проверки',
],
[
'statuses' => explode(',', Settings::getValue('support-status-accepted')),
'title' => 'Закрытые задачи',
'close' => true
],
];
foreach ($issues as $issue)
{
foreach ($settings as &$setting)
{
if(in_array($issue['status']['id'], $setting['statuses']))
{
$setting['models'][] = $issue;
}
}
}
unset($setting);
return $settings;
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ use yii\helpers\Html;
?>
<?php if($output['issues']) : ?>
<?php if($output) : ?>
<div class="panel-group panel-group-2" id="accordion_2">
<div class="panel panel-default">
......@@ -35,7 +35,7 @@ use yii\helpers\Html;
</div>
<div id="collapse_1" class="panel-collapse collapse in">
<?php foreach ($output['issues'] as $model) : ?>
<?php foreach ($output as $model) : ?>
<div class="panel-body panel-body-ex-1 color_on_cursor gray_box_2">
<table class="w100pr">
<tbody>
......
......@@ -4,6 +4,8 @@ use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\ActiveForm;
use common\modules\support\models\redmine\IssueHelper;
?>
<div class="client_interface">
......@@ -60,14 +62,22 @@ use yii\widgets\ActiveForm;
<table class="table">
<tr>
<td class="no_pad">
<?=$this->render('_loop', ['output' => $ratings, 'title' => 'Задачи на оценке']);?>
<?=$this->render('_loop', ['output' => $works, 'title' => 'Задачи в работе']);?>
<?=$this->render('_loop', ['output' => $tests, 'title' => 'Задачи на тестировании']);?>
<?=$this->render('_loop', ['output' => $approves, 'title' => 'Задачи ожидающие проверки']);?>
<?php
$issues = IssueHelper::sort($models['issues']);
foreach ($issues as $issue)
{
if(!isset($issue['close']))
{
echo $this->render('_loop', ['output' => $issue['models'], 'title' => $issue['title']]);
}
else
{
$accepteds = $issue['models'];
}
}
?>
</td>
</tr>
......@@ -87,7 +97,7 @@ use yii\widgets\ActiveForm;
<input type="checkbox">
</label>
<div class="text-mes">
<p><?=$model->subject?></p>
<p><?=$model['subject']?></p>
</div>
</div>
......
......@@ -14,7 +14,7 @@ class m160304_091243_fix_user_table extends Migration
public function safeDown()
{
$this->renameTable('users', 'redmine_key', 'support_id');
$this->renameColumn('users', 'redmine_key', 'support_id');
$this->renameColumn('users', 'support_id', Schema::TYPE_INTEGER . '(11) DEFAULT NULL');
}
}
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160310_063328_fix_support extends Migration
{
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
$this->insert('settings', [
'module_id' => 'support',
'code' => 'redmine-key',
'name' => 'Redmine Api Key',
'value' => 'bac5a4f334595be4ce4962e6428035041f47f569',
'element' => 'text',
'hidden' => 0,
'description' => 'Redmine Api Key',
]);
$this->insert('settings', [
'module_id' => 'support',
'code' => 'redmine-url',
'name' => 'Redmine Url',
'value' => 'http://help-russia.ru',
'element' => 'text',
'hidden' => 0,
'description' => 'Redmine Url',
]);
}
public function safeDown()
{
$this->delete('settings', ['code' => 'redmine-key']);
$this->delete('settings', ['code' => 'redmine-url']);
}
}
......@@ -945,6 +945,561 @@ pre code {
.keys_test_top {
min-height: 560px;
background: #009A46 url(../images/keys_test_top.png) no-repeat 50% 0%;
width: 100%;
padding-top: 64px;
position: relative;
}
.keys_test_top h1 {
font-size: 36px;
font-family: "RobotoBold";
letter-spacing: 0.7px;
color: #fff;
}
.keys_test_top span {
font-size: 18px;
color: #fff;
line-height: 23px;
letter-spacing: 0.3px;
margin-top: -6px;
display: block;
}
.ks_test_zak_block {
float: right;
margin-top: 14px;
margin-right: 32px;
}
.ks_test_zak_block_title {
font-size: 16px;
display: inline-block;
position: relative;
top: -19px;
right: 19px;
}
.ks_test_zak_block_logo {
display: inline-block;
}
.keys_test_line {
height: 178px;
width: 100%;
background: url(../images/keys_test_line.png) no-repeat top center;
background-size: cover;
-moz-background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
position: absolute;
bottom: 0;
}
a.keys_test_btn {
position: relative;
top: 220px;
z-index: 4;
}
.keys_test_par {
position: relative;
}
.keys_test_mockup1 {
width: 242px;
height: 115px;
position: absolute;
top: 284px;
left: -9px;
background: url(../images/keys_test_mockup1.png) no-repeat;
}
.keys_test_mockup2 {
width: 242px;
height: 145px;
position: absolute;
top: 215px;
left: 28px;
background: url(../images/keys_test_mockup2.png) no-repeat;
}
.keys_test_mockup3 {
width: 244px;
height: 152px;
position: absolute;
top: 139px;
left: 80px;
background: url(../images/keys_test_mockup3.png) no-repeat;
}
.keys_test_note {
width: 648px;
height: 378px;
position: absolute;
top: 47px;
left: 92px;
z-index: 4;
}
.keys_test_note img {
max-width: 100%;
height: auto;
}
.keys_test_hat {
width: 247px;
height: 222px;
position: absolute;
right: 16px;
top: -82px;
}
.e_cat_two_scroll2 {
padding-top: 100px;
}
.e_cat_two_scroll2 h2 {
background-color: #3b994d;
}
.laptop_box {
position: relative;
}
.laptop_box img {
width: 100%;
}
.laptop_box p {
position: absolute;
color: #547f91;
font: 16px/20px 'RobotoRegular', Arial,sans-serif;
}
.laptop_text_poz_1 {
top: 10px;
left: 118px;
}
.laptop_text_poz_2 {
top: 40px;
left: 118px;
}
.laptop_text_poz_3 {
top: 72px;
left: 118px;
}
.laptop_text_poz_4 {
bottom: 8px;
left: 142px;
}
.laptop_text_poz_5 {
bottom: 8px;
left: 390px;
}
.laptop_text_poz_6 {
bottom: 8px;
left: 684px;
}
.keys_testing_box {
position: relative;
background-color: #f3f3f3;
padding: 25px 30px;
padding-bottom: 15px;
color: #2d323a;
font: 18px/24px 'RobotoRegular', Arial,sans-serif;
overflow: hidden;
}
.keys_testing_box h3 {
font: 30px/35px 'RobotoBold', Arial,sans-serif;
margin-bottom: 20px;
}
.keys_testing_box h4 {
font: 20px/25px 'RobotoBold', Arial,sans-serif;
margin-bottom: 12px;
}
.keys_testing_box p {
margin-bottom: 35px;
}
.keys_testing_box_wr {
position: relative;
}
.keys_testing_img {
float: right;
position: absolute;
top: 0;
right: -50px;
}
.zoom_keys_testing_box {
position: relative;
z-index: 2;
font: 17px/21px 'RobotoBold', Arial,sans-serif;
}
.zoom_keys_testing_box p {
font: 17px/21px 'RobotoBold', Arial,sans-serif;
}
.zoom_keys_testing_box span {
display: inline-block;
float: left;
}
.keys_testing_text_arrow {
position: absolute;
top: 130px;
padding-left: 40px;
margin-left: 315px;
padding-top: 90px;
background: url(../images/keys_testing_text_arrow_top.png) 130px 0 no-repeat;
width: 550px;
z-index: 3;
}
.keys_testing_text_arrow:after {
content: '';
display: block;
background: url(../images/keys_testing_text_arrow_bottom.png) 0 0 no-repeat;
width: 47px;
height: 44px;
margin-left: -40px;
}
.keys_testing_text_arrow p {
font: 17px/21px 'RobotoRegular', Arial,sans-serif;
margin-bottom: 7px;
}
.keys_testing_box h5 {
font: 20px/25px 'RobotoBold', Arial,sans-serif;
padding-left: 18px;
background: url(../images/green_ok_icon.png) 0 9px no-repeat;
margin-bottom: 8px;
}
.keys_testing_box h6 {
font: 15px/20px 'RobotoRegular', Arial,sans-serif;
margin-bottom: 15px;
text-align: left;
}
.keys_testing_box_cont p {
font: 14px/20px 'RobotoRegular', Arial,sans-serif;
margin-bottom: 3px;
}
.like_form {
position: relative;
padding: 10px 6px;
background-color: #eaeaea;
margin-bottom: 17px;
}
.like_form:after {
content: '';
display: block;
position: absolute;
right: 0;
top: 0;
height: 100%;
width: 120px;
background: url(../images/like_form_shadow.png) 0 0 no-repeat;
z-index: 1;
}
.like_form>span {
display: block;
background-color: #fff;
border: 1px solid #d7d7d7;
padding: 10px 12px;
font: 12px/12px Arial,sans-serif;
color: #787878;
}
.like_form .red_text {
color: #f35c5c;
}
.keys_testing_box_cont {
border-bottom: 1px solid #d7d7d7;
margin-bottom: 25px;
}
.keys_testing_box_cont:last-child {
border-bottom: none;
}
.keys_testing_box_cont_arrow {
width: 42px;
height: 14px;
position: absolute;
top: -25px;
right: -8px;
background: url(../images/keys_testing_box_cont_arrow.png) 0 0 no-repeat;
z-index: 2;
}
.laptop_box_2 {
padding: 0 30px;
color: #2d323a;
font: 17px/22px 'RobotoRegular', Arial,sans-serif;
margin-bottom: 100px;
}
.laptop_box_2 p {
font: 17px/20px 'RobotoRegular', Arial,sans-serif;
}
.laptop_box_2 h5 {
font: 20px/25px 'RobotoBold', Arial,sans-serif;
margin-bottom: 5px;
}
.laptop_box_2_ins {
position: relative;
margin-top: 60px;
text-align: center;
}
.laptop_2_ins_img_1, .laptop_2_ins_img_2 {
position: absolute;
top: 0;
text-align: left;
-webkit-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
.laptop_2_ins_img_1 img, .laptop_2_ins_img_2 img {
-webkit-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
.laptop_2_ins_img_1 {
left: -45px;
}
.laptop_2_ins_img_2 {
right: -45px;
}
.laptop_2_ins_img_1 img:hover {
-webkit-transform: translate(-25px, -25px);
-ms-transform: translate(-25px, -25px);
-o-transform: translate(-25px, -25px);
transform: translate(-25px, -25px);
}
.laptop_2_ins_img_2 img:hover {
-webkit-transform: translate(25px, -25px);
-ms-transform: translate(25px, -25px);
-o-transform: translate(25px, -25px);
transform: translate(25px, -25px);
}
.laptop_2_ins_cont {
position: relative;
z-index: 2;
margin-top: -160px;
margin-left: 160px;
border-left: 1px solid #000;
padding-left: 15px;
padding-top: 100px;
width: 250px;
}
.laptop_2_ins_img_2 .laptop_2_ins_cont {
margin-left: 90px;
}
@media only screen and (max-width: 992px) {
.laptop_box p {
font-size: 14px;
}
.laptop_text_poz_1 {
top: 5px;
left: 90px;
}
.laptop_text_poz_2 {
top: 29px;
left: 90px;
}
.laptop_text_poz_3 {
top: 53px;
left: 90px;
}
.laptop_text_poz_4 {
bottom: -13px;
left: 15px;
}
.laptop_text_poz_5 {
bottom: -13px;
left: 215px;
}
.laptop_text_poz_6 {
bottom: -13px;
left: 455px;
}
.keys_testing_img {
right: -300px;
}
.keys_testing_text_arrow {
margin-left: 320px;
width: 350px;
}
.keys_testing_text_arrow h4 {
font-size: 16px;
margin-bottom: 5px;
}
.keys_testing_text_arrow p {
font-size: 14px;
}
.laptop_2_ins_img_1 img, .laptop_2_ins_img_2 img {
width: 340px;
height: 270px;
}
.laptop_2_ins_img_1, .laptop_2_ins_img_2 {
margin-top: 50px;
}
.laptop_2_ins_cont {
margin-top: -100px;
padding-top: 110px;
margin-left: 120px;
}
a.keys_test_btn {
display: none;
}
.keys_test_top {
min-height: 590px;
}
}
@media only screen and (max-width: 767px) {
.laptop_box p {
font-size: 12px;
line-height: 14px;
}
.laptop_text_poz_1 {
top: 2px;
left: 53px;
}
.laptop_text_poz_2 {
top: 15px;
left: 53px;
}
.laptop_text_poz_3 {
top: 29px;
left: 53px;
}
.laptop_text_poz_4 {
bottom: -25px;
left: 0px;
width: 120px;
text-align: center;
}
.laptop_text_poz_5 {
bottom: -25px;
left: 110px;
width: 120px;
text-align: center;
}
.laptop_text_poz_6 {
bottom: -25px;
left: 251px;
width: 100px;
text-align: center;
}
.keys_testing_img {
right: -400px;
}
.keys_testing_text_arrow {
position: static;
margin-left: 0;
padding: 0;
width: auto;
}
.keys_testing_text_arrow:after {
display: none;
}
.keys_testing_box_cont_arrow{
display: none;
}
.laptop_box_2_ins>img {
display: none;
}
.laptop_2_ins_img_1, .laptop_2_ins_img_2 {
position: static;
}
.laptop_2_ins_cont {
padding-top: 50px;
}
.keys_test_top {
min-height: 635px;
}
.ks_test_zak_block {
float: none;
margin-left: 20px;
margin-bottom: 10px;
}
.keys_test_top {
overflow: hidden;
}
}
@media only screen and (max-width: 479px) {
.laptop_text_poz_1 {
top: -8px;
left: 30px;
}
.laptop_text_poz_2 {
top: 5px;
left: 30px;
}
.laptop_text_poz_3 {
top: 18px;
left: 30px;
}
.laptop_text_poz_4 {
bottom: -25px;
left: -20px;
width: 120px;
text-align: center;
}
.laptop_text_poz_5 {
bottom: -45px;
left: 60px;
width: 120px;
text-align: center;
}
.laptop_text_poz_6 {
bottom: -25px;
left: 151px;
width: 100px;
text-align: center;
}
.laptop_box {
margin-bottom: 50px;
}
.keys_testing_img {
right: -500px;
}
.zoom_keys_testing_arrow {
display: none !important;
}
.laptop_2_ins_img_1 img, .laptop_2_ins_img_2 img {
width: 220px;
height: 175px;
}
.laptop_2_ins_cont {
margin-left: 0 !important;
border-left: none;
padding-top: 60px;
padding-left: 0;
}
.laptop_2_ins_cont {
width: auto;
}
.keys_test_top {
min-height: 705px;
}
}
/* ------------ BLOG MODAL ------------------ */
.clear {
clear: both;
......@@ -1217,4 +1772,17 @@ pre code {
.article_short_tags {
margin-top: 0;
}
}
.keys_test_top a.toggle_bottom {
position: relative;
top: 220px;
z-index: 4;
margin-top: 0;
}
@media only screen and (max-width: 992px) {
.keys_test_top a.toggle_bottom {
display: none;
}
}
\ No newline at end of file
/*==================================RESPONSIVE LAYOUTS===============================================*/
.puls_point_on {
opacity: 1;
top: 307px;
}
@media only screen and (max-width: 970px) {
.mackup_text {
display: none;
}
.section4 .section_h2 {
font-size: 26px;
line-height: 28px;
text-align: left;
}
.puls {
height: 360px;
}
a.toggle_bottom {
float: none;
margin: 0;
margin-top: 35px;
display: none;
}
.cif_last {
overflow: hidden;
}
.section5 {
padding-bottom: 70px;
}
.section6 {
background-position: center 105px;
}
}
@media only screen and (max-width: 768px) {
.section1 {
min-height: 260px;
}
.section1__title {
font-size: 20px;
line-height: 28px;
margin-top: 30px;
font-weight: bold;
text-align: left;
}
.slogan {
text-align: left;
font-size: 16px;
}
.section2 h2 {
display: none;
}
.app_block {
height: auto;
}
.section3 {
margin-top: 50px;
}
.desctop_line span {
text-align: left;
width: 100px;
position: static;
display: block;
}
.desctop_line {
background: url(../images/desctop_line.png) no-repeat 100% 0;
width: 185px;
height: 65px;
float: none;
margin-top: 35px;
margin-bottom: 15px;
margin-right: 0px;
position: relative;
}
.mac_win {
margin-top: 0;
}
.mobile_line {
background: url(../images/mobile_line.png) no-repeat 120px 0;
width: 185px;
height: 65px;
margin-top: 35px;
margin-left: 0px;
margin-bottom: 0px;
float: none;
position: relative;
}
.mobile_line span {
width: 100px;
position: static;
}
.app_block {
margin-top: 0;
}
.section_h2 {
font-size: 20px;
line-height: 28px;
text-align: left;
}
.puls {
margin: 0;
height: 175px;
width: auto;
margin-top: 15px;
margin: 35px;
display: block;
background: url(../images_new/puls_resp.png) 0 0 no-repeat;
}
.section4 {
padding-bottom: 60px;
background: none;
}
ul.ul_check:last-child {
margin-top: 29px;
}
.section5 {
margin-top: -125px;
}
.green_title {
margin-top: 70px;
}
.cif_50 {
width: 50%;
float: left;
}
.if_info1, .if_info2, .if_info3, .if_info4, .if_info5 {
display: none;
}
.inteface_1 {
margin-top: 40px;
height: 620px;
}
.inteface_2 {
margin-top: -210px;
}
.inteface_4 {
margin: 0;
margin-top: -200px;
}
.section6 {
background-position: center -130px;
}
.project_tit {
text-align: center;
}
.sup_block__item1 {
margin-bottom: 20px;
}
.sup_block__item2 {
padding-bottom: 140px;
}
.sup_block__info4 {
text-align: left;
left: 80px;
}
.sup_block__info4:after {
float: left;
margin-right: auto;
margin-left: -38px;
margin-top: -40px;
transform: rotate(260deg);
-webkit-transform: rotate(260deg); /* Chrome y Safari */
-moz-transform: rotate(260deg); /* Firefox */
filter: progid:DXImageTransform.
-o-transform: rotate(260deg); /* Opera */
}
.sup_block__info5 {
top: 50px;
}
.sup_block__info5:after {
margin-right: 0;
margin-left: -20px;
margin-top: 30px;
transform: rotate(60deg);
-webkit-transform: rotate(60deg); /* Chrome y Safari */
-moz-transform: rotate(60deg); /* Firefox */
filter: progid:DXImageTransform.
-o-transform: rotate(60deg); /* Opera */
}
.section8_down {
background-size: cover;
}
.table_people_bg {
margin: 30px auto;
}
.calk_form__title {
font-size: 20px;
text-align: center;
display: block;
}
.calk_form_subtitle {
font-size: 15px;
text-align: center;
}
.file-upload_block {
display: none;
}
}
@media only screen and (max-width: 480px) {
.inteface_1 {
height: 480px;
}
.project_tit {
margin-top: 60px;
}
.section6 {
padding-bottom: 80px;
}
.bx-wrapper .bx-pager, .bx-wrapper .bx-controls-auto {
bottom: -50px;
}
.bx-wrapper {
margin-top: 10px;
}
.code_block__txt {
text-align: center;
background-color: transparent;
}
.sup_block__item2 {
padding-bottom: 40px;
}
.sup_block__info5:after {
margin-left: -60px;
margin-right: 15px;
}
.section5 {
margin-top: -10px;
}
.section6 {
background-position: center -28px;
}
}
@media only screen and (max-width: 368px) {
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment