From b50fdaccade9cb52d5e5410c26b0aaf1920c950b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 20 Aug 2014 20:37:10 +0100 Subject: [PATCH] CRM-15153 - Give forms a unique css class based on full class name --- CRM/Core/Form.php | 5 +++++ templates/CRM/Activity/Form/Search.tpl | 3 ++- templates/CRM/Activity/Form/Task/FileOnCase.tpl | 2 +- templates/CRM/Admin/Form/Setting/Mapping.tpl | 5 +++-- templates/CRM/Batch/Form/Entry.tpl | 3 ++- templates/CRM/Campaign/Form/Gotv.tpl | 2 +- templates/CRM/Case/Form/Activity/LinkCases.tpl | 2 +- templates/CRM/Contact/Form/Contact.tpl | 2 +- templates/CRM/Contact/Form/Inline/Address.tpl | 4 ++-- templates/CRM/Contact/Form/Relationship.tpl | 2 +- templates/CRM/Contact/Form/Task/Email.tpl | 2 +- templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl | 2 +- templates/CRM/Contribute/Form/Contribution.tpl | 2 +- templates/CRM/Contribute/Form/SoftCredit.tpl | 2 +- templates/CRM/Core/I18n/Form.tpl | 5 +++-- templates/CRM/Event/Form/ManageEvent/EventInfo.tpl | 3 ++- templates/CRM/Event/Form/Participant.tpl | 4 ++-- templates/CRM/Event/Form/ParticipantFeeSelection.tpl | 3 ++- .../CRM/Event/Form/Registration/AdditionalParticipant.tpl | 2 +- templates/CRM/Form/attachment.tpl | 2 +- templates/CRM/Form/validate.tpl | 4 ++-- templates/CRM/Mailing/Form/InsertTokens.tpl | 4 ++-- templates/CRM/Member/Form/Membership.tpl | 4 ++-- templates/CRM/Pledge/Form/Pledge.tpl | 2 +- templates/CRM/SMS/Form/Provider.tpl | 2 +- templates/CRM/Tag/Form/Tag.tpl | 7 ++++--- templates/CRM/common/pager.tpl | 6 +++--- 27 files changed, 49 insertions(+), 37 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 7307c84c3a..3fa2bed56f 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -170,6 +170,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $this->_name = $name; } else { + // CRM-15153 - FIXME this name translates to a DOM id and is not always unique! $this->_name = CRM_Utils_String::getClassName(CRM_Utils_System::getClassName($this)); } @@ -187,6 +188,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page { if (!isset(self::$_template)) { self::$_template = CRM_Core_Smarty::singleton(); } + // Workaround for CRM-15153 - give each form a reasonably unique css class + $this->addClass(CRM_Utils_System::getClassName($this)); $this->assign('snippet', CRM_Utils_Array::value('snippet', $_GET)); } @@ -646,6 +649,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $this->accept($renderer); $content = $renderer->toArray(); $content['formName'] = $this->getName(); + // CRM-15153 + $content['formClass'] = CRM_Utils_System::getClassName($this); return $content; } diff --git a/templates/CRM/Activity/Form/Search.tpl b/templates/CRM/Activity/Form/Search.tpl index c0fe4cbecc..fee095679f 100644 --- a/templates/CRM/Activity/Form/Search.tpl +++ b/templates/CRM/Activity/Form/Search.tpl @@ -88,7 +88,8 @@ {literal} {/literal} diff --git a/templates/CRM/Mailing/Form/InsertTokens.tpl b/templates/CRM/Mailing/Form/InsertTokens.tpl index cf5ebcd07c..9e6129463c 100644 --- a/templates/CRM/Mailing/Form/InsertTokens.tpl +++ b/templates/CRM/Mailing/Form/InsertTokens.tpl @@ -29,7 +29,7 @@