Additional conflict fixes after merge.
[fa-stable.git] / admin / forms_setup.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU Affero General Public License,
5         AGPL, as published by the Free Software Foundation, either version 
6         3 of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
11 ***********************************************************************/
12 $page_security =10;
13 $path_to_root="..";
14 include($path_to_root . "/includes/session.inc");
15
16 page(_("Forms Setup"));
17
18 include($path_to_root . "/includes/ui.inc");
19
20 //-------------------------------------------------------------------------------------------------
21
22 if (isset($_POST['setprefs'])) 
23 {
24
25         $systypes = get_systypes();
26
27         begin_transaction();
28
29     while ($type = db_fetch($systypes)) 
30     {
31         save_next_reference($type["type_id"], $_POST['id' . $type["type_id"]]);
32     }
33
34     commit_transaction();
35
36         display_notification_centered(_("Forms settings have been updated."));
37 }
38
39 start_form();
40 start_table("class='tablestyle'");
41
42 $systypes = get_systypes();
43
44 $th = array(_("Form"), _("Next Reference"));
45 table_header($th);
46
47 while ($type = db_fetch($systypes)) 
48 {
49         ref_row(systypes::name($type["type_id"]), 'id' . $type["type_id"], '', $type["next_reference"]);
50 }
51
52 end_table(1);
53
54 submit_center('setprefs', _("Update"), true, '', true);
55
56 end_form(2);
57
58 //-------------------------------------------------------------------------------------------------
59
60 end_page();
61
62 ?>