(Partial) fix for Trac #285: turn email fields into click-able mailto: hyperlinks.

SVN:trunk[915]
This commit is contained in:
Denis Flaven
2010-10-22 10:33:53 +00:00
parent 70149af5d6
commit 1b618ff57c
4 changed files with 22 additions and 1 deletions

View File

@@ -359,6 +359,7 @@ class AttributeLinkedSet extends AttributeDefinition
{ {
return "ERROR: LIST OF OBJECTS"; return "ERROR: LIST OF OBJECTS";
} }
public function DuplicatesAllowed() {return false;} // No duplicates for 1:n links, never
} }
/** /**
@@ -375,6 +376,7 @@ class AttributeLinkedSetIndirect extends AttributeLinkedSet
public function IsIndirect() {return true;} public function IsIndirect() {return true;}
public function GetExtKeyToRemote() { return $this->Get('ext_key_to_remote'); } public function GetExtKeyToRemote() { return $this->Get('ext_key_to_remote'); }
public function GetEditClass() {return "LinkedSet";} public function GetEditClass() {return "LinkedSet";}
public function DuplicatesAllowed() {$bRet = $this->GetOptional("duplicates", false); echo "<p>Dups: $bRet</p>"; return $bRet;} // The same object may be linked several times... or not...
} }
/** /**
@@ -1086,6 +1088,11 @@ class AttributeEmailAddress extends AttributeString
{ {
return "^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$"; return "^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$";
} }
public function GetAsHTML($sValue)
{
return '<a class="mailto" href="mailto:'.$sValue.'">'.parent::GetAsHTML($sValue).'</a>';
}
} }
/** /**

View File

@@ -400,7 +400,8 @@ abstract class DBObject
$aAvailableFields = array(); $aAvailableFields = array();
foreach ($aExtKeyFriends as $sDispAttCode => $oExtField) foreach ($aExtKeyFriends as $sDispAttCode => $oExtField)
{ {
$aAvailableFields[$oExtField->GetExtAttCode()] = $oExtField->GetAsHTML($this->Get($oExtField->GetCode())); // $aAvailableFields[$oExtField->GetExtAttCode()] = $oExtField->GetAsHTML($this->Get($oExtField->GetCode()));
$aAvailableFields[$oExtField->GetExtAttCode()] = $this->Get($oExtField->GetCode());
} }
$sTargetClass = $oAtt->GetTargetClass(EXTKEY_ABSOLUTE); $sTargetClass = $oAtt->GetTargetClass(EXTKEY_ABSOLUTE);

View File

@@ -172,6 +172,19 @@ td a.no-arrow:hover {
padding-left:0px; padding-left:0px;
background: inherit; background: inherit;
} }
td a.mailto, td a.mailto:visited {
text-decoration:none;
color:#000000;
padding-left:20px;
background: url(../images/mail.png) no-repeat left;
}
td a.mailto:hover {
text-decoration:underline;
color:#EB8F00;
padding-left:20px;
background: url(../images/mail.png) no-repeat left;
}
a.small_action { a.small_action {
font-family: Tahoma, Verdana, Arial, Helvetica; font-family: Tahoma, Verdana, Arial, Helvetica;
font-size: 8pt; font-size: 8pt;

BIN
images/mail.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B