v20191217
authorKilian Saffran <ksaffran@dks.lu>
Wed, 18 Dec 2019 06:55:57 +0000 (07:55 +0100)
committerKilian Saffran <ksaffran@dks.lu>
Wed, 18 Dec 2019 06:55:57 +0000 (07:55 +0100)
63 files changed:
.htaccess
backoffice/api/db.cgi
backoffice/api/file.cgi
backoffice/api/index.cgi
backoffice/api/lib/sendemail.pm
backoffice/api/lib/session.pm
backoffice/api/tmp/mailbody_ksaffran_dks.lu.txt [new file with mode: 0644]
backoffice/api/tmp/sendmail.log [new file with mode: 0644]
backoffice/api/tmp/sql.log [deleted file]
backoffice/api/upload.cgi
backoffice/data/schemata/defaultcompany.schema.sql
backoffice/img/icons/calendar.svg
backoffice/img/icons/calendar_white.svg
backoffice/img/icons/poticon.svg [new file with mode: 0644]
backoffice/img/pottop.png [new file with mode: 0644]
backoffice/index.cgi
backoffice/js/admin.js
backoffice/js/formsave.js
backoffice/js/module_global.js
backoffice/js/request.js
backoffice/tmp/sql.log [deleted file]
backoffice/tmpl/block/dlgdeleterow.tt
backoffice/tmpl/module/companies/index.js
backoffice/tmpl/module/companies/index.tt
backoffice/tmpl/module/companies/widgets/companies/companies.js
backoffice/tmpl/module/companies/widgets/companies/frm_companies.tt
backoffice/tmpl/module/dashboard/index.tt
backoffice/tmpl/module/planning/index.tt
backoffice/tmpl/module/planning/widgets/reportperiod/dlg_reportperiod.tt
backoffice/tmpl/module/planning/widgets/reportperiod/reportperiod.js
backoffice/tmpl/module/planning/widgets/reportperiod/tbar_reportperiod.tt
backoffice/tmpl/module/planning/widgets/staffworkplan/staffworkplan.js
backoffice/tmpl/module/planning/widgets/staffworkplan/tbar_staffworkplan.tt
backoffice/tmpl/module/profile/dlgusername.tt
backoffice/tmpl/module/profile/index.js
backoffice/tmpl/module/profile/index.tt
backoffice/tmpl/module/staff/index.js
backoffice/tmpl/module/staff/index.tt
backoffice/tmpl/module/staff/widgets/staff/frm_staff.tt [new file with mode: 0644]
backoffice/tmpl/module/staff/widgets/staff/staff.js [new file with mode: 0644]
backoffice/tmpl/module/staff/widgets/staff/tbar_staff.tt [new file with mode: 0644]
backoffice/tmpl/module/staff/widgets/staff/tbl_staff.tt [new file with mode: 0644]
backoffice/tmpl/module/users/index.js
backoffice/tmpl/module/users/index.tt
backoffice/tmpl/module/users/widgets/users/dlg_users.tt [new file with mode: 0644]
backoffice/tmpl/module/users/widgets/users/tbar_users.tt [new file with mode: 0644]
backoffice/tmpl/module/users/widgets/users/tbl_users.tt [new file with mode: 0644]
backoffice/tmpl/module/users/widgets/users/users.js [new file with mode: 0644]
backoffice/tmpl/skeleton/index.tt
backoffice/tmpl/skeleton/module.tt
dev/db/gendefaultschema.sh
dev/db/l/man/man3/BusinessTaxVATValidation.3 [moved from dev/db/l/man/man3/Business::Tax::VAT::Validation.3 with 100% similarity]
dev/db/potlu_db.newcompanyschema.pg.schema.sql
dev/db/potlu_db.portanova.pg.data.sql
dev/db/potlu_db.portanova.pg.full.sql
dev/db/potlu_db.portanova.pg.schema.sql
dev/db/potlu_db.public.pg.data.sql
dev/db/potlu_db.public.pg.full.sql
dev/db/potlu_db.public.pg.install.schema.sql [new file with mode: 0644]
dev/db/potlu_db.public.pg.schema.sql
form.txt [deleted file]
index.cgi
tmpl/skeleton/index.tt

index 8660ace..532d804 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -2,7 +2,7 @@
 #RewriteCond %{SERVER_PORT} 80 
 #RewriteRule ^(.*)$ https://www.dks.lu/$1 [R,L]
 #AddType application/octet-stream .pdf
-SetEnv PERL5LIB "/home/kilian/perl5/lib/perl5"
+SetEnv PERL5LIB "/usr/home/dksalu/public_html/pot_lu/backoffice/api/lib/perl5"
 RewriteEngine on
 #dev-mode begin
 DirectoryIndex index.cgi index.html 
index 5233b5c..1c5fa1f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl
+#!/usr/local/bin/perl
 use strict;
 use lib ('./lib/perl5');
 use lib ('./lib');
index f0af54d..c7673a8 100755 (executable)
@@ -1,4 +1,4 @@
-#!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl
+#!/usr/local/bin/perl
 
 use strict;
 use lib ('./lib/perl5');
index 56cf968..58a49ab 100755 (executable)
@@ -1,4 +1,4 @@
-#!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl
+#!/usr/local/bin/perl
 use strict;
 use lib ('./lib/perl5');
 use lib ('./lib');
@@ -6,7 +6,7 @@ use CGI;
 use CGI::Cookie;
 #use CGI::Carp qw/fatalsToBrowser/;
 use File::Basename;
-use Business::Tax::VAT::Validation; 
+use Business::Tax::VAT::Validation;
 use JSON::PP;
 
 use dksconfig qw/$sitecfg/;
@@ -169,7 +169,14 @@ if (($cgi->request_method() eq "GET") || ($cgi->request_method() eq "POST")){
       if ($dbschema->{cnt} > 1){
         $dbsnum = int($dbschema->{cnt}) + 1;
       }
-      $html->{result}->{newschema} = $cmpy.$dnsnum;
+      $html->{result}->{newschema} = $cmpy.$dbsnum;
+    }
+    if ($p->{fn} eq "installschema"){
+      my $schemasql = "select count(*) as cnt from information_schema.schemata where schema_name='".$db->securetext($p->{schemaname})."';";
+       my $dbschema = $db->dbquery($schemasql);
+      if ($dbschema->{cnt} eq "0"){
+        $db->createdefinedschema("defaultcompany",$db->securetext($p->{schema}));
+      }
     }
   }
   
index fd53b2c..65de05f 100644 (file)
@@ -13,9 +13,9 @@ sub new {
     my $self = bless {}, $class;
     $self->{server} = "mail.your-server.de";
     $self->{port} = "587";
-    $self->{user} = 'webmaster@solana-architecture.lu';
-    $self->{password} = "FLxCtIQs720K8n79";
-    $self->{from} = 'webmaster@solana-architecture.lu';
+    $self->{user} = 'ksaffran@dks.lu';
+    $self->{password} = "FB1ia1ka";
+    $self->{from} = 'support@dks.lu';
     return $self;
 }
 
@@ -35,10 +35,6 @@ sub sendemail(){
   if (keys(%{$tmpl}) > 0){
     $tmpl = $tmpl->{0};
   }
-  # open (LOG,">>tmp/sendmail.log");
-  # print LOG $ENV{SCRIPT_FILENAME};
-  # print LOG "SEND EMAIL:".Dumper($data)."\n";
-  # close(LOG);
   my $datasql = $tmpl->{'emaildatasql'};
   $data->{id} = $iduser;
   foreach my $key (keys(%{$data})){
@@ -46,9 +42,6 @@ sub sendemail(){
     my $repl = $data->{$key};
     $datasql =~ s/$srch/$repl/g;
   }
-  # open (LOG,">>tmp/sendmail.log");
-  # print LOG "TEMPLATE DATA:".$datasql."\n";
-  # close(LOG);
   $maildata = $db->dbquerysorted($datasql);
   
   $body = $tmpl->{'emailtext'};
@@ -68,14 +61,6 @@ sub sendemail(){
   $bodytmpl =~ s/%%siteurl%%/$siteurl/g;
   $bodytmpl =~ s/%%SITEURL%%/$siteurl/g;
   $bodytmpl =~ s/\r//g;
-  #$bodytmpl =~ s/"/\\\"/g;
-  #PROD REPLACE all not replaced DATA       
-  #$bodytmpl =~ s/%%\w+%%//g;
-  #$sendto = 'ksaffran@dks.lu';
-  # open (LOG,">>tmp/sendmail.log");
-  # print LOG "SUBJECT:".$subject."\n";
-  # print LOG "BODY TEXT:".$bodytmpl."\n";
-  # close(LOG);
   if (($bodytmpl ne "") && ($subject ne "") && ($sendto =~ /.+\@.+\..+/)){
 
     
@@ -96,10 +81,9 @@ sub sendemail(){
     $cmd .= '-o tls=auto ';
     $cmd .= '-t "'.$sendto.'" ';
     $cmd .= '-u "'.$subject.'" ';
-  #    open (LOG,">>sendmail.log");
-  #  print LOG $cmd."\n";
-  # # print LOG "BODY TEXT:".$bodytmpl."\n";
-  #  close(LOG);
+    $cmd .= '-o message-content-type=html ';
+    $cmd .= '-o message-charset=ISO-8859-1 ';
+    $cmd .= '-o message-file='.$f.' ';
     open(EML,">".$f);
     print EML $bodytmpl;
     close(EML);
@@ -111,14 +95,8 @@ sub sendemail(){
         $cmd .= " ".$a." ";
       }
     }
-    # open (LOG,">>tmp/sendmail.log");
-    # print LOG "SEND EMAIL CMD:".$cmd."\n";
-    # close(LOG);
-    # $cmd =~ s/'/''/g; 
     $send = system($cmd);
-    # open (LOG,">>tmp/sendmail.log");
-    # print LOG "CMD RETURN NUM:".$send."\n";
-    # close(LOG);
+
     unlink($f);
   }    
   return $send;
index b44184f..0814d5f 100644 (file)
@@ -33,7 +33,7 @@ sub checklogin(){
   $login =~ s/^\s+//;
   $login =~ s/\s+$//;
 
-  $ret->{message} = "Mot de passe ou Login pas inconnue!";
+  $ret->{message} = "Mot de passe ou Login inconnue!";
   $ret->{messagetype} = "w3-red";
   $ret->{sid} = undef;
   my $siddata = $self->{db}->dbquerysorted("select * from checklogin('".$self->{db}->securetext($login)."','".$pwd."','".$ENV{REMOTE_ADDR}."','".$ENV{HTTP_USER_AGENT}."');");
@@ -60,7 +60,7 @@ sub passwordforgotten(){
   my $self = shift;
   my $email = shift;
   my $ret->{messagetype} ='w3-red';
-  $ret->{message} = "Onbekannt E-mail!";
+  $ret->{message} = "email inconnue!";
   my $sql = "select id,userpassword from users where username='".$self->{db}->securetext($email)."';";
   my $ex = $self->{db}->dbquerysorted($sql);
   if (keys(%{$ex}) > 0){
@@ -72,10 +72,10 @@ sub passwordforgotten(){
     my $mret = $eml->sendemail('user_forgotpasswd',$ex->{0}->{id},$email,$data,undef);
     if ($mret != 0){
       $ret->{messagetype} ='w3-red';
-      $ret->{message} = "Den Moment ass et leider nët méglech d'Passwuert autmatesch zreckzesetzen, <br/> wend dech w.e.g. via E-Mail un <a href=\"mailto:webmaster\@fld.lu\">webmaster\@fld.lu</a>!";
+      $ret->{message} = "Pour le moment il n'y est pas possible de recevoir un nouveau mot de passe, <br/>si besoin contacter le support <a href=\"mailto:support\@dks.lu\">support\@dks.lu</a>!";
       return $ret;
     }
-    $ret->{message} = "Mir hun dir eng E-Mail, matt engem neien Passwuert gescheckt!";
+    $ret->{message} = "nous vous avons envoyés unn nouveau mot de passe par via email!";
     $ret->{messagetype} = "w3-green";
   }
   return $ret;
@@ -106,18 +106,18 @@ sub registeruser(){
   my $user = $self->{db}->dbquerysorted("select id from users where username='".$data->{users_email}."';");
   if (keys(%{$user}) > 0){
     $ret->{page} = "register.tt";
-    $ret->{message} = "Il existe déjà un utilisateur avec la mème adresse e-mail!";
+    $ret->{message} = "Il y existe déjà un utilisateur avec la mème adresse e-mail!";
     return $ret; 
   }
   
   my $newcode = $self->randomstring(6);
 
   my $newuserid = $self->{db}->dbquerysorted("INSERT INTO users (username,vcode) VALUES ('".$data->{users_email}."','".$newcode."') returning id;");
-  $self->{db}->dbexec("INSERT INTO useringroups (id_user,id_group) VALUES ('".$newuserid->{0}->{id}."',(select id from usergroups where isdefault=true));");
+  #$self->{db}->dbexec("INSERT INTO useringroups (id_user,id_group) VALUES ('".$newuserid->{0}->{id}."',(select id from usergroups where isdefault=true));");
   my $company = $self->{db}->dbquerysorted("select id from companies where link=unaccent_string('".$data->{companies_company}."');");
   if (keys(%{$company}) == 0 ){
     $company = $self->{db}->dbquerysorted("INSERT INTO companies (company,link) VALUES ('".$data->{companies_company}."',unaccent_string('".$data->{companies_company}."')) returning id;");
-    $self->{db}->dbexec("INSERT INTO useringroups (id_user,id_group) VALUES ('".$newuserid->{0}->{id}."',(select id from usergroups where usergroup='company'));");
+    #$self->{db}->dbexec("INSERT INTO useringroups (id_user,id_group) VALUES ('".$newuserid->{0}->{id}."',(select id from usergroups where usergroup='company'));");
   }
   $self->{db}->dbexec("INSERT INTO members (surname, prename, phone, id_user, id_company, job) VALUES('".$data->{members_surname}."', '".$data->{members_prename}."', '".$data->{members_phone}."', ".$newuserid->{0}->{id}.", ".$company->{0}->{id}.", '".$data->{members_job}."');");
   my $maildata->{vcode} = $newcode;
diff --git a/backoffice/api/tmp/mailbody_ksaffran_dks.lu.txt b/backoffice/api/tmp/mailbody_ksaffran_dks.lu.txt
new file mode 100644 (file)
index 0000000..e3ff473
--- /dev/null
@@ -0,0 +1,31 @@
+<html>
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+    <style>
+    body,html {
+        margin: 0;
+        background-color: #fff;
+    }
+  </style>
+  </head>
+  <body bgcolor="#607d8b">
+    <div class="maincontainer" align="left" style="padding-top: 5px; width: auto; background-color: #607d8b!important; color: #fff;">
+        POT - Plan d'organisation de travail</span>
+      <div  style="background-color: #fff; color: #000">
+        <div class="mailcontent" align="left" style="padding: 10px; color: #000;">
+          Bonjour Kilian Saffran,<br/>
+<br/>
+Le code pour valider votre e-mail est:
+<br/>
+<strong>rpj0shm</strong><br/>
+<br/>
+entrez le code ici: <a href="http://localhost/backoffice/validationcode.html">http://localhost/backoffice/validationcode.html</a>
+<br/>
+Méilleurs Salutations,<br/>
+<br/>
+pot.lu Support Team
+        </div>
+      </div>
+    </div>
+  </body>
+</html>
\ No newline at end of file
diff --git a/backoffice/api/tmp/sendmail.log b/backoffice/api/tmp/sendmail.log
new file mode 100644 (file)
index 0000000..7983e13
--- /dev/null
@@ -0,0 +1 @@
+SEND EMAIL CMD:perl "/usr/home/dksalu/public_html/pot_lu/backoffice/api/sendEmail" -f support@dks.lu  -s "mail.your-server.de:587" -xu "ksaffran@dks.lu" -xp "FB1ia1ka" -q -o tls=auto -t "ksaffran@dks.lu" -u "Validation de votre Email pour le site pot.lu" 
diff --git a/backoffice/api/tmp/sql.log b/backoffice/api/tmp/sql.log
deleted file mode 100644 (file)
index fd65884..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-
-==
-DELETE FROM portanova. WHERE id='3';
-==
-
-==
-DELETE FROM portanova.workplans WHERE id='3';
-==
-
-==
-DELETE FROM portanova.workplans WHERE id='2';
-==
-
-==
-DELETE FROM portanova.workplans WHERE id='4';
-==
-
-==
-DELETE FROM portanova.workplans WHERE id='5';
-==
index 194fca8..a3cabbe 100755 (executable)
@@ -1,4 +1,4 @@
-#!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl
+#!/usr/local/bin/perl
 
 use strict;
 use lib ('./lib/perl5');
index f7db8e9..027a821 100644 (file)
@@ -1,46 +1,6 @@
 
 CREATE SCHEMA %%NEWSCHEMA%%;
 
-CREATE TABLE %%NEWSCHEMA%%.defaultweekworkplan (
-    id integer NOT NULL,
-    id_staff integer,
-    startdate date,
-    mon json,
-    tue json,
-    wed json,
-    thu json,
-    fri json,
-    sat json,
-    sun json
-);
-
-CREATE SEQUENCE %%NEWSCHEMA%%.defaultweekworkplan_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-ALTER SEQUENCE %%NEWSCHEMA%%.defaultweekworkplan_id_seq OWNED BY %%NEWSCHEMA%%.defaultweekworkplan.id;
-
-CREATE TABLE %%NEWSCHEMA%%.defaultworkplan (
-    id bigint NOT NULL,
-    id_staff integer,
-    daydate date,
-    plannedtimes json,
-    vacancytimes json,
-    presencetimes json
-);
-
-CREATE SEQUENCE %%NEWSCHEMA%%.defaultworkplan_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-ALTER SEQUENCE %%NEWSCHEMA%%.defaultworkplan_id_seq OWNED BY %%NEWSCHEMA%%.defaultworkplan.id;
-
 CREATE TABLE %%NEWSCHEMA%%.reportperiod (
     id integer NOT NULL,
     periodname text,
@@ -1125,10 +1085,6 @@ CREATE SEQUENCE %%NEWSCHEMA%%.worktypes_id_seq
 
 ALTER SEQUENCE %%NEWSCHEMA%%.worktypes_id_seq OWNED BY %%NEWSCHEMA%%.worktypes.id;
 
-ALTER TABLE ONLY %%NEWSCHEMA%%.defaultweekworkplan ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.defaultweekworkplan_id_seq'::regclass);
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.defaultworkplan ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.defaultworkplan_id_seq'::regclass);
-
 ALTER TABLE ONLY %%NEWSCHEMA%%.reportperiod ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.reportperiod_id_seq'::regclass);
 
 ALTER TABLE ONLY %%NEWSCHEMA%%.sites ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.sites_id_seq'::regclass);
@@ -1151,12 +1107,6 @@ ALTER TABLE ONLY %%NEWSCHEMA%%.workplans ALTER COLUMN id SET DEFAULT nextval('%%
 
 ALTER TABLE ONLY %%NEWSCHEMA%%.worktypes ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.worktypes_id_seq'::regclass);
 
-ALTER TABLE ONLY %%NEWSCHEMA%%.defaultweekworkplan
-    ADD CONSTRAINT defaultweekworkplan_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.defaultworkplan
-    ADD CONSTRAINT defaultworkplan_pkey PRIMARY KEY (id);
-
 ALTER TABLE ONLY %%NEWSCHEMA%%.reportperiod
     ADD CONSTRAINT reportperiod_pkey PRIMARY KEY (id);
 
@@ -1191,3 +1141,4 @@ ALTER TABLE ONLY %%NEWSCHEMA%%.worktypes
     ADD CONSTRAINT worktypes_pkey PRIMARY KEY (id);
 
 CREATE TRIGGER trg_upd_%%NEWSCHEMA%%_weekhours BEFORE UPDATE OF weekhours ON %%NEWSCHEMA%%.staffperiodbase FOR EACH ROW EXECUTE PROCEDURE public.trg_update_monthhours();
+
index 6b51e03..2e7a8a2 100644 (file)
@@ -1,3 +1 @@
-<svg id="glyphicons-basic" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
-  <path id="table" d="M25,4H8A3.00328,3.00328,0,0,0,5,7V26a2.00229,2.00229,0,0,0,2,2H26a2.00229,2.00229,0,0,0,2-2V7A3.00328,3.00328,0,0,0,25,4ZM12,25.5a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm0-6a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm0-6a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm7,12a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm0-6a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm0-6a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm7,12a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm0-6a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm0-6a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Z"/>
-</svg>
+<?xml version="1.0" encoding="utf-8"?> \r<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \r      x="0px" y="0px" width="50px" height="50px" viewBox="0 0 19.84 21.33"> \r<path d="M10.915,16.165001L13.52,16.165001 13.52,18.688 10.915,18.688z M6.8629996,16.165001L9.4669997,16.165001 9.4669997,18.688 6.8629996,18.688z M2.8109998,16.165001L5.4159996,16.165001 5.4159996,18.688 2.8109998,18.688z M14.76,12.197L17.364999,12.197 17.364999,14.719 14.76,14.719z M10.915,12.197L13.52,12.197 13.52,14.719 10.915,14.719z M6.8629996,12.197L9.4669997,12.197 9.4669997,14.719 6.8629996,14.719z M2.8109998,12.197L5.4159996,12.197 5.4159996,14.719 2.8109998,14.719z M14.76,8.1450005L17.364999,8.1450005 17.364999,10.667 14.76,10.667z M10.708,8.1450005L13.312999,8.1450005 13.312999,10.667 10.708,10.667z M6.6559999,8.1450005L9.2609994,8.1450005 9.2609994,10.667 6.6559999,10.667z M1.1907999,5.4987025L1.1907999,20.141716 18.6544,20.141716 18.6544,5.4987025z M0,0L19.844999,0 19.844999,21.333 0,21.333z"/> \r</svg>
\ No newline at end of file
index c738ec5..2e7a8a2 100644 (file)
@@ -1,3 +1 @@
-<svg id="glyphicons-basic" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
-  <path fill="#fff" id="table" d="M25,4H8A3.00328,3.00328,0,0,0,5,7V26a2.00229,2.00229,0,0,0,2,2H26a2.00229,2.00229,0,0,0,2-2V7A3.00328,3.00328,0,0,0,25,4ZM12,25.5a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm0-6a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm0-6a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm7,12a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm0-6a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm0-6a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm7,12a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm0-6a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Zm0-6a.5.5,0,0,1-.5.5h-4a.5.5,0,0,1-.5-.5v-3a.5.5,0,0,1,.5-.5h4a.5.5,0,0,1,.5.5Z"/>
-</svg>
+<?xml version="1.0" encoding="utf-8"?> \r<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \r      x="0px" y="0px" width="50px" height="50px" viewBox="0 0 19.84 21.33"> \r<path d="M10.915,16.165001L13.52,16.165001 13.52,18.688 10.915,18.688z M6.8629996,16.165001L9.4669997,16.165001 9.4669997,18.688 6.8629996,18.688z M2.8109998,16.165001L5.4159996,16.165001 5.4159996,18.688 2.8109998,18.688z M14.76,12.197L17.364999,12.197 17.364999,14.719 14.76,14.719z M10.915,12.197L13.52,12.197 13.52,14.719 10.915,14.719z M6.8629996,12.197L9.4669997,12.197 9.4669997,14.719 6.8629996,14.719z M2.8109998,12.197L5.4159996,12.197 5.4159996,14.719 2.8109998,14.719z M14.76,8.1450005L17.364999,8.1450005 17.364999,10.667 14.76,10.667z M10.708,8.1450005L13.312999,8.1450005 13.312999,10.667 10.708,10.667z M6.6559999,8.1450005L9.2609994,8.1450005 9.2609994,10.667 6.6559999,10.667z M1.1907999,5.4987025L1.1907999,20.141716 18.6544,20.141716 18.6544,5.4987025z M0,0L19.844999,0 19.844999,21.333 0,21.333z"/> \r</svg>
\ No newline at end of file
diff --git a/backoffice/img/icons/poticon.svg b/backoffice/img/icons/poticon.svg
new file mode 100644 (file)
index 0000000..f96b1f7
--- /dev/null
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 23.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   version="1.1"
+   id="Calque_1"
+   x="0px"
+   y="0px"
+   viewBox="0 0 270 270"
+   xml:space="preserve"
+   sodipodi:docname="poticon.svg"
+   width="270"
+   height="270"
+   inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><metadata
+   id="metadata4623"><rdf:RDF><cc:Work
+       rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+         rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+   id="defs4621" /><sodipodi:namedview
+   pagecolor="#ffffff"
+   bordercolor="#666666"
+   borderopacity="1"
+   objecttolerance="10"
+   gridtolerance="10"
+   guidetolerance="10"
+   inkscape:pageopacity="0"
+   inkscape:pageshadow="2"
+   inkscape:window-width="1920"
+   inkscape:window-height="1001"
+   id="namedview4619"
+   showgrid="false"
+   inkscape:zoom="0.63697917"
+   inkscape:cx="960"
+   inkscape:cy="540"
+   inkscape:window-x="-9"
+   inkscape:window-y="-9"
+   inkscape:window-maximized="1"
+   inkscape:current-layer="Calque_1" />
+<style
+   type="text/css"
+   id="style4518">
+       .st0{fill:#003268;}
+       .st1{fill:#FFFFFF;}
+       .st2{fill:#005BCE;}
+</style>
+<g
+   id="g4552"
+   transform="matrix(0.44031087,0,0,0.44229209,-292.34276,-76.55121)">
+       <g
+   id="g4544">
+               <path
+   class="st0"
+   d="m 1107.86,464.03 c -38.08,-0.02 -76.17,-0.02 -114.24,0.05 -2.02,0 -3.2,-0.62 -4.56,-2.21 -2.29,-2.68 -4.94,-5.26 -7.96,-6.97 -2.41,-1.38 -2.96,-2.75 -2.96,-5.27 0.07,-48.71 0.04,-97.43 0.04,-146.14 0,-1.2 0.07,-2.41 -0.04,-3.59 -0.37,-4.36 -4.07,-7.2 -8.41,-6.52 -3.87,0.61 -6.02,3.54 -6.02,8.34 -0.02,24.74 0,49.48 0,74.22 0,24.6 -0.02,49.23 0.02,73.86 0.03,2.37 -0.41,3.72 -2.82,5.04 -2.96,1.57 -5.56,4.07 -7.79,6.63 -1.47,1.69 -2.65,2.67 -5,2.63 -7.59,-0.15 -15.19,-0.04 -22.79,0 -3.52,0.02 -6.26,1.66 -8.16,4.55 -2.24,3.33 -2.34,6.96 -0.55,10.51 1.88,3.7 5.17,5.52 9.28,5.56 7.58,0.07 15.2,-0.06 22.77,0.11 1.34,0.05 2.8,1.07 3.94,1.97 3,2.41 5.72,5.23 8.87,7.42 1.53,1.05 2.3,1.82 2.28,3.73 -0.11,7.15 -0.07,14.31 -0.05,21.47 0,1.18 -0.02,2.41 0.27,3.55 0.83,3.39 4.18,5.65 7.61,5.32 3.77,-0.37 6.51,-3.22 6.57,-7.23 0.09,-7.7 0.07,-15.41 0,-23.11 0,-1.97 0.79,-2.89 2.54,-3.95 2.89,-1.72 5.72,-3.91 7.86,-6.5 1.62,-1.97 3.07,-2.82 5.58,-2.82 27.57,0.09 55.13,0.06 82.67,0.06 10.64,0 21.28,0.07 31.9,-0.02 6.66,-0.06 11.03,-4.55 10.84,-10.79 -0.2,-6.09 -4.64,-9.9 -11.69,-9.9 z m -124.61,11.53 c 0,0.01 0,0.02 -0.01,0.04 -0.01,0.13 -0.02,0.25 -0.04,0.38 -0.02,0.19 -0.05,0.37 -0.09,0.56 -0.1,0.55 -0.24,1.1 -0.42,1.63 -0.06,0.18 -0.12,0.36 -0.19,0.53 -0.08,0.21 -0.16,0.41 -0.26,0.62 -0.08,0.19 -0.16,0.37 -0.26,0.54 -0.18,0.36 -0.38,0.72 -0.6,1.05 -0.32,0.5 -0.68,0.98 -1.07,1.44 0,0.01 0,0.01 -0.01,0.02 -0.27,0.3 -0.54,0.58 -0.82,0.86 -0.15,0.14 -0.3,0.28 -0.45,0.42 0,0 0,0.01 -0.01,0.01 -0.2,0.18 -0.41,0.35 -0.62,0.51 -0.16,0.13 -0.32,0.25 -0.48,0.36 -0.94,0.67 -1.98,1.22 -3.09,1.62 -0.78,0.28 -1.58,0.49 -2.42,0.62 -0.42,0.06 -0.84,0.11 -1.27,0.13 -0.21,0 -0.42,0.01 -0.64,0.01 -0.23,0.01 -0.45,0 -0.68,-0.02 -0.17,-0.01 -0.34,-0.03 -0.52,-0.05 -0.37,-0.04 -0.74,-0.11 -1.1,-0.2 -0.36,-0.09 -0.72,-0.2 -1.07,-0.32 -1.28,-0.47 -2.5,-1.18 -3.6,-2.07 -0.19,-0.15 -0.38,-0.32 -0.56,-0.48 -0.24,-0.22 -0.47,-0.44 -0.69,-0.67 -0.05,-0.05 -0.1,-0.11 -0.15,-0.16 -0.22,-0.24 -0.44,-0.49 -0.64,-0.74 -0.26,-0.31 -0.5,-0.63 -0.72,-0.96 -0.22,-0.33 -0.43,-0.66 -0.63,-1.01 -0.38,-0.7 -0.71,-1.42 -0.95,-2.16 -0.13,-0.37 -0.23,-0.75 -0.32,-1.12 -0.04,-0.19 -0.08,-0.38 -0.11,-0.57 -0.06,-0.29 -0.1,-0.59 -0.11,-0.89 -0.03,-0.3 -0.04,-0.6 -0.04,-0.9 0,-0.22 0.01,-0.44 0.01,-0.66 0.02,-0.4 0.05,-0.79 0.11,-1.18 0.02,-0.14 0.04,-0.29 0.07,-0.43 0.01,-0.08 0.02,-0.15 0.04,-0.23 0.02,-0.07 0.04,-0.15 0.05,-0.23 0.03,-0.16 0.06,-0.31 0.1,-0.46 0.06,-0.25 0.13,-0.5 0.21,-0.74 0.16,-0.54 0.37,-1.07 0.61,-1.58 0.08,-0.18 0.17,-0.36 0.27,-0.54 0.12,-0.22 0.24,-0.44 0.37,-0.65 0.13,-0.21 0.26,-0.42 0.41,-0.63 0.28,-0.4 0.59,-0.79 0.92,-1.16 0.17,-0.2 0.36,-0.4 0.56,-0.58 0.16,-0.16 0.32,-0.31 0.49,-0.46 0.18,-0.16 0.37,-0.32 0.57,-0.47 0.19,-0.15 0.39,-0.29 0.6,-0.43 0.61,-0.42 1.27,-0.78 1.96,-1.08 0.23,-0.1 0.46,-0.19 0.7,-0.28 0.17,-0.06 0.34,-0.12 0.51,-0.17 0.17,-0.06 0.34,-0.11 0.51,-0.15 0.17,-0.04 0.35,-0.09 0.53,-0.13 0.18,-0.03 0.35,-0.07 0.53,-0.1 0.55,-0.09 1.1,-0.15 1.67,-0.18 0.22,-0.01 0.44,-0.01 0.66,-0.01 0.16,0 0.32,0 0.48,0.01 0.15,0.01 0.31,0.02 0.47,0.03 0.31,0.03 0.62,0.06 0.92,0.11 0.27,0.04 0.54,0.1 0.81,0.16 0.26,0.06 0.53,0.13 0.79,0.21 0.25,0.07 0.51,0.16 0.75,0.25 l 0.01,0.01 c 0.24,0.09 0.48,0.18 0.71,0.28 0.04,0.02 0.07,0.03 0.11,0.06 0.22,0.1 0.43,0.2 0.65,0.32 0.22,0.11 0.44,0.24 0.66,0.37 0.01,0.01 0.02,0.01 0.03,0.02 0.22,0.14 0.44,0.29 0.66,0.44 0.21,0.15 0.42,0.31 0.63,0.48 0.1,0.08 0.2,0.16 0.29,0.24 0.2,0.17 0.4,0.36 0.59,0.55 0.18,0.17 0.35,0.35 0.51,0.53 0.27,0.29 0.52,0.59 0.75,0.91 0.11,0.16 0.23,0.32 0.34,0.48 0.22,0.32 0.42,0.66 0.61,1.01 0.25,0.47 0.48,0.96 0.66,1.47 0.08,0.19 0.15,0.38 0.21,0.58 0.41,1.24 0.62,2.57 0.6,3.95 0,0.35 -0.02,0.69 -0.06,1.03 z"
+   id="path4520"
+   inkscape:connector-curvature="0"
+   style="fill:#003268" />
+               <path
+   class="st0"
+   d="m 977.13,266.06 c 0,2.38 0.18,4.77 -0.05,7.13 -0.33,3.46 -2.74,5.61 -5.97,5.68 -3.35,0.08 -6.09,-2.12 -6.28,-5.68 -0.26,-4.85 -0.26,-9.73 0,-14.58 0.18,-3.35 2.89,-5.5 6.12,-5.5 3.24,0 5.81,2.14 6.15,5.5 0.24,2.46 0.05,4.97 0.05,7.46 -0.02,-0.01 -0.02,-0.01 -0.02,-0.01 z"
+   id="path4522"
+   inkscape:connector-curvature="0"
+   style="fill:#003268" />
+               <path
+   class="st0"
+   d="m 977.18,682.72 c 0,2.27 0.14,4.55 -0.03,6.81 -0.29,3.76 -2.88,6.18 -6.28,6.13 -3.29,-0.05 -5.91,-2.38 -6.08,-5.97 -0.22,-4.64 -0.22,-9.3 -0.02,-13.95 0.16,-3.57 2.77,-5.88 6.09,-5.93 3.45,-0.04 6.03,2.35 6.3,6.08 0.17,2.26 0.03,4.54 0.03,6.82 -0.01,0.01 -0.01,0.01 -0.01,0.01 z"
+   id="path4524"
+   inkscape:connector-curvature="0"
+   style="fill:#003268" />
+               <path
+   class="st0"
+   d="m 1192.26,474.54 c -0.1,3.29 -2.6,5.76 -6.06,5.98 -0.21,0.02 -0.44,0.01 -0.65,0.01 h -6.5 c 0,-0.01 0,-0.01 0,-0.01 -2.27,0 -4.55,0.1 -6.82,-0.03 -3.29,-0.18 -5.7,-2.67 -5.86,-5.83 -0.16,-3.24 2.25,-6.29 5.58,-6.45 4.86,-0.21 9.75,-0.2 14.61,-0.01 3.38,0.14 5.8,3.07 5.7,6.34 z"
+   id="path4526"
+   inkscape:connector-curvature="0"
+   style="fill:#003268" />
+               <path
+   class="st0"
+   d="m 775.52,474.41 c -0.01,3.28 -2.51,5.85 -5.93,6.11 -0.21,0.01 -0.44,0.01 -0.65,0.01 -1.44,0.01 -2.88,0.01 -4.33,0.01 -0.72,-0.01 -1.45,-0.01 -2.17,-0.01 -1.8,-0.01 -3.61,0.05 -5.42,0.02 -0.46,-0.01 -0.93,-0.03 -1.4,-0.05 -3.44,-0.17 -5.94,-2.75 -5.99,-6.04 -0.05,-3.27 2.4,-6.15 5.78,-6.27 4.75,-0.18 9.53,-0.18 14.29,-0.01 3.37,0.13 5.84,2.97 5.82,6.23 z"
+   id="path4528"
+   inkscape:connector-curvature="0"
+   style="fill:#003268" />
+               <path
+   class="st1"
+   d="m 958.61,474.59 c 0,0.3 0.01,0.6 0.04,0.9 -0.04,-0.3 -0.05,-0.6 -0.05,-0.91 0,-0.22 0.01,-0.43 0.02,-0.65 0,0.22 -0.01,0.44 -0.01,0.66 z"
+   id="path4530"
+   inkscape:connector-curvature="0"
+   style="fill:#ffffff" />
+               <path
+   class="st1"
+   d="m 961.78,466.1 c -0.33,0.37 -0.64,0.76 -0.92,1.16 0.28,-0.4 0.58,-0.79 0.92,-1.16 z"
+   id="path4532"
+   inkscape:connector-curvature="0"
+   style="fill:#ffffff" />
+               <path
+   class="st1"
+   d="m 968.74,462.25 c 0.54,-0.1 1.1,-0.16 1.67,-0.18 -0.57,0.03 -1.12,0.09 -1.67,0.18 z"
+   id="path4534"
+   inkscape:connector-curvature="0"
+   style="fill:#ffffff" />
+               <path
+   class="st1"
+   d="m 970.5,486.91 c 0.22,0 0.43,-0.01 0.64,-0.01 -0.22,0.01 -0.43,0.02 -0.65,0.02 -0.23,0 -0.45,-0.01 -0.67,-0.03 0.23,0.02 0.45,0.03 0.68,0.02 z"
+   id="path4536"
+   inkscape:connector-curvature="0"
+   style="fill:#ffffff" />
+               <path
+   class="st1"
+   d="m 971.07,462.05 c 0.16,0 0.32,0.01 0.48,0.02 -0.16,-0.01 -0.32,-0.01 -0.48,-0.01 -0.22,0 -0.44,0 -0.66,0.01 0.22,-0.02 0.44,-0.02 0.66,-0.02 z"
+   id="path4538"
+   inkscape:connector-curvature="0"
+   style="fill:#ffffff" />
+               <path
+   class="st1"
+   d="m 979.48,483.23 c 0.28,-0.28 0.55,-0.56 0.82,-0.86 -0.39,0.46 -0.81,0.89 -1.27,1.28 0.15,-0.14 0.3,-0.28 0.45,-0.42 z"
+   id="path4540"
+   inkscape:connector-curvature="0"
+   style="fill:#ffffff" />
+               <path
+   class="st1"
+   d="m 980.31,482.35 c 0.39,-0.46 0.75,-0.94 1.07,-1.44 -0.32,0.51 -0.67,0.99 -1.07,1.44 z"
+   id="path4542"
+   inkscape:connector-curvature="0"
+   style="fill:#ffffff" />
+       </g>
+       <g
+   id="g4550">
+               <path
+   class="st2"
+   d="m 938.51,758.43 c -34.37,-2.96 -66.64,-13.09 -97.29,-28.53 -49.17,-24.78 -88.16,-60.95 -116.45,-107.95 -25.2,-41.88 -38.29,-87.64 -39.36,-136.77 -0.09,-3.85 -0.09,-7.71 0,-11.52 0.09,-7.29 0.48,-14.49 1.12,-21.63 11.91,-134.4 113.67,-241.26 251.03,-257.66 4.31,-0.5 8.67,-0.59 14.3,-0.96 v 29.07 c -46.37,3.83 -89.21,17.01 -126.34,44.05 -69.97,50.9 -108.26,116.27 -110.73,196.23 -0.2,6.09 -0.18,12.24 0.07,18.48 0.42,11.65 1.55,23.58 3.44,35.79 14.1,91.8 67.32,155.37 150.6,193.47 20.65,9.46 44.33,12.65 66.88,17.32 10.14,2.1 16.07,5.85 16.59,16.44 0.42,9.68 -3.48,15.07 -13.86,14.17 z"
+   id="path4546"
+   inkscape:connector-curvature="0"
+   style="fill:#005bce" />
+               <path
+   class="st0"
+   d="m 1162.02,683.4 c -44.03,42.88 -98.06,67.32 -159.42,74.45 -8.29,0.97 -17.41,2.57 -19.25,-9.57 -1.57,-10.33 4.3,-17.15 16.13,-19.83 19.48,-4.43 39.28,-7.97 58.3,-14 35.17,-11.17 65.04,-31.76 90.27,-58.19 73.17,-76.55 94.83,-166.82 58.98,-265.97 -35.85,-99.21 -110.67,-153.99 -215.54,-167.1 -1.7,-0.21 -3.41,-0.45 -6.61,-0.87 v -29.03 c 11.2,1.26 21.95,1.57 32.31,3.75 112.32,23.39 189.63,88.88 222.52,198.65 32.9,109.93 4.63,207.56 -77.69,287.71 z"
+   id="path4548"
+   inkscape:connector-curvature="0"
+   style="fill:#003268" />
+       </g>
+</g>
+
+
+
+
+</svg>
\ No newline at end of file
diff --git a/backoffice/img/pottop.png b/backoffice/img/pottop.png
new file mode 100644 (file)
index 0000000..5f159c5
Binary files /dev/null and b/backoffice/img/pottop.png differ
index ecd3994..e26f774 100755 (executable)
@@ -1,4 +1,4 @@
-#!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl
+#!/usr/local/bin/perl
 
 use strict;
 use lib ('api/lib/perl5');
index 3cc2511..d43a4bc 100644 (file)
@@ -82,7 +82,7 @@ document.addEventListener("DOMContentLoaded", function() {
 });\r
 \r
 function getschemata(){\r
-  req.reqdata("POST","db.cgi",{"get":"companylist"},fillschematalist);\r
+  req.reqdata("POST","db.cgi",{"get":"companieslist"},fillschematalist);\r
 }\r
 \r
 function fillschematalist(data){\r
index 8611d49..1b6f9a7 100644 (file)
@@ -1,7 +1,7 @@
 function saveform(frmid,aftercallback){
   var flds=getformcontent(frmid,null);
   flds["fn"] ="saveform";
-  flds["schemata"]=parent.admin.getcurrentSchemata();
+  flds["schemata"]=schemata;
   console.log(flds);
   if (aftercallback){
     req.reqdata("POST","index.cgi",flds,aftercallback);
@@ -86,6 +86,8 @@ function getformcontent(frmid,dataflds){
       
     }
   }
+  console.log("Fields to Save");
+  console.log(flds);
   return flds;
 }
 
@@ -233,7 +235,7 @@ function fillformbydataclass2(dataclass,choices,data){
     for (var f in frm){
       //console.log(frm[f]);
       if (data[frm[f].id]){
-        //console.log(frm[f].id + " => " + data[frm[f].id]);
+        console.log(frm[f].id + " => " + data[frm[f].id]);
         
         if (frm[f].tagName == 'INPUT'){
           if (frm[f].type == "checkbox"){
index 8cc297b..b0fac45 100644 (file)
@@ -56,6 +56,24 @@ var timecalc = {
     while (str.length < length)
         str = padString + str;
     return str;
+  },
+  mondayBefore: function(sdate){
+     if (sdate == null){
+       sdate=new Date();
+     }
+    var day = sdate.getDay();
+    var prevMonday = new Date();
+     if(sdate.getDay() == 0){
+         prevMonday = new Date().setDate(sdate.getDate() - 0);
+    }
+    else{
+         prevMonday = new Date().setDate(sdate.getDate() - day);
+   }
+
+    return new Date(prevMonday);
+  },
+  sundayAfter: function(sdate){
+    var nextSunday = new Date();
   }
 }
 
index d63cf1d..d8ea62e 100644 (file)
@@ -52,7 +52,8 @@ var req = {
     if (callback){
       async=true;
     }
-    
+    console.log("DATA to send:");
+    console.log(data);
     var request = new XMLHttpRequest();
     if (typeof data == 'object'){
       var xdata = [];
@@ -78,7 +79,7 @@ var req = {
     request.open(method.toUpperCase(), sendurl, true);
     request.onload = function(){
       if (request.status >= 200 && request.status <= 400){
-         console.log("Status returned: " + request.status + "resp:" + request.getResponseHeader("Content-Type"));
+         //console.log("Status returned: " + request.status + "resp:" + request.getResponseHeader("Content-Type"));
         if (request.getResponseHeader("Content-Type").indexOf('application/json') == 0){
           if (request.responseText){
             console.log(request.responseText);
diff --git a/backoffice/tmp/sql.log b/backoffice/tmp/sql.log
deleted file mode 100644 (file)
index e69de29..0000000
index 903ec61..b3d5fb7 100644 (file)
@@ -1,3 +1,4 @@
+[% PROCESS macro/fields.tt %]
 <div id="dlgdeleterow" class="w3-modal">
 
   <div class="w3-modal-content w3-animate-top w3-card-4">
@@ -36,7 +37,7 @@ function deleterow_confirmed(){
   //var deltbl = "ident_"+ document.getElementById('dlgdeltable').value + "_id";
   req.reqdata("POST", "db.cgi", {
               "del2": "1",
-              "schemata": parent.admin.getcurrentSchemata(),
+              "schemata": schemata,
                "id" : document.getElementById('dlgdelrowid').value,
                "table": document.getElementById('dlgdeltable').value
           }, afterdelete);
@@ -47,16 +48,18 @@ function deleterow_confirmed(){
 }
 
 function afterdelete(){
-  if (afterdeletecallback){
+  
+  if (afterdeletecallback != null){
     console.log("lauch after callback");
     console.log(afterdeletecallback);
-    call(afterdeletecallback);
+    afterdeletecallback(null);
   }
   document.getElementById('dlgdeleterow').style.display='none';
   var sb = document.getElementById("snackbar");
   sb.className="show w3-green";
   sb.innerHTML = 'Les données ont été supprimées!';
   setTimeout(function(){ sb.className = sb.className.replace("show w3-green", ""); }, 3000);
+  afterdeletecallback =null;
   return false;
 }
 </script>
\ No newline at end of file
index dc07ef2..9a6202c 100644 (file)
@@ -5,176 +5,4 @@ function initpage(){
   console.log("Current Schema:" + schemata);
   companies.inittable();
   module.viewpanel("tbl_companies");
-  //call("reportperiod","inittable");
-//   flatpickr(".timefield",{
-//     //altInput: true,
-//     //altFormat: "H:i",
-//     dateFormat: "H:i",
-//     //allowInput: true,
-//     defaultHour:'',
-//     defaultMinute:'',
-//     enableTime: true,
-//     noCalendar: true,
-//     time_24hr: true,
-//     "locale": "fr",
-//   });
 }
-
-// var tbl = null;
-// [% sid = session.id %]
-// [% IF(session.usergroups.search('admin') != 1) %]
-// [% qcompany = dksdb.query("select id_company from vw_userlist where id=$sid;") %]
-// [% company = qcompany.get_all() %]
-// var idcompany = "[% company.0.id_company %]";
-// [% ELSE %]
-// var idcompany = null;
-// [% END %]
-// //var choice = {"submissionaccess":{"projects":null,"cdm":null,"cdm_requests":null}};
-
-// function initpage() {
-//     [% IF(session.usergroups.search('admin') == 1) %]
-    
-//     tbl = new Tabulator("#tbl_companies", {
-//         headerFilterPlaceholder: "filter...",
-//         height: "95vh",
-//         layout: "fitDataFill",
-//         selectable: 1,
-//         responsiveLayout: "collapse",
-//         columns: [{
-//             title: "entreprise",
-//             field: "company",
-//             headerFilter: "input"
-//         }, {
-//             title: "address",
-//             field: "address",
-//             headerFilter: "input"
-//         }, {
-//             title: "cp",
-//             field: "zip",
-//             headerFilter: "input"
-//         }, {
-//             title: "ville",
-//             field: "city",
-//             headerFilter: "input"
-//         }, {
-//             title: "pays",
-//             field: "country",
-//             headerFilter: "input"
-//         }]
-//     });
-//     gettbldata();
-
-//     [% ELSE %]
-//     getcompanydata(idcompany);
-//     [% END %]
-
-
-// }
-// [% IF(session.usergroups.search('admin') == 1) %]
-
-
-
-// function gettbldata() {
-//     req.reqdata("POST", "db.cgi", {
-//         "get": "companylist"
-//     }, loadtbldata);
-
-// }
-
-// function loadtbldata(data) {
-//     if (data && data.sqldata) {
-//         tbl.setData(data.sqldata);
-//     }
-// }
-
-// function edit() {
-    
-//     var udata = tbl.getSelectedData();
-//     console.log(udata[0]);
-//     if (udata[0]) {
-//         var uid = udata[0].id;
-//         getcompanydata(uid);
-        
-//     }
-
-// }
-
-// function add() {
-//     cleanform('companies');
-//     viewform();
-// }
-
-// function remove() {
-//     var udata = tbl.getSelectedData();
-//     if (udata[0]) {
-//         if (confirm("Êtes vous sûre de supprimer l'entreprise selectionné?")) {
-//             req.reqdata("POST", "db.cgi", {
-//                 "del": "1",
-//                 "ident_companies_id": udata[0].id
-//             }, gettbldata);
-//         }
-//     }
-
-// }
-// [% END %]
-
-
-// function getcompanydata(id) {
-//     req.reqdata("POST", "db.cgi", {"get": "companydata","filter": "id=" + id}, fillformcompany);
-// }
-
-// function fillformcompany(data) {
-//     cleanform('companies');
-//     var isreadonly = false;
-//     [% IF(session.usergroups.search('admin') != 1) %]
-//     if (data.sqldata[0]["validated"] == 1) {
-//         isreadonly = true;
-//     }
-//     [% END %]
-//     if (data && data.sqldata) {
-//         fillformbydataclass('companies', data.sqldata[0], isreadonly);
-//     }
-//     if (isreadonly == true) {
-//         document.getElementById("btnsave_companies").style.display = 'none';
-//     }
-// }
-
-// function viewtable() {
-//     gettbldata();
-//     document.getElementById("pnl_table").style.display = 'block';
-//     document.getElementById("pnl_company").style.display = 'none';
-// }
-
-// function viewform(){
-//   document.getElementById("pnl_table").style.display = 'none';
-//   document.getElementById("pnl_company").style.display = 'block';
-// }
-
-//[% IF(session.usergroups.search('admin') == 1) %]
-// function getprojects(){
-//   req.reqdata("POST","db.cgi",{"get":"projectlist"},fillprojectlist);
-// }
-
-// function fillprojectlist(data){
-//   console.log("fill projectlist");
-//   fillselectlist(choice["submissionaccess"]["projects"],data.sqldata,'id','project');
-//   return false;
-// }
-
-//[% END %]
-
-// function getcdms(){
-//   req.reqdata("POST","db.cgi",{"get":"cdmlist"},fillcdmlist);
-// }
-
-// function fillcdmlist(data){
-//   console.log("fill cdmlist");
-//   fillselectlist(choice["submissionaccess"]["cdm_requests"],data.sqldata,'id','cdm');
-//   //var cdmlist = [];
-//   [% IF (session.usergroups.search('admin') == 1) %]
-//   fillselectlist(choice["submissionaccess"]["cdm"],data.sqldata,'id','cdm');
-//   //choice["submissionaccess"]["cdm"].clearStore();
-//   [% END %]
-
-//   return false;
-// }
\ No newline at end of file
index f59f8b0..6c2f2b7 100644 (file)
@@ -1,7 +1,7 @@
 <div class="w3-display-container">
   <div class="w3-top w3-theme-light w3-border-bottom">
     <div class="w3-bar">
-      <button class="w3-bar-item w3-button w3-border w3-blue-grey w3-hover-text-white" onclick="module.viewpanel('tbl_companies');">Entreprises</button>
+      <button class="w3-bar-item w3-button w3-border w3-blue-grey w3-hover-text-white" onclick="companies.gettbldata();module.viewpanel('tbl_companies');">Entreprises</button>
       
       [% INCLUDE "module/$module/widgets/companies/tbar_companies.tt" %] 
     </div>
index d3eb751..4c9bbec 100644 (file)
@@ -6,7 +6,7 @@ var companies ={
   name: "companies",
   choices:{},
   initform: function(){
-  
+    
   },
   inittable: function(){
     companies.initform();
@@ -52,9 +52,12 @@ var companies ={
   },
   add: function(){
     cleanform2(companies.name,companies.choices);
+    document.getElementById("company").addEventListener('blur', function(event){companies.checkschema(event,this.id);},true);
     module.viewpanel('frm_' + companies.name);
   },
   edit: function(){
+    console.log("force remove event");
+    document.getElementById("company").removeEventListener('blur',function(){},true);
     var udata = companies.tbl.getSelectedData();
     if (udata[0]) {
       cleanform2(companies.name,companies.choices);
@@ -63,9 +66,9 @@ var companies ={
     }
   },
   fillform: function(data){
-    console.log("Fill Form 1");
+    //console.log("Fill Form 1");
     if (data && data.sqldata){
-      console.log("Fill Form 2");
+      //console.log("Fill Form 2");
       fillformbydataclass2(companies.name,companies.choices,data.sqldata[0]);
     }
   },
@@ -73,15 +76,36 @@ var companies ={
     var udata = companies.tbl.getSelectedData();
     if (udata[0]) {
       var uid = udata[0].id;
-      //TODO: delete Data
-      module.viewpanel('tbl_' + companies.name);
+      showdeletedlg("companies",uid,"Êtes vous sûre de supprimer l'entrprise sélectionnée?",companies.afterdeletecallback);
+      //module.viewpanel('tbl_' + companies.name);
     }
   },
   saveform: function(){
-    var wpdata = getformcontent(companies.name);
+    //var wpdata = getformcontent(companies.name);
     //TODO: save form
-    console.log(wpdata);
+    //console.log(wpdata);
+    saveform(companies.name);
+    if (document.getElementById("id").value == ""){
+      console.log("Install new schema now!");
+    }
+  },
+  checkschema(ev,fieldid){
+    var companyname = document.getElementById(fieldid).value;
+    //var curschemaval = document.getElementById("schemata").value;
+    //if (curschemaval == ""){
+      req.reqdata("POST","index.cgi",{"fn":"getfreeschema","companyname":companyname},companies.setnewschema);
+    //}
+  },
+  setnewschema(data){
+    if (data && data.newschema){
+      document.getElementById("schemata").value = data.newschema;
+    }
   },
+  afterdeletecallback: function(data){
+    companies.gettbldata();
+  }
+  
+
   // getcompany: function(ev,id){
   //   console.log(id + "=>" + ev.detail.value);
   //   req.reqdata("POST","db.cgi",{"get":companies.name + "data","schemata":schemata,"filter":"id='" + ev.detail.value + "'"},companies.setcompany);
index 3638f51..e3211b2 100644 (file)
@@ -9,14 +9,14 @@
           [% fieldhidden('id','companies','ident') %]
           <div class="w3-container">
                 [% fieldeditbox('company','companies','Entreprise','w3-half','','','') %]
-                [% fieldeditbox('socialtype','companies','dénom. Sociale','w3-quarter','','','') %]
+                [% fieldeditbox('socialtype','companies','dénom. Sociale','w3-quarter','','','s.à r.l.') %]
                 [% fieldeditbox('address','companies','Adresse','','','','') %]
                 [% fieldeditbox('zip','companies','CP','w3-fifth','','','') %]
                 [% fieldeditbox('city','companies','Ville','w3-half','','','') %]
-                [% fieldeditbox('country','companies','Pays','w3-quarter','','','') %]
+                [% fieldeditbox('country','companies','Pays','w3-quarter','','','Luxembourg') %]
                 <div  class="w3-container">
-                [% fieldeditbox('comregister','companies','No. Registre de Commerce','w3-quarter','','','') %]
-                [% fieldeditbox('vatnumber','companies','No TVA Internationale','w3-quarter','','','') %]
+                [% fieldeditbox('comregister','companies','No. Registre de Commerce','w3-third','','','B123456') %]
+                [% fieldeditbox('vatnumber','companies','No TVA Internationale','w3-third','','','LU12345678') %]
               </div>
                 [% fieldeditbox('email','companies','E-Mail','w3-half','','','') %]
                 </div>
index a0c5377..b8145c6 100644 (file)
@@ -1,4 +1,7 @@
-[% appaccess = dksdb.prepare("select replace(ap.icon,'.svg','_white.svg') as icon,ap.app,ap.name,ug.usergroup from useringroups uig join apps ap on (uig.id_group=ap.id_usergroup)  join usergroups ug on (uig.id_group=ug.id) where uig.id_user=? and ap.app != 'dashboard' order by ap.sort; ") %]
+[% appaccess = dksdb.prepare("select ap.icon,ap.app,ap.name,ug.usergroup 
+from (SELECT users.id,json_array_elements_text(users.id_usergroups)::INT4 AS id_usergroup FROM users) uig 
+join apps ap on (uig.id_usergroup=ap.id_usergroup) 
+join usergroups ug on (uig.id_usergroup=ug.id) where uig.id=? and ap.app != 'dashboard' order by ap.sort; ") %]
 
 <div class="w3-display-container">
   <div class="w3-container">
index d797cf0..b36f380 100644 (file)
@@ -3,7 +3,7 @@
   <div class="w3-top w3-theme-light w3-border-bottom">
     <div class="w3-bar">
       <button class="w3-bar-item w3-button w3-border w3-blue-grey w3-hover-text-white" onclick="module.viewpanel('tbl_reportperiod');">Periodes</button>
-      <button class="w3-bar-item w3-button w3-border w3-blue-grey w3-hover-text-white" onclick="module.viewpanel('tbl_staffworkplan');">Plans</button>
+      <!-- <button class="w3-bar-item w3-button w3-border w3-blue-grey w3-hover-text-white" onclick="module.viewpanel('tbl_staffworkplan');">Plans</button> -->
       [% INCLUDE "module/$module/widgets/reportperiod/tbar_reportperiod.tt" %] 
       [% INCLUDE "module/$module/widgets/staffworkplan/tbar_staffworkplan.tt" %] 
     </div>
index f1f6508..deca2e1 100644 (file)
@@ -1,5 +1,5 @@
 [% PROCESS macro/fields.tt %]
-<div id="dlg_reportperiod dialog" class="w3-modal">
+<div id="dlg_reportperiod" class="dialog w3-modal">
 
   <div class="w3-modal-content w3-animate-top w3-card-4">
     <header class="w3-container"> 
@@ -23,7 +23,7 @@
 </div>
 <script>
   function aftersavereportperiod(){
-    reporttable.gettbldata();
+    reportperiod.gettbldata();
     document.getElementById('dlg_reportperiod').style.display='none';
     return false;
   }
index 8945cf4..c7f45b6 100644 (file)
@@ -2,7 +2,32 @@ var reportperiod ={
   tbl: null,
   name: "reportperiod",
   initform: function(){
-    
+    flatpickr("#startdate",{altInput: true,
+      altFormat: "d.m.Y",
+      dateFormat: "Y-m-d",
+      allowInput: true,
+      weekNumbers: true,
+      "disable": [
+        function(date) {
+            // return true to disable
+            return (date.getDay() !== 1);
+        }
+      ],
+      "locale": "fr",
+    });
+    flatpickr("#enddate",{altInput: true,
+      altFormat: "d.m.Y",
+      dateFormat: "Y-m-d",
+      allowInput: true,
+      weekNumbers: true,
+      "disable": [
+        function(date) {
+            // return true to disable
+            return (date.getDay() !== 0);
+        }
+      ],
+      "locale": "fr",
+    });
   },
   inittable: function(){
     reportperiod.tbl = new Tabulator("#tbl_" + reportperiod.name, {
@@ -23,10 +48,11 @@ var reportperiod ={
         e.preventDefault(); // prevent the browsers default context menu form appearing.
         },
       columns: [{title: "Nom", field: "periodname",headerFilter: "input"}, 
-      { title: "Début",field: "startdate",formatter:"datetime",formatterParams:{inputFormat:"yyyy-mm-dd",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""} },
-      { title: "Fin",field: "enddate",formatter:"datetime",formatterParams:{inputFormat:"yyyy-mm-dd",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""} },
+      { title: "Début",field: "startdate",formatter:"datetime",formatterParams:{inputFormat:"YYYY-MM-DD",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""} },
+      { title: "Fin",field: "enddate",formatter:"datetime",formatterParams:{inputFormat:"YYYY-MM-DD",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""} },
       ]
   });
+  //
     reportperiod.initform();
     reportperiod.gettbldata();
   },
@@ -41,18 +67,28 @@ var reportperiod ={
     module.viewdialog(reportperiod.name,null);
   },
   remove: function(){
-    var udata = tbl_reportperiod.getSelectedData();
+    var udata = reportperiod.tbl.getSelectedData();
     if (udata[0]) {
-      showdeletedlg(reportperiod.name,udata[0].id,null,gettbldata_workplan);
+      showdeletedlg(reportperiod.name,udata[0].id,null,reportperiod.afterperiodremove);
     }
   },
   edit: function(){
     var udata = reportperiod.tbl.getSelectedData();
     if (udata[0]) {
+      
       var uid = udata[0].id;
-      module.viewpanel('tbl_' + reportperiod.name);
+      staffworkplan.datefrom = udata[0].startdate; 
+      staffworkplan.dateto = udata[0].enddate;
+      document.getElementById("reportperiodtitle").innerHTML="&nbsp;Periode du <strong>" + moment(udata[0].startdate).lang("fr").format('DD.MM.YYYY')  + "</strong> au <strong>" + moment(udata[0].enddate).lang("fr").format('DD.MM.YYYY') + "</strong>";
+      staffworkplan.gettbldata();
+      module.viewpanel('tbl_' + staffworkplan.name);
+      
     }
   },
+  afterperiodremove: function(){
+    reportperiod.gettbldata();
+    document.getElementById('dlg_reportperiod').style.display='none';
+  },
   viewstaffplan: function(){
     var udata = reportperiod.tbl.getSelectedData();
     if (udata[0]){
index e384dda..6cfebec 100644 (file)
@@ -1,4 +1,6 @@
+
 <div class="toolbar" id="tbar_tbl_reportperiod" style="display: none;">
+
 <button class="w3-bar-item w3-button w3-border w3-right w3-red" onclick="reportperiod.remove();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
     <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="reportperiod.edit();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
     <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="reportperiod.add();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> 
index 268c458..5328e2c 100644 (file)
@@ -132,7 +132,7 @@ var staffworkplan ={
     staffworkplan.gettbldata();
   },
   gettbldata: function(){
-    req.reqdata("POST", "db.cgi", { "get":  staffworkplan.name + "list","schemata":schemata}, staffworkplan.loadtbldata);
+    req.reqdata("POST", "db.cgi", { "get":  staffworkplan.name + "list","schemata":schemata,"filter": "weekstart>=date('"+staffworkplan.datefrom+"') and weekend<=date('"+staffworkplan.dateto+"')" }, staffworkplan.loadtbldata);
   },
   loadtbldata: function(data){
     if (data && data.sqldata) { staffworkplan.tbl.setData(data.sqldata);}
index d914a6e..9cbebfc 100644 (file)
@@ -1,4 +1,5 @@
 <div class="toolbar" id="tbar_tbl_staffworkplan" style="display: none;">
+<span id="reportperiodtitle"></span>
 <button class="w3-bar-item w3-button w3-border w3-right w3-red" onclick="staffworkplan.remove();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
     <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="staffworkplan.edit();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
     <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="staffworkplan.add();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> 
index 4879285..7e5a56f 100644 (file)
@@ -9,10 +9,10 @@
     <div class="w3-container">
       <div id="nunmsg" ></div>
       <div class="w3-container" id="newmail">
-        [% fieldeditbox('newuseremail','onlydisplay','Nei E-Mail-Address','','','') %]
+        [% fieldeditbox('newuseremail','onlydisplay','nouveau E-mail','','','') %]
       </div>
       <div class="w3-container" style="display:none;" id="vcode"> 
-        [% fieldeditbox('verificationcode','users','Bestätegungs-Code','','','') %]
+        [% fieldeditbox('verificationcode','users','Code de Validation','','','') %]
         <button class="w3-button w3-theme-l2 w3-border" id="btnvalidateresend" onclick="resendemail();return false;">Renvoyer le code</button>
       </div>     
       </div>
@@ -41,7 +41,7 @@ function opendlgusername(){
 function checkemail(){
   newusername = document.getElementById("newuseremail").value;
   if (validateEmail(newusername)){
-    req.reqdata("POST","db.cgi",{"get":"userdata","filter":"username='"+ newusername+ "'"},checkmailreturn);
+    req.reqdata("POST","db.cgi",{"get":"usersdata","filter":"username='"+ newusername+ "'"},checkmailreturn);
   }else {
     document.getElementById("nunmsg").innerHTML= '<div class="panel w3-red">entrez une addresse email valide s.v.p.!</div>';
   }
index 63fb0fa..d70cc76 100644 (file)
@@ -1,64 +1,47 @@
 var iduser="[% session.id %]";\r
-\r
+var schemata = "public";\r
 function initpage(){\r
-  flatpickr(".datefield",{altInput: true,\r
-    altFormat: "d.m.Y",\r
-    dateFormat: "Y-m-d",\r
-    "locale": "fr",\r
-  });\r
-  loadmemberdata(iduser);\r
-  loadaccountdata(iduser);\r
+  loaduserdata(iduser);\r
 }\r
 \r
-function loadaccountdata(id){\r
-  req.reqdata("POST","db.cgi",{"get":"userdata","filter":"id="+id},fillformaccount);\r
-}\r
-function loadmemberdata(id){\r
-  req.reqdata("POST","db.cgi",{"get":"memberdata","filter":"id_user="+id},fillformmember);\r
+function loaduserdata(id){\r
+  req.reqdata("POST","db.cgi",{"get":"usersdata","filter":"id="+id},fillformaccount);\r
 }\r
+\r
 function fillformaccount(data){\r
   if (data && data.sqldata){\r
-    var frm = document.querySelectorAll('.data_users');\r
-    for (var f in frm){\r
-      if (data.sqldata[0][frm[f].id]){\r
-        if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')){\r
-          if (frm[f].classList.contains("datefield")){\r
-            frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]);\r
-          } else {\r
-            frm[f].value=data.sqldata[0][frm[f].id];\r
-          }\r
-        }\r
-      }\r
+    if (data && data.sqldata){\r
+      fillformbydataclass2("users",{},data.sqldata[0]);\r
     }\r
   }\r
 }\r
 \r
 \r
-function fillformmember(data){\r
-  // console.log(data);\r
-  if (data && data.sqldata){\r
-    var frm = document.querySelectorAll('.data_members');\r
-    for (var f in frm){\r
-      // console.log(frm[f].tagName);\r
-      // console.log(frm[f].id);\r
-      if (data.sqldata[0][frm[f].id]){\r
-        //console.log(frm[f].tagName + " " + frm[f].type + " " + frm[f].id);\r
-        if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')){\r
-          if (frm[f].classList.contains("datefield")){\r
-            frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]);\r
-          } else {\r
-            frm[f].value=data.sqldata[0][frm[f].id];\r
-          }\r
+// function fillformmember(data){\r
+//   // console.log(data);\r
+//   if (data && data.sqldata){\r
+//     var frm = document.querySelectorAll('.data_members');\r
+//     for (var f in frm){\r
+//       // console.log(frm[f].tagName);\r
+//       // console.log(frm[f].id);\r
+//       if (data.sqldata[0][frm[f].id]){\r
+//         //console.log(frm[f].tagName + " " + frm[f].type + " " + frm[f].id);\r
+//         if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')){\r
+//           if (frm[f].classList.contains("datefield")){\r
+//             frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]);\r
+//           } else {\r
+//             frm[f].value=data.sqldata[0][frm[f].id];\r
+//           }\r
           \r
-        }\r
-      }\r
+//         }\r
+//       }\r
 \r
-    }\r
-    // if (document.getElementById("profile_photo").value != ""){\r
-    //   document.getElementById("img_profile_photo").src = '../../data/members/' + document.getElementById("profile_photo").value;\r
-    // }\r
-    // console.log(frm);\r
-  }\r
-}\r
+//     }\r
+//     // if (document.getElementById("profile_photo").value != ""){\r
+//     //   document.getElementById("img_profile_photo").src = '../../data/members/' + document.getElementById("profile_photo").value;\r
+//     // }\r
+//     // console.log(frm);\r
+//   }\r
+// }\r
 \r
 \r
index 41f2139..78b0955 100644 (file)
@@ -2,7 +2,7 @@
 [% PROCESS macro/fields.tt %]\r
 <div class="w3-display-container w3-margin">\r
     <div class="w3-container w3-padding-24 w3-card w3-margin-bottom">\r
-    <form id="frm_users">\r
+    <form id="frm_account">\r
         <h3>données d'accès</h3>\r
         <div class="w3-row-padding">\r
             <div class="w3-container w3-half">\r
     </div>\r
       \r
       <div class="w3-container w3-padding-24 w3-card  w3-margin-bottom">\r
-        <form id="frm_members">\r
+        <form id="frm_users">\r
         <h3>données personelles</h3>\r
         <div class="w3-row-padding"> \r
         <div class="w3-container">\r
-          \r
-          [% fieldhidden('id','members','ident') %]\r
-          [% fieldeditbox('surname','members','Nom','w3-half','') %]\r
-          [% fieldeditbox('prename','members','Prénom','w3-half','') %]\r
-          [% fieldeditbox('job','members','Position','w3-half','') %]\r
-          [% fieldeditbox('phone','members','Téléphone','w3-half','') %]\r
+          [% fieldhidden('id','users','ident') %]\r
+          [% fieldeditbox('surname','users','Nom','w3-half','') %]\r
+          [% fieldeditbox('prename','users','Prénom','w3-half','') %]\r
+          [% fieldeditbox('job','users','Position','w3-half','') %]\r
+          [% fieldeditbox('phone','users','Téléphone','w3-half','') %]\r
       </div>\r
-        [% formsavebutton('members','sauvegarder') %]\r
+        [% formsavebutton('users','sauvegarder') %]\r
           </div>\r
         </form> \r
       </div>\r
index 424d0ad..d1c1fd9 100644 (file)
@@ -1,562 +1,9 @@
 var schemata = null;
-var tbl_staff = null;
-var tbl_staffperiodbase = null;
+var currentview = null;
 function initpage(){
   schemata = parent.admin.getcurrentSchemata();
   console.log("Current Schema:" + schemata);
-  inittable_staff();
-  inittable_staffperiodbase();
-  inittable_staffvacancy();
-  inittable_staffvacancyyear();
-  inittable_staffplanning();
-  // flatpickr(".timefield",{altInput: true,
-  //   altFormat: "H:M",
-  //   dateFormat: "H:M",
-  //   allowInput: true,
-  //   "locale": "fr",
-  // });
-  flatpickr(".datefield",{altInput: true,
-    altFormat: "d.m.Y",
-    dateFormat: "Y-m-d",
-    allowInput: true,
-    "locale": "fr",
-  });
-}
-
-function inittable_staff(){
-  tbl_staff = new Tabulator("#tbl_staff", {
-    headerFilterPlaceholder: "filter...",
-    height: "94vh",
-    layout: "fitDataFill",
-    selectable: 1,
-    rowContext:function(e, row){
-      //e - the click event object
-      //row - row component
-      //var contextMenu = CtxMenu();
-      //contextMenu.addItem("Editer", edit());
-    // Add our custom function to the menu
-       //contextMenu.addItem("Hello World", ContextMenuExampleFunction);
-
-       // Add a seperator
-       //contextMenu.addSeperator();
-      e.preventDefault(); // prevent the browsers default context menu form appearing.
-      },
-    columns: [{
-        title: "No.",
-        field: "staffnumber",
-        headerFilter: "input"
-    }, {
-        title: "Prénom",
-        field: "prename",
-        headerFilter: "input"
-    },{
-      title: "Nom",
-      field: "surname",
-      headerFilter: "input"
-  }, {
-        title: "Job",
-        field: "job",
-        headerFilter: "input"
-    }, {
-        title: "entrée",
-        field: "entrydate",
-        headerFilter: "input",align: "right",formatter:"datetime", formatterParams:{
-          inputFormat:"yyyy-mm-dd",
-          outputFormat:"DD.MM.YYYY",
-          invalidPlaceholder:""}
-    }, {
-        title: "sorite",
-        field: "leavedate",align: "right",formatter:"datetime", formatterParams:{
-          inputFormat:"yyyy-mm-dd",
-          outputFormat:"DD.MM.YYYY",
-          invalidPlaceholder:""},
-        headerFilter: "input"
-    }]
-});
-gettbldata_staff();
-}
-
-function inittable_staffperiodbase(){
-  tbl_staffperiodbase = new Tabulator("#tbl_staffperiodbase", {
-    headerFilterPlaceholder: "filter...",
-    //height: "94vh",
-    layout: "fitDataFill",
-    selectable: 1,
-    rowContext:function(e, row){
-      //e - the click event object
-      //row - row component
-      //var contextMenu = CtxMenu();
-      //contextMenu.addItem("Editer", edit());
-    // Add our custom function to the menu
-       //contextMenu.addItem("Hello World", ContextMenuExampleFunction);
-
-       // Add a seperator
-       //contextMenu.addSeperator();
-      e.preventDefault(); // prevent the browsers default context menu form appearing.
-      },
-    columns: [
-      {
-        title: "début",
-        field: "startdate",
-        align: "right",
-        formatter:"datetime",formatterParams:{inputFormat:"yyyy-mm-dd",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}
-      },{
-        title: "h/semaine",
-        field: "weekhours",
-        align: "right",
-        sorter:"number",
-        formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-      },{
-        title: "h/mois",
-        field: "monthhours",
-        align: "right",
-        sorter:"number",
-        formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-      }]
-});
-}
-
-function inittable_staffvacancyyear(){
-  tbl_staffperiodbase = new Tabulator("#tbl_staffvacancyyear", {
-    headerFilterPlaceholder: "filter...",
-    //height: "94vh",
-    layout: "fitDataFill",
-    selectable: 1,
-    rowContext:function(e, row){
-      //e - the click event object
-      //row - row component
-      //var contextMenu = CtxMenu();
-      //contextMenu.addItem("Editer", edit());
-    // Add our custom function to the menu
-       //contextMenu.addItem("Hello World", ContextMenuExampleFunction);
-
-       // Add a seperator
-       //contextMenu.addSeperator();
-      e.preventDefault(); // prevent the browsers default context menu form appearing.
-      },
-    columns: [
-      {
-        title: "Année",
-        field: "year",
-        align: "right",
-        formatter:"datetime",formatterParams:{inputFormat:"yyyy-mm-dd",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}
-      },
-      {
-        title: "Congé Normal",
-        columns: [
-          {
-            title: "Total",
-            field: "yearhours",
-            align: "right",
-            sorter:"number",
-            formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-          },{
-            title: "validé",
-            field: "validated_normal_hours",
-            align: "right",
-            sorter:"number",
-            formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-          },{
-            title: "ouvert",
-            field: "open_normal_hours",
-            align: "right",
-            sorter:"number",
-            formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-          }
-        ]
-      }
-      ,{
-        title: "Congé Extraordinaire",
-        columns: [
-          {
-            title: "Total",
-            field: "yearhours",
-            align: "right",
-            sorter:"number",
-            formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-          },{
-            title: "validé",
-            field: "validated_normal_hours",
-            align: "right",
-            sorter:"number",
-            formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-          },{
-            title: "ouvert",
-            field: "open_normal_hours",
-            align: "right",
-            sorter:"number",
-            formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-          }
-        ]
-      },
-      {
-        title: "Congé maladie",
-        columns: [
-      {
-        title: "total",
-        field: "illhours",
-        align: "right",
-        sorter:"number",
-        formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-      },{
-        title: "validé",
-        field: "illhours",
-        align: "right",
-        sorter:"number",
-        formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-      },
-      {
-        title: "ouvert",
-        field: "illhours",
-        align: "right",
-        sorter:"number",
-        formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-      }]
-    }
-    ]
-});
-}
-
-function inittable_staffvacancy(){
-  tbl_staffperiodbase = new Tabulator("#tbl_staffvacancy", {
-    headerFilterPlaceholder: "filter...",
-    //height: "94vh",
-    layout: "fitDataFill",
-    selectable: 1,
-    rowContext:function(e, row){
-      //e - the click event object
-      //row - row component
-      //var contextMenu = CtxMenu();
-      //contextMenu.addItem("Editer", edit());
-    // Add our custom function to the menu
-       //contextMenu.addItem("Hello World", ContextMenuExampleFunction);
-
-       // Add a seperator
-       //contextMenu.addSeperator();
-      e.preventDefault(); // prevent the browsers default context menu form appearing.
-      },
-    columns: [
-      {
-        title: "Date début",
-        field: "startdate",
-        align: "right",
-        headerFilter: "input",
-        formatter:"datetime",formatterParams:{inputFormat:"yyyy-mm-dd",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}
-      },
-      {
-        title: "Date fin",
-        field: "enddate",
-        align: "right",
-        headerFilter: "input",
-        formatter:"datetime",formatterParams:{inputFormat:"yyyy-mm-dd",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}
-      },
-      {
-        title: "heures/jour",
-        field: "dayhours",
-        align: "right",
-        sorter:"number",
-        formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-      },
-      {
-        title: "Total heures",
-        field: "totalhours",
-        align: "right",
-        sorter:"number",
-        formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-      },
-      {
-        title: "Congé Type",
-        field: "vacancytype",
-        headerFilter: "input"
-      },
-      {
-        title: "Validé",
-        field: "validated",
-        
-      },
-    ]
-});
-}
-
-function inittable_staffplanning(){
-  tbl_staffperiodbase = new Tabulator("#tbl_staffworkplan", {
-    headerFilterPlaceholder: "filter...",
-    //height: "94vh",
-    layout: "fitDataFill",
-    selectable: 1,
-    rowContext:function(e, row){
-      //e - the click event object
-      //row - row component
-      //var contextMenu = CtxMenu();
-      //contextMenu.addItem("Editer", edit());
-    // Add our custom function to the menu
-       //contextMenu.addItem("Hello World", ContextMenuExampleFunction);
-
-       // Add a seperator
-       //contextMenu.addSeperator();
-      e.preventDefault(); // prevent the browsers default context menu form appearing.
-      },
-    
-    columns: [
-      {
-        title: "semaine",
-        field: "week",
-        headerFilter: "input",
-        formatter:"datetime",formatterParams:{inputFormat:"yyyy-mm-dd",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}
-      },
-      {
-        title: "total semaine",
-        columns:[
-          {
-            title: "plan",
-            formater: "html"
-          },
-          {
-            title: "pointé",
-            formater: "html"
-          }
-        ]
-      },
-      {
-        title: "lundi",
-        columns:[
-          {
-            title: "plan",
-            formater: "html"
-          },
-          {
-            title: "pointé",
-            formater: "html"
-          }
-        ]
-      },
-      
-      {
-        title: "mardi",
-        columns:[
-          {
-            title: "plan",
-            formater: "html"
-          },
-          {
-            title: "pointé",
-            formater: "html"
-          }
-        ]
-      },
-      {
-        title: "mercredi",
-        columns:[
-          {
-            title: "plan",
-            formater: "html"
-          },
-          {
-            title: "pointé",
-            formater: "html"
-          }
-        ]
-      },
-      {
-        title: "jeudi",
-        columns:[
-          {
-            title: "plan",
-            formater: "html"
-          },
-          {
-            title: "pointé",
-            formater: "html"
-          }
-        ]
-      },
-      {
-        title: "vendredi",
-        columns:[
-          {
-            title: "plan",
-            formater: "html"
-          },
-          {
-            title: "pointé",
-            formater: "html"
-          }
-        ]
-      },
-      {
-        title: "samedi",
-        columns:[
-          {
-            title: "plan",
-            formater: "html"
-          },
-          {
-            title: "pointé",
-            formater: "html"
-          }
-        ]
-      },
-      {
-        title: "dimanche",
-        columns:[
-          {
-            title: "plan",
-            formater: "html"
-          },
-          {
-            title: "pointé",
-            formater: "html"
-          }
-        ]
-      },
-    ]
-});
-}
-
-function inittable_staffvacancy(){
-  tbl_staffperiodbase = new Tabulator("#tbl_staffvacancy", {
-    headerFilterPlaceholder: "filter...",
-    //height: "94vh",
-    layout: "fitDataFill",
-    selectable: 1,
-    rowContext:function(e, row){
-      //e - the click event object
-      //row - row component
-      //var contextMenu = CtxMenu();
-      //contextMenu.addItem("Editer", edit());
-    // Add our custom function to the menu
-       //contextMenu.addItem("Hello World", ContextMenuExampleFunction);
-
-       // Add a seperator
-       //contextMenu.addSeperator();
-      e.preventDefault(); // prevent the browsers default context menu form appearing.
-      },
-    columns: [
-      {
-        title: "Date début",
-        field: "startdate",
-        align: "right",
-        headerFilter: "input",
-        formatter:"datetime",formatterParams:{inputFormat:"yyyy-mm-dd",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}
-      },
-      {
-        title: "Date fin",
-        field: "enddate",
-        align: "right",
-        headerFilter: "input",
-        formatter:"datetime",formatterParams:{inputFormat:"yyyy-mm-dd",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}
-      },
-      {
-        title: "heures/jour",
-        field: "dayhours",
-        align: "right",
-        sorter:"number",
-        formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-      },
-      {
-        title: "Total heures",
-        field: "totalhours",
-        align: "right",
-        sorter:"number",
-        formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
-      },
-      {
-        title: "Congé Type",
-        field: "vacancytype",
-        headerFilter: "input"
-      },
-      {
-        title: "Validé",
-        field: "validated",
-        
-      },
-    ]
-});
-}
-
-function gettbldata_staff() {
-  req.reqdata("POST", "db.cgi", {
-      "get":  "stafflist","schemata":schemata
-  }, loadtbldata_staff);
-
-}
-
-function loadtbldata_staff(data) {
-
-  if (data && data.sqldata) {
-      tbl_staff.setData(data.sqldata);
-  }
-}
-
-function viewbasedata() {
-  var udata = tbl_staff.getSelectedData();
-  if (udata[0]) {
-      var uid = udata[0].id;
-      //getstaffdata(uid);
-      viewpanel('basedata');
-  }
-
-}
-
-function viewstaffvacancy(){
-  var udata = tbl_staff.getSelectedData();
-  if (udata[0]) {
-    var uid = udata[0].id;
-    var udata = tbl_staff.getSelectedData();
-    viewpanel('staffvacancy');
-  }
-}
-
-function viewstaffplanning(){
-  var udata = tbl_staff.getSelectedData();
-  if (udata[0]) {
-    var udata = tbl_staff.getSelectedData();
-    viewpanel('staffplanning');
-  }
-}
-
-function add() {
-  cleanform('staff');
-  viewpanel('basedata');
-}
-
-
-
-function remove() {
-  var udata = tbl_staff.getSelectedData();
-  if (udata[0]) {
-      if (confirm("Êtes vous sûre de supprimer l'employé(e) selectionné?")) {
-          req.reqdata("POST", "db.cgi", {
-              "del": "1",
-              "schemata": schemata,
-              "ident_staff_id": udata[0].id
-          }, gettbldata_staff);
-      }
-  }
-
-}
-
-function viewpanel(pnlname){
-  var panels = document.getElementsByClassName("panel");
-  for (var p=0;p<panels.length;p++){
-    //console.log(panels[p]+ "\n-xx-\n");
-    panels[p].style.display = 'none';
-  }
-  document.getElementById('pnl_' + pnlname).style.display = 'block';
-}
-
-// function viewtable() {
-//   gettbldata_staff();
-//   document.getElementById("pnl_table").style.display = 'block';
-//   document.getElementById("pnl_data").style.display = 'none';
-// }
-
-function edit_staffperiodbase(){
-
-}
-function add_staffperiodbase(){
   
+  staff.inittable();
+  module.viewpanel("tbl_staff");
 }
-function remove_staffperiodbase(){
-  
-}
\ No newline at end of file
index acff542..534c907 100644 (file)
@@ -1,85 +1,13 @@
-[% PROCESS macro/fields.tt %]
 <div class="w3-display-container">
   <div class="w3-top w3-theme-light w3-border-bottom">
     <div class="w3-bar">
-      <button class="w3-bar-item w3-button w3-border w3-blue-grey w3-hover-text-white" onclick="viewpanel('table');"><img src="[% abspath%]img/icons/home.svg" style="height: 24px;"/></button>
-      <button class="w3-bar-item w3-button w3-border w3-blue-grey w3-hover-text-white" onclick="viewbasedata();">Données de base</button>
-       <!-- <button class="w3-bar-item w3-button w3-border w3-blue-grey w3-hover-text-white" onclick="viewstaffvacancy();">Congé</button> -->
-      <button class="w3-bar-item w3-button w3-border w3-blue-grey w3-hover-text-white" onclick="viewstaffplanning();">Planning</button>
-    <!--<button class="w3-bar-item w3-button w3-border w3-right w3-orange" onclick="xlsxexport(); return false;"><img src="[% abspath%]img/icons/excel_white.svg" style="height: 24px;"/></button>
-    <button class="w3-bar-item w3-button w3-border w3-right w3-orange" onclick="pdfexport(); return false;"><img src="[% abspath%]img/icons/pdf_white.svg" style="height: 24px;"/></button>-->
-    
-    <button class="w3-bar-item w3-button w3-border w3-right w3-red" onclick="remove();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
-    <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="edit();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
-    <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="add();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> 
+      <button class="w3-bar-item w3-button w3-border w3-blue-grey w3-hover-text-white" onclick="module.viewpanel('tbl_staff');">Employé(e)s</button>
+      [% INCLUDE "module/$module/widgets/staff/tbar_staff.tt" %]
     </div>
   </div>
-  <div class="w3-display-container panel" id="pnl_table" style="margin-top: 45px;">
-    <div id="tbl_staff"></div>
-  </div>
-  <div class="w3-display-container w3-padding-24 panel" id="pnl_basedata" style="display: none; margin-top: 20px;" >
-    <div class="w3-container  w3-padding-24 w3-card  w3-margin w3-margin-bottom">
-      <form id="frm_staff">
-        <h3>Données de base de l'employé(e)</h3>
-        <div class="w3-row-padding"> 
-          <div class="w3-container">
-            [% fieldhidden('id','staff','ident') %]
-            <div class="w3-container">
-              [% fieldeditbox('staffnumber','staff','No.','w3-half','','','') %]
-              [% fieldeditbox('matricule','staff','Matricule','w3-half','','','') %]
-              [% fieldeditbox('surname','staff','Nom','w3-half','','','') %]
-              [% fieldeditbox('prename','staff','Prénom','w3-half','','','') %]
-              [% fieldeditbox('address','staff','adresse','','','','') %]
-              [% fieldeditbox('zip','staff','cp','w3-fifth','','','') %]
-              [% fieldeditbox('city','staff','ville','w3-twofifth','','','') %]
-              [% fieldeditbox('country','staff','pays','w3-twofifth','','','') %]
-              [% fieldeditbox('job','staff','Job / Position','w3-third','','','') %]
-              [% fieldeditbox('phone','staff','Téléphone','w3-third','','','') %]
-              [% fieldeditbox('email','staff','email','w3-third','','','') %]
-              [% fielddatebox('birthdate','staff',"date de naissance",'w3-third','','') %]
-              [% fielddatebox('entrydate','staff',"date d'entrée",'w3-third','','') %]
-              [% fielddatebox('leavedate','staff',"date de sortie",'w3-third','','') %]
-            </div>
-  
-        </div>
-        
-            [% formsavebutton('staff','sauvegarder') %]
-            </div>
-        </form>
-    </div>
-
-    <div class="w3-container  w3-padding-24 w3-card  w3-margin w3-margin-bottom">
-        <h3>Données contractuelles</h3>
-      <div class="w3-bar">
-      
-      <button class="w3-bar-item w3-button w3-border w3-right w3-red" onclick="remove_staffperiodbase();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
-      <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="edit_staffperiodbase();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
-      <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="add_staffperiodbase();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> 
-      </div>
-        <div id="tbl_staffperiodbase" >
-          
-        </div>
-    </div>
-</div>
-<div class="w3-display-container panel" id="pnl_staffvacancy" style="display: none; margin-top: 45px;">
-  <h2>Congé</h2>
-  <div id="tbl_staffvacancyyear"></div>
-  <div id="tbl_staffvacancy"></div>
+  [% INCLUDE "module/$module/widgets/staff/tbl_staff.tt" %]
+  [% INCLUDE "module/$module/widgets/staff/frm_staff.tt" %]
 </div>
-<div class="w3-display-container panel" id="pnl_staffplanning" style="display: none; margin-top: 45px;">
-  
+[% INCLUDE block/dlgdeleterow.tt %]
 
-    
-      <div class="w3-container">
-        <form id="frm_displayplanning w3-center">
-          <div class="w3-container w3-fifth">
-            <label  class="w3-label"><br/></label>
-            <div style="width: 100%;text-align: right;">Periode visualisé:</div>
-          </div>
-      [% fielddatebox('datefrom','display','Date du','w3-fifth','','') %]
-      [% fielddatebox('dateto','display',"jusqu'au",'w3-fifth','','') %]
-        </form>
-      </div>
-    
-    <div id="tbl_staffworkplan"></div>
-</div>
+<script src="widgets/staff/staff.js"></script>
\ No newline at end of file
diff --git a/backoffice/tmpl/module/staff/widgets/staff/frm_staff.tt b/backoffice/tmpl/module/staff/widgets/staff/frm_staff.tt
new file mode 100644 (file)
index 0000000..0134e78
--- /dev/null
@@ -0,0 +1,45 @@
+[% PROCESS macro/fields.tt %]
+<div class="w3-display-container w3-padding-24 panel" id="pnl_frm_staff" style="display: none; margin-top: 20px;" >
+    <div class="w3-container  w3-padding-24 w3-card  w3-margin w3-margin-bottom">
+      <form id="frm_staff">
+        <h3>Données de base de l'employé(e)</h3>
+        <div class="w3-row-padding"> 
+          <div class="w3-container">
+            [% fieldhidden('id','staff','ident') %]
+            <div class="w3-container">
+              [% fieldeditbox('staffnumber','staff','No.','w3-half','','','') %]
+              [% fieldeditbox('matricule','staff','Matricule','w3-half','','','') %]
+              [% fieldeditbox('surname','staff','Nom','w3-half','','','') %]
+              [% fieldeditbox('prename','staff','Prénom','w3-half','','','') %]
+              [% fieldeditbox('address','staff','adresse','','','','') %]
+              [% fieldeditbox('zip','staff','cp','w3-fifth','','','') %]
+              [% fieldeditbox('city','staff','ville','w3-twofifth','','','') %]
+              [% fieldeditbox('country','staff','pays','w3-twofifth','','','') %]
+              [% fieldeditbox('job','staff','Job / Position','w3-third','','','') %]
+              [% fieldeditbox('phone','staff','Téléphone','w3-third','','','') %]
+              [% fieldeditbox('email','staff','email','w3-third','','','') %]
+              [% fielddatebox('birthdate','staff',"date de naissance",'w3-third','','') %]
+              [% fielddatebox('entrydate','staff',"date d'entrée",'w3-third','','') %]
+              [% fielddatebox('leavedate','staff',"date de sortie",'w3-third','','') %]
+            </div>
+  
+        </div>
+        
+            [% formsavebutton('staff','sauvegarder') %]
+            </div>
+        </form>
+    </div>
+
+    <div class="w3-container  w3-padding-24 w3-card  w3-margin w3-margin-bottom">
+        <h3>Données contractuelles</h3>
+      <div class="w3-bar">
+      
+      <button class="w3-bar-item w3-button w3-border w3-right w3-red" onclick="staff.remove_periodbase();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
+      <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="staff.edit_periodbase();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
+      <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="staff.add_periodbase();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> 
+      </div>
+        <div id="tbl_staffperiodbase" >
+          
+        </div>
+    </div>
+</div>
\ No newline at end of file
diff --git a/backoffice/tmpl/module/staff/widgets/staff/staff.js b/backoffice/tmpl/module/staff/widgets/staff/staff.js
new file mode 100644 (file)
index 0000000..e4484d5
--- /dev/null
@@ -0,0 +1,148 @@
+//var tbl_staff = null;
+//var weekdays= ["mon","tue","wed","thu","fri","sat","sun"];
+var staff ={
+  tbl: null,
+  tblperiodbase: null,
+  current_user: null,
+  name: "staff",
+  choices:{},
+  initform: function(){
+    flatpickr(".datefield",{altInput: true,
+      altFormat: "d.m.Y",
+      dateFormat: "Y-m-d",
+      allowInput: true,
+      "locale": "fr",
+    });
+  },
+  inittable: function(){
+    staff.initform();
+    staff.tbl = new Tabulator("#tbl_" + staff.name, {
+      headerFilterPlaceholder: "filter...",
+      height: "92vh",
+      layout: "fitData",
+      selectable: 1,
+      rowContext:function(e, row){
+        //e - the click event object
+        //row - row component
+        e.preventDefault(); // prevent the browsers default context menu form appearing.
+        },
+        columns: [{
+          title: "No.",
+          field: "staffnumber",
+          headerFilter: "input"
+      }, {
+          title: "Prénom",
+          field: "prename",
+          headerFilter: "input"
+      },{
+        title: "Nom",
+        field: "surname",
+        headerFilter: "input"
+    }, {
+          title: "Job",
+          field: "job",
+          headerFilter: "input"
+      }, {
+          title: "entrée",
+          field: "entrydate",
+          headerFilter: "input",align: "right",formatter:"datetime", formatterParams:{
+            inputFormat:"yyyy-mm-dd",
+            outputFormat:"DD.MM.YYYY",
+            invalidPlaceholder:""}
+      }, {
+          title: "sorite",
+          field: "leavedate",align: "right",formatter:"datetime", formatterParams:{
+            inputFormat:"yyyy-mm-dd",
+            outputFormat:"DD.MM.YYYY",
+            invalidPlaceholder:""},
+          headerFilter: "input"
+      }]
+  });
+  staff.tblperiodbase = new Tabulator("#tbl_staffperiodbase", {
+    headerFilterPlaceholder: "filter...",
+    //height: "94vh",
+    layout: "fitDataFill",
+    selectable: 1,
+    rowContext:function(e, row){
+      //e - the click event object
+      //row - row component
+      //var contextMenu = CtxMenu();
+      //contextMenu.addItem("Editer", edit());
+    // Add our custom function to the menu
+       //contextMenu.addItem("Hello World", ContextMenuExampleFunction);
+
+       // Add a seperator
+       //contextMenu.addSeperator();
+      e.preventDefault(); // prevent the browsers default context menu form appearing.
+      },
+    columns: [
+      {
+        title: "début",
+        field: "startdate",
+        align: "right",
+        formatter:"datetime",formatterParams:{inputFormat:"yyyy-mm-dd",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}
+      },{
+        title: "h/semaine",
+        field: "weekhours",
+        align: "right",
+        sorter:"number",
+        formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
+      },{
+        title: "h/mois",
+        field: "monthhours",
+        align: "right",
+        sorter:"number",
+        formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:2},
+      }]
+});
+    staff.gettbldata();
+    staff.gettblperiodbasedata();
+  },
+  gettbldata: function(){
+    req.reqdata("POST", "db.cgi", { "get":  staff.name + "list","schemata":schemata}, staff.loadtbldata);
+  },
+  loadtbldata: function(data){
+    if (data && data.sqldata) { staff.tbl.setData(data.sqldata);}
+  },
+  gettblperiodbasedata: function(){
+    req.reqdata("POST", "db.cgi", { "get": "staffperiodbaselist","schemata":schemata}, staff.loadtblperiodbasedata);
+  },
+  loadtblperiodbasedata: function(data){
+    if (data && data.sqldata) { staff.tblperiodbase.setData(data.sqldata);}
+  },
+  add: function(){
+    cleanform2("staff",staff.choices);
+    module.viewpanel(staff.name);
+    //module.viewdialog(staff.name,null);
+    //document.getElementById("company").addEventListener('blur', function(event){staff.checkschema(event,this.id);},true);
+    //module.viewpanel('frm_' + staff.name);
+  },
+  edit: function(){
+    //console.log("force remove event");
+    //document.getElementById("company").removeEventListener('blur',function(){},true);
+    var udata = staff.tbl.getSelectedData();
+    if (udata[0]) {
+      cleanform2(staff.name,staff.choices);
+      req.reqdata("POST", "db.cgi", { "get":  staff.name + "data","schemata":schemata, "filter":"id='" + udata[0].id + "'"}, staff.fillform);
+      module.viewpanel("frm_" + staff.name);
+    }
+  },
+  fillform: function(data){
+    //console.log("Fill Form 1");
+    if (data && data.sqldata){
+      //console.log("Fill Form 2");
+      fillformbydataclass2(staff.name,staff.choices,data.sqldata[0]);
+    }
+  },
+  remove: function(){
+    var udata = staff.tbl.getSelectedData();
+    if (udata[0]) {
+      var uid = udata[0].id;
+      showdeletedlg("staff",uid,"Êtes vous sûre de supprimer l'employé(e) sélectionnée?",staff.afterdeletecallback);
+      //module.viewpanel('tbl_' + staff.name);
+    }
+  },
+  afterdeletecallback: function(data){
+    staff.gettbldata();
+  }
+}
diff --git a/backoffice/tmpl/module/staff/widgets/staff/tbar_staff.tt b/backoffice/tmpl/module/staff/widgets/staff/tbar_staff.tt
new file mode 100644 (file)
index 0000000..24caf12
--- /dev/null
@@ -0,0 +1,7 @@
+<div class="toolbar" id="tbar_tbl_staff" style="display: none;">
+  <button class="w3-bar-item w3-button w3-border w3-right w3-red" onclick="staff.remove();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
+  <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="staff.edit();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
+  <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="staff.add();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> 
+</div>
+<div class="toolbar" id="tbar_frm_staff" style="display: none;">
+</div>
\ No newline at end of file
diff --git a/backoffice/tmpl/module/staff/widgets/staff/tbl_staff.tt b/backoffice/tmpl/module/staff/widgets/staff/tbl_staff.tt
new file mode 100644 (file)
index 0000000..ca148b5
--- /dev/null
@@ -0,0 +1,3 @@
+<div class="w3-display-container panel" id="pnl_tbl_staff" style="margin-top: 45px;">
+    <div id="tbl_staff"></div>
+  </div>
\ No newline at end of file
index fc4471c..6caacd6 100644 (file)
@@ -1,266 +1,9 @@
-[% sid = session.id %]
-[% IF (session.usergroups.search('admin') != 1) %]
-[% qcompany = dksdb.query("select id_company from vw_userlist where id=$sid;") %]
-[% company = qcompany.get_all() %]
-[% END %]
-var tbl= null;
-var sel_usergroups = null;
-var choice = {"members":{"id_company":null}};
 
+var schemata = "public";
+var currentview = null;
 function initpage(){
-  [% IF (session.usergroups.search('admin') == 1) %]
-  sel_usergroups = new Choices('#usergroup_ids',{
-    searchEnabled: false,
-    itemSelectText: '',
-    removeItemButton: true,
-    choices : []
-  });
-  choice["members"]["id_company"] = new Choices('#id_company',{
-    searchEnabled: false,
-    itemSelectText: '',
-    removeItemButton: true,
-    choices : []
-  });
-  tbl = new Tabulator("#tbl_users", {
-    headerFilterPlaceholder:"filter...",
-    height: "95vh",
-    layout:"fitDataFill",
-    selectable:1,
-    responsiveLayout:"collapse",
-    columns:[
-    {title:"Entreprise", field:"company",headerFilter:"input",download:true},  
-    {title:"Nom", field:"surname",headerFilter:"input",download:true},
-    {title:"Prénom", field:"prename",headerFilter:"input",download:true},
-    {title:"Accès",field:"group_ids",download:true,headerFilter:"input"},
-    {title:"Position",field:"job",download:true},
-    {title:"Téléphone",field:"phone",download:true},
-    {title:"E-mail",field:"username",download:true},
-    {title:"Bloqué", field:"blocked",download:true},
-    ],
-});
-getusergroups();
-  [% ELSE %]
-  tbl = new Tabulator("#tbl_users", {
-    headerFilterPlaceholder:"filter...",
-    height: "95vh",
-    layout:"fitDataFill",
-    selectable:1,
-    responsiveLayout:"collapse",
-    columns:[
-    {title:"Entreprise", field:"company",},  
-    {title:"Nom", field:"surname",headerFilter:"input"},
-    {title:"Prénom", field:"prename",headerFilter:"input"},
-    {title:"Accès",field:"group_ids"},
-    {title:"Position",field:"job"},
-    {title:"Téléphone",field:"phone"},
-    {title:"E-mail",field:"username"},
-    ],
-});
-  [% END %]
-  gettbldata();
-  getcompanies();
-}
-
-function gettbldata(){
-  [% IF (session.usergroups.search('admin') == 1) %]
-  req.reqdata("POST","db.cgi",{"get":"userlist"},loadtbldata);
-  [% ELSE %]
-  req.reqdata("POST","db.cgi",{"get":"userlist","filter":"id_company=[% company.0.id_company %]"},loadtbldata);
-  [% END %]
-}
-
-function loadtbldata(data){
-  if (data && data.sqldata){
-    tbl.setData(data.sqldata);
-  }
-}
-
-
-function edit(){
-  var udata = tbl.getSelectedData();
-  if (udata[0]){
-    req.reqdata("POST","db.cgi",{"get":"userlist","filter":"id_member=" + udata[0].id_member},fillmemberform);
-  }
-}
-
-function fillmemberform(data){
-  cleanform("members");
-  if (data && data.sqldata){
-    fillformbydataclass("members",data.sqldata[0],false);
-  }
-  
-  document.getElementById('dlgmembers').style.display='block'; 
-}
-
-function getcompanies(){
-  req.reqdata("POST","db.cgi",{"get":"companylist"},fillcompanylist);
-}
-
-function fillcompanylist(data){
-  fillselectlist(choice["members"]["id_company"],data.sqldata,'id','company');
-  
-  return false;
-}
-
-
-function closedlgmembers(){
-  gettbldata();
-  document.getElementById('dlgmembers').style.display='none'; 
-  return false;
-}
-
-[% IF (session.usergroups.search('admin') == 1) %]
-function remove(){
-  var udata = tbl.getSelectedData();
-  if (udata[0]){
-    if (confirm("Êtes vous sûre de supprimer l'utilisateur selectionné?")){
-      req.reqdata("POST","db.cgi",{"del":"1","ident_users_id":udata[0].id},gettbldata);
-    }
-  }
-  
-}
-    function setusergroups(){
-      var udata = tbl.getSelectedData();
-      if (udata[0]){
-        var uid = udata[0].id;
-        req.reqdata("POST","db.cgi",{"get":"userdata","filter":"id=" + uid},fillusergroupform);
-      }
-    }
-    function fillusergroupform(data){
-    
-      if (data && data.sqldata){
-        var frm = document.querySelectorAll('.data_users,.data_display,.data_useringroups');
-        for (var f in frm){
-          
-          if (data.sqldata[0][frm[f].id]){
-            if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')) {
-              if (frm[f].id == "usergroup_ids"){
-                
-                var argrp = data.sqldata[0][frm[f].id].split(",");
-                //console.log(argrp);
-                sel_usergroups.setChoiceByValue(argrp);
-              }  else {
-                frm[f].value=data.sqldata[0][frm[f].id];
-              } 
-            }
-          }
-        }
-        document.getElementById('dlgusergroups').style.display='block';
-      }
-      
-    }
-
-    function getusergroups(){
-      req.reqdata("POST","db.cgi",{"get":"usergroups"},fillusergroups);
-      return false;
-    }
-    function fillusergroups(data){
-      var pug = [];
-      if (data && data.sqldata){
-        for (var i in data.sqldata){
-          pug.push({value:data.sqldata[i].id,label:data.sqldata[i].groupname});
-        }
-      }
-      sel_usergroups.setChoices(pug, 'value', 'label', true);
-      
-      return false;
-    }
-
-    function saveusergroupsform(){
-      var flds = getformcontent("usergroups",{});
-      //console.log(flds);
-
-      req.reqdata("POST","db.cgi",{"fn":"setgroupaccess","params": flds.ident_users_id + ",'{" + flds.useringroups_usergroup_ids.join(',') +"}'"},ugsaved);
-      return false;
-    }
-
-    function ugsaved(data){
-      //console.log(data);
-      gettbldata();
-      document.getElementById('dlgusergroups').style.display='none';
-      formsaved(null);
-    }
-
-    function setlogin(){
-      var udata = tbl.getSelectedData();
-      document.getElementById("nunmsg").innerHTML = ''
-      if (udata[0]){
-        var uid = udata[0].id;
-        req.reqdata("POST","db.cgi",{"get":"userdata","filter":"id=" + uid},fillloginform);
-      }
-    }
-    function fillloginform(data){
-      document.getElementById("blocked").checked = false;
-      document.getElementById("username").value = "";
-      if (data && data.sqldata){
-        var frm = document.querySelectorAll('.data_users,.data_display,.data_useringroups');
-        for (var f in frm){
-          
-          if (data.sqldata[0][frm[f].id]){
-            if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')) {
-              
-              if (frm[f].type == "checkbox"){
-                document.getElementById("blocked").checked = true;
-              } else {
-                frm[f].value=data.sqldata[0][frm[f].id];
-              } 
-            }
-          }
-        }
-        document.getElementById('dlglogin').style.display='block';
-      }
-    }
-
-    function setusername(){
-      var flds = getformcontent("users",{});
-      //console.log(flds);
-      flds["set"] = 1;
-      req.reqdata("POST","db.cgi",flds,loginsaved);
-      return false;
-    }
-
-    function loginsaved(data){
-      //console.log(data);
-        gettbldata();
-        document.getElementById('dlglogin').style.display='none';
-        formsaved(null);      
-    }
-    function ugsaved(data){
-      //console.log(data);
-        gettbldata();
-        document.getElementById('dlgusergroups').style.display='none';
-        formsaved(null);
-    }
-
-    function sendnewpassword(){
-      var flds = getformcontent("login",{});
-      //console.log(flds);
-      return false;
-    }
-
-    function checkemail(){
-      var newusername = document.getElementById("username").value;
-      //console.log("username: " + newusername);
-      if (validateEmail(newusername)){
-        req.reqdata("POST","db.cgi",{"get":"userdata","filter":"username='"+ newusername+ "' and id != " + document.getElementById("id").value},checkmailreturn);
-      }else {
-        document.getElementById("nunmsg").innerHTML= '<div class="panel w3-red">w.e.g. eng richteg email agin!</div>';
-      }
-      return false;
-    }
-    
-    function checkmailreturn(data){
-      //console.log(data);
-      if (data && data.sqldata.length > 0){
-        document.getElementById("nunmsg").innerHTML= '<div class="panel w3-red">Et existéiert schon een aaneren Kont matt deser E-mail!</div>';
-      } else {
-        setusername();
-      }
-      return false;
-    }
-
-    function validateEmail(email) {
-      var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
-      return re.test(String(email).toLowerCase());
-    }
-[% END %]
\ No newline at end of file
+  //schemata = parent.admin.getcurrentSchemata();
+  console.log("Current Schema:" + schemata);
+  users.inittable();
+  module.viewpanel("tbl_users");
+}
\ No newline at end of file
index 4c3bca5..2ea0ed2 100644 (file)
@@ -1,98 +1,14 @@
-[% PROCESS macro/fields.tt %]
-[% IF (session.usergroups.search('admin') == 1) %]
-<div class="w3-top w3-border-bottom w3-white">
-<div class="w3-bar">
-    
-    <!--<button class="w3-bar-item w3-button w3-border w3-right w3-orange" onclick="xlsxexport(); return false;"><img src="[% abspath%]img/icons/excel_white.svg" style="height: 24px;"/></button>
-    <button class="w3-bar-item w3-button w3-border w3-right w3-orange" onclick="pdfexport(); return false;"><img src="[% abspath%]img/icons/pdf_white.svg" style="height: 24px;"/></button>-->
-   
-    <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey " onclick="setusergroups();"><img src="[% abspath%]img/icons/group_white.svg" style="height: 24px;"/></button>
-    
-    <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey " onclick="setlogin();"><img src="[% abspath%]img/icons/user_white.svg" style="height: 24px;"/></button>
-    
-    <button class="w3-bar-item w3-button w3-border w3-right w3-red" onclick="remove();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
-    <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="edit();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
-    <!--<button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="add();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> -->
-    
-</div>
-</div>
-[% END %]
-[% #inputdisabled = 'readonly' %]
-[% #IF (session.usergroups.search('fld') == 1) %]
-[% #inputdisabled = '' %]
-[% #END %]
-<div class="w3-container" id="tbl_users" style="margin-top: 50px;"></div>
-<div id="dlgusergroups" class="w3-modal">
-  <div class="w3-modal-content w3-animate-top w3-card-4">
-    <header class="w3-container"> 
-      <span onclick="document.getElementById('dlgusergroups').style.display='none'; return false;" 
-       class="w3-button w3-display-topright">&times;</span>
-      <h2>Benotzer Accès</h2>
-    </header>
-    <div class="w3-container">
-        [% fieldeditbox("surname","display","Nom",'w3-half','readonly','') %]
-        [% fieldeditbox("prename","display","Prénom",'w3-half','readonly','') %]
-      <form id="frm_usergroups">
-        [% fieldhidden("id","users","ident",'') %]
-        [% fieldmultiselectbox("usergroup_ids","useringroups","Accès",'','','') %]
-      </form>
-    </div>
-    <footer class="w3-container w3-right-align w3-padding-16">
-        
-        <button class="w3-button w3-theme-light w3-border" onclick="document.getElementById('dlgusergroups').style.display='none'; return false;">annuler</button>
-        <button class="w3-button w3-blue-grey w3-margin" onclick="saveusergroupsform();return false;">sauvegarder</button>
-    </footer>
-  </div>
-</div>
-<div id="dlglogin" class="w3-modal">
-  <div class="w3-modal-content w3-animate-top w3-card-4">
-    <header class="w3-container"> 
-      <span onclick="document.getElementById('dlglogin').style.display='none'; return false;" 
-       class="w3-button w3-display-topright">&times;</span>
-      <h2>Benotzer E-Mail</h2>
-    </header>
-    <div class="w3-container">
-        <div id="nunmsg" ></div>
-        [% fieldeditbox("surname","display","Nom",'w3-half','readonly','') %]
-        [% fieldeditbox("prename","display","Prénom",'w3-half','readonly','') %]
-      <form id="frm_users">
-        [% fieldhidden("id","users","ident",'') %]
-        [% fieldeditbox("username","users","Login / E-Mail",'','','') %]
-        [% fieldcheckbox("blocked","users","compte blocké",'','','1') %]
-      </form>
-    </div>
-    <footer class="w3-container w3-right-align w3-padding-16">
-      <!--<button class="w3-button w3-orange w3-border" onclick="sendnewpassword(); return false;">neit Passwuert schecken</button>-->
-      <button class="w3-button w3-theme-light w3-border" onclick="document.getElementById('dlglogin').style.display='none'; return false;">annuler</button>
-      <button class="w3-button w3-blue-grey w3-margin" onclick="checkemail();return false;">Sauvegarder</button>
-    </footer>
-  </div>
-</div>
-<div id="dlgmembers" class="w3-modal">
-  <div class="w3-modal-content w3-animate-top w3-card-4">
-    <header class="w3-container"> 
-      <span onclick="document.getElementById('dlgmembers').style.display='none'; return false;" 
-       class="w3-button w3-display-topright">&times;</span>
-      <h2>Donnée de l'utilsateur</h2>
-    </header>
-    <div class="w3-container">
-    <form id="frm_members">
-         [% fieldhidden('id','members','ident') %]
-          [% fieldeditbox('surname','members','Nom','','') %]
-          [% fieldeditbox('prename','members','Prénom','','') %]
-          [% fieldeditbox('job','members','Position','','') %]
-          [% fieldeditbox('phone','members','Téléphone','','') %]
-          [% fieldselectbox('id_company','members','Entreprise','','','','') %]
-      </form>
+
+<div class="w3-display-container">
+  <div class="w3-top w3-theme-light w3-border-bottom">
+    <div class="w3-bar">
+      <button class="w3-bar-item w3-button w3-border w3-blue-grey w3-hover-text-white" onclick="module.viewpanel('tbl_users');">Utilisateurs</button>
+      [% INCLUDE "module/$module/widgets/users/tbar_users.tt" %]
     </div>
-    <footer class="w3-container w3-right-align w3-padding-16">
-        
-        <button class="w3-button w3-theme-light w3-border" onclick="document.getElementById('dlgmembers').style.display='none'; return false;">annuler</button>
-        [% formdlgsavebutton('members','sauvegarder','closedlgmembers();') %]
-    </footer>
   </div>
+  [% INCLUDE "module/$module/widgets/users/tbl_users.tt" %]
 </div>
-[% #IF (session.usergroups.search('admin') != 1) %]
-[% #INCLUDE "module/$module/javascript.tt" %]
-[% #END %]
+[% INCLUDE block/dlgdeleterow.tt %]
+[% INCLUDE "module/$module/widgets/users/dlg_users.tt" %]
+<script src="widgets/users/users.js"></script>
 
diff --git a/backoffice/tmpl/module/users/widgets/users/dlg_users.tt b/backoffice/tmpl/module/users/widgets/users/dlg_users.tt
new file mode 100644 (file)
index 0000000..597fe65
--- /dev/null
@@ -0,0 +1,30 @@
+[% PROCESS macro/fields.tt %]
+<div id="dlg_users" class="w3-modal">
+  <div class="w3-modal-content w3-animate-top w3-card-4">
+    <header class="w3-container"> 
+      <span onclick="document.getElementById('dlg_users').style.display='none'; return false;" 
+       class="w3-button w3-display-topright">&times;</span>
+      <h2>Données de base du utilisateur</h2>
+    </header>
+    <div class="w3-container">
+    <div id="usermsg" ></div>
+    <form id="frm_users">
+         [% fieldhidden('id','users','ident') %]
+         [% fieldeditbox("username","users","Login / E-Mail",'w3-twothird','','') %]
+         [% fieldcheckbox("blocked","users","compte blocké",'w3-third','','1') %]
+          [% fieldeditbox('surname','users','Nom','w3-half','') %]
+          [% fieldeditbox('prename','users','Prénom','w3-half','') %]
+          [% fieldeditbox('job','users','Position','w3-half','') %]
+          [% fieldeditbox('phone','users','Téléphone','w3-half','') %]
+          [% fieldselectbox('id_company','users','Entreprise','','','','') %]
+          [% fieldmultiselectbox("id_usergroups","users","Accès Groupes",'','','') %]
+          [% fieldmultiselectbox("schemaaccess","users","Accès Schemata",'','','') %]
+      </form>
+    </div>
+    <footer class="w3-container w3-right-align w3-padding-16">
+        <button class="w3-button w3-orange w3-border" onclick="users.sendnewpassword(); return false;">envoyer nouveau mot de passe</button>
+        <button class="w3-button w3-theme-light w3-border" onclick="document.getElementById('dlg_users').style.display='none'; return false;">annuler</button>
+        <button class="w3-button w3-blue-grey w3-margin w3-right-align" onclick="users.validateform();">sauvegarder</button>
+    </footer>
+  </div>
+</div>
\ No newline at end of file
diff --git a/backoffice/tmpl/module/users/widgets/users/tbar_users.tt b/backoffice/tmpl/module/users/widgets/users/tbar_users.tt
new file mode 100644 (file)
index 0000000..a7e4226
--- /dev/null
@@ -0,0 +1,5 @@
+<div class="toolbar" id="tbar_tbl_users" style="display: none;">
+  <button class="w3-bar-item w3-button w3-border w3-right w3-red" onclick="users.remove();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
+  <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="users.edit();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
+  <button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="users.add();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> 
+</div>
diff --git a/backoffice/tmpl/module/users/widgets/users/tbl_users.tt b/backoffice/tmpl/module/users/widgets/users/tbl_users.tt
new file mode 100644 (file)
index 0000000..8d562c7
--- /dev/null
@@ -0,0 +1,3 @@
+<div class="w3-display-container panel" id="pnl_tbl_users" style="margin-top: 45px;">
+    <div id="tbl_users"></div>
+  </div>
\ No newline at end of file
diff --git a/backoffice/tmpl/module/users/widgets/users/users.js b/backoffice/tmpl/module/users/widgets/users/users.js
new file mode 100644 (file)
index 0000000..98a6e33
--- /dev/null
@@ -0,0 +1,159 @@
+//var tbl_users = null;
+//var weekdays= ["mon","tue","wed","thu","fri","sat","sun"];
+var users ={
+  tbl: null,
+  current_user: null,
+  name: "users",
+  choices:{"id_company":null,"id_usergroups":null,"schemaaccess":null},
+  initform: function(){
+    users.choices["id_company"] = new Choices('#id_company',{
+      searchEnabled: false,
+      itemSelectText: '',
+      removeItemButton: true,
+      choices : []
+    });
+    users.choices["id_usergroups"] = new Choices('#id_usergroups',{
+      searchEnabled: false,
+      itemSelectText: '',
+      removeItemButton: true,
+      choices : []
+    });
+    users.choices["schemaaccess"] = new Choices('#schemaaccess',{
+      searchEnabled: false,
+      itemSelectText: '',
+      removeItemButton: true,
+      choices : []
+    });
+    users.getcompanies();
+    users.getusergroups();
+    users.getschemata();
+  },
+  inittable: function(){
+    users.initform();
+    users.tbl = new Tabulator("#tbl_" + users.name, {
+      headerFilterPlaceholder: "filter...",
+      height: "92vh",
+      layout: "fitData",
+      selectable: 1,
+      rowContext:function(e, row){
+        //e - the click event object
+        //row - row component
+        e.preventDefault(); // prevent the browsers default context menu form appearing.
+        },
+    columns:[
+    {title:"Entreprise", field:"company",headerFilter:"input"},  
+    {title:"Nom", field:"surname",headerFilter:"input"},
+    {title:"Prénom", field:"prename",headerFilter:"input"},
+    {title:"Accès",field:"group_ids",headerFilter:"input"},
+    {title:"Position",field:"job"},
+    {title:"Téléphone",field:"phone"},
+    {title:"E-mail",field:"username"},
+    {title:"Bloqué", field:"blocked"},
+    ],
+  });
+    users.gettbldata();
+  },
+  gettbldata: function(){
+    req.reqdata("POST", "db.cgi", { "get":  users.name + "list","schemata":schemata}, users.loadtbldata);
+  },
+  loadtbldata: function(data){
+    if (data && data.sqldata) { users.tbl.setData(data.sqldata);}
+  },
+  add: function(){
+    cleanform2("users",users.choices);
+    module.viewdialog(users.name);
+    //module.viewdialog(users.name,null);
+    //document.getElementById("company").addEventListener('blur', function(event){users.checkschema(event,this.id);},true);
+    //module.viewpanel('frm_' + users.name);
+  },
+  edit: function(){
+    //console.log("force remove event");
+    //document.getElementById("company").removeEventListener('blur',function(){},true);
+    var udata = users.tbl.getSelectedData();
+    if (udata[0]) {
+      cleanform2(users.name,users.choices);
+      req.reqdata("POST", "db.cgi", { "get":  users.name + "data","schemata":schemata, "filter":"id='" + udata[0].id + "'"}, users.fillform);
+      module.viewdialog(users.name);
+    }
+  },
+  fillform: function(data){
+    //console.log("Fill Form 1");
+    if (data && data.sqldata){
+      //console.log("Fill Form 2");
+      fillformbydataclass2(users.name,users.choices,data.sqldata[0]);
+    }
+  },
+  remove: function(){
+    var udata = users.tbl.getSelectedData();
+    if (udata[0]) {
+      var uid = udata[0].id;
+      showdeletedlg("users",uid,"Êtes vous sûre de supprimer l'utilisateur sélectionnée?",users.afterdeletecallback);
+      //module.viewpanel('tbl_' + users.name);
+    }
+  },
+  validateform: function(){
+    users.checkemail();
+  },
+  sendnewpassword: function(){
+    //users.saveform();
+
+  },
+  afterdeletecallback: function(data){
+    users.gettbldata();
+  },
+  afteruseradded: function(data){
+    users.gettbldata();
+    document.getElementById('dlg_users').style.display='none';
+    return false;
+  },
+  getcompanies: function(){
+    req.reqdata("POST","db.cgi",{"get":"companieslist","schemata":schemata},users.fillcompanies);
+  },
+  fillcompanies: function(data){
+    fillselectlist(users.choices["id_company"],data.sqldata,'id','company');
+  },
+  getusergroups: function(){
+    req.reqdata("POST","db.cgi",{"get":"usergroupslist","schemata":schemata},users.fillusergroups);
+  },
+  fillusergroups: function(data){
+    fillselectlist(users.choices["id_usergroups"],data.sqldata,'id','groupname');
+  },
+  getschemata: function(){
+    req.reqdata("POST","db.cgi",{"get":"schemata","schemata":schemata},users.fillschemata);
+  },
+  fillschemata: function(data){
+    fillselectlist(users.choices["schemaaccess"],data.sqldata,'schemaname','schemaname');
+  },
+  checkemail: function(){
+    var newusername = document.getElementsByName("users_username").value;
+    console.log("username: " + newusername);
+    if (users.validateEmail(newusername)){
+      req.reqdata("POST","db.cgi",{"get":"userdata","filter":"username='"+ newusername+ "' and id != " + document.getElementById("id").value},users.checkmailreturn);
+    }else {
+       document.getElementById("usermsg").innerHTML= '<div class="panel w3-red">inserez un email valide s.v.p.!</div>';
+    }
+    return false;
+  },
+  checkmailreturn:function (data){
+    //console.log(data);
+    if (data && data.sqldata.length > 0){
+      document.getElementById("usermsg").innerHTML= '<div class="panel w3-red">Il existe déjà uncompte avec cette addresse E-Mail!</div>';
+    } else {
+      users.savedata();
+    }
+    return false;
+  },
+  validateEmail: function (email) {
+          var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
+          return re.test(String(email).toLowerCase());
+  },
+  savedata: function(){
+      saveform("users",users.userformsaved);
+  },
+  userformsaved: function (data){
+      //console.log(data);
+    users.gettbldata();
+    document.getElementById('dlg_users').style.display='none';
+    formsaved(null);      
+  }
+}
index 149fece..1523e58 100644 (file)
@@ -1,9 +1,15 @@
 [% PROCESS macro/fields.tt %]
 [% USE dksdb = DBI(dsn, dbuser, dbpassword) %] 
-[% appgaccess = dksdb.prepare("select ap.icon,ap.app,ap.name,ug.usergroup from useringroups uig join apps ap on (uig.id_group=ap.id_usergroup) join usergroups ug on (uig.id_group=ug.id) where uig.id_user=? 
-group by ap.id,ug.id order by ap.sort;") %]
-[% appsaccess = dksdb.prepare("select ap.icon,ap.app,ap.name,ug.usergroup from useringroups uig join apps ap on (uig.id_group=ap.id_usergroup) join usergroups ug on (uig.id_group=ug.id) where uig.id_user=? and menutype = 'schema'
-group by ap.id,ug.id order by ap.sort;") %]
+[% appgaccess = dksdb.prepare("select ap.icon,ap.app,ap.name,ug.usergroup 
+from (SELECT users.id,json_array_elements_text(users.id_usergroups)::INT4 AS id_usergroup FROM users) uig 
+join apps ap on (uig.id_usergroup=ap.id_usergroup) 
+join usergroups ug on (uig.id_usergroup=ug.id) where uig.id=? 
+order by ap.sort;") %]
+[% appsaccess = dksdb.prepare("select ap.icon,ap.app,ap.name,ug.usergroup 
+from (SELECT users.id,json_array_elements_text(users.id_usergroups)::INT4 AS id_usergroup FROM users) uig 
+join apps ap on (uig.id_usergroup=ap.id_usergroup) 
+join usergroups ug on (uig.id_usergroup=ug.id) where uig.id=? and ap.menutype = 'schema'
+order by ap.sort;") %]
 <!DOCTYPE html>
 <html lang="en">
 <head>
@@ -16,7 +22,7 @@ group by ap.id,ug.id order by ap.sort;") %]
     <div class="w3-top">
     <div class="w3-bar w3-theme-light w3-large" style="z-index:4;">
         <button class="w3-bar-item w3-button w3-hide-large w3-hover-none w3-hover-text-light-grey" onclick="w3_open();" id="btnsidemenu"><img src="[% abspath %][% staticpath %]img/icons/menu.svg" style="height: 33px;"/></button>
-        <span class="w3-bar-item w3-hide-large">POT</span>
+        <span class="w3-bar-item w3-hide-large"><img src="[% abspath %][% staticpath %]img/pottop.png" alt="POT" style="width: 60px;"/></span>
         <!--<div class="w3-third">
         
         <div>-->
@@ -37,7 +43,7 @@ group by ap.id,ug.id order by ap.sort;") %]
     </div>
     <nav class="w3-sidebar w3-collapse w3-theme-light w3-animate-left" id="mySidebar" style="z-index:3;width:200px;margin-top: -10px;">
         <div class="w3-bar-block">
-            <div class="w3-bar-item w3-large">POT</div>
+            <div class="w3-bar-item w3-large"><img src="[% abspath %][% staticpath %]img/pottop.png" alt="POT" style="width: 60px;"/></div>
             <a class="w3-bar-item w3-button w3-padding-16 w3-hide-large w3-dark-grey w3-hover-black" href="javascript:w3_close();" title="close menu">Close Menu</a>
             
             <!--TODO admin selector -->
index 12f343b..29da19e 100644 (file)
@@ -42,6 +42,7 @@
   <script type="text/javascript" src="[% abspath %]vendors/choices/choices.js"></script>\r
   <script type="text/javascript" src="[% abspath %]vendors/flatpickr/flatpickr.min.js"></script>\r
   <script type="text/javascript" src="[% abspath %]vendors/flatpickr/l10n/fr.js"></script>\r
+  <script type="text/javascript" src="[% abspath %]vendors/flatpickr/plugins/weekSelect/weekSelect.js"></script>\r
   <script type="text/javascript" src="[% abspath %]vendors/ctxmenu/ctxmenu.js"></script>\r
   \r
    <script type="text/javascript" src="[% pagename %].js"></script>\r
index feaf8f7..d087cdd 100755 (executable)
@@ -8,7 +8,25 @@ then
        echo "No args"
        exit 0
 fi
+
 DBSCHEMA=$1
+echo "generate default schema from "${DBSCHEMA}
+if [ "${DBSCHEMA}" == "public" ]
+then
+cat ${CALLDIR}"/potlu_db."${DBSCHEMA}".pg.schema.sql" | \
+grep -v -e "^--" | \
+grep -v -e "^SET" | \
+grep -v "SELECT pg_catalog" | \
+grep -v "CREATE SCHEMA" | \
+grep -v "COMMENT ON SCHEMA public" | \
+grep -v "AS integer" \
+> ${CALLDIR}"/potlu_db."${DBSCHEMA}".pg.install.schema.sql"
+# 
+# 
+# grep -v "COMMENT ON SCHEMA public" \
+#sed -i -e 's/'${DBSCHEMA}'/'${COMPANYSCHEMA}'/g' ${CALLDIR}"/potlu_db."${DBSCHEMA}".pg.schema.sql"
+sed -i -e '/^$/N;/^\n$/D' ${CALLDIR}"/potlu_db."${DBSCHEMA}".pg.install.schema.sql"
+else
 cat ${CALLDIR}"/potlu_db."${DBSCHEMA}".pg.schema.sql" | \
 grep -v -e "^--" | \
 grep -v -e "^SET" | \
@@ -18,3 +36,5 @@ grep -v "SELECT pg_catalog" \
 sed -i -e 's/'${DBSCHEMA}'/'${COMPANYSCHEMA}'/g' ${CALLDIR}"/potlu_db.newcompanyschema.pg.schema.sql"
 sed -i -e '/^$/N;/^\n$/D' ${CALLDIR}"/potlu_db.newcompanyschema.pg.schema.sql"
 cp ${CALLDIR}"/potlu_db.newcompanyschema.pg.schema.sql" ${CALLDIR}"/../../backoffice/data/schemata/defaultcompany.schema.sql"
+fi
+
index f7db8e9..027a821 100644 (file)
@@ -1,46 +1,6 @@
 
 CREATE SCHEMA %%NEWSCHEMA%%;
 
-CREATE TABLE %%NEWSCHEMA%%.defaultweekworkplan (
-    id integer NOT NULL,
-    id_staff integer,
-    startdate date,
-    mon json,
-    tue json,
-    wed json,
-    thu json,
-    fri json,
-    sat json,
-    sun json
-);
-
-CREATE SEQUENCE %%NEWSCHEMA%%.defaultweekworkplan_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-ALTER SEQUENCE %%NEWSCHEMA%%.defaultweekworkplan_id_seq OWNED BY %%NEWSCHEMA%%.defaultweekworkplan.id;
-
-CREATE TABLE %%NEWSCHEMA%%.defaultworkplan (
-    id bigint NOT NULL,
-    id_staff integer,
-    daydate date,
-    plannedtimes json,
-    vacancytimes json,
-    presencetimes json
-);
-
-CREATE SEQUENCE %%NEWSCHEMA%%.defaultworkplan_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-ALTER SEQUENCE %%NEWSCHEMA%%.defaultworkplan_id_seq OWNED BY %%NEWSCHEMA%%.defaultworkplan.id;
-
 CREATE TABLE %%NEWSCHEMA%%.reportperiod (
     id integer NOT NULL,
     periodname text,
@@ -1125,10 +1085,6 @@ CREATE SEQUENCE %%NEWSCHEMA%%.worktypes_id_seq
 
 ALTER SEQUENCE %%NEWSCHEMA%%.worktypes_id_seq OWNED BY %%NEWSCHEMA%%.worktypes.id;
 
-ALTER TABLE ONLY %%NEWSCHEMA%%.defaultweekworkplan ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.defaultweekworkplan_id_seq'::regclass);
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.defaultworkplan ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.defaultworkplan_id_seq'::regclass);
-
 ALTER TABLE ONLY %%NEWSCHEMA%%.reportperiod ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.reportperiod_id_seq'::regclass);
 
 ALTER TABLE ONLY %%NEWSCHEMA%%.sites ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.sites_id_seq'::regclass);
@@ -1151,12 +1107,6 @@ ALTER TABLE ONLY %%NEWSCHEMA%%.workplans ALTER COLUMN id SET DEFAULT nextval('%%
 
 ALTER TABLE ONLY %%NEWSCHEMA%%.worktypes ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.worktypes_id_seq'::regclass);
 
-ALTER TABLE ONLY %%NEWSCHEMA%%.defaultweekworkplan
-    ADD CONSTRAINT defaultweekworkplan_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.defaultworkplan
-    ADD CONSTRAINT defaultworkplan_pkey PRIMARY KEY (id);
-
 ALTER TABLE ONLY %%NEWSCHEMA%%.reportperiod
     ADD CONSTRAINT reportperiod_pkey PRIMARY KEY (id);
 
@@ -1191,3 +1141,4 @@ ALTER TABLE ONLY %%NEWSCHEMA%%.worktypes
     ADD CONSTRAINT worktypes_pkey PRIMARY KEY (id);
 
 CREATE TRIGGER trg_upd_%%NEWSCHEMA%%_weekhours BEFORE UPDATE OF weekhours ON %%NEWSCHEMA%%.staffperiodbase FOR EACH ROW EXECUTE PROCEDURE public.trg_update_monthhours();
+
index 68d29b7..e301a0d 100644 (file)
@@ -16,18 +16,6 @@ SET xmloption = content;
 SET client_min_messages = warning;
 SET row_security = off;
 
---
--- Data for Name: defaultweekworkplan; Type: TABLE DATA; Schema: portanova; Owner: -
---
-
-
-
---
--- Data for Name: defaultworkplan; Type: TABLE DATA; Schema: portanova; Owner: -
---
-
-
-
 --
 -- Data for Name: reportperiod; Type: TABLE DATA; Schema: portanova; Owner: -
 --
@@ -1544,20 +1532,6 @@ INSERT INTO portanova.worktypes (id, worktype, isworktime, isfreetime, typecolor
 INSERT INTO portanova.worktypes (id, worktype, isworktime, isfreetime, typecolor) VALUES (7, 'libre jours', NULL, NULL, '#0070c0');
 
 
---
--- Name: defaultweekworkplan_id_seq; Type: SEQUENCE SET; Schema: portanova; Owner: -
---
-
-SELECT pg_catalog.setval('portanova.defaultweekworkplan_id_seq', 1, false);
-
-
---
--- Name: defaultworkplan_id_seq; Type: SEQUENCE SET; Schema: portanova; Owner: -
---
-
-SELECT pg_catalog.setval('portanova.defaultworkplan_id_seq', 1, false);
-
-
 --
 -- Name: reportperiod_id_seq; Type: SEQUENCE SET; Schema: portanova; Owner: -
 --
index 33d18dd..704f0ea 100644 (file)
@@ -29,85 +29,6 @@ SET default_tablespace = '';
 
 SET default_with_oids = false;
 
---
--- Name: defaultweekworkplan; Type: TABLE; Schema: portanova; Owner: potlu_user
---
-
-CREATE TABLE portanova.defaultweekworkplan (
-    id integer NOT NULL,
-    id_staff integer,
-    startdate date,
-    mon json,
-    tue json,
-    wed json,
-    thu json,
-    fri json,
-    sat json,
-    sun json
-);
-
-
-ALTER TABLE portanova.defaultweekworkplan OWNER TO potlu_user;
-
---
--- Name: defaultweekworkplan_id_seq; Type: SEQUENCE; Schema: portanova; Owner: potlu_user
---
-
-CREATE SEQUENCE portanova.defaultweekworkplan_id_seq
-    AS integer
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-ALTER TABLE portanova.defaultweekworkplan_id_seq OWNER TO potlu_user;
-
---
--- Name: defaultweekworkplan_id_seq; Type: SEQUENCE OWNED BY; Schema: portanova; Owner: potlu_user
---
-
-ALTER SEQUENCE portanova.defaultweekworkplan_id_seq OWNED BY portanova.defaultweekworkplan.id;
-
-
---
--- Name: defaultworkplan; Type: TABLE; Schema: portanova; Owner: potlu_user
---
-
-CREATE TABLE portanova.defaultworkplan (
-    id bigint NOT NULL,
-    id_staff integer,
-    daydate date,
-    plannedtimes json,
-    vacancytimes json,
-    presencetimes json
-);
-
-
-ALTER TABLE portanova.defaultworkplan OWNER TO potlu_user;
-
---
--- Name: defaultworkplan_id_seq; Type: SEQUENCE; Schema: portanova; Owner: potlu_user
---
-
-CREATE SEQUENCE portanova.defaultworkplan_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-ALTER TABLE portanova.defaultworkplan_id_seq OWNER TO potlu_user;
-
---
--- Name: defaultworkplan_id_seq; Type: SEQUENCE OWNED BY; Schema: portanova; Owner: potlu_user
---
-
-ALTER SEQUENCE portanova.defaultworkplan_id_seq OWNED BY portanova.defaultworkplan.id;
-
-
 --
 -- Name: reportperiod; Type: TABLE; Schema: portanova; Owner: potlu_user
 --
@@ -1466,20 +1387,6 @@ ALTER TABLE portanova.worktypes_id_seq OWNER TO potlu_user;
 ALTER SEQUENCE portanova.worktypes_id_seq OWNED BY portanova.worktypes.id;
 
 
---
--- Name: defaultweekworkplan id; Type: DEFAULT; Schema: portanova; Owner: potlu_user
---
-
-ALTER TABLE ONLY portanova.defaultweekworkplan ALTER COLUMN id SET DEFAULT nextval('portanova.defaultweekworkplan_id_seq'::regclass);
-
-
---
--- Name: defaultworkplan id; Type: DEFAULT; Schema: portanova; Owner: potlu_user
---
-
-ALTER TABLE ONLY portanova.defaultworkplan ALTER COLUMN id SET DEFAULT nextval('portanova.defaultworkplan_id_seq'::regclass);
-
-
 --
 -- Name: reportperiod id; Type: DEFAULT; Schema: portanova; Owner: potlu_user
 --
@@ -1557,22 +1464,6 @@ ALTER TABLE ONLY portanova.workplans ALTER COLUMN id SET DEFAULT nextval('portan
 ALTER TABLE ONLY portanova.worktypes ALTER COLUMN id SET DEFAULT nextval('portanova.worktypes_id_seq'::regclass);
 
 
---
--- Data for Name: defaultweekworkplan; Type: TABLE DATA; Schema: portanova; Owner: potlu_user
---
-
-COPY portanova.defaultweekworkplan (id, id_staff, startdate, mon, tue, wed, thu, fri, sat, sun) FROM stdin;
-\.
-
-
---
--- Data for Name: defaultworkplan; Type: TABLE DATA; Schema: portanova; Owner: potlu_user
---
-
-COPY portanova.defaultworkplan (id, id_staff, daydate, plannedtimes, vacancytimes, presencetimes) FROM stdin;
-\.
-
-
 --
 -- Data for Name: reportperiod; Type: TABLE DATA; Schema: portanova; Owner: potlu_user
 --
@@ -3111,20 +3002,6 @@ COPY portanova.worktypes (id, worktype, isworktime, isfreetime, typecolor) FROM
 \.
 
 
---
--- Name: defaultweekworkplan_id_seq; Type: SEQUENCE SET; Schema: portanova; Owner: potlu_user
---
-
-SELECT pg_catalog.setval('portanova.defaultweekworkplan_id_seq', 1, false);
-
-
---
--- Name: defaultworkplan_id_seq; Type: SEQUENCE SET; Schema: portanova; Owner: potlu_user
---
-
-SELECT pg_catalog.setval('portanova.defaultworkplan_id_seq', 1, false);
-
-
 --
 -- Name: reportperiod_id_seq; Type: SEQUENCE SET; Schema: portanova; Owner: potlu_user
 --
@@ -3202,22 +3079,6 @@ SELECT pg_catalog.setval('portanova.workplans_id_seq', 5, true);
 SELECT pg_catalog.setval('portanova.worktypes_id_seq', 7, true);
 
 
---
--- Name: defaultweekworkplan defaultweekworkplan_pkey; Type: CONSTRAINT; Schema: portanova; Owner: potlu_user
---
-
-ALTER TABLE ONLY portanova.defaultweekworkplan
-    ADD CONSTRAINT defaultweekworkplan_pkey PRIMARY KEY (id);
-
-
---
--- Name: defaultworkplan defaultworkplan_pkey; Type: CONSTRAINT; Schema: portanova; Owner: potlu_user
---
-
-ALTER TABLE ONLY portanova.defaultworkplan
-    ADD CONSTRAINT defaultworkplan_pkey PRIMARY KEY (id);
-
-
 --
 -- Name: reportperiod reportperiod_pkey; Type: CONSTRAINT; Schema: portanova; Owner: potlu_user
 --
index 04b0518..9c9512f 100644 (file)
@@ -27,77 +27,6 @@ SET default_tablespace = '';
 
 SET default_with_oids = false;
 
---
--- Name: defaultweekworkplan; Type: TABLE; Schema: portanova; Owner: -
---
-
-CREATE TABLE portanova.defaultweekworkplan (
-    id integer NOT NULL,
-    id_staff integer,
-    startdate date,
-    mon json,
-    tue json,
-    wed json,
-    thu json,
-    fri json,
-    sat json,
-    sun json
-);
-
-
---
--- Name: defaultweekworkplan_id_seq; Type: SEQUENCE; Schema: portanova; Owner: -
---
-
-CREATE SEQUENCE portanova.defaultweekworkplan_id_seq
-    AS integer
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: defaultweekworkplan_id_seq; Type: SEQUENCE OWNED BY; Schema: portanova; Owner: -
---
-
-ALTER SEQUENCE portanova.defaultweekworkplan_id_seq OWNED BY portanova.defaultweekworkplan.id;
-
-
---
--- Name: defaultworkplan; Type: TABLE; Schema: portanova; Owner: -
---
-
-CREATE TABLE portanova.defaultworkplan (
-    id bigint NOT NULL,
-    id_staff integer,
-    daydate date,
-    plannedtimes json,
-    vacancytimes json,
-    presencetimes json
-);
-
-
---
--- Name: defaultworkplan_id_seq; Type: SEQUENCE; Schema: portanova; Owner: -
---
-
-CREATE SEQUENCE portanova.defaultworkplan_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: defaultworkplan_id_seq; Type: SEQUENCE OWNED BY; Schema: portanova; Owner: -
---
-
-ALTER SEQUENCE portanova.defaultworkplan_id_seq OWNED BY portanova.defaultworkplan.id;
-
-
 --
 -- Name: reportperiod; Type: TABLE; Schema: portanova; Owner: -
 --
@@ -1396,20 +1325,6 @@ CREATE SEQUENCE portanova.worktypes_id_seq
 ALTER SEQUENCE portanova.worktypes_id_seq OWNED BY portanova.worktypes.id;
 
 
---
--- Name: defaultweekworkplan id; Type: DEFAULT; Schema: portanova; Owner: -
---
-
-ALTER TABLE ONLY portanova.defaultweekworkplan ALTER COLUMN id SET DEFAULT nextval('portanova.defaultweekworkplan_id_seq'::regclass);
-
-
---
--- Name: defaultworkplan id; Type: DEFAULT; Schema: portanova; Owner: -
---
-
-ALTER TABLE ONLY portanova.defaultworkplan ALTER COLUMN id SET DEFAULT nextval('portanova.defaultworkplan_id_seq'::regclass);
-
-
 --
 -- Name: reportperiod id; Type: DEFAULT; Schema: portanova; Owner: -
 --
@@ -1487,22 +1402,6 @@ ALTER TABLE ONLY portanova.workplans ALTER COLUMN id SET DEFAULT nextval('portan
 ALTER TABLE ONLY portanova.worktypes ALTER COLUMN id SET DEFAULT nextval('portanova.worktypes_id_seq'::regclass);
 
 
---
--- Name: defaultweekworkplan defaultweekworkplan_pkey; Type: CONSTRAINT; Schema: portanova; Owner: -
---
-
-ALTER TABLE ONLY portanova.defaultweekworkplan
-    ADD CONSTRAINT defaultweekworkplan_pkey PRIMARY KEY (id);
-
-
---
--- Name: defaultworkplan defaultworkplan_pkey; Type: CONSTRAINT; Schema: portanova; Owner: -
---
-
-ALTER TABLE ONLY portanova.defaultworkplan
-    ADD CONSTRAINT defaultworkplan_pkey PRIMARY KEY (id);
-
-
 --
 -- Name: reportperiod reportperiod_pkey; Type: CONSTRAINT; Schema: portanova; Owner: -
 --
index 8619bd4..5ab0266 100644 (file)
@@ -1,22 +1,4 @@
---
--- PostgreSQL database dump
---
-
--- Dumped from database version 11.5 (Debian 11.5-1+deb10u1)
--- Dumped by pg_dump version 11.5 (Debian 11.5-1+deb10u1)
 
-SET statement_timeout = 0;
-SET lock_timeout = 0;
-SET idle_in_transaction_session_timeout = 0;
-SET client_encoding = 'UTF8';
-SET standard_conforming_strings = on;
-SELECT pg_catalog.set_config('search_path', '', false);
-SET check_function_bodies = false;
-SET xmloption = content;
-SET client_min_messages = warning;
-SET row_security = off;
-
---
 -- Data for Name: usergroups; Type: TABLE DATA; Schema: public; Owner: -
 --
 
@@ -45,19 +27,89 @@ INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, m
 -- Data for Name: companies; Type: TABLE DATA; Schema: public; Owner: -
 --
 
-INSERT INTO public.companies (id, company, address, zip, city, country, tradetype, comregister, vatnumber, schemata, validated, schemata2, email) VALUES (1, 'DKS s.à r.l.', '4, rue Principale', '3770', 'Tétange', 'Luxembourg', NULL, NULL, NULL, 'portanova', NULL, NULL, NULL);
+INSERT INTO public.companies (id, company, address, zip, city, country, tradetype, comregister, vatnumber, schemata, validated, schemata2, email, socialtype, vatvalidated) VALUES (1, 'DKS', '4, rue Principale', '3770', 'Tétange', 'Luxembourg', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 's.à r.l.', true);
 
 
 --
 -- Data for Name: maillayouts; Type: TABLE DATA; Schema: public; Owner: -
 --
 
+INSERT INTO public.maillayouts (id, layoutname, mailtemplate) VALUES (1, 'potbasic', '<html>
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+    <style>
+    body,html {
+        margin: 0;
+        background-color: #fff;
+    }
+  </style>
+  </head>
+  <body bgcolor="#607d8b">
+    <div class="maincontainer" align="left" style="padding-top: 5px; width: auto; background-color: #607d8b!important; color: #fff;">
+        POT - Plan d''organisation de travail</span>
+      <div  style="background-color: #fff; color: #000">
+        <div class="mailcontent" align="left" style="padding: 10px; color: #000;">
+          %%BODYCONTENT%%
+        </div>
+      </div>
+    </div>
+  </body>
+</html>');
 
 
 --
 -- Data for Name: mailtemplates; Type: TABLE DATA; Schema: public; Owner: -
 --
 
+INSERT INTO public.mailtemplates (id, templatename, emailtext, emaildatasql, mailfrom, mailsubject, id_maillayout) VALUES (1, 'user_registration', 'Bonjour %%prename%% %%surname%%,<br/>
+<br/>
+Merci pour votre création de compte sur pot.lu,
+<br/><br/>
+votre login: <strong>%%username%%</strong><br/>
+votre mot de passe: <strong>%%password%%</strong>
+<br/>
+Meilleurs salutations,<br/>
+<br/>
+POT Support Team', 'select prename,surname,username from users where id=''%%id%%'';', 'support@dks.lu', 'Confirmation requis pour votre création de compte sur pot.lu', 1);
+INSERT INTO public.mailtemplates (id, templatename, emailtext, emaildatasql, mailfrom, mailsubject, id_maillayout) VALUES (2, 'user_forgotpasswd', 'Bonjour %%prename%% %%surname%%,<br/><br/>
+
+vous avez demandé un nouveau mot de passe via pot.lu!<br/>
+nouveau mot de passe: <strong>%%newpassword%%</strong><br/><br/>
+<br/>
+Meilleurs salutations,<br/>
+<br/>
+POT Support Team
+
+
+
+', 'select prename,surname from users where id=''%%id%%'';', 'support@dks.lu', 'Nouveau mot de passe pour le site pot.lu', 1);
+INSERT INTO public.mailtemplates (id, templatename, emailtext, emaildatasql, mailfrom, mailsubject, id_maillayout) VALUES (3, 'user_expiration_notice', 'Bonjour %%prename%% %%surname%%,<br/>
+<br/>
+Votre souscription au site pot.lu expire bientôt,
+<br/><br/>
+n''oublié pas à la prolonger!
+<a href="%%siteurl%%/profile/application">Prolonger maintenant</a>
+<br/>
+Meilleurs salutations,<br/>
+<br/>
+pot.lu Support Team', 'select prename,surname from users where id=''%%id%%'';', 'support@dks.lu', 'Notice d''expiration de votre souscription sur pot.lu', 1);
+INSERT INTO public.mailtemplates (id, templatename, emailtext, emaildatasql, mailfrom, mailsubject, id_maillayout) VALUES (4, 'user_invoice_paypal', 'Bonjour %%prename%% %%surname%%,<br/>
+<br/>
+En annexe vous trouvez la facture pour votre souscription au site pot.lu,
+<br/>
+<b>Vous avez Payé déjà via PayPal!</b>
+
+Meilleurs salutations,<br/>
+<br/>
+pot.lu Support Team', 'select prename,surname from users where id=''%%id%%'';', 'support@dks.lu', 'Info facture pour votre souscription sur pot.lu', 1);
+INSERT INTO public.mailtemplates (id, templatename, emailtext, emaildatasql, mailfrom, mailsubject, id_maillayout) VALUES (5, 'user_invoice', 'Bonjour %%prename%% %%surname%%,<br/>
+<br/>
+En annexe vous trouvez la facture pour votre souscription au site pot.lu,
+<br/>
+
+Meilleurs salutations,<br/>
+<br/>
+POT Support Team', 'select prename,surname from users where id=''%%id%%'';', 'support@dks.lu', 'Facture concernant votre souscription sur pot.lu', 1);
 
 
 --
@@ -74,20 +126,6 @@ INSERT INTO public.users (id, userpassword, created, blocked, username, regcode,
 INSERT INTO public.members (id, surname, prename, phone, id_user, id_company, job) VALUES (1, 'Saffran', 'Kilian', NULL, 1, 1, NULL);
 
 
---
--- Data for Name: sessions; Type: TABLE DATA; Schema: public; Owner: -
---
-
-INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (111, 'uWpnqxhEFJt2MZxMoLSz4ZAZoc3ZJnu3aKhq8oVD', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '2001:7e8:cc73:de00:213c:73ba:ffa7:842b', '2019-12-05 19:16:43.969105');
-INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (112, 'mUmGFzD4kPLyhHfJO9TDOGfCtsVAEefRYrotRRo1', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '2001:7e8:cc73:de00:7946:65e2:f587:8b74', '2019-12-06 07:02:23.094765');
-INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (113, 'HaDg0Eh9nIk7lftrHDtQpaKiLWL66VoEWRKMmSLz', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '::1', '2019-12-09 11:33:13.202044');
-INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (114, 'aSli1lR9B0ETjICf7IFjVxhphLd8dhRdZ2mRd4RE', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18362', '::1', '2019-12-10 15:55:53.526432');
-INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (122, 'Sp2D9CvtdjQHaxLPkEXgqSMSveIJwQde56I5y3oC', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '2001:7e8:cc73:de00:d970:312a:d5d:db83', '2019-12-12 07:06:51.913155');
-INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (123, 'klCMzztihKleI4E0zhnmNMrlL8sAUIj5TLHjb0si', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36', '::1', '2019-12-13 08:27:53.789037');
-INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (93, '5P7159lXg8xY83Iu7eZC3hj3Oi6x29jXOhPKg0yn', 1, 'Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36', '::1', '2019-12-04 14:58:48.993651');
-INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (98, '9UisAitYaoxdqtBaWUI37R04CiBlFxcp0STuCOZRU', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '::1', '2019-12-05 07:34:07.997426');
-INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (99, 'v6wZ65qozoWn5P32q4wg16224TcOAM1VJnLFj1UJ', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '192.168.178.23', '2019-12-05 07:35:01.756219');
-
 
 --
 -- Data for Name: useringroups; Type: TABLE DATA; Schema: public; Owner: -
@@ -114,14 +152,14 @@ SELECT pg_catalog.setval('public.companies_id_seq', 1, true);
 -- Name: maillayouts_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
 --
 
-SELECT pg_catalog.setval('public.maillayouts_id_seq', 1, false);
+SELECT pg_catalog.setval('public.maillayouts_id_seq', 1, true);
 
 
 --
 -- Name: mailtemplates_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
 --
 
-SELECT pg_catalog.setval('public.mailtemplates_id_seq', 1, false);
+SELECT pg_catalog.setval('public.mailtemplates_id_seq', 5, true);
 
 
 --
@@ -135,7 +173,7 @@ SELECT pg_catalog.setval('public.members_id_seq', 1, false);
 -- Name: sessions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
 --
 
-SELECT pg_catalog.setval('public.sessions_id_seq', 123, true);
+SELECT pg_catalog.setval('public.sessions_id_seq', 124, true);
 
 
 --
index a972283..cb9314e 100644 (file)
@@ -310,7 +310,9 @@ CREATE TABLE public.companies (
     schemata text,
     validated boolean,
     schemata2 json,
-    email text
+    email text,
+    socialtype text,
+    vatvalidated boolean
 );
 
 
@@ -600,10 +602,10 @@ ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
 
 
 --
--- Name: vw_companydata; Type: VIEW; Schema: public; Owner: potlu_user
+-- Name: vw_companiesdata; Type: VIEW; Schema: public; Owner: potlu_user
 --
 
-CREATE VIEW public.vw_companydata AS
+CREATE VIEW public.vw_companiesdata AS
  SELECT companies.id,
     companies.company,
     companies.address,
@@ -613,30 +615,41 @@ CREATE VIEW public.vw_companydata AS
     companies.tradetype,
     companies.comregister,
     companies.vatnumber,
-    companies.schemata AS link,
-    companies.validated
+    companies.schemata,
+    companies.validated,
+    companies.schemata2,
+    companies.email,
+    companies.socialtype,
+    companies.vatvalidated
    FROM public.companies;
 
 
-ALTER TABLE public.vw_companydata OWNER TO potlu_user;
+ALTER TABLE public.vw_companiesdata OWNER TO potlu_user;
 
 --
--- Name: vw_companylist; Type: VIEW; Schema: public; Owner: potlu_user
+-- Name: vw_companieslist; Type: VIEW; Schema: public; Owner: potlu_user
 --
 
-CREATE VIEW public.vw_companylist AS
- SELECT co.id,
-    co.company,
-    co.address,
-    co.zip,
-    co.city,
-    co.country,
-    ((((((co.address || '\n'::text) || co.zip) || ' '::text) || co.city) || ' '::text) || co.country) AS dspaddress,
-    co.schemata
-   FROM public.companies co;
+CREATE VIEW public.vw_companieslist AS
+ SELECT companies.id,
+    companies.company,
+    companies.address,
+    companies.zip,
+    companies.city,
+    companies.country,
+    companies.tradetype,
+    companies.comregister,
+    companies.vatnumber,
+    companies.schemata,
+    companies.validated,
+    companies.schemata2,
+    companies.email,
+    companies.socialtype,
+    companies.vatvalidated
+   FROM public.companies;
 
 
-ALTER TABLE public.vw_companylist OWNER TO potlu_user;
+ALTER TABLE public.vw_companieslist OWNER TO potlu_user;
 
 --
 -- Name: vw_memberdata; Type: VIEW; Schema: public; Owner: potlu_user
@@ -769,8 +782,8 @@ COPY public.apps (id, app, description, name, id_usergroup, icon, sort, menutype
 -- Data for Name: companies; Type: TABLE DATA; Schema: public; Owner: potlu_user
 --
 
-COPY public.companies (id, company, address, zip, city, country, tradetype, comregister, vatnumber, schemata, validated, schemata2, email) FROM stdin;
-1      DKS s.à r.l.   4, rue Principale       3770    Tétange        Luxembourg      \N      \N      \N      portanova       \N      \N      \N
+COPY public.companies (id, company, address, zip, city, country, tradetype, comregister, vatnumber, schemata, validated, schemata2, email, socialtype, vatvalidated) FROM stdin;
+1      DKS s.à r.l.   4, rue Principale       3770    Tétange        Luxembourg      \N      \N      \N      portanova       \N      \N      \N      \N      \N
 \.
 
 
@@ -779,6 +792,7 @@ COPY public.companies (id, company, address, zip, city, country, tradetype, comr
 --
 
 COPY public.maillayouts (id, layoutname, mailtemplate) FROM stdin;
+1      potbasic        <html>\r\n  <head>\r\n    <meta http-equiv="content-type" content="text/html; charset=UTF-8">\r\n    <style>\r\n    body,html {\r\n        margin: 0;\r\n        background-color: #fff;\r\n    }\r\n  </style>\r\n  </head>\r\n  <body bgcolor="#607d8b">\r\n    <div class="maincontainer" align="left" style="padding-top: 5px; width: auto; background-color: #607d8b!important; color: #fff;">\r\n        POT - Plan d'organisation de travail</span>\r\n      <div  style="background-color: #fff; color: #000">\r\n        <div class="mailcontent" align="left" style="padding: 10px; color: #000;">\r\n          %%BODYCONTENT%%\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </body>\r\n</html>
 \.
 
 
@@ -787,6 +801,11 @@ COPY public.maillayouts (id, layoutname, mailtemplate) FROM stdin;
 --
 
 COPY public.mailtemplates (id, templatename, emailtext, emaildatasql, mailfrom, mailsubject, id_maillayout) FROM stdin;
+1      user_registration       Bonjour %%prename%% %%surname%%,<br/>\n<br/>\nMerci pour votre création de compte sur pot.lu,\n<br/><br/>\nvotre login: <strong>%%username%%</strong><br/>\nvotre mot de passe: <strong>%%password%%</strong>\n<br/>\nMeilleurs salutations,<br/>\n<br/>\nPOT Support Team     select prename,surname,username from users where id='%%id%%';   support@dks.lu  Confirmation requis pour votre création de compte sur pot.lu   1
+2      user_forgotpasswd       Bonjour %%prename%% %%surname%%,<br/><br/>\n\nvous avez demandé un nouveau mot de passe via pot.lu!<br/>\nnouveau mot de passe: <strong>%%newpassword%%</strong><br/><br/>\n<br/>\nMeilleurs salutations,<br/>\n<br/>\nPOT Support Team\n\n\n\n        select prename,surname from users where id='%%id%%';    support@dks.lu  Nouveau mot de passe pour le site pot.lu        1
+3      user_expiration_notice  Bonjour %%prename%% %%surname%%,<br/>\n<br/>\nVotre souscription au site pot.lu expire bientôt,\n<br/><br/>\nn'oublié pas à la prolonger!\n<a href="%%siteurl%%/profile/application">Prolonger maintenant</a>\n<br/>\nMeilleurs salutations,<br/>\n<br/>\npot.lu Support Team        select prename,surname from users where id='%%id%%';    support@dks.lu  Notice d'expiration de votre souscription sur pot.lu    1
+4      user_invoice_paypal     Bonjour %%prename%% %%surname%%,<br/>\n<br/>\nEn annexe vous trouvez la facture pour votre souscription au site pot.lu,\n<br/>\n<b>Vous avez Payé déjà via PayPal!</b>\n\nMeilleurs salutations,<br/>\n<br/>\npot.lu Support Team    select prename,surname from users where id='%%id%%';    support@dks.lu  Info facture pour votre souscription sur pot.lu 1
+5      user_invoice    Bonjour %%prename%% %%surname%%,<br/>\n<br/>\nEn annexe vous trouvez la facture pour votre souscription au site pot.lu,\n<br/>\n\nMeilleurs salutations,<br/>\n<br/>\nPOT Support Team  select prename,surname from users where id='%%id%%';    support@dks.lu  Facture concernant votre souscription sur pot.lu        1
 \.
 
 
@@ -810,6 +829,7 @@ COPY public.sessions (id, idsession, id_user, user_agent, remote_addr, created)
 114    aSli1lR9B0ETjICf7IFjVxhphLd8dhRdZ2mRd4RE        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18362       ::1     2019-12-10 15:55:53.526432
 122    Sp2D9CvtdjQHaxLPkEXgqSMSveIJwQde56I5y3oC        1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36       2001:7e8:cc73:de00:d970:312a:d5d:db83   2019-12-12 07:06:51.913155
 123    klCMzztihKleI4E0zhnmNMrlL8sAUIj5TLHjb0si        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36      ::1     2019-12-13 08:27:53.789037
+124    NUTU0TkWd81oxH4ig52WCA3HzccA3bmHW5sMPCyT        1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36        ::1     2019-12-15 11:44:06.485589
 93     5P7159lXg8xY83Iu7eZC3hj3Oi6x29jXOhPKg0yn        1       Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36        ::1     2019-12-04 14:58:48.993651
 98     9UisAitYaoxdqtBaWUI37R04CiBlFxcp0STuCOZRU       1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36       ::1     2019-12-05 07:34:07.997426
 99     v6wZ65qozoWn5P32q4wg16224TcOAM1VJnLFj1UJ        1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36       192.168.178.23  2019-12-05 07:35:01.756219
@@ -865,14 +885,14 @@ SELECT pg_catalog.setval('public.companies_id_seq', 1, true);
 -- Name: maillayouts_id_seq; Type: SEQUENCE SET; Schema: public; Owner: potlu_user
 --
 
-SELECT pg_catalog.setval('public.maillayouts_id_seq', 1, false);
+SELECT pg_catalog.setval('public.maillayouts_id_seq', 1, true);
 
 
 --
 -- Name: mailtemplates_id_seq; Type: SEQUENCE SET; Schema: public; Owner: potlu_user
 --
 
-SELECT pg_catalog.setval('public.mailtemplates_id_seq', 1, false);
+SELECT pg_catalog.setval('public.mailtemplates_id_seq', 5, true);
 
 
 --
@@ -886,7 +906,7 @@ SELECT pg_catalog.setval('public.members_id_seq', 1, false);
 -- Name: sessions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: potlu_user
 --
 
-SELECT pg_catalog.setval('public.sessions_id_seq', 123, true);
+SELECT pg_catalog.setval('public.sessions_id_seq', 124, true);
 
 
 --
diff --git a/dev/db/potlu_db.public.pg.install.schema.sql b/dev/db/potlu_db.public.pg.install.schema.sql
new file mode 100644 (file)
index 0000000..c022c8e
--- /dev/null
@@ -0,0 +1,450 @@
+
+CREATE FUNCTION public.checklogin(vusername text, vpassword text, vremoteaddr text, vuseragent text) RETURNS text
+    LANGUAGE plpgsql
+    AS $$
+declare 
+       iduser int4;
+       newidsession text := null; 
+begin
+       select id into iduser from public.users where lower(username)=lower(vusername) and userpassword = vpassword and "blocked" is null;
+       if (iduser is not null) then
+               delete from public.sessions where id_user= iduser and remote_addr= vremoteaddr and user_agent= vuseragent;
+               insert into public.sessions (id_user,idsession,remote_addr,user_agent) VALUES( iduser,public.random_string(40), vremoteaddr,vuseragent) returning idsession into newidsession;
+       end if;
+       return newidsession;
+end;
+$$;
+
+CREATE FUNCTION public.getdates(startdate date, days integer) RETURNS SETOF date
+    LANGUAGE plpgsql
+    AS $$
+ BEGIN
+ return QUERY select date(startdate + s*'1day'::interval) as daydate from generate_series(0,days-1) s ;
+ END;  
+$$;
+
+CREATE FUNCTION public.getdateslist(startdate date, days integer) RETURNS text
+    LANGUAGE plpgsql
+    AS $$
+ declare       
+       ret text;
+ begin
+        select string_agg(to_char(getdates,'YYYY-MM-DD'),',') into ret from getdates(startdate,days); 
+ return  ret;
+ END;  
+$$;
+
+CREATE FUNCTION public.getmondays(vyear integer) RETURNS SETOF date
+    LANGUAGE plpgsql
+    AS $$
+ BEGIN
+ return QUERY select date(daydate) as mondays from (
+ select (vyear || '-01-01')::date + s*'1day'::interval as daydate from 
+    generate_series(0,(vyear ||'-12-31')::date - (vyear || '-01-01')::date) s) xx where extract('isodow' from daydate)=1;
+ END;  
+$$;
+
+CREATE FUNCTION public.getsession(vidsession text, vremoteaddr text, vuseragent text) RETURNS TABLE(idsession text, id integer, username text, usergroups text, userschemata text)
+    LANGUAGE plpgsql
+    AS $$
+ BEGIN
+ return QUERY select se.idsession,us.id,us.username,string_agg(distinct(aug.usergroup),',') as usergroups ,co.schemata as userschemata from sessions se 
+join users us on (us.id=se.id_user) 
+left join useringroups uig on (us.id=uig.id_user)
+left join usergroups aug on (aug.id=uig.id_group)
+left join members mb on (mb.id_user=us.id)
+left join companies co on (co.id=mb.id_company)
+where se.idsession= vidsession
+and se.remote_addr= vremoteaddr
+and se.user_agent= vuseragent and us.blocked is null group by se.id,us.id,mb.id,co.id;
+ END;  
+$$;
+
+CREATE FUNCTION public.getsundays(vyear integer) RETURNS SETOF date
+    LANGUAGE plpgsql
+    AS $$
+ BEGIN
+ return QUERY select date(daydate) as sundays from (
+ select (vyear || '-01-01')::date + s*'1day'::interval as daydate from 
+    generate_series(0,(vyear ||'-12-31')::date - (vyear || '-01-01')::date) s) xx where extract('isodow' from daydate)=7;
+ END;  
+$$;
+
+CREATE FUNCTION public.getweeks(vyear integer) RETURNS TABLE(cw integer, mondays date, sundays date)
+    LANGUAGE plpgsql
+    AS $$
+ BEGIN
+ return QUERY select extract('week' from daydate)::int4 as cw,date(daydate - interval '3 days') as mondays , date(daydate + interval '3 days') as sundays from (
+ select (vyear || '-01-01')::date + s*'1day'::interval as daydate from 
+    generate_series(0,(vyear ||'-12-31')::date - (vyear || '-01-01')::date) s) xx where extract('isodow' from daydate)=4;
+ END;  
+$$;
+
+CREATE FUNCTION public.random_string(vlength integer) RETURNS text
+    LANGUAGE plpgsql
+    AS $$
+declare
+       randstr text := null;
+BEGIN
+SELECT string_agg (substr('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', ceil (random() * 62)::integer, 1), '') into randstr
+FROM  generate_series(1, vlength);
+return randstr;
+end;
+$$;
+
+CREATE FUNCTION public.trg_update_basemonthhours() RETURNS trigger
+    LANGUAGE plpgsql
+    AS $$
+    BEGIN
+        new.monthhours = new.weekhours*173/40;
+
+        RETURN NEW;
+    END;
+$$;
+
+CREATE FUNCTION public.trg_update_modified() RETURNS trigger
+    LANGUAGE plpgsql
+    AS $$
+    BEGIN
+        new.modified = Current_timestamp;
+
+        RETURN NEW;
+    END;
+$$;
+
+CREATE FUNCTION public.trg_update_monthhours() RETURNS trigger
+    LANGUAGE plpgsql
+    AS $$
+    BEGIN
+        new.monthhours = new.weekhours*173/40;
+
+        RETURN NEW;
+    END;
+$$;
+
+CREATE FUNCTION public.trg_update_monthlyhours() RETURNS trigger
+    LANGUAGE plpgsql
+    AS $$
+    BEGIN
+        new.monthhours = new.weekhours*173/40;
+
+        RETURN NEW;
+    END;
+$$;
+
+CREATE TABLE public.apps (
+    id integer NOT NULL,
+    app text NOT NULL,
+    description text,
+    name text,
+    id_usergroup integer,
+    icon text,
+    sort integer,
+    menutype text
+);
+
+CREATE SEQUENCE public.apps_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+ALTER SEQUENCE public.apps_id_seq OWNED BY public.apps.id;
+
+CREATE TABLE public.companies (
+    id integer NOT NULL,
+    company text,
+    address text,
+    zip text,
+    city text,
+    country text,
+    tradetype text,
+    comregister text,
+    vatnumber text,
+    schemata text,
+    validated boolean,
+    schemata2 json,
+    email text,
+    socialtype text,
+    vatvalidated boolean
+);
+
+CREATE SEQUENCE public.companies_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+ALTER SEQUENCE public.companies_id_seq OWNED BY public.companies.id;
+
+CREATE TABLE public.maillayouts (
+    id integer NOT NULL,
+    layoutname text,
+    mailtemplate text
+);
+
+CREATE SEQUENCE public.maillayouts_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+ALTER SEQUENCE public.maillayouts_id_seq OWNED BY public.maillayouts.id;
+
+CREATE TABLE public.mailtemplates (
+    id integer NOT NULL,
+    templatename text DEFAULT NULL::character varying,
+    emailtext text,
+    emaildatasql text,
+    mailfrom text,
+    mailsubject text DEFAULT NULL::character varying,
+    id_maillayout integer
+);
+
+CREATE SEQUENCE public.mailtemplates_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+ALTER SEQUENCE public.mailtemplates_id_seq OWNED BY public.mailtemplates.id;
+
+CREATE TABLE public.members (
+    id integer NOT NULL,
+    surname text,
+    prename text,
+    phone text,
+    id_user bigint,
+    id_company integer,
+    job text
+);
+
+CREATE SEQUENCE public.members_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+ALTER SEQUENCE public.members_id_seq OWNED BY public.members.id;
+
+CREATE TABLE public.sessions (
+    id bigint NOT NULL,
+    idsession text NOT NULL,
+    id_user bigint,
+    user_agent text,
+    remote_addr text,
+    created timestamp without time zone DEFAULT now()
+);
+
+CREATE SEQUENCE public.sessions_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+ALTER SEQUENCE public.sessions_id_seq OWNED BY public.sessions.id;
+
+CREATE TABLE public.usergroups (
+    id integer NOT NULL,
+    usergroup text NOT NULL,
+    isdefault boolean,
+    groupname text
+);
+
+CREATE SEQUENCE public.usergroups_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+ALTER SEQUENCE public.usergroups_id_seq OWNED BY public.usergroups.id;
+
+CREATE TABLE public.useringroups (
+    id integer NOT NULL,
+    id_user bigint,
+    id_group bigint
+);
+
+CREATE SEQUENCE public.useringroups_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+ALTER SEQUENCE public.useringroups_id_seq OWNED BY public.useringroups.id;
+
+CREATE TABLE public.users (
+    id integer NOT NULL,
+    userpassword text,
+    created timestamp without time zone DEFAULT now(),
+    blocked boolean,
+    username text,
+    regcode text,
+    vcode text,
+    schemaaccess json
+);
+
+CREATE SEQUENCE public.users_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
+
+CREATE VIEW public.vw_companiesdata AS
+ SELECT companies.id,
+    companies.company,
+    companies.address,
+    companies.zip,
+    companies.city,
+    companies.country,
+    companies.tradetype,
+    companies.comregister,
+    companies.vatnumber,
+    companies.schemata,
+    companies.validated,
+    companies.schemata2,
+    companies.email,
+    companies.socialtype,
+    companies.vatvalidated
+   FROM public.companies;
+
+CREATE VIEW public.vw_companieslist AS
+ SELECT companies.id,
+    companies.company,
+    companies.address,
+    companies.zip,
+    companies.city,
+    companies.country,
+    companies.tradetype,
+    companies.comregister,
+    companies.vatnumber,
+    companies.schemata,
+    companies.validated,
+    companies.schemata2,
+    companies.email,
+    companies.socialtype,
+    companies.vatvalidated
+   FROM public.companies;
+
+CREATE VIEW public.vw_memberdata AS
+ SELECT members.id,
+    members.surname,
+    members.prename,
+    members.phone,
+    members.id_user,
+    members.id_company,
+    members.job
+   FROM public.members;
+
+CREATE VIEW public.vw_userdata AS
+ SELECT users.id,
+    users.username
+   FROM public.users;
+
+CREATE VIEW public.vw_userlist AS
+SELECT
+    NULL::integer AS id,
+    NULL::integer AS id_member,
+    NULL::text AS username,
+    NULL::text AS prename,
+    NULL::text AS surname,
+    NULL::boolean AS blocked,
+    NULL::text AS group_ids,
+    NULL::integer AS id_company,
+    NULL::text AS company;
+
+ALTER TABLE ONLY public.apps ALTER COLUMN id SET DEFAULT nextval('public.apps_id_seq'::regclass);
+
+ALTER TABLE ONLY public.companies ALTER COLUMN id SET DEFAULT nextval('public.companies_id_seq'::regclass);
+
+ALTER TABLE ONLY public.maillayouts ALTER COLUMN id SET DEFAULT nextval('public.maillayouts_id_seq'::regclass);
+
+ALTER TABLE ONLY public.mailtemplates ALTER COLUMN id SET DEFAULT nextval('public.mailtemplates_id_seq'::regclass);
+
+ALTER TABLE ONLY public.members ALTER COLUMN id SET DEFAULT nextval('public.members_id_seq'::regclass);
+
+ALTER TABLE ONLY public.sessions ALTER COLUMN id SET DEFAULT nextval('public.sessions_id_seq'::regclass);
+
+ALTER TABLE ONLY public.usergroups ALTER COLUMN id SET DEFAULT nextval('public.usergroups_id_seq'::regclass);
+
+ALTER TABLE ONLY public.useringroups ALTER COLUMN id SET DEFAULT nextval('public.useringroups_id_seq'::regclass);
+
+ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
+
+ALTER TABLE ONLY public.apps
+    ADD CONSTRAINT apps_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY public.companies
+    ADD CONSTRAINT company_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY public.maillayouts
+    ADD CONSTRAINT maillayouts_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY public.mailtemplates
+    ADD CONSTRAINT mailtemplates_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY public.members
+    ADD CONSTRAINT members_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY public.users
+    ADD CONSTRAINT uniq_username UNIQUE (username);
+
+ALTER TABLE ONLY public.usergroups
+    ADD CONSTRAINT usergroups_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY public.useringroups
+    ADD CONSTRAINT useringroups_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY public.users
+    ADD CONSTRAINT users_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY public.sessions
+    ADD CONSTRAINT usersession_pkey PRIMARY KEY (id);
+
+CREATE OR REPLACE VIEW public.vw_userlist AS
+ SELECT us.id,
+    mb.id AS id_member,
+    COALESCE(us.username, ''::text) AS username,
+    mb.prename,
+    mb.surname,
+    us.blocked,
+    string_agg(ug.groupname, ','::text) AS group_ids,
+    co.id AS id_company,
+    co.company
+   FROM ((((public.users us
+     LEFT JOIN public.members mb ON ((us.id = mb.id_user)))
+     LEFT JOIN public.useringroups uig ON ((us.id = uig.id_user)))
+     JOIN public.usergroups ug ON ((uig.id_group = ug.id)))
+     LEFT JOIN public.companies co ON ((mb.id_company = co.id)))
+  GROUP BY us.id, mb.id, co.id
+  ORDER BY mb.surname, mb.prename;
+
+ALTER TABLE ONLY public.apps
+    ADD CONSTRAINT apps_usergroups_fk FOREIGN KEY (id_usergroup) REFERENCES public.usergroups(id);
+
+ALTER TABLE ONLY public.mailtemplates
+    ADD CONSTRAINT mailtemplates_maillayouts_fk FOREIGN KEY (id_maillayout) REFERENCES public.maillayouts(id);
+
+ALTER TABLE ONLY public.members
+    ADD CONSTRAINT members_users_fkey FOREIGN KEY (id_user) REFERENCES public.users(id);
+
+ALTER TABLE ONLY public.useringroups
+    ADD CONSTRAINT useringroups_idgroup_fkey FOREIGN KEY (id_group) REFERENCES public.usergroups(id);
+
+ALTER TABLE ONLY public.useringroups
+    ADD CONSTRAINT useringroups_iduser_fkey FOREIGN KEY (id_user) REFERENCES public.users(id);
+
+ALTER TABLE ONLY public.sessions
+    ADD CONSTRAINT usersession_users_fk FOREIGN KEY (id_user) REFERENCES public.users(id);
+
index 54b62bf..037a9de 100644 (file)
@@ -280,7 +280,9 @@ CREATE TABLE public.companies (
     schemata text,
     validated boolean,
     schemata2 json,
-    email text
+    email text,
+    socialtype text,
+    vatvalidated boolean
 );
 
 
@@ -538,10 +540,10 @@ ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
 
 
 --
--- Name: vw_companydata; Type: VIEW; Schema: public; Owner: -
+-- Name: vw_companiesdata; Type: VIEW; Schema: public; Owner: -
 --
 
-CREATE VIEW public.vw_companydata AS
+CREATE VIEW public.vw_companiesdata AS
  SELECT companies.id,
     companies.company,
     companies.address,
@@ -551,25 +553,36 @@ CREATE VIEW public.vw_companydata AS
     companies.tradetype,
     companies.comregister,
     companies.vatnumber,
-    companies.schemata AS link,
-    companies.validated
+    companies.schemata,
+    companies.validated,
+    companies.schemata2,
+    companies.email,
+    companies.socialtype,
+    companies.vatvalidated
    FROM public.companies;
 
 
 --
--- Name: vw_companylist; Type: VIEW; Schema: public; Owner: -
+-- Name: vw_companieslist; Type: VIEW; Schema: public; Owner: -
 --
 
-CREATE VIEW public.vw_companylist AS
- SELECT co.id,
-    co.company,
-    co.address,
-    co.zip,
-    co.city,
-    co.country,
-    ((((((co.address || '\n'::text) || co.zip) || ' '::text) || co.city) || ' '::text) || co.country) AS dspaddress,
-    co.schemata
-   FROM public.companies co;
+CREATE VIEW public.vw_companieslist AS
+ SELECT companies.id,
+    companies.company,
+    companies.address,
+    companies.zip,
+    companies.city,
+    companies.country,
+    companies.tradetype,
+    companies.comregister,
+    companies.vatnumber,
+    companies.schemata,
+    companies.validated,
+    companies.schemata2,
+    companies.email,
+    companies.socialtype,
+    companies.vatvalidated
+   FROM public.companies;
 
 
 --
diff --git a/form.txt b/form.txt
deleted file mode 100644 (file)
index a08af2b..0000000
--- a/form.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-multiselect staff
-date multipledates or date-range
-singleselect wptmpl
-workplan with vacancy hours and type
-
-
index 81e5075..d4ab0f0 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -1,4 +1,4 @@
-#!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl
+#!/usr/local/bin/perl
 
 use strict;
 use lib ('backoffice/api/lib/perl5');
index 0cf6576..be64bae 100644 (file)
@@ -44,7 +44,6 @@
   <body class="front-page">\r
     <div class="bgimg w3-display-container w3-animate-opacity w3-text-white">\r
   <div class="w3-display-topleft w3-padding-large w3-xlarge">\r
-    Logo\r
   </div>\r
   <div class="w3-display-middle">\r
     <h1 class="w3-jumbo w3-animate-top"><img src="[% abspath%]img/pot_big.png" alt="POT"/></h1>\r