From 1b618ff57c234cec85c76731f4f7edb38fddb51c Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Fri, 22 Oct 2010 10:33:53 +0000 Subject: [PATCH] (Partial) fix for Trac #285: turn email fields into click-able mailto: hyperlinks. SVN:trunk[915] --- core/attributedef.class.inc.php | 7 +++++++ core/dbobject.class.php | 3 ++- css/light-grey.css | 13 +++++++++++++ images/mail.png | Bin 0 -> 348 bytes 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 images/mail.png diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index c9dcd66ed..1626522f7 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -359,6 +359,7 @@ class AttributeLinkedSet extends AttributeDefinition { 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 GetExtKeyToRemote() { return $this->Get('ext_key_to_remote'); } public function GetEditClass() {return "LinkedSet";} + public function DuplicatesAllowed() {$bRet = $this->GetOptional("duplicates", false); echo "

Dups: $bRet

"; 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})$"; } + + public function GetAsHTML($sValue) + { + return ''.parent::GetAsHTML($sValue).''; + } } /** diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 19327ebfc..22504c0d4 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -400,7 +400,8 @@ abstract class DBObject $aAvailableFields = array(); 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); diff --git a/css/light-grey.css b/css/light-grey.css index 7b7d6e44b..089a4b059 100644 --- a/css/light-grey.css +++ b/css/light-grey.css @@ -172,6 +172,19 @@ td a.no-arrow:hover { padding-left:0px; 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 { font-family: Tahoma, Verdana, Arial, Helvetica; font-size: 8pt; diff --git a/images/mail.png b/images/mail.png new file mode 100644 index 0000000000000000000000000000000000000000..20940079904d7a8e40e4005b5ad91cd572a811f7 GIT binary patch literal 348 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>M`nUxc*DCKV1q!m4c>21s-{KPG)Hjq9)wBf)-SKpB46!(U zcakmFAqSBb`+6=t_$e2EQ#mt-eOj^QN%y#tyq)qt=wV;?feIlEUm1~tqWT9 zBqBMdSv@tl|EBs)^Zanu2OCmYRpJZ0bY?JKnSV^;fcLqjDeG!x>x+EZ^TcOe&7PMN zcips1T&z0XVClxWU)F@z^0E}V?aM6A<+VQ)dr|Ml)$a)c=}%s(nO@Xyoy*Gb``nz# zuZlzk-Mqie-6>oqCZQ|oviP{lspmq=coqq|o&LnMSk-Zk=(Uad?1j&CHkKD`UTAbv pXk*2OZ_=U@YNRfgdi?2s_oKt*Oy=_Ex