mirror of https://github.com/itflow-org/itflow
Finished DB Structure for the coming new feature custom fields
This commit is contained in:
parent
ac51f0cb72
commit
0f758c5901
|
|
@ -2,7 +2,7 @@
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-user-plus mr-2"></i>New Client</h5>
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-user-plus mr-2"></i>Create client</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
|
|
@ -332,7 +332,7 @@
|
|||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="add_client" class="btn btn-primary text-bold" onclick="promptPrimaryContact()"><i class="fa fa-check mr-2"></i>Create</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Close</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
14
clients.php
14
clients.php
|
|
@ -33,7 +33,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-users mr-2"></i>Clients</h3>
|
||||
<div class="card-tools">
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addClientModal"><i class="fas fa-plus mr-2"></i>New Client</button>
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addClientModal"><i class="fas fa-plus mr-2"></i>Create</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -43,7 +43,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(htmlentities($q)); } ?>" placeholder="Search Clients" autofocus>
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(htmlentities($q)); } ?>" placeholder="Search" autofocus>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
|
|
@ -60,7 +60,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Canned Date</label>
|
||||
<label>Canned date</label>
|
||||
<select class="form-control select2" name="canned_date">
|
||||
<option <?php if ($_GET['canned_date'] == "custom") { echo "selected"; } ?> value="custom">Custom</option>
|
||||
<option <?php if ($_GET['canned_date'] == "today") { echo "selected"; } ?> value="today">Today</option>
|
||||
|
|
@ -76,13 +76,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date From</label>
|
||||
<label>Date from</label>
|
||||
<input type="date" class="form-control" name="dtf" max="2999-12-31" value="<?php echo htmlentities($dtf); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date To</label>
|
||||
<label>Date to</label>
|
||||
<input type="date" class="form-control" name="dtt" max="2999-12-31" value="<?php echo htmlentities($dtt); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -95,8 +95,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<thead class="<?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=location_city&o=<?php echo $disp; ?>">Primary Address </a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_name&o=<?php echo $disp; ?>">Primary Contact</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=location_city&o=<?php echo $disp; ?>">Primary address </a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_name&o=<?php echo $disp; ?>">Primary contact</a></th>
|
||||
<?php if ($session_user_role == 3 || $session_user_role == 1 && $config_module_enable_accounting == 1) { ?> <th class="text-right">Billing</th> <?php } ?>
|
||||
<?php if ($session_user_role == 3) { ?> <th class="text-center">Action</th> <?php } ?>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -979,11 +979,48 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
|
|||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.5.2'");
|
||||
}
|
||||
|
||||
//if (CURRENT_DATABASE_VERSION == '0.5.2') {
|
||||
if (CURRENT_DATABASE_VERSION == '0.5.2') {
|
||||
//Insert queries here required to update to DB version 0.5.3
|
||||
//Custom Fields and Values
|
||||
|
||||
mysqli_query($mysqli, "CREATE TABLE `custom_fields` (
|
||||
`custom_field_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`custom_field_table` varchar(255) NOT NULL,
|
||||
`custom_field_label` varchar(255) NOT NULL,
|
||||
`custom_field_type` varchar(255) NOT NULL DEFAULT 'TEXT',
|
||||
`custom_field_location` int(11) NOT NULL DEFAULT 0,
|
||||
`custom_field_order` int(11) NOT NULL DEFAULT 999,
|
||||
PRIMARY KEY (`custom_field_id`),
|
||||
UNIQUE KEY (`custom_field_table`),
|
||||
UNIQUE KEY (`custom_field_label`),
|
||||
UNIQUE KEY (`custom_field_type`)
|
||||
)");
|
||||
|
||||
mysqli_query($mysqli, "CREATE TABLE `custom_values` (
|
||||
`custom_value_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`custom_value_value` text NOT NULL,
|
||||
`custom_value_field` int(11) NOT NULL,
|
||||
PRIMARY KEY (`custom_value_id`)
|
||||
)");
|
||||
|
||||
mysqli_query($mysqli, "CREATE TABLE `asset_custom` (
|
||||
`asset_custom_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`asset_custom_field_value` int(11) NOT NULL,
|
||||
`asset_custom_field_id` int(11) NOT NULL,
|
||||
`asset_custom_asset_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`asset_custom_id`),
|
||||
UNIQUE KEY (`asset_custom_field_id`)
|
||||
)");
|
||||
|
||||
// Then, update the database to the next sequential version
|
||||
//mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.5.3'");
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.5.3'");
|
||||
}
|
||||
|
||||
//if (CURRENT_DATABASE_VERSION == '0.5.3') {
|
||||
//Insert queries here required to update to DB version 0.5.4
|
||||
|
||||
// Then, update the database to the next sequential version
|
||||
//mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.5.4'");
|
||||
//}
|
||||
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@
|
|||
* It is used in conjunction with database_updates.php
|
||||
*/
|
||||
|
||||
DEFINE("LATEST_DATABASE_VERSION", "0.5.2");
|
||||
DEFINE("LATEST_DATABASE_VERSION", "0.5.3");
|
||||
|
|
|
|||
55
db.sql
55
db.sql
|
|
@ -53,6 +53,23 @@ CREATE TABLE `api_keys` (
|
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `asset_custom`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `asset_custom`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `asset_custom` (
|
||||
`asset_custom_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`asset_custom_field_value` int(11) NOT NULL,
|
||||
`asset_custom_field_id` int(11) NOT NULL,
|
||||
`asset_custom_asset_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`asset_custom_id`),
|
||||
UNIQUE KEY `asset_custom_field_id` (`asset_custom_field_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `asset_documents`
|
||||
--
|
||||
|
|
@ -353,6 +370,42 @@ CREATE TABLE `contacts` (
|
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `custom_fields`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `custom_fields`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `custom_fields` (
|
||||
`custom_field_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`custom_field_table` varchar(255) NOT NULL,
|
||||
`custom_field_label` varchar(255) NOT NULL,
|
||||
`custom_field_type` varchar(255) NOT NULL DEFAULT 'TEXT',
|
||||
`custom_field_location` int(11) NOT NULL DEFAULT 0,
|
||||
`custom_field_order` int(11) NOT NULL DEFAULT 999,
|
||||
PRIMARY KEY (`custom_field_id`),
|
||||
UNIQUE KEY `custom_field_table` (`custom_field_table`),
|
||||
UNIQUE KEY `custom_field_label` (`custom_field_label`),
|
||||
UNIQUE KEY `custom_field_type` (`custom_field_type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `custom_values`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `custom_values`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `custom_values` (
|
||||
`custom_value_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`custom_value_value` text NOT NULL,
|
||||
`custom_value_field` int(11) NOT NULL,
|
||||
PRIMARY KEY (`custom_value_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `documents`
|
||||
--
|
||||
|
|
@ -1491,4 +1544,4 @@ CREATE TABLE `vendors` (
|
|||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2023-05-02 12:35:34
|
||||
-- Dump completed on 2023-05-07 19:45:11
|
||||
|
|
|
|||
Loading…
Reference in New Issue