0.22. fixed manual sign in, vwf, stray errors, lang patch, etc etc

This commit is contained in:
Josh North 2021-06-18 10:02:44 -04:00
parent 429972512b
commit 17ce4fa156
7 changed files with 124 additions and 20 deletions

View File

@ -162,7 +162,7 @@
<!-- START NAVBAR MENU FOR ALL LOGGED IN - BOTTOM END -->
</ul>
<ul class="navbar-nav mr-sm-2">
<li class="nav-item"><a class="nav-link<?php $sname=$SiteInfo->getSite($siteid, "0", "0", "0")[0]["sites_name"]; if($sname=="NOSITE") { echo " btn btn-sm btn-outline-warning"; } else { echo " btn btn-sm btn-outline-secondary"; }; ?>" href="#" data-bs-toggle="modal" data-bs-target="#sitetimeModal"><i class="fas fa-map-marker-alt"></i> <?php if ($sname=="NOSITE") {echo $transLang['NOSITE'];} else { echo $sname; } ?></a></li>
<li class="nav-item"><a class="nav-link<?php $sname=$SiteInfo->getSite($siteid, "0", "0", "0")[0]["sites_name"]; if($sname=="NOSITE") { echo " btn btn-sm btn-outline-warning"; } else { echo " btn btn-sm btn-outline-secondary"; } ?>" href="#" data-bs-toggle="modal" data-bs-target="#sitetimeModal"><i class="fas fa-map-marker-alt"></i> <?php if ($sname=="NOSITE") {echo $transLang['NOSITE'];} else { echo $sname; } ?></a></li>
<?php if (Registry::AUTHMETHOD == 'SAML') { ?>
<!-- SAML SESSION BUTTONS -->
<li class="nav-item"><a class="nav-link btn btn-sm btn-outline-danger<?php if ($app_current_pagename==$transLang['LOGOUT']): echo " active"; endif; ?>" href="<?php echo str_replace("http%3A%2F%2F","https%3A%2F%2F",$auth->getLogoutURL()); ?>"><span class="badge bg-light text-dark"><?php echo $session_user["0"]["users_firstname"] . " " . $session_user["0"]["users_lastname"];?></span> <i class="fas fa-ban"></i> <?php echo $transLang['LOGOUT']; ?></a></li>
@ -175,11 +175,20 @@
<form action="changelang.php" method="post" name="changelang" class="changelang">
<?php echo Csrf::getInputToken('home') ?>
<div class="input-group">
<?php
foreach(glob('src/Language/*.lang.ini.example') as $file){
}
?>
<select class="form-select btn-outline-secondary" id="app_disp_lang" name="app_disp_lang">
<?php foreach(glob('src/Language/*.ini') as $file){
if(!is_dir($file)) { $filename=basename(preg_replace('/\.[^.]+$/','',preg_replace('/\.[^.]+$/','',$file))); }; ?>
<option value="<?php echo $filename; ?>"<?php if ($filename==$app_disp_lang) { echo " selected"; }; ?>><?php echo strtoupper($filename); ?></option>
<?php }; ?>
<?php foreach(glob('src/Language/*.lang.ini.example') as $file){
if(!is_dir($file)) { $filename=basename(explode('.', $file, 2)[0]); } ?>
<option value="<?php echo $filename; ?>"<?php if ($filename==$app_disp_lang) { echo " selected"; } ?>><?php echo strtoupper($filename); ?></option>
<?php } ?>
</select>
</div>
</form>

119
index.php
View File

@ -164,11 +164,6 @@ if (Registry::AUTHMETHOD == 'SAML') {
echo $VisitActions->voidVisit($_POST['voidvisit'], "0", $_POST['voidnotes']);
}
// UPDATE VENDOR RECORD IF POSTED
if (!empty($_POST['updateinitialvendorvisit'])) {
echo $VisitActions->setInfoVendorVisitInitial($_POST['db_vendorinfo_id'], $_POST['db_vendorinfo_checklistrequired'], $_POST['db_vendorinfo_routinework'], $_POST['db_vendorinfo_nonroutinework'], $_POST['db_vendorinfo_coi'], $_POST['db_vendorinfo_worksummary'], $_POST['db_vendorinfo_equipmentsummary'] );
}
// FINALIZE VENDOR RECORD IF POSTED
if (!empty($_POST['updatefinalvendorvisit'])) {
echo $VisitActions->setInfoVendorVisitFinal($_POST['db_vendorinfo_id'], $_POST['db_vendorinfo_checklistcompleted'], $_POST['db_vendorinfo_workcompleted'], $_POST['db_vendorinfo_sitecleanup'], $uid, $_POST['db_vendorinfo_doccompleted'] );
@ -193,8 +188,37 @@ $form_data = filter_input_array(INPUT_POST, [
'form_data_escortrequired' => (int)FILTER_VALIDATE_INT,
'form_data_v_signature' => (string)FILTER_SANITIZE_STRING,
'form_data_e_signature' => (string)FILTER_SANITIZE_STRING,
'form_data_escortname' => (string)FILTER_SANITIZE_STRING
'form_data_escortname' => (string)FILTER_SANITIZE_STRING,
'db_vendorinfo_id' => (string)FILTER_SANITIZE_STRING,
'db_vendorinfo_checklistrequired' => (string)FILTER_SANITIZE_STRING,
'db_vendorinfo_routinework' => (string)FILTER_SANITIZE_STRING,
'db_vendorinfo_nonroutinework' => (string)FILTER_SANITIZE_STRING,
'db_vendorinfo_coi' => (string)FILTER_SANITIZE_STRING,
'db_vendorinfo_worksummary' => (string)FILTER_SANITIZE_STRING,
'db_vendorinfo_equipmentsummary' => (string)FILTER_SANITIZE_STRING
]);
// UPDATE VENDOR RECORD IF POSTED
if(!empty($form_data['form_data_stage'])){
if($form_data['form_data_stage']==='updateinitialvendorvisit'){
ob_start();
$VisitActions->setInfoVendorVisitInitial(
$form_data['db_vendorinfo_id'],
$form_data['db_vendorinfo_checklistrequired'],
$form_data['db_vendorinfo_routinework'],
$form_data['db_vendorinfo_nonroutinework'],
$form_data['db_vendorinfo_coi'],
$form_data['db_vendorinfo_worksummary'],
$form_data['db_vendorinfo_equipmentsummary'] );
ob_end_clean();
unset($form_data);
}
}
// SET MANUALSIGNIN STAGE
if(!empty($form_data['form_data_stage'])){
if($form_data['form_data_stage']==='manualsignin'){
@ -382,6 +406,15 @@ if($form_data['form_data_isvendor'] === (int)"1") {
</div>
</div>
</div>
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="vendorrequiredswitch" name="vendorrequiredswitch">
<label class="form-check-label" for="vendorrequiredswitch"><?php echo $transLang['STR_VENDORINFO_VENDOR_TITLE']; ?></label>
</div>
</div>
</div>
<div id="vendorrequiredsection">
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0">
@ -420,6 +453,41 @@ if($form_data['form_data_isvendor'] === (int)"1") {
</div>
</div>
</div>
</div>
<script type="text/javascript">
$('#vendorrequiredswitch').change(function() {
var checkedEscortValue=$("#vendorrequiredswitch").is(":checked");
if (checkedEscortValue === true) {
$('#vendorrequiredsection').show();
$('#escortrequiredsection').hide();
$('#escortrequiredswitchsection').hide();
$('#form_data_escortname').removeAttr('required');
$('#form_data_escortname').removeAttr('data-error');
$('#form_data_contact1').attr('required', '');
$('#form_data_contact1').attr('data-error', 'This field is required.');
$('#form_data_contact2').attr('required', '');
$('#form_data_contact2').attr('data-error', 'This field is required.');
$('#form_data_workstart').attr('required', '');
$('#form_data_workstart').attr('data-error', 'This field is required.');
$('#form_data_workend').attr('required', '');
$('#form_data_workend').attr('data-error', 'This field is required.');
} else {
$('#vendorrequiredsection').hide();
$('#escortrequiredswitchsection').show();
$('#form_data_escortname').removeAttr('required');
$('#form_data_escortname').removeAttr('data-error');
$('#form_data_contact1').removeAttr('required');
$('#form_data_contact1').removeAttr('data-error');
$('#form_data_contact2').removeAttr('required');
$('#form_data_contact2').removeAttr('data-error');
$('#form_data_workstart').removeAttr('required');
$('#form_data_workstart').removeAttr('data-error');
$('#form_data_workend').removeAttr('required');
$('#form_data_workend').removeAttr('data-error');
}
});
$('#vendorrequiredswitch').trigger("change");
</script>
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0">
@ -431,14 +499,37 @@ if($form_data['form_data_isvendor'] === (int)"1") {
</div>
</div>
</div>
<div class="row row-cols-1 mb-2">
<div class="row row-cols-1 mb-2" id="escortrequiredswitchsection" name="escortrequiredswitchsection">
<div class="col d-grid gap-2">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="escortrequiredswitch" name="escortrequiredswitch">
<label class="form-check-label" for="escortrequiredswitch"><?php echo $transLang['ESECTION']; ?></label>
</div>
</div>
</div>
<div class="row row-cols-1 mb-2" id="escortrequiredsection" name="escortrequiredsection">
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text"><?php echo $transLang['ENAME']; ?></span>
<input type="text" id="form_data_escortname" name="form_data_escortname" class="form-control" placeholder="<?php echo $transLang['ETAG']; ?>" autofocus>
</div>
</div>
</div>
<input type="text" id="form_data_escortname" name="form_data_escortname" class="form-control" placeholder="<?php echo $transLang['ETAG']; ?>" autofocus>
</div>
</div>
</div>
<script type="text/javascript">
$('#escortrequiredswitch').change(function() {
var checkedEscortValue=$("#escortrequiredswitch").is(":checked");
if (checkedEscortValue === true) {
$('#escortrequiredsection').show();
$('#form_data_escortname').attr('required', '');
$('#form_data_escortname').attr('data-error', 'This field is required.');
} else {
$('#escortrequiredsection').hide();
$('#form_data_escortname').removeAttr('required');
$('#form_data_escortname').removeAttr('data-error');
}
});
$('#escortrequiredswitch').trigger("change");
</script>
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><i class="fas fa-ban"></i>&nbsp;<?php echo $transLang['STR_COMMON_CANCEL']; ?></button>
@ -516,7 +607,7 @@ if($form_data['form_data_isvendor'] === (int)"1") {
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0">
<input type="hidden" name="updateinitialvendorvisit" id="updateinitialvendorvisit" value="updateinitialvendorvisit" />
<input type="hidden" name="form_data_stage" id="form_data_stage" value="updateinitialvendorvisit" />
<input type="hidden" name="db_vendorinfo_id" id="db_vendorinfo_id" value="<?php echo $db_vendorinfo_id; ?>" />
<span class="input-group-text"><?php echo $transLang['STR_VENDORINFO_CONTACT1_TITLE']; ?></span>
<input class="form-control" id="db_vendorinfo_contact1" name="db_vendorinfo_contact1" placeholder="<?php echo $db_vendorinfo_contact1; ?>" value="<?php echo $db_vendorinfo_contact1; ?>" disabled />
@ -943,7 +1034,7 @@ if ($db_vendorinfo_workcompleted === 1 && $db_vendorinfo_sitecleanup === 1) { $f
</div>
<?php if($isvendor===1) { ?>
<div class="input-group input-group-sm mb-0">
<?php if ($initialvendorformcomplete===1) { ?>
<?php if(empty($initialvendorformcomplete)) {$initialvendorformcomplete=0;}; if ($initialvendorformcomplete===1) { ?>
<span class="badge bg-success text-dark"><?php echo $transLang['STR_TAGS_FORMCOMPLETE_TITLE']; ?></span>&nbsp;
<?php } else { ?>
<span class="badge bg-info text-dark"><?php echo $transLang['STR_TAGS_FORMINCOMPLETE_TITLE']; ?></span>&nbsp;
@ -960,7 +1051,7 @@ if ($db_vendorinfo_workcompleted === 1 && $db_vendorinfo_sitecleanup === 1) { $f
<?php } ?>
<td class="small">
<div class="input-group input-group-sm mb-0 d-grid gap-2">
<button type="submit" name="approvevisit" id="approvevisit-<?php echo $visitid; ?>" value="<?php echo $visitid; ?>" class="btn btn-success btn-block btn-sm <?php if ($isvendor===1 && $initialvendorformcomplete===0) { echo "disabled"; }; ?>"><i class="fas fa-thumbs-up"></i>&nbsp;<?php echo $transLang['STR_COMMON_APPROVE']; ?></button>
<button type="submit" name="approvevisit" id="approvevisit-<?php echo $visitid; ?>" value="<?php echo $visitid; ?>" class="btn btn-success btn-block btn-sm <?php if(empty($initialvendorformcomplete)) {$initialvendorformcomplete=0;}; if ($isvendor===1 && $initialvendorformcomplete===0) { echo "disabled"; }; ?>"><i class="fas fa-thumbs-up"></i>&nbsp;<?php echo $transLang['STR_COMMON_APPROVE']; ?></button>
</div>
<div class="input-group input-group-sm mb-0 d-grid gap-2">
<a data-bs-toggle="modal" data-bs-target="#voidModal" data-id="<?php echo $visitid; ?>" href="#voidModal" name="voidvisit" value="<?php echo $visitid; ?>" class="btn btn-danger btn-block btn-sm open-voidModal"><i class="fas fa-thumbs-down"></i>&nbsp;<?php echo $transLang['DECLINE']; ?></a>

View File

@ -145,6 +145,7 @@ STR_COMMON_SITE = 'Site'
STR_COMMON_START = 'Anfang'
STR_COMMON_TIMEZONE = 'Zeitzone'
STR_COMMON_TOUR = 'Tour'
TOUR = 'Tour'
STR_COMMON_VSIGNATURE = 'Unterschrift des Besuchers'
STR_COMMON_YES = 'Ja'
STR_REPORT_EXECUTE_TITLE = 'Bericht ausführen'

View File

@ -145,6 +145,7 @@ STR_COMMON_SITE = 'Site'
STR_COMMON_START = 'Start'
STR_COMMON_TIMEZONE = 'Timezone'
STR_COMMON_TOUR = 'Tour'
TOUR = 'Tour'
STR_COMMON_VSIGNATURE = 'Visitor Signature'
STR_COMMON_YES = 'Yes'
STR_REPORT_EXECUTE_TITLE = 'Run Report'

View File

@ -145,6 +145,7 @@ STR_COMMON_SITE = 'Sitio'
STR_COMMON_START = 'Comienzo'
STR_COMMON_TIMEZONE = 'Zona horaria'
STR_COMMON_TOUR = 'Visitar'
TOUR = 'Visitar'
STR_COMMON_VSIGNATURE = 'Firma del Visitante'
STR_COMMON_YES = 'Sí'
STR_REPORT_EXECUTE_TITLE = 'Sacar un reporte'

View File

@ -145,6 +145,7 @@ STR_COMMON_SITE = 'Le site'
STR_COMMON_START = 'Début'
STR_COMMON_TIMEZONE = 'Fuseau horaire'
STR_COMMON_TOUR = 'Visiter'
TOUR = 'Visiter'
STR_COMMON_VSIGNATURE = 'Visiteur Signature'
STR_COMMON_YES = 'Oui'
STR_REPORT_EXECUTE_TITLE = 'Rapport d&#39;exécution'

View File

@ -29,7 +29,7 @@ class StaticFunctions {
public function getVersion ($app_disp_lang) {
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
$transLang = $Translate->userLanguage();
echo $transLang['SOFTWARE_VERSION'] . ': lobbysio_v0.20-beta';
echo $transLang['SOFTWARE_VERSION'] . ': lobbysio_v0.22-beta';
}
public function getUTC () {