Skip to content

Commit

Permalink
Merge pull request RosDostup#15 from Ahaenor/no_gibddfix_last
Browse files Browse the repository at this point in the history
No gibddfix last
  • Loading branch information
RosDostup committed Sep 30, 2012
2 parents 53585dc + def0e63 commit 4c5f6bc
Show file tree
Hide file tree
Showing 16 changed files with 205 additions and 156 deletions.
10 changes: 2 additions & 8 deletions css/template_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,8 @@ ul.usermenu li.active .profileBtn{background: #f88100;}
padding: 0 0 0 30px;
vertical-align: middle;
}

.trafficlight {background: url(/images/defects/rosdostup/trafficlight.png) no-repeat 0 0;}
.paving {background: url(/images/defects/rosdostup/paving.png) no-repeat 0 0;}
.pandus {background: url(/images/defects/rosdostup/pandus.png) no-repeat 0 0;}
.door {background: url(/images/defects/rosdostup/door.png) no-repeat 0 0;}
.parking {background: url(/images/defects/rosdostup/parking.png) no-repeat 0 0;}

.badroad {background: url(/images/st1234/badroad.png) no-repeat 0 0;}

.badroad {background: url(/images/st1234/badroad.png) no-repeat 0 0;}
.hatch {background: url(/images/st1234/hatch.png) no-repeat 0 0;}
.nomarking {background: url(/images/st1234/nomarking.png) no-repeat 0 0;}
.light {background: url(/images/st1234/light.png) no-repeat 3px -2px;}
Expand Down
1 change: 1 addition & 0 deletions protected/config/appConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
// this is used in contact page
'adminEmail'=>'[email protected]',
'YMapKey'=>'AKtzDVABAAAAbnnpfAIAZPFgkjAuQV52QNsahNkE7plr4F0AAAAAAAAAAAAyrGSHDyaYbEfL1i8AVZDhjT4VHQ==',
'copyright' => 'rosdostup', // For copyright meta in header
'gibddOn' => false, // True, если ГИБДД участвует в форме дефекта; false, если она исключается из формы
//'layout'=>'startpage',

Expand Down
3 changes: 2 additions & 1 deletion protected/extensions/ymapmultiplot/YMapMultiplot.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ public function run()
else $stl="";*/
if ($this->width && $this->height) echo '<div id="'.$this->id.'" style="width:'.$this->width.'; height:'.$this->height.';'.$stl.'" class="bx-yandex-map">загрузка карты...</div>';
else echo '<div id="'.$this->id.'"></div>';
echo '<script src="http://api-maps.yandex.ru/1.1/index.xml?key='.$this->key.'" type="text/javascript"></script>
echo '<script type="text/javascript">var GIBDD_ON = '.(Yii::app()->params->gibddOn ? 'true' : 'false').';</script>
<script src="http://api-maps.yandex.ru/1.1/index.xml?key='.$this->key.'" type="text/javascript"></script>
<script src="'.CHtml::asset(dirname(__FILE__).DIRECTORY_SEPARATOR.'js'.DIRECTORY_SEPARATOR.'ymapmultiplot.js').'" type="text/javascript"></script>';
/* echo '<script language="javascript">
'.$this->$jsfunc.'
Expand Down
10 changes: 5 additions & 5 deletions protected/extensions/ymapmultiplot/js/ymapmultiplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ function GetGibbds(map){
gibddsPolygons[data.gibdds[i].id][ii] = new YMaps.Polygon(startpoints, {
style: style,
hasHint: 0,
hasBalloon: 0,
hasBalloon: 0
});

}
Expand Down Expand Up @@ -509,7 +509,7 @@ function getMyArea(map, showpolygon){
myareaPolygons[i] = new YMaps.Polygon(startpoints, {
style: style,
hasHint: 0,
hasBalloon: 0,
hasBalloon: 0
});


Expand Down Expand Up @@ -547,7 +547,7 @@ function getUserArea(map){
userareaPolygons[i] = new YMaps.Polygon(startpoints, {
style: style,
hasHint: 0,
hasBalloon: 0,
hasBalloon: 0
});


Expand Down Expand Up @@ -737,7 +737,7 @@ function setCoordValue(map, ev)
else {
if (ev!='from_coord') var ev=false;
map.setCenter(new YMaps.GeoPoint($('#Holes_LONGITUDE').val(), $('#Holes_LATITUDE').val()));
}
}
var lon = $('#Holes_LATITUDE').val();
var lat = $('#Holes_LONGITUDE').val();
coordpoint = new YMaps.Placemark(new YMaps.GeoPoint(lat, lon), { style: 'default#violetPoint', draggable: true, hasBalloon: false, hideIcon: false });
Expand All @@ -747,7 +747,7 @@ function setCoordValue(map, ev)
geocodeOnSetCoordValue(true);
});
map.addOverlay(coordpoint);
geocodeOnSetCoordValue(ev);
geocodeOnSetCoordValue(GIBDD_ON ? ev : false);
}

function geocodeOnSetCoordValue(ev)
Expand Down
39 changes: 26 additions & 13 deletions protected/messages/ru/holes_view.php

Large diffs are not rendered by default.

67 changes: 35 additions & 32 deletions protected/models/Holes.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ public static function getAllstatesShort()
{
$arr=Array();
$arr['fresh'] = 'Добавлено на сайт';
$arr['inprogress'] = 'В ГАИ';
$arr['inprogress'] = (Yii::app()->params->gibddOn ? 'В ГАИ' : 'В местных органах власти');
$arr['fixed'] = 'Отремонтировано';
$arr['achtung'] = 'В ГАИ';
$arr['achtung'] = (Yii::app()->params->gibddOn ? 'В ГАИ' : 'В местных органах власти');
$arr['gibddre'] = 'Получен ответ';
$arr['prosecutor'] = 'Заявление в прокуратуре';
return $arr;
Expand Down Expand Up @@ -447,7 +447,7 @@ public function updateRevokep(){

public function makeRequest($type){
$attr='request_'.$type;
if (!$this->$attr){
if (empty($this->$attr)){
$request=new HoleRequests;
$request->attributes=Array(
'hole_id'=>$this->ID,
Expand Down Expand Up @@ -636,35 +636,38 @@ public function getmodering(){
*/
public function attributeLabels()
{
return array(
'ID' => 'ID',
'USER_ID' => 'Пользователь',
'LATITUDE' => 'Широта',
'LONGITUDE' => 'Долгота',
'ADDRESS' => 'Адрес дефекта',
'gibdd_id'=>'Отдел ГИБДД',
'STATE' => 'Статус',
'DATE_CREATED' => 'Дата создания',
'DATE_SENT' => 'Дата отправки в ГИБДД',
'DATE_STATUS' => 'Дата изменения',
'COMMENT1' => 'Комментарии',
'COMMENT2' => 'Комментарии',
'TYPE_ID' => 'Тип дефекта',
'ADR_SUBJECTRF' => 'Субъект РФ',
'ADR_CITY' => 'Город',
'COMMENT_GIBDD_REPLY' => 'Comment Gibdd Reply',
'GIBDD_REPLY_RECEIVED' => 'Gibdd Reply Received',
'PREMODERATED' => 'Модер.',
'NOT_PREMODERATED' => 'только непроверенные',
'DATE_SENT_PROSECUTOR' => 'Date Sent Prosecutor',
'deletepict'=>'Удалить фотографию?',
'replуfiles'=>'Необходимо добавить отсканированный ответ из ГИБДД',
'upploadedPictures'=>$this->scenario=='fix' ? 'Желательно добавить фотографии исправленного дефекта' : 'Нужно загрузить фотографии (не больше 10 штук)',
'description_size'=>'Описание дефекта (размеры и прочая информация)',
'description_locality'=>'Подробное описание расположения дефекта на местности',
'archive'=>'Архив',
'deleted'=>'Удалено'
);
$labels = array(
'ID' => 'ID',
'USER_ID' => 'Пользователь',
'LATITUDE' => 'Широта',
'LONGITUDE' => 'Долгота',
'ADDRESS' => 'Адрес дефекта',
'STATE' => 'Статус',
'DATE_CREATED' => 'Дата создания',
'DATE_SENT' => 'Дата отправки в ГИБДД',
'DATE_STATUS' => 'Дата изменения',
'COMMENT1' => 'Комментарии',
'COMMENT2' => 'Комментарии',
'TYPE_ID' => 'Тип дефекта',
'ADR_SUBJECTRF' => 'Субъект РФ',
'ADR_CITY' => 'Город',
'PREMODERATED' => 'Модер.',
'NOT_PREMODERATED' => 'только непроверенные',
'DATE_SENT_PROSECUTOR' => 'Date Sent Prosecutor',
'deletepict'=>'Удалить фотографию?',
'replуfiles'=>'Необходимо добавить отсканированный ответ из ГИБДД',
'upploadedPictures'=>$this->scenario=='fix' ? 'Желательно добавить фотографии исправленного дефекта' : 'Нужно загрузить фотографии (не больше 10 штук)',
'description_size'=>'Описание дефекта (размеры и прочая информация)',
'description_locality'=>'Подробное описание расположения дефекта на местности',
'archive'=>'Архив',
'deleted'=>'Удалено'
);
if(Yii::app()->params->gibddOn) {
$labels['GIBDD_REPLY_RECEIVED'] = 'Gibdd Reply Received';
$labels['COMMENT_GIBDD_REPLY'] = 'Comment Gibdd Reply';
$labels['gibdd_id'] = 'Отдел ГИБДД';
}
return $labels;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion protected/views/holes/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@
<?php echo $form->error($model,'ADDRESS'); ?>
</div>

<!-- адрес -->
<!-- ГИБДД -->
<?php if(Yii::app()->params->gibddOn) {?>
<div class="f">
<?php echo $form->labelEx($model,'gibdd_id'); ?>
<?php echo $form->dropDownList($model, 'gibdd_id', CHtml::listData( $model->territorialGibdd, 'id', 'gibdd_name' ));?>
<?php echo $form->error($model,'gibdd_id'); ?>
</div>
<?php }?>

<!-- фотки -->
<div class="f">
Expand Down
2 changes: 1 addition & 1 deletion protected/views/holes/_form_gibdd.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
));
$usermodel=Yii::app()->user->userModel;
$model=new HoleRequestForm;
$model->to=$gibdd ? $gibdd->post_dative.' '.$gibdd->fio_dative : '';
$model->to = empty($gibdd) ? '' : $gibdd->post_dative.' '.$gibdd->fio_dative;
$model->from=$usermodel->relProfile->request_from ? $usermodel->relProfile->request_from : $usermodel->last_name.' '.$usermodel->name.' '.$usermodel->second_name;
$model->address=CHtml::encode($hole->ADDRESS);
$model->signature=$usermodel->relProfile->request_signature ? $usermodel->relProfile->request_signature : $usermodel->last_name.' '.substr($usermodel->name, 0, 2).($usermodel->name ? '.' : '').' '.substr($usermodel->second_name, 0, 2).($usermodel->second_name ? '.' : '');
Expand Down
60 changes: 60 additions & 0 deletions protected/views/holes/_form_organs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Не исключена вероятность того, что на <a href="http://www.gosuslugi.ru/ru/chorg/index.php?ssid_4=4120&stab_4=4&rid=228&tid=2" target="_blank">сайте госуслуг</a> окажется немного полезной информации.

<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'request-form',
'enableAjaxValidation'=>false,
'action'=>Yii::app()->createUrl("holes/request", array("id"=>$hole->ID)),
'htmlOptions'=>Array ('onsubmit'=>"document.getElementById('pdf_form').style.display='none';"),
));
$usermodel=Yii::app()->user->userModel;
$model=new HoleRequestForm;
$model->to = empty($gibdd) ? '' : $gibdd->post_dative.' '.$gibdd->fio_dative;
$model->from=$usermodel->relProfile->request_from ? $usermodel->relProfile->request_from : $usermodel->last_name.' '.$usermodel->name.' '.$usermodel->second_name;
$model->address=CHtml::encode($hole->ADDRESS);
$model->signature=$usermodel->relProfile->request_signature ? $usermodel->relProfile->request_signature : $usermodel->last_name.' '.substr($usermodel->name, 0, 2).($usermodel->name ? '.' : '').' '.substr($usermodel->second_name, 0, 2).($usermodel->second_name ? '.' : '');
$model->postaddress=$usermodel->relProfile->request_address ? $usermodel->relProfile->request_address : '';
?>
<h2><?= Yii::t('holes_view', 'HOLE_REQUEST_FORM') ?></h2>
<table>
<tr>
<th><?php echo $form->labelEx($model,'to'); ?><span class="comment"><?= Yii::t('holes_view', 'HOLE_REQUEST_FORM_TO_COMMENT') ?></span></th>
<td><?php echo $form->textArea($model,'to',array('rows'=>3, 'cols'=>40)); ?></td>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'from'); ?><span class="comment"><?= Yii::t('holes_view', 'HOLE_REQUEST_FORM_FROM_COMMENT') ?></span></th>
<td><?php echo $form->textArea($model,'from',array('rows'=>3, 'cols'=>40)); ?></td>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'postaddress'); ?><span class="comment"><?= Yii::t('holes_view', 'HOLE_REQUEST_FORM_POSTADDRESS_COMMENT') ?></span></th>
<td><?php echo $form->textArea($model,'postaddress',array('rows'=>3, 'cols'=>40)); ?></td>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'address'); ?><span class="comment"><?= Yii::t('holes_view', 'HOLE_REQUEST_FORM_ADDRESS_COMMENT') ?></span></th>
<td><?php echo $form->textArea($model,'address',array('rows'=>3, 'cols'=>40)); ?></td>
</tr>
<?php if($hole->type->alias == 'light'): ?>
<tr>
<th><?php echo $form->labelEx($model,'comment'); ?><span class="comment"><?= Yii::t('holes_view', 'HOLE_REQUEST_FORM_COMMENT_COMMENT') ?></span></th>
<td><?php echo $form->textArea($model,'comment',array('rows'=>3, 'cols'=>40)); ?></td>
</tr>
<?php endif; ?>
<?php if($hole->description_size || $hole->description_locality): ?>
<tr>
<th colspan="2"><?php echo $form->labelEx($model,'showDescriptions'); ?>&nbsp;&nbsp;&nbsp;<?php echo $form->checkBox($model,'showDescriptions',array('style'=>'width:20px')); ?><span class="comment"><?= Yii::t('holes_view', 'HOLE_REQUEST_FORM_SHOW_DESCRIPTIONS_COMMENT') ?></span></th>

</tr>
<?php endif; ?>
<tr>
<th><?php echo $form->labelEx($model,'signature'); ?><span class="comment"><?= Yii::t('holes_view', 'HOLE_REQUEST_FORM_SIGNATURE_COMMENT') ?></span></th>
<td><?php echo $form->textField($model,'signature',array('class'=>'textInput')); ?></td>
</tr>
<tr>
<th></th>
<td>
<?php echo CHtml::submitButton(Yii::t('holes_view', 'HOLE_REQUEST_FORM_SUBMIT'), Array('class'=>'submit', 'name'=>'HoleRequestForm[pdf]')); ?>
<?php echo CHtml::submitButton(Yii::t('holes_view', 'HOLE_REQUEST_FORM_SUBMIT2'), Array('class'=>'submit', 'name'=>'HoleRequestForm[html]')); ?>
</td>
</tr>
</table>
<?php $this->endWidget(); ?>
<?= Yii::t('holes_view', 'ST1234_INSTRUCTION') ?>
2 changes: 1 addition & 1 deletion protected/views/holes/_form_prosecutor_achtung.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$model->address=CHtml::encode($hole->ADDRESS);
$model->signature=$usermodel->relProfile->request_signature ? $usermodel->relProfile->request_signature : $usermodel->last_name.' '.substr($usermodel->name, 0, 2).($usermodel->name ? '.' : '').' '.substr($usermodel->second_name, 0, 2).($usermodel->second_name ? '.' : '');
$model->gibdd=$hole->subject && $hole->subject->gibdd ? $hole->subject->gibdd->gibdd_name : '';
$model->application_data=$hole->request_gibdd ? date('d.m.Y',$hole->request_gibdd->date_sent) : '';
$model->application_data = empty($hole->request_gibdd) ? '' : date('d.m.Y', $hole->request_gibdd->date_sent);
$model->postaddress=$usermodel->relProfile->request_address ? $usermodel->relProfile->request_address : '';
?>
<?php echo $form->hiddenField($model,'form_type'); ?>
Expand Down
2 changes: 2 additions & 0 deletions protected/views/holes/map.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
<?php if (!Yii::app()->user->isGuest && Yii::app()->user->userModel->hole_area) : ?>
<label><span class="myarea_check"><input id="myarea_check_inp" name="myarea_check_inp" type="checkbox" <?php if (!$usermodel) echo 'checked="true"' ?> /></span><ins>Показать мою зону наблюдения</ins></label>
<?php endif; ?>
<?php if(Yii::app()->params->gibddOn) {?>
<label style="padding-left:10px;"><span class="gibdd_check"><input id="ibdd_check_inp" name="ibdd_check_inp" type="checkbox" /></span><ins>Показывать границы наблюдения подразделений ГИБДД</ins></label>
<?php }?>
</div>
</div>
<?php $this->endWidget(); ?> </div>
Expand Down
Loading

0 comments on commit 4c5f6bc

Please sign in to comment.