Commit c14241ed authored by Reinhold Kainhofer's avatar Reinhold Kainhofer

Add list variable [UserRoles]

parent 7cc620d4
...@@ -318,7 +318,14 @@ class OpenToolsOrdernumbers extends OpenToolsOrdernumbersBasic { ...@@ -318,7 +318,14 @@ class OpenToolsOrdernumbers extends OpenToolsOrdernumbersBasic {
public function setupUserReplacements (&$reps, $details, $nrtype) { public function setupUserReplacements (&$reps, $details, $nrtype) {
$reps["[ipaddress]"] = $details->customer_ip_address; $reps["[ipaddress]"] = $details->customer_ip_address;
$reps["[userid]"] = $details->get_user_id(); $uid = $details->get_user_id();
$userinfo = get_userdata($uid);
$reps["[userid]"] = $uid;
$roles = array();
if (isset($userinfo->roles) && is_array($userinfo->roles)) {
$roles = $userinfo->roles;
}
$reps["[userroles]"] = $roles;
} }
public function setupShippingReplacements(&$reps, $order, $nrtype) { public function setupShippingReplacements(&$reps, $order, $nrtype) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment