redmine

Improved "Подготовлено:"

@@ -468,8 +468,22 @@ foreach (array('signer', 'contact', 'user', 'recipient') as $key) { @@ -468,8 +468,22 @@ foreach (array('signer', 'contact', 'user', 'recipient') as $key) {
468 } 468 }
469 469
470 foreach (array('fullname' => 40, 'phonenumber' => 20, 'email' => 30, 'appointment' => 40, 'pgp-id' => 12) as $key => $space) { 470 foreach (array('fullname' => 40, 'phonenumber' => 20, 'email' => 30, 'appointment' => 40, 'pgp-id' => 12) as $key => $space) {
471 - if (empty($_GET['signer-'.$key])) 471 + if (empty($_GET['signer-'.$key])) {
472 - $_GET['signer-'.$key] = str_pad('', $space, '_'); 472 + switch ($key) {
  473 + case 'phonenumber':
  474 + if (isset($_GET['signer-appointment-id']) && !empty($_GET['signer-login'])) {
  475 + $voip_result = json_decode(file_get_contents('http://new.voip.mephi.ru/subscribers.json?login='.$_GET['signer-login']), 1);
  476 + $_GET['signer-phonenumber'] = @$voip_result['appointments'][0]['EffectiveExtension'];
  477 + }
  478 + break;
  479 + case 'email':
  480 + if (isset($_GET['signer-appointment-id']) && !empty($_GET['signer-login']))
  481 + $_GET['signer-email'] = strtolower($_GET['signer-login']).'@mephi.ru';
  482 + break;
  483 + }
  484 + if (empty($_GET['signer-'.$key]))
  485 + $_GET['signer-'.$key] = str_pad('', $space, '_');
  486 + }
473 487
474 if (empty($_GET['user-'.$key])) 488 if (empty($_GET['user-'.$key]))
475 $_GET['user-'.$key] = str_pad('', $space, '_'); 489 $_GET['user-'.$key] = str_pad('', $space, '_');
@@ -1265,8 +1279,14 @@ foreach ($files as $file) { @@ -1265,8 +1279,14 @@ foreach ($files as $file) {
1265 $qr .= ' 1279 $qr .= '
1266 \vspace{-2.8cm} 1280 \vspace{-2.8cm}
1267 \begin{flushleft} 1281 \begin{flushleft}
1268 - Подготовил(а):\\\\ 1282 + {\small
1269 - '.$_GET['signer-name'].' 1283 + \begin{tabular}{ r l }
  1284 + \multicolumn{2}{ l }{ Подготовлено: } \\\\
  1285 + ФИО: & '.$_GET['signer-name'].' \\\\
  1286 + Тел.: & '.$_GET['signer-phonenumber'].' \\\\
  1287 + Email: & '.$_GET['signer-email'].' \\\\
  1288 + \end{tabular}
  1289 + }
1270 \end{flushleft}'; 1290 \end{flushleft}';
1271 } 1291 }
1272 break; 1292 break;
Inflect @ 754ec13a
1 -Subproject commit a60c8e42622081bce1e8a04c0d18eef53791418b 1 +Subproject commit 754ec13a3789333e9c0a2f858116d0aec7edd238