From debf8210ca2def79d6b6b7140eb57ac9f6196db3 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 28 Feb 2013 21:49:07 -0800 Subject: [PATCH] Import from SVN (r45945, r596) --- admin/admin.civicrm.php | 96 +++++++ admin/config.xml | 19 ++ admin/configure.php | 237 ++++++++++++++++ admin/helpers/api.php | 31 +++ admin/language/en-GB/en-GB.com_civicrm.ini | 2 + .../language/en-GB/en-GB.com_civicrm.sys.ini | 1 + admin/license.civicrm.txt | 4 + admin/plugins/civicrm/civicrm.php | 125 +++++++++ admin/plugins/civicrm/civicrm.xml | 16 ++ admin/plugins/civicrm/index.html | 4 + admin/plugins/civicrmicon/civicrmicon.php | 51 ++++ admin/plugins/civicrmicon/civicrmicon.xml | 16 ++ admin/plugins/civicrmicon/index.html | 0 admin/plugins/civicrmsys/civicrmsys.php | 126 +++++++++ admin/plugins/civicrmsys/civicrmsys.xml | 16 ++ admin/plugins/civicrmsys/index.html | 1 + admin/plugins/example/example.php | 56 ++++ admin/plugins/example/example.xml | 32 +++ admin/plugins/example/index.html | 4 + admin/toolbar.civicrm.html.php | 38 +++ admin/toolbar.civicrm.php | 34 +++ script.civicrm.php | 262 ++++++++++++++++++ site/civicrm.html.php | 9 + site/civicrm.php | 77 +++++ site/elements/civicontribpages.php | 69 +++++ site/elements/civicontribpagespcp.php | 78 ++++++ site/elements/civicustomsearch.php | 67 +++++ site/elements/civievents.php | 80 ++++++ site/elements/civieventsonline.php | 56 ++++ site/elements/civipcps.php | 69 +++++ site/elements/civiprofiles.php | 64 +++++ site/views/Contributions/metadata.xml | 6 + site/views/Contributions/tmpl/default.php | 31 +++ site/views/Contributions/tmpl/default.xml | 26 ++ site/views/Contributions/tmpl/pcp.php | 31 +++ site/views/Contributions/tmpl/pcp.xml | 27 ++ site/views/Contributions/tmpl/pcpinfo.php | 31 +++ site/views/Contributions/tmpl/pcpinfo.xml | 25 ++ site/views/Contributions/view.html.php | 37 +++ site/views/CustomSearch/metadata.xml | 6 + site/views/CustomSearch/tmpl/default.php | 29 ++ site/views/CustomSearch/tmpl/default.xml | 27 ++ site/views/CustomSearch/view.html.php | 42 +++ site/views/Dashboard/metadata.xml | 6 + site/views/Dashboard/tmpl/default.xml | 25 ++ site/views/Dashboard/view.html.php | 38 +++ site/views/Events/metadata.xml | 6 + site/views/Events/tmpl/default.php | 152 ++++++++++ site/views/Events/tmpl/default.xml | 27 ++ site/views/Events/tmpl/eventlisting.php | 29 ++ site/views/Events/tmpl/eventlisting.xml | 36 +++ site/views/Events/tmpl/participantlisting.php | 29 ++ site/views/Events/tmpl/participantlisting.xml | 27 ++ site/views/Events/tmpl/register.php | 155 +++++++++++ site/views/Events/tmpl/register.xml | 27 ++ site/views/Events/view.html.php | 35 +++ site/views/MailingList/metadata.xml | 6 + site/views/MailingList/tmpl/default.xml | 25 ++ site/views/MailingList/view.html.php | 33 +++ site/views/Profiles/metadata.xml | 6 + site/views/Profiles/tmpl/default.php | 183 ++++++++++++ site/views/Profiles/tmpl/default.xml | 27 ++ site/views/Profiles/tmpl/edit.php | 202 ++++++++++++++ site/views/Profiles/tmpl/edit.xml | 27 ++ site/views/Profiles/tmpl/search.php | 140 ++++++++++ site/views/Profiles/tmpl/search.xml | 28 ++ site/views/Profiles/tmpl/view.php | 208 ++++++++++++++ site/views/Profiles/tmpl/view.xml | 27 ++ site/views/Profiles/view.html.php | 42 +++ 69 files changed, 3604 insertions(+) create mode 100644 admin/admin.civicrm.php create mode 100644 admin/config.xml create mode 100644 admin/configure.php create mode 100644 admin/helpers/api.php create mode 100644 admin/language/en-GB/en-GB.com_civicrm.ini create mode 100644 admin/language/en-GB/en-GB.com_civicrm.sys.ini create mode 100644 admin/license.civicrm.txt create mode 100755 admin/plugins/civicrm/civicrm.php create mode 100755 admin/plugins/civicrm/civicrm.xml create mode 100755 admin/plugins/civicrm/index.html create mode 100644 admin/plugins/civicrmicon/civicrmicon.php create mode 100644 admin/plugins/civicrmicon/civicrmicon.xml create mode 100644 admin/plugins/civicrmicon/index.html create mode 100644 admin/plugins/civicrmsys/civicrmsys.php create mode 100644 admin/plugins/civicrmsys/civicrmsys.xml create mode 100644 admin/plugins/civicrmsys/index.html create mode 100644 admin/plugins/example/example.php create mode 100644 admin/plugins/example/example.xml create mode 100644 admin/plugins/example/index.html create mode 100644 admin/toolbar.civicrm.html.php create mode 100644 admin/toolbar.civicrm.php create mode 100644 script.civicrm.php create mode 100644 site/civicrm.html.php create mode 100644 site/civicrm.php create mode 100644 site/elements/civicontribpages.php create mode 100644 site/elements/civicontribpagespcp.php create mode 100644 site/elements/civicustomsearch.php create mode 100644 site/elements/civievents.php create mode 100644 site/elements/civieventsonline.php create mode 100644 site/elements/civipcps.php create mode 100644 site/elements/civiprofiles.php create mode 100644 site/views/Contributions/metadata.xml create mode 100644 site/views/Contributions/tmpl/default.php create mode 100644 site/views/Contributions/tmpl/default.xml create mode 100644 site/views/Contributions/tmpl/pcp.php create mode 100644 site/views/Contributions/tmpl/pcp.xml create mode 100644 site/views/Contributions/tmpl/pcpinfo.php create mode 100644 site/views/Contributions/tmpl/pcpinfo.xml create mode 100644 site/views/Contributions/view.html.php create mode 100644 site/views/CustomSearch/metadata.xml create mode 100644 site/views/CustomSearch/tmpl/default.php create mode 100644 site/views/CustomSearch/tmpl/default.xml create mode 100644 site/views/CustomSearch/view.html.php create mode 100644 site/views/Dashboard/metadata.xml create mode 100644 site/views/Dashboard/tmpl/default.xml create mode 100644 site/views/Dashboard/view.html.php create mode 100644 site/views/Events/metadata.xml create mode 100644 site/views/Events/tmpl/default.php create mode 100644 site/views/Events/tmpl/default.xml create mode 100644 site/views/Events/tmpl/eventlisting.php create mode 100644 site/views/Events/tmpl/eventlisting.xml create mode 100644 site/views/Events/tmpl/participantlisting.php create mode 100644 site/views/Events/tmpl/participantlisting.xml create mode 100644 site/views/Events/tmpl/register.php create mode 100644 site/views/Events/tmpl/register.xml create mode 100644 site/views/Events/view.html.php create mode 100644 site/views/MailingList/metadata.xml create mode 100644 site/views/MailingList/tmpl/default.xml create mode 100644 site/views/MailingList/view.html.php create mode 100644 site/views/Profiles/metadata.xml create mode 100644 site/views/Profiles/tmpl/default.php create mode 100644 site/views/Profiles/tmpl/default.xml create mode 100644 site/views/Profiles/tmpl/edit.php create mode 100644 site/views/Profiles/tmpl/edit.xml create mode 100644 site/views/Profiles/tmpl/search.php create mode 100644 site/views/Profiles/tmpl/search.xml create mode 100644 site/views/Profiles/tmpl/view.php create mode 100644 site/views/Profiles/tmpl/view.xml create mode 100644 site/views/Profiles/view.html.php diff --git a/admin/admin.civicrm.php b/admin/admin.civicrm.php new file mode 100644 index 000000000000..9e26e1fa1a67 --- /dev/null +++ b/admin/admin.civicrm.php @@ -0,0 +1,96 @@ +"; + exit(); +} + +define('CIVICRM_SETTINGS_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'civicrm.settings.php'); +include_once CIVICRM_SETTINGS_PATH; + +civicrm_invoke(); + +function civicrm_init() { + require_once 'CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + + require_once 'PEAR.php'; + + $config = CRM_Core_Config::singleton(); +} + +function plugin_init() { + //invoke plugins. + JPluginHelper::importPlugin('civicrm'); + $app = JFactory::getApplication(); + $app->triggerEvent('onCiviLoad'); +} + +function civicrm_invoke() { + civicrm_init(); + + plugin_init(); + + $user = JFactory::getUser(); + + /* bypass synchronize if running upgrade + * to avoid any serious non-recoverable error + * which might hinder the upgrade process. + */ + + if (CRM_Utils_Array::value('task', $_REQUEST) != 'civicrm/upgrade') { + CRM_Core_BAO_UFMatch::synchronize($user, FALSE, 'Joomla', 'Individual', TRUE); + } + + // Add our standard css & js + $resources = CRM_Core_Resources::singleton(); + $resources->addCoreResources(); + + $config = CRM_Core_Config::singleton(); + if (!$config->userFrameworkFrontend) { + $resources->addStyleFile('civicrm', 'css/joomla.css', -97, 'html-header'); + } + else { + $resources->addStyleFile('civicrm', 'css/joomla_frontend.css', -97, 'html-header'); + } + + if (isset($_GET['task'])) { + $args = explode('/', trim($_GET['task'])); + } + else { + $_GET['task'] = 'civicrm/dashboard'; + $_GET['reset'] = 1; + $args = array('civicrm', 'dashboard'); + } + CRM_Core_Invoke::invoke($args); +} + diff --git a/admin/config.xml b/admin/config.xml new file mode 100644 index 000000000000..0f70e4968d60 --- /dev/null +++ b/admin/config.xml @@ -0,0 +1,19 @@ + + +
+ + + +
+
diff --git a/admin/configure.php b/admin/configure.php new file mode 100644 index 000000000000..afd2b51f6921 --- /dev/null +++ b/admin/configure.php @@ -0,0 +1,237 @@ +"; + echo "If this is a new install, you will need to uninstall CiviCRM from the Joomla Extension Manager.

"; + exit(); + } + + $extractdir = $adminPath; + JArchive::extract($archivename, $extractdir); + } + + $scratchDir = JPATH_SITE . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'civicrm'; + if (!is_dir($scratchDir)) { + JFolder::create($scratchDir, 0777); + } + + $compileDir = $scratchDir . DIRECTORY_SEPARATOR . 'templates_c'; + if (!is_dir($compileDir)) { + JFolder::create($compileDir, 0777); + } + + $db = JFactory::getDBO(); + $db->setQuery(' SELECT count( * ) +FROM information_schema.tables +WHERE table_name LIKE "civicrm_domain" +AND table_schema = "' . $jConfig->getValue('config.db') . '" '); + + global $civicrmUpgrade; + $civicrmUpgrade = ($db->loadResult() == 0) ? FALSE : TRUE; +} + +function civicrm_write_file($name, &$buffer) { + JFile::write($name, $buffer); +} + +function civicrm_main() { + global $civicrmUpgrade, $adminPath; + + civicrm_setup(); + + // setup vars + $configFile = $adminPath . DIRECTORY_SEPARATOR . 'civicrm.settings.php'; + + // generate backend config file + $string = " +register(); +"; + + $string = trim($string); + civicrm_write_file($adminPath . DIRECTORY_SEPARATOR . + 'civicrm' . DIRECTORY_SEPARATOR . + 'civicrm.config.php', + $string + ); + + $liveSite = substr_replace(JURI::root(), '', -1, 1); + $siteKey = md5( uniqid( '', true ) . $liveSite ); + + // generate backend settings file + $string = civicrm_config(FALSE, $siteKey); + civicrm_write_file($configFile, $string); + + // generate frontend settings file + $string = civicrm_config(TRUE, $siteKey); + civicrm_write_file(JPATH_SITE . DIRECTORY_SEPARATOR . + 'components' . DIRECTORY_SEPARATOR . + 'com_civicrm' . DIRECTORY_SEPARATOR . + 'civicrm.settings.php', + $string + ); + + define('CIVICRM_SETTINGS_PATH', $configFile); + include_once CIVICRM_SETTINGS_PATH; + + // for install case only + if (!$civicrmUpgrade) { + $sqlPath = $adminPath . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'sql'; + + civicrm_source($sqlPath . DIRECTORY_SEPARATOR . 'civicrm.mysql'); + civicrm_source($sqlPath . DIRECTORY_SEPARATOR . 'civicrm_data.mysql'); + + require_once 'CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + + require_once 'CRM/Core/Config.php'; + $config = CRM_Core_Config::singleton(); + + // now also build the menu + require_once 'CRM/Core/Menu.php'; + CRM_Core_Menu::store(); + } +} + +function civicrm_source($fileName, $lineMode = FALSE) { + + $dsn = CIVICRM_DSN; + + require_once 'DB.php'; + + $db = DB::connect($dsn); + if (PEAR::isError($db)) { + die("Cannot open $dsn: " . $db->getMessage()); + } + + if (!$lineMode) { + $string = JFile::read($fileName); + + //get rid of comments starting with # and -- + $string = preg_replace("/^#[^\n]*$/m", "\n", $string); + $string = preg_replace("/^\-\-[^\n]*$/m", "\n", $string); + + $queries = preg_split('/;\s*$/m', $string); + + foreach ($queries as $query) { + $query = trim($query); + if (!empty($query)) { + $res = &$db->query($query); + if (PEAR::isError($res)) { + die("Cannot execute $query: " . $res->getMessage()); + } + } + } + } + else { + $fd = fopen($fileName, "r"); + while ($string = fgets($fd)) { + $string = ereg_replace("\n#[^\n]*\n", "\n", $string); + $string = ereg_replace("\n\-\-[^\n]*\n", "\n", $string); + $string = trim($string); + if (!empty($string)) { + $res = &$db->query($string); + if (PEAR::isError($res)) { + die("Cannot execute $string: " . $res->getMessage()); + } + } + } + } +} + +function civicrm_config($frontend = FALSE, $siteKey) { + global $adminPath, $compileDir; + + $jConfig = new JConfig(); + + $liveSite = substr_replace(JURI::root(), '', -1, 1); + $params = array( + 'cms' => 'Joomla', + 'crmRoot' => $adminPath . DIRECTORY_SEPARATOR . 'civicrm', + 'templateCompileDir' => $compileDir, + 'baseURL' => $liveSite . '/administrator/', + 'dbUser' => $jConfig->user, + 'dbPass' => $jConfig->password, + 'dbHost' => $jConfig->host, + 'dbName' => $jConfig->db, + 'CMSdbUser' => $jConfig->user, + 'CMSdbPass' => $jConfig->password, + 'CMSdbHost' => $jConfig->host, + 'CMSdbName' => $jConfig->db, + 'siteKey' => $siteKey, + ); + + if ($frontend) { + $params['baseURL'] = $liveSite . '/'; + } + + $str = JFile::read($adminPath . DIRECTORY_SEPARATOR . + 'civicrm' . DIRECTORY_SEPARATOR . + 'templates' . DIRECTORY_SEPARATOR . + 'CRM' . DIRECTORY_SEPARATOR . + 'common' . DIRECTORY_SEPARATOR . + 'civicrm.settings.php.tpl' + ); + foreach ($params as $key => $value) { + $str = str_replace('%%' . $key . '%%', $value, $str); + } + return trim($str); +} + +civicrm_main(); + diff --git a/admin/helpers/api.php b/admin/helpers/api.php new file mode 100644 index 000000000000..afa4ec84e34b --- /dev/null +++ b/admin/helpers/api.php @@ -0,0 +1,31 @@ +isAdmin() ) { + $jUser =& JFactory::getUser(); + $jId = $jUser->get('id'); + self::civicrmResetNavigation( $jId ); + } + } + + /** + * Reset CiviCRM user/contact navigation cache + * + * @param $jId - the logged in joomla ID if it exists + * + * @return void + */ + public function civicrmResetNavigation($jId = null) { + // Instantiate CiviCRM + if ( !class_exists('CRM_Core_Config') ) { + require_once JPATH_ROOT.'/administrator/components/com_civicrm/civicrm.settings.php'; + require_once 'CRM/Core/Config.php'; + } + + $config = CRM_Core_Config::singleton( ); + + $cId = NULL; + + //retrieve civicrm contact ID if joomla user ID is provided + if ( $jId ) { + $params = array( + 'version' => 3, + 'uf_id' => $jId, + 'return' => 'contact_id', + ); + $cId = civicrm_api('uf_match', 'getvalue', $params); + } + + // Reset Navigation + CRM_Core_BAO_Navigation::resetNavigation($cId); + } + +} diff --git a/admin/plugins/civicrm/civicrm.xml b/admin/plugins/civicrm/civicrm.xml new file mode 100755 index 000000000000..8907ecb429ab --- /dev/null +++ b/admin/plugins/civicrm/civicrm.xml @@ -0,0 +1,16 @@ + + + CiviCRM User Management + CiviCRM, LLC + January 2011 + Copyright (C) 2005 - 2011 CiviCRM. All rights reserved. + GNU Affero General Public License version 2 or later + info@civicrm.org + www.civicrm.org + 1.0 + Clear CiviCRM user navigation cache when ACL group membership altered. Remove Joomla user/CiviCRM contact mapping record when user is deleted. + + civicrm.php + index.html + + diff --git a/admin/plugins/civicrm/index.html b/admin/plugins/civicrm/index.html new file mode 100755 index 000000000000..6bfc7988e127 --- /dev/null +++ b/admin/plugins/civicrm/index.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/admin/plugins/civicrmicon/civicrmicon.php b/admin/plugins/civicrmicon/civicrmicon.php new file mode 100644 index 000000000000..75541994b504 --- /dev/null +++ b/admin/plugins/civicrmicon/civicrmicon.php @@ -0,0 +1,51 @@ +loadLanguage(); + } + + /** + * This method is called when the Quick Icons module is constructing its set + * of icons. You can return an array which defines a single icon and it will + * be rendered right after the stock Quick Icons. + * + * @param $context The calling context + * + * @return array A list of icon definition associative arrays, consisting of the + * keys link, image, text and access. + * + * @since 2.5 + */ + public function onGetIcons($context) { + jimport('joomla.environment.uri'); + return array( + array( + 'link' => 'index.php?option=com_civicrm', + 'image' => JURI::base() . 'components/com_civicrm/civicrm/i/smallLogo.png', + 'text' => 'CiviCRM', + 'id' => 'plg_quickicon_civicrmicon', + )); + } +} + diff --git a/admin/plugins/civicrmicon/civicrmicon.xml b/admin/plugins/civicrmicon/civicrmicon.xml new file mode 100644 index 000000000000..521b0e9d0a5e --- /dev/null +++ b/admin/plugins/civicrmicon/civicrmicon.xml @@ -0,0 +1,16 @@ + + + CiviCRM QuickIcon + CiviCRM, LLC + April 2012 + Copyright (C) 2005 - 2012 CiviCRM. All rights reserved. + GNU Affero General Public License version 2 or later + info@civicrm.org + www.civicrm.org + 2.5.0 + Displays link to CiviCRM in main icon Control Panel + + civicrmicon.php + index.html + + diff --git a/admin/plugins/civicrmicon/index.html b/admin/plugins/civicrmicon/index.html new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/admin/plugins/civicrmsys/civicrmsys.php b/admin/plugins/civicrmsys/civicrmsys.php new file mode 100644 index 000000000000..849859429481 --- /dev/null +++ b/admin/plugins/civicrmsys/civicrmsys.php @@ -0,0 +1,126 @@ +scheduleCivicrmRebuild(); + } + + /** + * After extension source code has been installed + * + * @param JInstaller Installer object + * @param int Extension Identifier + */ + public function onExtensionAfterInstall($installer, $eid) + { + if ($installer->extension instanceof JTableExtension && $installer->extension->folder == 'civicrm') { + //x $args = func_get_args(); dump($args, 'onExtensionAfterInstall'); + $this->scheduleCivicrmRebuild(); + } + } + + /** + * After extension source code has been updated(?) + * + * @param JInstaller Installer object + * @param int Extension identifier + */ + public function onExtensionAfterUpdate($installer, $eid) + { + // TODO test //if ($installer->extension instanceof JTableExtension && $installer->extension->folder == 'civicrm') { + $this->scheduleCivicrmRebuild(); + //} + } + + /** + * After extension configuration has been saved + */ + public function onExtensionAfterSave($type, $ext) + { + // Called by "Manage Plugins" use-case -- per-plugin forms + if ($type == 'com_plugins.plugin' && $ext->folder == 'civicrm') { + $this->scheduleCivicrmRebuild(); + } + } + + public function onContentCleanCache($defaultgroup, $cachebase) { + // Called by "Manage Plugins" use-case -- both bulk operations and per-plugin forms + if ($defaultgroup == 'com_plugins') { + $this->scheduleCivicrmRebuild(); + } + } + + /** + * After extension source code has been removed + * + * @param JInstaller Installer object + * @param int Extension identifier + */ + public function onExtensionAfterUninstall($installer, $eid, $result) + { + $this->scheduleCivicrmRebuild(); + } + + /** + * Ensure that the rebuild will be done + */ + public function scheduleCivicrmRebuild() { + if ($this->scheduled) { + return; + } + register_shutdown_function(array($this, 'doCivicrmRebuild')); + // dump(TRUE, 'scheduled'); + $this->scheduled = TRUE; + } + + /** + * Perform the actual rebuild + */ + public function doCivicrmRebuild() { + // dump($this, 'doCivicrmRebuild'); + $this->bootstrap(); + CRM_Core_Invoke::rebuildMenuAndCaches(TRUE); + } + + /** + * Make sure that CiviCRM is loaded + */ + protected function bootstrap() { + if (defined('CIVICRM_UF')) { + // already loaded settings + return; + } + + $app = JFactory::getApplication(); // copied from example -- but why? + + define('CIVICRM_SETTINGS_PATH', JPATH_ROOT . '/' . 'administrator/components/com_civicrm/civicrm.settings.php'); + require_once CIVICRM_SETTINGS_PATH; + + require_once 'CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + + require_once 'CRM/Core/Config.php'; + $civiConfig = CRM_Core_Config::singleton(); + } +} diff --git a/admin/plugins/civicrmsys/civicrmsys.xml b/admin/plugins/civicrmsys/civicrmsys.xml new file mode 100644 index 000000000000..89bc747836a8 --- /dev/null +++ b/admin/plugins/civicrmsys/civicrmsys.xml @@ -0,0 +1,16 @@ + + + CiviCRM System Listener + CiviCRM, LLC + January 2011 + Copyright (C) 2005 - 2011 CiviCRM. All rights reserved. + GNU Affero General Public License version 2 or later + info@civicrm.org + www.civicrm.org + 1.0 + Refresh CiviCRM configuration when related extensions are added or remove + + civicrmsys.php + index.html + + diff --git a/admin/plugins/civicrmsys/index.html b/admin/plugins/civicrmsys/index.html new file mode 100644 index 000000000000..2efb97f319a3 --- /dev/null +++ b/admin/plugins/civicrmsys/index.html @@ -0,0 +1 @@ + diff --git a/admin/plugins/example/example.php b/admin/plugins/example/example.php new file mode 100644 index 000000000000..684ff9148c9d --- /dev/null +++ b/admin/plugins/example/example.php @@ -0,0 +1,56 @@ +params->def('placement'); + $content = " + + + + +
Hook Data
Data 1
Data 2
+"; + } + + public function civicrm_tabs(&$tabs, $contactID) { + // unset the contribution tab, i.e. remove it from the page + unset($tabs[1]); + + // let's add a new "contribution" tab with a different name and put it last + // this is just a demo, in the real world, you would create a url which would + // return an html snippet etc. + $url = CRM_Utils_System::url('civicrm/contact/view/contribution', + "reset=1&snippet=1&force=1&cid=$contactID" + ); + $tabs[] = array( + 'id' => 'mySupercoolTab', + 'url' => $url, + 'title' => 'Contribution Tab Renamed', + 'weight' => 300, + ); + } +} + diff --git a/admin/plugins/example/example.xml b/admin/plugins/example/example.xml new file mode 100644 index 000000000000..050178a2884e --- /dev/null +++ b/admin/plugins/example/example.xml @@ -0,0 +1,32 @@ + + + plgCiviCRMExample + CiviCRM LLC + January 2011 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + GNU Affero General Public License version 3 or later + 1.6.0 + Example CiviCRM Plugin + + example.php + index.html + + + +

+ + + + + +
+ + + diff --git a/admin/plugins/example/index.html b/admin/plugins/example/index.html new file mode 100644 index 000000000000..6bfc7988e127 --- /dev/null +++ b/admin/plugins/example/index.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/admin/toolbar.civicrm.html.php b/admin/toolbar.civicrm.html.php new file mode 100644 index 000000000000..8a0bc2148d02 --- /dev/null +++ b/admin/toolbar.civicrm.html.php @@ -0,0 +1,38 @@ +[ ' . $displayAction . ' ]', 'generic.png'); + } + + static function _DEFAULT() { + + JToolBarHelper::title(JText::_('CiviCRM'), 'generic.png'); + } +} + diff --git a/admin/toolbar.civicrm.php b/admin/toolbar.civicrm.php new file mode 100644 index 000000000000..5407ddb2f864 --- /dev/null +++ b/admin/toolbar.civicrm.php @@ -0,0 +1,34 @@ + + + + + +
+ CiviCRM component files have been UPGRADED succesfully. +

Please run the CiviCRM Database Upgrade Utility now. This utility will check your database and perform any needed upgrades.

+

Also review the Upgrade Guide for any additional steps required to complete this upgrade.

+
+ '; + } + else { + $docLink = CRM_Utils_System::docURL2('Installation and Upgrades', FALSE, 'Installation Guide',NULL,NULL,"wiki"); + $frontEnd = CRM_Utils_System::docURL2('Configuring Front-end Profile Listings and Forms in Joomla! Sites', FALSE, 'Create front-end forms and searchable directories using Profiles',NULL,NULL,"wiki"); + $contri = CRM_Utils_System::docURL2('Displaying Online Contribution Pages in Joomla! Frontend Sites', FALSE, 'Create online contribution pages',NULL,NULL,"wiki"); + $event = CRM_Utils_System::docURL2('Configuring Front-end Event Info and Registration in Joomla! Sites', FALSE, 'Create events with online event registration',NULL,NULL,"wiki"); + + // INSTALL successful status and links + $content = ' +
+ + + + +
+ CiviCRM component files and database tables have been INSTALLED succesfully. +

Please review the ' . $docLink . ' for any additional steps required to complete the installation.

+

Then use the Configuration Checklist to review and configure CiviCRM settings for your new site.

+

Additional Resources: +

    +
  • ' . $frontEnd . '
  • +
  • ' . $contri . '
  • +
  • ' . $event . '
  • +
+

+

We have integrated KCFinder with CKEditor and TinyMCE, which enables user to upload images. Note that all the images uploaded using KCFinder will be public. +

+

Have you registered this site at CiviCRM.org? If not, please help strengthen the CiviCRM ecosystem by taking a few minutes to fill out the site registration form. The information collected will help us prioritize improvements, target our communications and build the community. If you have a technical role for this site, be sure to check Keep in Touch to receive technical updates (a low volume mailing list).

+
+
'; + } + + //install and enable plugins + $manifest = $parent->get("manifest"); + $parent = $parent->getParent(); + $source = $parent->getPath("source"); + $installer = new JInstaller(); + $plgArray = array(); + + foreach ($manifest->plugins->plugin as $plugin) { + $attributes = $plugin->attributes(); + $plg = $source . DS . $attributes['folder'] . DS . $attributes['plugin']; + $installer->install($plg); + $plgArray[] = "'" . $attributes['plugin'] . "'"; + } + + $db = JFactory::getDbo(); + $tableExtensions = $db->nameQuote("#__extensions"); + $columnElement = $db->nameQuote("element"); + $columnType = $db->nameQuote("type"); + $columnEnabled = $db->nameQuote("enabled"); + $plgList = implode(',', $plgArray); + + // Enable plugins + $db->setQuery("UPDATE $tableExtensions + SET $columnEnabled = 1 + WHERE $columnElement IN ($plgList) + AND $columnType = 'plugin'" + ); + $db->query(); + + echo $content; + } + + function uninstall($parent) { + $uninstall = FALSE; + // makes it easier if folks want to really uninstall + if ($uninstall) { + define('CIVICRM_SETTINGS_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'civicrm.settings.php'); + require_once CIVICRM_SETTINGS_PATH; + + require_once 'CRM/Core/Config.php'; + $config = CRM_Core_Config::singleton(); + + require_once 'CRM/Core/DAO.php'; + CRM_Core_DAO::dropAllTables(); + + echo "You have uninstalled CiviCRM. All CiviCRM related tables have been dropped from the database."; + } + else { + echo "You have uninstalled CiviCRM."; + } + } + + function update($parent) { + $this->install($parent); + } + + function preflight($type, $parent) {} + + function postflight($type, $parent) { + // set the default permissions + // only on new install + // CRM-9418 + global $civicrmUpgrade; + + if (!$civicrmUpgrade) { + $this->setDefaultPermissions(); + } + } + + function setDefaultPermissions() { + // get the current perms from the assets table and + // only set if its empty + $db = JFactory::getDbo(); + $db->setQuery('SELECT rules FROM #__assets WHERE name = ' . $db->quote('com_civicrm')); + $assetRules = json_decode((string ) $db->loadResult()); + + + if (count($assetRules) > 1) { + return; + } + + $rules = new stdClass; + + $permissions = array( + 'Public' => + array( + 'access CiviMail subscribe/unsubscribe pages', + 'access all custom data', + 'access uploaded files', + 'make online contributions', + 'profile listings and forms', + 'register for events', + 'view event info', + 'view event participants', + ), + 'Registered' => + array( + 'access CiviMail subscribe/unsubscribe pages', + 'access all custom data', + 'access uploaded files', + 'make online contributions', + 'profile listings and forms', + 'register for events', + 'view event info', + 'view event participants', + ), + ); + + require_once 'CRM/Utils/String.php'; + + $newPerms = array(); + foreach ($permissions as $group => $perms) { + + // get user group ID + $userGroupID = $this->getJoomlaUserGroupID($group); + if (empty($userGroupID)) { + // since we cant resolve this, we move on + continue; + } + + + foreach ($perms as $perm) { + $permString = 'civicrm.' . CRM_Utils_String::munge(strtolower($perm)); + if (!array_key_exists($permString, $newPerms)) { + $newPerms[$permString] = array(); + } + $newPerms[$permString][] = $userGroupID; + } + } + + if (empty($newPerms)) { + return; + } + + // now merge the two newPerms and rules + foreach ($newPerms as $perm => $groups) { + if (empty($rules->$perm)) { + $rulesArray = array(); + } + else { + $rulesArray = (array ) $rules->$perm; + } + + foreach ($groups as $group) { + $present = FALSE; + foreach ($rulesArray as $key => $val) { + if ((int ) $key == $group) { + $present = TRUE; + break; + } + } + if (!$present) { + $rulesArray[(string ) $group] = 1; + } + } + + $rules->$perm = (object ) $rulesArray; + } + + $rulesString = json_encode($rules); + $db->setQuery('UPDATE #__assets SET rules = ' . + $db->quote($rulesString) . + ' WHERE name = ' . + $db->quote('com_civicrm') + ); + if (!$db->query()) { + echo 'Seems like setting default actions failed

'; + } + } + + function getJoomlaUserGroupID($title) { + $db = JFactory::getDbo(); + $db->setQuery('SELECT id FROM #__usergroups where title = ' . $db->quote($title)); + return (int) $db->loadResult(); + } +} + diff --git a/site/civicrm.html.php b/site/civicrm.html.php new file mode 100644 index 000000000000..85f2d09f34be --- /dev/null +++ b/site/civicrm.html.php @@ -0,0 +1,9 @@ +"; + exit(); +} + +define('CIVICRM_SETTINGS_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'civicrm.settings.php'); +include_once CIVICRM_SETTINGS_PATH; + +civicrm_invoke(); + +function civicrm_init() { + + require_once 'CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + + require_once 'PEAR.php'; + + $config = CRM_Core_Config::singleton(); + + // this is the front end, so let others know + $config->userFrameworkFrontend = 1; +} + +function civicrm_invoke() { + civicrm_init(); + + // check and ensure that we have a valid session + if (!empty($_POST)) { + // the session should not be empty + // however for standalone forms, it will not have any CiviCRM variables in the + // session either, so dont check for it + if (count($_SESSION) <= 1) { + $config = CRM_Core_Config::singleton(); + CRM_Utils_System::redirect($config->userFrameworkBaseURL); + } + } + + // add all the values from the itemId param + // overrride the GET values if conflict + if (CRM_Utils_Array::value('Itemid', $_GET)) { + $component = JComponentHelper::getComponent('com_civicrm'); + $menu = JSite::getMenu(); + $params = $menu->getParams($_GET['Itemid']); + $args = array('task', 'id', 'gid', 'pageId', 'action', 'csid', 'component'); + $view = CRM_Utils_Array::value('view', $_GET); + if ($view) { + $args[] = 'reset'; + } + foreach ($args as $a) { + $val = $params->get($a, NULL); + if ($val !== NULL && $view) { + $_REQUEST[$a] = $_GET[$a] = $val; + } + } + } + + $task = CRM_Utils_Array::value('task', $_GET, ''); + $args = explode('/', trim($task)); + + CRM_Core_Resources::singleton()->addCoreResources(); + CRM_Utils_System_Joomla::addHTMLHead(); + + $user = JFactory::getUser(); + CRM_Core_BAO_UFMatch::synchronize($user, FALSE, 'Joomla', 'Individual', TRUE); + + CRM_Core_Invoke::invoke($args); +} + diff --git a/site/elements/civicontribpages.php b/site/elements/civicontribpages.php new file mode 100644 index 000000000000..76c660577a04 --- /dev/null +++ b/site/elements/civicontribpages.php @@ -0,0 +1,69 @@ +value; + $name = $this->name; + + // Initiate CiviCRM + define('CIVICRM_SETTINGS_PATH', JPATH_ROOT . '/' . 'administrator/components/com_civicrm/civicrm.settings.php'); + require_once CIVICRM_SETTINGS_PATH; + + require_once 'CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + + require_once 'CRM/Core/Config.php'; + $config = CRM_Core_Config::singleton(); + + $options = array(); + $options[] = JHTML::_('select.option', '0', JText::_('- Select Contribution Page -')); + $query = 'SELECT id,title FROM civicrm_contribution_page WHERE is_active = 1 ORDER BY title'; + $dao = CRM_Core_DAO::executeQuery($query); + while ($dao->fetch()) { + $options[] = JHTML::_('select.option', $dao->id, $dao->title); + } + return JHTML::_('select.genericlist', $options, $name, + NULL, 'value', 'text', $value, $name + ); + } +} + + diff --git a/site/elements/civicontribpagespcp.php b/site/elements/civicontribpagespcp.php new file mode 100644 index 000000000000..c37577c95593 --- /dev/null +++ b/site/elements/civicontribpagespcp.php @@ -0,0 +1,78 @@ +value; + $name = $this->name; + + // Initiate CiviCRM + define('CIVICRM_SETTINGS_PATH', JPATH_ROOT . '/' . 'administrator/components/com_civicrm/civicrm.settings.php'); + require_once CIVICRM_SETTINGS_PATH; + + require_once 'CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + + require_once 'CRM/Core/Config.php'; + $config = CRM_Core_Config::singleton(); + + // Get list of all ContribPagesPCP and assign to options array + $options = array(); + + $query = "SELECT cp.id, cp.title + FROM civicrm_contribution_page cp, civicrm_pcp_block pcp + WHERE cp.is_active = 1 + AND pcp.is_active = 1 + AND pcp.entity_id = cp.id + AND pcp.entity_table = 'civicrm_contribution_page' + ORDER BY cp.title;"; + + $dao = CRM_Core_DAO::executeQuery($query); + while ($dao->fetch()) { + $options[] = JHTML::_('select.option', $dao->id, $dao->title); + } + + return JHTML::_('select.genericlist', $options, $name, + NULL, 'value', 'text', $value, $name + ); + } +} + diff --git a/site/elements/civicustomsearch.php b/site/elements/civicustomsearch.php new file mode 100644 index 000000000000..75fe49654302 --- /dev/null +++ b/site/elements/civicustomsearch.php @@ -0,0 +1,67 @@ +value; + $name = $this->name; + + // Initiate CiviCRM + define('CIVICRM_SETTINGS_PATH', JPATH_ROOT . '/' . 'administrator/components/com_civicrm/civicrm.settings.php'); + require_once CIVICRM_SETTINGS_PATH; + + require_once 'CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + + require_once 'CRM/Core/Config.php'; + $config = CRM_Core_Config::singleton(); + $query = " +SELECT value, description +FROM civicrm_option_value +WHERE option_group_id =24 +"; + $dao = CRM_Core_DAO::executeQuery($query); + while ($dao->fetch()) { + $options[] = JHTML::_('select.option', $dao->value, $dao->description); + } + + return JHTML::_('select.genericlist', $options, $name, NULL, 'value', 'text', $dao->value); + } +} + diff --git a/site/elements/civievents.php b/site/elements/civievents.php new file mode 100644 index 000000000000..d045e3dc4977 --- /dev/null +++ b/site/elements/civievents.php @@ -0,0 +1,80 @@ +value; + $name = $this->name; + // Initiate CiviCRM + define('CIVICRM_SETTINGS_PATH', JPATH_ROOT . '/' . 'administrator/components/com_civicrm/civicrm.settings.php'); + require_once CIVICRM_SETTINGS_PATH; + + require_once 'CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + + require_once 'CRM/Core/Config.php'; + $config = CRM_Core_Config::singleton(); + + $params = array( + 'version' => '3', + 'is_active' => 1, + 'isCurrent' => 1, + 'return.title' => 1, + 'return.id' => 1, + 'return.end_date' => 1, + 'return.start_date' => 1, + ); + $events = civicrm_api('event', 'get', $params); + $currentdate = date("Y-m-d H:i:s"); + $options = array(); + $options[] = JHTML::_('select.option', '', JText::_('- Select Event -')); + foreach ($events['values'] as $event) { + if (strtotime($event['start_date']) >= strtotime($currentdate) || + strtotime($event['end_date']) >= strtotime($currentdate) + ) { + $options[] = JHTML::_('select.option', $event['id'], $event['event_title']); + } + } + + return JHTML::_('select.genericlist', $options, $name, NULL, 'value', 'text', $value); + } +} + + diff --git a/site/elements/civieventsonline.php b/site/elements/civieventsonline.php new file mode 100644 index 000000000000..714a94fbdb14 --- /dev/null +++ b/site/elements/civieventsonline.php @@ -0,0 +1,56 @@ +value; + $name = $this->name; + + // Initiate CiviCRM + define('CIVICRM_SETTINGS_PATH', JPATH_ROOT . '/' . 'administrator/components/com_civicrm/civicrm.settings.php'); + require_once CIVICRM_SETTINGS_PATH; + + require_once 'CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + + require_once 'CRM/Core/Config.php'; + $config = CRM_Core_Config::singleton(); + + $params = array( + 'version' => '3', + 'is_online_registration' => 1, + 'is_active' => 1, + 'isCurrent' => 1, + 'return.title' => 1, + 'return.id' => 1, + 'return.end_date' => 1, + 'return.start_date' => 1, + ); + $events = civicrm_api('event', 'get', $params); + $currentdate = date("Y-m-d H:i:s"); + $options = array(); + $options[] = JHTML::_('select.option', '', JText::_('- Select Event -')); + foreach ($events['values'] as $event) { + if (strtotime($event['start_date']) >= strtotime($currentdate) || + strtotime($event['end_date']) >= strtotime($currentdate) + ) { + $options[] = JHTML::_('select.option', $event['id'], $event['event_title']); + } + } + return JHTML::_('select.genericlist', $options, $name, NULL, 'value', 'text', $value); + } +} + + diff --git a/site/elements/civipcps.php b/site/elements/civipcps.php new file mode 100644 index 000000000000..2dc9fdc092a5 --- /dev/null +++ b/site/elements/civipcps.php @@ -0,0 +1,69 @@ +value; + $name = $this->name; + + // Initiate CiviCRM + define('CIVICRM_SETTINGS_PATH', JPATH_ROOT . '/' . 'administrator/components/com_civicrm/civicrm.settings.php'); + require_once CIVICRM_SETTINGS_PATH; + + require_once 'CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + + require_once 'CRM/Core/Config.php'; + $config = CRM_Core_Config::singleton(); + + // Get list of all profiles and assign to options array + $options = array(); + + $query = 'SELECT id, title FROM civicrm_pcp WHERE is_active = 1 AND status_id = 2 ORDER BY title'; + $dao = CRM_Core_DAO::executeQuery($query); + while ($dao->fetch()) { + $options[] = JHTML::_('select.option', $dao->id, $dao->title); + } + return JHTML::_('select.genericlist', $options, $name, NULL, 'value', 'text', $value); + } +} + + diff --git a/site/elements/civiprofiles.php b/site/elements/civiprofiles.php new file mode 100644 index 000000000000..96255c4f4dfc --- /dev/null +++ b/site/elements/civiprofiles.php @@ -0,0 +1,64 @@ +value; + $name = $this->name; + + // Initiate CiviCRM + define('CIVICRM_SETTINGS_PATH', JPATH_ROOT . '/' . 'administrator/components/com_civicrm/civicrm.settings.php'); + require_once CIVICRM_SETTINGS_PATH; + + require_once 'CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + + require_once 'CRM/Core/Config.php'; + $config = CRM_Core_Config::singleton(); + + $ufGroups = CRM_Core_PseudoConstant::ufGroup(); + $options[] = JHTML::_('select.option', '', JText::_('- Select Profile -')); + foreach ($ufGroups as $key => $values) { + $options[] = JHTML::_('select.option', $key, $values); + } + return JHTML::_('select.genericlist', $options, $name, NULL, 'value', 'text', $value); + } +} + + diff --git a/site/views/Contributions/metadata.xml b/site/views/Contributions/metadata.xml new file mode 100644 index 000000000000..58692e205033 --- /dev/null +++ b/site/views/Contributions/metadata.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/site/views/Contributions/tmpl/default.php b/site/views/Contributions/tmpl/default.php new file mode 100644 index 000000000000..922fcdbc84ee --- /dev/null +++ b/site/views/Contributions/tmpl/default.php @@ -0,0 +1,31 @@ + + + + + + + CiviCRM Contribution Page + 07/26/2010 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + 3.4 + CiviCRM Contribution Pages + + +

+ + + +
+ + + + + diff --git a/site/views/Contributions/tmpl/pcp.php b/site/views/Contributions/tmpl/pcp.php new file mode 100644 index 000000000000..922fcdbc84ee --- /dev/null +++ b/site/views/Contributions/tmpl/pcp.php @@ -0,0 +1,31 @@ + + + + + + CiviCRM PCP + 07/26/2010 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + 4.0 + CiviCRM contribution pages which support personal campaign pages. + + +
+ + + + + +
+
+
+
+
+ diff --git a/site/views/Contributions/tmpl/pcpinfo.php b/site/views/Contributions/tmpl/pcpinfo.php new file mode 100644 index 000000000000..922fcdbc84ee --- /dev/null +++ b/site/views/Contributions/tmpl/pcpinfo.php @@ -0,0 +1,31 @@ + + + + + + CiviCRM PCP + 07/26/2010 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + 4.0 + CiviCRM Personal Campaign Information Pages + + +
+ + + +
+
+
+
+
+ diff --git a/site/views/Contributions/view.html.php b/site/views/Contributions/view.html.php new file mode 100644 index 000000000000..ea8e80dc2be6 --- /dev/null +++ b/site/views/Contributions/view.html.php @@ -0,0 +1,37 @@ + + + + + + \ No newline at end of file diff --git a/site/views/CustomSearch/tmpl/default.php b/site/views/CustomSearch/tmpl/default.php new file mode 100644 index 000000000000..f157f2b3d170 --- /dev/null +++ b/site/views/CustomSearch/tmpl/default.php @@ -0,0 +1,29 @@ + diff --git a/site/views/CustomSearch/tmpl/default.xml b/site/views/CustomSearch/tmpl/default.xml new file mode 100644 index 000000000000..4562a2399f8f --- /dev/null +++ b/site/views/CustomSearch/tmpl/default.xml @@ -0,0 +1,27 @@ + + + + + + + + CiviCRM + 07/07/2011 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + 4.0 + Custom Search + CiviCRM Custom Search + + +
+ + + +
+
+
+
+
diff --git a/site/views/CustomSearch/view.html.php b/site/views/CustomSearch/view.html.php new file mode 100644 index 000000000000..1b5800eeda6e --- /dev/null +++ b/site/views/CustomSearch/view.html.php @@ -0,0 +1,42 @@ + + + + + + \ No newline at end of file diff --git a/site/views/Dashboard/tmpl/default.xml b/site/views/Dashboard/tmpl/default.xml new file mode 100644 index 000000000000..e64f6a7eff13 --- /dev/null +++ b/site/views/Dashboard/tmpl/default.xml @@ -0,0 +1,25 @@ + + + + + + + + Dashboard + 04/01/2008 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + 2.2 + CiviCRM Dashboard + + +
+ + +
+
+
+
+
diff --git a/site/views/Dashboard/view.html.php b/site/views/Dashboard/view.html.php new file mode 100644 index 000000000000..27e32b08624b --- /dev/null +++ b/site/views/Dashboard/view.html.php @@ -0,0 +1,38 @@ + + + + + + diff --git a/site/views/Events/tmpl/default.php b/site/views/Events/tmpl/default.php new file mode 100644 index 000000000000..a0bf49d2c86e --- /dev/null +++ b/site/views/Events/tmpl/default.php @@ -0,0 +1,152 @@ + +params->def( 'show_page_title', 1 ) ) : ?> +
+ escape($this->params->get('page_title')); ?> +
+ + +params->def('image', -1) != -1) || $this->params->def('show_comp_description', 1) ) : ?> + + + + +
+ image) ) : echo $this->image; endif; + echo $this->params->get('comp_description'); + ?> +
+ + +
+

$event.title ?>

+
+ + + + + + + + + + + + + + + + + + /*End of isShowLocation condition*/ + + + + + + + + + + + +
$event.summary ?>
+ $event.description ?>
+ + + + + + $event.event_end_date|crmDate:0:1 ?> + + else + + $event.event_end_date|crmDate ?> + + + +
+ {$location.1.name}
{/if} + $location.1.address.display|nl2br ?> + mapAPIKey && + ( ( !empty($location.1.address.geo_code_1) AND is_numeric($location.1.address.geo_code_1) ) || + ( $config->mapGeoCoding && !empty($location.1.address.city) AND !empty($location.1.address.state_province) ) ) ) ?> +
JText::_('Map this Location') + +
/* loop on any phones and emails for this event */ + + + + "$phone.phone ?>"
+ + + + + + JText::_('Email:') + + +
+ + //need to do this part + {section name=loop start=1 loop=11} + {assign var=idx value=$smarty.section.loop.index} + + + + {/section} +
{$feeBlock.label.$idx}{$feeBlock.value.$idx|crmMoney}
+
+ + + + /* Show link to Event Registration page if event if configured for online reg AND we are NOT coming from Contact Dashboard (CRM-2046) */ + + + +
+ + + +
+ diff --git a/site/views/Events/tmpl/default.xml b/site/views/Events/tmpl/default.xml new file mode 100644 index 000000000000..7fb9ceaf5547 --- /dev/null +++ b/site/views/Events/tmpl/default.xml @@ -0,0 +1,27 @@ + + + + + + + CiviCRM + 07/26/2010 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + 3.2 + CiviCRM event information page. Only current/future, active events are available (next 25 upcoming events). + Standard Event Information Layout + + +
+ + + +
+
+
+
+
+ diff --git a/site/views/Events/tmpl/eventlisting.php b/site/views/Events/tmpl/eventlisting.php new file mode 100644 index 000000000000..f157f2b3d170 --- /dev/null +++ b/site/views/Events/tmpl/eventlisting.php @@ -0,0 +1,29 @@ + diff --git a/site/views/Events/tmpl/eventlisting.xml b/site/views/Events/tmpl/eventlisting.xml new file mode 100644 index 000000000000..cc03c94b9be1 --- /dev/null +++ b/site/views/Events/tmpl/eventlisting.xml @@ -0,0 +1,36 @@ + + + + + Display a list of current/future public events. + + + + CiviCRM + 11/11/2010 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + 3.3 + List of all active, current, public events. + Event Listing + +
+ + + +
+
+ +
+ + + +
+
+ +
+
diff --git a/site/views/Events/tmpl/participantlisting.php b/site/views/Events/tmpl/participantlisting.php new file mode 100644 index 000000000000..f157f2b3d170 --- /dev/null +++ b/site/views/Events/tmpl/participantlisting.php @@ -0,0 +1,29 @@ + diff --git a/site/views/Events/tmpl/participantlisting.xml b/site/views/Events/tmpl/participantlisting.xml new file mode 100644 index 000000000000..e70ea9cce468 --- /dev/null +++ b/site/views/Events/tmpl/participantlisting.xml @@ -0,0 +1,27 @@ + + + + + + + + CiviCRM + 11/11/2010 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + 3.3 + + Participant listing page. Be sure to enable this option in your event settings and select a listing template before creating a menu item. + + Participant Listing + +
+ + + +
+
+
+
diff --git a/site/views/Events/tmpl/register.php b/site/views/Events/tmpl/register.php new file mode 100644 index 000000000000..50a13d2dbc75 --- /dev/null +++ b/site/views/Events/tmpl/register.php @@ -0,0 +1,155 @@ + +params->def( 'show_page_title', 1 ) ) : ?> +
+ escape($this->params->get('page_title')); ?> +
+ + +params->def('image', -1) != -1) || $this->params->def('show_comp_description', 1) ) : ?> + + + + +
+ image) ) : echo $this->image; endif; + echo $this->params->get('comp_description'); + ?> +
+ + +
+

$event.title ?>

+
+ + + + + + + + + + + + + + + + + + /*End of isShowLocation condition*/ + + + + + + + + + + + + +
$event.summary ?>
+ $event.description ?>
+ + $event.event_start_date|crmDate ?> + + +   JText::_('through')   + /* Only show end time if end date = start date*/ + + + $event.event_end_date|crmDate:0:1 ?> + + + + $event.event_end_date|crmDate?> + + + +
+ $location.1.name ?>
+ + $location.1.address.display|nl2br ?> + mapAPIKey && + ( ( !empty($location.1.address.geo_code_1) AND is_numeric($location.1.address.geo_code_1) ) || + ( $config->mapGeoCoding && !empty($location.1.address.city) AND !empty($location.1.address.state_province) ) ) ) ?> +
JText::_('Map this Location') + +
/* loop on any phones and emails for this event */ + + + + {$phone.phone}
+ + + + + + + JText::_('Email:') + + +
+ + //need to do + {section name=loop start=1 loop=11} + {assign var=idx value=$smarty.section.loop.index} + + + + {/section} +
{$feeBlock.label.$idx}{$feeBlock.value.$idx|crmMoney}
+
+ + {include file="CRM/Contact/Page/View/InlineCustomData.tpl" mainEditForm=1} + + /* Show link to Event Registration page if event if configured for online reg AND we are NOT coming from Contact Dashboard (CRM-2046) */ + + + +
+ + + +
+ diff --git a/site/views/Events/tmpl/register.xml b/site/views/Events/tmpl/register.xml new file mode 100644 index 000000000000..0b365c4c9272 --- /dev/null +++ b/site/views/Events/tmpl/register.xml @@ -0,0 +1,27 @@ + + + + + + + CiviCRM + 07/26/2010 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + 3.2 + CiviCRM event registration. Only current/future, active, online events are available (next 25 upcoming events). + Standard Event Registration Layout + + +
+ + + +
+
+
+
+
+ diff --git a/site/views/Events/view.html.php b/site/views/Events/view.html.php new file mode 100644 index 000000000000..38a44cf0cc4f --- /dev/null +++ b/site/views/Events/view.html.php @@ -0,0 +1,35 @@ + + + + Use this link to allow users to signup for mailing lists by being added to public access groups. Note that the addition of contacts to groups will respect your single or double opt-in settings in CiviCRM. + + \ No newline at end of file diff --git a/site/views/MailingList/tmpl/default.xml b/site/views/MailingList/tmpl/default.xml new file mode 100644 index 000000000000..6811113a9b21 --- /dev/null +++ b/site/views/MailingList/tmpl/default.xml @@ -0,0 +1,25 @@ + + + + + + + + Mailing List Subscription + 11/11/2010 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + 3.2 + Use this link to allow users to signup for mailing lists by being added to public access groups. Note that the addition of contacts to groups will respect your single or double opt-in settings in CiviCRM. + + +
+ + +
+
+
+
+
diff --git a/site/views/MailingList/view.html.php b/site/views/MailingList/view.html.php new file mode 100644 index 000000000000..1e4ff9d065a4 --- /dev/null +++ b/site/views/MailingList/view.html.php @@ -0,0 +1,33 @@ + + + + + + \ No newline at end of file diff --git a/site/views/Profiles/tmpl/default.php b/site/views/Profiles/tmpl/default.php new file mode 100644 index 000000000000..7ff6c5c5c7b3 --- /dev/null +++ b/site/views/Profiles/tmpl/default.php @@ -0,0 +1,183 @@ + +params->def( 'show_page_title', 1 ) ) : ?> +
+ escape($this->params->get('page_title')); ?> +
+ + +params->def('image', -1) != -1) || $this->params->def('show_comp_description', 1) ) : ?> + + + + +
+ image) ) : echo $this->image; endif; + echo $this->params->get('comp_description'); + ?> +
+ +/* wrap in crm-container div so crm styles are used */ +
+ + /*create is mode 1*/ + + +
$help_pre ?>
+ + + + + {assign var=zeroField value="Initial Non Existent Fieldset"} + {assign var=fieldset value=$zeroField} + {foreach from=$fields item=field key=fieldName} + + + + + +
$groupHelpPost ?>
+ + + + +
+ + + + {assign var="groupId" value="id_"|cat:$field.group_id} + +
+ {ts}open section{/ts}
+
+ +
+
{ts}close section{/ts}{ts}{$field.groupTitle}{/ts} + {else} +
+
{ts}{$field.groupTitle}{/ts} + + + {assign var=fieldset value=`$field.groupTitle`} + {assign var=groupHelpPost value=`$field.groupHelpPost`} + +
{$field.groupHelpPre}
+ + + + + {assign var=n value=$field.name} + + + + + + {else} + + + + + {if $form.$n.type eq 'file'} + + + + + /* Show explanatory text for field if not in 'view' mode */ + + + + {/foreach} + + + + + + + {include file='CRM/common/ReCAPTCHA.tpl'} + + +
{$form.$n.label} + {assign var="count" value="1"} + {strip} + + + /* sort by fails for option per line. Added a variable to iterate through the element array*/ + {assign var="index" value="1"} + {foreach name=outer key=key item=item from=$form.$n} + + {assign var="index" value=`$index+1`} + {else} + + + + + {assign var="count" value="1"} + {else} + {assign var="count" value=`$count+1`} + + + {/foreach} + +
{$form.$n.$key.html}
+ {/strip} +
{$form.$n.label} + + {assign var="provider" value=$n|cat:"-provider_id"} + {$form.$provider.html}  + + {$form.$n.html} +
{$customFiles.$n.displayURL}
{$customFiles.$n.deleteURL}
 {$field.help_post}
{$form.group[$addToGroupId].label}{$form.group[$addToGroupId].html}
+ + +
{$field.groupHelpPost}
+ + + +
+
+ + + +
{$help_post}
+ + {/strip} +
/* end crm-container div */ + + +{if ! empty( $fields )} +/* wrap in crm-container div so crm styles are used */ +
+ + {include file="CRM/Form/body.tpl"} + + + {strip} + {if $help_pre && $action neq 4} +
{$help_pre}
+ {/if} + + {include file="CRM/common/CMSUser.tpl"} + + {assign var=zeroField value="Initial Non Existent Fieldset"} + {assign var=fieldset value=$zeroField} + {foreach from=$fields item=field key=fieldName} + + {if $field.groupTitle != $fieldset} + {if $fieldset != $zeroField} + + {if $groupHelpPost} +
{$groupHelpPost}
+ {/if} + + + + + {/if} + + +
+ + {if $context neq 'dialog'} +
+ {ts}open section{/ts}
+
+ +
+
{ts}close section{/ts}{ts}{$field.groupTitle}{/ts} + {else} +
+
{ts}{$field.groupTitle}{/ts} + {/if} + {/if} + {assign var=fieldset value=`$field.groupTitle`} + {assign var=groupHelpPost value=`$field.groupHelpPost`} + {if $field.groupHelpPre} +
{$field.groupHelpPre}
+ {/if} + + {/if} + + {assign var=n value=$field.name} + {if $field.options_per_line} + + + + + {else} + + + + + {if $form.$n.type eq 'file'} + + + {/if} + {/if} + {* Show explanatory text for field if not in 'view' mode *} + {if $field.help_post && $action neq 4 && $form.$n.html} + {/if} + + {/foreach} + + {if $addToGroupId} + + {/if} + + {if $isCaptcha } + {include file='CRM/common/ReCAPTCHA.tpl'} + {/if} + +
{$form.$n.label} + {assign var="count" value="1"} + {strip} + + + {* sort by fails for option per line. Added a variable to iterate through the element array*} + {assign var="index" value="1"} + {foreach name=outer key=key item=item from=$form.$n} + {if $index < 10} + {assign var="index" value=`$index+1`} + {else} + + {if $count == $field.options_per_line} + + + {assign var="count" value="1"} + {else} + {assign var="count" value=`$count+1`} + {/if} + {/if} + {/foreach} + +
{$form.$n.$key.html}
+ {/strip} +
{$form.$n.label} + {if $n|substr:0:3 eq 'im-'} + {assign var="provider" value=$n|cat:"-provider_id"} + {$form.$provider.html}  + {/if} + {$form.$n.html} +
{$customFiles.$n.displayURL}
{$customFiles.$n.deleteURL}
 {$field.help_post}
{$form.group[$addToGroupId].label}{$form.group[$addToGroupId].html}
+ + {if $field.groupHelpPost} +
{$field.groupHelpPost}
+ {/if} + +
+ + + + +{/if} + {if $help_post && $action neq 4}
{$help_post}
{/if} + {/strip} + +
/* end crm-container div */ + + +{/if} + +{else} {* empty fields *} +
+
+
{ts}status{/ts}
+
{ts}No fields in this Profile have been configured as searchable. Ask the site administrator to check the Profile setup.{/ts}
+
+
+{/if} + + + + + diff --git a/site/views/Profiles/tmpl/search.xml b/site/views/Profiles/tmpl/search.xml new file mode 100644 index 000000000000..1b5bef839133 --- /dev/null +++ b/site/views/Profiles/tmpl/search.xml @@ -0,0 +1,28 @@ + + + + + + + + CiviCRM + 07/26/2010 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + 3.2 + Profile Search Layout + CiviCRM Profile Search Form + + +
+ + + +
+
+
+ +
+
diff --git a/site/views/Profiles/tmpl/view.php b/site/views/Profiles/tmpl/view.php new file mode 100644 index 000000000000..033bfba1f7f3 --- /dev/null +++ b/site/views/Profiles/tmpl/view.php @@ -0,0 +1,208 @@ + +params->def( 'show_page_title', 1 ) ) : ?> +
+ escape($this->params->get('page_title')); ?> +
+ + +params->def('image', -1) != -1) || $this->params->def('show_comp_description', 1) ) : ?> + + + + +
+ image) ) : echo $this->image; endif; + echo $this->params->get('comp_description'); + ?> +
+ + +{* wrap in crm-container div so crm styles are used *} +
+ + {if $mode eq 8 || $mode eq 1} + {include file="CRM/Form/body.tpl"} + {/if} + + {strip} + {if $help_pre && $action neq 4} +
{$help_pre}
+ {/if} + + {include file="CRM/common/CMSUser.tpl"} + + {assign var=zeroField value="Initial Non Existent Fieldset"} + {assign var=fieldset value=$zeroField} + {foreach from=$fields item=field key=fieldName} + + {if $field.groupTitle != $fieldset} + {if $fieldset != $zeroField} + + {if $groupHelpPost} +
{$groupHelpPost}
+ {/if} + + {if $mode eq 8} +
+ {else} +
+
+ {/if} + {/if} + + {if $mode eq 8} +
+ {else} + {assign var="groupId" value="id_"|cat:$field.group_id} + {if $context neq 'dialog'} +
+ {ts}open section{/ts}
+
+ +
+
{ts}close section{/ts}{ts}{$field.groupTitle}{/ts} + {else} +
+
{ts}{$field.groupTitle}{/ts} + {/if} + {/if} + {assign var=fieldset value=`$field.groupTitle`} + {assign var=groupHelpPost value=`$field.groupHelpPost`} + {if $field.groupHelpPre} +
{$field.groupHelpPre}
+ {/if} + + {/if} + + {assign var=n value=$field.name} + {if $field.options_per_line} + + + + + {else} + + + + + {if $form.$n.type eq 'file'} + + + {/if} + {/if} + {* Show explanatory text for field if not in 'view' mode *} + {if $field.help_post && $action neq 4 && $form.$n.html} + {/if} + + {/foreach} + + {if $addToGroupId} + + {/if} + + {if $isCaptcha && ( $mode eq 8 || $mode eq 4 || $mode eq 1 ) } + {include file='CRM/common/ReCAPTCHA.tpl'} + {/if} + +
{$form.$n.label} + {assign var="count" value="1"} + {strip} + + + {* sort by fails for option per line. Added a variable to iterate through the element array*} + {assign var="index" value="1"} + {foreach name=outer key=key item=item from=$form.$n} + {if $index < 10} + {assign var="index" value=`$index+1`} + {else} + + {if $count == $field.options_per_line} + + + {assign var="count" value="1"} + {else} + {assign var="count" value=`$count+1`} + {/if} + {/if} + {/foreach} + +
{$form.$n.$key.html}
+ {/strip} +
{$form.$n.label} + {if $n|substr:0:3 eq 'im-'} + {assign var="provider" value=$n|cat:"-provider_id"} + {$form.$provider.html}  + {/if} + {$form.$n.html} +
{$customFiles.$n.displayURL}
{$customFiles.$n.deleteURL}
 {$field.help_post}
{$form.group[$addToGroupId].label}{$form.group[$addToGroupId].html}
+ + {if $field.groupHelpPost} +
{$field.groupHelpPost}
+ {/if} + + {if $mode eq 8} +
+ {else} +
+
+ {/if} + + +{if $mode eq 4} +
+ {$form.buttons.html} +
+{/if} + {if $help_post && $action neq 4}
{$help_post}
{/if} + {/strip} + + {* end crm-container div *} + + +{/if} {* fields array is not empty *} + + + + + diff --git a/site/views/Profiles/tmpl/view.xml b/site/views/Profiles/tmpl/view.xml new file mode 100644 index 000000000000..2d83baef10c8 --- /dev/null +++ b/site/views/Profiles/tmpl/view.xml @@ -0,0 +1,27 @@ + + + + + + + + CiviCRM + 07/26/2010 + (C) CiviCRM LLC + CiviCRM LLC + info@civicrm.org + civicrm.org + 3.2 + Profile View Layout + CiviCRM Profile View + + +
+ + + +
+
+
+
+
diff --git a/site/views/Profiles/view.html.php b/site/views/Profiles/view.html.php new file mode 100644 index 000000000000..1b5800eeda6e --- /dev/null +++ b/site/views/Profiles/view.html.php @@ -0,0 +1,42 @@ +