Code Duplication    Length = 9-9 lines in 5 locations

addTicket.php 1 location

@@ 308-316 (lines=9) @@
305
        }
306
307
        $elements = array('subject', 'description');
308
        foreach($elements as $element){         // Foreach element in the predefined list
309
            $xoopsTpl->assign("xhelp_element_$element", "formButton");
310
            foreach($aElements as $aElement){   // Foreach that has an error
311
                if($aElement == $element){      // If the names are equal
312
                    $xoopsTpl->assign("xhelp_element_$element", "validateError");
313
                    break;
314
                }
315
            }
316
        }
317
318
        if ($ticket =& $_xhelpSession->get('xhelp_ticket')) {
319
            $xoopsTpl->assign('xhelp_ticket_uid', $ticket['uid']);

anon_addTicket.php 1 location

@@ 175-183 (lines=9) @@
172
    }
173
174
    $elements = array('subject', 'description', 'email');
175
    foreach($elements as $element){         // Foreach element in the predefined list
176
        $xoopsTpl->assign("xhelp_element_$element", "formButton");
177
        foreach($aElements as $aElement){   // Foreach that has an error
178
            if($aElement == $element){      // If the names are equal
179
                $xoopsTpl->assign("xhelp_element_$element", "validateError");
180
                break;
181
            }
182
        }
183
    }
184
185
    if ($ticket =& $_xhelpSession->get('xhelp_ticket')) {
186
        $xoopsTpl->assign('xhelp_ticket_subject', stripslashes($ticket['subject']));

response.php 2 locations

@@ 259-267 (lines=9) @@
256
            }
257
258
            $elements = array('response', 'timespent');
259
            foreach($elements as $element){         // Foreach element in the predefined list
260
                $xoopsTpl->assign("xhelp_element_$element", "formButton");
261
                foreach($aElements as $aElement){   // Foreach that has an error
262
                    if($aElement == $element){      // If the names are equal
263
                        $xoopsTpl->assign("xhelp_element_$element", "validateError");
264
                        break;
265
                    }
266
                }
267
            }
268
269
            //Get all staff defined templates
270
            $crit = new Criteria('uid', $uid);
@@ 376-384 (lines=9) @@
373
        }
374
375
        $elements = array('response', 'timespent');
376
        foreach($elements as $element){         // Foreach element in the predefined list
377
            $xoopsTpl->assign("xhelp_element_$element", "formButton");
378
            foreach($aElements as $aElement){   // Foreach that has an error
379
                if($aElement == $element){      // If the names are equal
380
                    $xoopsTpl->assign("xhelp_element_$element", "validateError");
381
                    break;
382
                }
383
            }
384
        }
385
386
        $hResponseTpl =& xhelpGetHandler('responseTemplates');          // Used to display responseTemplates
387
        $crit = new Criteria('uid', $uid);

ticket.php 1 location

@@ 333-341 (lines=9) @@
330
            }
331
332
            $elements = array('subject', 'description');
333
            foreach($elements as $element){         // Foreach element in the predefined list
334
                $xoopsTpl->assign("xhelp_element_$element", "formButton");
335
                foreach($aElements as $aElement){   // Foreach that has an error
336
                    if($aElement == $element){      // If the names are equal
337
                        $xoopsTpl->assign("xhelp_element_$element", "validateError");
338
                        break;
339
                    }
340
                }
341
            }
342
            // end form validation stuff
343
344
            $javascript = "<script type=\"text/javascript\" src=\"". XHELP_BASE_URL ."/include/functions.js\"></script>