Permalink
Browse files

Merge pull request #104 from borazslo/master

make new church
  • Loading branch information...
borazslo committed Mar 28, 2018
2 parents da2035e + 317ffe5 commit 7394e648f151bd31b8139c39a531cf393021a9a3
@@ -95,7 +95,7 @@ function getRemarksStatusAttribute($value) {
}
public function delete() {
$this->neighbours()->delete();
#$this->neighbours()->delete();
Distance::where('church_to', $this->id)->delete();
Distance::where('church_from', $this->id)->delete();
$this->remarks()->delete();
@@ -108,7 +108,9 @@ function getLocationAttribute($value) {
$location->lat = $this->lat;
$location->lon = $this->lon;
$location->country = DB::table('orszagok')->where('id', $this->orszag)->pluck('nev')[0];
if ($this->orszag > 0) {
$location->country = DB::table('orszagok')->where('id', $this->orszag)->pluck('nev')[0];
}
if ($this->megye > 0) {
$location->county = DB::table('megye')->where('id', $this->megye)->pluck('megyenev')[0];
}
@@ -19,13 +19,13 @@ public function __construct() {
if (!$user->checkRole('miserend')) {
throw new \Exception('Nincs jogosultságod megnézni a templomok listáját.');
}
$this->filterKeyword = (isset($this->input['church']['keyword']) ? $this->input['church']['keyword'] : false);
$this->filterDiocese = (isset($this->input['church']['egyhazmegye']) ? $this->input['church']['egyhazmegye'] : false);
$this->filterDeanery = ((isset($this->input['church']['espereskerulet']) AND $this->input['church']['espereskerulet'] != 0 ) ? $this->input['church']['espereskerulet'] : false);
$this->filterStatus = (isset($this->input['church']['status']) ? $this->input['church']['status'] : false);
$this->orderBy = (isset($this->input['church']['orderBy']) ? $this->input['church']['orderBy'] : 'moddatum desc');
$this->orderBy = (isset($this->input['church']['orderBy']) ? $this->input['church']['orderBy'] : 'moddatum DESC');
$params = [
'church[keyword]' => $this->filterKeyword,
'church[egyhazmegye]' => $this->filterDiocese,
@@ -0,0 +1,36 @@
<?php
namespace Html\Church;
class Create extends \Html\Html {
public function __construct($path) {
global $user;
if (!$user->checkRole('miserend')) {
throw new \Exception('Nincs jogosultságod a templomot létrehozni.');
}
$this->title = 'Új misézőhely létrehozása';
$this->template = 'layout.twig';
$church = new \Eloquent\Church;
$church->nev = 'Új misézőhely';
$church->ok = 'n';
$church->letrehozta = $user->login;
$church->megbizhato = 'i';
$church->frissites = date('Y-m-d');
$church->moddatum = date('Y-m-d');
$church->egyhazmegye = 1;
$church->save();
$church->nev = "Új misézőhely - ".$church->id;
$church->save();
$this->content = "Létrehozás sikeres: <br/><a href='/templom/".$church->id."/edit'>".$church->nev."</a>";
$this->redirect("/templom/".$church->id."/edit");
}
}
@@ -16,8 +16,9 @@ public function __construct($path) {
$this->setTitle($this->church->nev);
if (!$this->church->McheckWriteAccess($user)) {
$this->title = 'Hiányzó jogosultság!';
$this->title = 'Templom szerkesztése!';
addMessage('Hiányzó jogosultság!', 'danger');
throw new \Exception('Hiányzó jogosultság!');
return;
}
View
@@ -10,6 +10,10 @@ public function __construct($path) {
if (isset($_REQUEST['update'])) {
set_time_limit('300');
$cache = new \ExternalApi\OverpassApi();
$cache->cache = '1 sec';
$cache->clearOldCache();
$job = \Eloquent\Cron::where('class','\ExternalApi\OverpassApi')->where('function','updateUrlMiserend')->first();
$job->run();
}
@@ -7,7 +7,7 @@
{% block content %}
<p><a href="/church/create">Új misézőhely létrehozás.</a></p>
<form method=get>
<div class="row">
<div class="col-md-4"><label>Kulcsszó</label></div>
View
@@ -14,7 +14,6 @@
<th>url:miserend</th>
<th class="col-md-1"><span class="glyphicon glyphicon-edit" aria-hidden="true" style=""></span></th>
<th class="col-md-1"><span class="glyphicon glyphicon-eye-open" aria-hidden="true" style=""></span></th>
<th class="col-md-1"><span class="glyphicon glyphicon-map-marker" aria-hidden="true" style=""></span></th>
</tr>
{% for osm in osmWithoutChurch %}
<tr>
@@ -50,17 +49,17 @@
<th>Ország</th>
<th>Város</th>
<th>Misézőhely neve </th>
<th class="col-md-1"><span class="glyphicon glyphicon-edit" aria-hidden="true" style=""></span></th>
<th class="col-md-1"><span class="glyphicon glyphicon-eye-open" aria-hidden="true" style=""></span></th>
<th class="col-md-1"><span class="glyphicon glyphicon-eye-open" aria-hidden="true" style=""></span></th>
<th class="col-md-1"><span class="glyphicon glyphicon-edit" aria-hidden="true" style=""></span></th>
<th class="col-md-1"><span class="glyphicon glyphicon-map-marker" aria-hidden="true" style=""></span></th>
</tr>
{% for church in churchWithoutOSM %}
<tr>
<td>{{ church.orszag }}</td>
<td>{{ church.varos }}</td>
<td>{{ church.nev }} {% if church.ismertnev %}({{ church.ismertnev}}){% endif %}</td>
<td><a href="/templom/{{ church.id }}/edit"><span class="glyphicon glyphicon-edit" aria-hidden="true" title="Templom szerkesztése..."></span></a></td>
<td><a href="/templom/{{ church.id }}"><span class="glyphicon glyphicon-eye-open" aria-hidden="true" title="Templom megtekintése..."></span></a></td>
<td><a href="https://www.openstreetmap.org/edit?editor=id#map=19/{{ church.lat }}/{{ church.lon }}"><span class="glyphicon glyphicon-edit" aria-hidden="true" title="OSM szerkesztése..."></span></a></td>
<td><a href='http://www.openstreetmap.org/?mlat={{ church.lat }}&mlon={{ church.lon }}#map=18/{{ church.lat }}/{{ church.lon }}' target='_blank'><span class="glyphicon glyphicon glyphicon-map-marker" aria-hidden="true" title="OSM térkép megjelenítése..."></span></a></td>
</tr>
{% endfor %}

0 comments on commit 7394e64

Please sign in to comment.