mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 11:46:27 +01:00
Adding bike move methode
This commit is contained in:
parent
7736fee89d
commit
0857601751
8 changed files with 98 additions and 319 deletions
|
@ -1475,6 +1475,7 @@ sub booking_update(){
|
|||
}
|
||||
|
||||
my $co2saving = "";
|
||||
$booking->{int26} = 10 if(!$booking->{int26} && ($auth->{c_id} == 5781 || $auth->{c_id} == 38883));#10 km test
|
||||
if($booking->{int26}){
|
||||
$co2saving = "Einsparung: ";
|
||||
my $co2diff = $pri->co2calc($booking);
|
||||
|
@ -1738,6 +1739,7 @@ sub rental_to_feedback{
|
|||
$show_dialog->{user_miniquery} = $dbt->evaluationsfragen($dbh);
|
||||
}
|
||||
$show_dialog->{co2saving} = "";
|
||||
$ctpos->{int26} = 10 if(!$ctpos->{int26} && ($auth->{c_id} == 5781 || $auth->{c_id} == 38883));#10 km test
|
||||
if($ctpos->{int26}){
|
||||
my $co2saving = "Einsparung: ";
|
||||
my $co2diff = $pri->co2calc($ctpos);
|
||||
|
|
|
@ -374,6 +374,9 @@ sub handler {
|
|||
}elsif($R::base_edit eq "save_content"){
|
||||
$feedb = $pl->save_content($q,$users_dms,$node_meta,$R::c_id) if(looks_like_number($R::c_id));
|
||||
$apif->stations_caching($q,\%varenv,$users_sharee) if($node_meta->{template_id} =~ /210|205|225/);
|
||||
}elsif($R::base_edit eq "move_content"){
|
||||
$feedb = $pl->move_content($q,$users_dms,$node_meta,$R::c_id) if(looks_like_number($R::c_id));
|
||||
$apif->stations_caching($q,\%varenv,$users_sharee) if($node_meta->{template_id} == 205);
|
||||
}elsif($R::c_id && $R::base_edit eq "remove_chk4rel"){
|
||||
my $delete_key = "delete_content";
|
||||
$feedb->{message} = "failure::Datensatz wirklich löschen. ::?base_edit=$delete_key\&exit_box2=1\&c_id=$R::c_id ::löschen";
|
||||
|
|
|
@ -56,10 +56,6 @@ sub mobox3(){
|
|||
$title = "Node Editor";
|
||||
$height = "300";
|
||||
$width = "600";
|
||||
}elsif($R::rel_edit =~ /dialog4menu|dialog4content/){
|
||||
$title = "Relation Editor";
|
||||
$height = "300";
|
||||
$width = "550";
|
||||
}
|
||||
|
||||
|
||||
|
@ -118,10 +114,6 @@ EOF
|
|||
# require "Tpl/APIdialog.pm";
|
||||
# &APIdialog::tpl($node_meta,$users_dms,$mode,$return);
|
||||
#}
|
||||
#elsif($R::relate_dialog || $R::rel_edit =~ /dialog4menu|dialog4content/){
|
||||
# require "Mod/RelationEdit.pm";
|
||||
# &RelationEdit::tpl($node_meta,$users_dms,$mode,$return);
|
||||
#}
|
||||
elsif(($R::node2edit && $R::node2edit =~ /editpart/) || ($R::base_edit && $R::base_edit !~ /delete/)){
|
||||
require "Tpl/BaseEdit.pm";
|
||||
&BaseEdit::tpl($node_meta,$users_dms,$feedb);
|
||||
|
|
|
@ -13,7 +13,6 @@ use Mod::Buttons;
|
|||
use Mod::Libenz;
|
||||
use Mod::Basework;
|
||||
use Mod::DBtank;
|
||||
use Mod::Relation;
|
||||
use Data::Dumper;
|
||||
|
||||
sub new {
|
||||
|
@ -38,7 +37,6 @@ sub admin_tpl(){
|
|||
my $bw = new Basework;
|
||||
my $dbt = new DBtank;
|
||||
my $but = new Buttons;
|
||||
my $relform = new Relation;
|
||||
my %varenv = $cf->envonline();
|
||||
my $script = $q->script_name();
|
||||
my $path = $q->path_info();
|
||||
|
|
|
@ -243,7 +243,30 @@ sub save_content {
|
|||
}else{
|
||||
$feedb->{message} = "failure::Eingabefehler \"$valxx\", falsche Datum Uhrzeit Format";
|
||||
}
|
||||
}elsif($_ =~ /^int|barcode/){
|
||||
}elsif($_ =~ /barcode/){
|
||||
my $val = $q->param("$_");
|
||||
$valxx = $q->escapeHTML("$val");
|
||||
$valxx =~ s/\s//g;
|
||||
if($node_meta->{ct_table} eq "content" && (looks_like_number($valxx) || $valxx == 0) && $R::rel_id && $R::template_id){
|
||||
my $pref_cc = {
|
||||
table => "content",
|
||||
fetch => "one",
|
||||
template_id => "$R::template_id",
|
||||
barcode => "$valxx",
|
||||
rel_id => "!=::$R::rel_id",
|
||||
};
|
||||
|
||||
my $cc_part = { c_id => 0 };
|
||||
$cc_part = $dbt->fetch_record($dbh,$pref_cc);
|
||||
if(!$cc_part->{c_id}){
|
||||
$update_ct->{$_} = "$valxx";
|
||||
}else{
|
||||
$feedb->{message} = "failure::Fehler \"$valxx\", die Artikelnummer ist bereits vorhanden";
|
||||
}
|
||||
}else{
|
||||
$feedb->{message} = "failure::Eingabefehler \"$valxx\", hier sind nur numerische Werte erlaubt";
|
||||
}
|
||||
}elsif($_ =~ /^int/){
|
||||
my $val = $q->param("$_");
|
||||
$valxx = $q->escapeHTML("$val");
|
||||
$valxx =~ s/,/./;
|
||||
|
@ -269,6 +292,34 @@ sub save_content {
|
|||
return $feedb;
|
||||
}#end save_content
|
||||
|
||||
#move content (mainly for bike flot)
|
||||
sub move_content {
|
||||
my $self = shift;
|
||||
my $q = shift;
|
||||
my $users_dms = shift;
|
||||
my $node_meta = shift;
|
||||
my $c_id = shift || "";
|
||||
$q->import_names('R');
|
||||
my $dbh = "";
|
||||
my $feedb = { message => "", u_rows => 0 };
|
||||
|
||||
my $update_relation = {
|
||||
table => "relation",
|
||||
rel_id => "$R::rel_id",
|
||||
};
|
||||
|
||||
if($R::template_id && $node_meta->{template_id} == $R::template_id && $R::rel_id && $R::main_id){
|
||||
$u_rows += $dbt->update_one($dbh,$update_relation,"main_id=$R::main_id");
|
||||
my $uri_path = $dbt->recurse_node($dbh,$R::main_id);
|
||||
print redirect("$varenv{wwwhost}/$uri_path?node2edit=editpart\&rel_id=$R::rel_id\&return=$i_rows-$u_rows-$d_rows");
|
||||
exit 0;
|
||||
}else{
|
||||
$feedb->{message} = "failure::Der Artikel konnte nicht verschoben werden.";
|
||||
}
|
||||
|
||||
return $feedb;
|
||||
}
|
||||
|
||||
#delete content
|
||||
sub delete_content {
|
||||
my $self = shift;
|
||||
|
@ -744,9 +795,6 @@ sub set_workflow {
|
|||
}
|
||||
$db->update_users4trans($c_idnew,"218","",$users_dms->{u_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 redirect("$varenv{wwwhost}/$uri_path?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;
|
||||
}#end set_workflow
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
package Relation;
|
||||
#
|
||||
##
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# Copyright (c) Rainer Gümpelein, TeilRad GmbH
|
||||
#
|
||||
use strict;
|
||||
use warnings;
|
||||
use CGI;
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
use CGI ':standard';
|
||||
use Mod::Buttons;
|
||||
use Mod::Libenzdb;
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = {};
|
||||
bless($self,$class);
|
||||
return $self;
|
||||
}
|
||||
|
||||
#Template
|
||||
sub tpl(){
|
||||
my ($source,$main_id,$ct_name,$barcode,$u_id,$lang,$set_style,$colspan_left,$colspan_right) = @_;
|
||||
|
||||
my $q = new CGI;
|
||||
my $db = new Libenzdb;
|
||||
my $but = new Buttons;
|
||||
my $users = $db->select_users($u_id);
|
||||
my %ib = $but->ibuttons();
|
||||
|
||||
#collect recursive waren
|
||||
my $node_mandant = $db->get_node2($users->{fullurl},"$source",$lang);
|
||||
my $main_ids = $db->collect_noderec($node_mandant->{main_id},$lang,"nothing");
|
||||
my $parent_nodes = $db->collect_node($node_mandant->{main_id},$lang);
|
||||
my $nodes = $db->collect_node2("$main_ids");
|
||||
|
||||
|
||||
my $setpart_main_id=$main_id;
|
||||
my @_waren_rel;
|
||||
foreach my $pid (sort { lc($parent_nodes->{$a}->{node_name}) cmp lc($parent_nodes->{$b}->{node_name}) } keys (%$parent_nodes)){
|
||||
my $parent_name = "/";
|
||||
$parent_name .= $parent_nodes->{$pid}->{node_name} if($parent_nodes->{$pid}->{node_name});
|
||||
push (@_waren_rel, "$pid:$parent_name") if($parent_name && "$parent_name" !~ /root/);
|
||||
foreach my $id (sort { lc($nodes->{$a}->{node_name}) cmp lc($nodes->{$b}->{node_name}) } keys (%$nodes)){
|
||||
if($nodes->{$id}->{parent_id} eq $parent_nodes->{$pid}->{main_id}){
|
||||
push (@_waren_rel, "$id:$parent_name/$nodes->{$id}->{node_name}") if($nodes->{$id}->{node_name});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print $q->hidden(-name=>'main_id', -value=>"$main_id");
|
||||
print $q->Tr();
|
||||
print "<td colspan='9' style='font-size:1em;border: solid #dcd77f;'>\n";
|
||||
print $q->start_table({-style=>'',-border=>'0',-align=>'left', -cellpadding=>'0', -cellspacing=>'0'});
|
||||
|
||||
print $q->Tr();
|
||||
print $q->td({-class=>'tdescr2',-colspan=>"$colspan_left",-style=>"$set_style"},"Kontext Kopie",$but->singlesubmit2("rel_edit","context_copy_content","$ib{context_copy_content}","$set_style"));
|
||||
if($barcode){
|
||||
$ct_name = "" if($barcode == $ct_name);
|
||||
print $q->hidden(-name=>'barcode', -value=>"$barcode");
|
||||
print $q->hidden(-name=>'empty_rel_id', -value=>"1");
|
||||
print $q->td({-class=>'tdval2',-colspan=>"$colspan_right",-style=>"$set_style"}, "Teilenummer:",$q->textfield(-class=>'etxt',-name=>"other_ct_name",-default=>"$ct_name",-size=>12,-maxlength=>15), " Barcode (intern): $barcode\n");
|
||||
}else{
|
||||
print $q->td({-class=>'tdval2',-colspan=>"$colspan_right",-style=>"$set_style;color:red"}, "Der Barcode (intern) muss vorhanden sein\n");
|
||||
}
|
||||
#print $q->Tr();
|
||||
#print $q->td({-class=>'tdescr2',-colspan=>"$colspan_left",-style=>"$set_style"},"Kopieren",$but->singlesubmit2("rel_edit","copy_content","$ib{copy_content}","$set_style"));
|
||||
#print $q->hidden(-name=>'', -value=>"");
|
||||
#print $q->td({-class=>'tdval2',-colspan=>"$colspan_right",-style=>"$set_style"}, "Barcode:",$q->textfield(-class=>'etxt',-name=>"new_barcode",-default=>"$barcode",-size=>12,-maxlength=>15), "\n");
|
||||
print $q->Tr();
|
||||
print $q->td({-class=>'tdescr2',-colspan=>"$colspan_left",-style=>"$set_style"},"Verschieben",$but->singlesubmit2("rel_edit","move_content","$ib{move_content}","$set_style"));
|
||||
print $q->td({-class=>'tdval2',-colspan=>"$colspan_right",-style=>"$set_style"}, "Gruppen-Ordner:",$but->selector("setpart_main_id","250px",$setpart_main_id,@_waren_rel),"\n");
|
||||
print $q->end_table;
|
||||
print "</td>";
|
||||
|
||||
}
|
||||
1;
|
|
@ -1,200 +0,0 @@
|
|||
package RelationEdit;
|
||||
#
|
||||
##
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# Copyright (c) Rainer Gümpelein, TeilRad GmbH
|
||||
#
|
||||
use strict;
|
||||
use warnings;
|
||||
use CGI;
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
use CGI ':standard';
|
||||
use Lib::Config;
|
||||
use Mod::Buttons;
|
||||
use Mod::Libenz;
|
||||
use Mod::Libenzdb;
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = {};
|
||||
bless($self,$class);
|
||||
return $self;
|
||||
}
|
||||
|
||||
#Template
|
||||
sub tpl(){
|
||||
my $node_meta = shift;
|
||||
my $users_dms = shift;
|
||||
my $u_group = shift;
|
||||
my $return = shift;
|
||||
|
||||
my $q = new CGI;
|
||||
my @keywords = $q->param;
|
||||
my $cf = new Config;
|
||||
my $lb = new Libenz;
|
||||
my $db = new Libenzdb;
|
||||
my $but = new Buttons;
|
||||
my %ib = $but->ibuttons();
|
||||
my $script = $q->script_name();
|
||||
my %varenv = $cf->envonline();
|
||||
my $path_info = $q->path_info();
|
||||
my $path = $path_info;
|
||||
#with meta_host,
|
||||
if("$varenv{metahost}"){
|
||||
$path = "$script" . "$path_info";
|
||||
$script="";
|
||||
}
|
||||
my $lang = "de";
|
||||
my $ctn;
|
||||
if($R::rel_id){
|
||||
$ctn = $db->collect_rel4nodes("",$node_meta->{content_id},$node_meta->{template_id});
|
||||
}else{
|
||||
return "failure::Fehler bei der Auswahluebergabe";
|
||||
}
|
||||
my $bg_color = "gray";
|
||||
my $table = "content";
|
||||
my $relate_key;
|
||||
$relate_key = "move_content" if($R::rel_edit =~ /move_/);
|
||||
$relate_key = "relate_content" if($R::rel_edit =~ /relate_/);
|
||||
$relate_key = "copy_content" if($R::rel_edit =~ /copy_/);
|
||||
if($node_meta->{ct_table} eq "contentadr"){
|
||||
$table = "contentadr";
|
||||
$relate_key = "move_contentadr" if($R::rel_edit =~ /move_/);
|
||||
$relate_key = "relate_contentadr" if($R::rel_edit =~ /relate_/);
|
||||
}
|
||||
if($node_meta->{ct_table} eq "contenttrans"){
|
||||
$table = "contenttrans";
|
||||
$relate_key = "move_conttrans" if($R::rel_edit =~ /move_/);
|
||||
$relate_key = "relate_contenttrans" if($R::rel_edit =~ /relate_/);
|
||||
}
|
||||
if($node_meta->{ct_table} eq "contenttver"){
|
||||
$table = "contenttver";
|
||||
$relate_key = "move_contenttver" if($R::rel_edit =~ /move_/);
|
||||
$relate_key = "relate_contenttver" if($R::rel_edit =~ /relate_/);
|
||||
}
|
||||
if($node_meta->{ct_table} eq "contentnel"){
|
||||
$table = "contentnel";
|
||||
$relate_key = "move_contentnel" if($R::rel_edit =~ /move_/);
|
||||
$relate_key = "relate_contentnel" if($R::rel_edit =~ /relate_/);
|
||||
}
|
||||
|
||||
|
||||
#print "$table,$node_meta->{main_id},$lang,$R::rel_id, xxxxxxxxxxxxxx";
|
||||
my $ctrel = $db->get_ctrel($table,"",$lang,$R::rel_id);
|
||||
my $node = $db->get_node4multi($node_meta->{main_id},$lang);
|
||||
$ctrel->{mtime} = $lb->time4de($ctrel->{mtime},"1") if($ctrel->{mtime});
|
||||
$ctrel->{rel_id} = 0 if(!$ctrel->{rel_id});
|
||||
my $ct_users;
|
||||
$ct_users = $db->collect_users("users") if($u_group eq "manager");#users map
|
||||
|
||||
#we mean roots for sub-NodePath selection
|
||||
my @viewsel = split /\//,$1 if($path =~ /^\/(.*)/);
|
||||
my $depth = scalar(@viewsel);
|
||||
my $view_root = $viewsel[0] || "root";
|
||||
|
||||
my $selector = "this_is_no_selection";
|
||||
$selector = $1 if($path =~ /\/(Waren|Kunden|Veranstaltung|Nachrichten)/);
|
||||
|
||||
#collect recursive nodes
|
||||
my $selsize="200px";
|
||||
#nodes with relation would be better
|
||||
my $nodes = $db->collect_node4all("","","","100000");
|
||||
my @_menu_rel;
|
||||
foreach my $id (sort { lc($nodes->{$a}->{node_name}) cmp lc($nodes->{$b}->{node_name}) } keys (%$nodes)){
|
||||
my @viewsel;
|
||||
my $depth=0;
|
||||
my $j=0;
|
||||
my ($m_id,$uri) = "";#$lb->make_uri5($nodes->{$id}->{main_id},$nodes);
|
||||
if(($uri =~ /\w\/\w/) && ($uri !~ /000 root/)){
|
||||
@viewsel = split(/\//,$uri) if($uri =~ /^\/(.*)/);
|
||||
$depth = scalar(@viewsel);
|
||||
if($varenv{orga} eq "dms"){
|
||||
#sharee-copri workaround to get only bike menue
|
||||
if($selector && ($path =~ /\/$selector/) && ($uri =~ /$selector/) && ($node_meta->{template_id} == 205)){#Waren bikes
|
||||
if($depth >= 2){
|
||||
my $rel = $db->get_relation($nodes->{$id}->{main_id},$lang,"");
|
||||
push (@_menu_rel, "$m_id:$uri") if($rel->{template_id} == 205);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
my $mcount = scalar(@_menu_rel);
|
||||
#
|
||||
|
||||
#collect content
|
||||
my $content = $db->collect_content();
|
||||
my @_content;
|
||||
foreach my $id (sort { lc($content->{$a}->{ct_name}) cmp lc($content->{$b}->{ct_name}) } keys (%$content)){
|
||||
push (@_content, "$id:$content->{$id}->{ct_name}") if($content->{$id}->{ct_name});
|
||||
}
|
||||
#
|
||||
|
||||
print "<div id='Container_cms'>";
|
||||
|
||||
my $u_name;
|
||||
foreach my $ctu_id (keys (%$ct_users)){
|
||||
if($ctrel->{owner} eq $ct_users->{$ctu_id}->{owner}){
|
||||
$u_name = $ct_users->{$ctu_id}->{u_name};
|
||||
}
|
||||
}
|
||||
$db->users_up("rel_id4edit",$ctrel->{rel_id},$users_dms->{u_id});
|
||||
print $q->hidden(-name=>'main_id', -value=>"$ctrel->{main_id}");
|
||||
print $q->hidden(-name=>'rel_id', -value=>"$ctrel->{rel_id}") if($ctrel->{rel_id});
|
||||
print $q->hidden(-name=>'template_id', -value=>"$ctrel->{template_id}");
|
||||
|
||||
print $q->start_table({-class=>'list', -border=>'0', -width=>'100%', -align=>'left', -cellpadding=>'3', -cellspacing=>'3'});
|
||||
|
||||
#Buttons
|
||||
print $q->Tr();
|
||||
print "<td style='margin:1px 0;padding:2px;background-color:$bg_color' colspan='2' nowrap>\n";
|
||||
print $but->singlesubmit7("rel_edit","$relate_key","$ib{$relate_key}");
|
||||
print "</td>\n";
|
||||
|
||||
print $q->Tr();
|
||||
print $q->td({-colspan=>'2'}," ");
|
||||
|
||||
if("$R::relate_dialog" eq "menu" || $R::rel_edit =~ /dialog4menu/){
|
||||
print $q->hidden(-name=>'set_content_id', -value=>"$ctrel->{content_id}");
|
||||
print $q->Tr();
|
||||
print $q->td({-class=>'tdescr2'}, "Content"),"\n";
|
||||
print $q->td({-class=>'tdval2'},$q->b("$ctrel->{ct_name} ($ctrel->{txt01})"),"\n");
|
||||
print $q->Tr();
|
||||
print $q->td({-class=>'tdescr2'}, "Node"),"\n";
|
||||
if($mcount > 0 || $varenv{orga} eq "dms"){
|
||||
if($varenv{wwwhost} =~ /woge|fsd/){#with multiple select
|
||||
my $height = scalar(@_menu_rel);
|
||||
my $remain_id;
|
||||
foreach my $in (keys(%$ctn)){
|
||||
$remain_id .= "$ctn->{$in}->{main_id},";
|
||||
}
|
||||
$remain_id =~ s/,$//;
|
||||
print $q->td({-class=>'tdval2'},$but->selector2("set_main_id","600px","$height",$remain_id,@_menu_rel)),"\n";
|
||||
}else{
|
||||
print $q->td({-class=>'tdval2'},$but->selector("set_main_id","250px",$node_meta->{main_id},@_menu_rel)),"\n";
|
||||
}
|
||||
}else{
|
||||
print $q->td({-class=>'tdval2'},"Es ist kein leeres Menue fuer eine Verknuepfung vorhanden."),"\n";
|
||||
}
|
||||
print $q->hidden(-name=>'mastermain_id', -value=>"$node_meta->{mastermain_id}") if($node_meta->{mastermain_id});
|
||||
}elsif("$R::relate_dialog" eq "content" || $R::rel_edit =~ /dialog4content/){
|
||||
print $q->hidden(-name=>'set_main_id', -value=>"$node_meta->{main_id}");
|
||||
print $q->Tr();
|
||||
print $q->td({-class=>'tdescr2'}, "Node"),"\n";
|
||||
print $q->td({-class=>'tdval2'},$q->b($node->{node_name}),"\n");
|
||||
print $q->Tr();
|
||||
print $q->td({-class=>'tdescr2'}, "Content"),"\n";
|
||||
print $q->td({-class=>'tdval2'},$but->selector("set_content_id","250px",$ctrel->{c_id},@_content),"\n");
|
||||
}
|
||||
print $q->Tr();
|
||||
print $q->td({-colspan=>'2'}," ");
|
||||
#print $q->Tr();
|
||||
#print "<td class='element3' colspan='2'>";
|
||||
#print $q->a({-class=>"linknav2",-href=>'javascript:history.back()'}, "zurück");
|
||||
#print "</td>\n";
|
||||
|
||||
print $q->end_table;
|
||||
print "</div>\n";
|
||||
|
||||
}
|
||||
1;
|
|
@ -90,6 +90,7 @@ sub tpl(){
|
|||
};
|
||||
$cttpos = $dbt->fetch_tablerecord($dbh,$pref);
|
||||
$occupied_style = "color:#ff1493" if($cttpos->{int10} == 2 ||$cttpos->{int10} == 3);
|
||||
$move_key = "move_content";
|
||||
}
|
||||
my $ref = {
|
||||
table => "$node_meta->{ct_table}",
|
||||
|
@ -102,9 +103,6 @@ sub tpl(){
|
|||
print $q->hidden(-name=>'rel_id',-override=>'1', -value=>"$ctrel->{rel_id}");
|
||||
|
||||
$edit = "base_edit";
|
||||
#$relate_key = "relate_dialog4menu";
|
||||
#$move_key = "move_dialog4menu" if($node_meta->{tpl_id} == 205);#only Waren
|
||||
#$copy_key = "copy_content";
|
||||
$save_key = "save_content";
|
||||
$edit_template = "$ctrel->{template_id}";
|
||||
$tpl = $dbt->get_tpl($dbh,$edit_template);
|
||||
|
@ -229,7 +227,6 @@ sub tpl(){
|
|||
my $selsize="200px";
|
||||
|
||||
print $q->hidden(-name=>'parent_id',-override=>'1', -value=>"$node_meta->{parent_id}");
|
||||
print $q->hidden(-name=>'main_id',-override=>'1', -value=>"$node_meta->{main_id}");
|
||||
print $q->hidden(-name=>'template_id',-override=>'1', -value=>"$node_meta->{template_id}");
|
||||
print $q->hidden(-name=>'offset',-override=>'1', -value=>"$R::offset");
|
||||
print $q->hidden(-name=>'limit', -override=>'1', -value=>"$R::limit");
|
||||
|
@ -239,37 +236,41 @@ sub tpl(){
|
|||
|
||||
my $bike_nodes = {};
|
||||
my $tariff_all = {};
|
||||
if($varenv{systype} eq "sharee"){
|
||||
my $node = { template_id => 205,#Leihrad_liste
|
||||
parent_id => 200013,#Waren
|
||||
fetch => "all",
|
||||
keyfield => "main_id",
|
||||
};
|
||||
$bike_nodes = $dbt->fetch_rel4tpl4nd($dbh,$node);
|
||||
my $node = {
|
||||
template_id => 205,
|
||||
parent_id => 200013,
|
||||
fetch => "all",
|
||||
keyfield => "main_id",
|
||||
};
|
||||
$bike_nodes = $dbt->fetch_rel4tpl4nd($dbh,$node);
|
||||
|
||||
my $tariff = {
|
||||
my $tariff = {
|
||||
table => "content",
|
||||
fetch => "all",
|
||||
keyfield => "barcode",
|
||||
template_id => "210",#Tariff tpl_id
|
||||
};
|
||||
$tariff_all = $dbt->fetch_record($dbh,$tariff);
|
||||
}
|
||||
$tariff_all = $dbt->fetch_record($dbh,$tariff);
|
||||
|
||||
print "<div id='Container_cms'>\n";
|
||||
#1. table submit
|
||||
print $q->start_table({-class=>'list', -border=>'0', -width=>'100%',-align=>'center', -cellpadding=>'3', -cellspacing=>'0'});
|
||||
print $q->Tr();
|
||||
print "<td style='background-color:#a7a18f;padding:2px;border-bottom: 1px solid silver;'>";
|
||||
print $but->singlesubmit7("$edit","$save_key","$ib{$save_key}","margin:0 5px;");
|
||||
print $but->singlesubmit7("rel_edit","$relate_key","$ib{$relate_key}","margin:0 5px;");
|
||||
print $but->singlesubmit7("rel_edit","$move_key","$ib{$move_key}","margin:0 5px;");
|
||||
print $but->singlesubmit7("rel_edit","$copy_key","$ib{$copy_key}","margin:0 5px;");
|
||||
print $but->singlesubmit7("$edit","remove_chk4rel","$ib{remove_chk4rel}","margin:0 5px;") if($node_meta->{tpl_id} !~ /199|221/);
|
||||
|
||||
#print $q->div({-style=>'position:fixed;bottom:2%;right:1%;z-index:10;font-size:13px;'}," (c_id: $ctrel->{c_id} | rel_id: $ctrel->{rel_id} | tpl_id: $ctrel->{template_id} / $edit_template)"),"\n" if($users_dms->{u_id} eq $varenv{superu_id});
|
||||
print "</td>\n";
|
||||
print $q->td({-style=>"background-color:#a7a18f;padding-right:10px;border-bottom: 1px solid silver;text-align:right;font-size:11px;"}, "$u_name / $dbmtime");
|
||||
print $q->td({-style=>"background-color:#a7a18f;padding-right:0px;border-bottom: 1px solid silver;"},$but->singlesubmit7("$edit","$save_key","$ib{$save_key}","margin:0 5px;"));
|
||||
if($move_key){
|
||||
my @_main_valxx = ();
|
||||
foreach my $rid (sort { $bike_nodes->{$a}->{n_sort} <=> $bike_nodes->{$b}->{n_sort} } keys (%$bike_nodes)){
|
||||
push (@_main_valxx, "$bike_nodes->{$rid}->{main_id}:$bike_nodes->{$rid}->{node_name} - $dbt->{copri_conf}->{type_id}->{$bike_nodes->{$rid}->{type_id}}");
|
||||
}
|
||||
if(scalar(@_main_valxx) > 1){
|
||||
print $q->td({-style=>"background-color:#a7a18f;padding-right:10px;border-bottom: 1px solid silver;"},
|
||||
$but->singlesubmit7("$edit","$move_key","$ib{$move_key}","margin:0 5px;"),
|
||||
$but->selector_class("main_id","eselect","",$ctrel->{main_id},@_main_valxx)
|
||||
);
|
||||
}
|
||||
}
|
||||
print $q->td({-style=>"background-color:#a7a18f;border-bottom: 1px solid silver;text-align:right;font-size:11px;"}, "$u_name / $dbmtime");
|
||||
print $q->td({-style=>"background-color:#a7a18f;padding-right:10px;border-bottom: 1px solid silver;text-align:right;"},$but->singlesubmit7("$edit","remove_chk4rel","$ib{remove_chk4rel}","margin:0 5px;")) if($node_meta->{tpl_id} !~ /199|221/);
|
||||
print $q->end_table;
|
||||
|
||||
|
||||
|
@ -361,8 +362,11 @@ EOF
|
|||
|
||||
#Mietjournal edit
|
||||
if($node_meta->{ct_table} eq "contenttranspos" && $node_meta->{tpl_id} == 221){
|
||||
my ($key,$des,$size,$postdes) = split /=/,$_;
|
||||
$des .= " ($key)" if($users_dms->{u_id} eq $varenv{superu_id});
|
||||
my $dbh_primary = $dbt->dbconnect_extern($dbt->{primary}->{sharee_primary}->{database}->{dbname});
|
||||
my $users_dms_primary = { u_id => 0 };
|
||||
$users_dms_primary = $dbt->select_users($dbh_primary,$users_dms->{u_id},"");
|
||||
my ($key,$des,$size,$postdes) = split /=/,$_;
|
||||
$des .= " ($key)" if($users_dms->{u_id} eq $varenv{superu_id});
|
||||
my $prefix = $cttpos->{txt12};
|
||||
$prefix = "S3X" if($prefix eq "SX");
|
||||
|
||||
|
@ -499,6 +503,14 @@ EOF
|
|||
print $q->td({-class=>'left_italic_cms'}, $q->a({-class=>"linknav4",-href=>"/$dbt->{shareedms_conf}->{parent_node}/Waren/Gebühren?ca_id=$cttpos->{ca_id}\&ct_id=$cttpos->{ct_id}\&owner=$users_dms->{u_id}",-title=>""},"Gebühr hinzufügen")),"\n";
|
||||
print $q->td({-class=>'content1_cms'}," \n");
|
||||
}
|
||||
if($key eq "txt24" && $cttpos->{$key} && $users_dms_primary->{u_id} && $dbt->{copri_conf}->{contributors} && $users_dms_primary->{u_id} =~ /$dbt->{copri_conf}->{contributors}/){
|
||||
$cttpos->{$key} = $q->unescapeHTML("$cttpos->{$key}");
|
||||
$cttpos->{$key} = $lb->newline($cttpos->{$key},"",1);
|
||||
print $q->Tr(),"\n";
|
||||
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
||||
print $q->td({-class=>'content1_cms'},"$cttpos->{$key};\n");
|
||||
}
|
||||
|
||||
}#end edit position
|
||||
|
||||
#service-config
|
||||
|
@ -929,7 +941,9 @@ EOF
|
|||
print $q->end_table;
|
||||
#2.table ende
|
||||
|
||||
print $q->div($but->singlesubmit7("$edit","$save_key","$ib{$save_key}","margin:10px 5px;"), $q->span({-style=>'color:#FF5F1F;'},"•"),"Orange markierte Angaben bitte prüfen und ggf. korrigieren."),"\n";
|
||||
my $legend = "";
|
||||
$legend = "<span style='color:#FF5F1F;'>• </span> Orange markierte Angaben bitte prüfen und ggf. korrigieren." if($node_meta->{tpl_id} == 221);
|
||||
print $q->div($but->singlesubmit7("$edit","$save_key","$ib{$save_key}","margin:10px 5px;"), "$legend"),"\n";
|
||||
my $debug = "";
|
||||
$debug = "(ct_table: $node_meta->{ct_table} | main_id: $node_meta->{main_id} | c_id: $ctrel->{c_id} | tpl_id: $tpl->{tpl_id} | rel_id: $ctrel->{rel_id})";
|
||||
print $q->div({-style=>'z-index:10;font-size:13px;'},"$debug"),"\n" if($users_dms->{u_id} == $dbt->{copri_conf}->{superu_id});
|
||||
|
|
Loading…
Add table
Reference in a new issue