redmine

Added a template for domain-name request memos

... ... @@ -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'];
}
... ...
Прошу зарегистрировать доменное имя «[{domain-name}]» с целью [{reason}] и закрепить его за [{target-type}] [{target-id}].
... ...