mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2024-11-15 23:26:34 +01:00
248 lines
10 KiB
Perl
Executable file
248 lines
10 KiB
Perl
Executable file
package AccountSubmenu;
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
# Copyright (c) Rainer Gümpelein, TeilRad GmbH
|
|
#
|
|
use strict;
|
|
use warnings;
|
|
use POSIX;
|
|
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 $self = shift;
|
|
my $node_meta = shift;
|
|
my $users_dms = shift || "";
|
|
my $mode = shift || "";
|
|
my $varenv = shift;
|
|
my $users_sharee = shift || "";
|
|
my $return = shift || "";
|
|
|
|
my $q = new CGI;
|
|
my $cf = new Config;
|
|
my $but = new Buttons;
|
|
my $lb = new Libenz;
|
|
my $db = new Libenzdb;
|
|
my $dbt = new DBtank;
|
|
|
|
my $lang = "de";
|
|
my $script = $q->script_name();
|
|
my $path_info = $q->path_info();
|
|
my $path = $path_info;
|
|
#with meta_host,
|
|
if("$varenv->{metahost}"){
|
|
$path = "$script" . "$path_info";
|
|
$script="";
|
|
}
|
|
|
|
my $session="";
|
|
if($R::sessionid && length($R::sessionid) > 20){
|
|
$session = "?sessionid=$R::sessionid";
|
|
}
|
|
|
|
my @viewsel = split /\//,$1 if($path =~ /^\/(.*)/);
|
|
|
|
#my $coo = $q->cookie(-name=>'domcookie') || $R::sessionid || "";
|
|
my $coo = $R::authcookie || $R::sessionid || "";
|
|
#my $merchant_id = "";
|
|
#$merchant_id = $coo if($coo && length($coo) <= 10);
|
|
#$merchant_id = $1 if($coo =~ /_(\w+)$/);
|
|
|
|
my $bgcolor1 = "009899";#sharee
|
|
#my $bgcolor1 = "e2001a";
|
|
|
|
$bgcolor1 = $dbt->{website}->{$varenv->{syshost}}->{bgcolor1} if($dbt->{website}->{$varenv->{syshost}}->{bgcolor1});
|
|
|
|
#$bgcolor1 = $dbt->{merchant_ids}->{$merchant_id}->{bgcolor1} if($merchant_id && $dbt->{merchant_ids}->{$merchant_id}->{bgcolor1});
|
|
$bgcolor1 = $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{bgcolor1} if($dbt->{merchant_ids}->{$varenv->{merchant_id}}->{bgcolor1});
|
|
|
|
#payable check
|
|
my $payable_check=0;
|
|
if(($users_sharee->{int03} == 1 && $users_sharee->{ct_name} =~ /\w{2}-\d+/) || ($users_sharee->{int03} == 2 && length($users_sharee->{ct_name}) >= 19)){
|
|
$payable_check=1;
|
|
}
|
|
my $node1 = $db->collect_node($node_meta->{parent_id},$lang,"1");
|
|
|
|
#bootstrap 5 with standalone bayern
|
|
if($varenv->{syshost} eq "shareeweb-bayern"){
|
|
|
|
#subMenue--------
|
|
print "<style>
|
|
ul#AccNavi {
|
|
position:relative;
|
|
display:flex;
|
|
margin-left: -32px;
|
|
}
|
|
ul#AccNavi li {
|
|
list-style: none;
|
|
display: inline;
|
|
margin-right:20px;
|
|
}
|
|
ul#AccNavi li a {
|
|
display:flex;
|
|
text-align:center;
|
|
align-itmes;center;
|
|
justify-content:center;
|
|
transition: all 0.3s ease;
|
|
margin: 0;
|
|
padding: 1em;
|
|
height: auto;
|
|
background-color: #$bgcolor1;
|
|
font-family:Arial,sans-serif;
|
|
text-decoration: none;
|
|
font-weight: normal;
|
|
color: white;
|
|
}
|
|
ul#AccNavi a:hover {
|
|
color: black;
|
|
background-color: white;
|
|
}
|
|
ul#AccNavi a:active {
|
|
color: white;
|
|
background-color: gray;
|
|
}
|
|
</style>\n";
|
|
|
|
#print "<div style='margin-top:40px;'>\n";
|
|
print "<ul id='AccNavi'>\n";
|
|
foreach my $id1 (sort {$node1->{$a}->{n_sort} <=> $node1->{$b}->{n_sort}} keys (%$node1)){
|
|
#Creditcard test switch for payone (tinkwwp)
|
|
if($users_sharee->{c_id} && ($path =~ /$varenv->{mandant}\/$varenv->{profile}/ || $path =~ /$varenv->{mandant}\/Account/)){
|
|
my $mstyle_1="";
|
|
my $mstyle_1_5="";
|
|
my $mstyle_2="";
|
|
my $mstyle_3="";
|
|
|
|
if($node_meta->{main_id} == $node1->{$id1}->{main_id}){
|
|
$mstyle_1 .= "background-color: silver;" if("$node1->{$id1}->{node_name}" eq "$varenv->{accounting_1}");
|
|
$mstyle_1_5 .= "background-color: silver;" if("$node1->{$id1}->{node_name}" eq "$varenv->{accounting_1_5}");
|
|
$mstyle_2 .= "background-color: silver;" if("$node1->{$id1}->{node_name}" eq "$varenv->{accounting_2}");
|
|
$mstyle_3 .= "background-color: silver;" if("$node1->{$id1}->{node_name}" eq "$varenv->{accounting_3}");
|
|
|
|
#Konrad & TINK & sharee AGB
|
|
if(!$users_sharee->{int14} && !$users_sharee->{int15} && !$users_sharee->{txt30}){
|
|
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$node1->{$id1}->{node_name}", -href=>"/$viewsel[0]/Account/$node1->{$id1}->{node_name}$session"}, "$node1->{$id1}->{node_name}")),"\n";
|
|
}
|
|
elsif(!$users_sharee->{int03}){
|
|
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$varenv->{accounting_1}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1}$session"}, $q->span({-class=>"bi bi-file-earmark-person"}))),"\n";
|
|
print $q->li($q->a({-style=>"$mstyle_1_5",-title=>"$varenv->{accounting_1_5}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1_5}$session"}, $q->span({-class=>"bi bi-credit-card"}))),"\n";
|
|
}
|
|
elsif($payable_check){
|
|
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$varenv->{accounting_1}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1}$session"}, $q->span({-class=>"bi bi-file-earmark-person"}))),"\n";
|
|
print $q->li($q->a({-style=>"$mstyle_1_5",-title=>"$varenv->{accounting_1_5}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1_5}$session"}, $q->span({-class=>"bi bi-credit-card"}))),"\n";
|
|
print $q->li($q->a({-style=>"$mstyle_2",-title=>"$varenv->{accounting_2}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_2}$session"},$q->span({-class=>"bi bi-cash"}))),"\n";
|
|
print $q->li($q->a({-style=>"$mstyle_3",-title=>"$varenv->{accounting_3}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_3}$session"},$q->span({-class=>"bi bi-list-ul"}))),"\n";
|
|
}
|
|
else{
|
|
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$varenv->{accounting_1}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1}$session"}, $q->span({-class=>"bi bi-file-earmark-person"}))),"\n";
|
|
print $q->li($q->a({-style=>"$mstyle_1_5",-title=>"$varenv->{accounting_1_5}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1_5}$session"}, $q->span({-class=>"bi bi-credit-card"}))),"\n";
|
|
print $q->li($q->a({-style=>"$mstyle_2",-title=>"$varenv->{accounting_2}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_2}$session"},$q->span({-class=>"bi bi-cash"}))),"\n";
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
print "</ul>\n";
|
|
#print "</div>\n";
|
|
#-----------------
|
|
}else{
|
|
|
|
#subMenue--------
|
|
print "<style>
|
|
ul#AccNavi {
|
|
position:relative;
|
|
display:flex;
|
|
margin-left: -40px;
|
|
}
|
|
ul#AccNavi li {
|
|
list-style: none;
|
|
display: inline;
|
|
margin-right:20px;
|
|
}
|
|
ul#AccNavi li a {
|
|
display:flex;
|
|
text-align:center;
|
|
align-itmes;center;
|
|
justify-content:center;
|
|
transition: all 0.3s ease;
|
|
margin: 0;
|
|
padding: 1em;
|
|
height: 50px;
|
|
background-color: #$bgcolor1;
|
|
font-family:Arial,sans-serif;
|
|
text-decoration: none;
|
|
font-weight: normal;
|
|
color: white;
|
|
}
|
|
ul#AccNavi a:hover {
|
|
color: black;
|
|
background-color: white;
|
|
}
|
|
ul#AccNavi a:active {
|
|
color: white;
|
|
background-color: gray;
|
|
}
|
|
</style>\n";
|
|
|
|
|
|
#print "<div style='margin-top:40px;'>\n";
|
|
print "<ul id='AccNavi'>\n";
|
|
foreach my $id1 (sort {$node1->{$a}->{n_sort} <=> $node1->{$b}->{n_sort}} keys (%$node1)){
|
|
#Creditcard test switch for payone (tinkwwp)
|
|
if($users_sharee->{c_id} && ($path =~ /$varenv->{mandant}\/$varenv->{profile}/ || $path =~ /$varenv->{mandant}\/Account/)){
|
|
my $mstyle_1="";
|
|
my $mstyle_1_5="";
|
|
my $mstyle_2="";
|
|
my $mstyle_3="";
|
|
|
|
if($node_meta->{main_id} == $node1->{$id1}->{main_id}){
|
|
$mstyle_1 .= "background-color: silver;" if("$node1->{$id1}->{node_name}" eq "$varenv->{accounting_1}");
|
|
$mstyle_1_5 .= "background-color: silver;" if("$node1->{$id1}->{node_name}" eq "$varenv->{accounting_1_5}");
|
|
$mstyle_2 .= "background-color: silver;" if("$node1->{$id1}->{node_name}" eq "$varenv->{accounting_2}");
|
|
$mstyle_3 .= "background-color: silver;" if("$node1->{$id1}->{node_name}" eq "$varenv->{accounting_3}");
|
|
|
|
#Konrad & TINK & sharee AGB
|
|
if(!$users_sharee->{int14} && !$users_sharee->{int15} && !$users_sharee->{txt30}){
|
|
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$node1->{$id1}->{node_name}", -href=>"/$viewsel[0]/Account/$node1->{$id1}->{node_name}$session"}, "$node1->{$id1}->{node_name}")),"\n";
|
|
}
|
|
elsif(!$users_sharee->{int03}){
|
|
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$varenv->{accounting_1}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1}$session"}, $q->img({-src=>"$varenv->{metahost}/glyphicons/glyphicons-265-vcard.png"}))),"\n";
|
|
print $q->li($q->a({-style=>"$mstyle_1_5",-title=>"$varenv->{accounting_1_5}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1_5}$session"}, $q->img({-src=>"$varenv->{metahost}/glyphicons/glyphicons-268-credit-card.png"}))),"\n";
|
|
}
|
|
elsif($payable_check){
|
|
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$varenv->{accounting_1}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1}$session"}, $q->img({-src=>"$varenv->{metahost}/glyphicons/glyphicons-265-vcard.png"}))),"\n";
|
|
print $q->li($q->a({-style=>"$mstyle_1_5",-title=>"$varenv->{accounting_1_5}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1_5}$session"}, $q->img({-src=>"$varenv->{metahost}/glyphicons/glyphicons-268-credit-card.png"}))),"\n";
|
|
print $q->li($q->a({-style=>"$mstyle_2",-title=>"$varenv->{accounting_2}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_2}$session"},$q->img({-src=>"$varenv->{metahost}/glyphicons/glyphicons-326-wallet.png"}))),"\n";
|
|
print $q->li($q->a({-style=>"$mstyle_3",-title=>"$varenv->{accounting_3}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_3}$session"},$q->img({-src=>"$varenv->{metahost}/glyphicons/glyphicons-530-list-alt.png"}))),"\n";
|
|
}
|
|
else{
|
|
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$varenv->{accounting_1}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1}$session"}, $q->img({-src=>"$varenv->{metahost}/glyphicons/glyphicons-265-vcard.png"}))),"\n";
|
|
print $q->li($q->a({-style=>"$mstyle_1_5",-title=>"$varenv->{accounting_1_5}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1_5}$session"}, $q->img({-src=>"$varenv->{metahost}/glyphicons/glyphicons-268-credit-card.png"}))),"\n";
|
|
print $q->li($q->a({-style=>"$mstyle_2",-title=>"$varenv->{accounting_2}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_2}$session"}, $q->img({-src=>"$varenv->{metahost}/glyphicons/glyphicons-326-wallet.png"}))),"\n";
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
print "</ul>\n";
|
|
#print "</div>\n";
|
|
#-----------------
|
|
}#end else bootstrap version
|
|
|
|
#print $q->div({-style=>'position:fixed;bottom:4%;right:2%;z-index:10;font-size:13px;'},"--> $varenv->{syshost} | $varenv->{merchant_id} | $bgcolor1 | template -> $node_meta->{tpl_name} | $users_sharee->{c_id}"),"\n" if($users_sharee->{c_id} eq $dbt->{copri_conf}->{superu_id} || $dbt->{copri_conf}->{stage} eq "test");
|
|
}
|
|
1;
|