mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2024-11-05 02:36:30 +01:00
146 lines
4.3 KiB
Perl
Executable file
146 lines
4.3 KiB
Perl
Executable file
package AttributEdit;
|
|
#
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
# Copyright (c) Rainer Gümpelein, TeilRad GmbH
|
|
#
|
|
use strict;
|
|
use warnings;
|
|
use CGI::Carp qw(fatalsToBrowser);
|
|
use CGI ':standard';
|
|
use Lib::Config;
|
|
use Mod::Buttons;
|
|
use Mod::Libenz;
|
|
use Mod::Libenzdb;
|
|
use Mod::DBtank;
|
|
|
|
sub new {
|
|
my $class = shift;
|
|
my $self = {};
|
|
bless($self,$class);
|
|
return $self;
|
|
}
|
|
|
|
#Template
|
|
sub tpl(){
|
|
my $node_meta = shift;
|
|
my $users_dms = shift;
|
|
my $mode = shift;
|
|
my $return = shift;
|
|
|
|
my $q = new CGI;
|
|
my $cf = new Config;
|
|
my $lb = new Libenz;
|
|
my $db = new Libenzdb;
|
|
my $dbt = new DBtank;
|
|
my $but = new Buttons;
|
|
|
|
my %varenv = $cf->envonline();
|
|
my $script = $q->script_name();
|
|
my $path = $q->path_info();
|
|
my %ib = $but->ibuttons();
|
|
my $dbh = "";
|
|
my $tpl = $db->get_tpl($R::tpl_id);#Master template
|
|
my @tpl_order = split /,/,$tpl->{tpl_order};
|
|
|
|
my @_attr;
|
|
my $asort=0;
|
|
my $des_name;
|
|
my $key_txt;
|
|
my $checked_txt;
|
|
my $key_txtarea;
|
|
my $checked_txtarea;
|
|
my $key_int;
|
|
my $checked_int;
|
|
my $key_intcheck;
|
|
my $checked_intcheck;
|
|
my ($key,$des,$size);
|
|
foreach (@tpl_order){
|
|
$asort++;
|
|
($key,$des,$size) = split /=/,$_;
|
|
#push (@_attr, "$key") if($key);
|
|
if("$key" eq "$R::key"){
|
|
$des_name = $des;
|
|
if($key =~ /ct_name/){
|
|
last;
|
|
}
|
|
elsif($key =~ /txt(\d+)/ && $size =~ /area/){
|
|
$key_txtarea = $1;
|
|
$checked_txtarea = "checked";
|
|
last;
|
|
}
|
|
elsif($key =~ /txt(\d+)/){
|
|
$key_txt = $1;
|
|
$checked_txt = "checked";
|
|
last;
|
|
}
|
|
elsif($key =~ /int(\d+)/ && $size =~ /checkbox/){
|
|
$key_intcheck = $1;
|
|
$checked_intcheck = "checked";
|
|
last;
|
|
}
|
|
elsif($key =~ /int(\d+)/){
|
|
$key_int = $1;
|
|
$checked_int = "checked";
|
|
last;
|
|
}
|
|
}
|
|
}
|
|
|
|
$tpl->{change} = $lb->time4de($tpl->{change},"1") if($tpl->{change});
|
|
my $u_name = $tpl->{owner};
|
|
|
|
$u_name = $dbt->sys_username($dbh,$tpl->{owner});
|
|
|
|
print "<div style='border: 0px solid gray;margin: 0 auto;padding: 0;min-width: 100%;min-height: 150px;font-size: 14px;'>";
|
|
print $q->hidden(-name=>'key', -value=>"$R::key",-override=>'1');
|
|
|
|
print $q->start_table({-class=>'list', -border=>'0', -width=>'100%', -align=>'left', -cellpadding=>'3', -cellspacing=>'3'});
|
|
#Buttons
|
|
print $q->Tr();
|
|
print "<td style='background:$varenv{background_color2};margin:1px 0;padding:2px;' colspan='2' nowrap>\n";
|
|
print $but->singlesubmit7("rel_edit","save_attrtpl","","");
|
|
print $but->singlesubmit7("rel_edit","remove_chk4attr","","margin-left:10px;");
|
|
#print $but->singlesubmit9("dummy","zurück","","ebutton","","");
|
|
print $q->span({-style=>'margin-left:5em; font-size:0.91em;'}, "$u_name / $tpl->{change}");
|
|
print "</td>\n";
|
|
|
|
print $q->Tr();
|
|
print $q->td({-colspan=>'2'}," ");
|
|
print $q->Tr();
|
|
print $q->td({-class=>'tdescr'}, "Service Datenfeldname"),"\n";
|
|
print $q->td({-class=>'tdval'},$q->textfield(-class=>'etxt',-name=>"des", -override=>'1',-default=>"$des_name")),"\n";
|
|
if($key =~ /txt|int/){
|
|
print $q->Tr();
|
|
print $q->td({-class=>'tdescr'}, "Datentyp"),"\n";
|
|
print "<td class='tdval'>\n";
|
|
if($R::key =~ /txt/){
|
|
print $but->radiobox("txt","key_typ","$checked_txt"),"Textzeile\n";
|
|
print $but->radiobox("txt_area","key_typ","$checked_txtarea"),"Textarea\n";
|
|
}elsif($R::key =~ /int/){
|
|
print $but->radiobox("int","key_typ","$checked_int"),"Dezimalzahl\n";
|
|
print $but->radiobox("int_checkbox","key_typ","$checked_intcheck"),"Checkbox\n";
|
|
}
|
|
print "</td>\n";
|
|
}
|
|
print $q->Tr();
|
|
print $q->td({-class=>'tdescr'},"Sortierung"),"\n";
|
|
print $q->td({-class=>'tdval'},$q->textfield(-class=>'etxt', -name=>"asort", -default=>"$asort")),"\n";
|
|
#print $q->Tr();
|
|
#print $q->td({-class=>'tdescr'},"Text Vorauswahl"),"\n";
|
|
#my $pre_values = $q->unescapeHTML("$ctf->{$R::key}");
|
|
#print $q->td({-class=>'tdval'},$q->textarea(-id=>"prev", -class=>'etxt',-style=>"width:300px;",-rows=>"1", -name=>"pre_values",-default=>"$pre_values", -override=>'1')),"\n";
|
|
#print "<script>\$(\"textarea#prev\").autoResize({extraSpace:10});</script>";
|
|
#print $q->hidden(-name=>'cuid_glob', -value=>"$cuid_glob",-override=>'1');
|
|
|
|
#print $q->Tr();
|
|
#print $q->td({-class=>'tdescr',-colspan=>'2'},""),"\n";
|
|
#print $q->Tr();
|
|
#print $q->td({-class=>'tdescr',-colspan=>'2'},"Achtung, das löschen oder ändern verursacht Datenverlust."),"\n";
|
|
|
|
print $q->end_table;
|
|
|
|
print "</div>";
|
|
}
|
|
1;
|
|
|