Revision 83914eeb
Von Moritz Bunkus vor fast 17 Jahren hinzugefügt
bin/mozilla/am.pl | ||
---|---|---|
3136 | 3136 |
$lxdebug->leave_sub(); |
3137 | 3137 |
} |
3138 | 3138 |
|
3139 |
sub add_warehouse { |
|
3140 |
$lxdebug->enter_sub(); |
|
3141 |
|
|
3142 |
$auth->assert('config'); |
|
3143 |
|
|
3144 |
$form->{title} = $locale->text('Add Warehouse'); |
|
3145 |
$form->{callback} ||= build_std_url('action=add_warehouse'); |
|
3146 |
$form->{fokus} = 'description'; |
|
3147 |
|
|
3148 |
$form->header(); |
|
3149 |
print $form->parse_html_template('am/edit_warehouse'); |
|
3150 |
|
|
3151 |
$lxdebug->leave_sub(); |
|
3152 |
} |
|
3153 |
|
|
3154 |
sub edit_warehouse { |
|
3155 |
$lxdebug->enter_sub(); |
|
3156 |
|
|
3157 |
$auth->assert('config'); |
|
3158 |
|
|
3159 |
AM->get_warehouse(\%myconfig, $form); |
|
3160 |
|
|
3161 |
$form->get_lists('employees' => 'EMPLOYEES'); |
|
3162 |
|
|
3163 |
$form->{title} = $locale->text('Edit Warehouse'); |
|
3164 |
$form->{callback} ||= build_std_url('action=list_warehouses'); |
|
3165 |
$form->{fokus} = 'description'; |
|
3166 |
|
|
3167 |
$form->header(); |
|
3168 |
print $form->parse_html_template('am/edit_warehouse'); |
|
3169 |
|
|
3170 |
$lxdebug->leave_sub(); |
|
3171 |
} |
|
3172 |
|
|
3173 |
sub list_warehouses { |
|
3174 |
$lxdebug->enter_sub(); |
|
3175 |
|
|
3176 |
$auth->assert('config'); |
|
3177 |
|
|
3178 |
AM->get_all_warehouses(\%myconfig, $form); |
|
3179 |
|
|
3180 |
my $previous; |
|
3181 |
foreach my $current (@{ $form->{WAREHOUSES} }) { |
|
3182 |
if ($previous) { |
|
3183 |
$previous->{next_id} = $current->{id}; |
|
3184 |
$current->{previous_id} = $previous->{id}; |
|
3185 |
} |
|
3186 |
|
|
3187 |
$previous = $current; |
|
3188 |
} |
|
3189 |
|
|
3190 |
$form->{callback} = build_std_url('action=list_warehouses'); |
|
3191 |
$form->{title} = $locale->text('Warehouses'); |
|
3192 |
$form->{url_base} = build_std_url('callback'); |
|
3193 |
|
|
3194 |
$form->header(); |
|
3195 |
print $form->parse_html_template('am/list_warehouses'); |
|
3196 |
|
|
3197 |
$lxdebug->leave_sub(); |
|
3198 |
} |
|
3199 |
|
|
3200 |
sub save_warehouse { |
|
3201 |
$lxdebug->enter_sub(); |
|
3202 |
|
|
3203 |
$auth->assert('config'); |
|
3204 |
|
|
3205 |
$form->isblank("description", $locale->text('Description missing!')); |
|
3206 |
|
|
3207 |
$form->{number_of_new_bins} = $form->parse_amount(\%myconfig, $form->{number_of_new_bins}); |
|
3208 |
|
|
3209 |
AM->save_warehouse(\%myconfig, $form); |
|
3210 |
|
|
3211 |
$form->{callback} .= '&saved_message=' . E($locale->text('Warehouse saved.')) if ($form->{callback}); |
|
3212 |
|
|
3213 |
$form->redirect($locale->text('Warehouse saved.')); |
|
3214 |
|
|
3215 |
$lxdebug->leave_sub(); |
|
3216 |
} |
|
3217 |
|
|
3218 |
sub swap_warehouses { |
|
3219 |
$lxdebug->enter_sub(); |
|
3220 |
|
|
3221 |
$auth->assert('config'); |
|
3222 |
|
|
3223 |
AM->swap_sortkeys(\%myconfig, $form, 'warehouse'); |
|
3224 |
list_warehouses(); |
|
3225 |
|
|
3226 |
$lxdebug->leave_sub(); |
|
3227 |
} |
|
3228 |
|
|
3229 |
sub delete_warehouse { |
|
3230 |
$lxdebug->enter_sub(); |
|
3231 |
|
|
3232 |
$auth->assert('config'); |
|
3233 |
|
|
3234 |
if (!$form->{confirmed}) { |
|
3235 |
$form->{title} = $locale->text('Confirmation'); |
|
3236 |
|
|
3237 |
$form->header(); |
|
3238 |
print $form->parse_html_template('am/confirm_delete_warehouse'); |
|
3239 |
exit 0; |
|
3240 |
} |
|
3241 |
|
|
3242 |
if (AM->delete_warehouse(\%myconfig, $form)) { |
|
3243 |
$form->{callback} .= '&saved_message=' . E($locale->text('Warehouse deleted.')) if ($form->{callback}); |
|
3244 |
$form->redirect($locale->text('Warehouse deleted.')); |
|
3245 |
|
|
3246 |
} else { |
|
3247 |
$form->error($locale->text('The warehouse could not be deleted because it has already been used.')); |
|
3248 |
} |
|
3249 |
|
|
3250 |
$lxdebug->leave_sub(); |
|
3251 |
} |
|
3252 |
|
|
3253 |
sub save_bin { |
|
3254 |
$lxdebug->enter_sub(); |
|
3255 |
|
|
3256 |
$auth->assert('config'); |
|
3257 |
|
|
3258 |
AM->save_bins(\%myconfig, $form); |
|
3259 |
|
|
3260 |
$form->{callback} .= '&saved_message=' . E($locale->text('Bins saved.')) if ($form->{callback}); |
|
3261 |
|
|
3262 |
$form->redirect($locale->text('Bins saved.')); |
|
3263 |
|
|
3264 |
$lxdebug->leave_sub(); |
|
3265 |
} |
|
3266 |
|
Auch abrufbar als: Unified diff
Lagerverwaltung implementiert.