+ $auth->assert('config');
+
+ if ($form->{type} eq 'partsgroup') {
+ $form->isblank("partsgroup", $locale->text('Group missing!'));
+ PE->save_partsgroup(\%myconfig, \%$form);
+ $form->redirect($locale->text('Group saved!'));
+ }
+
+ # choice pricegroup and save
+ if ($form->{type} eq 'pricegroup') {
+ $form->isblank("pricegroup", $locale->text('Pricegroup missing!'));
+ PE->save_pricegroup(\%myconfig, \%$form);
+ $form->redirect($locale->text('Pricegroup saved!'));
+ }
+ # saving the history
+ if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumbers} = qq|projectnumber_| . $form->{projectnumber};
+ $form->{addition} = "SAVED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
+
+ $lxdebug->leave_sub();
+}
+
+sub delete {
+ $lxdebug->enter_sub();
+
+ $auth->assert('config');
+
+ PE->delete_tuple(\%myconfig, \%$form);
+
+ if ($form->{type} eq 'partsgroup') {
+ $form->redirect($locale->text('Group deleted!'));
+ }
+ if ($form->{type} eq 'pricegroup') {
+ $form->redirect($locale->text('Pricegroup deleted!'));
+ }
+ # saving the history
+ if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|projectnumber_| . $form->{projectnumber};
+ $form->{addition} = "DELETED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
+ $lxdebug->leave_sub();
+}
+
+sub continue { call_sub($form->{"nextsub"}); }
+
+sub partsgroup_report {
+ $lxdebug->enter_sub();
+
+ $auth->assert('config');
+
+ map { $form->{$_} = $form->unescape($form->{$_}) } (partsgroup);
+ PE->partsgroups(\%myconfig, \%$form);