Skip to content

Instantly share code, notes, and snippets.

@BrandonDyer64
Created April 6, 2018 07:12
Show Gist options
  • Save BrandonDyer64/820c67405acb32ae4959ce4b3436bc44 to your computer and use it in GitHub Desktop.
Save BrandonDyer64/820c67405acb32ae4959ce4b3436bc44 to your computer and use it in GitHub Desktop.
<?php
include("../../bin/do_not_change/standard_validation_regex.php");
unset($field);
unset($index);
$table = "${master}_status_update";
$table_type = "master_id_with_auto";
$is_slave_table_to[] = "${master}";
$dont_show_in_vert_table[] = "${master}";
//$on_add_offer_to_send_email_to[] = "employee";
// these two need to go together
$master = "${master}";
$update_master_current_status_upon_add = TRUE;
$thing_display = preg_replace("/_/", " ", $table);
$Thing_display = ucfirst($thing_display);
$things_display = "${thing_display}s";
$Things_display = ucfirst($things_display);
$indefinite_article = "a";
$default_sort_by = "date_added";
$default_sort_dir = "ASC";
$dont_list_unless_filter = TRUE;
$display_name_as = "${master}_id - ${master}_status_id";
$field[] = array("name"=>"${master}_id",
"type"=>"INT UNSIGNED",
"not_null" => TRUE,
"dont_make_select_list" => TRUE,
"display_in_table_list_column" => TRUE,
"display_field_in_vertical_table" => TRUE,
"field_is_required_in_form" => TRUE,
"filterable" => TRUE,
"filter_operator" => "=",
"human_display" => "Test Case"
);
$field[] = array("name"=>"id",
"type"=>"INT UNSIGNED",
"not_null" => TRUE,
"auto_increment" => TRUE,
"display_in_table_list_column" => TRUE,
"display_field_in_vertical_table" => TRUE,
"field_is_required_in_form" => FALSE,
"filterable" => TRUE,
"filter_operator" => "=",
"human_display" => "ID"
);
$field[] = array("name"=>"${master}_status_id",
"type"=>"INT UNSIGNED",
"not_null" => TRUE,
"display_in_table_list_column" => TRUE,
"display_field_in_vertical_table" => TRUE,
"field_is_required_in_form" => TRUE,
"filterable" => TRUE,
"filter_operator" => "=",
"human_display" => "Status"
);
$field[] = array("name"=>"author_id",
"type"=>"INT UNSIGNED",
"select_id_from" => "siteuser",
"display_in_table_list_column" => TRUE,
"display_field_in_vertical_table" => TRUE,
"field_is_required_in_form" => TRUE,
"filterable" => TRUE,
"filter_operator" => "=",
"human_display" => "Updated By"
);
$field[] = array("name"=>"comments",
"type"=>"TEXT",
"display_in_table_list_column" => TRUE,
"display_field_in_vertical_table" => TRUE,
"field_is_required_in_form" => FALSE,
"filterable" => TRUE,
"filter_operator" => "LIKE",
"human_display" => "Comments"
);
include("../../bin/do_not_change/standard_config_files/STANDARD_TABLE_FIELDS");
$index[] = array("type"=>"PRIMARY KEY",
"name"=>array("${master}_id", "id")
);
$index[] = array("type"=>"INDEX",
"name"=>array("${master}_status_id", "${master}_id")
);
$startup_sql[] = "INSERT IGNORE INTO thing (id, name, active, date_added) VALUES ('$table','$Thing_display','y',NOW())";
// give admin group read/write permissions
$startup_sql[] = "INSERT IGNORE INTO jusergroup_thing (usergroup_id, thing_id, read_access, write_access, active, date_added) VALUES ('2','$table','all','all','y',NOW())";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment