Skip to content
Snippets Groups Projects
Commit 07c1d79f authored by Jared Hancock's avatar Jared Hancock
Browse files

oops: Fix upgrade crash

Also,
* use current year when no company name exists (yet)
* log a `created` timestamp for new files
* drop table %group during the upgrade
parent 33f18c50
No related branches found
No related tags found
No related merge requests found
......@@ -386,6 +386,7 @@ class AttachmentFile extends VerySimpleModel {
'key' => $file['key'],
'ft' => $ft ?: 'T',
'signature' => $file['signature'],
'created' => SqlFunction::NOW(),
));
if (isset($file['size']))
......
......@@ -47,7 +47,7 @@ if (count($ext_bks)) { ?>
<div id="company">
<div class="content">
<?php echo __('Copyright'); ?> &copy; <?php echo Format::htmlchars($ost->company); ?>
<?php echo __('Copyright'); ?> &copy; <?php echo Format::htmlchars($ost->company) ?: date('Y'); ?>
</div>
</div>
</div>
......
......@@ -29,7 +29,7 @@ $info = ($_POST)?Format::htmlchars($_POST):array();
<div id="company">
<div class="content">
<?php echo __('Copyright'); ?> &copy; <?php echo Format::htmlchars($ost->company); ?>
<?php echo __('Copyright'); ?> &copy; <?php echo Format::htmlchars($ost->company) ?: date('Y'); ?>
</div>
</div>
</div>
......
......@@ -27,7 +27,7 @@ $info = ($_POST && $errors)?Format::htmlchars($_POST):array();
<div id="company">
<div class="content">
<?php echo __('Copyright'); ?> &copy; <?php echo Format::htmlchars($ost->company); ?>
<?php echo __('Copyright'); ?> &copy; <?php echo Format::htmlchars($ost->company) ?: date('Y'); ?>
</div>
</div>
</div>
......
......@@ -25,7 +25,7 @@ $info = ($_POST && $errors)?Format::htmlchars($_POST):array();
<div id="company">
<div class="content">
<?php echo __('Copyright'); ?> &copy; <?php echo Format::htmlchars($ost->company); ?>
<?php echo __('Copyright'); ?> &copy; <?php echo Format::htmlchars($ost->company) ?: date('Y'); ?>
</div>
</div>
</div>
......
......@@ -6,6 +6,7 @@
*/
DROP TABLE IF EXISTS `%TABLE_PREFIX%group_dept_access`;
DROP TABLE IF EXISTS `%TABLE_PREFIX%group`;
-- Drop `updated` if it exists (it stayed in the install script after it was
-- removed from the update path
......
......@@ -245,6 +245,7 @@ class AttachmentMigrater extends MigrationTask {
'hash' => $file['hash'],
'bk' => '6',
'attrs' => $file['path'],
'created' => date('Y-m-d H:i:s', Misc::dbtime(filemtime($file['path']))),
));
}
}
......
......@@ -26,6 +26,7 @@ ALTER TABLE `%TABLE_PREFIX%staff`
ADD `role_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `dept_id`;
ALTER TABLE `%TABLE_PREFIX%groups`
RENAME TO `%TABLE_PREFIX%group`,
CHANGE `group_id` `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
ADD `role_id` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `id`;
......
<?php
define('GROUP_TABLE', TABLE_PREFIX.'groups');
define('GROUP_TABLE', TABLE_PREFIX.'group');
define('GROUP_DEPT_TABLE', TABLE_PREFIX.'group_dept_access');
class Group extends VerySimpleModel {
static $meta = array(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment