From e2046b336f803b1d7ef1181e0c032512b5faf1c2 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 18 Aug 2014 21:49:02 +0100 Subject: [PATCH] CRM-13863 - Get rid of double title for forms that use popups Transfer responsibility for page title from tpl to php. Add setPageTitle helper method to CRM_Core_Form. And a bit of misc form/tpl cleanup --- CRM/ACL/Form/ACL.php | 3 ++ CRM/Activity/Page/Tab.php | 3 -- CRM/Admin/Form.php | 4 +- CRM/Admin/Form/ContactType.php | 3 ++ CRM/Admin/Form/LocationType.php | 5 ++- CRM/Admin/Form/MailSettings.php | 2 + CRM/Admin/Form/Mapping.php | 4 +- CRM/Admin/Form/Options.php | 3 ++ CRM/Admin/Form/RelationshipType.php | 4 +- CRM/Admin/Form/Tag.php | 12 +++--- CRM/Admin/Page/Mapping.php | 2 + CRM/Case/Page/Tab.php | 3 -- CRM/Contact/BAO/Contact.php | 2 +- CRM/Contact/Form/Task.php | 2 +- CRM/Contact/Form/Task/SMS.php | 3 -- CRM/Contact/Page/Inline/ContactName.php | 6 +-- CRM/Contact/Page/View/Note.php | 3 -- CRM/Contact/Page/View/Relationship.php | 3 -- CRM/Contribute/Form/Contribution.php | 15 +++---- CRM/Contribute/Form/ManagePremiums.php | 39 ++----------------- CRM/Contribute/Page/ContributionRecur.php | 3 -- CRM/Contribute/Page/Tab.php | 3 -- CRM/Core/Form.php | 22 +++++++++++ CRM/Custom/Form/DeleteField.php | 3 +- CRM/Custom/Form/Field.php | 2 +- CRM/Custom/Page/Field.php | 4 +- CRM/Event/Form/Participant.php | 6 ++- CRM/Event/Page/Tab.php | 3 -- CRM/Financial/Form/FinancialAccount.php | 9 ++--- CRM/Financial/Form/FinancialBatch.php | 3 ++ CRM/Financial/Form/FinancialType.php | 3 +- CRM/Financial/Form/FinancialTypeAccount.php | 18 ++------- CRM/Grant/Form/Grant.php | 3 +- CRM/Grant/Form/GrantView.php | 2 + CRM/Grant/Page/Tab.php | 3 -- CRM/Grant/Selector/Search.php | 4 -- CRM/Member/Form/Membership.php | 12 +----- CRM/Member/Form/MembershipRenewal.php | 3 ++ CRM/Member/Form/MembershipType.php | 2 + CRM/Member/Page/Tab.php | 3 -- CRM/Note/Form/Note.php | 6 +-- CRM/Pledge/Form/Payment.php | 2 + CRM/Pledge/Form/Pledge.php | 8 +--- CRM/Pledge/Page/Payment.php | 2 - CRM/Pledge/Page/Tab.php | 3 -- CRM/Price/Form/Field.php | 12 +----- CRM/SMS/Form/Provider.php | 2 +- CRM/UF/Form/Field.php | 13 +------ templates/CRM/ACL/Form/ACL.tpl | 1 - templates/CRM/Admin/Form/ContactType.tpl | 5 +-- templates/CRM/Admin/Form/LocationType.tpl | 1 - templates/CRM/Admin/Form/MailSettings.tpl | 1 - templates/CRM/Admin/Form/Mapping.tpl | 1 - templates/CRM/Admin/Form/OptionGroup.tpl | 1 - templates/CRM/Admin/Form/Options.tpl | 1 - templates/CRM/Admin/Form/RelationshipType.tpl | 1 - templates/CRM/Admin/Form/Tag.tpl | 1 - templates/CRM/Admin/Page/ContactType.tpl | 26 ++++++------- templates/CRM/Admin/Page/LocationType.tpl | 36 ++++++++--------- templates/CRM/Admin/Page/MailSettings.tpl | 13 +++---- templates/CRM/Admin/Page/Options.tpl | 17 ++++---- templates/CRM/Admin/Page/RelationshipType.tpl | 13 +++---- templates/CRM/Contact/Page/View/Note.tpl | 10 ----- .../CRM/Contribute/Form/Contribution.tpl | 8 +--- .../CRM/Contribute/Form/ContributionView.tpl | 2 - .../CRM/Contribute/Form/ManagePremiums.tpl | 3 +- templates/CRM/Custom/Form/DeleteField.tpl | 1 - templates/CRM/Event/Form/Participant.tpl | 2 - templates/CRM/Event/Form/ParticipantView.tpl | 1 - .../CRM/Financial/Form/FinancialAccount.tpl | 1 - .../CRM/Financial/Form/FinancialBatch.tpl | 8 ---- .../CRM/Financial/Form/FinancialType.tpl | 1 - .../Financial/Form/FinancialTypeAccount.tpl | 1 - templates/CRM/Grant/Form/Grant.tpl | 8 ---- templates/CRM/Grant/Form/GrantView.tpl | 1 - templates/CRM/Member/Form/Membership.tpl | 3 -- .../CRM/Member/Form/MembershipRenewal.tpl | 1 - templates/CRM/Member/Form/MembershipType.tpl | 3 +- templates/CRM/Member/Form/MembershipView.tpl | 1 - templates/CRM/Pledge/Form/Payment.tpl | 1 - templates/CRM/Pledge/Form/Pledge.tpl | 7 +--- templates/CRM/Pledge/Form/PledgeView.tpl | 1 - templates/CRM/Pledge/Page/Payment.tpl | 12 +++--- templates/CRM/SMS/Form/Provider.tpl | 1 - templates/CRM/SMS/Page/Provider.tpl | 30 ++++++-------- templates/CRM/common/enableDisableApi.tpl | 2 +- 86 files changed, 171 insertions(+), 336 deletions(-) diff --git a/CRM/ACL/Form/ACL.php b/CRM/ACL/Form/ACL.php index 2741d755e1..a787abe90c 100644 --- a/CRM/ACL/Form/ACL.php +++ b/CRM/ACL/Form/ACL.php @@ -121,6 +121,8 @@ class CRM_ACL_Form_ACL extends CRM_Admin_Form { public function buildQuickForm() { parent::buildQuickForm(); + $this->setPageTitle(ts('ACL')); + if ($this->_action & CRM_Core_Action::DELETE) { return; } @@ -311,5 +313,6 @@ class CRM_ACL_Form_ACL extends CRM_Admin_Form { CRM_ACL_BAO_ACL::create($params); } } + } diff --git a/CRM/Activity/Page/Tab.php b/CRM/Activity/Page/Tab.php index 1e5fa71e7e..555d1b7e86 100644 --- a/CRM/Activity/Page/Tab.php +++ b/CRM/Activity/Page/Tab.php @@ -135,9 +135,6 @@ class CRM_Activity_Page_Tab extends CRM_Core_Page { // check logged in url permission CRM_Contact_Page_View::checkUserPermission($this); - // set page title - CRM_Contact_Page_View::setTitle($this->_contactId); - $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->assign('action', $this->_action); diff --git a/CRM/Admin/Form.php b/CRM/Admin/Form.php index 6f18f00607..0f6a1d407b 100644 --- a/CRM/Admin/Form.php +++ b/CRM/Admin/Form.php @@ -75,7 +75,7 @@ class CRM_Admin_Form extends CRM_Core_Form { } /** - * This function sets the default values for the form. MobileProvider that in edit/view mode + * This function sets the default values for the form. Note that in edit/view mode * the default values are retrieved from the database * * @access public @@ -112,7 +112,7 @@ class CRM_Admin_Form extends CRM_Core_Form { * @access public */ public function buildQuickForm() { - if ($this->_action & CRM_Core_Action::VIEW) { + if ($this->_action & CRM_Core_Action::VIEW || $this->_action & CRM_Core_Action::PREVIEW) { $this->addButtons(array( array( 'type' => 'cancel', diff --git a/CRM/Admin/Form/ContactType.php b/CRM/Admin/Form/ContactType.php index 0f900b9296..74211e0ea0 100644 --- a/CRM/Admin/Form/ContactType.php +++ b/CRM/Admin/Form/ContactType.php @@ -47,6 +47,8 @@ class CRM_Admin_Form_ContactType extends CRM_Admin_Form { */ public function buildQuickForm() { parent::buildQuickForm(); + $this->setPageTitle(ts('Contact Type')); + if ($this->_action & CRM_Core_Action::DELETE) { return; } @@ -153,5 +155,6 @@ class CRM_Admin_Form_ContactType extends CRM_Admin_Form { array(1 => $contactType->label) ), ts('Saved'), 'success'); } + } diff --git a/CRM/Admin/Form/LocationType.php b/CRM/Admin/Form/LocationType.php index 8252d55180..8e8dcf64f5 100644 --- a/CRM/Admin/Form/LocationType.php +++ b/CRM/Admin/Form/LocationType.php @@ -46,8 +46,8 @@ class CRM_Admin_Form_LocationType extends CRM_Admin_Form { * @access public */ public function buildQuickForm() { - parent::buildQuickForm(); + $this->setPageTitle(ts('Location Type')); if ($this->_action & CRM_Core_Action::DELETE) { return; @@ -70,7 +70,7 @@ class CRM_Admin_Form_LocationType extends CRM_Admin_Form { 'variable' ); - $this->add('text', 'display_name', ts('Display Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_LocationType', 'display_name')); + $this->add('text', 'display_name', ts('Display Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_LocationType', 'display_name'), TRUE); $this->add('text', 'vcard_name', ts('vCard Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_LocationType', 'vcard_name')); $this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_LocationType', 'description')); @@ -127,4 +127,5 @@ class CRM_Admin_Form_LocationType extends CRM_Admin_Form { array(1 => $locationType->name) ), ts('Saved'), 'success'); } + } diff --git a/CRM/Admin/Form/MailSettings.php b/CRM/Admin/Form/MailSettings.php index 34b9ae12af..f66de121e3 100644 --- a/CRM/Admin/Form/MailSettings.php +++ b/CRM/Admin/Form/MailSettings.php @@ -47,6 +47,7 @@ class CRM_Admin_Form_MailSettings extends CRM_Admin_Form { */ public function buildQuickForm() { parent::buildQuickForm(); + $this->setPageTitle(ts('Mail Account')); if ($this->_action & CRM_Core_Action::DELETE) { return; @@ -182,5 +183,6 @@ class CRM_Admin_Form_MailSettings extends CRM_Admin_Form { CRM_Core_Session::setStatus("", ts('Changes Not Saved.'), "info"); } } + } diff --git a/CRM/Admin/Form/Mapping.php b/CRM/Admin/Form/Mapping.php index 38b3fcf592..ae1806af2a 100644 --- a/CRM/Admin/Form/Mapping.php +++ b/CRM/Admin/Form/Mapping.php @@ -55,6 +55,8 @@ class CRM_Admin_Form_Mapping extends CRM_Admin_Form { public function buildQuickForm() { parent::buildQuickForm(); + $this->setPageTitle(ts('Field Mapping')); + if ($this->_action == CRM_Core_Action::DELETE) { return; } @@ -110,6 +112,6 @@ class CRM_Admin_Form_Mapping extends CRM_Admin_Form { CRM_Core_BAO_Mapping::add($params); } } - //end of function + } diff --git a/CRM/Admin/Form/Options.php b/CRM/Admin/Form/Options.php index a380f05534..8282796976 100644 --- a/CRM/Admin/Form/Options.php +++ b/CRM/Admin/Form/Options.php @@ -150,6 +150,8 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { */ public function buildQuickForm() { parent::buildQuickForm(); + $this->setPageTitle(ts('%1 Option', array(1 => $this->_gLabel))); + if ($this->_action & CRM_Core_Action::DELETE) { return; } @@ -437,4 +439,5 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array(1 => $this->_gLabel, 2 => $optionValue->label)), ts('Saved'), 'success'); } } + } diff --git a/CRM/Admin/Form/RelationshipType.php b/CRM/Admin/Form/RelationshipType.php index 995450231d..c03c8fc82f 100644 --- a/CRM/Admin/Form/RelationshipType.php +++ b/CRM/Admin/Form/RelationshipType.php @@ -47,9 +47,9 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form { */ public function buildQuickForm() { parent::buildQuickForm(); + $this->setPageTitle(ts('Relationship Type')); if ($this->_action & CRM_Core_Action::DELETE) { - return; } @@ -171,6 +171,6 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form { CRM_Core_Session::setStatus(ts('The Relationship Type has been saved.'), ts('Saved'), 'success'); } } - //end of function + } diff --git a/CRM/Admin/Form/Tag.php b/CRM/Admin/Form/Tag.php index f1812e8db7..5346a4d6c9 100644 --- a/CRM/Admin/Form/Tag.php +++ b/CRM/Admin/Form/Tag.php @@ -47,12 +47,12 @@ class CRM_Admin_Form_Tag extends CRM_Admin_Form { * @access public */ public function buildQuickForm() { + $this->setPageTitle($this->_isTagSet ? ts('Tag Set') : ts('Tag')); + if ($this->_action == CRM_Core_Action::DELETE) { if ($this->_id && $tag = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Tag', $this->_id, 'name', 'parent_id')) { - CRM_Core_Session::setStatus(ts("This tag cannot be deleted. You must delete all its child tags ('%1', etc) prior to deleting this tag.", array(1 => $tag)), ts('Sorry'), 'error'); $url = CRM_Utils_System::url('civicrm/admin/tag', "reset=1"); - CRM_Utils_System::redirect($url); - return TRUE; + CRM_Core_Error::statusBounce(ts("This tag cannot be deleted. You must delete all its child tags ('%1', etc) prior to deleting this tag.", array(1 => $tag)), $url); } } else { @@ -65,7 +65,7 @@ class CRM_Admin_Form_Tag extends CRM_Admin_Form { $this->_isTagSet = TRUE; } - $allTag = array('' => '- ' . ts('select') . ' -') + CRM_Core_BAO_Tag::getTagsNotInTagset(); + $allTag = array('' => ts('- select -')) + CRM_Core_BAO_Tag::getTagsNotInTagset(); if ($this->_id) { unset($allTag[$this->_id]); @@ -89,7 +89,7 @@ class CRM_Admin_Form_Tag extends CRM_Admin_Form { ); //@lobo haven't a clue why the checkbox isn't displayed (it should be checked by default - $this->add('checkbox', 'is_selectable', ts("If it's a tag or a category")); + $this->add('checkbox', 'is_selectable'); $isReserved = $this->add('checkbox', 'is_reserved', ts('Reserved?')); @@ -159,6 +159,6 @@ class CRM_Admin_Form_Tag extends CRM_Admin_Form { CRM_Core_Session::setStatus(ts('The tag \'%1\' has been saved.', array(1 => $tag->name)), ts('Saved'), 'success'); } } - //end of function + } diff --git a/CRM/Admin/Page/Mapping.php b/CRM/Admin/Page/Mapping.php index 95c1ed9eb3..ac9bb3587f 100644 --- a/CRM/Admin/Page/Mapping.php +++ b/CRM/Admin/Page/Mapping.php @@ -38,6 +38,8 @@ */ class CRM_Admin_Page_Mapping extends CRM_Core_Page_Basic { + public $useLivePageJS = TRUE; + /** * The action links that we need to display for the browse screen * diff --git a/CRM/Case/Page/Tab.php b/CRM/Case/Page/Tab.php index 5706c0a9bb..2c83b33a87 100644 --- a/CRM/Case/Page/Tab.php +++ b/CRM/Case/Page/Tab.php @@ -81,9 +81,6 @@ class CRM_Case_Page_Tab extends CRM_Core_Page { else { CRM_Contact_Page_View::checkUserPermission($this); } - - // set page title - CRM_Contact_Page_View::setTitle($this->_contactId); } else { if ($this->_action & CRM_Core_Action::VIEW) { diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 16b703190d..2f93f8eb08 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -3191,7 +3191,7 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id ) * * @param int $contactId contact id. * - * @return true if present else false. + * @return bool true if present else false. * @access public * @static */ diff --git a/CRM/Contact/Form/Task.php b/CRM/Contact/Form/Task.php index b9eb35da8e..b783d0230d 100644 --- a/CRM/Contact/Form/Task.php +++ b/CRM/Contact/Form/Task.php @@ -332,7 +332,7 @@ class CRM_Contact_Form_Task extends CRM_Core_Form { * * @access public * - * @return void + * @return array */ function setDefaultValues() { $defaults = array(); diff --git a/CRM/Contact/Form/Task/SMS.php b/CRM/Contact/Form/Task/SMS.php index 0c3918fa21..5eb487817e 100644 --- a/CRM/Contact/Form/Task/SMS.php +++ b/CRM/Contact/Form/Task/SMS.php @@ -59,9 +59,6 @@ class CRM_Contact_Form_Task_SMS extends CRM_Contact_Form_Task { $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE); - if ($cid) { - CRM_Contact_Page_View::setTitle($cid); - } CRM_Contact_Form_Task_SMSCommon::preProcessProvider($this); diff --git a/CRM/Contact/Page/Inline/ContactName.php b/CRM/Contact/Page/Inline/ContactName.php index 9e27fc6b8b..a8ff5d513d 100644 --- a/CRM/Contact/Page/Inline/ContactName.php +++ b/CRM/Contact/Page/Inline/ContactName.php @@ -60,11 +60,7 @@ class CRM_Contact_Page_Inline_ContactName extends CRM_Core_Page { $this->assign('title', $title); // Check if this is default domain contact CRM-10482 - if (CRM_Contact_BAO_Contact::checkDomainContact($contactId)) { - $this->assign('domainContact', TRUE); - } else { - $this->assign('domainContact', FALSE); - } + $this->assign('domainContact', CRM_Contact_BAO_Contact::checkDomainContact($contactId)); // check logged in user permission CRM_Contact_Page_View::checkUserPermission($this, $contactId); diff --git a/CRM/Contact/Page/View/Note.php b/CRM/Contact/Page/View/Note.php index 6ab9c26692..8a9e8ca44f 100644 --- a/CRM/Contact/Page/View/Note.php +++ b/CRM/Contact/Page/View/Note.php @@ -208,9 +208,6 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { // check logged in url permission CRM_Contact_Page_View::checkUserPermission($this); - // set page title - CRM_Contact_Page_View::setTitle($this->_contactId); - $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId); CRM_Utils_System::setTitle(ts('Notes for') . ' ' . $displayName); diff --git a/CRM/Contact/Page/View/Relationship.php b/CRM/Contact/Page/View/Relationship.php index 3738957ff3..944a373f13 100644 --- a/CRM/Contact/Page/View/Relationship.php +++ b/CRM/Contact/Page/View/Relationship.php @@ -198,9 +198,6 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { // check logged in url permission CRM_Contact_Page_View::checkUserPermission($this); - // set page title - CRM_Contact_Page_View::setTitle($this->_contactId); - $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->assign('action', $this->_action); } diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index cfefe62ec1..34420056ca 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -331,16 +331,11 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $this->assign('lineItem', empty($this->_lineItems) ? FALSE : $this->_lineItems); // Set title - if ($this->_contactID) { - $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactID); - - // Check if this is default domain contact CRM-10482 - if (CRM_Contact_BAO_Contact::checkDomainContact($this->_contactID)) { - $displayName .= ' (' . ts('default organization') . ')'; - } - - // omitting contactImage from title for now since the summary overlay css doesn't work outside of our crm-container - CRM_Utils_System::setTitle(ts('Contribution from') . ' ' . $displayName); + if ($this->_mode) { + $this->setPageTitle($this->_ppID ? ts('Credit Card Pledge Payment') : ts('Credit Card Contribution')); + } + else { + $this->setPageTitle($this->_ppID ? ts('Pledge Payment') : ts('Contribution')); } if ($this->_id) { diff --git a/CRM/Contribute/Form/ManagePremiums.php b/CRM/Contribute/Form/ManagePremiums.php index 0787a131b6..4c9c34bbdf 100644 --- a/CRM/Contribute/Form/ManagePremiums.php +++ b/CRM/Contribute/Form/ManagePremiums.php @@ -93,36 +93,15 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form { * @access public */ public function buildQuickForm() { - //parent::buildQuickForm( ); + parent::buildQuickForm( ); + $this->setPageTitle(ts('Premium Product')); if ($this->_action & CRM_Core_Action::PREVIEW) { CRM_Contribute_BAO_Premium::buildPremiumPreviewBlock($this, $this->_id); - - $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Done with Preview'), - 'isDefault' => TRUE, - ), - ) - ); - return; } if ($this->_action & CRM_Core_Action::DELETE) { - $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); return; } @@ -210,19 +189,6 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form { $this->addFormRule(array('CRM_Contribute_Form_ManagePremiums', 'formRule')); - $this->addButtons(array( - array( - 'type' => 'upload', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); - $this->assign('productId', $this->_id); } @@ -420,5 +386,6 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form { $config = CRM_Core_Config::singleton(); return $config->imageUploadURL.basename($newFilename); } + } diff --git a/CRM/Contribute/Page/ContributionRecur.php b/CRM/Contribute/Page/ContributionRecur.php index c9056a964f..be2c84832f 100644 --- a/CRM/Contribute/Page/ContributionRecur.php +++ b/CRM/Contribute/Page/ContributionRecur.php @@ -81,9 +81,6 @@ class CRM_Contribute_Page_ContributionRecur extends CRM_Core_Page { // check logged in url permission CRM_Contact_Page_View::checkUserPermission($this); - // set page title - CRM_Contact_Page_View::setTitle($this->_contactId); - $this->assign('action', $this->_action); if ($this->_permission == CRM_Core_Permission::EDIT && !CRM_Core_Permission::check('edit contributions')) { diff --git a/CRM/Contribute/Page/Tab.php b/CRM/Contribute/Page/Tab.php index 94d7adf2ac..c63ae358cf 100644 --- a/CRM/Contribute/Page/Tab.php +++ b/CRM/Contribute/Page/Tab.php @@ -259,9 +259,6 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { // check logged in url permission CRM_Contact_Page_View::checkUserPermission($this); - - // set page title - CRM_Contact_Page_View::setTitle($this->_contactId); } $this->assign('action', $this->_action); diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 562d3fe970..13a097844b 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -1674,5 +1674,27 @@ class CRM_Core_Form extends HTML_QuickForm_Page { function allowAjaxSubmit() { $this->removeAttribute('data-no-ajax-submit'); } + + /** + * Sets page title based on entity and action + * @param string $entityLabel + */ + function setPageTitle($entityLabel) { + switch ($this->_action) { + case CRM_Core_Action::ADD: + CRM_Utils_System::setTitle(ts('New %1', array(1 => $entityLabel))); + break; + case CRM_Core_Action::UPDATE: + CRM_Utils_System::setTitle(ts('Edit %1', array(1 => $entityLabel))); + break; + case CRM_Core_Action::VIEW: + case CRM_Core_Action::PREVIEW: + CRM_Utils_System::setTitle(ts('View %1', array(1 => $entityLabel))); + break; + case CRM_Core_Action::DELETE: + CRM_Utils_System::setTitle(ts('Delete %1', array(1 => $entityLabel))); + break; + } + } } diff --git a/CRM/Custom/Form/DeleteField.php b/CRM/Custom/Form/DeleteField.php index 49543efc04..cd7c6dc75d 100644 --- a/CRM/Custom/Form/DeleteField.php +++ b/CRM/Custom/Form/DeleteField.php @@ -69,9 +69,8 @@ class CRM_Custom_Form_DeleteField extends CRM_Core_Form { CRM_Core_BAO_CustomField::retrieve($params, $defaults); $this->_title = CRM_Utils_Array::value('label', $defaults); - $this->assign('title', $this->_title); - CRM_Utils_System::setTitle(ts('Confirm Custom Field Delete')); + CRM_Utils_System::setTitle(ts('Delete %1', array(1 => $this->_title))); } /** diff --git a/CRM/Custom/Form/Field.php b/CRM/Custom/Form/Field.php index 4c368c8ae2..cce4f2b958 100644 --- a/CRM/Custom/Form/Field.php +++ b/CRM/Custom/Form/Field.php @@ -280,7 +280,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form { public function buildQuickForm() { if ($this->_gid) { $this->_title = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'title'); - CRM_Utils_System::setTitle($this->_title . ' - ' . ($this->_id ? ts('Edit Field') : ts('Add Field'))); + CRM_Utils_System::setTitle($this->_title . ' - ' . ($this->_id ? ts('Edit Field') : ts('New Field'))); $this->assign('gid', $this->_gid); } diff --git a/CRM/Custom/Page/Field.php b/CRM/Custom/Page/Field.php index 0085da3368..84507d6808 100644 --- a/CRM/Custom/Page/Field.php +++ b/CRM/Custom/Page/Field.php @@ -276,7 +276,9 @@ class CRM_Custom_Page_Field extends CRM_Core_Page { $groupTitle = CRM_Core_BAO_CustomGroup::getTitle($this->_gid); $this->assign('gid', $this->_gid); $this->assign('groupTitle', $groupTitle); - CRM_Utils_System::setTitle(ts('%1 - Custom Fields', array(1 => $groupTitle))); + if ($action & CRM_Core_Action::BROWSE) { + CRM_Utils_System::setTitle(ts('%1 - Custom Fields', array(1 => $groupTitle))); + } } // assign vars to templates diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index fdfb16e1d0..ef44f13493 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -218,8 +218,10 @@ class CRM_Event_Form_Participant extends CRM_Contact_Form_Task { if ($this->_contactId) { $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId); $this->assign('displayName', $displayName); - // omitting contactImage from title for now since the summary overlay css doesn't work outside of our crm-container - CRM_Utils_System::setTitle(ts('Event Registration for') . ' ' . $displayName); + $this->setPageTitle(ts('Event Registration for %1', array(1 => $displayName))); + } + else { + $this->setPageTitle(ts('Event Registration')); } // check the current path, if search based, then dont get participantID diff --git a/CRM/Event/Page/Tab.php b/CRM/Event/Page/Tab.php index 9d971eba44..8a8ab7bb7a 100644 --- a/CRM/Event/Page/Tab.php +++ b/CRM/Event/Page/Tab.php @@ -135,9 +135,6 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { // check logged in url permission CRM_Contact_Page_View::checkUserPermission($this); - - // set page title - CRM_Contact_Page_View::setTitle($this->_contactId); } $this->assign('action', $this->_action); diff --git a/CRM/Financial/Form/FinancialAccount.php b/CRM/Financial/Form/FinancialAccount.php index a04b33276f..25bb316754 100644 --- a/CRM/Financial/Form/FinancialAccount.php +++ b/CRM/Financial/Form/FinancialAccount.php @@ -68,12 +68,7 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form { $this->_isARFlag = TRUE; if ($this->_action & CRM_Core_Action::DELETE) { $msg = ts("The selected financial account cannot be deleted because at least one Accounts Receivable type account is required (to ensure that accounting transactions are in balance)."); - if (CRM_Utils_Array::value('snippet', $_REQUEST) == 'json') { - CRM_Core_Page_AJAX::returnJsonResponse($msg); - } - CRM_Core_Session::setStatus($msg, '', 'error'); - CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/financial/financialAccount', - "reset=1&action=browse")); + CRM_Core_Error::statusBounce($msg); } } } @@ -87,6 +82,7 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form { */ public function buildQuickForm( ) { parent::buildQuickForm( ); + $this->setPageTitle(ts('Financial Account')); if ($this->_action & CRM_Core_Action::DELETE) { return; @@ -194,4 +190,5 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form { CRM_Core_Session::setStatus(ts('The Financial Account \'%1\' has been saved.', array(1 => $contributionType->name))); } } + } diff --git a/CRM/Financial/Form/FinancialBatch.php b/CRM/Financial/Form/FinancialBatch.php index 4bed5d72f6..4b4846c033 100644 --- a/CRM/Financial/Form/FinancialBatch.php +++ b/CRM/Financial/Form/FinancialBatch.php @@ -90,6 +90,8 @@ class CRM_Financial_Form_FinancialBatch extends CRM_Contribute_Form { */ public function buildQuickForm() { parent::buildQuickForm(); + $this->setPageTitle(ts('Financial Batch')); + if (isset( $this->_id)) { $this->_title = CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $this->_id, 'title'); CRM_Utils_System::setTitle($this->_title .' - '.ts( 'Accounting Batch')); @@ -315,6 +317,7 @@ class CRM_Financial_Form_FinancialBatch extends CRM_Contribute_Form { CRM_Core_Error::statusBounce(ts('You dont have permission to %1 this batch'), array(1 => $actionName)); } } + } diff --git a/CRM/Financial/Form/FinancialType.php b/CRM/Financial/Form/FinancialType.php index 1a780db3d6..7d75bfefe6 100644 --- a/CRM/Financial/Form/FinancialType.php +++ b/CRM/Financial/Form/FinancialType.php @@ -48,11 +48,11 @@ class CRM_Financial_Form_FinancialType extends CRM_Contribute_Form { */ public function buildQuickForm() { parent::buildQuickForm(); + $this->setPageTitle(ts('Financial Type')); $this->_id = CRM_Utils_Request::retrieve('id' , 'Positive', $this); if ($this->_id) { $this->_title = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $this->_id, 'name'); - CRM_Utils_System::setTitle($this->_title . ' - ' . ts( 'Financial Type')); } if ($this->_action & CRM_Core_Action::DELETE) { return; @@ -129,4 +129,5 @@ class CRM_Financial_Form_FinancialType extends CRM_Contribute_Form { $session->replaceUserContext($url); } } + } diff --git a/CRM/Financial/Form/FinancialTypeAccount.php b/CRM/Financial/Form/FinancialTypeAccount.php index 00fcecc471..fc907db9e2 100644 --- a/CRM/Financial/Form/FinancialTypeAccount.php +++ b/CRM/Financial/Form/FinancialTypeAccount.php @@ -127,24 +127,13 @@ class CRM_Financial_Form_FinancialTypeAccount extends CRM_Contribute_Form { * @access public */ public function buildQuickForm() { + parent::buildQuickForm(); + $this->setPageTitle(ts('Financial Type Account'));); + if ($this->_action & CRM_Core_Action::DELETE) { - $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete Financial Account Type'), - 'spacing' => '         ', - 'isDefault' => TRUE - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel')) - ) - ); return; } - parent::buildQuickForm(); - if (isset($this->_id)) { $params = array('id' => $this->_id); CRM_Financial_BAO_FinancialTypeAccount::retrieve($params, $defaults); @@ -351,6 +340,7 @@ class CRM_Financial_Form_FinancialTypeAccount extends CRM_Contribute_Form { "reset=1&action=browse&aid={$this->_aid}")); } } + } diff --git a/CRM/Grant/Form/Grant.php b/CRM/Grant/Form/Grant.php index eac98fec4a..1c8c6a90d2 100644 --- a/CRM/Grant/Form/Grant.php +++ b/CRM/Grant/Form/Grant.php @@ -90,6 +90,8 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form { CRM_Core_Error::fatal(ts('You do not have permission to access this page')); } + $this->setPageTitle(ts('Grant')); + if ($this->_action & CRM_Core_Action::DELETE) { return; } @@ -123,7 +125,6 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form { return CRM_Custom_Form_CustomData::setDefaultValues($this); } - $defaults = array(); $defaults = parent::setDefaultValues(); if ($this->_action & CRM_Core_Action::DELETE) { diff --git a/CRM/Grant/Form/GrantView.php b/CRM/Grant/Form/GrantView.php index 859343647a..1b0fc3b797 100644 --- a/CRM/Grant/Form/GrantView.php +++ b/CRM/Grant/Form/GrantView.php @@ -117,6 +117,8 @@ class CRM_Grant_Form_GrantView extends CRM_Core_Form { CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree); $this->assign('id', $this->_id); + + $this->setPageTitle(ts('Grant')); } /** diff --git a/CRM/Grant/Page/Tab.php b/CRM/Grant/Page/Tab.php index 03518b187f..0094dcdc17 100644 --- a/CRM/Grant/Page/Tab.php +++ b/CRM/Grant/Page/Tab.php @@ -122,9 +122,6 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View { // check logged in url permission CRM_Contact_Page_View::checkUserPermission($this); - - // set page title - CRM_Utils_System::setTitle(ts('Grant by') . ' ' . $displayName); } $this->assign('action', $this->_action); diff --git a/CRM/Grant/Selector/Search.php b/CRM/Grant/Selector/Search.php index 70112e1daf..d481ac9483 100644 --- a/CRM/Grant/Selector/Search.php +++ b/CRM/Grant/Selector/Search.php @@ -209,13 +209,10 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co ); if ($cid) { - $deleteExtra = ts('Are you sure you want to delete this grant?'); - $delLink = array( CRM_Core_Action::DELETE => array('name' => ts('Delete'), 'url' => 'civicrm/contact/view/grant', 'qs' => 'action=delete&reset=1&cid=%%cid%%&id=%%id%%&selectedChild=grant' . $extraParams, - 'extra' => 'onclick = "if (confirm(\'' . $deleteExtra . '\') ) this.href+=\'&confirmed=1\'; else return false;"', 'title' => ts('Delete Grant'), ), ); @@ -224,7 +221,6 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co } return self::$_links; } - //end of function /** * getter for array of the parameters required for creating pager. diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 3180b299f8..a865ddb8a0 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -269,18 +269,8 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { $this->assign('onlinePendingContributionId', $this->_onlinePendingContributionId); $this->_fromEmails = CRM_Core_BAO_Email::getFromEmail(); - // Set title - if ($this->_contactID) { - $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactID); - - // Check if this is default domain contact CRM-10482 - if (CRM_Contact_BAO_Contact::checkDomainContact($this->_contactID)) { - $displayName .= ' (' . ts('default organization') . ')'; - } + $this->setPageTitle(ts('Membership')); - // omitting contactImage from title for now since the summary overlay css doesn't work outside of our crm-container - CRM_Utils_System::setTitle(ts('Membership for') . ' ' . $displayName); - } parent::preProcess(); } diff --git a/CRM/Member/Form/MembershipRenewal.php b/CRM/Member/Form/MembershipRenewal.php index cc3a1c53bc..e0de74e80c 100644 --- a/CRM/Member/Form/MembershipRenewal.php +++ b/CRM/Member/Form/MembershipRenewal.php @@ -197,6 +197,9 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form { } $this->_fromEmails = CRM_Core_BAO_Email::getFromEmail(); + + CRM_Utils_System::setTitle(ts('Renew Membership')); + parent::preProcess(); } diff --git a/CRM/Member/Form/MembershipType.php b/CRM/Member/Form/MembershipType.php index 17e0b726e0..4cca8ce15d 100644 --- a/CRM/Member/Form/MembershipType.php +++ b/CRM/Member/Form/MembershipType.php @@ -53,6 +53,8 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form { $session = CRM_Core_Session::singleton(); $url = CRM_Utils_System::url('civicrm/admin/member/membershipType', 'reset=1'); $session->pushUserContext($url); + + $this->setPageTitle(ts('Membership Type')); } /** diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php index 72e7d2b293..e451396b50 100644 --- a/CRM/Member/Page/Tab.php +++ b/CRM/Member/Page/Tab.php @@ -297,9 +297,6 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { // check logged in url permission CRM_Contact_Page_View::checkUserPermission($this); - - // set page title - CRM_Contact_Page_View::setTitle($this->_contactId); } $this->assign('action', $this->_action); diff --git a/CRM/Note/Form/Note.php b/CRM/Note/Form/Note.php index eec3f9f321..79f23507ad 100644 --- a/CRM/Note/Form/Note.php +++ b/CRM/Note/Form/Note.php @@ -83,11 +83,7 @@ class CRM_Note_Form_Note extends CRM_Core_Form { if ($this->_id && CRM_Core_BAO_Note::getNotePrivacyHidden($this->_id)) { CRM_Core_Error::statusBounce(ts('You do not have access to this note.')); } - - // set title to "Note - " + Contact Name - $displayName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_entityId, 'display_name'); - $pageTitle = 'Note - ' . $displayName; - $this->assign('pageTitle', $pageTitle); + $this->setPageTitle($this->_parentId ? ts('Comment') : ts('Note')); } /** diff --git a/CRM/Pledge/Form/Payment.php b/CRM/Pledge/Form/Payment.php index c491621b9a..83b8f2336e 100644 --- a/CRM/Pledge/Form/Payment.php +++ b/CRM/Pledge/Form/Payment.php @@ -60,6 +60,8 @@ class CRM_Pledge_Form_Payment extends CRM_Core_Form { } $this->_id = CRM_Utils_Request::retrieve('ppId', 'Positive', $this); + + CRM_Utils_System::setTitle(ts('Edit Scheduled Pledge Payment')); } /** diff --git a/CRM/Pledge/Form/Pledge.php b/CRM/Pledge/Form/Pledge.php index 6db57883b3..bce71ce4d2 100644 --- a/CRM/Pledge/Form/Pledge.php +++ b/CRM/Pledge/Form/Pledge.php @@ -105,14 +105,10 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $this->userEmail ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID); $this->assign('displayName', $this->userDisplayName); - - // set title to "Pledge - "+Contact Name - $displayName = $this->userDisplayName; - $pageTitle = ts('Pledge by'). ' ' . $displayName; - $this->assign('pageTitle', $pageTitle); - CRM_Utils_System::setTitle($pageTitle); } + $this->setPageTitle(ts('Pledge')); + //build custom data CRM_Custom_Form_CustomData::preProcess($this, NULL, NULL, 1, 'Pledge', $this->_id); $this->_values = array(); diff --git a/CRM/Pledge/Page/Payment.php b/CRM/Pledge/Page/Payment.php index 6d5ab08dc2..56e7462e47 100644 --- a/CRM/Pledge/Page/Payment.php +++ b/CRM/Pledge/Page/Payment.php @@ -53,8 +53,6 @@ class CRM_Pledge_Page_Payment extends CRM_Core_Page { if ($this->_action & CRM_Core_Action::UPDATE) { $this->edit(); - // set page title - CRM_Contact_Page_View::setTitle($this->_contactId); } else { $pledgeId = CRM_Utils_Request::retrieve('pledgeId', 'Positive', $this); diff --git a/CRM/Pledge/Page/Tab.php b/CRM/Pledge/Page/Tab.php index 15b9f2f8ff..68df77e40c 100644 --- a/CRM/Pledge/Page/Tab.php +++ b/CRM/Pledge/Page/Tab.php @@ -112,9 +112,6 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { // check logged in url permission CRM_Contact_Page_View::checkUserPermission($this); - - // set page title - CRM_Contact_Page_View::setTitle($this->_contactId); } $this->assign('action', $this->_action); diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index 3870e0dbc5..e0ec35e89f 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -96,17 +96,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form { CRM_Utils_System::appendBreadCrumb($breadCrumb); - switch ($this->_action) { - case CRM_Core_Action::ADD: - CRM_Utils_System::setTitle(ts('Add Price Field')); - break; - case CRM_Core_Action::UPDATE: - CRM_Utils_System::setTitle(ts('Edit Price Field')); - break; - case CRM_Core_Action::DELETE: - CRM_Utils_System::setTitle(ts('Delete Price Field')); - break; - } + $this->setPageTitle(ts('Price Field')); } /** diff --git a/CRM/SMS/Form/Provider.php b/CRM/SMS/Form/Provider.php index 6ec36832fb..753039b159 100644 --- a/CRM/SMS/Form/Provider.php +++ b/CRM/SMS/Form/Provider.php @@ -43,7 +43,7 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form { $this->_id = $this->get('id'); - CRM_Utils_System::setTitle(ts('Manage - SMS Providers')); + $this->setPageTitle(ts('SMS Provider')); if ($this->_id) { $refreshURL = CRM_Utils_System::url('civicrm/admin/sms/provider', diff --git a/CRM/UF/Form/Field.php b/CRM/UF/Form/Field.php index 87c276cb35..97a936c763 100644 --- a/CRM/UF/Form/Field.php +++ b/CRM/UF/Form/Field.php @@ -106,17 +106,8 @@ class CRM_UF_Form_Field extends CRM_Core_Form { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); if ($this->_gid) { $this->_title = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $this->_gid, 'title'); - switch ($this->_action) { - case CRM_Core_Action::ADD: - CRM_Utils_System::setTitle(ts('Add Profile Field')); - break; - case CRM_Core_Action::UPDATE: - CRM_Utils_System::setTitle(ts('Edit Profile Field')); - break; - case CRM_Core_Action::DELETE: - CRM_Utils_System::setTitle(ts('Delete Profile Field')); - break; - } + + $this->setPageTitle(ts('Profile Field')); $url = CRM_Utils_System::url('civicrm/admin/uf/group/field', "reset=1&action=browse&gid={$this->_gid}" diff --git a/templates/CRM/ACL/Form/ACL.tpl b/templates/CRM/ACL/Form/ACL.tpl index b6608bf978..ad10a2d2f1 100644 --- a/templates/CRM/ACL/Form/ACL.tpl +++ b/templates/CRM/ACL/Form/ACL.tpl @@ -24,7 +24,6 @@ +--------------------------------------------------------------------+ *} {* this template is used for adding/editing ACL *} -

{if $action eq 1}{ts}New ACL{/ts}{elseif $action eq 2}{ts}Edit ACL{/ts}{else}{ts}Delete ACL{/ts}{/if}

{if $action eq 8}
diff --git a/templates/CRM/Admin/Form/ContactType.tpl b/templates/CRM/Admin/Form/ContactType.tpl index cce3627d6c..660de87b81 100644 --- a/templates/CRM/Admin/Form/ContactType.tpl +++ b/templates/CRM/Admin/Form/ContactType.tpl @@ -25,7 +25,6 @@ *} {* this template is used for adding/editing Contact Type *} -

{if $action eq 1}{ts}New Contact Type{/ts}{elseif $action eq 2}{ts}Edit Contact Type{/ts}{else}{ts}Delete Contact Type{/ts}{/if}

{if $action eq 8}
@@ -53,8 +52,8 @@ {/if} - {$form.image_URL.label} - {$form.image_URL.html|crmAddClass:'huge40'}{help id="id-image_URL"} + {$form.image_URL.label} {help id="id-image_URL"} + {$form.image_URL.html|crmAddClass:'huge40'} {$form.description.label} diff --git a/templates/CRM/Admin/Form/LocationType.tpl b/templates/CRM/Admin/Form/LocationType.tpl index 945a8df2ee..d02a3e89a7 100644 --- a/templates/CRM/Admin/Form/LocationType.tpl +++ b/templates/CRM/Admin/Form/LocationType.tpl @@ -24,7 +24,6 @@ +--------------------------------------------------------------------+ *} {* this template is used for adding/editing location type *} -

{if $action eq 1}{ts}New Location Type{/ts}{elseif $action eq 2}{ts}Edit Location Type{/ts}{else}{ts}Delete Location Type{/ts}{/if}

{include file="CRM/common/formButtons.tpl" location="top"}
{if $action eq 8} diff --git a/templates/CRM/Admin/Form/MailSettings.tpl b/templates/CRM/Admin/Form/MailSettings.tpl index 7ed52a897a..67e9adbbea 100644 --- a/templates/CRM/Admin/Form/MailSettings.tpl +++ b/templates/CRM/Admin/Form/MailSettings.tpl @@ -24,7 +24,6 @@ +--------------------------------------------------------------------+ *} {* this template is used for adding/editing email settings. *} -

{if $action eq 1}{ts}New Email Settings{/ts}{elseif $action eq 2}{ts}Edit Email Settings{/ts}{else}{ts}Delete Email Settings{/ts}{/if}

{include file="CRM/common/formButtons.tpl" location="top"}
{if $action eq 8} diff --git a/templates/CRM/Admin/Form/Mapping.tpl b/templates/CRM/Admin/Form/Mapping.tpl index 6ebb1243d4..746fc72802 100644 --- a/templates/CRM/Admin/Form/Mapping.tpl +++ b/templates/CRM/Admin/Form/Mapping.tpl @@ -24,7 +24,6 @@ +--------------------------------------------------------------------+ *} {* this template is used for adding/editing a saved mapping *} -

{if $action eq 1}{ts}New Tag{/ts}{elseif $action eq 2}{ts}Edit Mapping{/ts}{else}{ts}Delete Mapping{/ts}{/if}

{if $action eq 1 or $action eq 2 }
{include file="CRM/common/formButtons.tpl" location="top"}
diff --git a/templates/CRM/Admin/Form/OptionGroup.tpl b/templates/CRM/Admin/Form/OptionGroup.tpl index 9e456e4e72..6da427ffd1 100644 --- a/templates/CRM/Admin/Form/OptionGroup.tpl +++ b/templates/CRM/Admin/Form/OptionGroup.tpl @@ -23,7 +23,6 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{* this template is used for adding/editing/deleting activity type *}

{if $action eq 1}{ts}New Option Group{/ts}{elseif $action eq 2}{ts}Edit Option Group{/ts}{else}{ts}Delete Option Group{/ts}{/if}

{include file="CRM/common/formButtons.tpl" location="top"}
diff --git a/templates/CRM/Admin/Form/Options.tpl b/templates/CRM/Admin/Form/Options.tpl index 27afc01060..b08273239a 100644 --- a/templates/CRM/Admin/Form/Options.tpl +++ b/templates/CRM/Admin/Form/Options.tpl @@ -24,7 +24,6 @@ +--------------------------------------------------------------------+ *} {* this template is used for adding/editing options *} -

{if $action eq 1}{ts 1=$gLabel}New %1 Option{/ts}{elseif $action eq 8}{ts 1=$gLabel}Delete %1 Option{/ts}{else}{ts 1=$gLabel}Edit %1 Option{/ts}{/if}

{include file="CRM/common/formButtons.tpl" location="top"}
{if $action eq 8} diff --git a/templates/CRM/Admin/Form/RelationshipType.tpl b/templates/CRM/Admin/Form/RelationshipType.tpl index 3c4f97b19c..fc83e30fb2 100644 --- a/templates/CRM/Admin/Form/RelationshipType.tpl +++ b/templates/CRM/Admin/Form/RelationshipType.tpl @@ -24,7 +24,6 @@ +--------------------------------------------------------------------+ *} {* this template is used for adding/editing relationship types *} -

{if $action eq 1}{ts}New Relationship Type{/ts}{elseif $action eq 2}{ts}Edit Relationship Type{/ts}{elseif $action eq 8}{ts}Delete Relationship Type{/ts}{else}{ts}View Relationship Type{/ts}{/if}

{include file="CRM/common/formButtons.tpl" location="top"}
{if $action eq 8} diff --git a/templates/CRM/Admin/Form/Tag.tpl b/templates/CRM/Admin/Form/Tag.tpl index 301dbb5175..242138abea 100644 --- a/templates/CRM/Admin/Form/Tag.tpl +++ b/templates/CRM/Admin/Form/Tag.tpl @@ -24,7 +24,6 @@ +--------------------------------------------------------------------+ *} {* this template is used for adding/editing a tag (admin) *} -

{if $action eq 1}{ts}New Tag {if $isTagSet}Set{/if}{/ts}{elseif $action eq 2}{ts}Edit Tag {if $isTagSet}Set{/if}{/ts}{else}{ts}Delete Tag {if $isTagSet}Set{/if}{/ts}{/if}

{if $action eq 1 or $action eq 2 }
{include file="CRM/common/formButtons.tpl" location="top"}
diff --git a/templates/CRM/Admin/Page/ContactType.tpl b/templates/CRM/Admin/Page/ContactType.tpl index 6a6d707c45..eae3fe1dec 100644 --- a/templates/CRM/Admin/Page/ContactType.tpl +++ b/templates/CRM/Admin/Page/ContactType.tpl @@ -23,14 +23,13 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -
- {ts}CiviCRM comes with 3 basic (built-in) contact types: Individual, Household, and Organization. You can create additional contact types based on these types to further differentiate contacts (for example you might create Student, Parent, Staff, and /or Volunteer types from the basic Individual type...).{/ts} {help id="id-contactSubtype-intro"} -
- {if $action eq 1 or $action eq 2 or $action eq 8} {include file="CRM/Admin/Form/ContactType.tpl"} {else} +
+ {ts}CiviCRM comes with 3 basic (built-in) contact types: Individual, Household, and Organization. You can create additional contact types based on these types to further differentiate contacts (for example you might create Student, Parent, Staff, and /or Volunteer types from the basic Individual type...).{/ts} {help id="id-contactSubtype-intro"} +
{if $rows}
{strip} @@ -57,17 +56,14 @@ {/foreach} {/strip} - {if $action ne 1 and $action ne 2} - - {/if} -
-{else} +
+ {else}
- {ts}status{/ts} - {capture assign=crmURL}{crmURL p='civicrm/admin/ContactType' q="action=add&reset=1"}{/capture} - {ts 1=$crmURL}There are currently no Contact Types entered. You can add one.{/ts} + {ts}status{/ts} + {ts}None found.{/ts}
-{/if} + {/if} + {/if} diff --git a/templates/CRM/Admin/Page/LocationType.tpl b/templates/CRM/Admin/Page/LocationType.tpl index 747f4a7211..7a07c54b14 100644 --- a/templates/CRM/Admin/Page/LocationType.tpl +++ b/templates/CRM/Admin/Page/LocationType.tpl @@ -30,8 +30,8 @@ {ts}Location types provide convenient labels to differentiate contacts' location(s). Administrators may define as many additional types as appropriate for your constituents (examples might be Main Office, School, Vacation Home...).{/ts}
-{if $rows} -
+ {if $rows} +
{strip} {* handle enable/disable actions*} {include file="CRM/common/enableDisableApi.tpl"} @@ -51,29 +51,25 @@ {foreach from=$rows item=row} - {$row.name} - {$row.display_name} - {$row.vcard_name} - {$row.description} - {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} - {if $row.is_default eq 1}{ts}Default{/ts}{/if}  + {$row.name} + {$row.display_name} + {$row.vcard_name} + {$row.description} + {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} + {if $row.is_default eq 1}{ts}Default{/ts}{/if}  {$row.action|replace:'xx':$row.id} {/foreach} {/strip} - - {if $action ne 1 and $action ne 2} - - {/if} -
-{else} +
+ {else}
- {ts}status{/ts} - {capture assign=crmURL}{crmURL p='civicrm/admin/locationType' q="action=add&reset=1"}{/capture} - {ts 1=$crmURL}There are no Location Types entered for this Contact. You can add one.{/ts} + {ts}status{/ts} + {ts}None found.{/ts}
-{/if} + {/if} + {/if} diff --git a/templates/CRM/Admin/Page/MailSettings.tpl b/templates/CRM/Admin/Page/MailSettings.tpl index 38f05ca107..ba0111f4bd 100644 --- a/templates/CRM/Admin/Page/MailSettings.tpl +++ b/templates/CRM/Admin/Page/MailSettings.tpl @@ -66,18 +66,15 @@ {/strip} - {if $action ne 1 and $action ne 2} - - {/if}
{else}
- {ts}status{/ts} - {capture assign=crmURL}{crmURL p='civicrm/admin/mailSettings' q="action=add&reset=1"}{/capture} - {ts 1=$crmURL}There are no Mail Settings present. You can add one.{/ts} + {ts}status{/ts} + {ts}None found.{/ts}
{/if} + {/if} diff --git a/templates/CRM/Admin/Page/Options.tpl b/templates/CRM/Admin/Page/Options.tpl index b68715bead..d75725c4a0 100644 --- a/templates/CRM/Admin/Page/Options.tpl +++ b/templates/CRM/Admin/Page/Options.tpl @@ -70,7 +70,7 @@
{if $rows} -{if $action ne 1 and $action ne 2 and $isLocked ne 1} +{if $isLocked ne 1} @@ -150,18 +150,17 @@ {include file="CRM/common/crmeditable.tpl"} {/strip} - {if $action ne 1 and $action ne 2 and $isLocked ne 1} - - {/if}
{else}
-
- {capture assign=link}class="action-item" href="{crmURL p="civicrm/admin/options/$gName" q='action=add&reset=1'}"{/capture} - {ts 1=$link}There are no option values entered. You can add one.{/ts} + {ts}status{/ts} + {ts}None found.{/ts}
{/if} + {if $isLocked ne 1} + + {/if}
{/if} diff --git a/templates/CRM/Admin/Page/RelationshipType.tpl b/templates/CRM/Admin/Page/RelationshipType.tpl index 99fc3f0e40..827219de27 100644 --- a/templates/CRM/Admin/Page/RelationshipType.tpl +++ b/templates/CRM/Admin/Page/RelationshipType.tpl @@ -75,17 +75,14 @@ {/strip} - {if !($action eq 1 and $action eq 2)} - - {/if}
{else}
-
- {capture assign=crmURL}{crmURL p='civicrm/admin/reltype' q="action=add&reset=1"}{/capture} - {ts 1=$crmURL}There are no relationship types present. You can add one.{/ts} + {ts}status{/ts} + {ts}None found.{/ts}
{/if} + {/if} diff --git a/templates/CRM/Contact/Page/View/Note.tpl b/templates/CRM/Contact/Page/View/Note.tpl index 2bcf2d167c..f43d8236d6 100644 --- a/templates/CRM/Contact/Page/View/Note.tpl +++ b/templates/CRM/Contact/Page/View/Note.tpl @@ -26,7 +26,6 @@
{if $action eq 4}{* when action is view *} {if $notes} -

{ts}View Note{/ts}

@@ -59,13 +58,6 @@ {/if} {elseif $action eq 1 or $action eq 2} {* action is add or update *} -

- {if $parentId} - {if $action eq 1}{ts}New Comment{/ts}{else}{ts}Edit Comment{/ts}{/if} - {else} - {if $action eq 1}{ts}New Note{/ts}{else}{ts}Edit Note{/ts}{/if} - {/if} -

{include file="CRM/common/formButtons.tpl" location="top"}
{ts}Subject{/ts}{$note.subject}
@@ -101,10 +93,8 @@ {/if} {if ($action eq 8)} -
{ts}Delete Note{/ts}
{ts 1=$notes.$id.note}Are you sure you want to delete the note '%1'?{/ts}
{include file="CRM/common/formButtons.tpl"}
-
{/if} diff --git a/templates/CRM/Contribute/Form/Contribution.tpl b/templates/CRM/Contribute/Form/Contribution.tpl index df3efb4a9b..d80e903199 100644 --- a/templates/CRM/Contribute/Form/Contribution.tpl +++ b/templates/CRM/Contribute/Form/Contribution.tpl @@ -33,12 +33,6 @@ {include file="CRM/Contribute/Form/AdditionalInfo/$formType.tpl"} {else} - {if $contributionMode} -

{if $ppID}{ts}Credit Card Pledge Payment{/ts}{else}{ts}Credit Card Contribution{/ts}{/if}

- {elseif $context NEQ 'standalone'} -

{if $action eq 1 or $action eq 1024}{if $ppID}{ts}Pledge Payment{/ts}{else}{ts}New Contribution{/ts}{/if}{elseif $action eq 8}{ts}Delete Contribution{/ts}{else}{ts}Edit Contribution{/ts}{/if}

- {/if} -
{if $contributionMode == 'test' } @@ -75,7 +69,7 @@ {else} {capture assign=ccModeLink}{crmURL p='civicrm/contact/view/contribution' q="reset=1&action=add&context=standalone&mode=live"}{/capture} {/if} -  » {ts}submit credit card contribution{/ts} +  » {ts}submit credit card contribution{/ts} {/if}
{if $isOnline}{assign var=valueStyle value=" class='view-value'"}{else}{assign var=valueStyle value=""}{/if} diff --git a/templates/CRM/Contribute/Form/ContributionView.tpl b/templates/CRM/Contribute/Form/ContributionView.tpl index d13cf73fb3..783b0a98d2 100644 --- a/templates/CRM/Contribute/Form/ContributionView.tpl +++ b/templates/CRM/Contribute/Form/ContributionView.tpl @@ -24,8 +24,6 @@ +--------------------------------------------------------------------+ *}
-

{ts}View Contribution{/ts}

-
{$form.name.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_product' field='name' id=$productId}{/if} diff --git a/templates/CRM/Custom/Form/DeleteField.tpl b/templates/CRM/Custom/Form/DeleteField.tpl index 72f861217e..ea2cf56999 100644 --- a/templates/CRM/Custom/Form/DeleteField.tpl +++ b/templates/CRM/Custom/Form/DeleteField.tpl @@ -24,7 +24,6 @@ +--------------------------------------------------------------------+ *} {* this template is used for confirmation of delete for a Fields *} -

{ts}Delete Custom Field{/ts} - {$title}

diff --git a/templates/CRM/Event/Form/Participant.tpl b/templates/CRM/Event/Form/Participant.tpl index cad2d9da89..e762821956 100644 --- a/templates/CRM/Event/Form/Participant.tpl +++ b/templates/CRM/Event/Form/Participant.tpl @@ -181,7 +181,6 @@ {elseif $participantMode == 'live'} {assign var=registerMode value="LIVE"} {/if} -

{if $action eq 1}{ts}New Event Registration{/ts}{elseif $action eq 8}{ts}Delete Event Registration{/ts}{else}{ts}Edit Event Registration{/ts}{/if}

{if $participantMode} @@ -199,7 +198,6 @@ {/if} {if $action eq 8} {* If action is Delete *} -
{include file="CRM/common/formButtons.tpl" location="top"}
  diff --git a/templates/CRM/Event/Form/ParticipantView.tpl b/templates/CRM/Event/Form/ParticipantView.tpl index bc51b308bd..a83a3d2874 100644 --- a/templates/CRM/Event/Form/ParticipantView.tpl +++ b/templates/CRM/Event/Form/ParticipantView.tpl @@ -25,7 +25,6 @@ *} {* View existing event registration record. *}
-

{ts}View Participant{/ts}