diff --git a/app/schemas/app_languages.php b/app/schemas/app_languages.php new file mode 100644 index 0000000000..f361934971 --- /dev/null +++ b/app/schemas/app_languages.php @@ -0,0 +1,119 @@ + \ No newline at end of file diff --git a/app/schemas/schema_data_delete.php b/app/schemas/schema_data_delete.php index aceccba562..4dd856c6e8 100644 --- a/app/schemas/schema_data_delete.php +++ b/app/schemas/schema_data_delete.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + if (count($_GET)>0) { //declare variable(s) @@ -94,7 +100,7 @@ if (count($_GET)>0) { //show a message to the user before the redirect echo "
\n"; - echo "Delete Complete\n"; + echo $text['message-delete']."\n"; echo "
\n"; require_once "includes/footer.php"; return; diff --git a/app/schemas/schema_data_edit.php b/app/schemas/schema_data_edit.php index 8b9cd37fa9..57feb5507f 100644 --- a/app/schemas/schema_data_edit.php +++ b/app/schemas/schema_data_edit.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //set http get variables to php variables $search_all = check_str($_GET["search_all"]); $schema_uuid = check_str($_GET["schema_uuid"]); @@ -357,8 +363,8 @@ else { //show a message to the user before the redirect echo "
\n"; - if ($action == "add") { echo "Add Complete\n"; } - if ($action == "update") { echo "Update Complete\n"; } + if ($action == "add") { echo $text['message-add']."\n"; } + if ($action == "update") { echo $text['message-update']."\n"; } echo "
\n"; require_once "includes/footer.php"; return; @@ -366,6 +372,7 @@ else { //show the header require_once "includes/header.php"; + $page["title"] = $text['title-data']; //pre-populate the form if ($action == "update") { @@ -431,7 +438,7 @@ else { } //detect a new row id if ($previous_row_id != $row['data_row_uuid']) { - if ($row_id_found) { + if ($row_id_found) { if (!$next_row_id_found) { //make sure it is not the current row id if ($data_row_uuid != $row['data_row_uuid']) { @@ -458,7 +465,7 @@ else { $total_records = $x; //set record number - if (strlen($_GET["n"]) == 0) { + if (strlen($_GET["n"]) == 0) { $n = 1; } else { @@ -472,25 +479,24 @@ else { //echo "\n"; //echo ""; -//begin creating the content +//begin creating the content echo "
"; //get the title and description of the schema echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "\n"; } else { echo " \n"; } echo " \n"; @@ -711,16 +715,16 @@ else { echo "\n"; switch ($row['field_name']) { case "true": - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; break; case "false": - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; break; default: - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; } echo "\n"; @@ -893,7 +897,7 @@ else { echo "".$data_row[$row['field_name']].""; echo ""; echo ""; echo ""; echo "
\n"; - echo " $schema_label \n"; + echo " $schema_label "; if ($action == "add") { - echo " Add\n"; + echo $text['button-add']."\n"; } else { - echo "Edit\n"; + echo $text['button-edit']."\n"; } echo " \n"; echo "      \n"; if ($action == "update" && permission_exists('schema_data_edit')) { - echo " \n"; - //echo " \n"; + echo " \n"; } echo "
\n"; echo " $schema_description\n"; @@ -502,21 +508,19 @@ else { echo "
\n"; if ($action == "update" && permission_exists('schema_data_edit')) { - //echo " \n"; if (strlen($previous_data_row_uuid) == 0) { - echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } - echo " \n"; + echo " \n"; if (strlen($next_data_row_uuid) == 0) { - echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } - //echo " \n"; } echo "    "; echo "    "; @@ -530,18 +534,18 @@ else { //echo " \n"; //echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo "\n"; - echo " \n"; + echo " \n"; echo "\n"; - //echo " \n"; - //echo " \n"; - echo " \n"; + //echo " \n"; + //echo " \n"; + echo " \n"; echo "
TrueFalse".$text['option-true']."".$text['option-false']."TrueFalse".$text['option-true']."".$text['option-false']."TrueFalse".$text['option-true']."".$text['option-false']."
"; - echo "\n"; + echo "\n"; echo "
"; @@ -934,11 +938,11 @@ else { echo " \n"; echo " \n"; if ($action == "add" && permission_exists('schema_data_add')) { - echo " \n"; + echo " \n"; } if ($action == "update" && permission_exists('schema_data_edit')) { echo " \n"; - echo " \n"; + echo " \n"; } echo " \n"; echo " \n"; diff --git a/app/schemas/schema_data_view.php b/app/schemas/schema_data_view.php index c6b9632bad..c83498ac37 100644 --- a/app/schemas/schema_data_view.php +++ b/app/schemas/schema_data_view.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + if (strlen($_GET["id"]) > 0) { $schema_uuid = check_str($_GET["id"]); if (strlen($_GET["data_parent_row_uuid"])>0) { @@ -44,15 +50,16 @@ if (strlen($_GET["id"]) > 0) { //used for changing the order $order_by = $_GET["order_by"]; - $order = $_GET["order"]; + $order = $_GET["order"]; -//used to alternate colors when paging +//used to alternate colors when paging $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; //show the header require_once "includes/header.php"; + $page["title"] = $text['title-data_view']; //get the information about the schema by using the id $sql = "select * from v_schemas "; @@ -255,7 +262,7 @@ if (strlen($_GET["id"]) > 0) { echo " \n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo "\n"; } echo " \n"; @@ -275,7 +282,7 @@ if (strlen($_GET["id"]) > 0) { else { $param = "&id=$schema_uuid&data_row_uuid=$data_row_uuid"; } - list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); + list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); $offset = $rows_per_page * $page; //list the data in the database @@ -297,7 +304,7 @@ if (strlen($_GET["id"]) > 0) { } echo "\n"; if (permission_exists('schema_data_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } echo "\n"; echo "\n"; @@ -351,14 +358,14 @@ if (strlen($_GET["id"]) > 0) { echo "\n"; if (permission_exists('schema_data_edit')) { if (strlen($data_parent_row_uuid) == 0) { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } else { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } } if (permission_exists('schema_delete')) { - echo" $v_link_label_delete\n"; + echo" $v_link_label_delete\n"; } echo "\n"; @@ -375,7 +382,7 @@ if (strlen($_GET["id"]) > 0) { echo " $paging_controls\n"; echo " \n"; if (permission_exists('schema_data_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } echo " \n"; echo " \n"; diff --git a/app/schemas/schema_delete.php b/app/schemas/schema_delete.php index 9c84db8029..1e14b852b5 100644 --- a/app/schemas/schema_delete.php +++ b/app/schemas/schema_delete.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //get the http get variable if (count($_GET)>0) { $id = check_str($_GET["id"]); @@ -54,7 +60,7 @@ if (strlen($id) > 0) { //redirect the user echo "\n"; echo "
\n"; - echo "Delete Complete\n"; + echo $text['message-delete']."\n"; echo "
\n"; //show the footer diff --git a/app/schemas/schema_edit.php b/app/schemas/schema_edit.php index 32207658cc..dcfd51f9ab 100644 --- a/app/schemas/schema_edit.php +++ b/app/schemas/schema_edit.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //action add or update if (isset($_REQUEST["id"])) { $action = "update"; @@ -64,14 +70,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } //check for all required data - if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid
\n"; } - //if (strlen($schema_category) == 0) { $msg .= "Please provide: Schema Category
\n"; } - //if (strlen($schema_label) == 0) { $msg .= "Please provide: Label
\n"; } - if (strlen($schema_name) == 0) { $msg .= "Please provide: Schema Name
\n"; } - //if (strlen($schema_auth) == 0) { $msg .= "Please provide: Authentication
\n"; } - //if (strlen($schema_captcha) == 0) { $msg .= "Please provide: Captcha
\n"; } - //if (strlen($schema_parent_uuid) == 0) { $msg .= "Please provide: Parent Schema
\n"; } - //if (strlen($schema_description) == 0) { $msg .= "Please provide: Description
\n"; } + if (strlen($schema_name) == 0) { $msg .= $text['message-required'].$text['label-schema_name']."
\n"; } if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; require_once "includes/persistformvar.php"; @@ -124,7 +123,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Add Complete\n"; + echo $text['message-add']."\n"; echo "
\n"; require_once "includes/footer.php"; return; @@ -152,7 +151,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Update Complete\n"; + echo $text['message-update']."\n"; echo "
\n"; require_once "includes/footer.php"; return; @@ -184,6 +183,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //show the header require_once "includes/header.php"; + $page["title"] = $text['title-schema']; //show the content echo "
"; @@ -196,78 +196,78 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -278,13 +278,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " \n"; @@ -340,7 +341,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; } echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo "
Schema".$text['header-schema']."\n"; if (strlen($schema_uuid) > 0) { - echo "   \n"; - echo "   \n"; + echo "   \n"; + echo "   \n"; } include "export/index.php"; - echo " \n"; + echo " \n"; echo "
\n"; - echo "Provides the ability to quickly define information to store and dynamically makes tools available to view, add, edit, delete, and search.

\n"; + echo $text['description-schema']."

\n"; echo "
\n"; - echo " Category:\n"; + echo " ".$text['label-category'].":\n"; echo "\n"; $select_name = 'v_schemas';$field_name = 'schema_category';$sql_where_optional = "";$field_current_value = $schema_category; echo html_select_other($db, $select_name, $field_name, $sql_where_optional, $field_current_value); - echo "Select the category.\n"; + echo $text['description-category']."\n"; echo "
\n"; - echo " Label:\n"; + echo " ".$text['label-label'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the label.\n"; + echo $text['description-label']."\n"; echo "
\n"; - echo " Name:\n"; + echo " ".$text['label-name'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the schema name.\n"; + echo $text['description-name']."\n"; echo "
\n"; - echo " Authentication:\n"; + echo " ".$text['label-authentication'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Choose whether to require authentication.\n"; + echo $text['description-authentication']."\n"; echo "
\n"; //echo "
\n"; - echo " Parent Schema:\n"; + echo " ".$text['label-parent_schema'].":\n"; echo "\n"; @@ -306,6 +306,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; $sql = "select * from v_schemas "; $sql .= "where domain_uuid = '$domain_uuid' "; + $sql .= "and schema_name not like '".$schema_name."'"; $prep_statement = $db->prepare($sql); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); @@ -320,18 +321,18 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo "
\n"; - echo "Select a parent schema.\n"; + echo $text['description-parent_schema']."\n"; echo "
\n"; - echo " Description:\n"; + echo " ".$text['label-description'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter a description.\n"; + echo $text['description-description']."\n"; echo "
"; diff --git a/app/schemas/schema_field_delete.php b/app/schemas/schema_field_delete.php index 7024348ad6..a1b8dcd8f8 100644 --- a/app/schemas/schema_field_delete.php +++ b/app/schemas/schema_field_delete.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //get the http values if (count($_GET) > 0) { $id = check_str($_GET["id"]); @@ -54,7 +60,7 @@ else { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Delete Complete\n"; + echo $text['message-delete']."\n"; echo "
\n"; require_once "includes/footer.php"; return; diff --git a/app/schemas/schema_field_edit.php b/app/schemas/schema_field_edit.php index 09492083c5..4eb2c9531f 100644 --- a/app/schemas/schema_field_edit.php +++ b/app/schemas/schema_field_edit.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //set the action as an add or update if (isset($_REQUEST["id"])) { $action = "update"; @@ -71,18 +77,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } //check for all required data - if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid
\n"; } - //if (strlen($field_label) == 0) { $msg .= "Please provide: Label
\n"; } - if (strlen($field_name) == 0 && $field_type != "label") { $msg .= "Please provide: Name
\n"; } - if (strlen($field_type) == 0) { $msg .= "Please provide: Type
\n"; } - //if (strlen($field_value) == 0) { $msg .= "Please provide: Value
\n"; } - if (strlen($field_list_hidden) == 0) { $msg .= "Please provide: List Visibility
\n"; } - //if (strlen($field_search_by) == 0) { $msg .= "Please provide: Search By
\n"; } - if (strlen($field_column) == 0) { $msg .= "Please provide: Column
\n"; } - if (strlen($field_required) == 0) { $msg .= "Please provide: Required
\n"; } - if (strlen($field_order) == 0) { $msg .= "Please provide: Field Order
\n"; } - if (strlen($field_order_tab) == 0) { $msg .= "Please provide: Tab Order
\n"; } - //if (strlen($field_description) == 0) { $msg .= "Please provide: Description
\n"; } + if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid
\n"; } + if (strlen($field_name) == 0 && $field_type != "label") { $msg .= $text['message-required'].$text['label-field_name']."
\n"; } + if (strlen($field_type) == 0) { $msg .= $text['message-required'].$text['label-field_type']."
\n"; } + if (strlen($field_list_hidden) == 0) { $msg .= $text['message-required'].$text['label-field_visibility']."
\n"; } + if (strlen($field_column) == 0) { $msg .= $text['message-required'].$text['label-field_column']."
\n"; } + if (strlen($field_required) == 0) { $msg .= $text['message-required'].$text['label-field_required']."
\n"; } + if (strlen($field_order) == 0) { $msg .= $text['message-required'].$text['label-field_order']."
\n"; } + if (strlen($field_order_tab) == 0) { $msg .= $text['message-required'].$text['label-field_tab_order']."
\n"; } if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; require_once "includes/persistformvar.php"; @@ -140,7 +142,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Add Complete\n"; + echo $text['message-add']."\n"; echo "
\n"; require_once "includes/footer.php"; return; @@ -168,7 +170,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Update Complete\n"; + echo $text['message-update']."\n"; echo "
\n"; require_once "includes/footer.php"; return; @@ -207,6 +209,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //show the header require_once "includes/header.php"; + $page["title"] = $text['title-field']; //begin the content echo "
"; @@ -219,333 +222,285 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " \n"; @@ -554,7 +509,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo "
Field".$text['header-field']."
\n"; - echo "Lists the fields in the database.

\n"; + echo $text['description-field']."

\n"; echo "
\n"; - echo " Label:\n"; + echo " ".$text['label-field_label'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the field label.\n"; + echo $text['description-field_label']."\n"; echo "
\n"; - echo " Name:\n"; + echo " ".$text['label-field_name'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter field name.\n"; + echo $text['description-field_name']."\n"; echo "
\n"; - echo " Type:\n"; + echo " ".$text['label-field_type'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Select the field type.\n"; + echo $text['description-field_type']."\n"; echo "
\n"; - echo " Value:\n"; + echo " ".$text['label-field_value'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the default value.\n"; + echo $text['description-field_value']."\n"; echo "
\n"; - echo " List Visibility:\n"; + echo " ".$text['label-field_visibility'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Choose whether the field is hidden from the list.\n"; + echo $text['description-field_visibility']."\n"; echo "
\n"; - echo " Search By:\n"; + echo " ".$text['label-field_search_by'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Choose whether the field will be used for searches.\n"; + echo $text['description-field_search_by']."\n"; echo "
\n"; - echo " Column:\n"; + echo " ".$text['label-field_column'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Determines which column to show the field in.\n"; + echo $text['description-field_column']."\n"; echo "
\n"; - echo " Required:\n"; + echo " ".$text['label-field_required'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Choose whether the field is required.\n"; + echo $text['description-field_required']."\n"; echo "
\n"; - echo " Field Order:\n"; + echo " ".$text['label-field_order'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the order of the field.\n"; + echo $text['description-field_order']."\n"; echo "
\n"; - echo " Tab Order:\n"; + echo " ".$text['label-field_tab_order'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the tab order.\n"; + echo $text['description-field_tab_order']."\n"; echo "
\n"; - echo " Description:\n"; + echo " ".$text['label-field_description'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the description.\n"; + echo $text['description-field_description']."\n"; echo "
"; diff --git a/app/schemas/schema_fields.php b/app/schemas/schema_fields.php index 1c993bd196..48c3c22d2c 100644 --- a/app/schemas/schema_fields.php +++ b/app/schemas/schema_fields.php @@ -33,6 +33,7 @@ else { echo "access denied"; exit; } + require_once "includes/header.php"; require_once "includes/paging.php"; @@ -48,12 +49,12 @@ $order = $_GET["order"]; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Fields".$text['header-fields']." 
\n"; - echo "Lists the fields in the database.

\n"; + echo $text['description-fields']."

\n"; echo "
\n"; @@ -80,19 +81,19 @@ $order = $_GET["order"]; echo "
\n"; echo "\n"; echo "\n"; - echo th_order_by('field_label', 'Label', $order_by, $order); - echo th_order_by('field_name', 'Name', $order_by, $order); - echo th_order_by('field_type', 'Type', $order_by, $order); - echo th_order_by('field_column', 'Column', $order_by, $order); - echo th_order_by('field_required', 'Required', $order_by, $order); - echo th_order_by('field_list_hidden', 'Visible', $order_by, $order); - echo th_order_by('field_search_by', 'Search By', $order_by, $order); - echo th_order_by('field_order', 'Field Order', $order_by, $order); - echo th_order_by('field_order_tab', 'Tab Order', $order_by, $order); - echo th_order_by('field_description', 'Description', $order_by, $order); + echo th_order_by('field_label', $text['label-field_label'], $order_by, $order); + echo th_order_by('field_name', $text['label-field_name'], $order_by, $order); + echo th_order_by('field_type', $text['label-field_type'], $order_by, $order); + echo th_order_by('field_column', $text['label-field_column'], $order_by, $order); + echo th_order_by('field_required', $text['label-field_required'], $order_by, $order); + echo th_order_by('field_list_hidden', $text['label-field_visibility'], $order_by, $order); + echo th_order_by('field_search_by', $text['label-field_search_by'], $order_by, $order); + echo th_order_by('field_order', $text['label-field_order'], $order_by, $order); + echo th_order_by('field_order_tab', $text['label-field_tab_order'], $order_by, $order); + echo th_order_by('field_description', $text['label-field_description'], $order_by, $order); echo "\n"; echo "\n"; @@ -102,20 +103,63 @@ $order = $_GET["order"]; echo "\n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; @@ -132,7 +176,7 @@ $order = $_GET["order"]; echo " \n"; echo " \n"; echo " \n"; diff --git a/app/schemas/schema_import.php b/app/schemas/schema_import.php index a63ed46606..7797cee8e8 100644 --- a/app/schemas/schema_import.php +++ b/app/schemas/schema_import.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + if (count($_POST)>0) { $schema_uuid = trim($_REQUEST["id"]); $data = trim($_POST["data"]); @@ -111,7 +117,7 @@ if (count($_POST)>0) { $sql .= "'$this->field_order_tab', "; $sql .= "'$this->field_description' "; $sql .= ")"; - if (!$this->db_field_exists()) { + if (!$this->db_field_exists()) { $db->exec(check_sql($sql)); } unset($sql); @@ -186,7 +192,7 @@ if (count($_POST)>0) { } } -//built in str_getcsv requires PHP 5.3 or higher, this function can be used to reproduct the functionality but requirs PHP 5.1.0 or higher +//built in str_getcsv requires PHP 5.3 or higher, this function can be used to reproduct the functionality but requirs PHP 5.1.0 or higher if(!function_exists('str_getcsv')) { function str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = "\\") { $fp = fopen("php://memory", 'r+'); @@ -203,13 +209,14 @@ if (count($_POST)>0) { //show the header require_once "includes/header.php"; + $page["title"] = $text['title-import_results']; echo "
\n"; echo "
\n"; if (permission_exists('schema_view')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } echo "
".$row['field_label']." ".$row['field_name']." ".$row['field_type'].""; + switch ($row['field_type']) { + case "text" : echo $text['option-text']; break; + case "numeric" : echo $text['option-number']; break; + case "date" : echo $text['option-date']; break; + case "email" : echo $text['option-email']; break; + case "label" : echo $text['option-label']; break; + case "phone" : echo $text['option-phone']; break; + case "checkbox" : echo $text['option-check_box']; break; + case "textarea" : echo $text['option-text_area']; break; + case "select" : echo $text['option-select']; break; + case "hidden" : echo $text['option-hidden']; break; + case "uuid" : echo $text['option-uuid']; break; + case "password" : echo $text['option-password']; break; + case "pin_number" : echo $text['option-pin_number']; break; + case "image" : echo $text['option-image_upload']; break; + case "upload_file" : echo $text['option-file_upload']; break; + case "url" : echo $text['option-url']; break; + case "mod_date" : echo $text['option-modified_date']; break; + case "mod_user" : echo $text['option-modified_user']; break; + default : echo $row['field_type']; + } + echo " ".$row['field_column']."".$row['field_required']."".$row['field_list_hidden']."".$row['field_search_by']." "; + if ($row['field_required'] == 'yes') { + echo $text['option-true']; + } + else if ($row['field_required'] == 'no') { + echo $text['option-false']; + } + echo " "; + if ($row['field_list_hidden'] == 'show') { + echo $text['option-visible']; + } + else if ($row['field_list_hidden'] == 'hide') { + echo $text['option-hidden']; + } + echo " "; + if ($row['field_search_by'] == 'yes') { + echo $text['option-true']; + } + else if ($row['field_search_by'] == 'no') { + echo $text['option-false']; + } + echo " ".$row['field_order']."".$row['field_order_tab']."".$row['field_description']." \n"; if (permission_exists('schema_edit')) { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } if (permission_exists('schema_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } echo "
 \n"; if (permission_exists('schema_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } echo "
\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -297,14 +304,14 @@ if (count($_POST)>0) { //show the header require_once "includes/header.php"; + $page["title"] = $text['title-import']; //show the content echo "
"; echo "
Import Results".$text['header-import_results']."\n"; - echo " \n"; + echo " \n"; echo "

\n"; echo "
\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -321,46 +328,46 @@ if (count($_POST)>0) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo " "; echo "
Import".$text['header-import']."\n"; - //echo " \n"; echo "

\n"; echo "
\n"; - echo " Data:\n"; + echo " ".$text['label-import_data'].":\n"; echo "\n"; - echo " \n"; echo "
\n"; - echo "Copy and paste the comma delimitted data into the text area to begin the import.\n"; + echo $text['description-import_data']."\n"; echo "
\n"; - echo " Delimiter:\n"; + echo " ".$text['label-import_delimiter'].":\n"; echo "\n"; - echo " \n"; + echo " \n"; + echo " \n"; echo " \n"; echo "
\n"; - echo "Select the delimiter.\n"; + echo $text['description-import_delimiter']."\n"; echo "
\n"; - echo " Enclosure:\n"; + echo " ".$text['label-import_enclosure'].":\n"; echo "\n"; - echo " \n"; + echo " \n"; + echo " \n"; echo " \n"; echo "
\n"; - echo "Select the enclosure.\n"; + echo $text['description-import_enclosure']."\n"; echo "
\n"; - echo " \n"; + echo " \n"; echo "
"; diff --git a/app/schemas/schema_name_value_delete.php b/app/schemas/schema_name_value_delete.php index 081659efa5..20027631c4 100644 --- a/app/schemas/schema_name_value_delete.php +++ b/app/schemas/schema_name_value_delete.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //get the http values if (count($_GET) > 0) { $id = check_str($_GET["id"]); @@ -55,7 +61,7 @@ else { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Delete Complete\n"; + echo $text['message-delete']."\n"; echo "
\n"; require_once "includes/footer.php"; return; diff --git a/app/schemas/schema_name_value_edit.php b/app/schemas/schema_name_value_edit.php index 7dd74d23d6..84277637f5 100644 --- a/app/schemas/schema_name_value_edit.php +++ b/app/schemas/schema_name_value_edit.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //action add or update if (isset($_REQUEST["id"])) { $action = "update"; @@ -64,11 +70,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } //check for all required data - if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid
\n"; } - if (strlen($schema_uuid) == 0) { $msg .= "Please provide: schema_uuid
\n"; } - if (strlen($schema_field_uuid) == 0) { $msg .= "Please provide: schema_field_uuid
\n"; } - if (strlen($data_types_name) == 0) { $msg .= "Please provide: Name
\n"; } - if (strlen($data_types_value) == 0) { $msg .= "Please provide: Value
\n"; } + if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid
\n"; } + if (strlen($schema_uuid) == 0) { $msg .= $text['message-required']."schema_uuid
\n"; } + if (strlen($schema_field_uuid) == 0) { $msg .= $text['message-required']."schema_field_uuid
\n"; } + if (strlen($data_types_name) == 0) { $msg .= $text['message-required'].$text['label-name_value_name']."
\n"; } + if (strlen($data_types_value) == 0) { $msg .= $text['message-required'].$text['label-name_value_value']."
\n"; } if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; require_once "includes/persistformvar.php"; @@ -109,7 +115,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Add Complete\n"; + echo $text['message-add']."\n"; echo "
\n"; require_once "includes/footer.php"; return; @@ -129,7 +135,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Update Complete\n"; + echo $text['message-update']."\n"; echo "
\n"; require_once "includes/footer.php"; return; @@ -160,6 +166,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //show the header require_once "includes/header.php"; + $page["title"] = $text['title-name_value']; //show the content echo "
"; @@ -174,38 +181,38 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; if ($action == "add") { - echo "Table Data Types Name Value Add\n"; + echo "".$text['header-name_value']." ".$text['button-add']."\n"; } if ($action == "update") { - echo "Table Data Types Name Value Edit\n"; + echo "".$text['header-name_value']." ".$text['button-edit']."\n"; } - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "Stores the name and value pairs.

\n"; + echo $text['description-name_value']."

\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Name:\n"; + echo " ".$text['label-name_value_name'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the name.\n"; + echo $text['description-name_value_name']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Value:\n"; + echo " ".$text['label-name_value_value'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the value.\n"; + echo $text['description-name_value_value']."\n"; echo "\n"; echo "\n"; echo " \n"; @@ -215,7 +222,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo ""; diff --git a/app/schemas/schema_name_values.php b/app/schemas/schema_name_values.php index 8a75d9f030..80fb6b7842 100644 --- a/app/schemas/schema_name_values.php +++ b/app/schemas/schema_name_values.php @@ -49,12 +49,12 @@ require_once "includes/paging.php"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Schema Name Values".$text['header-name_values']." 
\n"; - echo "Stores the name and value pairs.

\n"; + echo $text['description-name_values']."

\n"; echo "
\n"; @@ -71,9 +71,9 @@ require_once "includes/paging.php"; //$rows_per_page = 10; //$param = ""; //$page = $_GET['page']; - //if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } - //list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); - //$offset = $rows_per_page * $page; + //if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } + //list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); + //$offset = $rows_per_page * $page; $sql = "select * from v_schema_name_values "; $sql .= "where domain_uuid = '$domain_uuid' "; @@ -93,10 +93,10 @@ require_once "includes/paging.php"; echo "
\n"; echo "\n"; echo "\n"; - echo th_order_by('data_types_name', 'Name', $order_by, $order); - echo th_order_by('data_types_value', 'Value', $order_by, $order); + echo th_order_by('data_types_name', $text['label-name_value_name'], $order_by, $order); + echo th_order_by('data_types_value', $text['label-name_value_value'], $order_by, $order); echo "\n"; echo "\n"; @@ -106,13 +106,11 @@ require_once "includes/paging.php"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; - if ($c==0) { $c=1; } else { $c=0; } + $c = ($c==0) ? 1 : 0; } //end foreach unset($sql, $result, $row_count); } //end if results @@ -125,7 +123,7 @@ require_once "includes/paging.php"; echo " \n"; //echo " \n"; echo " \n"; echo " \n"; echo "
\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
".$row[data_types_name]."".$row[data_types_value]."\n"; - echo " $v_link_label_edit\n"; - echo " $v_link_label_delete\n"; - //echo " \n"; - //echo " \n"; + echo " $v_link_label_edit\n"; + echo " $v_link_label_delete\n"; echo "
 $paging_controls\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
\n"; diff --git a/app/schemas/schemas.php b/app/schemas/schemas.php index 943e6eec06..d19fc47391 100644 --- a/app/schemas/schemas.php +++ b/app/schemas/schemas.php @@ -33,7 +33,16 @@ else { echo "access denied"; exit; } + +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + require_once "includes/header.php"; +$page["title"] = $text['title-schemas']; + require_once "includes/paging.php"; //get the http get variables @@ -49,12 +58,12 @@ require_once "includes/paging.php"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -71,9 +80,9 @@ require_once "includes/paging.php"; $rows_per_page = 100; $param = ""; $page = $_GET['page']; - if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } - list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); - $offset = $rows_per_page * $page; + if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } + list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); + $offset = $rows_per_page * $page; $sql = " select * from v_schemas "; $sql .= " where domain_uuid = '$domain_uuid' "; @@ -92,14 +101,14 @@ require_once "includes/paging.php"; echo "
\n"; echo "
Schemas".$text['header-schemas']." 
\n"; - echo "Provides the ability to quickly define information to store and dynamically makes tools available to view, add, edit, delete, and search.\n"; + echo $text['description-schemas']."\n"; echo "

\n"; echo "
\n"; echo "\n"; - echo th_order_by('schema_label', 'Label', $order_by, $order); - echo th_order_by('schema_name', 'Schema Name', $order_by, $order); - echo th_order_by('schema_auth', 'Authentication', $order_by, $order); - echo th_order_by('schema_description', 'Description', $order_by, $order); + echo th_order_by('schema_label', $text['label-label'], $order_by, $order); + echo th_order_by('schema_name', $text['label-schema_name'], $order_by, $order); + echo th_order_by('schema_auth', $text['label-authentication'], $order_by, $order); + echo th_order_by('schema_description', $text['label-description'], $order_by, $order); //echo "\n"; echo "\n"; echo "\n"; @@ -112,14 +121,21 @@ require_once "includes/paging.php"; echo "\n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo "\n"; @@ -136,7 +152,7 @@ require_once "includes/paging.php"; echo " \n"; echo " \n"; echo " \n";
View\n"; if (permission_exists('schema_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } echo "
".$row['schema_label']." ".$row['schema_name']."".$row['schema_auth'].""; + if ($row['schema_auth'] == 'yes') { + echo $text['option-true']; + } + else if ($row['schema_auth'] == 'false') { + echo $text['option-false']; + } + echo " ".$row['schema_description']." \n"; if (permission_exists('schema_edit')) { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } if (permission_exists('schema_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } echo "
$paging_controls\n"; if (permission_exists('schema_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } echo "