text-cms init and return feedb change

This commit is contained in:
ragu 2023-01-17 20:43:36 +01:00
parent c1fe6c235c
commit a61920988c
23 changed files with 267 additions and 408 deletions

View file

@ -1967,12 +1967,6 @@ sub bikes_available(){
$return->{$id}->{system} = "Ilockit";
$return->{$id}->{Ilockit_GUID} = "$record->{$id}->{txt17}";
$return->{$id}->{Ilockit_ID} = "$record->{$id}->{txt18}";
#if($users_serviceapp->{int09})
#shareetool
if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} == 187 && scalar(@{$user_tour} >= 1)){
my @service_code = split(/\s/,$record->{$id}->{txt23});
$return->{$id}->{service_code} = [@service_code];
}
}elsif($record->{$id}->{int11} eq "3"){
$return->{$id}->{system} = "sigo";
}
@ -2151,7 +2145,8 @@ sub bikes_all(){
#shareetool
if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} == 187 && scalar(@{$user_tour} >= 1)){
my @service_code = split(/\s/,$record->{$id}->{txt23});
$return->{$id}->{service_code} = [@service_code];
#2023-01-16 temporär deaktiviert
#$return->{$id}->{service_code} = [@service_code];
}
}elsif($record->{$id}->{int11} eq "3"){
$return->{$id}->{system} = "sigo";

View file

@ -63,9 +63,10 @@ sub return_feedback(){
my $node_meta = shift;
my $users_dms = shift || {};
my $feedb = shift || {};
my $debug = "";
#$debug = $feedb->{debug};
my $return = "";
if(ref($feedb) eq "HASH" && $feedb->{message}){
if(ref($feedb) eq "HASH"){
print<<EOF
<script>
\$(document).ready(function(){
@ -74,19 +75,13 @@ print<<EOF
</script>
EOF
;
my $debug = "";
#$debug = $feedb->{debug};
if($feedb->{message} =~ /(failure::.*)/){
$return = $1;
}elsif($feedb->{message}){
print $q->div({-id=>'retm'},"$feedb->{message} $debug"),"\n";
}elsif($feedb->{u_rows}){
print $q->div({-id=>'retm'},"$feedb->{u_rows} $node_meta->{node_name} aktualisiert $debug"),"\n";
print $q->div({-id=>'retm'},"$feedb->{message} $debug"),"\n" if($feedb->{message} && $feedb->{message} =~ /[a-z]/);
print $q->div({-id=>'retm'},"$node_meta->{node_name} angelegt $debug"),"\n" if($feedb->{i_rows});
print $q->div({-id=>'retm'},"$node_meta->{node_name} aktualisiert $debug"),"\n" if($feedb->{u_rows});
print $q->div({-id=>'retm'},"$node_meta->{node_name} gelöscht $debug"),"\n" if($feedb->{d_rows});
}
}
return $return;
return;
}
sub battery_bars {

View file

@ -33,7 +33,7 @@ sub ibuttons(){
'send_invoice_again' => 'senden',
'new_contenttver' => 'Neues Arbeitsprofil',
'new_content' => 'NEUER Datensatz',
'new_content_2' => 'Add New Optical Instrument',
'new_contentcms' => 'NEUER Datensatz',
'new_adr' => 'Kunde anlegen',
'new_trans' => 'NEUE Transaktion',
'new_tver' => 'NEU',
@ -93,44 +93,6 @@ sub ibuttons(){
my %ib = ibuttons();
#buttons for jvbasel
sub ibuttons_arch(){
my $self = shift;
my ($counter) = @_;
my %ib = (
'reload_search' => 'Reload',
'new_content_1' => 'NEU',
'new_content_2' => 'Objekt hinzufuegen',
'new_relation4sub' => 'Ordner hinzufuegen',
'new_relation4sub_collection' => 'Sammlung hinzufuegen',
'new_attrtpl_int' => 'Checkbox/Integer Datenfeld erzeugen',
'new_attrtpl_txt' => 'Text Datenfeld erzeugen',
'new_adr' => 'NEUE Adresse',
'move_dnd' => 'Objekt verschieben',
'relate_dnd' => 'Objekt verlinken',
'copy_dnd' => 'Objekt kopieren',
'remove_chk4rel' => 'Objekt löschen',
'remove_chk4rel_en' => 'Delete Content',
'save_content' => 'Objekt speichern',
'relate_dialog4menu' => 'Relation herstellen',
'save_content_en' => 'Save Content',
'save_attrtpl' => 'Eigenschaft speichern',
'remove_chk4attr' => 'Eigenschaft löschen',
'delete_content' => 'löschen',
'XLSout' => 'XLS Export',
'PDFout' => 'PDF Export',
'object' => 'Ansicht',
'list_view' => 'Ansicht',
'object_view' => 'Ansicht',
'search' => 'suchen',
'more' => 'more',
'Login' => 'Login',
'login' => 'login'
);
return %ib;
}
# Language Icons
sub langicon_pic(){
my $self = shift;

View file

@ -8,10 +8,8 @@ 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 POSIX;
use Data::Dumper;
sub new {
my $class = shift;
@ -20,33 +18,31 @@ sub new {
return $self;
}
#Template
#just some frontend feedback
sub tpl(){
my ($main_id,$u_id,$lang,$bg_color1,$bg_color2,$level,$failure) = @_;
my $varenv = shift;
my $u_id = shift || "";
my $feedb = shift || {};
my $q = new CGI;
my $cf = new Config;
my $lb = new Libenz;
my $db = new Libenzdb;
my $but = new Buttons;
my %varenv = $cf->envonline();
my $path = $q->path_info();
$path =~ s/\/user|\/manager|\/admin//;
my $script = $q->script_name();
my %ib = $but->ibuttons();
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
open(FILE,">>$varenv->{logdir}/feedbFailure.log");
print FILE "\n*-->syshost $varenv->{syshost} $now_dt| u_id: $u_id\n";
print FILE Dumper($feedb) . "\n";
my $failure = $feedb->{message} || "";
$failure =~ s/failure:://g;
my ($link,$lname,$link2,$lname2);
($failure,$link,$lname,$link2,$lname2) = split(/::/,$failure);
my $link = "";
my $lname = "";
($failure,$link,$lname) = split(/::/,$failure);
my $width="600";
my $height="300";
#my $bg_color = $varenv{background_color} || "white";
#my $bg_color2 = $varenv{background_color2} || "";
my $bg_color1 = "white";
my $bg_color2 = "";
if($failure =~ /Newsletter Versandt/){
$width="600";
$height="700";
}
print FILE "$failure | $link | $lname\n";
if($varenv->{syshost} =~ /shareedms-/){
print<<EOF
<style>
.ui-dialog .ui-dialog-content {
@ -74,11 +70,11 @@ print<<EOF
</script>
EOF
;
}
my $title = "Achtung";
my $back = "zurück";
my $font_size = "";
print "<div id='dialog-failure' style='$font_size;text-align:left;margin:auto;max-width:600px;' title='$title'>";
print "<div id='dialog-failure' style='text-align:left;margin:auto;max-width:600px;' title='$title'>";
print "<div style='padding:1em;background-color:white;'>\n";
@ -87,10 +83,11 @@ EOF
print "<style>.linknav2 { margin:3px; padding:1px 20px; border: 1px solid $bg_color2; background-color: $bg_color2; font-size:13px; text-decoration: none; } .linknav2:hover { color:#464433;}</style>\n";
print $q->div({-style=>'float:left;padding:1em;'}, $q->a({-class=>"linknav2",-href=>"$link",-title=>''}, " $lname ")) if($lname);
print $q->div({-style=>'float:left;padding:1em;'}, $q->a({-class=>"linknav2",-href=>"$link2",-title=>''}, " $lname2 ")) if($lname2);
print $q->div({-style=>'float:left;padding:1em;'},$q->a({-class=>"linknav2",-href=>'javascript:history.back()'}, " $back "));
print "</div>\n";
print "</div>";
close(FILE);
}
1;

View file

@ -69,6 +69,14 @@ sub handler {
my $user_agent = $q->user_agent();
$path =~ s/\.html//;
my $feedb = {
c_id => "",
message => "",
i_rows => 0,
u_rows => 0,
d_rows => 0,
};
#$mode is used to set GUI features like "maintainer" contextmenue
my $modes = $dbt->{shareedms_conf}->{modes};
my $mode = "";
@ -174,7 +182,7 @@ sub handler {
#create_account. 2. inserts contentadr
my $tinkc_id = $tk->create_account($aowner);
($returnwww,$return) = $tk->save_account($tinkc_id,\%varenv,$aowner);
($returnwww,$feedb) = $tk->save_account($tinkc_id,\%varenv,$aowner);
#Like login_sharee, redundant
my $hw_id = unpack ('H*', pack('Nc', time, $$ % 0xff));#old $co
@ -318,7 +326,7 @@ sub handler {
$delete_key = "delete_adr";
$return = "failure::Datensatz wirklich löschen. ::?base_edit=$delete_key\&exit_box2=1\&c_id=$R::c_id ::löschen";
}elsif($users_dms_primary->{u_id} && $users_dms_primary->{int02} == 2 && $users_dms->{u_id} && $users_dms->{int02} == 2 && $R::c_id && $R::base_edit eq "save_adr"){
($returnwww,$return) = $tk->save_account($R::c_id,\%varenv,$users_dms->{u_id});
($returnwww,$feedb) = $tk->save_account($R::c_id,\%varenv,$users_dms->{u_id});
}elsif($users_dms_primary->{u_id} && $users_dms_primary->{int02} == 2 && $users_dms->{u_id} && $users_dms->{int02} == 2 && $R::c_id && $R::base_edit eq "delete_adr"){
$return = $tk->delete_account($R::c_id,$users_dms->{u_id});
}else{
@ -342,19 +350,22 @@ sub handler {
}
#DMS Waren || Einstellung/Service* rw
if($node_meta->{ct_table} eq "content" || $node_meta->{ct_table} eq "contentuser"){
if(($node_meta->{ct_table} eq "content" || $node_meta->{ct_table} eq "contentuser") && $R::main_id && $R::main_id >= 200000){
$bw->log("DMS action from $users_dms->{u_id} on $node_meta->{ct_table}|$R::main_id with: $R::rel_edit","","");
if(($node_meta->{ct_table} eq "content" && $users_dms->{int01} == 2) || ($node_meta->{ct_table} eq "contentuser" && $users_dms->{int08} == 2)){
if($R::rel_edit eq "save_relation" && $R::main_id && $R::main_id >= 200000){
if($R::rel_edit eq "save_relation"){
$return = $pl->save_relation($q,$R::main_id,$users_dms->{u_id});
}elsif($R::rel_edit eq "delete_relation" && $R::main_id && $R::main_id >= 200000){
}elsif($R::rel_edit eq "delete_relation"){
$return = $pl->delete_relation($q,$R::main_id,$users_dms->{u_id});
}elsif($R::rel_edit eq "new_relation" && $R::main_id && $R::main_id >= 200000){
}elsif($R::rel_edit eq "new_relation"){
$return = $pl->new_relation($q,$R::main_id,$users_dms->{u_id});
}elsif($R::rel_edit eq "save_ctuser" && $R::main_id && $R::main_id >= 200000){
#$return = "failure::under development, $node_meta->{tpl_name}";
}elsif($R::rel_edit eq "save_ctuser"){
$return = $pl->save_service_desc($q,$R::c_id,$users_dms);
}elsif($R::rel_edit && $R::main_id && $R::main_id >= 200000){
}elsif($R::base_edit eq "new_contentcms"){
$feedb = $pl->new_contentcms($q,$users_dms);
}elsif($R::base_edit eq "save_contentcms"){
$feedb = $pl->save_content($q,$users_dms,$node_meta,$R::c_id) if(looks_like_number($R::c_id));
}elsif($R::rel_edit){
$return = $pm->maininit($users_dms);
}
}elsif($R::rel_edit){
@ -379,7 +390,7 @@ sub handler {
}elsif($R::ct_trans =~ /set_accounting2invoice/){
$return = $pl->set_accounting2invoice($q,$users_dms,$R::c_id4trans,$R::set_main_id4workflow) if(looks_like_number($R::c_id4trans) && looks_like_number($R::tpl_id4trans) && looks_like_number($R::set_main_id4workflow));
}elsif($R::ct_trans =~ /save_text|save_adr/){
$return = $pl->save_text2contenttrans($q,$users_dms,$R::c_id4trans) if(looks_like_number($R::c_id4trans));
$feedb = $pl->save_text2contenttrans($q,$users_dms,$R::c_id4trans) if(looks_like_number($R::c_id4trans));
}elsif($R::detail_search && $R::detail_search eq "operator_accounting"){
my $ck4ex = "@R::ck4ex" || "";
$return = $pl->operator_accounting($q,$users_dms,$users_sharee,$R::accounting_type,$ck4ex);
@ -394,12 +405,12 @@ sub handler {
#DMS Mietjournal
if($node_meta->{ct_table} eq "contenttranspos" && $R::base_edit eq "save_pos"){
$return = $pl->save_contenttranspos($q,$R::c_id,$users_dms->{u_id});
$feedb = $pl->save_contenttranspos($q,$R::c_id,$users_dms->{u_id});
}
#DMS insert part or fee
if($node_meta->{ct_table} eq "contenttranspos" && $R::insert_contenttranspos){
$return = $pl->insert_contenttranspos($q,$R::cc_id,$R::ca_id,$R::ct_id,$users_dms->{u_id});
$feedb = $pl->insert_contenttranspos($q,$R::cc_id,$R::ca_id,$R::ct_id,$users_dms->{u_id});
}
$users_dms = $dbt->select_users($dbh,$users_dms->{u_id},"");#just to get update after save
@ -412,7 +423,7 @@ sub handler {
#save_account. 3. updates contentadr
if($users_sharee->{c_id} && $R::sharee_edit && $R::sharee_edit =~ /save_account/){
($returnwww,$return) = $tk->save_account($users_sharee->{c_id},\%varenv,$aowner);
($returnwww,$feedb) = $tk->save_account($users_sharee->{c_id},\%varenv,$aowner);
}
if($users_sharee->{c_id} && $R::sharee_edit && $R::sharee_edit =~ /save_transact/){
@ -566,12 +577,11 @@ sub handler {
$db->updater("contentadr","c_id","$confirmed_email->{c_id}","txt32","$confirmed_email->{txt08}");
print FILE "confirmed_email: $confirmed_email->{c_id} update because confirm_code:$confirm_code\n" if($debug);
#after mailAck, delete all douple adr with no mailAck and no invoices
#after mailAck, delete all douple adr with no mailAck
my $ctadr = $db->collect_ct4rel3("contentadr","","","ilike","txt08","$confirmed_email->{txt08}","","","");
foreach my $aid (keys(%$ctadr)){
if(!$ctadr->{$aid}->{int04}){
my $ctctt = $db->get_content6("contenttrans","int10",$ctadr->{$aid}->{c_id});
$db->delete_content("contentadr",$ctadr->{$aid}->{c_id}) if(!$ctctt->{c_id});
$db->delete_content("contentadr",$ctadr->{$aid}->{c_id});
print FILE "c_id $ctadr->{$aid}->{c_id} $confirmed_email->{txt08} delete because of dopplel\n" if($debug);
}
}
@ -601,7 +611,8 @@ sub handler {
($api_return,$users_sharee) = $apif->auth_verify($q,"",$users_sharee->{c_id}) if($users_sharee->{c_id});
if($users_sharee->{int12} != 2 && $users_sharee->{int04} && $users_sharee->{int13}){
my $row = $db->updater("contentadr","c_id","$users_sharee->{c_id}","int12","0");#Vde
#2023-01-17 disabled because of should only be set by payment check
#my $row = $db->updater("contentadr","c_id","$users_sharee->{c_id}","int12","0");#Vde
$dbt->update_operatorsloop($varenv{dbname},$users_sharee->{c_id},"update");
}else{
my $field = "int13";
@ -641,10 +652,6 @@ sub handler {
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1_5}$session");
exit 0;
}
elsif($users_sharee->{int12} || $users_sharee->{int03} != $R::int03){
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_2}?cum=2$session_and\&$returnwww");
exit 0;
}
elsif($payable_check && (!$users_sharee->{int04} || !$users_sharee->{int13})){
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_3}?cum=2$session_and\&$returnwww");
exit 0;
@ -792,9 +799,15 @@ sub handler {
$html5 =~ s{<html.*?>}{<html lang='de'>}s;
print $html5;
print $q->div({-style=>'background-color:black;color:white;'},"<noscript>JavaScript is off. Please enable to view full site.</noscript>"),"\n";
print $q->div({-style=>'background-color:black;color:white;'},"<noscript>JavaScript is off. Please enable to view full site.</noscript>"),"\n";
$ml->tpl($node_meta,$users_dms,$mode,\%varenv,$users_sharee,$return);
#feedb will be the new hashed return. todo refactoring
if(ref($return) eq "HASH"){
$feedb = $return;
}else{
$feedb->{message} = $return;
}
$ml->tpl($node_meta,$users_dms,$mode,\%varenv,$users_sharee,$feedb);
if(ref($api_return) eq "HASH" && $api_return->{response_text}){
print<<EOF

View file

@ -24,7 +24,10 @@ sub new {
}
sub mobox(){
my ($node_meta,$users_dms,$mode,$return) = @_;
my $node_meta = shift;
my $users_dms = shift;
my $return = shift || "";
my $q = new CGI;
my $cf = new Config;
my $but = new Buttons;

View file

@ -21,8 +21,12 @@ sub new {
}
sub mobox3(){
my ($node_meta,$users_dms,$mode,$return) = @_;
#my ($return) = @_;
my $node_meta = shift;
my $users_dms = shift;
my $feedb = shift || "";
my $return = shift || "";
my $mode = shift || "";
my $q = new CGI;
my $cf = new Config;
my $dbt = new DBtank;
@ -124,7 +128,7 @@ EOF
}
elsif(($R::node2edit && $R::node2edit =~ /editpart/) || ($R::base_edit && $R::base_edit !~ /delete/)){
require "Tpl/BaseEdit.pm";
&BaseEdit::tpl($node_meta,$users_dms,$mode,$return);
&BaseEdit::tpl($node_meta,$users_dms,$feedb);
}
else{
print $q->div("Zugriff verweigert.");

View file

@ -51,12 +51,77 @@ my %varenv = $cf->envonline();
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
my $debug=1;
#insert text-cms
sub new_contentcms {
my $self = shift;
my $q = shift;
my $users_dms = shift;
$q->import_names('R');
my $dbh = "";
my $feedb = { message => "" };
my $insert_ctu = {
table => "contentuser",
itime => 'now()',
mtime => 'now()',
owner => "$users_dms->{u_id}",
ct_name => "---",
template_id => "$R::template_id",
main_id => "$R::main_id",
};
my $c_idnew = 0;
$c_idnew = $dbt->insert_contentoid($dbh,$insert_ctu,"") if($R::template_id && $R::main_id);
if($c_idnew){
$feedb->{c_id} = $c_idnew;
$feedb->{i_rows} = $i_rows;
}
return $feedb;
}
#save contentuser cms and maybe useable at all content*!?
sub save_content {
my $self = shift;
my $q = shift;
my $users_dms = shift;
my $node_meta = shift;
my $c_id = shift || "";
$q->import_names('R');
my @keywords = $q->param;
my $dbh = "";
my $feedb = { message => "" };
my $ct = { c_id => $c_id };
my $update_ct = {
table => $node_meta->{ct_table},
owner => $users_dms->{u_id},
mtime => "now()",
};
foreach(@keywords){
my $val = $q->param($_);
my $valxx = $q->escapeHTML("$val");
my @val = $q->param($_);
$valxx = $q->escapeHTML("@val");
if($_ =~ /ct_name|txt|int|state|time/){
$update_ct->{$_} = "$valxx";
}
}
$u_rows += $dbt->update_record($dbh,$update_ct,$ct) if($ct->{c_id});
$feedb->{u_rows} = $u_rows;
return $feedb;
}#end save_content
#save invoice address or text
sub save_text2contenttrans {
my $self = shift;
my $q = shift;
my $users_dms = shift;
my $c_id = shift;
my $c_id = shift || "";
$q->import_names('R');
my @keywords = $q->param;
@ -80,11 +145,12 @@ sub save_text2contenttrans {
}
}
$u_rows += $dbt->update_record($dbh,$update_ctt,$ctt);
#empty warn_time if warnstate not set
if(!$R::int06){
$dbt->update_one($dbh,$update_ctt,"warn_time=null",$c_id);
if($ctt->{c_id}){
$u_rows += $dbt->update_record($dbh,$update_ctt,$ctt);
#empty warn_time if warnstate not set
if(!$R::int06){
$dbt->update_one($dbh,$update_ctt,"warn_time=null",$c_id);
}
}
$feedb->{u_rows} = $u_rows;

View file

@ -142,7 +142,7 @@ sub save_account(){
my $c_id = shift;
my $varmerch = shift || "";
my $owner = shift || 0;
my $feedb = { message => "" };
my $table = "contentadr";
$q = new CGI;
$q->import_names('R');
@ -567,13 +567,14 @@ sub save_account(){
$ret = $ret_conflict if($ret_conflict);
print FILE "final ret: $ret \n" if($debug);
close(FILE) if($debug);
#if(!$ret){#we do it also on failures to get sync
#update operator with primary data after COPRI address edit
$dbt->update_operatorsloop($varenv{dbname},$ctadr->{c_id},"update");
return ($ret,"$i_rows-$u_rows-$d_rows");
$feedb->{u_rows} = $u_rows;
print FILE Dumper($feedb) . "\n" if($debug);
close(FILE) if($debug);
return ($ret,$feedb);
}
#insert/save/delete DMS users

View file

@ -32,8 +32,7 @@ sub new {
sub tpl(){
my $node_meta = shift;
my $users_dms = shift;
my $u_group = shift;
my $return = shift;
my $feedb = shift || {};
my $q = new CGI;
my $cf = new Config;
@ -48,17 +47,20 @@ sub tpl(){
my %varenv = $cf->envonline();
my $lang = "de";
my $dbh = "";
#print $dbt->{operator}->{$varenv{dbname}}->{oprefix};
my $rel_id = $1 if($R::rel_id && $R::rel_id =~ /(\d+)/);
my $c_id = $1 if($R::c_id && $R::c_id =~ /(\d+)/);
my $c_id = "";
$c_id = $1 if($R::c_id && $R::c_id =~ /(\d+)/);
$c_id = $feedb->{c_id} if($feedb->{c_id});
my $u_id = $1 if($R::u_id && $R::u_id =~ /(\d+)/);
$u_id = $1 if($R::c_idadr && $R::c_idadr =~ /(\d+)/ && $R::base_edit eq "new_dmsusers");
my ($edit,$copy_key,$save_key,$relate_key,$move_key,$delete_key);
my $tpl = {};
my @tpl_order = ();
my $edit_template = "";
my $bg_color = "grey";
my $bg_color = $node_meta->{bg_color} || "grey";
my $ctrel = {};
my $cttpos = {};
my $gesamt = 0;
@ -78,7 +80,6 @@ sub tpl(){
print $q->hidden(-name=>'c_id',-override=>'1', -value=>"$ctrel->{c_id}");
print $q->hidden(-name=>'rel_id',-override=>'1', -value=>"$ctrel->{rel_id}");
$bg_color = $varenv{background_color2};
$edit = "rel_edit";
#$relate_key = "relate_dialog4menu";
$move_key = "move_dialog4menu" if($node_meta->{tpl_id} == 205);#only Waren
@ -97,7 +98,6 @@ sub tpl(){
print $q->hidden(-name=>'c_id',-override=>'1', -value=>"$ctrel->{c_id}");
print $q->hidden(-name=>'rel_id',-override=>'1', -value=>"$ctrel->{rel_id}");
$bg_color = $varenv{background_color2};
$edit = "base_edit";
$save_key = "save_adr";
$edit_template = "$ctrel->{template_id}" . "000";
@ -122,7 +122,6 @@ sub tpl(){
$ctrel = $dbt->fetch_tablerecord($dbh,$ref);
print $q->hidden(-name=>'u_id',-override=>'1', -value=>"$ctrel->{u_id}");
$bg_color = $varenv{background_color2};
$edit = "base_edit";
$save_key = "save_dmsusers";
#print Dumper($node_meta->{tpl_id}) . "\n u_id:" . $u_id;
@ -138,11 +137,25 @@ sub tpl(){
print $q->hidden(-name=>'c_id',-override=>'1', -value=>"$ctrel->{c_id}");
print $q->hidden(-name=>'rel_id',-override=>'1', -value=>"$ctrel->{rel_id}");
$bg_color = $varenv{background_color2};
$edit = "rel_edit";
$save_key = "save_ctuser";
$tpl = $dbt->get_tpl($dbh,$node_meta->{tpl_id});
}elsif($node_meta->{ct_table} eq "contentuser" && $node_meta->{tpl_id} == 194 && $c_id){
my $ref = {
table => "$node_meta->{ct_table}",
fetch => "one",
template_id => "$node_meta->{tpl_id}",
c_id => "$c_id",
};
$ctrel = $dbt->fetch_record($dbh,$ref);
print $q->hidden(-name=>'c_id',-override=>'1', -value=>"$ctrel->{c_id}");
print $q->hidden(-name=>'rel_id',-override=>'1', -value=>"$ctrel->{rel_id}");
$edit = "base_edit";
$save_key = "save_contentcms";
$tpl = $dbt->get_tpl($dbh,$node_meta->{tpl_id});
}elsif($node_meta->{ct_table} eq "contenttranspos" && $node_meta->{tpl_id} == 221){
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
my $pref = {
@ -169,7 +182,6 @@ sub tpl(){
$gesamt = sprintf('%.2f', $gesamt);
}
$bg_color = $varenv{background_color2};
$edit = "base_edit";
$save_key = "save_pos";
my $tpl_id = $node_meta->{tpl_id};
@ -775,10 +787,7 @@ EOF
my $w = "width:25em;";
$w= "width:" . $2 . "em;" if($size =~ /area(\d+)-(\d+)/);
print $q->Tr();
print $q->td({-style=>'padding:4px 0 0 0px;',-colspan=>1},""),"\n";
print $q->td({-style=>'padding:4px 0 0 0px;',-colspan=>3},"$des"),"\n";
print $q->Tr();
print $q->td({-style=>'padding:4px 0 0 0px;',-colspan=>1},""),"\n";
print $q->td({-class=>'left_italic_cms',-colspan=>1},"$des"),"\n";
if($key eq "txt28" && $ctrel->{$key} =~ /SEPA-Lastschriftmandat/){
use URI::Encode qw(uri_encode uri_decode);
$ctrel->{txt28} = uri_decode($ctrel->{txt28});
@ -788,9 +797,6 @@ EOF
}
print $q->td({-class=>'content1_cms', -colspan=>'3'},$q->textarea(-id=>"$key", -class=>"etxt", -style=>"border: 1px solid silver;$h $w", -name=>"$key", -override=>'1',-default=>"$ctrel->{$key}")),"\n";
}
elsif($key =~ /txt02/ && $varenv{syshost} =~ /sharee/){
#nothing txt02=Datei aktiv=10=sharee-APP aktivierte Dokument
}
elsif($key =~ /txt15/ && $varenv{syshost} =~ /sharee/ && $node_meta->{tpl_id} == 202){
my $record_bonus = {c_id => 0};
my $pref_cc = {

View file

@ -25,7 +25,7 @@ sub tpl(){
my $mode = shift || "";
my $varenv = shift;
my $users_sharee = shift || { c_id => 0 };
my $return = shift || "";
my $feedb = shift || "";
my $q = new CGI;
my $but = new Buttons;

View file

@ -33,7 +33,6 @@ sub new {
sub tpl(){
my $node_meta = shift;
my $users_dms = shift;
my $u_group = shift;
my $return = shift || "";
my $q = new CGI;
@ -120,7 +119,7 @@ sub tpl(){
my $table = "content";
$searchref->{table_pos} = "contentpos";
if($node_meta->{tpl_id} == 199){
if($node_meta->{tpl_id} == 194 || $node_meta->{tpl_id} == 199){
$table = "contentuser";
$searchref->{table_pos} = "";
$searchref->{template_id_pos} = "";
@ -245,13 +244,17 @@ EOF
#new_edit and search (disabled for Statistik, Service-Config and DMS-Account view)
if($node_meta->{tpl_id} !~ /195|198|199/){
my $edit="rel_edit";
my $new_key="service_done";
my $search = "search";
print $q->Tr(),"\n";
print $q->td({-style=>"background-color:silver;$hstyle"},$but->singlesubmit1("detail_search","$search","","")),"\n";
print $q->td({-style=>"$hstyle"},"&nbsp;"),"\n";
print $q->td({-style=>"background-color:silver;$hstyle"},$but->singlesubmit1("detail_search","search","","")),"\n";
my $a_color = $node_meta->{bg_color} || "yellow";
if($node_meta->{tpl_id} =~ /194/){
my $edit="base_edit";
my $new_key="new_contentcms";#Text-CMS
print $q->td({-style=>"width:25px;background-color:$a_color;$hstyle"}, $but->singlesubmit2glyph("$edit","$new_key","$ib{$new_key}","background-color:$a_color;"));
}else{
print $q->td({-style=>"$hstyle"},"&nbsp;"),"\n";
}
#1. Search-fields
my $s_val = "";
@ -413,7 +416,7 @@ EOF
#$u_name = $ct_users->{$ct4rel->{$id}->{$key}}->{txt01} || $ct4rel->{$id}->{$key};
print $q->td({-class=>"$tdclass",-style=>"$tdstyle $set_style"},"$u_name"),"\n";
}elsif($key eq "ct_name" && $node_meta->{ct_table} eq "contentuser" && $node_meta->{tpl_id} == 199){
}elsif($key eq "ct_name" && $node_meta->{ct_table} eq "contentuser" && $node_meta->{tpl_id} =~ /194|199/){
my $spec_style = "";
$spec_style = "min-width:140px;";
print $q->td({-class=>"$tdclass",-style=>"$tdstyle $spec_style"},$q->a({-class=>"linknav3",-href=>"?node2edit=editpart\&c_id=$ct4rel->{$id}->{c_id}",-title=>"edit"},"$ct4rel->{$id}->{$key}")),"\n";

View file

@ -581,7 +581,7 @@ EOF
print $q->div({-style=>"clear:both;height:0.1px;"},""),"\n";
if($ctt->{txt30}){
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"}, "$ctt->{txt30}"),"\n";
}elsif( -f "$varenv{pdf}/$praefix-$ctt->{ct_name}.pdf" ){
}elsif( -f "$varenv{pdfinvoice}/$praefix-$ctt->{ct_name}.pdf" ){
print $q->start_form(),"\n";
print $q->hidden(-name=>'offset', -override=>'1', -value=>"$R::offset"),"\n" if($R::offset);
print $q->hidden(-name=>'limit', -override=>'1', -value=>"$R::limit"),"\n" if($R::limit);

View file

@ -86,14 +86,17 @@ if($todo eq "24h_occupied"){
$smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name});
$dbt->update_one($dbh,$update_pos,"int33=3",$cttpos->{$pid}->{c_id});
}
}elsif($dt1 >= $dt2_48h_occupied){
if($cttpos->{$pid}->{int33} != 2){
$todo = "48h_occupied";
print $dt1 . ">=" . $dt2_48h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n";
$smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name});
$dbt->update_one($dbh,$update_pos,"int33=2",$cttpos->{$pid}->{c_id});
}
}elsif($dt1 >= $dt2_24h_occupied){
}
#2023-01-17 disabled, 24h and 72h are enough
#elsif($dt1 >= $dt2_48h_occupied){
# if($cttpos->{$pid}->{int33} != 2){
# $todo = "48h_occupied";
# print $dt1 . ">=" . $dt2_48h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n";
# $smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name});
# $dbt->update_one($dbh,$update_pos,"int33=2",$cttpos->{$pid}->{c_id});
# }
#}
elsif($dt1 >= $dt2_24h_occupied){
if($cttpos->{$pid}->{int33} != 1){
$todo = "24h_occupied";
print $dt1 . ">=" . $dt2_24h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n";

View file

@ -29,7 +29,7 @@ sub tpl(){
my $mode = shift || "";
my $varenv = shift;
my $users_sharee = shift || "";
my $return = shift || "";
my $feedb = shift || "";
my $session="";
my $session_and="";
@ -56,7 +56,7 @@ sub tpl(){
print "<div class='container'>\n";
print "<div id='Contenttxt' style='margin-top:20px;padding-bottom:350px;'>\n";
$self->tplselect($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
$self->tplselect($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
print "</div>\n";
print "</div>\n";
#print "<script src='$varenv->{js_bootstrap}'></script>\n";
@ -71,9 +71,8 @@ sub tplselect(){
my $mode = shift || "";
my $varenv = shift;
my $users_sharee = shift || "";
my $return = shift || "";
my $feedb = shift || "";
my $u_id = $users_dms->{u_id} || "";
my $sort = "";
my $lang = "de";
my $tpl_id = $node_meta->{tpl_id};
@ -81,29 +80,22 @@ sub tplselect(){
if($node_meta->{main_id}){
if($tpl_id == 2){
require "Tpl/Anmelden.pm";
&Anmelden::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
&Anmelden::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
}elsif($tpl_id == 302 || $tpl_id == 302008 || $tpl_id == 302004){#Adresse
require "Tpl/FormEdit.pm";
&FormEdit::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
&FormEdit::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
}elsif($tpl_id == 308){
require "Tpl/PayoneSelect.pm";
&PayoneSelect::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
&PayoneSelect::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
}elsif($tpl_id == 197){
require "Tpl/Contact.pm";
&Contact::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
#}elsif($tpl_id == 1 || $tpl_id == 3){
# require "Tpl/Listing.pm";
# &Listing::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
&Contact::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
}
}
my $debug = "Mlogic --> (users_sharee->{c_id}: $users_sharee->{c_id} | ct_table: $node_meta->{ct_table} | parent_id: $node_meta->{parent_id} | main_id: $node_meta->{main_id} | tpl_id: $node_meta->{tpl_id} | u_id: $u_id | mode: $mode)";
my $debug = "Mlogic --> (users_sharee->{c_id}: $users_sharee->{c_id} | ct_table: $node_meta->{ct_table} | parent_id: $node_meta->{parent_id} | main_id: $node_meta->{main_id} | tpl_id: $node_meta->{tpl_id} | u_id: $users_dms->{u_id} | mode: $mode)";
print $q->div({-style=>'position:fixed;bottom:0%;right:2%;z-index:10;font-size:13px;'},"$debug"),"\n" if($users_sharee->{c_id} eq $varenv->{superu_id});
if($return && $return =~ /failure/){
require "Mod/Failure.pm";
&Failure::tpl("",$u_id,"","","","",$return);
}
}
1;

View file

@ -28,7 +28,7 @@ sub tpl(){
my $mode = shift || "";
my $varenv = shift;
my $users_sharee = shift || "";
my $return = shift || "";
my $feedb = shift || "";
my $q = new CGI;
my $cf = new Config;

View file

@ -27,7 +27,7 @@ sub tpl(){
my $mode = shift || "";
my $varenv = shift;
my $users_sharee = shift || "";
my $return = shift || "";
my $feedb = shift || "";
my $q = new CGI;
my $cf = new Config;

View file

@ -27,7 +27,7 @@ sub tpl(){
my $mode = shift || "";
my $varenv = shift;
my $users_sharee = shift || "";
my $return = shift || "";
my $feedb = shift || "";
my $q = new CGI;
my $cf = new Config;

View file

@ -33,7 +33,7 @@ sub tpl(){
my $mode = shift || "";
my $varenv = shift;
my $users_sharee = shift || "";
my $return = shift || "";
my $feedb = shift || "";
my $q = new CGI;
my $cf = new Config;
@ -115,7 +115,8 @@ Weitere Personen aus Ihrem Haushalt profitieren jedoch ebenfalls, falls Sie weit
table => "contenttrans",
fetch => "all",
int10 => "$ctrel->{c_id}",
keyfield => "c_id",
keyfield => "ct_name",
ct_name => "~::[1-9]",
};
@ -125,7 +126,7 @@ Weitere Personen aus Ihrem Haushalt profitieren jedoch ebenfalls, falls Sie weit
$ctt->{$id}->{wwwhost} = "$operator_hash->{$sharee_operator}";
$ctt->{$id}->{operator} = "$sharee_operator";
$ctt->{$id}->{basedir} = "$dbt->{copri_conf}->{basedir}/$dbt->{operator}->{$sharee_operator}->{dir_app}";
#print "$sharee_operator|$ctt->{$id}->{wwwhost}|$ctt->{$id}->{operator}|$ctt->{$id}->{basedir}<br>";
#print "$id|$sharee_operator|$ctt->{$id}->{wwwhost}|$ctt->{$id}->{operator}|$ctt->{$id}->{basedir}|$ctt->{$id}->{ct_name}<br>";
}
$ctt_all = { %$ctt_all, %$ctt };
@ -232,7 +233,7 @@ EOF
}
#subMenue--------
$submenu->tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
$submenu->tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
#-----------------
my $catch_failure=0;
@ -347,11 +348,10 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
}
print $q->div({-class=>'content2'}, "Nach der Mietradnutzung haben Sie hier die Möglichkeit die Mietvorgänge einzusehen und gebuchte Rechnungen als PDF herunterzuladen."),"\n";
print $q->div({-class=>'content2'}, "$bonus_ak"),"\n" if($R::success && $R::success eq "txt15");
print $q->div({-class=>'content2'}, "Aktuell liegen keine Buchungen vor."),"\n" if(!$cttpos_count);
}elsif($key =~ /barcode/ && $cttpos_count){
}elsif($key =~ /barcode/){
#print $q->div({-style=>'padding-top:1.5em;font-weight:bold;'},"Ihre Buchungsdaten der letzten 1 &frac12; Jahre im Überblick"),"\n";
if($cttpos_count){
print $q->div({-style=>'padding-top:1.5em;font-weight:bold;'},"Folgende Positionen liegen zur nächsten Abbuchung vor"),"\n";
my @tpl_posorder = ("txt01=Beschreibung","int04=Station","ct_name=(Rad) Nummer","int26=CO2","int02=Betrag");
@ -461,13 +461,17 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
}
print $q->end_table;
print "</div>\n";
}else{
print $q->div({-class=>'content2',-style=>'padding:0.5em 0;'}, "Aktuell liegen keine Mietvorgänge vor."),"\n";
}#end if $cttpos_count
my $i=0;
my $dtext = "";
print "<div style='clear:both;'>\n";
foreach my $id (sort { $ctt_all->{$b}->{ct_name} cmp $ctt_all->{$a}->{ct_name} } keys(%$ctt_all)){
if( -f "$ctt_all->{$id}->{basedir}/pdfinvoice/Rechnung-$ctt_all->{$id}->{operator}-$ctt_all->{$id}->{ct_name}.pdf" && $ctt_all->{$id}->{ct_name} =~ /\d/ && $coo){
if( -f "$ctt_all->{$id}->{basedir}/pdfinvoice/Rechnung-$ctt_all->{$id}->{operator}-$ctt_all->{$id}->{ct_name}.pdf" && $ctt_all->{$id}->{ct_name} =~ /\d/ && $coo){
#print "$ctt_all->{$id}->{basedir}/pdfinvoice/Rechnung-$ctt_all->{$id}->{operator}-$ctt_all->{$id}->{ct_name}.pdf && $ctt_all->{$id}->{ct_name} =~ /\d/ && $coo<br />";
$i++;
my $invoice_time = $ctt_all->{$id}->{invoice_time} || $ctt_all->{$id}->{mtime};
$invoice_time = $lb->time4de($invoice_time,0);
@ -549,15 +553,15 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
if($key eq "txt15"){
if($R::failure =~ /^txt15/){
$autofocus = "autofocus";
$label_des = "<span style=color:$red>$bonus_avail</span>";
$bonus_desc = "<span style=color:$red>$bonus_avail</span>";
}
if($R::failure =~ /conflict_txt15/){
$label_des = "<span style=color:$red>$bonus_conflict</span>";
$bonus_desc = "<span style=color:$red>$bonus_conflict</span>";
}
my $saved_coupon = "";
$saved_coupon = "$ctadrcoupon->{sharee_kn}->{txt15}" if($ctadrcoupon->{sharee_kn}->{txt15});
print $q->label({-for=>"$key", -style=>'padding-top:1.5em;'},"$bonus_desc $label_des"),"\n";
print $q->label({-for=>"$key", -style=>'padding-top:1.5em;'},"$bonus_desc"),"\n";
print "<input id='$key' type='text' class='form-control' name='$key' value='$saved_coupon' override $autofocus />\n";
print $q->div("&nbsp");
foreach my $opid (keys(%$ctadrcoupon)){

View file

@ -1,177 +0,0 @@
package Listing;
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (c) Rainer Gümpelein, TeilRad GmbH
#
use strict;
use warnings;
use CGI ':standard';
use Lib::Config;
use Mod::Buttons;
use Mod::Libenz;
use Mod::Libenzdb;
use Mod::DBtank;
use Encode;
use Data::Dumper;
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 $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 $user_agent = $q->user_agent();
my @tpl_order = split /,/,$node_meta->{tpl_order};
my $main_ids = $node_meta->{main_id};
my @viewsel = split /\//,$1 if($path =~ /^\/(.*)/);
my $session="";
my $session_and="";
if(length($R::sessionid) > 20){
$session = "?sessionid=$R::sessionid";
$session_and = "&sessionid=$R::sessionid";
}
my $ct4rel = {};
my $scol = "sort";
my $sort_updown = "up";
if($path =~ /NEWS/){
$scol = "date_time01";
$sort_updown = "down";
#$scol = "date_time01";
}
my $content2 = "content2";
my $content_img = "pic-float";
$ct4rel = $db->collect_ct4rel2("content",$main_ids,$lang,"","","","","",$users_dms->{u_id});
print "<div id='Contentapp'>\n";
#Content sequential
#BIG LOOP content table
foreach my $id (sort {
if($sort_updown eq "down"){
if ($scol =~ /barcode|int|sort/) {
$ct4rel->{$b}->{$scol} <=> $ct4rel->{$a}->{$scol}
}else{
lc($ct4rel->{$b}->{$scol}) cmp lc($ct4rel->{$a}->{$scol})
}
}else{
if ($scol =~ /barcode|int|sort/) {
$ct4rel->{$a}->{$scol} <=> $ct4rel->{$b}->{$scol}
}else{
lc($ct4rel->{$a}->{$scol}) cmp lc($ct4rel->{$b}->{$scol})
}
}
} keys(%$ct4rel)){
my $j=0;
my $date_time;
my $uritxt_key;
foreach (@tpl_order){
my ($key,$des,$size) = split /=/,$_;
$ct4rel->{$id}->{$key} = $q->unescapeHTML("$ct4rel->{$id}->{$key}");
$ct4rel->{$id}->{$key} = $lb->newline($ct4rel->{$id}->{$key},"","");
my $datamain_id = $ct4rel->{$id}->{main_id};
my $dir_main = "$varenv->{data}/$datamain_id/$ct4rel->{$id}->{c_id}";
my $dir_thumb = "$varenv->{data}/$datamain_id-thumb/$ct4rel->{$id}->{c_id}";
my $dir_resize = "$varenv->{data}/$datamain_id-resize/$ct4rel->{$id}->{c_id}";
if($key =~ /img/ && $ct4rel->{$id}->{rel_id}){
#print "<div class=''>\n";
if( -d "$dir_resize"){
my @pics = $lb->read_dirfiles($dir_resize,"\.JPG|\.JPEG|\.PNG","file");
foreach(@pics){
print $q->img({-id=>"$content_img" ,-src=>"$varenv->{metahost}/data/$datamain_id-resize/$ct4rel->{$id}->{c_id}/$_"}),"\n" if($_ =~ /\w/);
}
}
#print "</div>\n";
print $q->div({-style=>'clear:both;'},""),"\n";
}elsif($key =~ /pdf/){
if( -d "$dir_main"){
my @pdfs = $lb->read_dirfiles($dir_main,"\.JPG|\.JPEG|\.PNG","file","not");
foreach(@pdfs){
print $q->div($q->a({-href=>"$varenv->{wwwhost}/FileOut?file=$datamain_id/$ct4rel->{$id}->{c_id}/$_$session_and", -target=>'_default', -title=>'Download',-type=>'application/octet-stream'}, $q->img({-src=>"$varenv->{metahost}/glyphicons/file-any.png", -style=>'width:50px;'}), "$_")),"\n";
}
}
}elsif($key =~ /date_time/ && $ct4rel->{$id}->{$key} =~ /\d{4}-\d{2}-\d{2}/){
$date_time = $lb->time4de("$ct4rel->{$id}->{$key}","","Date_to_Text_Long");
$date_time =~ s/^\w+,\s\w+//;
}elsif($key =~ /node_name/){
my $ct_users;
$ct_users = $db->get_owner($ct4rel->{$id}->{owner}) if($ct4rel->{$id}->{owner});
$ct4rel->{$id}->{mtime} = $lb->time4de($ct4rel->{$id}->{mtime},"1") if($ct4rel->{$id}->{mtime});
print $q->div({-class=>'content2_group'},"Absender: $ct_users->{u_name} | $ct4rel->{$id}->{mtime}"),"\n";
}elsif($key =~ /ct_name/){
my $debug;
if($users_dms->{u_id}){
print $q->div({-class=>'content_title2',-style=>"background-color:silver;padding:0.2em;"},$q->a({-class=>'editnav',-href=>"$path/manager?node2edit=edit_content\&rel_id=$ct4rel->{$id}->{rel_id}", -title=>"edit content"}, "$ct4rel->{$id}->{$key}"),$debug),"\n";
print $q->div({-class=>'content_title2'},"$date_time"),"\n" if($date_time);
}elsif(!$R::sharee_edit){
print $q->div({-class=>'content_title2'},"$date_time"),"\n" if($date_time);
print $q->div({-id=>"$ct4rel->{$id}->{c_id}",-class=>'content_title2'},"$ct4rel->{$id}->{$key}"),"\n" if($ct4rel->{$id}->{$key} =~ /[A-Za-z]/);
print $q->div({-style=>""},"$debug"),"\n";
}
}elsif($key =~ /uri(\d+)/ && $ct4rel->{$id}->{$key} =~ /http/){
$uritxt_key = "txt" . $1;
print $q->div({-class=>'content_direct2',-style=>'font-size:14px;'},$q->a({-href=>"$ct4rel->{$id}->{$key}"},"zum Projekt")),"\n";
}elsif($key =~ /txt|int/ && $ct4rel->{$id}->{$key} && "$key" ne "$uritxt_key"){
if($key =~ /txt/ && $size =~ /area(\d+)/ && $ct4rel->{$id}->{$key}){
#phone tag
if($ct4rel->{$id}->{$key} =~ /Telefon|Mobile/){
$ct4rel->{$id}->{$key} =~ s/([\s0-9-]+)/\<a href=\'tel:00$1\'\>$1\<\/a\>/;
}
#email tag with little coding against grabber
if($ct4rel->{$id}->{$key} =~ /(\w+\@[\w-]+\.de)/){
$ct4rel->{$id}->{$key} =~ s/(\w+\@[\w-]+\.de)/\<a href=\'mailto:$1\'\>$1\<\/a\>/;
$ct4rel->{$id}->{$key} =~ s/\@/\&\#64\;/g;
#$ct4rel->{$id}->{$key} =~ s/\.de/\&\#46\;de/g;
}
#Development
if($ct4rel->{$id}->{$key} =~ /(www\.GNU-Systems\.de)/){
$ct4rel->{$id}->{$key} =~ s/(www\.[\w-]+\.de)/\<a href=\'http:\/\/$1\' target=\'_blank\'\>$1\<\/a\>/g;
}
$ct4rel->{$id}->{$key} =~ s/\\//g;
print $q->div({-class=>"$content2"}, "$ct4rel->{$id}->{$key}"),"\n";
}elsif($ct4rel->{$id}->{$key} && $size !~ /checkbox/){
print $q->div({-class=>"$content2"}, "$ct4rel->{$id}->{$key}"),"\n";
}
}
}
print $q->div({-class=>"$content2"},"&nbsp;"),"\n";
}#end if
print "</div>\n";
}
1;

View file

@ -28,7 +28,7 @@ sub tpl(){
my $mode = shift || "";
my $varenv = shift;
my $users_sharee = shift || "";
my $return = shift || "";
my $feedb = shift || "";
my $q = new CGI;
my $cf = new Config;
@ -58,14 +58,14 @@ sub tpl(){
print "<div id='Contentapp'>\n";
#subMenue--------
$submenu->tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
$submenu->tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
#-----------------
#Selected Payment
if($ctrel->{int03} == 1 || $ctrel->{int03} == 3){
$paySEPA->tpl("309",$node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
$paySEPA->tpl("309",$node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
}elsif($ctrel->{int03} == 2){
$payCC->tpl("310",$node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
$payCC->tpl("310",$node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
}
print "</div>\n";

View file

@ -32,8 +32,9 @@ sub tpl(){
my $mode = shift || "";
my $varenv = shift;
my $users_sharee = shift || "";
my $return = shift || "";
my $feedb = shift || "";
my $return = "";
my $q = new CGI;
my $bw = new Basework;
my $lb = new Libenz;
@ -129,12 +130,8 @@ sub tpl(){
if($users_dms->{u_id} && $main_id){
if(ref($return) eq "HASH"){
$return = $bw->return_feedback($node_meta,$users_dms,$return);
}else{
#deprecated
$return = $lb->return_feedback($return,$node_meta->{node_name},$users_dms->{owner}) if($return !~ /shareejson/);
}
$feedb->{message} .= "\n$return" if($return);
$bw->return_feedback($node_meta,$users_dms,$feedb);
if($main_id >= "100000"){
my $mstyle="";
@ -294,7 +291,7 @@ sub tpl(){
print $q->div({-style=>'position:fixed;bottom:0%;right:1%;z-index:10;padding:2px;font-size:13px;'},"$debug",$q->a({-style=>'color:black;text-decoration: none;',-href=>'https://sharee.bike',-target=>'_blank'},"sharee.bike &copy; TeilRad GmbH 2022")),"\n";
print $q->div({-style=>'padding: 30px 0 0 0;'}, ""), "\n";
$self->tplselect($node_meta,$users_dms,$mode,$varenv,$return);
$self->tplselect($node_meta,$users_dms,$mode,$varenv,$feedb);
print "</div>\n";
}#end logedin environment
@ -307,8 +304,9 @@ sub tplselect(){
my $users_dms = shift;
my $mode = shift || "";
my $varenv = shift;
my $return = shift || "";
my $feedb = shift || "";
my $return = "";
my $sort = "";
my $lang = "de";
my $tpl_name = $node_meta->{tpl_name};
@ -316,42 +314,41 @@ sub tplselect(){
my $ct_table = $node_meta->{ct_table};
my $parent_id = $node_meta->{parent_id};
my $main_id = $node_meta->{main_id};
my $u_id = $users_dms->{u_id};
#print Dumper($node_meta);
#exit;
if($node_meta->{tpl_id} =~ /195|199/ && $node_meta->{ct_table} eq "contentuser"){
if($node_meta->{tpl_id} =~ /194|195|199/ && $node_meta->{ct_table} eq "contentuser"){
require "Tpl/SubListe.pm";
$return = &SubListe::tpl($node_meta,$users_dms,$mode,$return);
$return = &SubListe::tpl($node_meta,$users_dms,$feedb);
}elsif($node_meta->{ct_table} eq "contentuser"){
require "Tpl/MandantConf.pm";
$return = &MandantConf::tpl($node_meta,$users_dms,$mode,$return);
$return = &MandantConf::tpl($node_meta,$users_dms,$mode,$feedb);
}elsif($node_meta->{tpl_id} == 1 && $node_meta->{main_id} == 200017){
require "Tpl/Karte_osm.pm";
&Karte_osm::tpl($node_meta,$users_dms,$mode,$varenv,"",$return);
&Karte_osm::tpl($node_meta,$users_dms,$mode,$varenv,"",$feedb);
}elsif($node_meta->{ct_table} =~ /contentpos|contentadrpos|users$/){#contentpos or contentadrpos
require "Tpl/SubListe.pm";
$return = &SubListe::tpl($node_meta,$users_dms,$mode,$return);
$return = &SubListe::tpl($node_meta,$users_dms,$feedb);
}elsif($node_meta->{ct_table} =~ /content$|contentadr$|contenttrans$/){
require "Tpl/Liste3.pm";
$return = &Liste3::tpl($node_meta,$users_dms,$mode,$return);
$return = &Liste3::tpl($node_meta,$users_dms,$mode,$feedb);
}elsif($node_meta->{ct_table} =~ /contenttranspos|contenttheftpos/){
require "Tpl/Calorin.pm";
&Calorin::tpl($node_meta,$users_dms,$mode,$return);
&Calorin::tpl($node_meta,$users_dms,$mode,$feedb);
}
##Modalbox things##
if($return !~ /failure/){
if($return =~ /failure/ || (ref($feedb) eq "HASH" && $feedb->{message} =~ /failure/)){
$feedb->{message} .= "\n$return" if($return);
require "Mod/Failure.pm";
&Failure::tpl($varenv,$users_dms->{u_id},$feedb);
}else{
if(($R::ct_trans !~ /close/) && ($ct_table =~ /contenttrans/) && ($R::ct_trans || $R::trans2edit || $R::ctpos_activ || $R::select_part || $R::set_main_id)){
&Modalbox::mobox($node_meta,$users_dms,$mode,$return);
&Modalbox::mobox($node_meta,$users_dms,$return);
}elsif(($R::ct_trans !~ /close/) && ($ct_table =~ /content$|contentadr|contentuser|contentpos|users$|contenttranspos/ && ($R::ct_trans || $R::rel_edit || $R::base_edit)) || ($R::node2edit && $R::node2edit =~ /edit/)){
&Modalbox3::mobox3($node_meta,$users_dms,$mode,$return) if($R::rel_edit !~ /delete|save/ && $R::ct_trans !~ /delete/ && $R::base_edit !~ /delete|save/ && !$R::service_id);
&Modalbox3::mobox3($node_meta,$users_dms,$feedb,$return,$mode) if($R::rel_edit !~ /delete|save/ && $R::ct_trans !~ /delete/ && $R::base_edit !~ /delete|save/ && !$R::service_id);
}
}
if($return =~ /failure/){
require "Mod/Failure.pm";
&Failure::tpl("",$u_id,"","","","",$return);
}
}
1;

View file

@ -27,7 +27,7 @@ sub tpl(){
my $mode = shift || "";
my $varenv = shift;
my $users_sharee = shift || "";
my $return = shift || "";
my $feedb = shift || "";
my $user_agent = $q->user_agent();
@ -189,9 +189,9 @@ sub tpl(){
if(($node_meta->{tpl_id} == 1 || $node_meta->{tpl_id} == 3) && $node_meta->{main_id} == 200017){
require "Tpl/Karte_osm.pm";
&Karte_osm::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
&Karte_osm::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
}else{
$self->tplselect($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
$self->tplselect($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
}
@ -266,11 +266,6 @@ EOF
my $debug_footer = "Mlogic --> (syshost: $varenv->{syshost} | users_sharee->{c_id}: $users_sharee->{c_id} | ct_table: $node_meta->{ct_table} | parent_id: $node_meta->{parent_id} | main_id: $node_meta->{main_id} | tpl_id: $node_meta->{tpl_id} | $users_dms->{u_id})";
print $q->div({-style=>'position:fixed;bottom:0%;left:2%;z-index:10;font-size:13px;'},"$debug_footer"),"\n" if($users_sharee->{c_id} eq $varenv->{superu_id});
if($return && $return =~ /failure/){
require "Mod/Failure.pm";
&Failure::tpl("",$users_dms->{u_id},"","","","",$return);
}
}
#2021-05-05 changed to Mlogic
@ -281,7 +276,7 @@ sub tplselect(){
my $mode = shift || "";
my $varenv = shift;
my $users_sharee = shift || "";
my $return = shift || "";
my $feedb = shift || "";
my $lang = "de";
my $tpl_id = $node_meta->{tpl_id};
@ -289,17 +284,17 @@ sub tplselect(){
if($node_meta->{main_id}){
if($tpl_id == 2){
require "Tpl/Anmelden.pm";
&Anmelden::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
&Anmelden::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
}elsif($tpl_id == 302 || $tpl_id == 302008 || $tpl_id == 302004){#Adresse
require "Tpl/FormEdit.pm";
&FormEdit::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
&FormEdit::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
}elsif($tpl_id == 308){
require "Tpl/PayoneSelect.pm";
&PayoneSelect::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
&PayoneSelect::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
}elsif($tpl_id == 197){
require "Tpl/Contact.pm";
&Contact::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$return);
&Contact::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
}
}