mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 11:46:27 +01:00
search option for debug-log info by rentaljournal
This commit is contained in:
parent
44d47011af
commit
9e1a56aa83
7 changed files with 84 additions and 173 deletions
|
@ -68,7 +68,7 @@ my $response = {
|
||||||
apiserver => "$apiserver",
|
apiserver => "$apiserver",
|
||||||
response => "$respreq",
|
response => "$respreq",
|
||||||
uri_primary => "$dbt->{primary}->{sharee_primary}->{primaryApp}",
|
uri_primary => "$dbt->{primary}->{sharee_primary}->{primaryApp}",
|
||||||
copri_version => "4.1.23.19",
|
copri_version => "4.1.23.20",
|
||||||
user_id => "",
|
user_id => "",
|
||||||
authcookie => "",
|
authcookie => "",
|
||||||
new_authcoo => "0",
|
new_authcoo => "0",
|
||||||
|
|
|
@ -1109,7 +1109,6 @@ sub insert_contentoid {
|
||||||
my $dbh = shift || $dbh_intern;
|
my $dbh = shift || $dbh_intern;
|
||||||
my $insert = shift;
|
my $insert = shift;
|
||||||
my $reset_keys = shift || "";
|
my $reset_keys = shift || "";
|
||||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
|
||||||
|
|
||||||
if($insert->{table} eq "contentadr" && $reset_keys eq "reset_adropkeys"){
|
if($insert->{table} eq "contentadr" && $reset_keys eq "reset_adropkeys"){
|
||||||
delete $insert->{txt17};#operators
|
delete $insert->{txt17};#operators
|
||||||
|
@ -1167,7 +1166,7 @@ sub insert_contentoid {
|
||||||
my $last_id;
|
my $last_id;
|
||||||
$sth->bind_columns(\$last_id);
|
$sth->bind_columns(\$last_id);
|
||||||
my $c_id = $sth->fetchrow_array();
|
my $c_id = $sth->fetchrow_array();
|
||||||
$bw->log("insert_contentoid $source c_id: $c_id",$sql,"") if($debug);
|
$bw->log("insert_contentoid c_id: $c_id",$sql,"") if($debug);
|
||||||
|
|
||||||
if($insert->{table} =~ /content$|contentadr$|contenttrans$|contenttver$|contentuser$/ && $insert->{main_id} && $insert->{template_id}){
|
if($insert->{table} =~ /content$|contentadr$|contenttrans$|contenttver$|contentuser$/ && $insert->{main_id} && $insert->{template_id}){
|
||||||
my $foreignkey = "";
|
my $foreignkey = "";
|
||||||
|
@ -1179,11 +1178,11 @@ sub insert_contentoid {
|
||||||
my $sql_rel = "INSERT INTO relation (main_id,content_id,template_id,change,$foreignkey) VALUES('$insert->{main_id}','$c_id','$insert->{template_id}','now()','$c_id')";
|
my $sql_rel = "INSERT INTO relation (main_id,content_id,template_id,change,$foreignkey) VALUES('$insert->{main_id}','$c_id','$insert->{template_id}','now()','$c_id')";
|
||||||
my $sth3 = $dbh->prepare($sql_rel);
|
my $sth3 = $dbh->prepare($sql_rel);
|
||||||
$sth3->execute();
|
$sth3->execute();
|
||||||
$bw->log("insert_contentoid relation $source c_id: $c_id",$sql_rel,"") if($debug);
|
$bw->log("insert_contentoid relation c_id: $c_id",$sql_rel,"") if($debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $c_id;
|
return $c_id;
|
||||||
}
|
}#end insert_contentoid
|
||||||
|
|
||||||
|
|
||||||
#delete content
|
#delete content
|
||||||
|
@ -1223,7 +1222,6 @@ sub collect_transpos {
|
||||||
$search->{$key} =~ s/\s$//g;
|
$search->{$key} =~ s/\s$//g;
|
||||||
$where .= " and cp.c_id = $search->{$key}" if(($key eq "c_id" || $key eq "cttpos_id") && $search->{$key});
|
$where .= " and cp.c_id = $search->{$key}" if(($key eq "c_id" || $key eq "cttpos_id") && $search->{$key});
|
||||||
$where .= " and cp.$key ilike '%$search->{$key}%'" if($key eq "txt08" && $search->{$key});
|
$where .= " and cp.$key ilike '%$search->{$key}%'" if($key eq "txt08" && $search->{$key});
|
||||||
$where .= " and cp.$key ilike '%$search->{$key}%'" if($key eq "txt23" && $search->{$key});
|
|
||||||
$where .= " and cp.int04 = $search->{$key}" if($key eq "int04" && looks_like_number($search->{$key}));
|
$where .= " and cp.int04 = $search->{$key}" if($key eq "int04" && looks_like_number($search->{$key}));
|
||||||
$where .= " and cp.int06 = $search->{$key}" if($key eq "int06" && looks_like_number($search->{$key}));
|
$where .= " and cp.int06 = $search->{$key}" if($key eq "int06" && looks_like_number($search->{$key}));
|
||||||
$where .= " and cp.ct_name = '$search->{$key}'" if($key eq "cp_ct_name" && $search->{$key});
|
$where .= " and cp.ct_name = '$search->{$key}'" if($key eq "cp_ct_name" && $search->{$key});
|
||||||
|
@ -1236,6 +1234,11 @@ sub collect_transpos {
|
||||||
$where .= " and cp.$key = $search->{$key}" if($key eq "int12" && looks_like_number($search->{$key}));
|
$where .= " and cp.$key = $search->{$key}" if($key eq "int12" && looks_like_number($search->{$key}));
|
||||||
$where .= " and (cp.$key = $search->{$key} OR cp.owner_end = $search->{$key})" if($key eq "owner" && looks_like_number($search->{$key}));
|
$where .= " and (cp.$key = $search->{$key} OR cp.owner_end = $search->{$key})" if($key eq "owner" && looks_like_number($search->{$key}));
|
||||||
$where .= " and (cp.$key is $search->{$key} OR cp.$key = 0)" if($key eq "int34" && $search->{$key} eq "null");
|
$where .= " and (cp.$key is $search->{$key} OR cp.$key = 0)" if($key eq "int34" && $search->{$key} eq "null");
|
||||||
|
$where .= " and cp.$key ilike '%$search->{$key}%'" if($key eq "txt23" && $search->{$key});
|
||||||
|
#logs,debug,agent,HW
|
||||||
|
if($key eq "txt24" && $search->{$key}){
|
||||||
|
$where .= " and (cp.txt24 ilike '%$search->{txt24}%' OR cp.txt25 ilike '%$search->{txt24}%' OR cp.txt26 ilike '%$search->{txt24}%' OR cp.txt27 ilike '%$search->{txt24}%' OR cp.txt28 ilike '%$search->{txt24}%' OR cp.txt29 ilike '%$search->{txt24}%')";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#adding itime to get also not rental dependent entries
|
#adding itime to get also not rental dependent entries
|
||||||
|
|
|
@ -21,7 +21,6 @@ use Mod::Callib;
|
||||||
use Mod::Libenzdb;
|
use Mod::Libenzdb;
|
||||||
use Mod::Buttons;
|
use Mod::Buttons;
|
||||||
use Lib::Config;
|
use Lib::Config;
|
||||||
use Digest::MD5 qw(md5 md5_hex);
|
|
||||||
use Scalar::Util qw(looks_like_number);
|
use Scalar::Util qw(looks_like_number);
|
||||||
|
|
||||||
my $cf = new Config;
|
my $cf = new Config;
|
||||||
|
@ -441,7 +440,6 @@ sub month_line(){
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($users) = @_;
|
my ($users) = @_;
|
||||||
|
|
||||||
#my $users = $db->select_users($u_id);
|
|
||||||
my $hh;my $mm;
|
my $hh;my $mm;
|
||||||
my $day = strftime "%d", localtime;
|
my $day = strftime "%d", localtime;
|
||||||
my $mon = strftime "%m", localtime;
|
my $mon = strftime "%m", localtime;
|
||||||
|
@ -498,7 +496,6 @@ sub rent_scale(){
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($users,$year_st,$mon_st,$day_st,$hh_st,$mm_st,$year_en,$mon_en,$day_en,$hh_en,$mm_en) = @_;
|
my ($users,$year_st,$mon_st,$day_st,$hh_st,$mm_st,$year_en,$mon_en,$day_en,$hh_en,$mm_en) = @_;
|
||||||
#print "<br />($u_id,$year_st,$mon_st,$day_st,$hh_st,$mm_st,$year_en,$mon_en,$day_en,$hh_en,$mm_en)<br />";
|
#print "<br />($u_id,$year_st,$mon_st,$day_st,$hh_st,$mm_st,$year_en,$mon_en,$day_en,$hh_en,$mm_en)<br />";
|
||||||
#my $users = $db->select_users($u_id);
|
|
||||||
my $hh;my $mm;
|
my $hh;my $mm;
|
||||||
my $day = strftime "%d", localtime;
|
my $day = strftime "%d", localtime;
|
||||||
my $mon = strftime "%m", localtime;
|
my $mon = strftime "%m", localtime;
|
||||||
|
@ -561,32 +558,6 @@ sub rent_scale(){
|
||||||
return ($day_stpx,$rent_day_px);
|
return ($day_stpx,$rent_day_px);
|
||||||
}
|
}
|
||||||
|
|
||||||
#check if barcodeable
|
|
||||||
sub barcodeable(){
|
|
||||||
my $self = shift;
|
|
||||||
my ($table,$number) = @_;
|
|
||||||
my $oGdBar = GD::Barcode->new("Code39", "$number");
|
|
||||||
my $ct_name = $oGdBar->{text};
|
|
||||||
my $barcode = $oGdBar->{text};
|
|
||||||
return ($ct_name,$barcode);
|
|
||||||
}
|
|
||||||
|
|
||||||
#TODO or change to barcode=c_id
|
|
||||||
#get free barcode
|
|
||||||
sub get_freenr(){
|
|
||||||
my $self = shift;
|
|
||||||
my ($table,$barcode_last) = @_;
|
|
||||||
my $freenr = $db->collect_content3($table);
|
|
||||||
my $s_id = $barcode_last;
|
|
||||||
my $e_id = "100000";
|
|
||||||
$freenr->{$s_id}->{barcode} = "1000" if(!$freenr->{$s_id}->{barcode} || $freenr->{$s_id}->{barcode} == 0);
|
|
||||||
for (; $s_id < $e_id; $s_id++){
|
|
||||||
if($freenr->{$s_id}->{barcode} != $s_id){
|
|
||||||
return $s_id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#umst breaking date 16 19 %
|
#umst breaking date 16 19 %
|
||||||
sub umst_breaking(){
|
sub umst_breaking(){
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
@ -627,25 +598,6 @@ sub checkinput(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# input date check. returns english date and 1 if true
|
|
||||||
sub true_date(){
|
|
||||||
my $self = shift;
|
|
||||||
my ($date,$time) = @_;
|
|
||||||
$date =~ s/,/./g;
|
|
||||||
my $d_chck = 0;
|
|
||||||
|
|
||||||
if($date =~ /(\d{4})-(\d{2})-(\d{2})/){
|
|
||||||
$d_chck = 1 if(check_date($1,$2,$3));
|
|
||||||
$date = "$1-$2-$3";
|
|
||||||
}elsif($date =~ /(\d{2})\.(\d{2})\.(\d{4})/){
|
|
||||||
$d_chck = 1 if(check_date($3,$2,$1));
|
|
||||||
$date = "$3-$2-$1";
|
|
||||||
}
|
|
||||||
return ($date,$d_chck);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# input date check
|
# input date check
|
||||||
sub checkdate(){
|
sub checkdate(){
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
@ -666,41 +618,6 @@ sub checkdate(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sub sub4txt(){
|
|
||||||
my $self = shift;
|
|
||||||
my ($txt,$index,$length,$cut,$cut_last) = @_;
|
|
||||||
my $substrtxt = substr($txt, $index, $length);
|
|
||||||
#$substrtxt =~ s/<br \/>/\n/g;
|
|
||||||
#$substrtxt =~ s/<b.?//g;
|
|
||||||
#$substrtxt =~ s/\/>//g;
|
|
||||||
#$substrtxt =~ s/^[<|\\|\/|>|:|,|\.|\\n]+//g;
|
|
||||||
#$substrtxt =~ s/^\w+\s// if($index > 20);
|
|
||||||
|
|
||||||
#entferne das erste teil-wort ...
|
|
||||||
if($cut){
|
|
||||||
$substrtxt =~ s/^[äöü]+//;
|
|
||||||
$substrtxt =~ s/^\w+//;
|
|
||||||
$substrtxt =~ s/^\,//;
|
|
||||||
$substrtxt =~ s/^\.//;
|
|
||||||
}
|
|
||||||
|
|
||||||
#entferne das letzte teil-wort ...
|
|
||||||
if($cut_last){
|
|
||||||
$substrtxt =~ s/[äöü]+$//;
|
|
||||||
$substrtxt =~ s/\w+$//;
|
|
||||||
$substrtxt =~ s/\,$//;
|
|
||||||
$substrtxt =~ s/\.$//;
|
|
||||||
}
|
|
||||||
|
|
||||||
#entferne das letzte teil-wort ...
|
|
||||||
if($index && ($index > $length)){
|
|
||||||
$substrtxt =~ s/\w+$//;
|
|
||||||
}
|
|
||||||
#$substrtxt =~ s/\s\w+$//;
|
|
||||||
return $substrtxt;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub newline(){
|
sub newline(){
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $txtxx = shift || "";
|
my $txtxx = shift || "";
|
||||||
|
@ -781,27 +698,6 @@ sub time4de(){
|
||||||
return $date_de;
|
return $date_de;
|
||||||
}
|
}
|
||||||
|
|
||||||
#error window
|
|
||||||
sub failure(){
|
|
||||||
my $self = shift;
|
|
||||||
my ($failure,$back) = @_;
|
|
||||||
print "<div id='Inhalt3'>\n";
|
|
||||||
print $q->div("$failure");
|
|
||||||
print $q->div($q->a({-class=>"linknav3",-href=>'javascript:history.back()'}, "[ $back ]")) if($back);
|
|
||||||
print "</div>\n";
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub failure2(){
|
|
||||||
my $self = shift;
|
|
||||||
my ($failure,$back) = @_;
|
|
||||||
print "<div style='background-color:white;'>\n";
|
|
||||||
print $q->div("$failure");
|
|
||||||
print $q->div($q->a({-class=>"linknav3",-href=>'javascript:history.back()'}, "[ $back ]")) if($back);
|
|
||||||
print "</div>\n";
|
|
||||||
#exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub failure3(){
|
sub failure3(){
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($failure,$back) = @_;
|
my ($failure,$back) = @_;
|
||||||
|
@ -811,35 +707,6 @@ sub failure3(){
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
#for site-head navigation with breadcrumb and close button
|
|
||||||
sub pathrun(){
|
|
||||||
my $self = shift;
|
|
||||||
my $path = shift;
|
|
||||||
my @menu = ("");
|
|
||||||
if($path =~ /^\/(.*)/){
|
|
||||||
@menu = split /\//,$1;
|
|
||||||
}
|
|
||||||
my $node_active;
|
|
||||||
my $crumb;
|
|
||||||
my $h=0;
|
|
||||||
my $backlink;
|
|
||||||
foreach(@menu){
|
|
||||||
$node_active=$_;
|
|
||||||
$crumb = "<a style='text-decoration:none;' href='/$menu[0]'>$menu[0]</a>" if($h==0);
|
|
||||||
$backlink = "/" if($h==0);
|
|
||||||
$crumb .= " | <a style='text-decoration:none;' href='/$menu[0]/$menu[1]'>$menu[1]</a>" if($h==1);
|
|
||||||
$backlink = "/$menu[0]#$menu[1]" if($h==1);
|
|
||||||
#cut long link-name
|
|
||||||
my $length=length($menu[2]);
|
|
||||||
my $cut_last;
|
|
||||||
$cut_last = 1 if($length >= 30);
|
|
||||||
my $menu2 = &sub4txt("",$menu[2],0,30,"","$cut_last");
|
|
||||||
$crumb .= " | <a style='text-decoration:none;' href='/$menu[0]/$menu[1]/$menu[2]'>$menu2</a>" if($h==2);
|
|
||||||
$backlink = "/$menu[0]/$menu[1]#$menu[2]" if($h==2);
|
|
||||||
$h++;
|
|
||||||
}
|
|
||||||
return ("$node_active","$crumb","$backlink");
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ use DateTime;
|
||||||
use DateTime::Format::Pg;
|
use DateTime::Format::Pg;
|
||||||
use Text::CSV_XS;
|
use Text::CSV_XS;
|
||||||
use Lib::Config;
|
use Lib::Config;
|
||||||
use Mod::Libenzdb;
|
|
||||||
use Mod::Libenz;
|
use Mod::Libenz;
|
||||||
use Mod::DBtank;
|
use Mod::DBtank;
|
||||||
use Mod::Basework;
|
use Mod::Basework;
|
||||||
|
@ -26,7 +25,6 @@ use Mod::APIsigclient;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
my $cf = new Config;
|
my $cf = new Config;
|
||||||
my $db = new Libenzdb;
|
|
||||||
my $lb = new Libenz;
|
my $lb = new Libenz;
|
||||||
my $dbt = new DBtank;
|
my $dbt = new DBtank;
|
||||||
my $bw = new Basework;
|
my $bw = new Basework;
|
||||||
|
@ -921,7 +919,7 @@ sub set_workflow {
|
||||||
|
|
||||||
#position copy
|
#position copy
|
||||||
if($c_idnew > 0){
|
if($c_idnew > 0){
|
||||||
my ($cttpos,$rows) = $db->collect_contentpos("contenttrans",$c_id);
|
my ($cttpos,$rows) = $dbt->collect_contentpos($dbh,"contenttrans",$c_id);
|
||||||
foreach my $id (sort { $cttpos->{$a}->{c_id} <=> $cttpos->{$b}->{c_id} } keys(%$cttpos)){
|
foreach my $id (sort { $cttpos->{$a}->{c_id} <=> $cttpos->{$b}->{c_id} } keys(%$cttpos)){
|
||||||
#reverse pos sum for example by Storno
|
#reverse pos sum for example by Storno
|
||||||
$cttpos->{$id}->{int01} = $cttpos->{$id}->{int01} * -1 if($cttpos->{$id}->{int01} != 0);
|
$cttpos->{$id}->{int01} = $cttpos->{$id}->{int01} * -1 if($cttpos->{$id}->{int01} != 0);
|
||||||
|
@ -943,11 +941,17 @@ sub set_workflow {
|
||||||
$i_rows += 1 if($ctpos_id > 0);
|
$i_rows += 1 if($ctpos_id > 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$db->update_users4trans($c_idnew,"218","",$users_dms->{u_id});
|
my $update_users = {
|
||||||
|
table => "users",
|
||||||
|
change => "no_time",
|
||||||
|
u_id => $users_dms->{u_id}
|
||||||
|
};
|
||||||
|
$dbt->update_one($dbh,$update_users,"c_id4trans=$c_idnew,tpl_id4trans=218");
|
||||||
|
|
||||||
print redirect("$varenv{wwwhost}/DMS/Faktura?ct_trans=open\&c_id4trans=$c_idnew\&tpl_id4trans=218\&owner=$users_dms->{u_id}\&offset=$R::offset\&limit=$R::limit\&return=$i_rows-$u_rows-$d_rows");
|
print redirect("$varenv{wwwhost}/DMS/Faktura?ct_trans=open\&c_id4trans=$c_idnew\&tpl_id4trans=218\&owner=$users_dms->{u_id}\&offset=$R::offset\&limit=$R::limit\&return=$i_rows-$u_rows-$d_rows");
|
||||||
exit 0;
|
exit 0;
|
||||||
|
}
|
||||||
}#end set_workflow
|
}#end set_workflow
|
||||||
|
|
||||||
|
|
||||||
|
@ -1005,7 +1009,12 @@ sub set_accounting2invoice {
|
||||||
$i_rows = 1 if($c_idnew);
|
$i_rows = 1 if($c_idnew);
|
||||||
#taking just same (operator_accounting) invoices detected by int10=2
|
#taking just same (operator_accounting) invoices detected by int10=2
|
||||||
|
|
||||||
$db->update_users4trans($c_idnew,"218","",$users_dms->{u_id});
|
my $update_users = {
|
||||||
|
table => "users",
|
||||||
|
change => "no_time",
|
||||||
|
u_id => $users_dms->{u_id}
|
||||||
|
};
|
||||||
|
$dbt->update_one($dbh,$update_users,"c_id4trans=$c_idnew,tpl_id4trans=218");
|
||||||
|
|
||||||
my $uri_path = $dbt->recurse_node($dbh,$node->{main_id});
|
my $uri_path = $dbt->recurse_node($dbh,$node->{main_id});
|
||||||
print "$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows\n";
|
print "$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows\n";
|
||||||
|
@ -1542,7 +1551,12 @@ sub operator_accounting {
|
||||||
$dbt->update_sql($dbh,"UPDATE contenttrans set int20='$ctt->{c_id}' where c_id IN ($ck4ex)");
|
$dbt->update_sql($dbh,"UPDATE contenttrans set int20='$ctt->{c_id}' where c_id IN ($ck4ex)");
|
||||||
print FILE "UPDATE contenttrans set int20='$ctt->{c_id}' where c_id IN ($ck4ex)\n";
|
print FILE "UPDATE contenttrans set int20='$ctt->{c_id}' where c_id IN ($ck4ex)\n";
|
||||||
|
|
||||||
$db->update_users4trans($c_idnew,"208","",$users_dms->{u_id});
|
my $update_users = {
|
||||||
|
table => "users",
|
||||||
|
change => "no_time",
|
||||||
|
u_id => $users_dms->{u_id}
|
||||||
|
};
|
||||||
|
$dbt->update_one($dbh,$update_users,"c_id4trans=$c_idnew,tpl_id4trans=208");
|
||||||
}
|
}
|
||||||
|
|
||||||
my $uri_path = $dbt->recurse_node($dbh,$node->{main_id});
|
my $uri_path = $dbt->recurse_node($dbh,$node->{main_id});
|
||||||
|
|
|
@ -10,7 +10,6 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use POSIX;
|
use POSIX;
|
||||||
use CGI; # only for debugging
|
use CGI; # only for debugging
|
||||||
use Mod::Libenzdb;
|
|
||||||
use Mod::Libenz;
|
use Mod::Libenz;
|
||||||
use Mod::DBtank;
|
use Mod::DBtank;
|
||||||
use Mod::Buttons;
|
use Mod::Buttons;
|
||||||
|
@ -29,7 +28,6 @@ use Data::Dumper;
|
||||||
|
|
||||||
my $cf = new Config;
|
my $cf = new Config;
|
||||||
my $but = new Buttons;
|
my $but = new Buttons;
|
||||||
my $db = new Libenzdb;
|
|
||||||
my $lb = new Libenz;
|
my $lb = new Libenz;
|
||||||
my $dbt = new DBtank;
|
my $dbt = new DBtank;
|
||||||
my $apif = new APIfunc;
|
my $apif = new APIfunc;
|
||||||
|
@ -115,13 +113,22 @@ sub delete_account {
|
||||||
sub create_account(){
|
sub create_account(){
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $owner = shift;
|
my $owner = shift;
|
||||||
my $table = "contentadr";
|
my $dbh = "";
|
||||||
|
|
||||||
|
my $insert_adr = {
|
||||||
|
table => "contentadr",
|
||||||
|
template_id => 202,
|
||||||
|
main_id => 200011,
|
||||||
|
mtime => 'now()',
|
||||||
|
owner => $owner,
|
||||||
|
int20 => $owner,
|
||||||
|
};
|
||||||
|
my $c_idnew = $dbt->insert_contentoid($dbh,$insert_adr,"");
|
||||||
|
my $ctadr = { c_id => $c_idnew };
|
||||||
|
$insert_adr->{ct_name} = $c_idnew;
|
||||||
|
$insert_adr->{barcode} = $c_idnew;
|
||||||
|
$dbt->update_record($dbh,$insert_adr,$ctadr);
|
||||||
|
|
||||||
my $c_idnew = $db->insert_content($table);
|
|
||||||
$db->updater("$table","c_id",$c_idnew,"ct_name","$c_idnew","$owner");
|
|
||||||
$db->updater("$table","c_id",$c_idnew,"barcode","$c_idnew","$owner");
|
|
||||||
$db->updater("$table","c_id",$c_idnew,"int20","$owner","$owner");
|
|
||||||
my $rel_idnew = $db->insert_relationlist($table,"200011","de",$c_idnew,"202","ca_id");
|
|
||||||
return $c_idnew;
|
return $c_idnew;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ sub tpl(){
|
||||||
|
|
||||||
my $lang = "de";
|
my $lang = "de";
|
||||||
my @tpl_order = ('c_id=ID=5=Datensatz ID (nur intern)','date_time=Mietzeit','txt08=Name=15','int06=Start Station=5','int04=End Station=5','barcode=Bike Nr.=5','int12=Group=select','int10=Rental State=select','int20=Lock State=select','owner=User=select','txt23=Comment=15');
|
my @tpl_order = ('c_id=ID=5=Datensatz ID (nur intern)','date_time=Mietzeit','txt08=Name=15','int06=Start Station=5','int04=End Station=5','barcode=Bike Nr.=5','int12=Group=select','int10=Rental State=select','int20=Lock State=select','owner=User=select','txt23=Comment=15');
|
||||||
|
push (@tpl_order, "txt24=debug,log,agent,HW") if($users_dms->{int03} > 1);
|
||||||
|
|
||||||
my %varenv = $cf->envonline();
|
my %varenv = $cf->envonline();
|
||||||
my %ib = $but->ibuttons();
|
my %ib = $but->ibuttons();
|
||||||
|
@ -139,7 +140,7 @@ sub tpl(){
|
||||||
print $q->end_form;
|
print $q->end_form;
|
||||||
print $q->start_form();
|
print $q->start_form();
|
||||||
|
|
||||||
print "<div id='Content4cal' style='min-width: 1400px;'>\n";
|
print "<div id='Content4cal' style='min-width: 1450px;'>\n";
|
||||||
|
|
||||||
my $start_date_time = $R::start_date_time;
|
my $start_date_time = $R::start_date_time;
|
||||||
my $end_date_time = $R::end_date_time;
|
my $end_date_time = $R::end_date_time;
|
||||||
|
@ -200,7 +201,6 @@ sub tpl(){
|
||||||
$search->{cttpos_id} = $q->escapeHTML("$R::cttpos_id");
|
$search->{cttpos_id} = $q->escapeHTML("$R::cttpos_id");
|
||||||
$search->{txt06} = $q->escapeHTML("$R::txt06");
|
$search->{txt06} = $q->escapeHTML("$R::txt06");
|
||||||
$search->{txt08} = $q->escapeHTML("$R::txt08");
|
$search->{txt08} = $q->escapeHTML("$R::txt08");
|
||||||
$search->{txt23} = $q->escapeHTML("$R::txt23");
|
|
||||||
$search->{int04} = $q->escapeHTML("$R::int04");
|
$search->{int04} = $q->escapeHTML("$R::int04");
|
||||||
$search->{int06} = $q->escapeHTML("$R::int06");
|
$search->{int06} = $q->escapeHTML("$R::int06");
|
||||||
$search->{int12} = $q->escapeHTML("$R::int12");
|
$search->{int12} = $q->escapeHTML("$R::int12");
|
||||||
|
@ -212,6 +212,8 @@ sub tpl(){
|
||||||
$search->{ct_txt06} = $q->escapeHTML("$R::ct_txt06");#PLZ
|
$search->{ct_txt06} = $q->escapeHTML("$R::ct_txt06");#PLZ
|
||||||
$search->{ct_ct_name} = $q->escapeHTML("$R::ct_ct_name");
|
$search->{ct_ct_name} = $q->escapeHTML("$R::ct_ct_name");
|
||||||
$search->{owner} = $q->escapeHTML("$R::owner");
|
$search->{owner} = $q->escapeHTML("$R::owner");
|
||||||
|
$search->{txt23} = $q->escapeHTML("$R::txt23");
|
||||||
|
$search->{txt24} = $q->escapeHTML("$R::txt24");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$start_chck && !$end_chck){
|
if(!$start_chck && !$end_chck){
|
||||||
|
@ -261,7 +263,7 @@ sub tpl(){
|
||||||
#$h++;
|
#$h++;
|
||||||
my ($key,$des,$size) = split /=/,$_;
|
my ($key,$des,$size) = split /=/,$_;
|
||||||
my $valxx = $q->param("$key") || "";
|
my $valxx = $q->param("$key") || "";
|
||||||
$valxx = "" if($R::base_edit eq "save_pos" && $key ne "barcode");#empty search fields, select only bike number
|
$valxx = "" if(($R::base_edit eq "save_pos") || ($R::base_edit eq "transpos"));#empty search fields, select only bike number
|
||||||
|
|
||||||
if($key =~ /time/){
|
if($key =~ /time/){
|
||||||
$size="10px";
|
$size="10px";
|
||||||
|
@ -472,6 +474,16 @@ sub tpl(){
|
||||||
my $comment_view = "";
|
my $comment_view = "";
|
||||||
$comment_view = "→ $comment" if($comment);
|
$comment_view = "→ $comment" if($comment);
|
||||||
|
|
||||||
|
my $debug_log_view = "";
|
||||||
|
if($search->{txt24}){
|
||||||
|
my $debug_log = "appapi-log: $cttpos->{$pid}->{txt24} | sigapi-log: $cttpos->{$pid}->{txt25} | user-agent: $cttpos->{$pid}->{txt26} | app-debug: $cttpos->{$pid}->{txt27} | lock-HW: $cttpos->{$pid}->{txt28} | response-log: $cttpos->{$pid}->{txt29}";
|
||||||
|
my $index = index(lc($debug_log), lc($search->{txt24}));
|
||||||
|
$index -= 20;
|
||||||
|
$debug_log = "... " . substr($debug_log,$index,100) . " ...";
|
||||||
|
$debug_log_view = "→ debug-log: $debug_log" if($debug_log);
|
||||||
|
$debug_log_view =~ s/($search->{txt24})/<span style=\'color:#FF5F1F;\'>$1<\/span>/i;
|
||||||
|
}
|
||||||
|
|
||||||
my $kunde = "$cttpos->{$pid}->{txt08}";
|
my $kunde = "$cttpos->{$pid}->{txt08}";
|
||||||
if($users_dms_primary->{u_id} && $users_dms->{u_id} && $users_dms->{int02} >= 1){
|
if($users_dms_primary->{u_id} && $users_dms->{u_id} && $users_dms->{int02} >= 1){
|
||||||
$kunde = $q->a({-class=>"linknav3",-style=>"$part_style",-href=>"/DMS/Kunden/?detail_search=1&s_c_id=$cttpos->{$pid}->{ca_id}",-title=>"Kunde im Kundenstamm"},"$cttpos->{$pid}->{txt08} ($cttpos->{$pid}->{ca_id})");#2021-05-24 saves kd name
|
$kunde = $q->a({-class=>"linknav3",-style=>"$part_style",-href=>"/DMS/Kunden/?detail_search=1&s_c_id=$cttpos->{$pid}->{ca_id}",-title=>"Kunde im Kundenstamm"},"$cttpos->{$pid}->{txt08} ($cttpos->{$pid}->{ca_id})");#2021-05-24 saves kd name
|
||||||
|
@ -483,11 +495,11 @@ sub tpl(){
|
||||||
$part_path = "Prepaid" if($cttpos->{$pid}->{template_id} == 219);
|
$part_path = "Prepaid" if($cttpos->{$pid}->{template_id} == 219);
|
||||||
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id → $start_time → $part_path Nr. $bikenr → $kunde → $u_name/$u_name_end $comment_view"),"\n";
|
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id → $start_time → $part_path Nr. $bikenr → $kunde → $u_name/$u_name_end $comment_view"),"\n";
|
||||||
}else{
|
}else{
|
||||||
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id → <span style='$time_style'>$start_time – $end_time</span> → $kunde → Start Station $start_station → End Station $end_station → Bike $bikenr $status $lock_state → $u_name/$u_name_end<br /><span style='padding-left:60px;'>$charge $track_info $comment_view</span>"),"\n";
|
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id → <span style='$time_style'>$start_time – $end_time</span> → $kunde → Start Station $start_station → End Station $end_station → Bike $bikenr $status $lock_state → $u_name/$u_name_end<br /><span style='padding-left:60px;'>$charge $track_info $comment_view $debug_log_view</span>"),"\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($users_dms_primary->{u_id} && $users_dms->{u_id} && $users_dms->{int03} >= 1){
|
if($users_dms_primary->{u_id} && $users_dms->{u_id} && $users_dms->{int03} >= 1){
|
||||||
print $q->div({-style=>'float:left;margin-left:1em;'}, "→ Faktura", $q->a({-class=>"linknav3",-style=>"$trans_style",-href=>"/DMS/Faktura?ct_trans=open\&c_id4trans=$c_id4trans\&tpl_id4trans=$tpl_id4trans\&owner=$users_dms->{owner}",-title=>"Faktura Terminal öffnen"},"$opos \#$ct_name")),"\n" if($c_id4trans && $tpl_id4trans);
|
print $q->div({-style=>'float:left;margin:0.4em 0 0 1em;'}, "→ Faktura", $q->a({-class=>"linknav3",-style=>"$trans_style",-href=>"/DMS/Faktura?ct_trans=open\&c_id4trans=$c_id4trans\&tpl_id4trans=$tpl_id4trans\&owner=$users_dms->{owner}",-title=>"Faktura Terminal öffnen"},"$opos \#$ct_name")),"\n" if($c_id4trans && $tpl_id4trans);
|
||||||
print $q->div({-style=>'float:left;margin-left:1em;'}, "$user_device"),"\n";
|
print $q->div({-style=>'float:left;margin-left:1em;'}, "$user_device"),"\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,14 +12,12 @@ use Config::General;
|
||||||
use Mod::Buttons;
|
use Mod::Buttons;
|
||||||
use Mod::Basework;
|
use Mod::Basework;
|
||||||
use Mod::Libenz;
|
use Mod::Libenz;
|
||||||
use Mod::Libenzdb;
|
|
||||||
use Mod::DBtank;
|
use Mod::DBtank;
|
||||||
use POSIX;
|
use POSIX;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
my $bw = new Basework;
|
my $bw = new Basework;
|
||||||
my $lb = new Libenz;
|
my $lb = new Libenz;
|
||||||
my $db = new Libenzdb;
|
|
||||||
my $dbt = new DBtank;
|
my $dbt = new DBtank;
|
||||||
my $but = new Buttons;
|
my $but = new Buttons;
|
||||||
|
|
||||||
|
@ -52,10 +50,9 @@ sub tpl(){
|
||||||
}
|
}
|
||||||
my $coo = $q->cookie(-name=>'domcookie');
|
my $coo = $q->cookie(-name=>'domcookie');
|
||||||
my $debug = "";
|
my $debug = "";
|
||||||
my $lang = "de";
|
my $dbh = "";
|
||||||
my @viewsel = split /\//,$1 if($path =~ /^\/(.*)/);
|
my @viewsel = split /\//,$1 if($path =~ /^\/(.*)/);
|
||||||
my $view_root = $viewsel[0] || "";
|
my $view_root = $viewsel[0] || "";
|
||||||
my $mandant = $db->get_node("$view_root","$lang");
|
|
||||||
my $parent_id = $node_meta->{parent_id};
|
my $parent_id = $node_meta->{parent_id};
|
||||||
my $main_id = $node_meta->{main_id};
|
my $main_id = $node_meta->{main_id};
|
||||||
|
|
||||||
|
@ -86,7 +83,15 @@ sub tpl(){
|
||||||
}elsif($R::go && $R::go eq "forward_list"){
|
}elsif($R::go && $R::go eq "forward_list"){
|
||||||
$offset += $limit;
|
$offset += $limit;
|
||||||
}
|
}
|
||||||
my $ctrel = $db->get_ctrel($table,"",$lang,"",$users_dms->{c_id4trans},$users_dms->{tpl_id4trans});
|
|
||||||
|
my $pref = {
|
||||||
|
table => "contenttrans",
|
||||||
|
fetch => "one",
|
||||||
|
template_id => $users_dms->{tpl_id4trans},
|
||||||
|
c_id => $users_dms->{c_id4trans},
|
||||||
|
};
|
||||||
|
my $ctrel = $dbt->fetch_record($dbh,$pref);
|
||||||
|
|
||||||
print $q->div({-id=>'Headerlogin',-style=>"background-color:#f7ae37;"},$q->a({-class=>'elinkbutton1',-title=>"Faktura Terminal öffnen",-href=>"$varenv->{wwwhost}/DMS/Faktura?ct_trans=open\&c_id4trans=$users_dms->{c_id4trans}\&tpl_id4trans=$users_dms->{tpl_id4trans}\&owner=$users_dms->{owner}\&offset=$offset\&limit=$limit\&relids=$R::relids\&no_redirect=1"}," Faktura \#$ctrel->{ct_name} $ctrel->{txt01}", $q->span({-id=>"c_id4trans", -style=>"color:#f7ae37"}, "$users_dms->{c_id4trans}"))) if($ctrel->{ct_name});
|
print $q->div({-id=>'Headerlogin',-style=>"background-color:#f7ae37;"},$q->a({-class=>'elinkbutton1',-title=>"Faktura Terminal öffnen",-href=>"$varenv->{wwwhost}/DMS/Faktura?ct_trans=open\&c_id4trans=$users_dms->{c_id4trans}\&tpl_id4trans=$users_dms->{tpl_id4trans}\&owner=$users_dms->{owner}\&offset=$offset\&limit=$limit\&relids=$R::relids\&no_redirect=1"}," Faktura \#$ctrel->{ct_name} $ctrel->{txt01}", $q->span({-id=>"c_id4trans", -style=>"color:#f7ae37"}, "$users_dms->{c_id4trans}"))) if($ctrel->{ct_name});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,7 +162,7 @@ sub tpl(){
|
||||||
print "<span class='navbar-toggler-icon'></span>\n";
|
print "<span class='navbar-toggler-icon'></span>\n";
|
||||||
print "</button>\n";
|
print "</button>\n";
|
||||||
print $q->div({-id=>'Headerlogo'},$q->a({-class=>'navbar-brand',-style=>"color:black;",-href=>"$varenv->{wwwhost}"}, $q->img({ -style=>"height:25px",-src=>"$varenv->{head_logo}"}), "$coprihome" ,$q->div({-style=>'font-size:0.71em;'}, "$title"))),"\n";
|
print $q->div({-id=>'Headerlogo'},$q->a({-class=>'navbar-brand',-style=>"color:black;",-href=>"$varenv->{wwwhost}"}, $q->img({ -style=>"height:25px",-src=>"$varenv->{head_logo}"}), "$coprihome" ,$q->div({-style=>'font-size:0.71em;'}, "$title"))),"\n";
|
||||||
my $node = $db->collect_noderel($dbt->{shareedms_conf}->{parent_id},$lang,$users_dms->{u_id});
|
my ($node,$rows) = $dbt->collect_noderel($dbh,$dbt->{shareedms_conf}->{parent_id},"");
|
||||||
|
|
||||||
print "<div class='collapse navbar-collapse' id='navbarsDefault'>\n";
|
print "<div class='collapse navbar-collapse' id='navbarsDefault'>\n";
|
||||||
print "<ul class='navbar-nav me-auto mb-2 mb-md-0' style='padding:0 20px;text-align:left;'>\n";
|
print "<ul class='navbar-nav me-auto mb-2 mb-md-0' style='padding:0 20px;text-align:left;'>\n";
|
||||||
|
@ -192,7 +197,7 @@ sub tpl(){
|
||||||
|
|
||||||
#1. submenu
|
#1. submenu
|
||||||
my $subs1=0;
|
my $subs1=0;
|
||||||
my $node1 = $db->collect_noderel($node->{$id}->{main_id},$lang,$users_dms->{u_id});
|
my ($node1,$rows1) = $dbt->collect_noderel($dbh,$node->{$id}->{main_id},"");
|
||||||
foreach my $id1 (sort {$node1->{$a}->{n_sort} <=> $node1->{$b}->{n_sort}} keys (%$node1)){
|
foreach my $id1 (sort {$node1->{$a}->{n_sort} <=> $node1->{$b}->{n_sort}} keys (%$node1)){
|
||||||
$subs1=1 if($node1->{$id1}->{main_id});
|
$subs1=1 if($node1->{$id1}->{main_id});
|
||||||
}
|
}
|
||||||
|
@ -207,7 +212,7 @@ sub tpl(){
|
||||||
foreach my $id1 (sort {$node1->{$a}->{n_sort} <=> $node1->{$b}->{n_sort}} keys (%$node1)){
|
foreach my $id1 (sort {$node1->{$a}->{n_sort} <=> $node1->{$b}->{n_sort}} keys (%$node1)){
|
||||||
#hide Operator- and Kunden-Faktura config or be primary admin
|
#hide Operator- and Kunden-Faktura config or be primary admin
|
||||||
if(($node1->{$id1}->{template_id} !~ /196|201/) || ($users_dms_primary->{u_id} && $users_dms_primary->{int02} >= 1)){
|
if(($node1->{$id1}->{template_id} !~ /196|201/) || ($users_dms_primary->{u_id} && $users_dms_primary->{int02} >= 1)){
|
||||||
my $node2 = $db->collect_noderel($node1->{$id1}->{main_id},$lang,$users_dms->{u_id});
|
my ($node2,$rows2) = $dbt->collect_noderel($dbh,$node1->{$id1}->{main_id},"");
|
||||||
$topath = "/$viewsel[0]/$node->{$id}->{node_name}";
|
$topath = "/$viewsel[0]/$node->{$id}->{node_name}";
|
||||||
$mclass = "";
|
$mclass = "";
|
||||||
$mstyle = "";
|
$mstyle = "";
|
||||||
|
@ -228,10 +233,13 @@ sub tpl(){
|
||||||
if(ref($node2) eq "HASH"){
|
if(ref($node2) eq "HASH"){
|
||||||
my $lmenu2;
|
my $lmenu2;
|
||||||
foreach my $id2 (sort {$node2->{$a}->{n_sort} <=> $node2->{$b}->{n_sort}} keys (%$node2)){
|
foreach my $id2 (sort {$node2->{$a}->{n_sort} <=> $node2->{$b}->{n_sort}} keys (%$node2)){
|
||||||
my $parent_node4rel = $db->get_node4rel($node2->{$id2}->{parent_id},"","","null");
|
my $noderef = {
|
||||||
#because of don't view Service Attribut on Einste.
|
main_id => $node2->{$id2}->{parent_id},
|
||||||
|
content_id => 'null',
|
||||||
|
fetch => 'one',
|
||||||
|
};
|
||||||
|
my $parent_node4rel = $dbt->fetch_rel4tpl4nd($dbh,$noderef);
|
||||||
if($parent_node4rel->{template_id} =~ /205|225|194/){
|
if($parent_node4rel->{template_id} =~ /205|225|194/){
|
||||||
#if(1==1){
|
|
||||||
$mclass = "";
|
$mclass = "";
|
||||||
$mstyle = "";
|
$mstyle = "";
|
||||||
if("$node2->{$id2}->{node_name}" eq "$viewsel[3]"){
|
if("$node2->{$id2}->{node_name}" eq "$viewsel[3]"){
|
||||||
|
@ -305,7 +313,7 @@ sub tplselect(){
|
||||||
my $feedb_req = shift || {};
|
my $feedb_req = shift || {};
|
||||||
|
|
||||||
my $sort = "";
|
my $sort = "";
|
||||||
my $lang = "de";
|
my $dbh = "";
|
||||||
my $tpl_name = $node_meta->{tpl_name};
|
my $tpl_name = $node_meta->{tpl_name};
|
||||||
my $tpl_id = $node_meta->{tpl_id};
|
my $tpl_id = $node_meta->{tpl_id};
|
||||||
my $ct_table = $node_meta->{ct_table};
|
my $ct_table = $node_meta->{ct_table};
|
||||||
|
|
Loading…
Add table
Reference in a new issue