Commit b418c73a authored by Rich's avatar Rich
Browse files

civix updates

parent c13b1a45
......@@ -4,15 +4,18 @@
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
*
* Generated from /buildkit/build/dmaster/sites/default/files/civicrm/ext/actionlinks/xml/schema/CRM/Actionlinks/ActionLink.xml
* Generated from actionlinks/xml/schema/CRM/Actionlinks/ActionLink.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:fada413e7d6b6fa66b960e0cebcfd323)
* (GenCodeChecksum:04ce185ccc3f279f64f93f72aa066e5a)
*/
use CRM_Actionlinks_ExtensionUtil as E;
/**
* Database access object for the ActionLink entity.
*/
class CRM_Actionlinks_DAO_ActionLink extends CRM_Core_DAO {
const EXT = E::LONG_NAME;
const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
......@@ -146,6 +149,16 @@ class CRM_Actionlinks_DAO_ActionLink extends CRM_Core_DAO {
parent::__construct();
}
/**
* Returns localized title of this entity.
*
* @param bool $plural
* Whether to return the plural version of the title.
*/
public static function getEntityTitle($plural = FALSE) {
return $plural ? E::ts('Action Links') : E::ts('Action Link');
}
/**
* Returns all the column names of this table
*
......@@ -157,19 +170,21 @@ class CRM_Actionlinks_DAO_ActionLink extends CRM_Core_DAO {
'id' => [
'name' => 'id',
'type' => CRM_Utils_Type::T_INT,
'description' => CRM_Actionlinks_ExtensionUtil::ts('Unique ActionLink ID'),
'description' => E::ts('Unique ActionLink ID'),
'required' => TRUE,
'where' => 'civicrm_action_link.id',
'table_name' => 'civicrm_action_link',
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'readonly' => TRUE,
'add' => NULL,
],
'name' => [
'name' => 'name',
'type' => CRM_Utils_Type::T_STRING,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Name'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('Administrative name'),
'title' => E::ts('Name'),
'description' => E::ts('Administrative name'),
'maxlength' => 255,
'size' => CRM_Utils_Type::HUGE,
'where' => 'civicrm_action_link.name',
......@@ -177,35 +192,38 @@ class CRM_Actionlinks_DAO_ActionLink extends CRM_Core_DAO {
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'description' => [
'name' => 'description',
'type' => CRM_Utils_Type::T_TEXT,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Description'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('Description'),
'title' => E::ts('Description'),
'description' => E::ts('Description'),
'required' => FALSE,
'where' => 'civicrm_action_link.description',
'table_name' => 'civicrm_action_link',
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'is_active' => [
'name' => 'is_active',
'type' => CRM_Utils_Type::T_BOOLEAN,
'description' => CRM_Actionlinks_ExtensionUtil::ts('Whether this link is active.'),
'description' => E::ts('Whether this link is active.'),
'where' => 'civicrm_action_link.is_active',
'default' => '0',
'table_name' => 'civicrm_action_link',
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'allowed_url' => [
'name' => 'allowed_url',
'type' => CRM_Utils_Type::T_STRING,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Allowed Url'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('The URL you would normally redirect to'),
'title' => E::ts('Allowed Url'),
'description' => E::ts('The URL you would normally redirect to'),
'maxlength' => 255,
'size' => CRM_Utils_Type::HUGE,
'where' => 'civicrm_action_link.allowed_url',
......@@ -213,12 +231,13 @@ class CRM_Actionlinks_DAO_ActionLink extends CRM_Core_DAO {
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'denied_url' => [
'name' => 'denied_url',
'type' => CRM_Utils_Type::T_STRING,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Denied Url'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('The URL to redirect to if not allowed'),
'title' => E::ts('Denied Url'),
'description' => E::ts('The URL to redirect to if not allowed'),
'maxlength' => 255,
'size' => CRM_Utils_Type::HUGE,
'where' => 'civicrm_action_link.denied_url',
......@@ -226,24 +245,26 @@ class CRM_Actionlinks_DAO_ActionLink extends CRM_Core_DAO {
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'contact_required' => [
'name' => 'contact_required',
'type' => CRM_Utils_Type::T_BOOLEAN,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Contact Required'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('Must we be able to identify a valid contact'),
'title' => E::ts('Contact Required'),
'description' => E::ts('Must we be able to identify a valid contact'),
'where' => 'civicrm_action_link.contact_required',
'default' => '1',
'table_name' => 'civicrm_action_link',
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'form_processor_name' => [
'name' => 'form_processor_name',
'type' => CRM_Utils_Type::T_STRING,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Form Processor Name'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('The name of the form processor to trigger.'),
'title' => E::ts('Form Processor Name'),
'description' => E::ts('The name of the form processor to trigger.'),
'required' => FALSE,
'maxlength' => 255,
'size' => CRM_Utils_Type::HUGE,
......@@ -252,12 +273,13 @@ class CRM_Actionlinks_DAO_ActionLink extends CRM_Core_DAO {
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'form_processor_run' => [
'name' => 'form_processor_run',
'type' => CRM_Utils_Type::T_STRING,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Form Processor Run'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('every or once - how often to run the form prcessor per contact'),
'title' => E::ts('Form Processor Run'),
'description' => E::ts('every or once - how often to run the form prcessor per contact'),
'required' => TRUE,
'maxlength' => 5,
'size' => CRM_Utils_Type::SIX,
......@@ -267,81 +289,88 @@ class CRM_Actionlinks_DAO_ActionLink extends CRM_Core_DAO {
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'form_processor_params' => [
'name' => 'form_processor_params',
'type' => CRM_Utils_Type::T_TEXT,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Form Processor Params'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('JSON parameters (object of simple key:value pairs) for the form processor'),
'title' => E::ts('Form Processor Params'),
'description' => E::ts('JSON parameters (object of simple key:value pairs) for the form processor'),
'required' => FALSE,
'where' => 'civicrm_action_link.form_processor_params',
'table_name' => 'civicrm_action_link',
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'use_count' => [
'name' => 'use_count',
'type' => CRM_Utils_Type::T_INT,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Use Count'),
'title' => E::ts('Use Count'),
'where' => 'civicrm_action_link.use_count',
'default' => '0',
'table_name' => 'civicrm_action_link',
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'use_limit' => [
'name' => 'use_limit',
'type' => CRM_Utils_Type::T_INT,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Use Limit'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('Access denied after this many uses'),
'title' => E::ts('Use Limit'),
'description' => E::ts('Access denied after this many uses'),
'required' => FALSE,
'where' => 'civicrm_action_link.use_limit',
'table_name' => 'civicrm_action_link',
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'use_by' => [
'name' => 'use_by',
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Use By'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('Access denied after this'),
'title' => E::ts('Use By'),
'description' => E::ts('Access denied after this'),
'required' => FALSE,
'where' => 'civicrm_action_link.use_by',
'table_name' => 'civicrm_action_link',
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'use_per_contact' => [
'name' => 'use_per_contact',
'type' => CRM_Utils_Type::T_INT,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Use Per Contact'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('Number of times each contact is allowed to use this link'),
'title' => E::ts('Use Per Contact'),
'description' => E::ts('Number of times each contact is allowed to use this link'),
'where' => 'civicrm_action_link.use_per_contact',
'table_name' => 'civicrm_action_link',
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'use_by_contacts' => [
'name' => 'use_by_contacts',
'type' => CRM_Utils_Type::T_INT,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Use By Contacts'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('Number of contacts allowed to use this link'),
'title' => E::ts('Use By Contacts'),
'description' => E::ts('Number of contacts allowed to use this link'),
'where' => 'civicrm_action_link.use_by_contacts',
'table_name' => 'civicrm_action_link',
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
'hash' => [
'name' => 'hash',
'type' => CRM_Utils_Type::T_STRING,
'title' => CRM_Actionlinks_ExtensionUtil::ts('Hash'),
'description' => CRM_Actionlinks_ExtensionUtil::ts('Hash unique to this link'),
'title' => E::ts('Hash'),
'description' => E::ts('Hash unique to this link'),
'maxlength' => 10,
'size' => CRM_Utils_Type::TWELVE,
'where' => 'civicrm_action_link.hash',
......@@ -349,6 +378,7 @@ class CRM_Actionlinks_DAO_ActionLink extends CRM_Core_DAO {
'entity' => 'ActionLink',
'bao' => 'CRM_Actionlinks_DAO_ActionLink',
'localizable' => 0,
'add' => NULL,
],
];
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
......
......@@ -7,9 +7,9 @@
* extension.
*/
class CRM_Actionlinks_ExtensionUtil {
const SHORT_NAME = "actionlinks";
const LONG_NAME = "actionlinks";
const CLASS_PREFIX = "CRM_Actionlinks";
const SHORT_NAME = 'actionlinks';
const LONG_NAME = 'actionlinks';
const CLASS_PREFIX = 'CRM_Actionlinks';
/**
* Translate a string using the extension's domain.
......@@ -193,8 +193,9 @@ function _actionlinks_civix_civicrm_disable() {
* @param $op string, the type of operation being performed; 'check' or 'enqueue'
* @param $queue CRM_Queue_Queue, (for 'enqueue') the modifiable list of pending up upgrade tasks
*
* @return mixed based on op. for 'check', returns array(boolean) (TRUE if upgrades are pending)
* for 'enqueue', returns void
* @return mixed
* based on op. for 'check', returns array(boolean) (TRUE if upgrades are pending)
* for 'enqueue', returns void
*
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_upgrade
*/
......@@ -220,41 +221,18 @@ function _actionlinks_civix_upgrader() {
* Search directory tree for files which match a glob pattern.
*
* Note: Dot-directories (like "..", ".git", or ".svn") will be ignored.
* Note: In Civi 4.3+, delegate to CRM_Utils_File::findFiles()
* Note: Delegate to CRM_Utils_File::findFiles(), this function kept only
* for backward compatibility of extension code that uses it.
*
* @param string $dir base dir
* @param string $pattern , glob pattern, eg "*.txt"
*
* @return array(string)
* @return array
*/
function _actionlinks_civix_find_files($dir, $pattern) {
if (is_callable(['CRM_Utils_File', 'findFiles'])) {
return CRM_Utils_File::findFiles($dir, $pattern);
}
$todos = [$dir];
$result = [];
while (!empty($todos)) {
$subdir = array_shift($todos);
foreach (_actionlinks_civix_glob("$subdir/$pattern") as $match) {
if (!is_dir($match)) {
$result[] = $match;
}
}
if ($dh = opendir($subdir)) {
while (FALSE !== ($entry = readdir($dh))) {
$path = $subdir . DIRECTORY_SEPARATOR . $entry;
if ($entry{0} == '.') {
}
elseif (is_dir($path)) {
$todos[] = $path;
}
}
closedir($dh);
}
}
return $result;
return CRM_Utils_File::findFiles($dir, $pattern);
}
/**
* (Delegated) Implements hook_civicrm_managed().
*
......@@ -362,7 +340,7 @@ function _actionlinks_civix_civicrm_themes(&$themes) {
* @link http://php.net/glob
* @param string $pattern
*
* @return array, possibly empty
* @return array
*/
function _actionlinks_civix_glob($pattern) {
$result = glob($pattern);
......@@ -470,14 +448,12 @@ function _actionlinks_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NUL
*
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes
*/
function _actionlinks_civix_civicrm_entityTypes(&$entityTypes) {
$entityTypes = array_merge($entityTypes, array (
'CRM_Actionlinks_DAO_ActionLink' =>
array (
$entityTypes = array_merge($entityTypes, [
'CRM_Actionlinks_DAO_ActionLink' => [
'name' => 'ActionLink',
'class' => 'CRM_Actionlinks_DAO_ActionLink',
'table' => 'civicrm_action_link',
),
));
],
]);
}
......@@ -8,8 +8,7 @@
--
-- Generated from schema.tpl
-- DO NOT EDIT. Generated by CRM_Core_CodeGen
--
--
-- +--------------------------------------------------------------------+
-- | Copyright CiviCRM LLC. All rights reserved. |
......@@ -24,7 +23,7 @@
--
-- /*******************************************************
-- *
-- * Clean up the exisiting tables
-- * Clean up the existing tables
-- *
-- *******************************************************/
......@@ -73,6 +72,6 @@ CREATE TABLE `civicrm_action_link` (
)
) ;
) ENGINE=InnoDB ;
\ No newline at end of file
......@@ -11,7 +11,7 @@
--
-- /*******************************************************
-- *
-- * Clean up the exisiting tables
-- * Clean up the existing tables
-- *
-- *******************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment