Skip to content
Snippets Groups Projects
Commit 397e184d authored by Peter Rotich's avatar Peter Rotich
Browse files

installer: bug fixes

parent a6b1b1f5
No related branches found
No related tags found
No related merge requests found
......@@ -50,12 +50,10 @@ class Canned {
if(!$id && !($id=$this->getId()))
return false;
$sql='SELECT canned.*, count(attach.file_id) as attachments, '
.' count(filter.id) as filters '
$sql='SELECT canned.*, count(attach.file_id) as attachments '
.' FROM '.CANNED_TABLE.' canned '
.' LEFT JOIN '.ATTACHMENT_TABLE.' attach
ON (attach.object_id=canned.canned_id AND attach.`type`=\'C\' AND NOT attach.inline) '
.' LEFT JOIN '.FILTER_TABLE.' filter ON (canned.canned_id = filter.canned_response_id) '
.' WHERE canned.canned_id='.db_input($id)
.' GROUP BY canned.canned_id';
......@@ -87,6 +85,7 @@ class Canned {
}
function getNumFilters() {
//XXX : Query the filter action table and cache the results
return $this->ht['filters'];
}
......
......@@ -135,6 +135,7 @@ class Topic extends VerySimpleModel {
function getForms() {
if (!isset($this->_forms)) {
$this->_forms = array();
foreach ($this->forms->select_related('form') as $F) {
$extra = JsonDataParser::decode($F->extra) ?: array();
$F->form->disableFields($extra['disable'] ?: array());
......
a22c2b4ff54ce5aa61e94124a73e6eac
2d590ffab4a6a928f08cc97aace1399e
/**
* @signature 0e47d678f50874fa0d33e1e3759f657e
* @signature 2d590ffab4a6a928f08cc97aace1399e
* @version v1.9.6
* @title Make fields disable-able per help topic
*/
......
/**
* @signature a22c2b4ff54ce5aa61e94124a73e6eac
* @signature 2d590ffab4a6a928f08cc97aace1399e
* @version v1.9.6
* @title Make fields disable-able per help topic
*
......@@ -104,7 +104,8 @@ CREATE TABLE `%TABLE_PREFIX%help_topic_form` (
`form_id` int(10) unsigned NOT NULL default 0,
`sort` int(10) unsigned NOT NULL default 1,
`extra` text,
PRIMARY KEY (`topic_id`, `form_id`)
PRIMARY KEY (`id`),
KEY `topic-form` (`topic_id`, `form_id`)
) DEFAULT CHARSET=utf8;
-- Handle A4 / A3 / A2 / A1 help topics. For these, consider the forms
......@@ -134,5 +135,5 @@ ALTER TABLE `%TABLE_PREFIX%help_topic`
-- Finished with patch
UPDATE `%TABLE_PREFIX%config`
SET `value` = 'a22c2b4ff54ce5aa61e94124a73e6eac'
SET `value` = '2d590ffab4a6a928f08cc97aace1399e'
WHERE `key` = 'schema_signature' AND `namespace` = 'core';
......@@ -303,6 +303,7 @@ CREATE TABLE `%TABLE_PREFIX%filter` (
`match_all_rules` tinyint(1) unsigned NOT NULL default '0',
`stop_onmatch` tinyint(1) unsigned NOT NULL default '0',
`target` ENUM( 'Any', 'Web', 'Email', 'API' ) NOT NULL DEFAULT 'Any',
`email_id` int(10) unsigned NOT NULL default '0',
`name` varchar(32) NOT NULL default '',
`notes` text,
`created` datetime NOT NULL,
......@@ -468,7 +469,8 @@ CREATE TABLE `%TABLE_PREFIX%help_topic_form` (
`form_id` int(10) unsigned NOT NULL default 0,
`sort` int(10) unsigned NOT NULL default 1,
`extra` text,
PRIMARY KEY (`topic_id`, `form_id`)
PRIMARY KEY (`id`),
KEY `topic-form` (`topic_id`, `form_id`)
) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%organization`;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment