Code Duplication    Length = 14-16 lines in 5 locations

admin/actions/categories.php 1 location

@@ 252-267 (lines=16) @@
249
        break;
250
251
    // ****************************************************************************************************************
252
    case 'delete': // Suppression d'une catégorie
253
        // ****************************************************************************************************************
254
        xoops_cp_header();
255
        oledrion_adminMenu(3);
256
        $id = isset($_POST['id']) ? (int)$_POST['id'] : 0;
257
        if ($id == 0) {
258
            OledrionUtility::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5);
259
        }
260
        $category = null;
261
        $category = $h_oledrion_cat->get($id);
262
        if (!is_object($category)) {
263
            OledrionUtility::redirect(_AM_OLEDRION_ERROR_10, $baseurl, 5);
264
        }
265
        $msg = sprintf(_AM_OLEDRION_CONF_DEL_CATEG, $category->getVar('cat_title'));
266
        xoops_confirm(array('op' => 'categories', 'action' => 'confdelete', 'id' => $id), 'index.php', $msg);
267
        break;
268
269
    // ****************************************************************************************************************
270
    case 'confdelete': //Suppression effective d'une catégorie

admin/actions/delivery.php 1 location

@@ 205-218 (lines=14) @@
202
        }
203
        break;
204
205
    case 'delete':
206
        xoops_cp_header();
207
        $id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
208
        if ($id == 0) {
209
            OledrionUtility::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5);
210
        }
211
        $delivery = null;
212
        $delivery = $h_oledrion_delivery->get($id);
213
        if (!is_object($delivery)) {
214
            OledrionUtility::redirect(_AM_OLEDRION_ERROR_10, $baseurl, 5);
215
        }
216
        $msg = sprintf(_AM_OLEDRION_CONF_DEL_ITEM, $delivery->getVar('delivery_title'));
217
        xoops_confirm(array('op' => 'delivery', 'action' => 'confdelete', 'id' => $id), 'index.php', $msg);
218
        break;
219
220
    case 'confdelete':
221

admin/actions/location.php 1 location

@@ 218-231 (lines=14) @@
215
        require_once OLEDRION_ADMIN_PATH . 'admin_footer.php';
216
        break;
217
218
    case 'delete':
219
        xoops_cp_header();
220
        $id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
221
        if ($id == 0) {
222
            OledrionUtility::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5);
223
        }
224
        $location = null;
225
        $location = $h_oledrion_location->get($id);
226
        if (!is_object($location)) {
227
            OledrionUtility::redirect(_AM_OLEDRION_ERROR_10, $baseurl, 5);
228
        }
229
        $msg = sprintf(_AM_OLEDRION_CONF_DEL_ITEM, $location->getVar('location_title'));
230
        xoops_confirm(array('op' => 'location', 'action' => 'confdelete', 'id' => $id), 'index.php', $msg);
231
        break;
232
233
    case 'confdelete':
234

admin/actions/packing.php 1 location

@@ 163-177 (lines=15) @@
160
        }
161
        break;
162
163
    case 'delete':
164
        xoops_cp_header();
165
        $id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
166
        if ($id == 0) {
167
            OledrionUtility::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5);
168
        }
169
        $packing = null;
170
        $packing = $h_oledrion_packing->get($id);
171
        if (!is_object($packing)) {
172
            OledrionUtility::redirect(_AM_OLEDRION_ERROR_10, $baseurl, 5);
173
        }
174
        $msg = sprintf(_AM_OLEDRION_CONF_DEL_ITEM, $packing->getVar('packing_title'));
175
        xoops_confirm(array('op' => 'packing', 'action' => 'confdelete', 'id' => $id), 'index.php', $msg);
176
177
        break;
178
179
    case 'confdelete':
180

admin/actions/payment.php 1 location

@@ 184-198 (lines=15) @@
181
        }
182
        break;
183
184
    case 'delete':
185
        xoops_cp_header();
186
        $id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
187
        if ($id == 0) {
188
            OledrionUtility::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5);
189
        }
190
        $payment = null;
191
        $payment = $h_oledrion_payment->get($id);
192
        if (!is_object($payment)) {
193
            OledrionUtility::redirect(_AM_OLEDRION_ERROR_10, $baseurl, 5);
194
        }
195
        $msg = sprintf(_AM_OLEDRION_CONF_DEL_ITEM, $payment->getVar('payment_title'));
196
        xoops_confirm(array('op' => 'payment', 'action' => 'confdelete', 'id' => $id), 'index.php', $msg);
197
198
        break;
199
200
    case 'confdelete':
201