A free open source IT asset/license management system
Merge branch 'develop' into replace-date-and-time-display-macros
Marcus Moorea1e65cd89767
diff --cc resources/macros/macros.phpindex 57035a7bd9,231e306c7e..844c3f8be7--- a/resources/macros/macros.php+++ b/resources/macros/macros.php@@@ -39,41 -39,53 +39,6 @@@ Form::macro('countries', function ($namreturn $select;});- Form::macro('digit_separator', function ($name = 'digit_separator', $selected = null, $class = null) {-Form::macro('date_display_format', function ($name = 'date_display_format', $selected = null, $class = null) {-- $formats = [- '1,234.56',- '1.234,56',- 'Y-m-d',- 'D M d, Y',- 'M j, Y',- 'd M, Y',- 'm/d/Y',- 'n/d/y',- 'd/m/Y',- 'd.m.Y',- 'Y.m.d.',-- ];---- foreach ($formats as $format) {- $date_display_formats[$format] = Carbon::parse(date('Y-m-d'))->format($format);-- }- $select = '<select name="'.$name.'" class="'.$class.'" style="min-width:120px">';- foreach ($formats as $format_inner) {- $select .= '<option value="'.$format_inner.'"'.($selected == $format_inner ? ' selected="selected"' : '').'>'.$format_inner.'</option> ';- $select = '<select name="'.$name.'" class="'.$class.'" style="min-width:100%" aria-label="'.$name.'">';- foreach ($date_display_formats as $format => $date_display_format) {- $select .= '<option value="'.$format.'"'.($selected == $format ? ' selected="selected" role="option" aria-selected="true"' : ' aria-selected="false"').'">'.$date_display_format.'</option> ';-- }---- $select .= '</select>';---- return $select;--});---- Form::macro('name_display_format', function ($name = 'name_display_format', $selected = null, $class = null) {-Form::macro('time_display_format', function ($name = 'time_display_format', $selected = null, $class = null) {-- $formats = [- 'first_last' => trans('general.firstname_lastname_display'),- 'last_first' => trans('general.lastname_firstname_display'),- 'g:iA',- 'h:iA',- 'H:i',-- ];--- $select = '<select name="'.$name.'" class="'.$class.'" style="width: 100%" aria-label="'.$name.'">';- foreach ($formats as $format => $label) {- $select .= '<option value="'.$format.'"'.($selected == $format ? ' selected="selected" role="option" aria-selected="true"' : ' aria-selected="false"').'>'.$label.'</option> '."\n";- $datetime = date("y-m-d").' 14:00:00';- foreach ($formats as $format) {- $time_display_formats[$format] = Carbon::parse($datetime)->format($format);- }- $select = '<select name="'.$name.'" class="'.$class.'" style="min-width:150px" aria-label="'.$name.'">';- foreach ($time_display_formats as $format => $time_display_format) {- $select .= '<option value="'.$format.'"'.($selected == $format ? ' selected="selected" role="option" aria-selected="true"' : ' aria-selected="false"').'>'.$time_display_format.'</option> ';-- }---- $select .= '</select>';---- return $select;--});--/*** Barcode macro* Generates the dropdown menu of available 1D barcodes