service new_task and style conf refactoring

This commit is contained in:
ragu 2023-01-05 18:11:24 +01:00
parent 14d1891695
commit 8607a42e34
18 changed files with 54 additions and 92 deletions

View file

@ -5,14 +5,21 @@ html {
overflow-y: scroll;
}
html, body {
background-color:#d9d6ce;
color: black;
font-family: Arial;
font-size:100.01%;
margin: 0; padding: 0;
text-align:left;
html,body {
background-color: #d9d6ce;
color: #3f3f3f;
font-family:'Arial';
background-repeat: no-repeat;
background-position: right bottom;
background-attachment: fixed;
background-size: cover;
font-size: 100.01%;
line-height: 1;
margin: 0;
padding: 0;
text-align: center;
}
div {
font-family: Arial,sans-serif;
font-size: 1em;

View file

@ -832,13 +832,15 @@ sub service_work {
$key_change .= "_" . $j;
}
my $work_val = "$pos_record->{$id}->{$key}";
$work_val = "" if($pos_record->{$id}->{$key} eq "::new_task::");
$return->{$article}->{$key_change}->{service_id} = "$pos_record->{$id}->{c_id}";
$return->{$article}->{$key_change}->{work_id} = "$key";
$return->{$article}->{$key_change}->{work_name} = "$val";
$return->{$article}->{$key_change}->{interval} = "$interval";
$return->{$article}->{$key_change}->{time_over} = "$time_over";
$return->{$article}->{$key_change}->{service_type} = "$service_type";
$return->{$article}->{$key_change}->{work_val} = "$pos_record->{$id}->{$key}";
$return->{$article}->{$key_change}->{work_val} = "$work_val";
$return->{$article}->{$key_change}->{mtime} = "$pos_record->{$id}->{mtime}";
$return->{$article}->{$key_change}->{user_name} = "$u_name";
$return->{$article}->{$key_change}->{owner} = "$pos_record->{$id}->{owner}";

View file

@ -753,10 +753,12 @@ elsif($q->param('request') eq "service_done"){
if(ref($xresponse->{$article}) eq "HASH"){
#$bw->log("service_done xresponse",$xresponse->{$article},"");
#if no new_task then select last service_id with work_duration < 1 day
my $service_id = "";
#select last service_id with work_duration < 1 day
foreach my $id (sort { $xresponse->{$article}->{$a}->{mtime} cmp $xresponse->{$article}->{$b}->{mtime} } keys (%{$xresponse->{$article}})){
if(!$q->param('new_task') && $q->param('work_val') ne "::new_task::"){
foreach my $id (sort { $xresponse->{$article}->{$a}->{mtime} cmp $xresponse->{$article}->{$b}->{mtime} } keys (%{$xresponse->{$article}})){
$service_id = $id if($id > 1);
}
}
my $rows=0;

View file

@ -418,7 +418,7 @@ sub sig_booking {
my $endpoint = "$dbt->{operator}->{$varenv->{dbname}}->{endpoint}/";
my %json = ();
$ctadr->{txt08} =~ s/[a-z]-/-/; $ctadr->{txt08} =~ s/[a-z]_/_/; $ctadr->{txt08} =~ s/[a-z]\@/\@/i;
$ctadr->{txt08} =~ s/[a-z]-/-/; $ctadr->{txt08} =~ s/[a-z]_/_/; $ctadr->{txt08} =~ s/[0-9a-z]\@/\@/i; $ctadr->{txt08} =~ s/[0-9a-z]\@/\@/i; $ctadr->{txt08} =~ s/\@(\w{1,2})\w+\.(\w+)/\@$1email\.$2/i;
$ctadr->{txt08} =~ s/[a-z]\./\./ if($ctadr->{txt08} =~ /\.\w+\@/);
#reservation start
if($todo eq "reserve"){

View file

@ -706,25 +706,6 @@ sub handler {
}
my $dyn_css = "";
if(1==1){
my $background = "";
$background = "$varenv{metahost}/img/$varenv{background_image}" if($varenv{background_image});
$dyn_css = "
html,body {
background-image:url('$background');
background-repeat: $varenv{background_repeat};
background-position: right bottom;
background-attachment:fixed;
background-size:$varenv{background_size};
font-size: $varenv{font_size};
line-height: $varenv{line_height};
margin: 0; padding: 0;
text-align:$varenv{background_align};
}\n";
}
my $url = "$varenv{wwwhost}/$path";
my $onload="";

View file

@ -128,7 +128,7 @@ sub admin_tpl(){
print $q->Tr();
if(1==1){
if(($users_dms->{u_id} > 0) || ($u_group eq "admin")){
print "<td style='background:$varenv{background_color2};margin:1px 0;padding:2px;' colspan='2' nowrap>\n";
print "<td style='background:#a7a18f;margin:1px 0;padding:2px;' colspan='2' nowrap>\n";
#print "<td style='margin:1px 0;padding:0px;' colspan='2' nowrap>\n";
print $but->singlesubmit7("rel_edit","save_relation","$ib{save_relation}","","modal_position(xpos,ypos)");
#look at dialog4menu, it seems better. vise a verse

View file

@ -221,9 +221,9 @@ sub tpl(){
#8=get_position after validate
if(!$R::theft_details){
$search->{int10} = "IN::(7,8)";
$search->{int03} = ">::1";#move count
$search->{int07} = ">::1";#speed
$search->{int08} = ">::50";#meter
$search->{int03} = ">::$dbt->{copri_conf}->{theftalarm}->{move_count}";#move count
$search->{int07} = ">::$dbt->{copri_conf}->{theftalarm}->{speed}";#speed
$search->{int08} = ">::$dbt->{copri_conf}->{theftalarm}->{meter}";#meter
}
$cttpos = $dbt->collect_theftpos($dbh,$search);
}
@ -415,7 +415,7 @@ sub tpl(){
if($users_dms_primary->{u_id} && $dbt->{copri_conf}->{contributors} && $users_dms_primary->{u_id} =~ /$dbt->{copri_conf}->{contributors}/){
$pos_id = $q->div({-class=>"popup",-onclick=>"toggle_box('$pid')"},"$cttpos->{$pid}->{c_id}", $q->span({-class=>"popuptext",-id=>"$pid"},"$pos_details"));
$user_device = "";
$user_device .= " &rarr; end-ack" if($cttpos->{$pid}->{int27});
$user_device .= " &rarr; endAck" if($cttpos->{$pid}->{int27});
my $txt26 = $cttpos->{$pid}->{txt26};
$txt26 = substr($cttpos->{$pid}->{txt26},0,25) if(length($cttpos->{$pid}->{txt26}) > 20);
$user_device .= " &rarr; $txt26" if($txt26);

View file

@ -171,7 +171,7 @@ sub tpl(){
$db->users_up("col_sort","0",$users_dms->{owner}) if("$scol" ne "$users_dms->{col_sort}");
}
my $limit = $R::limit || $varenv{limit};
my $limit = $R::limit || 250;
my $offset = $R::offset || "0";
#backward | forward

View file

@ -60,8 +60,7 @@ sub tpl(){
my $message = "";
my $s_owner_id = "";
my $offset = $R::offset || "0";
$offset = 0 if($node_meta->{int10} && $node_meta->{int10} < $varenv{limit});
my $limit = $R::limit || $varenv{limit};
my $limit = $R::limit || 250;
my $searchref = {
time => $time,

View file

@ -426,6 +426,14 @@ sub get_positions {
my $c_id = $dbt->insert_contentoid($dbh,$insert);
print FILE "insert sub get_positions:" . Dumper($insert);
#theft mailing
if($theftmove_count > $dbt->{copri_conf}->{theftalarm}->{move_count} && $resp->{speed} $dbt->{copri_conf}->{theftalarm}->{speed} && $resp->{attributes}->{distance} > $dbt->{copri_conf}->{theftalarm}->{meter}){
#send mail
#system("$varenv{basedir}/src/scripts/mailTransportcms.pl '$varenv->{syshost}' 'send_alarm2hotline' '' ''");
print FILE "send_alarm2hotline, condition: $theftmove_count > $dbt->{copri_conf}->{theftalarm}->{move_count} && $resp->{speed} $dbt->{copri_conf}->{theftalarm}->{speed} && $resp->{attributes}->{distance} > $dbt->{copri_conf}->{theftalarm}->{meter}\n";
}
}
}
}

View file

@ -169,10 +169,12 @@ sub get_tripsum {
if(1==1){
my $update_pos = {
table => "contenttranspos",
owner => $owner,
mtime => "now()",
int26 => 0,
};
#disabled to keep real rental owner id
#owner => $owner,
#mtime => "now()",
foreach my $resp (@{ $response_in }) {
if($ctpos->{int13} eq $resp->{deviceId}){
print FILE "device Id: $resp->{deviceId}" . "\n";

View file

@ -0,0 +1 @@
../../../../../sharee.bike/copri-bike/main/src/scripts/mailTransportcms.pl