mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-10 05:56:27 +02:00
refactoring some methodes
This commit is contained in:
parent
697a29b97d
commit
729dad2be4
28 changed files with 567 additions and 2323 deletions
|
@ -27,14 +27,15 @@ sub new {
|
|||
#Template
|
||||
sub tpl(){
|
||||
my $self = shift;
|
||||
my $q = shift;
|
||||
my $node_meta = shift;
|
||||
my $users_dms = shift;
|
||||
my $mode = shift || "";
|
||||
my $varenv = shift;
|
||||
my $users_sharee = shift || "";
|
||||
my $feedb = shift || "";
|
||||
$q->import_names('R');
|
||||
|
||||
my $q = new CGI;
|
||||
my $bw = new Basework;
|
||||
my $lb = new Libenz;
|
||||
my $db = new Libenzdb;
|
||||
|
@ -143,8 +144,8 @@ sub tpl(){
|
|||
if($users_dms_primary->{u_id} && $users_dms_primary->{int03} >= 1 && $users_dms->{u_id} && $users_dms->{int03} >= 1){
|
||||
$mod_active .= "|Faktura";
|
||||
}
|
||||
if($users_dms->{u_id} && $users_dms->{int01} >= 2 && ($users_dms->{int07} >= 1 || $users_dms->{int08} >= 1)){
|
||||
$mod_active .= "|Einstellung";#trust only if parts editable
|
||||
if($users_dms->{u_id} && ($users_dms->{int07} >= 1 || $users_dms->{int08} >= 1)){
|
||||
$mod_active .= "|Einstellung";
|
||||
}
|
||||
|
||||
###Top Menu
|
||||
|
@ -182,7 +183,7 @@ sub tpl(){
|
|||
$aclass = "nav-link" if($node->{$id}->{node_name} =~ /Mietjourna|Alarmjournal|Karte/);
|
||||
$aclass = "nav-link" if($node->{$id}->{node_name} =~ /Mietjourna|Alarmjournal|Karte|App-feedback/ && $mod_active !~ /Kunden/);
|
||||
if($users_dms->{u_id} && ($users_dms->{int01} == 2 && $node_meta->{ct_table} =~ /content$/) || ($users_dms->{u_id} == $dbt->{copri_conf}->{superu_id})){
|
||||
my $url = "$topath/maintainer?node2edit=edit_relation\&main_id=$node->{$id}->{main_id}";
|
||||
my $url = "$topath?node2edit=edit_relation\&main_id=$node->{$id}->{main_id}";
|
||||
$lmenu0 = $but->event_button("$topath","$node->{$id}->{node_name}","$node->{$id}->{main_id}","$aclass $mclass","","$users_dms->{u_id}","$url");
|
||||
}else{
|
||||
$lmenu0 = $but->lo_button("$topath","$node->{$id}->{node_name}","$node->{$id}->{main_id}","$aclass $mclass","","$users_dms->{u_id}");
|
||||
|
@ -203,7 +204,7 @@ sub tpl(){
|
|||
print "<li class='nav-item'> $lmenu0 </li><li><hr class='dropdown-divider'></li>\n";
|
||||
my $lmenu1 = "";
|
||||
foreach my $id1 (sort {$node1->{$a}->{n_sort} <=> $node1->{$b}->{n_sort}} keys (%$node1)){
|
||||
#hide Faktura config or be 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)){
|
||||
my $node2 = $db->collect_noderel($node1->{$id1}->{main_id},$lang,$users_dms->{u_id});
|
||||
$topath = "/$viewsel[0]/$node->{$id}->{node_name}";
|
||||
|
@ -214,7 +215,7 @@ sub tpl(){
|
|||
$mstyle = "color:white;";
|
||||
}
|
||||
if($users_dms->{u_id} && ($users_dms->{int01} == 2 && $node_meta->{ct_table} =~ /content$/) || ($users_dms->{u_id} == $dbt->{copri_conf}->{superu_id})){
|
||||
my $url = "$topath/$node1->{$id1}->{node_path}/maintainer?node2edit=edit_relation\&main_id=$node1->{$id1}->{main_id}";
|
||||
my $url = "$topath/$node1->{$id1}->{node_path}?node2edit=edit_relation\&main_id=$node1->{$id1}->{main_id}";
|
||||
$lmenu1 = $but->event_button("$topath/$node1->{$id1}->{node_path}","$node1->{$id1}->{node_name}","$node1->{$id1}->{main_id}","dropdown-item $mclass","","$users_dms->{u_id}","$url");
|
||||
}else{
|
||||
$lmenu1 = $but->lo_button("$topath/$node1->{$id1}->{node_path}","$node1->{$id1}->{node_name}","$node1->{$id1}->{main_id}","dropdown-item $mclass","","$users_dms->{u_id}");
|
||||
|
@ -237,7 +238,7 @@ sub tpl(){
|
|||
$mstyle = "color:white;";
|
||||
}
|
||||
if($users_dms->{u_id} && ($users_dms->{int01} == 2 && $node_meta->{ct_table} =~ /content$/) || ($users_dms->{u_id} == $dbt->{copri_conf}->{superu_id})){
|
||||
my $url = "$topath/$node1->{$id1}->{node_path}/$node2->{$id2}->{node_path}/maintainer?node2edit=edit_relation\&main_id=$node2->{$id2}->{main_id}";
|
||||
my $url = "$topath/$node1->{$id1}->{node_path}/$node2->{$id2}->{node_path}?node2edit=edit_relation\&main_id=$node2->{$id2}->{main_id}";
|
||||
$lmenu2 = $but->event_button("$topath/$node1->{$id1}->{node_path}/$node2->{$id2}->{node_path}","$node2->{$id2}->{node_name}","$node2->{$id2}->{main_id}","dropdown-item $mclass","","$users_dms->{u_id}","$url");
|
||||
}else{
|
||||
$lmenu2 = $but->lo_button("$topath/$node1->{$id1}->{node_path}/$node2->{$id2}->{node_path}","$node2->{$id2}->{node_name}","$node2->{$id2}->{main_id}","dropdown-item $mclass","","$users_dms->{u_id}");
|
||||
|
@ -251,7 +252,6 @@ sub tpl(){
|
|||
print "</ul>\n";
|
||||
print "</li>\n";
|
||||
#end submenu
|
||||
#}elsif($node->{$id}->{node_name} !~ /Einstellung/ || $users_dms->{u_group} =~ /maintainer/){
|
||||
}elsif(1==1){
|
||||
print "<li class='nav-item'> $lmenu0 </li>\n";
|
||||
}
|
||||
|
@ -273,7 +273,11 @@ sub tpl(){
|
|||
$big2menu .= $but->lia_button("$dbt->{website}->{$key}->{operatorWeb}","Web $key","","","color:#$dbt->{website}->{$key}->{bgcolor1};","") if($dbt->{website}->{$key}->{merchant_id});
|
||||
}
|
||||
foreach my $key (sort keys (%{ $dbt->{appsframe} })) {
|
||||
$big2menu .= $but->lia_button("$dbt->{primary}->{sharee_primary}->{primaryApp}?sessionid=$dbt->{appsframe}->{$key}->{merchant_id}","App $key","","","color:#$dbt->{merchant_ids}->{$dbt->{appsframe}->{$key}->{merchant_id}}->{bgcolor1};","");
|
||||
if($key eq "shareetool"){
|
||||
$big2menu .= $but->lia_button("$dbt->{appsframe}->{$key}->{uri}?sessionid=$dbt->{appsframe}->{$key}->{merchant_id}","App $key","","","color:#$dbt->{merchant_ids}->{$dbt->{appsframe}->{$key}->{merchant_id}}->{bgcolor1};","");
|
||||
}else{
|
||||
$big2menu .= $but->lia_button("$dbt->{primary}->{sharee_primary}->{primaryApp}?sessionid=$dbt->{appsframe}->{$key}->{merchant_id}","App $key","","","color:#$dbt->{merchant_ids}->{$dbt->{appsframe}->{$key}->{merchant_id}}->{bgcolor1};","");
|
||||
}
|
||||
}
|
||||
|
||||
print $q->div({-style=>'width:100%;margin:0;padding-top:70px;color:white;'}, ""),"\n";
|
||||
|
@ -331,7 +335,7 @@ sub tplselect(){
|
|||
}
|
||||
|
||||
if($return =~ /failure/ || (ref($feedb) eq "HASH" && $feedb->{message} =~ /failure/)){
|
||||
#$feedb->{message} .= "\n$return" if($return);
|
||||
$feedb->{message} = "$return" if($return);
|
||||
require "Mod/Failure.pm";
|
||||
&Failure::tpl($varenv,$users_dms->{u_id},$feedb);
|
||||
}else{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue