Skip to content
This repository was archived by the owner on Jan 18, 2019. It is now read-only.

Commit 64c7e8f

Browse files
committed
dbscan also reports lang tables, minor cs fix
1 parent f87f93a commit 64c7e8f

File tree

5 files changed

+47
-32
lines changed

5 files changed

+47
-32
lines changed

css/main.css

+5
Original file line numberDiff line numberDiff line change
@@ -376,4 +376,9 @@ div.chmin
376376
div.states div.chmin img.picture
377377
{
378378
margin-top: -35px;
379+
}
380+
381+
h2 a.editlink
382+
{
383+
float:right;
379384
}

protected/commands/ToolsCommand.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,13 @@ public function actionDBScan($save = false)
9999

100100
$tabledata['count'] = $ctr;
101101
if($tabledata['count'] != $oldcache[$tablename]['count'])
102-
$changedtables[$tablename] = $tablename;
103-
102+
$changedtables[$tablename] = $tablename;
103+
104+
#201805231626:thevikas:Kovai:Patch to consider xxxLang tables too
104105
$cache[$tablename] = $tabledata;
106+
$beh = $obj2->behaviors();
107+
if(isset($beh['ml']) && isset($changedtables[$tablename]))
108+
$changedtables[$tablename . 'Lang'] = $tablename . 'Lang';
105109
#echo "$table\t$maxpknum\t$maxcreated\t$maxupdated\t$ctr\n";
106110
}
107111
if($save)

protected/models/Officer.php

+5-23
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,7 @@ class Officer extends CActiveRecord
4545
const DESIG_HEALTHOFFICER = 'HEALTHOFFICER';
4646
const DESIG_DEPUTYHEALTHOFFICER = 'DEPUTYHEALTHOFFICER';
4747
const DESIG_CHIEFENGINEER = 'CHIEFENGINEER';
48-
/*
49-
* static $designstr = [
50-
//duplicates
51-
Officer::DESIG_CHIEFENGINEER => __('Chief Engineer (I/C)'),
52-
Officer::DESIG_HEALTHOFFICER => __('Health Officer (I/C)'),
53-
Officer::DESIG_HEALTHOFFICER => __('Medical Officer of Health'),
54-
//originals
55-
Officer::DESIG_DEPUTYCOMMISSIONER => __('Deputy Commissioner'),
56-
Officer::DESIG_JOINTCOMMISSIONER => __('Joint Commissioner'),
57-
Officer::DESIG_ASSTCOMMISSIONER => __('Assisstant Commissioner'),
58-
Officer::DESIG_EXECENGINEER => __('Executive Engineer'),
59-
Officer::DESIG_CHIEFENGINEER => __('Chief Engineer'),
60-
Officer::DESIG_HEALTHOFFICER => __('Health Officer'),
61-
Officer::DESIG_DEPUTYHEALTHOFFICER => __('Deputy Health Officer'),
62-
Officer::DESIG_ASSTEXECENGINEER => __('Assistant Executive Engineer'),
63-
Officer::DESIG_ASSTTOWNPLANNER => __('Assistant Town Planning Officer'),
64-
Officer::DESIG_ASSTREVENUEOFF => __('Assistant Revenue Officer'),
65-
Officer::DESIG_ZONALSANITORYOFF => __('Zonal Sanitary Officer'),
66-
//
67-
Officer::DESIG_ASSTENGINEER => __('Assistant Engineer'),
68-
Officer::DESIG_WATERSUPPLYOFF => __('Water Supply Engineer'),
69-
Officer::DESIG_SANITORYINSPECTOR => __('Sanitory Inspector'),
70-
];*/
48+
7149

7250
public static function designstr()
7351
{
@@ -271,6 +249,10 @@ function savePicture($url)
271249
$outfile = '';
272250
switch($this->desig)
273251
{
252+
case self::DESIG_DEPUTYCOMMISSIONER:
253+
$outfile = strtolower($this->district->state->slug . '_' . $this->district->slug . '_' . $desig . '.jpg');
254+
$stateobj = $this->district->state;
255+
break;
274256
case self::DESIG_DEPUTYCHIEFMINISTER:
275257
$outfile = strtolower($stateobj->slug . '_' . $desig . '_' . time() . '.jpg');
276258
break;

protected/views/site/_district.php

+28-5
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,20 @@
1717
break;
1818
}
1919
?>
20+
<div class="view district <?=empty ( $data->picture ) ? '' : 'pic'?>">
21+
<h2 class="acname"><?=$label2?><?php
22+
if(Yii::app()->user->checkAccess('ADD_CHIEF_MINISTER'))
23+
echo ' ' . CHtml::link(__('Edit'),['/officer/update','id' => $data->id_officer],['class' => 'editlink']);
24+
?></h2>
25+
<?php
26+
if (! empty ( $data->picture ))
27+
echo CHtml::image ( '/images/pics/' . $data->picture, $data->name, [
28+
'class' => 'picture amly'
29+
] );
30+
2031

21-
<div class="view district">
22-
<h2 class="acname"><?=$label2?></h2>
2332

24-
<?php
25-
$att = [array ( // related city displayed as a link
33+
$att = [array ( // related city displayed as a link
2634
'label' => $label,
2735
'name' => 'name',
2836
)];
@@ -69,7 +77,22 @@
6977
return implode(' ',$rt);
7078
}
7179
];
72-
80+
if (! empty ( $data->website ))
81+
$att [] = [
82+
'type' => 'raw',
83+
'name' => 'website',
84+
'label' => __ ( 'Website' ),
85+
'value' => function ($data)
86+
{
87+
return CHtml::link($data->website,$data->website);
88+
}
89+
];
90+
if (! empty ( $data->address ))
91+
$att [] = [
92+
'name' => 'address',
93+
];
94+
95+
7396
$this->widget ( 'zii.widgets.CDetailView',
7497
array (
7598
'data' => $data,

protected/views/state/_districteditor.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
/* @var $this StateController */
33
/* @var $district District */
44
?>
5-
<div class="view">';
5+
<div class="view">
66
<h2><?= __ ( 'Data Editor' )?></h2>
77

88
<ol>
9-
<li><?=CHtml::link(__('Add Deputy Commissioner'),['officer/create','id_state' => $district->id_state,'id_district' => $district->id_district ])?>
9+
<li><?=CHtml::link(__('Add Deputy Commissioner'),
10+
['officer/create','id_state' => $district->id_state,'id_district' => $district->id_district ])?>
1011
</ol>
1112

1213
</div>

0 commit comments

Comments
 (0)