Toggle navigation
Toggle navigation
This project
Loading...
Sign in
UT
/
ut-tex
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
redmine
2015-02-20 19:47:14 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eb1b4bd52c93b248c8c36b075c863d6e0c7d664a
eb1b4bd5
1 parent
10b13e02
Added a template for domain-name request memos
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
26 deletions
genpdf/genpdf.php
mephimemo/template/request/domain-name.tex
genpdf/genpdf.php
View file @
eb1b4bd
...
...
@@ -266,11 +266,8 @@ foreach ($_GET as $key => &$value) {
if
(
substr
(
$key
,
-
12
)
==
"-other-value"
)
if
(
$_GET
[
substr
(
$key
,
0
,
strlen
(
$key
)
-
12
)]
==
"other"
)
$_GET
[
substr
(
$key
,
0
,
strlen
(
$key
)
-
12
)]
=
$value
;
$value
=
str_replace
(
array
(
'\\'
,
'_'
),
array
(
'{\textbackslash}'
,
'\_'
),
$value
);
}
foreach
(
array
(
'videocheck'
,
'confcheck'
,
'webtrans'
,
'telebridge'
,
'otherconf'
,
'record1'
,
'record2'
,
'record3'
)
as
$key
)
{
if
(
isset
(
$_GET
[
$key
]))
$_GET
[
$key
]
=
'Да'
;
...
...
@@ -349,7 +346,30 @@ $files = split(',', $_GET['file']);
$pdfs
=
array
();
foreach
(
$files
as
$file
)
{
$file_eff
=
$file
;
switch
(
$file
)
{
case
'request/domain-name'
:
$project_id
=
12886
;
$memo_subject
=
'Запрос на регистрацию доменного имени'
;
$file_eff
=
$file
;
//.' '.$_GET['target-type'];
$_GET
[
'domain-name'
]
=
$_GET
[
'domain-name'
]
.
'.mephi.ru'
;
switch
(
$_GET
[
'target-type'
])
{
case
'ipaddr'
:
$_GET
[
'target-type'
]
=
'IP-адресом'
;
$_GET
[
'target-id'
]
=
$_GET
[
'ipaddr'
];
break
;
case
'container-name'
:
$_GET
[
'target-type'
]
=
'контейнер'
;
$_GET
[
'target-id'
]
=
$_GET
[
'container-name'
];
break
;
case
'issue-id'
:
$_GET
[
'target-type'
]
=
'ранее предоставленным хостингом по заявке'
;
$_GET
[
'target-id'
]
=
'#'
.
$_GET
[
'issue-id'
];
break
;
}
break
;
case
'request/vpn'
:
$project_id
=
1
;
$memo_subject
=
'Запрос на учётную запись к vpn.mephi.ru'
;
...
...
@@ -481,8 +501,10 @@ foreach ($files as $file) {
foreach
(
$custom_fields_keys
as
$id
=>
$key
)
$custom_fields
[]
=
array
(
'id'
=>
$id
,
'value'
=>
empty
(
$_GET
[
$key
])
?
'0'
:
$_GET
[
$key
]);
foreach
(
$_GET
as
$key
=>
&
$value
)
{
$value
=
str_replace
(
array
(
'\\'
,
'_'
,
'#'
),
array
(
'{\textbackslash}'
,
'\_'
,
'\\#'
),
$value
);
}
$tempdir
=
tempdir
();
...
...
@@ -504,7 +526,7 @@ foreach ($files as $file) {
$_GET['date-end'] = (date('Y')+1).'-12-31';
*/
$body_template
=
file_get_contents
(
'template/'
.
$file
.
'.tex'
);
$body_template
=
file_get_contents
(
'template/'
.
$file
_eff
.
'.tex'
);
$body
=
body_parse
(
$body_template
);
switch
(
$file
)
{
...
...
@@ -544,27 +566,25 @@ foreach ($files as $file) {
$text
=
file_get_contents
(
'memo.txt'
);
unlink
(
'memo.pdf'
);
//insert switch here
switch
(
$file
)
{
case
'request/php'
:
$issue_props
=
array
(
'assigned_to_id'
=>
USERID_KVMARTINOV
,
'project_id'
=>
$project_id
,
'subject'
=>
$memo_subject
,
'description'
=>
$text
,
);
break
;
default
:
$issue_props
=
array
(
'assigned_to_id'
=>
USERID_DYOKUNEV
,
'project_id'
=>
$project_id
,
'subject'
=>
$memo_subject
,
'description'
=>
$text
,
);
}
switch
(
$file
)
{
case
'request/php'
:
$issue_props
=
array
(
'assigned_to_id'
=>
USERID_KVMARTINOV
,
'project_id'
=>
$project_id
,
'subject'
=>
$memo_subject
,
'description'
=>
$text
,
);
break
;
default
:
$issue_props
=
array
(
'assigned_to_id'
=>
USERID_DYOKUNEV
,
'project_id'
=>
$project_id
,
'subject'
=>
$memo_subject
,
'description'
=>
$text
,
);
}
if
(
!
is_null
(
$custom_fields
))
$issue_props
[
'custom_fields'
]
=
$custom_fields
;
...
...
@@ -581,6 +601,7 @@ foreach ($files as $file) {
error
(
'Wrong parameters: '
.
$result
);
$issue_id
=
$issue
->
id
;
}
else
{
$issue_id
=
$_GET
[
'issue-id'
];
}
...
...
mephimemo/template/request/domain-name.tex
0 → 100644
View file @
eb1b4bd
Прошу зарегистрировать доменное имя «[
{
domain-name
}
]» с целью [
{
reason
}
] и закрепить его за [
{
target-type
}
] [
{
target-id
}
].
...
...
Please
register
or
login
to post a comment