Partial changes for new access control system.
[fa-stable.git] / admin / payment_terms.php
index 24969c94a268301ac5611b8aff46536c0b7bd8c7..ddc4c50945fca768af030f114027629028e7d0fa 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       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 License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
 $page_security = 10;
 $path_to_root="..";
 include($path_to_root . "/includes/session.inc");
@@ -126,15 +135,20 @@ if ($Mode == 'Delete')
 if ($Mode == 'RESET')
 {
        $selected_id = -1;
+       $sav = get_post('show_inactive');
        unset($_POST);
+       $_POST['show_inactive'] = $sav;
 }
 //-------------------------------------------------------------------------------------------------
 
 $sql = "SELECT * FROM ".TB_PREF."payment_terms";
+if (!check_value('show_inactive')) $sql .= " WHERE !inactive";
 $result = db_query($sql,"could not get payment terms");
+
 start_form();
 start_table($table_style);
 $th = array(_("Description"), _("Following Month On"), _("Due After (Days)"), "", "");
+inactive_control_column($th);
 table_header($th);
 
 $k = 0; //row colour counter
@@ -163,21 +177,19 @@ while ($myrow = db_fetch($result))
     label_cell($myrow["terms"]);
     label_cell($full_text);
     label_cell($after_text);
+       inactive_control_cell($myrow["terms_indicator"], $myrow["inactive"], 'payment_terms', "terms_indicator");
        edit_button_cell("Edit".$myrow["terms_indicator"], _("Edit"));
-       edit_button_cell("Delete".$myrow["terms_indicator"], _("Delete"));
+       delete_button_cell("Delete".$myrow["terms_indicator"], _("Delete"));
     end_row();
 
 
 } //END WHILE LIST LOOP
 
-end_table();
-end_form();
-echo '<br>';
+inactive_control_row($th);
+end_table(1);
 
 //-------------------------------------------------------------------------------------------------
 
-start_form();
-
 start_table($table_style2);
 
 $day_in_following_month = $days_before_due = 0;
@@ -213,7 +225,7 @@ text_row_ex(_("Days (Or Day In Following Month):"), 'DayNumber', 3);
 
 end_table(1);
 
-submit_add_or_update_center($selected_id == -1, '', true);
+submit_add_or_update_center($selected_id == -1, '', 'both');
 
 end_form();