本文整理汇总了PHP中CRM_Utils_System::setTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_System::setTitle方法的具体用法?PHP CRM_Utils_System::setTitle怎么用?PHP CRM_Utils_System::setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Utils_System
的用法示例。
在下文中一共展示了CRM_Utils_System::setTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* Build all the data structures needed to build the form.
*/
public function preProcess()
{
// reset action from the session
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'update');
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
$rcid = CRM_Utils_Request::retrieve('rcid', 'Positive', $this);
$rcid = $rcid ? "&id={$rcid}" : '';
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/user', "reset=1{$rcid}"));
if ($this->_contactId) {
$contact = new CRM_Contact_DAO_Contact();
$contact->id = $this->_contactId;
if (!$contact->find(TRUE)) {
CRM_Core_Error::statusBounce(ts('contact does not exist: %1', array(1 => $this->_contactId)));
}
$this->_contactType = $contact->contact_type;
// check for permissions
if (!CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::EDIT)) {
CRM_Core_Error::statusBounce(ts('You do not have the necessary permission to edit this contact.'));
}
list($displayName, $contactImage) = CRM_Contact_BAO_Contact::getDisplayAndImage($this->_contactId);
CRM_Utils_System::setTitle($displayName, $contactImage . ' ' . $displayName);
} else {
CRM_Core_Error::statusBounce(ts('Could not get a contact_id and/or contact_type'));
}
}
示例2: buildQuickForm
/**
* Function to build the form
*
* @access public
* @return None
*/
function buildQuickForm()
{
CRM_Utils_System::setTitle(ts('Add Contacts to Organization'));
$this->addElement('text', 'name', ts('Find Target Organization'));
$this->add('select', 'relationship_type_id', ts('Relationship Type'), array('' => ts('- select -')) + CRM_Contact_BAO_Relationship::getRelationType("Organization"), true);
$searchRows = $this->get('searchRows');
$searchCount = $this->get('searchCount');
if ($searchRows) {
$checkBoxes = array();
$chekFlag = 0;
foreach ($searchRows as $id => $row) {
if (!$chekFlag) {
$chekFlag = $id;
}
$checkBoxes[$id] = $this->createElement('radio', null, null, null, $id);
}
$this->addGroup($checkBoxes, 'contact_check');
if ($chekFlag) {
$checkBoxes[$chekFlag]->setChecked(true);
}
$this->assign('searchRows', $searchRows);
}
$this->assign('searchCount', $searchCount);
$this->assign('searchDone', $this->get('searchDone'));
$this->assign('contact_type_display', ts('Organization'));
$this->addElement('submit', $this->getButtonName('refresh'), ts('Search'), array('class' => 'form-submit'));
$this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), array('class' => 'form-submit'));
$this->addButtons(array(array('type' => 'next', 'name' => ts('Add to Organization'), 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
}
示例3: preProcess
public function preProcess()
{
if (!CRM_Campaign_BAO_Campaign::accessCampaign()) {
CRM_Utils_System::permissionDenied();
}
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add', 'REQUEST');
$this->_surveyId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
if ($this->_surveyId) {
$this->_single = TRUE;
$params = array('id' => $this->_surveyId);
CRM_Campaign_BAO_Survey::retrieve($params, $surveyInfo);
$this->_surveyTitle = $surveyInfo['title'];
$this->assign('surveyTitle', $this->_surveyTitle);
CRM_Utils_System::setTitle(ts('Configure Survey - %1', array(1 => $this->_surveyTitle)));
}
$this->assign('action', $this->_action);
$this->assign('surveyId', $this->_surveyId);
// when custom data is included in this page
if (!empty($_POST['hidden_custom'])) {
$this->set('type', 'Event');
$this->set('entityId', $this->_surveyId);
CRM_Custom_Form_CustomData::preProcess($this, NULL, NULL, 1, 'Survey', $this->_surveyId);
CRM_Custom_Form_CustomData::buildQuickForm($this);
CRM_Custom_Form_CustomData::setDefaultValues($this);
}
// CRM-11480, CRM-11682
// Preload libraries required by the "Questions" tab
CRM_UF_Page_ProfileEditor::registerProfileScripts();
CRM_UF_Page_ProfileEditor::registerSchemas(array('IndividualModel', 'ActivityModel'));
CRM_Campaign_Form_Survey_TabHeader::build($this);
}
示例4: buildQuickForm
/**
* Build the form object.
*/
public function buildQuickForm()
{
$config = CRM_Core_Config::singleton();
CRM_Utils_System::setTitle(ts('Settings - Localization'));
$warningTitle = json_encode(ts("Warning"));
$defaultLocaleOptions = CRM_Admin_Form_Setting_Localization::getDefaultLocaleOptions();
$domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
if ($domain->locales) {
// add language limiter and language adder
$this->addCheckBox('languageLimit', ts('Available Languages'), array_flip($defaultLocaleOptions), NULL, NULL, NULL, NULL, ' ');
$this->addElement('select', 'addLanguage', ts('Add Language'), array_merge(array('' => ts('- select -')), array_diff(CRM_Core_I18n::languages(), $defaultLocaleOptions)));
// add the ability to return to single language
$warning = ts('This will make your CiviCRM installation a single-language one again. THIS WILL DELETE ALL DATA RELATED TO LANGUAGES OTHER THAN THE DEFAULT ONE SELECTED ABOVE (and only that language will be preserved).');
$this->assign('warning', $warning);
$warning = json_encode($warning);
$this->addElement('checkbox', 'makeSinglelingual', ts('Return to Single Language'), NULL, array('onChange' => "if (this.checked) CRM.alert({$warning}, {$warningTitle})"));
} else {
$warning = ts('Enabling multiple languages changes the schema of your database, so make sure you know what you are doing when enabling this function; making a database backup is strongly recommended.');
$this->assign('warning', $warning);
$warning = json_encode($warning);
$validTriggerPermission = CRM_Core_DAO::checkTriggerViewPermission(TRUE);
if ($validTriggerPermission && !$config->logging) {
$this->addElement('checkbox', 'makeMultilingual', ts('Enable Multiple Languages'), NULL, array('onChange' => "if (this.checked) CRM.alert({$warning}, {$warningTitle})"));
}
}
$this->addElement('select', 'contact_default_language', ts('Default Language for users'), CRM_Admin_Form_Setting_Localization::getDefaultLanguageOptions());
$includeCurrency =& $this->addElement('advmultiselect', 'currencyLimit', ts('Available Currencies') . ' ', self::getCurrencySymbols(), array('size' => 5, 'style' => 'width:150px', 'class' => 'advmultiselect'));
$includeCurrency->setButtonAttributes('add', array('value' => ts('Add >>')));
$includeCurrency->setButtonAttributes('remove', array('value' => ts('<< Remove')));
$this->addFormRule(array('CRM_Admin_Form_Setting_Localization', 'formRule'));
parent::buildQuickForm();
}
示例5: preProcess
/**
* Heart of the viewing process. The runner gets all the meta data for
* the contact and calls the appropriate type of page to view.
*
* @return void
* @access public
*
*/
function preProcess()
{
// Make sure case types have been configured for the component
require_once 'CRM/Core/OptionGroup.php';
$caseType = CRM_Core_OptionGroup::values('case_type');
if (empty($caseType)) {
$this->assign('notConfigured', 1);
return;
}
$session =& CRM_Core_Session::singleton();
$allCases = CRM_Utils_Request::retrieve('all', 'Positive', $session);
CRM_Utils_System::setTitle(ts('CiviCase Dashboard'));
$userID = $session->get('userID');
if (!$allCases) {
$this->assign('myCases', true);
} else {
$this->assign('myCases', false);
}
$this->assign('newClient', false);
if (CRM_Core_Permission::check('add contacts')) {
$this->assign('newClient', true);
}
require_once 'CRM/Case/BAO/Case.php';
$summary = CRM_Case_BAO_Case::getCasesSummary($allCases, $userID);
$upcoming = CRM_Case_BAO_Case::getCases($allCases, $userID, 'upcoming');
$recent = CRM_Case_BAO_Case::getCases($allCases, $userID, 'recent');
$this->assign('casesSummary', $summary);
if (!empty($upcoming)) {
$this->assign('upcomingCases', $upcoming);
}
if (!empty($recent)) {
$this->assign('recentCases', $recent);
}
}
示例6: buildQuickForm
/**
* Build the form object.
*/
public function buildQuickForm()
{
CRM_Utils_System::setTitle(ts('Settings - Cleanup Caches and Update Paths'));
$this->addElement('submit', $this->getButtonName('next', 'cleanup'), 'Cleanup Caches', array('class' => 'crm-form-submit', 'id' => 'cleanup-cache'));
$this->addElement('submit', $this->getButtonName('next', 'resetpaths'), 'Reset Paths', array('class' => 'crm-form-submit', 'id' => 'resetpaths'));
//parent::buildQuickForm();
}
示例7: preProcess
/**
* set up variables to build the form
*
* @param null
*
* @return void
* @acess protected
*/
function preProcess()
{
$this->_fid = $this->get('fid');
$this->_title = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $this->_fid, 'label', 'id');
$this->assign('title', $this->_title);
CRM_Utils_System::setTitle(ts('Confirm Price Field Delete'));
}
示例8: preProcess
public function preProcess()
{
parent::preProcess();
$this->_groupID = CRM_Utils_Request::retrieve('gid', 'Integer', $this, FALSE, NULL, 'REQUEST');
// ensure that there is a destination, if not set the destination to the
// referrer string
if (!$this->controller->getDestination()) {
$this->controller->setDestination(NULL, TRUE);
}
if ($this->_groupID) {
$groupTypeCondition = CRM_Contact_BAO_Group::groupTypeCondition('Mailing');
// make sure requested qroup is accessible and exists
$query = "\nSELECT title, description\n FROM civicrm_group\n WHERE id={$this->_groupID}\n AND visibility != 'User and User Admin Only'\n AND {$groupTypeCondition}";
$dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
if ($dao->fetch()) {
$this->assign('groupName', $dao->title);
CRM_Utils_System::setTitle(ts('Subscribe to Mailing List - %1', array(1 => $dao->title)));
} else {
CRM_Core_Error::statusBounce("The specified group is not configured for this action OR The group doesn't exist.");
}
$this->assign('single', TRUE);
} else {
$this->assign('single', FALSE);
CRM_Utils_System::setTitle(ts('Mailing List Subscription'));
}
}
示例9: buildQuickForm
/**
* Build the form object.
*
* @return void
*/
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'));
$this->assign('batchTitle', $this->_title);
$contactID = CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $this->_id, 'created_id');
$contactName = CRM_Contact_BAO_Contact::displayName($contactID);
$this->assign('contactName', $contactName);
}
$this->applyFilter('__ALL__', 'trim');
$this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'next', 'name' => ts('Save and New'), 'subName' => 'new'), array('type' => 'cancel', 'name' => ts('Cancel'))));
if ($this->_action & CRM_Core_Action::UPDATE && $this->_id) {
$batchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id');
//unset exported status
$exportedStatusId = CRM_Utils_Array::key('Exported', $batchStatus);
unset($batchStatus[$exportedStatusId]);
$this->add('select', 'status_id', ts('Batch Status'), array('' => ts('- select -')) + $batchStatus, TRUE);
$this->freeze(array('status_id'));
}
$attributes = CRM_Core_DAO::getAttribute('CRM_Batch_DAO_Batch');
$this->add('text', 'title', ts('Batch Name'), $attributes['name'], TRUE);
$this->add('textarea', 'description', ts('Description'), $attributes['description']);
$this->add('select', 'payment_instrument_id', ts('Payment Method'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument(), FALSE);
$this->add('text', 'total', ts('Total Amount'), $attributes['total']);
$this->add('text', 'item_count', ts('Number of Transactions'), $attributes['item_count']);
$this->addFormRule(array('CRM_Financial_Form_FinancialBatch', 'formRule'), $this);
}
示例10: run
/**
* Run dashboard.
*
* @return void
*/
public function run()
{
// Add dashboard js and css
$resources = CRM_Core_Resources::singleton();
$resources->addScriptFile('civicrm', 'js/jquery/jquery.dashboard.js', 0, 'html-header', FALSE);
$resources->addStyleFile('civicrm', 'css/dashboard.css');
$resetCache = CRM_Utils_Request::retrieve('resetCache', 'Positive', CRM_Core_DAO::$_nullObject);
CRM_Utils_System::setTitle(ts('CiviCRM Home'));
$session = CRM_Core_Session::singleton();
$contactID = $session->get('userID');
if ($resetCache) {
CRM_Core_BAO_Dashboard::resetDashletCache($contactID);
}
// call hook to get html from other modules
// ignored but needed to prevent warnings
$contentPlacement = CRM_Utils_Hook::DASHBOARD_BELOW;
$html = CRM_Utils_Hook::dashboard($contactID, $contentPlacement);
if (is_array($html)) {
$this->assign_by_ref('hookContent', $html);
$this->assign('hookContentPlacement', $contentPlacement);
}
$communityMessages = CRM_Core_CommunityMessages::create();
if ($communityMessages->isEnabled()) {
$message = $communityMessages->pick();
if ($message) {
$this->assign('communityMessages', $communityMessages->evalMarkup($message['markup']));
}
}
return parent::run();
}
示例11: preProcess
function preProcess()
{
parent::preProcess();
CRM_Utils_System::setTitle(ts('Settings - Addresses'));
// add all the checkboxes
$this->_cbs = array('address_options' => ts('Address Fields'));
}
示例12: run
/**
* run this page (figure out the action needed and perform it).
*
* @return void
*/
function run()
{
$instanceId = CRM_Report_Utils_Report::getInstanceID();
$action = CRM_Utils_Request::retrieve('action', 'String', $this);
$optionVal = CRM_Report_Utils_Report::getValueFromUrl($instanceId);
$reportUrl = CRM_Utils_System::url('civicrm/report/list', "reset=1");
if ($action & CRM_Core_Action::DELETE) {
if (!CRM_Core_Permission::check('administer Reports')) {
$statusMessage = ts('Your do not have permission to Delete Report.');
CRM_Core_Error::statusBounce($statusMessage, $reportUrl);
}
CRM_Report_BAO_Instance::delete($instanceId);
CRM_Core_Session::setStatus(ts('Selected Instance has been deleted.'));
} else {
require_once 'CRM/Core/OptionGroup.php';
$templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', "{$optionVal}", 'value');
if (strstr($templateInfo['name'], '_Form')) {
$instanceInfo = array();
CRM_Report_BAO_Instance::retrieve(array('id' => $instanceId), $instanceInfo);
if (!empty($instanceInfo['title'])) {
CRM_Utils_System::setTitle($instanceInfo['title']);
$this->assign('reportTitle', $instanceInfo['title']);
} else {
CRM_Utils_System::setTitle($templateInfo['label']);
$this->assign('reportTitle', $templateInfo['label']);
}
$wrapper =& new CRM_Utils_Wrapper();
return $wrapper->run($templateInfo['name'], null, null);
}
CRM_Core_Session::setStatus(ts('Could not find template for the instance.'));
}
return CRM_Utils_System::redirect($reportUrl);
}
示例13: run
function run()
{
list($ext, $suite) = $this->getRequestExtAndSuite();
if (empty($ext) || empty($suite)) {
throw new CRM_Core_Exception("FIXME: Not implemented: QUnit browser");
}
if (!preg_match('/^[a-zA-Z0-9_\\-\\.]+$/', $suite) || strpos($suite, '..') !== FALSE) {
throw new CRM_Core_Exception("Malformed suite name");
}
$path = CRM_Extension_System::singleton()->getMapper()->keyToBasePath($ext);
if (!is_dir("{$path}/tests/qunit/{$suite}")) {
throw new CRM_Core_Exception("Failed to locate test suite");
}
// Load the test suite -- including any PHP, TPL, or JS content
if (file_exists("{$path}/tests/qunit/{$suite}/test.php")) {
// e.g. load resources
require_once "{$path}/tests/qunit/{$suite}/test.php";
}
if (file_exists("{$path}/tests/qunit/{$suite}/test.tpl")) {
// e.g. setup markup and/or load resources
CRM_Core_Smarty::singleton()->addTemplateDir("{$path}/tests");
$this->assign('qunitTpl', "qunit/{$suite}/test.tpl");
}
if (file_exists("{$path}/tests/qunit/{$suite}/test.js")) {
CRM_Core_Resources::singleton()->addScriptFile($ext, "tests/qunit/{$suite}/test.js", 1000);
}
CRM_Utils_System::setTitle(ts('QUnit: %2 (%1)', array(1 => $ext, 2 => $suite)));
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'packages/qunit/qunit.js')->addStyleFile('civicrm', 'packages/qunit/qunit.css');
parent::run();
}
示例14: preProcess
/**
* Process the form submission.
*
*
* @return void
*/
public function preProcess()
{
$config = CRM_Core_Config::singleton();
CRM_Utils_System::setTitle(ts('CiviContribute Component Settings'));
$this->_varNames = array(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME => array('invoice_prefix' => array('html_type' => 'text', 'title' => ts('Invoice Prefix'), 'weight' => 1, 'description' => ts('Enter prefix to be display on PDF for invoice')), 'credit_notes_prefix' => array('html_type' => 'text', 'title' => ts('Credit Notes Prefix'), 'weight' => 2, 'description' => ts('Enter prefix to be display on PDF for credit notes.')), 'due_date' => array('html_type' => 'text', 'title' => ts('Due Date'), 'weight' => 3), 'due_date_period' => array('html_type' => 'select', 'title' => ts('For transmission'), 'weight' => 4, 'description' => ts('Select the interval for due date.'), 'option_values' => array('select' => ts('- select -'), 'days' => ts('Days'), 'months' => ts('Months'), 'years' => ts('Years'))), 'notes' => array('html_type' => 'wysiwyg', 'title' => ts('Notes or Standard Terms'), 'weight' => 5, 'description' => ts('Enter note or message to be displayed on PDF invoice or credit notes '), 'attributes' => array('rows' => 2, 'cols' => 40)), 'is_email_pdf' => array('html_type' => 'checkbox', 'title' => ts('Automatically email invoice when user purchases online'), 'weight' => 6), 'tax_term' => array('html_type' => 'text', 'title' => ts('Tax Term'), 'weight' => 7), 'tax_display_settings' => array('html_type' => 'select', 'title' => ts('Tax Display Settings'), 'weight' => 8, 'option_values' => array('Do_not_show' => ts('Do not show breakdown, only show total -i.e ' . $config->defaultCurrencySymbol . '120.00'), 'Inclusive' => ts('Show [tax term] inclusive price - i.e. ' . $config->defaultCurrencySymbol . '120.00 (includes [tax term] of ' . $config->defaultCurrencySymbol . '20.00)'), 'Exclusive' => ts('Show [tax term] exclusive price - i.e. ' . $config->defaultCurrencySymbol . '100.00 + ' . $config->defaultCurrencySymbol . '20.00 [tax term]')))));
parent::preProcess();
}
示例15: run
/**
* run this page (figure out the action needed and perform it).
*
* @return void
*/
function run()
{
if (!CRM_Core_Permission::check('administer Reports')) {
return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/report/list', 'reset=1'));
}
$optionVal = CRM_Report_Utils_Report::getValueFromUrl();
$templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', "{$optionVal}", 'value', 'String', FALSE);
$extKey = strpos(CRM_Utils_Array::value('name', $templateInfo), '.');
$reportClass = NULL;
if ($extKey !== FALSE) {
$ext = CRM_Extension_System::singleton()->getMapper();
$reportClass = $ext->keyToClass($templateInfo['name'], 'report');
$templateInfo['name'] = $reportClass;
}
if (strstr(CRM_Utils_Array::value('name', $templateInfo), '_Form') || !is_null($reportClass)) {
CRM_Utils_System::setTitle($templateInfo['label'] . ' - Template');
$this->assign('reportTitle', $templateInfo['label']);
$session = CRM_Core_Session::singleton();
$session->set('reportDescription', $templateInfo['description']);
$wrapper = new CRM_Utils_Wrapper();
return $wrapper->run($templateInfo['name'], NULL, NULL);
}
if ($optionVal) {
CRM_Core_Session::setStatus(ts('Could not find the report template. Make sure the report template is registered and / or url is correct.'), ts('Template Not Found'), 'error');
}
return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/report/list', 'reset=1'));
}