Updates to 03-2025

This commit is contained in:
Kevin Adametz 2025-04-01 10:36:47 +02:00
parent bfa3bb1df4
commit 9ae662f63e
243 changed files with 12580 additions and 12018 deletions

View file

@ -104,23 +104,22 @@ class HTMLHelper
return $ret;
}
public static function getAboIntervallWeeks($default = 1){
$values = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
public static function getAboDeliveryOptions($default = 5){
$values = \App\Models\UserAbo::$aboDeliveryDays;
$ret = "";
foreach ($values as $value){
$attr = ($value == $default) ? 'selected="selected"' : '';
$str = self::getAboWeeksLang($value);
$str = self::getAboStrLang($value);
$ret .= '<option value="'.$value.'" '.$attr.'>'.$str.'</option>\n';
}
return $ret;
}
public static function getAboWeeksLang($num){
if($num == 1){
return __('order.every_week');
}
return __('order.every_weeks', ['num' => $num]);
public static function getAboStrLang($num){
return $num.'. '.__('abo.of_month');
}
public static function getAttributesWithoutParents($id = false, $sameId = false, $all = true){
$values = Attribute::where('parent_id', null)->get();
$ret = "";
@ -157,14 +156,14 @@ class HTMLHelper
if($ids == null){
$ids = array();
}
$values = Product::where('active', 1)->get();
$values = Product::all();
$ret = "";
if($all){
$ret .= '<option value="">'.__('none').'</option>\n';
}
foreach ($values as $value){
$attr = in_array($value->id, $ids) ? 'selected="selected"' : '';
$ret .= '<option value="'.$value->id.'" '.$attr.'>'.$value->name.'</option>\n';
$ret .= '<option value="'.$value->id.'" '.$attr.'>'.$value->name.' ('.($value->active ? 'on' : 'off').')</option>\n';
}
return $ret;
}