diff --git a/genpdf/genpdf.php b/genpdf/genpdf.php index dfd1fcc..e564c6c 100644 --- a/genpdf/genpdf.php +++ b/genpdf/genpdf.php @@ -468,8 +468,22 @@ foreach (array('signer', 'contact', 'user', 'recipient') as $key) { } foreach (array('fullname' => 40, 'phonenumber' => 20, 'email' => 30, 'appointment' => 40, 'pgp-id' => 12) as $key => $space) { - if (empty($_GET['signer-'.$key])) - $_GET['signer-'.$key] = str_pad('', $space, '_'); + if (empty($_GET['signer-'.$key])) { + switch ($key) { + case 'phonenumber': + if (isset($_GET['signer-appointment-id']) && !empty($_GET['signer-login'])) { + $voip_result = json_decode(file_get_contents('http://new.voip.mephi.ru/subscribers.json?login='.$_GET['signer-login']), 1); + $_GET['signer-phonenumber'] = @$voip_result['appointments'][0]['EffectiveExtension']; + } + break; + case 'email': + if (isset($_GET['signer-appointment-id']) && !empty($_GET['signer-login'])) + $_GET['signer-email'] = strtolower($_GET['signer-login']).'@mephi.ru'; + break; + } + if (empty($_GET['signer-'.$key])) + $_GET['signer-'.$key] = str_pad('', $space, '_'); + } if (empty($_GET['user-'.$key])) $_GET['user-'.$key] = str_pad('', $space, '_'); @@ -1265,8 +1279,14 @@ foreach ($files as $file) { $qr .= ' \vspace{-2.8cm} \begin{flushleft} - Подготовил(а):\\\\ - '.$_GET['signer-name'].' + {\small + \begin{tabular}{ r l } + \multicolumn{2}{ l }{ Подготовлено: } \\\\ + ФИО: & '.$_GET['signer-name'].' \\\\ + Тел.: & '.$_GET['signer-phonenumber'].' \\\\ + Email: & '.$_GET['signer-email'].' \\\\ + \end{tabular} + } \end{flushleft}'; } break; diff --git a/genpdf/lib/3dparty/Inflect b/genpdf/lib/3dparty/Inflect index a60c8e4..754ec13 160000 --- a/genpdf/lib/3dparty/Inflect +++ b/genpdf/lib/3dparty/Inflect @@ -1 +1 @@ -Subproject commit a60c8e42622081bce1e8a04c0d18eef53791418b +Subproject commit 754ec13a3789333e9c0a2f858116d0aec7edd238