Skip to content
Snippets Groups Projects
Commit 59478df3 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #323 from greezybacon/issue/original-name-option


names: Add option for original name

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 1de293a7 25a69a7d
No related branches found
No related tags found
No related merge requests found
...@@ -270,6 +270,7 @@ class PersonsName { ...@@ -270,6 +270,7 @@ class PersonsName {
'short' => array("First L.", 'getShort'), 'short' => array("First L.", 'getShort'),
'shortformal' => array("F. Last", 'getShortFormal'), 'shortformal' => array("F. Last", 'getShortFormal'),
'complete' => array("Mr. First M. Last Sr.", 'getComplete'), 'complete' => array("Mr. First M. Last Sr.", 'getComplete'),
'original' => array('-- As Entered --', 'getOriginal'),
); );
function __construct($name) { function __construct($name) {
...@@ -342,6 +343,16 @@ class PersonsName { ...@@ -342,6 +343,16 @@ class PersonsName {
return $this->name; return $this->name;
} }
function getInitials() {
$names = array($this->parts['first']);
$names = array_merge($names, explode(' ', $this->parts['middle']));
$names[] = $this->parts['last'];
$initials = '';
foreach (array_filter($names) as $n)
$initials .= mb_substr($n,0,1);
return mb_convert_case($initials, MB_CASE_UPPER);
}
function asVar() { function asVar() {
return $this->__toString(); return $this->__toString();
} }
......
...@@ -16,7 +16,7 @@ if ($info['error']) { ...@@ -16,7 +16,7 @@ if ($info['error']) {
<i class="icon-user icon-4x pull-left icon-border"></i> <i class="icon-user icon-4x pull-left icon-border"></i>
<a class="action-button pull-right" style="overflow:inherit" <a class="action-button pull-right" style="overflow:inherit"
id="unselect-user" href="#"><i class="icon-remove"></i> Add New User</a> id="unselect-user" href="#"><i class="icon-remove"></i> Add New User</a>
<div><strong id="user-name"><?php echo $user ? Format::htmlchars($user->getName()) : ''; ?></strong></div> <div><strong id="user-name"><?php echo $user ? Format::htmlchars($user->getName()->getOriginal()) : ''; ?></strong></div>
<div>&lt;<span id="user-email"><?php echo $user ? $user->getEmail() : ''; ?></span>&gt;</div> <div>&lt;<span id="user-email"><?php echo $user ? $user->getEmail() : ''; ?></span>&gt;</div>
<?php if ($user) { ?> <?php if ($user) { ?>
<table style="margin-top: 1em;"> <table style="margin-top: 1em;">
......
...@@ -20,7 +20,7 @@ if ($info['error']) { ...@@ -20,7 +20,7 @@ if ($info['error']) {
<?php <?php
} ?> } ?>
<div><b><a href="#" id="edituser"><i class="icon-edit"></i>&nbsp;<?php <div><b><a href="#" id="edituser"><i class="icon-edit"></i>&nbsp;<?php
echo Format::htmlchars($user->getName()); ?></a></b></div> echo Format::htmlchars($user->getName()->getOriginal()); ?></a></b></div>
<div>&lt;<?php echo $user->getEmail(); ?>&gt;</div> <div>&lt;<?php echo $user->getEmail(); ?>&gt;</div>
<table style="margin-top: 1em;"> <table style="margin-top: 1em;">
<?php foreach ($user->getDynamicData() as $entry) { <?php foreach ($user->getDynamicData() as $entry) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment