6 'AP--Add Purchase Order.png' => 'purchase_order_add.png',
7 'AP--Add RFQ.png' => 'rfq_add.png',
9 'AP--Reports.png' => 'ap_report.png',
10 'AP--Reports--Purchase Orders.png' => 'purchase_order_report.png',
11 'AP--Reports--RFQs.png' => 'rfq_report.png',
12 'AR--Add Credit Note.png' => 'credit_note_add.png',
13 'AR--Add Delivery Order.png' => 'delivery_oder_add.png', # symlink to MDI-Txt_editor
14 'AR--Add Dunning.png' => 'dunning_add.png',
15 'AR--Add Quotation.png' => 'quotation_add.png',
16 'AR--Add Sales Invoice.png' => 'sales_invoice_add.png',
17 'AR--Add Sales Order.png' => 'sales_order_add.png',
19 'AR--Reports--Delivery Orders.png' => 'delivery_order_report.png', # symlink to MDI-Text_editor
20 'AR--Reports--Dunnings.png' => 'dunnings_report.png',
21 'AR--Reports--Invoices, Credit Notes & AR Transactions.png' => 'invoices_report.png',
22 'AR--Reports.png' => 'ar_report.png',
23 'AR--Reports--Quotations.png' => 'report_quotations.png',
24 'AR--Reports--Sales Orders.png' => 'report_sales_orders.png',
25 'Batch Printing--Packing Lists.png' => 'package_lists.png',
26 'Batch Printing.png' => 'printing.png',
27 'Batch Printing--Purchase Orders.png' => 'purchase_order_printing.png',
28 'Batch Printing--Quotations.png' => 'quotation_printing.png',
29 'Batch Printing--Receipts.png' => 'receipt_printing.png',
30 'Batch Printing--RFQs.png' => 'rfq_printing.png',
31 'Batch Printing--Sales Invoices.png' => 'sales_invoice_printing.png',
32 'Batch Printing--Sales Orders.png' => 'sales_order_printing.png',
33 'Cash--Payment.png' => 'payment.png',
34 'Cash.png' => 'cash.png',
35 'Cash--Receipt.png' => 'receipt.png',
36 'Cash--Reconciliation.png' => 'reconcilliation.png',
37 'Cash--Reports--Payments.png' => 'payment_report.png',
38 'Cash--Reports.png' => 'cash_report.png',
39 'Cash--Reports--Receipts.png' => 'receipt_report.png',
40 'CRM--Add--Customer.png' => 'customer.png',
41 'CRM--Add--Person.png' => 'contact.png',
42 'CRM--Add--Vendor.png' => 'vendor.png',
43 'CRM--Admin--Document Template.png' => 'document_template.png',
44 'CRM--Admin--Label.png' => 'label.png',
45 'CRM--Admin--Message.png' => 'message.png',
46 'CRM--Admin.png' => 'admin.png',
47 'CRM--Admin--Status.png' => 'status.png',
48 'CRM--Admin--User Groups.png' => 'user_group.png',
49 'CRM--Admin--User.png' => 'user.png',
50 'CRM--Appointments.png' => 'appointment.png',
51 'CRM--E-mail.png' => 'email.png',
52 'CRM--Follow-Up.png' => 'follow_up.png',
53 'CRM--Help.png' => 'help.png',
54 'CRM--Knowledge.png' => 'knowledge.png',
55 'CRM--Memo.png' => 'memo.png',
56 'CRM--Opportunity.png' => 'opportunity.png',
57 'CRM.png' => 'crm.png',
58 'CRM--Search.png' => 'search.png',
59 'CRM--Service.png' => 'service.png',
60 'General Ledger--Add AP Transaction.png' => 'ap_transaction_add.png',
61 'General Ledger--Add AR Transaction.png' => 'ar_transaction_add.png',
62 'General Ledger--Add Transaction.png' => 'transaction_add.png',
63 'General Ledger--DATEV - Export Assistent.png' => 'datev.png',
64 'General Ledger.png' => 'gl.png',
65 'General Ledger--Reports--AP Aging.png' => 'ap_aging.png',
66 'General Ledger--Reports--AR Aging.png' => 'ar_aging.png',
67 'General Ledger--Reports--Journal.png' => 'journal.png',
68 'General Ledger--Reports.png' => 'gl_report.png',
69 'Master Data--Add Assembly.png' => 'assembly_add.png',
70 'Master Data--Add Customer.png' => 'customer_add.png',
71 'Master Data--Add License.png' => 'license_add.png',
72 'Master Data--Add Part.png' => 'part_add.png',
73 'Master Data--Add Project.png' => 'project_add.png',
74 'Master Data--Add Service.png' => 'service_add.png',
75 'Master Data--Add Vendor.png' => 'vendor_add.png',
76 'Master Data.png' => 'master_data.png',
77 'Master Data--Reports--Assemblies.png' => 'assembly_report.png',
78 'Master Data--Reports--Customers.png' => 'customer_report.png',
79 'Master Data--Reports--Licenses.png' => 'license_report.png',
80 'Master Data--Reports--Parts.png' => 'part_report.png',
81 'Master Data--Reports.png' => 'master_data_report.png',
82 'Master Data--Reports--Projects.png' => 'project_report.png',
83 'Master Data--Reports--Projecttransactions.png' => 'project_transaction_report.png',
84 'Master Data--Reports--Services.png' => 'service_report.png',
85 'Master Data--Reports--Vendors.png' => 'vendor_report.png',
86 'Master Data--Update Prices.png' => 'prices_update.png',
87 'Neues Fenster.png' => 'window_new.png',
88 'phone.png' => 'phone.png',
89 'Program--Logout.png' => 'logout.png',
90 'Program.png' => 'program.png',
91 'Program--Preferences.png' => 'preferences.png',
92 'Program--Version.png' => 'version.png',
93 'Reports--Balance Sheet.png' => 'balance_sheet.png',
94 'Reports--Chart of Accounts.png' => 'chart_of_accounts.png',
95 'Reports--Income Statement.png' => 'income_statement.png',
96 'Reports.png' => 'report.png',
97 'Reports--UStVa.png' => 'ustva.png',
98 'System.png' => 'system.png',
99 'Warehouse.png' => 'warehouse.png',
100 'Warehouse--Produce Assembly.png' => 'assembly_produce.png',
101 'MDI-Text-Editor-16x16.png' => 'mdi_text_editor.png',
102 'Productivity' => 'productivity.png',
106 'mdi_text_editor.png' => 'delivery_order_add.png', # symlink to MDI-Txt_editor
107 'mdi_text_editor.png' => 'delivery_order_report.png', # symlink to MDI-Txt_editor
111 # check 1: no duplicate targets
113 for (values %icons) {
114 next unless defined $_;
115 die "duplicate target: $_" if $seen{$_}++;
118 # check2: all targets should end in .png, otherwise there's a typo
119 for (values %icons) {
120 next unless defined $_;
121 die "target does not end in .png: $_" unless /\.png$/;
124 # check 3: all sources need to be real files in this dir
126 next unless defined $_;
127 die "key $_ is not a file!" unless -f $_;
130 # check 4: all keys in symlinks need to be a target in icons
131 for (keys %symlinks) {
132 no warnings 'uninitialized';
133 die "can't symlink this, because it's not a target of renaming: $_" unless { reverse %icons }->{$_};
138 # now do the actual renaming
139 while (my ($from, $to) = each(%icons)) {
142 system("git mv '$from' '$to'");
145 system("git rm '$from'");
149 # and do some symlinking
150 while (my ($from, $to) = each(%symlinks)) {
151 system("ln -s '$from' '$to'");
152 system("git add '$to'");
157 my ($menu_file) = @_;
159 my $new_file = $menu_file;
160 $new_file =~ s/\./_new\./;
162 open my $in, "<", $menu_file or die "error opening $menu_file: $!";
163 open my $out, ">", $new_file or die "error opening $new_file: $!";
169 # look if we got this in %icons
170 if ($icons{ $name . '.png' }) {
171 my $new_name = $icons{ $name . '.png' };
172 $new_name =~ s/\.png$//;
173 print $out "ICON=$new_name\n";
175 warn "don't know what '$name' is in $menu_file";
179 system("mv $new_file $menu_file");
185 translate_menu('menus/erp.ini');
186 translate_menu('menus/admin.ini');
187 translate_menu('menus/crm.ini');