mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-11 06:17:27 +02:00
text-cms init and return feedb change
This commit is contained in:
parent
c1fe6c235c
commit
a61920988c
23 changed files with 267 additions and 408 deletions
|
@ -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";
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"}," "),"\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"}," "),"\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";
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue