function generateCreateSql($database, $tables, $fileName = 'civicrm.mysql') {
echo "Generating sql file\n";
- $this->smarty->clear_all_assign();
+ $this->reset_smarty_assignments();
$this->smarty->assign_by_ref('database', $database);
$this->smarty->assign_by_ref('tables', $tables);
$dropOrder = array_reverse(array_keys($tables));
function generateNavigation() {
echo "Generating navigation file\n";
- $this->smarty->clear_all_assign();
+ $this->reset_smarty_assignments();
file_put_contents($this->sqlCodePath . "civicrm_navigation.mysql", $this->smarty->fetch('civicrm_navigation.tpl'));
}
function generateLocalDataSql($db_version, $locales) {
- $this->smarty->clear_all_assign();
+ $this->reset_smarty_assignments();
global $tsLocale;
$oldTsLocale = $tsLocale;
}
function generateSample() {
- $this->smarty->clear_all_assign();
+ $this->reset_smarty_assignments();
$sample = $this->smarty->fetch('civicrm_sample.tpl');
$sample .= $this->smarty->fetch('civicrm_acl.tpl');
file_put_contents($this->sqlCodePath . 'civicrm_sample.mysql', $sample);
}
function generateDAOs($tables) {
- $this->smarty->clear_all_assign();
foreach (array_keys($tables) as $name) {
$this->smarty->clear_all_cache();
echo "Generating $name as " . $tables[$name]['fileName'] . "\n";
- $this->smarty->clear_all_assign();
+ $this->reset_smarty_assignments();
$this->smarty->assign_by_ref('table', $tables[$name]);
$php = $this->smarty->fetch('dao.tpl');
}
}
- $this->smarty->clear_all_cache();
- $this->smarty->clear_all_assign();
+ $this->reset_smarty_assignments();
$this->smarty->assign_by_ref('columns', $columns);
$this->smarty->assign_by_ref('indices', $indices);
function getTable($tableXML, &$database, &$tables) {
$name = trim((string ) $tableXML->name);
$klass = trim((string ) $tableXML->class);
- $base = $this->value('base', $tableXML) . '/DAO/';
- $pre = str_replace('/', '_', $base);
+ $base = $this->value('base', $tableXML);
+ $sourceFile = "xml/schema/{$base}/{$klass}.xml";
+ $daoPath = "{$base}/DAO/";
+ $pre = str_replace('/', '_', $daoPath);
$this->classNames[$name] = $pre . $klass;
$localizable = FALSE;
$table = array(
'name' => $name,
- 'base' => $base,
+ 'base' => $daoPath,
+ 'sourceFile' => $sourceFile,
'fileName' => $klass . '.php',
'objectName' => $klass,
'labelName' => substr($name, 8),
}
return 'CRM_Utils_Type::HUGE';
}
+
+ /**
+ * Clear the smarty cache and assign default values
+ */
+ function reset_smarty_assignments() {
+ $this->smarty->clear_all_assign();
+ $this->smarty->clear_all_cache();
+ $this->smarty->assign('generated', "DO NOT EDIT. Generated by " . basename(__FILE__));
+ }
}
<xi:include href="Mapping.xml" parse="xml" />
<xi:include href="MappingField.xml" parse="xml" />
<xi:include href="Menu.xml" parse="xml" />
- <xi:include href="MessageTemplate.xml" parse="xml" />
+ <xi:include href="MessageTemplates.xml" parse="xml" />
<xi:include href="Navigation.xml" parse="xml" />
<xi:include href="Note.xml" parse="xml" />
<xi:include href="OptionGroup.xml" parse="xml" />
<xi:include href="FinancialTrxn.xml" parse="xml" />
<xi:include href="PaymentProcessor.xml" parse="xml" />
<xi:include href="PaymentProcessorType.xml" parse="xml" />
-<xi:include href="Receipt.xml" parse="xml" />
+<xi:include href="OfficialReceipt.xml" parse="xml" />
<xi:include href="FinancialType.xml" parse="xml" />
<xi:include href="EntityFinancialAccount.xml" parse="xml" />
<xi:include href="FinancialItem.xml" parse="xml" />
<tables xmlns:xi="http://www.w3.org/2001/XInclude">
-<xi:include href="Nonces.xml" parse="xml" />
+<xi:include href="Nonce.xml" parse="xml" />
<xi:include href="Associations.xml" parse="xml" />
</tables>
-- | GNU Affero General Public License or the licensing of CiviCRM, |
-- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
-- +--------------------------------------------------------------------+
+--
+-- Generated from {$smarty.template}
+-- {$generated}
+--
-- sample acl entries
-- Create ACL to edit and view contacts in all groups
-- | GNU Affero General Public License or the licensing of CiviCRM, |
-- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
-- +--------------------------------------------------------------------+
+--
+-- Generated from {$smarty.template}
+-- {$generated}
+--
/*!40101 SET NAMES utf8 */;
/*******************************************************
-- | GNU Affero General Public License or the licensing of CiviCRM, |
-- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
-- +--------------------------------------------------------------------+
+--
+-- Generated from {$smarty.template}
+-- {$generated}
+--
-- currencies
INSERT INTO civicrm_currency (id, name, symbol, numeric_code, full_name) VALUES
( 1, "AUD", "$", "036", "Australian Dollar"),
-- | GNU Affero General Public License or the licensing of CiviCRM, |
-- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
-- +--------------------------------------------------------------------+
+--
+-- Generated from {$smarty.template}
+-- {$generated}
+--
-- This file provides template to civicrm_data.mysql. Inserts all base data needed for a new CiviCRM DB
SET @domainName := 'Default Domain Name';
-- | GNU Affero General Public License or the licensing of CiviCRM, |
-- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
-- +--------------------------------------------------------------------+
+--
+-- Generated from {$smarty.template}
+-- {$generated}
+--
{* not sure how to define the below in Smarty, so doing it in PHP instead *}
{php}
$ogNames = array(
-- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
-- +--------------------------------------------------------------------+
-- Navigation Menu, Preferences and Mail Settings
+--
+-- Generated from {$smarty.template}
+-- {$generated}
SELECT @domainID := id FROM civicrm_domain where name = 'Default Domain Name';
-- | GNU Affero General Public License or the licensing of CiviCRM, |
-- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
-- +--------------------------------------------------------------------+
+--
+-- Generated from {$smarty.template}
+-- {$generated}
+--
SELECT @domainID := id FROM civicrm_domain where name = 'Default Domain Name';
-- | GNU Affero General Public License or the licensing of CiviCRM, |
-- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
-- +--------------------------------------------------------------------+
+--
+-- Generated from {$smarty.template}
+-- {$generated}
+--
/*!40101 SET NAMES utf8 */;
INSERT INTO civicrm_state_province (id, country_id, abbreviation, name) VALUES
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2013
- * $Id$
*
+ * Generated from {$table.sourceFile}
+ * {$generated}
*/
require_once 'CRM/Core/DAO.php';
-- | GNU Affero General Public License or the licensing of CiviCRM, |
-- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
-- +--------------------------------------------------------------------+
+--
+-- Generated from {$smarty.template}
+-- {$generated}
+--
-- /*******************************************************
-- *
-- * Clean up the exisiting tables
<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Generated from {$smarty.template}
+ {$generated}
+-->
<extension method="upgrade" type="component" version="2.5">
<name>CiviCRM</name>
<creationDate>{$creationDate}</creationDate>
+--
+-- Generated from {$smarty.template}
+-- {$generated}
+--
-- CRM-6138
-- language list from http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
-- most common languages, according to http://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers enabled
-- | GNU Affero General Public License or the licensing of CiviCRM, |
-- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
-- +--------------------------------------------------------------------+
+--
+-- Generated from {$smarty.template}
+-- {$generated}
+--
{$database.comments}
{include file="drop.tpl"}
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2013
- * $Id$
*
+ * Generated from {$smarty.template}
+ * {$generated}
*/
class CRM_Core_I18n_SchemaStructure
{ldelim}