diff options
author | Camil Staps | 2015-02-06 10:48:36 +0100 |
---|---|---|
committer | Camil Staps | 2015-02-06 10:48:36 +0100 |
commit | 4ed0049b1c1bead979de48dbc117740f5b47d4b9 (patch) | |
tree | ce83aaad31fe83b02157a86a8eb603bf9c4b3350 | |
parent | Updated readme (diff) |
0.1 Assign float values to nr. of working hours of assignments
-rw-r--r-- | README.md | 14 | ||||
-rw-r--r-- | classes/constants.class.php | 3 | ||||
-rw-r--r-- | include/about.php | 2 | ||||
-rw-r--r-- | install/index.php | 2 | ||||
-rw-r--r-- | install/upgrade.php | 53 |
5 files changed, 72 insertions, 2 deletions
@@ -65,6 +65,14 @@ The files folder will be used to put generated invoices in. Make your server use If you add a file logo-correspondence.png in the files folder, this image will be used as your logo in generated invoices. +# Upgrading + +1. Always make a backup of your current files! +1. First note down your current version number from the About page in BusinessAdmin. +1. Update the directory. +1. Make sure you restore your personal settings in /conf.php and /classes/constants.php, if these files were updated. +1. Go to /install/upgrade.php and fill in your old version number. This will alter database tables, if necessary. + # Usage ## Abstract @@ -118,3 +126,9 @@ When you delete an invoice file, it's not actually deleted. Instead, it's placed * Different languages for different contacts * Add a calendar plugin to the date fields * Appendices feature: upload custom documents and link them to assignments (for functional designs, specifications, etc.) + +# Changelog + +## 0.1 (Feb 6, 2015) + +It's now possible to assign float values to the amount of hours you work on an assignment (as opposed to integer values).
\ No newline at end of file diff --git a/classes/constants.class.php b/classes/constants.class.php index 7afcf50..4bb8dbf 100644 --- a/classes/constants.class.php +++ b/classes/constants.class.php @@ -65,4 +65,7 @@ class constants { const invoice_tel_nr = '+31 6 1234 5678'; const invoice_email = 'my-email@domain.tld'; const invoice_valuta = '$'; // chr(128) for euro + + /** @const version Version of BusinessAdmin. Don't change this yourself! */ + const version = '0.1'; }
\ No newline at end of file diff --git a/include/about.php b/include/about.php index b94bfce..bc93e14 100644 --- a/include/about.php +++ b/include/about.php @@ -39,7 +39,7 @@ require('./header.php'); <div class="panel panel-default"> <div class="panel-heading">About</div> <div class="panel-body"> - <p class="lead">BusinessAdmin is open source software under the GPL 3.0 license.</p> + <p class="lead">BusinessAdmin <?=constants::version?> is open source software under the GPL 3.0 license.</p> <p>A full version of the license is available <a href="<?=constants::url_external?>LICENSE">here</a>. An excerpt is shown below:</p> <pre>BusinessAdmin: administrative software for small companies Copyright (C) 2015 Camil Staps (ViviSoft) diff --git a/install/index.php b/install/index.php index 3921161..5d6b7fa 100644 --- a/install/index.php +++ b/install/index.php @@ -26,7 +26,7 @@ if (isset($_GET['create_tables'])) { `offerId` smallint(5) unsigned NOT NULL, `title` tinytext NOT NULL, `description` text NOT NULL, - `hours` smallint(5) unsigned NOT NULL, + `hours` float NOT NULL, `price_per_hour` float NOT NULL, `VAT_percentage` float NOT NULL, PRIMARY KEY (`id`), diff --git a/install/upgrade.php b/install/upgrade.php new file mode 100644 index 0000000..dd2f6b9 --- /dev/null +++ b/install/upgrade.php @@ -0,0 +1,53 @@ +<?php +/** + * BusinessAdmin: administrative software for small companies + * Copyright (C) 2015 Camil Staps (ViviSoft) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +require('../conf.php'); + +function lower_version($that, $this) { + $that = explode('.', $that); + $this = explode('.', $this); + while (count($that) < count($this)) $that[] = 0; + while (count($this) < count($that)) $this[] = 0; + + for ($i = 0; $i < count($this); $i++) { + if ($this[$i] > $that[$i]) { + return true; + } + } + return false; +} + +if (isset($_GET['upgrade']) && lower_version($_GET['upgrade'], '0.1')) { + try { + $_pdo->query("ALTER TABLE `assignment` CHANGE `hours` `hours` FLOAT UNSIGNED NOT NULL"); + } catch (PDOException $e) { + echo "Altering the database structure failed with a PDOException ({$e->getCode()}): {$e->getMessage()}<br/>" . $e->getTraceAsString(); + } +} + +if (isset($_GET['upgrade'])) { + echo "<br/>All done."; +} +?> + +<p>You're going to upgrade to version <?=constants::version?>. What was your old version number?</p> +<form method="GET"> + <input type="text" name="upgrade" placeholder="Old version"/> + <input type="submit" value="Upgrade"/> +</form>
\ No newline at end of file |