Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
retypos-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
retypos-server
Commits
aefe3d4f
Commit
aefe3d4f
authored
Jun 12, 2019
by
Dmitriy
Committed by
Vitaly Lipatov
Jun 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Задача 13943] Добавлено поле для указания пути POST-запроса исправления опечатки
parent
0c50efed
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
4 deletions
+17
-4
Sites.php
cp/application/controllers/admins/Sites.php
+4
-0
Typo.php
cp/application/models/Typo.php
+3
-2
Site.php
cp/application/models/admins/Site.php
+3
-0
sites.php
cp/application/views/admins/sites.php
+3
-2
12.06.2019-addPathColumn.sql
db/migrations/12.06.2019-addPathColumn.sql
+4
-0
No files found.
cp/application/controllers/admins/Sites.php
View file @
aefe3d4f
...
...
@@ -78,6 +78,8 @@ class Sites extends CI_Controller {
if
(
$oper
==
'add'
)
{
// Добавление пользователя
$data
[
'site'
]
=
$this
->
input
->
post
(
'site'
);
$path
=
$this
->
input
->
post
(
'path'
);
$data
[
'path'
]
=
$path
?
$path
:
null
;
if
(
$data
[
'site'
]
==
''
)
{
echo
json_encode
(
array
(
'message'
=>
'Название сайта некорректно'
));
}
else
{
...
...
@@ -90,6 +92,8 @@ class Sites extends CI_Controller {
}
else
if
(
$oper
==
'edit'
)
{
// Редактирование пользователя
$data
[
'id_site'
]
=
$this
->
input
->
post
(
'id'
);
$data
[
'site'
]
=
$this
->
input
->
post
(
'site'
);
$path
=
$this
->
input
->
post
(
'path'
);
$data
[
'path'
]
=
$path
?
$path
:
null
;
if
(
$data
[
'site'
]
==
''
)
{
echo
json_encode
(
array
(
'message'
=>
'Название сайта некорректно'
));
}
else
{
...
...
cp/application/models/Typo.php
View file @
aefe3d4f
...
...
@@ -366,9 +366,10 @@ private function get_site_id($DBH, $url) {
$this
->
db
->
from
(
"sites as s"
);
$this
->
db
->
where
(
"s.id"
,
$id_site
);
$site
=
$this
->
db
->
get
()
->
row
();
$path
=
empty
(
$site
->
path
)
?
$correctPath
:
$site
->
path
;
//error_log("result: " . $site->site . "/" . $correctPath);
log_message
(
"error"
,
"result: "
.
$site
->
site
.
"/"
.
$correctP
ath
);
return
$site
->
site
.
"/"
.
$
correctP
ath
;
log_message
(
"error"
,
"result: "
.
$site
->
site
.
"/"
.
$p
ath
);
return
$site
->
site
.
"/"
.
$
p
ath
;
// Адрес на который шлем запрос исправления
//return $parsed_url["scheme"] . "://" . $parsed_url["host"] . "/" . $correctPath;
}
...
...
cp/application/models/admins/Site.php
View file @
aefe3d4f
...
...
@@ -96,6 +96,7 @@ class Site extends CI_Model {
$data
[
'rows'
][
$id
][
'id'
]
=
$row
->
id
;
$data
[
'rows'
][
$id
][
'cell'
][]
=
$row
->
id
;
$data
[
'rows'
][
$id
][
'cell'
][]
=
$row
->
site
;
$data
[
'rows'
][
$id
][
'cell'
][]
=
$row
->
path
;
$data
[
'rows'
][
$id
][
'cell'
][]
=
$row
->
date
;
}
}
else
if
(
$table
==
'users'
)
{
...
...
@@ -125,6 +126,7 @@ class Site extends CI_Model {
$data
=
array
(
'site'
=>
$site
[
'site'
],
'path'
=>
$site
[
'path'
],
'date'
=>
date
(
"Y-m-d H:i:s"
,
time
())
);
...
...
@@ -138,6 +140,7 @@ class Site extends CI_Model {
}
$this
->
db
->
set
(
"site"
,
$data
[
'site'
]);
$this
->
db
->
set
(
"path"
,
$data
[
'path'
]);
$this
->
db
->
where
(
"id"
,
$data
[
'id_site'
]);
$this
->
db
->
update
(
"sites"
);
}
...
...
cp/application/views/admins/sites.php
View file @
aefe3d4f
...
...
@@ -16,10 +16,11 @@ jQuery("#table_sites").jqGrid({ // Привязка плагина к табли
url
:
'
<?=
$base_url
?>
admins/sites/get_list_sites'
,
// Скрипт - обработчик ваших запросов
editurl
:
'
<?=
$base_url
?>
admins/sites/panel_sites'
,
datatype
:
"json"
,
// Формат скрипта-обработчика
colNames
:[
'Номер'
,
'Сайт'
,
'Дата регистрации'
],
colNames
:[
'Номер'
,
'Сайт'
,
'
Путь'
,
'
Дата регистрации'
],
colModel
:[
{
name
:
"id"
,
index
:
's.id'
,
width
:
10
,
searchtype
:
"integer"
,
align
:
'center'
},
{
name
:
"site"
,
index
:
's.site'
,
align
:
'center'
,
width
:
20
,
searchtype
:
"string"
,
editable
:
true
,
addtable
:
true
,
editrules
:{
required
:
true
}},
{
name
:
"site"
,
index
:
's.site'
,
align
:
'center'
,
width
:
20
,
searchtype
:
"string"
,
editable
:
true
,
addtable
:
true
,
editrules
:{
required
:
true
}},
{
name
:
"path"
,
index
:
's.path'
,
align
:
'center'
,
width
:
20
,
searchtype
:
"string"
,
editable
:
true
,
addtable
:
true
},
{
name
:
"date"
,
index
:
's.date'
,
align
:
'center'
,
width
:
20
,
searchtype
:
"string"
},
],
...
...
db/migrations/12.06.2019-addPathColumn.sql
0 → 100644
View file @
aefe3d4f
/*Добавление столбца для храния произвольного пути для сайта*/
ALTER
TABLE
`sites`
ADD
`path`
VARCHAR
(
255
)
NULL
DEFAULT
NULL
AFTER
`site`
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment