CONSTRAINT `mmta_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `marc_modification_templates` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+--
+-- Table structure for table `misc_files`
+--
+
+CREATE TABLE IF NOT EXISTS `misc_files` ( -- miscellaneous files attached to records from various tables
+ `file_id` int(11) NOT NULL AUTO_INCREMENT, -- unique id for the file record
+ `table_tag` varchar(255) NOT NULL, -- usually table name, or arbitrary unique tag
+ `record_id` int(11) NOT NULL, -- record id from the table this file is associated to
+ `file_name` varchar(255) NOT NULL, -- file name
+ `file_type` varchar(255) NOT NULL, -- MIME type of the file
+ `file_description` varchar(255) DEFAULT NULL, -- description given to the file
+ `file_content` longblob NOT NULL, -- file content
+ `date_uploaded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- date and time the file was added
+ PRIMARY KEY (`file_id`),
+ KEY `table_tag` (`table_tag`),
+ KEY `record_id` (`record_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
('AcqCreateItem','ordering','ordering|receiving|cataloguing','Define when the item is created : when ordering, when receiving, or in cataloguing module','Choice'),
+('AcqEnableFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to invoice records.','YesNo'),
('AcqItemSetSubfieldsWhenReceived','','','Upon receiving items, update their subfields if they were created when placing an order (e.g. o=5|a="foo bar")','Free'),
('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
SetVersion ($DBversion);
}
+$DBversion = "3.15.00.XXX";
+if (CheckVersion($DBversion)) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,type) VALUES('AcqEnableFiles','0','If enabled, allows librarians to upload and attach arbitrary files to invoice records.','YesNo')");
+ $dbh->do("
+CREATE TABLE IF NOT EXISTS `misc_files` (
+ `file_id` int(11) NOT NULL AUTO_INCREMENT,
+ `table_tag` varchar(255) NOT NULL,
+ `record_id` int(11) NOT NULL,
+ `file_name` varchar(255) NOT NULL,
+ `file_type` varchar(255) NOT NULL,
+ `file_description` varchar(255) DEFAULT NULL,
+ `file_content` longblob NOT NULL, -- file content
+ `date_uploaded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`file_id`),
+ KEY `table_tag` (`table_tag`),
+ KEY `record_id` (`record_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ ");
+ print "Upgrade to $DBversion done (Bug 3050 - Add an option to upload scanned invoices)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
- Upon receiving items, update their subfields if they were created when placing an order (e.g. o=5|a="foo bar").
- pref: AcqItemSetSubfieldsWhenReceived
-
+ - pref: AcqEnableFiles
+ choices:
+ yes: Do
+ no: "Don't"
+ - enable the ability to upload and attach arbitrary files to invoices.
+ -
- Set the mapping values for a new order line created from a MARC record in a staged file.
- pref: MarcFieldsToOrder
type: textarea