X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=dimensions%2Fdimension_entry.php;h=d5c4f2a9fab9b6daa1fe83bd1e4488477f2a7c84;hb=a721b65478fd2a264b470e1265e69cf829031e7a;hp=7b9bcb3791ceb475581dc3a87287c7ed71b480c8;hpb=80dd97a37f674cc3691fa04af4c29607067566b2;p=fa-stable.git diff --git a/dimensions/dimension_entry.php b/dimensions/dimension_entry.php index 7b9bcb37..d5c4f2a9 100644 --- a/dimensions/dimension_entry.php +++ b/dimensions/dimension_entry.php @@ -17,13 +17,14 @@ include_once($path_to_root . "/includes/date_functions.inc"); include_once($path_to_root . "/includes/manufacturing.inc"); include_once($path_to_root . "/includes/data_checks.inc"); +include_once($path_to_root . "/admin/db/tags_db.inc"); include_once($path_to_root . "/dimensions/includes/dimensions_db.inc"); include_once($path_to_root . "/dimensions/includes/dimensions_ui.inc"); $js = ""; -if ($use_date_picker) +if (user_use_date_picker()) $js .= get_js_date_picker(); -page(_("Dimension Entry"), false, false, "", $js); +page(_($help_context = "Dimension Entry"), false, false, "", $js); //--------------------------------------------------------------------------------------- @@ -153,21 +154,23 @@ function can_process() if (isset($_POST['ADD_ITEM']) || isset($_POST['UPDATE_ITEM'])) { - + if (!isset($_POST['dimension_tags'])) + $_POST['dimension_tags'] = array(); + if (can_process()) { if ($selected_id == -1) { - $id = add_dimension($_POST['ref'], $_POST['name'], $_POST['type_'], $_POST['date_'], $_POST['due_date'], $_POST['memo_']); - + add_tag_associations($id, $_POST['dimension_tags']); meta_forward($_SERVER['PHP_SELF'], "AddedID=$id"); } else { update_dimension($selected_id, $_POST['name'], $_POST['type_'], $_POST['date_'], $_POST['due_date'], $_POST['memo_']); + update_tag_associations(TAG_DIMENSION, $selected_id, $_POST['dimension_tags']); meta_forward($_SERVER['PHP_SELF'], "UpdatedID=$selected_id"); } @@ -194,6 +197,7 @@ if (isset($_POST['delete'])) // delete delete_dimension($selected_id); + delete_tag_associations(TAG_DIMENSION,$selected_id, true); meta_forward($_SERVER['PHP_SELF'], "DeletedID=$selected_id"); } } @@ -219,7 +223,7 @@ if (isset($_POST['reopen'])) start_form(); -start_table($table_style2); +start_table(TABLESTYLE2); if ($selected_id != -1) { @@ -245,6 +249,12 @@ if ($selected_id != -1) $_POST['date_'] = sql2date($myrow["date_"]); $_POST['due_date'] = sql2date($myrow["due_date"]); $_POST['memo_'] = get_comments_string(ST_DIMENSION, $selected_id); + + $tags_result = get_tags_associated_with_record(TAG_DIMENSION, $selected_id); + $tagids = array(); + while ($tag = db_fetch($tags_result)) + $tagids[] = $tag['id']; + $_POST['dimension_tags'] = $tagids; hidden('ref', $_POST['ref']); @@ -254,6 +264,7 @@ if ($selected_id != -1) } else { + $_POST['dimension_tags'] = array(); ref_row(_("Dimension Reference:"), 'ref', '', $Refs->get_next(ST_DIMENSION)); } @@ -267,6 +278,8 @@ date_row(_("Start Date") . ":", 'date_'); date_row(_("Date Required By") . ":", 'due_date', '', null, $SysPrefs->default_dimension_required_by()); +tag_list_row(_("Tags:"), 'dimension_tags', 5, TAG_DIMENSION, true); + textarea_row(_("Memo:"), 'memo_', null, 40, 5); end_table(1); @@ -294,4 +307,3 @@ end_form(); end_page(); -?>