Code Duplication    Length = 26-26 lines in 2 locations

src/projects/fcreate.php 1 location

@@ 845-870 (lines=26) @@
842
843
// generate controls for 'duration' field
844
845
elseif ($form == 'durationform')
846
{
847
    $xml .= '<control name="min_value" required="' . get_html_resource(RES_REQUIRED3_ID) . '">'
848
          . '<label>' . get_html_resource(RES_MIN_VALUE_ID) . '</label>'
849
          . '<editbox maxlen="' . ustrlen(time2ustr(MAX_FIELD_DURATION)) . '">'
850
          . ustr2html($min_value)
851
          . '</editbox>'
852
          . '</control>';
853
854
    $xml .= '<control name="max_value" required="' . get_html_resource(RES_REQUIRED3_ID) . '">'
855
          . '<label>' . get_html_resource(RES_MAX_VALUE_ID) . '</label>'
856
          . '<editbox maxlen="' . ustrlen(time2ustr(MAX_FIELD_DURATION)) . '">'
857
          . ustr2html($max_value)
858
          . '</editbox>'
859
          . '</control>';
860
861
    $xml .= '<control name="def_value">'
862
          . '<label>' . get_html_resource(RES_DEFAULT_VALUE_ID) . '</label>'
863
          . '<editbox maxlen="' . ustrlen(time2ustr(MAX_FIELD_DURATION)) . '">'
864
          . ustr2html($def_value)
865
          . '</editbox>'
866
          . '</control>';
867
868
    $notes .= '<note>' . ustrprocess(get_html_resource(RES_ALERT_TIME_VALUE_OUT_OF_RANGE_ID), time2ustr(MIN_FIELD_DURATION), time2ustr(MAX_FIELD_DURATION)) . '</note>'
869
            . '<note>' . get_html_resource(RES_ALERT_MIN_MAX_VALUES_ID) . '</note>';
870
}
871
872
// generate common controls
873

src/projects/fmodify.php 1 location

@@ 617-642 (lines=26) @@
614
615
// generate controls for 'duration' field
616
617
elseif ($field['field_type'] == FIELD_TYPE_DURATION)
618
{
619
    $xml .= '<control name="min_value" required="' . get_html_resource(RES_REQUIRED3_ID) . '">'
620
          . '<label>' . get_html_resource(RES_MIN_VALUE_ID) . '</label>'
621
          . '<editbox maxlen="' . ustrlen(time2ustr(MAX_FIELD_DURATION)) . '">'
622
          . ustr2html($param1)
623
          . '</editbox>'
624
          . '</control>';
625
626
    $xml .= '<control name="max_value" required="' . get_html_resource(RES_REQUIRED3_ID) . '">'
627
          . '<label>' . get_html_resource(RES_MAX_VALUE_ID) . '</label>'
628
          . '<editbox maxlen="' . ustrlen(time2ustr(MAX_FIELD_DURATION)) . '">'
629
          . ustr2html($param2)
630
          . '</editbox>'
631
          . '</control>';
632
633
    $xml .= '<control name="def_value">'
634
          . '<label>' . get_html_resource(RES_DEFAULT_VALUE_ID) . '</label>'
635
          . '<editbox maxlen="' . ustrlen(time2ustr(MAX_FIELD_DURATION)) . '">'
636
          . ustr2html($default)
637
          . '</editbox>'
638
          . '</control>';
639
640
    $notes .= '<note>' . ustrprocess(get_html_resource(RES_ALERT_TIME_VALUE_OUT_OF_RANGE_ID), time2ustr(MIN_FIELD_DURATION), time2ustr(MAX_FIELD_DURATION)) . '</note>'
641
            . '<note>' . get_html_resource(RES_ALERT_MIN_MAX_VALUES_ID) . '</note>';
642
}
643
644
// generate common controls
645