This commit is contained in:
Josh North 2021-06-22 17:41:41 -04:00
parent 06062e23ee
commit 6a483e314c
6 changed files with 83 additions and 67 deletions

View File

@ -275,7 +275,12 @@ $form_data = filter_input_array(INPUT_POST, [
if (empty($_POST['id_type'])) { $id_type_error=1; } else {$id_type_error=0;};
if (empty($_POST['badge'])) { $badge_error=1; } else {$badge_error=0;};
if (empty($_POST['initials'])) { $initials_error=1; } else {$initials_error=0;};
if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US" || $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "CAN") {
if (empty($_POST['citizen'])) { $citizen_error=(int)'1'; } elseif ($_POST['citizen']==='00') { $citizen_error=(int)'1'; } else { $citizen_error=(int)'0'; };
}elseif($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA"){
$_POST['citizen']=NULL;
$citizen_error=(int)'0';
}
if (isset($_POST['id_type']) && $_POST['id_type']===1 && isset($_POST['id_reference'])) { $id_reference_error=0; } elseif (isset($_POST['id_type']) && $_POST['id_type']===1 && empty($_POST['id_reference'])) { $id_reference_error=1; } else { $id_reference_error=0; };
if ($id_type_error+$badge_error+$initials_error+$citizen_error+$id_reference_error===0) {
$approved=2;
@ -578,7 +583,7 @@ $form_data = filter_input_array(INPUT_POST, [
<table class="table table-sm table-responsive-sm text-nowrap">
<thead class="thead-dark">
<tr>
<th class="small col-xs-1"><?php echo $transLang['TIMEREASON']; ?></th><th class="small col-xs-2"><?php echo $transLang['NAME']; ?></th><th class="small col-xs-2"><?php echo $transLang['ESCORT']; ?></th><th class="small col-xs-2"><?php echo $transLang['VALIDATIONS']; ?></th><th class="small col-xs-2"><?php echo $transLang['BADGEINITIALS']; ?></th><?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?><th class="small col-xs-1"><?php echo $transLang['CARNUM'] . " / " . $transLang['SSANUM']; ?></th><?php } ?><th class="small col-xs-1"><?php echo $transLang['ACTIONS']; ?></th>
<th class="small col-xs-1"><?php echo $transLang['TIMEREASON']; ?></th><th class="small col-xs-2"><?php echo $transLang['NAME']; ?></th><th class="small col-xs-2"><?php echo $transLang['ESCORT']; ?></th><th class="small col-xs-2"><?php echo $transLang['VALIDATIONS']; ?></th><th class="small col-xs-2"><?php echo $transLang['BADGEINITIALS']; ?></th><?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?><th class="small col-xs-1"><?=$transLang['DETAILS']?></th><?php } ?><th class="small col-xs-1"><?php echo $transLang['ACTIONS']; ?></th>
</tr>
</thead>
<tbody>
@ -977,7 +982,7 @@ if ($db_vendorinfo_workcompleted === 1 && $db_vendorinfo_sitecleanup === 1) { $f
<?php } ?>
</td>
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?>
<td class="small"><?php echo $carnum; ?> / <?php echo $ssanum; ?></td>
<td class="small"><span class="badge bg-light text-dark"><?=$transLang['CARNUM']?></span><?php echo $carnum; ?><br /><span class="badge bg-light text-dark"><?=$transLang['SSANUM']?></span><?php echo $ssanum; ?></td>
<?php } ?>
<td class="small">
<div class="input-group input-group-sm mb-0 d-grid gap-2">
@ -1072,7 +1077,7 @@ if ($db_vendorinfo_workcompleted === 1 && $db_vendorinfo_sitecleanup === 1) { $f
<input class="form-control form-control-sm" type="hidden" id="initials" name="initials" placeholder="<?php echo $uid; ?>" value="<?php echo $uid; ?>">
</td>
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA") { ?>
<td class="small"><?php echo $carnum; ?> / <?php echo $ssanum; ?></td>
<td class="small"><span class="badge bg-light text-dark"><?=$transLang['CARNUM']?></span><?php echo $carnum; ?><br /><span class="badge bg-light text-dark"><?=$transLang['SSANUM']?></span><?php echo $ssanum; ?></td>
<?php } ?>
<td class="small">
<div class="input-group input-group-sm mb-0 d-grid gap-2">

View File

@ -23,6 +23,7 @@ DECLINE = 'Ablehnen'
DEFAULT = 'Default'
DELETE = 'Löschen'
DELETE_WARNING = '********* WARNUNG! ********** Sind Sie sicher, dass Sie diesen Benutzer und alle zugehörigen Punches LÖSCHEN möchten!?!? Es gibt KEINE UNDO!'
DETAILS = 'Einzelheiten'
EMAIL = 'E-Mail-Addresse'
EMAIL_NOTVALID = 'Email adresse nicht gültig'
EMAIL_USED = 'E-Mail wird bereits verwendet'

View File

@ -23,6 +23,7 @@ DECLINE = 'Decline'
DEFAULT = 'Default'
DELETE = 'Delete'
DELETE_WARNING = '********* WARNING! ********** Are you SURE you want to DELETE this user AND ALL ASSOCIATED RECORDS!?!? There is NO UNDO!'
DETAILS = 'Details'
EMAIL = 'E-Mail Address'
EMAIL_NOTVALID = 'Email address not valid'
EMAIL_USED = 'Email already in use'

View File

@ -23,6 +23,7 @@ DECLINE = 'Disminución'
DEFAULT = 'Defecto'
DELETE = 'Borrar'
DELETE_WARNING = '********* ¡ADVERTENCIA! ********** ¿Estás seguro de que quieres BORRAR este usuario? No hay UNDO!'
DETAILS = 'Detalles'
EMAIL = 'Dirección de correo electrónico'
EMAIL_NOTVALID = 'La dirección de correo electrónico no es válida'
EMAIL_USED = 'Email ya en uso'

View File

@ -23,6 +23,7 @@ DECLINE = 'Déclin'
DEFAULT = 'Défaut'
DELETE = 'Effacer'
DELETE_WARNING = '********* ATTENTION! ********** Êtes-vous sûr de vouloir SUPPRIMER cet utilisateur ET TOUS LES POINÇONS ASSOCIÉS!?!? Il n&#39;y a pas d&#39;annulation!'
DETAILS = 'Des détails'
EMAIL = 'Adresse électronique'
EMAIL_NOTVALID = 'Adresse email non valide'
EMAIL_USED = 'Email déjà utilisé'

View File

@ -86,6 +86,7 @@
<?php // FILTER POSTED DATA
$form_data = filter_input_array(INPUT_POST, [
'fd_formAction' => (string)FILTER_SANITIZE_STRING,
'edituser' => (string)FILTER_SANITIZE_STRING,
'fd_editUserId' => (string)FILTER_SANITIZE_STRING,
'fd_initialPassword' => (string)FILTER_SANITIZE_STRING,
@ -93,11 +94,10 @@ $form_data = filter_input_array(INPUT_POST, [
'fd_firstName' => (string)FILTER_SANITIZE_STRING,
'fd_lastName' => (string)FILTER_SANITIZE_STRING,
'fd_userEmail' => (string)FILTER_SANITIZE_STRING,
'fd_actionNewSite' => (string)FILTER_SANITIZE_STRING,
'fd_newSiteName' => (string)FILTER_SANITIZE_STRING,
'fd_newSiteTimezone' => (string)FILTER_SANITIZE_STRING,
'fd_newSiteRegion' => (string)FILTER_SANITIZE_STRING
]);
]);
?>
<?php // PAGE CONSTANTS
@ -105,6 +105,19 @@ $form_data = filter_input_array(INPUT_POST, [
$minpasslength = $StaticFunctions->getMinPass(); // MINIMUM PASSWORD LENGTH
?>
<?php if(!empty($form_data['fd_formAction'])){ // ADD NEW SITE
if($form_data['fd_formAction']==='actionNewSite'){
ob_start();
$SiteInfo->addSite($form_data['fd_newSiteName'], $form_data['fd_newSiteTimezone'], $form_data['fd_newSiteRegion']);
$fd_newSiteId = $SiteInfo->getSiteByID($form_data['fd_newSiteName']);
$SiteInfo->grantSitePermissionBySiteAndUser($fd_newSiteId["0"]["id"], "1");
$SiteInfo->grantSitePermissionBySiteAndUser($fd_newSiteId["0"]["id"], "2");
header('Location: users.php');
ob_end_clean(); unset($form_data); } } ?>
<?php
if (!empty($form_data['edituser'])) { $edituser = $Users->getUserInfo($form_data['fd_editUserId'], "0", "0") ?>
<!-- USER EDIT SECTION -->
@ -119,7 +132,7 @@ if (!empty($form_data['edituser'])) { $edituser = $Users->getUserInfo($form_data
</div>
<div class="col text-end">
<button type="submit" class="btn btn-success btn-lg" value="Submit" name="editusercomplete"><i class="fas fa-save"></i> <?php echo $transLang['STR_COMMON_SAVE']; ?></button>
<a href="users.php" type="button" class="btn btn-primary btn-lg"><i class="fas fa-ban"></i> <?php echo $transLang['CANCEL']; ?></a>
<a href="users.php" type="button" class="btn btn-primary btn-lg"><i class="fas fa-ban"></i> <?php echo $transLang['STR_COMMON_CANCEL']; ?></a>
</div>
</div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
@ -202,15 +215,6 @@ if (!empty($form_data['edituser'])) { $edituser = $Users->getUserInfo($form_data
<?php } else { ?>
<?php if(!empty($form_data['fd_formAction'])){ // ADD NEW SITE
if($form_data['fd_formAction']==='actionNewSite'){
ob_start();
$SiteInfo->addSite($form_data['fd_newSiteName'], $form_data['fd_newSiteTimezone'], $form_data['fd_newSiteRegion']);
$fd_newSiteId = $SiteInfo->getSiteByID($form_data['fd_newSiteName']);
$SiteInfo->grantSitePermissionBySiteAndUser($fd_newSiteId["0"]["id"], "1");
$SiteInfo->grantSitePermissionBySiteAndUser($fd_newSiteId["0"]["id"], "2");
header('Location: users.php');
ob_end_clean(); unset($form_data); } } ?>
<?php
if (Registry::AUTHMETHOD == 'INTERNAL') {
@ -524,7 +528,7 @@ if (0 === $row_count1): else: $page_count1 = (int)ceil($row_count1 / $StaticFunc
</ul>
</div>
<div class="col text-end">
<a data-bs-toggle="modal" data-bs-target="#addSiteModal" href="#addSiteModal" name="addSiteModal" type="button" class="btn btn-info btn-lg open-addSiteModal"><i class="fas fa-map-marker-alt"></i> <?php echo $transLang['ADD_SITE']; ?></a>
<a data-bs-toggle="modal" data-bs-target="#modalAddSite" href="#modalAddSite" name="modalAddSite" type="button" class="btn btn-info btn-lg open-modalAddSite"><i class="fas fa-map-marker-alt"></i> <?php echo $transLang['ADD_SITE']; ?></a>
<a href="users.php" type="button" class="btn btn-primary btn-lg"><i class="fa fa-redo"></i> <?php echo $transLang['REFRESH']; ?></a>
</div>
</div>
@ -553,42 +557,42 @@ if (0 === $row_count1): else: $page_count1 = (int)ceil($row_count1 / $StaticFunc
<!-- START ADDSITE MODAL -->
<div class="modal fade" id="addSiteModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<form class="form form-approve" method="post">
<input type="hidden" name="fd_formAction" id="fd_formAction" value="actionNewSite" />
<div class="modal fade" id="modalAddSite" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" role="dialog">
<div class="modal-dialog modal-dialog-scrollable modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="AddSite"><?php echo $transLang['ADD_SITE']; ?></h5>
<div class="modal-header text-light bg-secondary">
<h5 class="modal-title"><?php echo $transLang['ADD_SITE']; ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<form class="form form-approve" method="post">
<input type="hidden" name="fd_formAction" id="fd_formAction" value="actionNewSite" />
<div class="row row-cols-1">
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text"><?php echo $transLang['NAME']; ?></span>
<input type="text" class="form-control" id="fd_newSiteName" name="fd_newSiteName" required />
<input type="text" class="form-control form-control-lg" id="fd_newSiteName" name="fd_newSiteName" required />
</div>
</div>
</div>
<div class="row row-cols-1">
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text"><?php echo $transLang['STR_COMMON_TIMEZONE']; ?></span>
<select class="form-control" id="fd_newSiteTimezone" name="fd_newSiteTimezone" required>
<select class="form-control form-select form-control-lg" id="fd_newSiteTimezone" name="fd_newSiteTimezone" required>
<option value=""><?php echo $transLang['STR_COMMON_TIMEZONE']; ?></option>
<?php foreach(DateTimeZone::listIdentifiers(DateTimeZone::ALL) as $row2) { ?>
<?php foreach(DateTimeZone::listIdentifiers(DateTimeZone::ALL) as $row2) { ?>
<option><?php echo $row2; ?></option>
<?php } ?>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="row row-cols-1">
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text"><?php echo $transLang['NAME']; ?></span>
<select class="form-control" id="fd_newSiteRegion" name="fd_newSiteRegion" required>
<select class="form-control form-select form-control-lg" id="fd_newSiteRegion" name="fd_newSiteRegion" required>
<option value=""><?php echo $transLang['STR_COMMON_REGION']; ?></option>
<option>CAN</option>
<option>EMEA</option>
@ -597,17 +601,20 @@ if (0 === $row_count1): else: $page_count1 = (int)ceil($row_count1 / $StaticFunc
</div>
</div>
</div>
<div class="row row-cols-1">
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal"><i class="fas fa-ban"></i>&nbsp;<?php echo $transLang['STR_COMMON_CANCEL']; ?></button>
<button type="submit" class="btn btn-success btn-sm" value="Submit" name="fd_actionNewSite"><i class="fas fa-user-plus"></i>&nbsp;<?php echo $transLang['ADD_SITE']; ?></button>
<button type="button" class="btn btn-secondary form-control form-control-lg" data-bs-dismiss="modal"><i class="fas fa-ban"></i>&nbsp;<?php echo $transLang['STR_COMMON_CANCEL']; ?></button>
</div>
<div class="col d-grid gap-2">
<button type="submit" class="btn btn-success form-control form-control-lg"><i class="fas fa-save"></i>&nbsp;<?php echo $transLang['ADD_SITE']; ?></button>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- END ADDSITE MODAL -->
<?php } ?>
<hr />