Code translation
|
@ -499,7 +499,7 @@ class user{
|
|||
}
|
||||
$_SESSION['_user_hidden'] = $user[0]["hidden"];
|
||||
$_SESSION['_user_disabled'] = $user[0]["disabled"];
|
||||
$_SESSION['_user_foreman'] = $user[0]["foreman"];
|
||||
$_SESSION['_user_chief'] = $user[0]["chief"];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -533,8 +533,8 @@ class user{
|
|||
$disabled = $disabled ? 1 : 0;
|
||||
$capo = $capo ? 1 : 0;
|
||||
$autista = $autista ? 1 : 0;
|
||||
$sql = "INSERT INTO `%PREFIX%_profiles` (`hidden`, `disabled`, `name`, `foreman`, `autista`) VALUES (:hidden, :disabled, :name, :foreman, :autista)";
|
||||
$this->database->exec($sql, false, [":hidden" => $hidden, ":disabled" => $disabled, ":name" => $name, ":foreman" => $capo, ":autista" => $autista]);
|
||||
$sql = "INSERT INTO `%PREFIX%_profiles` (`hidden`, `disabled`, `name`, `chief`, `autista`) VALUES (:hidden, :disabled, :name, :chief, :autista)";
|
||||
$this->database->exec($sql, false, [":hidden" => $hidden, ":disabled" => $disabled, ":name" => $name, ":chief" => $capo, ":autista" => $autista]);
|
||||
if($capo == 1){
|
||||
$this->auth->admin()->addRoleForUserById($userId, Role::FULL_VIEWER);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"username": "kathy.jordan",
|
||||
"password": "4jpbly8g6a",
|
||||
"birthday": "08/08/1995",
|
||||
"foreman": false,
|
||||
"chief": false,
|
||||
"driver": false
|
||||
}, {
|
||||
"email": "user2@mail.local",
|
||||
|
@ -12,7 +12,7 @@
|
|||
"username": "natalie.jordan",
|
||||
"password": "kf343di74s",
|
||||
"birthday": "04/05/2011",
|
||||
"foreman": true,
|
||||
"chief": true,
|
||||
"driver": false
|
||||
}, {
|
||||
"email": "user3@mail.local",
|
||||
|
@ -20,7 +20,7 @@
|
|||
"username": "keith.li",
|
||||
"password": "3ojvgk4fpv",
|
||||
"birthday": "11/04/2019",
|
||||
"foreman": true,
|
||||
"chief": true,
|
||||
"driver": true
|
||||
}, {
|
||||
"email": "user4@mail.local",
|
||||
|
@ -28,7 +28,7 @@
|
|||
"username": "pellegrino.scotto",
|
||||
"password": "e0ou92taw3",
|
||||
"birthday": "20/10/1983",
|
||||
"foreman": true,
|
||||
"chief": true,
|
||||
"driver": false
|
||||
}, {
|
||||
"email": "user5@mail.local",
|
||||
|
@ -36,7 +36,7 @@
|
|||
"username": "william.torres",
|
||||
"password": "0fso8sxxe0",
|
||||
"birthday": "16/07/2000",
|
||||
"foreman": false,
|
||||
"chief": false,
|
||||
"driver": true
|
||||
}, {
|
||||
"email": "user6@mail.local",
|
||||
|
@ -44,7 +44,7 @@
|
|||
"username": "napoleone.tomasetti",
|
||||
"password": "so7ykv8a7g",
|
||||
"birthday": "27/12/1978",
|
||||
"foreman": true,
|
||||
"chief": true,
|
||||
"driver": true
|
||||
}, {
|
||||
"email": "user7@mail.local",
|
||||
|
@ -52,7 +52,7 @@
|
|||
"username": "gelsomina.murray",
|
||||
"password": "x1js0s6zao",
|
||||
"birthday": "22/10/1994",
|
||||
"foreman": true,
|
||||
"chief": true,
|
||||
"driver": true
|
||||
}, {
|
||||
"email": "user8@mail.local",
|
||||
|
@ -60,7 +60,7 @@
|
|||
"username": "letizia.petrucelli",
|
||||
"password": "k1hsbdt3cv",
|
||||
"birthday": "24/04/1981",
|
||||
"foreman": true,
|
||||
"chief": true,
|
||||
"driver": false
|
||||
}, {
|
||||
"email": "user9@mail.local",
|
||||
|
@ -68,7 +68,7 @@
|
|||
"username": "giampaolo.surian",
|
||||
"password": "et52m65s4g",
|
||||
"birthday": "10/06/1972",
|
||||
"foreman": true,
|
||||
"chief": true,
|
||||
"driver": true
|
||||
}, {
|
||||
"email": "user10@mail.local",
|
||||
|
@ -76,6 +76,6 @@
|
|||
"username": "cassandra.jensen",
|
||||
"password": "9h3fb37ccw",
|
||||
"birthday": "28/10/1985",
|
||||
"foreman": true,
|
||||
"chief": true,
|
||||
"driver": false
|
||||
}]
|
|
@ -37,7 +37,7 @@ describe("User management", () => {
|
|||
.clear()
|
||||
.type(user.birthday)
|
||||
.should('have.value', user.birthday)
|
||||
if(user.foreman){
|
||||
if(user.chief){
|
||||
cy.get("input[name='capo']")
|
||||
.check({force: true})
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ describe("User management", () => {
|
|||
username: user.username,
|
||||
password: user.password,
|
||||
birthday: user.birthday,
|
||||
capo: user.foreman | 0,
|
||||
capo: user.chief | 0,
|
||||
autista: user.driver | 0,
|
||||
hidden: 0,
|
||||
disabled: 0
|
||||
|
|
|
@ -323,7 +323,7 @@ CREATE TABLE IF NOT EXISTS `".$prefix."_profiles` (
|
|||
`disabled` BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
`name` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`available` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`foreman` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`chief` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`autista` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`telefono` varchar(25) DEFAULT NULL,
|
||||
`services` int(11) NOT NULL DEFAULT 0,
|
||||
|
|
|
@ -3,7 +3,7 @@ include_once("../../core.php");
|
|||
init_class();
|
||||
$user->requirelogin();
|
||||
|
||||
$risultato = $database->exec("SELECT * FROM `%PREFIX%_profiles` ORDER BY available DESC, foreman DESC, services ASC, availability_minutes ASC, name ASC;", true);
|
||||
$risultato = $database->exec("SELECT * FROM `%PREFIX%_profiles` ORDER BY available DESC, chief DESC, services ASC, availability_minutes ASC, name ASC;", true);
|
||||
|
||||
$hidden = $user->hidden();
|
||||
?>
|
||||
|
@ -53,10 +53,10 @@ th, td {
|
|||
$name = $user->nameById($row["id"]);
|
||||
$callFunction = ($row['available'] == 1) ? "Deactivate" : "Activate";
|
||||
$available = $row["available"];
|
||||
if ($row['foreman'] == 1) {
|
||||
echo "<a onclick='$callFunction(".$row["id"].");'><img src='./resources/images/cascoRosso.png' width='20px'>";
|
||||
if ($row['chief'] == 1) {
|
||||
echo "<a onclick='$callFunction(".$row["id"].");'><img src='./resources/images/red_helmet.png' width='20px'>";
|
||||
} else {
|
||||
echo "<a onclick='$callFunction(".$row["id"].");'><img src='./resources/images/cascoNero.png' width='20px'>";
|
||||
echo "<a onclick='$callFunction(".$row["id"].");'><img src='./resources/images/black_helmet.png' width='20px'>";
|
||||
}
|
||||
if((time()-$row["online_time"])<=30){
|
||||
echo "<u>".$name."</u></a></td><td><a onclick='$callFunction(".$row["id"].");'>";
|
||||
|
@ -71,7 +71,7 @@ th, td {
|
|||
echo "</a></td>
|
||||
<td>";
|
||||
if ($row['autista'] == 1) {
|
||||
echo "<img src='./resources/images/volante.png' width='20px'>";
|
||||
echo "<img src='./resources/images/wheel.png' width='20px'>";
|
||||
} else {
|
||||
echo "";
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ include_once("../../core.php");
|
|||
init_class();
|
||||
$user->requirelogin();
|
||||
|
||||
$users_sql = "SELECT `id`, `name`, `available`, `foreman`, `autista`, `telefono`, `services`, `trainings`, `online`, `availability_minutes`, `immagine` FROM `%PREFIX%_profiles` LIMIT 0 , 30";
|
||||
$users_sql = "SELECT `id`, `name`, `available`, `chief`, `autista`, `telefono`, `services`, `trainings`, `online`, `availability_minutes`, `immagine` FROM `%PREFIX%_profiles` LIMIT 0 , 30";
|
||||
$users = $database->exec($users_sql, true);
|
||||
|
||||
$services_sql="SELECT * FROM `%PREFIX%_services` ORDER BY `services`.`id` DESC LIMIT 0 , 30";
|
||||
|
|
|
@ -7,7 +7,7 @@ $user->requirelogin();
|
|||
|
||||
function arraynum(){
|
||||
global $database;
|
||||
$risultato = $database->exec("SELECT * FROM `%PREFIX%_profiles` ORDER BY available DESC, foreman DESC, services ASC, name ASC", true);
|
||||
$risultato = $database->exec("SELECT * FROM `%PREFIX%_profiles` ORDER BY available DESC, chief DESC, services ASC, name ASC", true);
|
||||
$incremento = array();
|
||||
$availability_minutes_old = array();
|
||||
foreach($risultato as $row){
|
||||
|
|
|
@ -3,7 +3,7 @@ include_once("../../core.php");
|
|||
init_class();
|
||||
$user->requirelogin();
|
||||
|
||||
$risultato = $database->exec("SELECT * FROM `%PREFIX%_profiles` ORDER BY available DESC, foreman DESC, services ASC, availability_minutes ASC, name ASC;", true);
|
||||
$risultato = $database->exec("SELECT * FROM `%PREFIX%_profiles` ORDER BY available DESC, chief DESC, services ASC, availability_minutes ASC, name ASC;", true);
|
||||
|
||||
$hidden = $user->hidden();
|
||||
?>
|
||||
|
@ -45,7 +45,7 @@ th, td {
|
|||
foreach($risultato as $row){
|
||||
if(!in_array($row['name'], $hidden) && ($row['hidden'] == 0 && $row['disabled'] == 0)){
|
||||
echo "<tr><td>";
|
||||
if ($row['foreman'] == 1) {echo "<img src='./resources/images/cascoRosso.png' width='20px'> ";} else{echo "<img src='./resources/images/cascoNero.png' width='20px'> ";}
|
||||
if ($row['chief'] == 1) {echo "<img src='./resources/images/red_helmet.png' width='20px'> ";} else{echo "<img src='./resources/images/black_helmet.png' width='20px'> ";}
|
||||
if((time()-$row["online_time"])<=30){
|
||||
echo "<u>".$user->nameById($row["id"])."</u></td><td>";
|
||||
} else {
|
||||
|
|
|
@ -19,7 +19,7 @@ $risultato = $database->exec("SELECT * FROM `%PREFIX%_services` ORDER BY data DE
|
|||
<th><?php t("Code"); ?></th>
|
||||
<th><?php t("Start time"); ?></th>
|
||||
<th><?php t("End time"); ?></th>
|
||||
<th><?php t("Foreman"); ?></th>
|
||||
<th><?php t("Chief"); ?></th>
|
||||
<th><?php t("Drivers"); ?></th>
|
||||
<th><?php t("People"); ?></th>
|
||||
<th><?php t("Place"); ?></th>
|
||||
|
@ -32,7 +32,7 @@ $risultato = $database->exec("SELECT * FROM `%PREFIX%_services` ORDER BY data DE
|
|||
<tbody>
|
||||
<?php
|
||||
foreach($risultato as $row){
|
||||
$foreman = $user->nameById($row["capo"]);
|
||||
$chief = $user->nameById($row["capo"]);
|
||||
$drivers = "";
|
||||
foreach(explode(",", $row['autisti']) as $key=>$name){
|
||||
$drivers = $drivers.$user->nameById($name).", ";
|
||||
|
@ -41,7 +41,7 @@ foreach($risultato as $row){
|
|||
foreach(explode(",", $row['personale']) as $key=>$name){
|
||||
$others_people = $others_people.$user->nameById($name).", ";
|
||||
}
|
||||
echo "<tr><td>" . $row['data'] . "</td><td>" . $row['codice'] . "</td><td>" . $row['uscita'] . "</td><td>" . $row['rientro'] . "</td><td>" . $foreman . "</td><td>" . $drivers . "</td><td>" . $others_people . "</td><td>" . s($row['luogo'],false,true) . "</td><td>" . s($row['note'],false,true) . "</td><td>" . s($row['tipo'],false,true) . "</td>";
|
||||
echo "<tr><td>" . $row['data'] . "</td><td>" . $row['codice'] . "</td><td>" . $row['uscita'] . "</td><td>" . $row['rientro'] . "</td><td>" . $chief . "</td><td>" . $drivers . "</td><td>" . $others_people . "</td><td>" . s($row['luogo'],false,true) . "</td><td>" . s($row['note'],false,true) . "</td><td>" . s($row['tipo'],false,true) . "</td>";
|
||||
if($impostazioni['edit']) {
|
||||
echo "<td><a href='edit_service.php?edit&id={$row['id']}'><i style='font-size: 40px' class='fa fa-edit'></i></a></td>";
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ $risultato = $database->exec("SELECT * FROM `%PREFIX%_trainings` ORDER BY data D
|
|||
<th><?php t("Name"); ?></th>
|
||||
<th><?php t("Start time"); ?></th>
|
||||
<th><?php t("End time"); ?></th>
|
||||
<th><?php t("Foreman"); ?></th>
|
||||
<th><?php t("Chief"); ?></th>
|
||||
<th><?php t("People"); ?></th>
|
||||
<th><?php t("Place"); ?></th>
|
||||
<th><?php t("Notes"); ?></th>
|
||||
|
@ -30,12 +30,12 @@ $risultato = $database->exec("SELECT * FROM `%PREFIX%_trainings` ORDER BY data D
|
|||
<tbody>
|
||||
<?php
|
||||
foreach($risultato as $row){
|
||||
$foreman = $user->nameById($row["capo"]);
|
||||
$chief = $user->nameById($row["capo"]);
|
||||
$others_people = "";
|
||||
foreach(explode(",", $row['personale']) as $key=>$name){
|
||||
$others_people = $others_people.$user->nameById($name).", ";
|
||||
}
|
||||
echo "<tr><td>" . $row['data'] . "</td><td>" . $row['name'] . "</td><td>" . $row['inizio'] . "</td><td>" . $row['fine'] . "</td><td>" . $foreman . "</td><td>" . $others_people . "</td><td>" . $row['luogo'] . "</td><td>" . $row['note'] . "</td>";
|
||||
echo "<tr><td>" . $row['data'] . "</td><td>" . $row['name'] . "</td><td>" . $row['inizio'] . "</td><td>" . $row['fine'] . "</td><td>" . $chief . "</td><td>" . $others_people . "</td><td>" . $row['luogo'] . "</td><td>" . $row['note'] . "</td>";
|
||||
if($impostazioni['edit']) {
|
||||
echo "<td><a href='edit_training.php?edit&id={$row['id']}'><i style='font-size: 40px' class='fa fa-edit'></i></a></td>";
|
||||
}
|
||||
|
|
|
@ -318,11 +318,11 @@ foreach($risultato as $row){
|
|||
echo("<h1>".t("Personal data",false)." <b>$name</b></h1><br><br>");
|
||||
echo('<img alt="VVF" src="./resources/images/distaccamento.png" width="150" class="img-resposive"><br><br><br>');
|
||||
$disp = vero1($row['available'], "<i class='fa fa-check' style='color:green' width='22px'></i>", "<i class='fa fa-times' style='color:red' width='22px'></i>");
|
||||
$foreman = vero1($row['foreman'], "<img src='./resources/images/cascoRosso.png' width='22px'>", "<img src='./resources/images/cascoNero.png' width='22px'>");
|
||||
$autista = vero1($row['autista'], "<img src='./resources/images/volante.png' width='22px'>");
|
||||
$chief = vero1($row['chief'], "<img src='./resources/images/red_helmet.png' width='22px'>", "<img src='./resources/images/black_helmet.png' width='22px'>");
|
||||
$autista = vero1($row['autista'], "<img src='./resources/images/wheel.png' width='22px'>");
|
||||
echo("<p>".t("Name",false).": <b>$name</b></p><br>");
|
||||
echo("<p>".t("Available",false).": <b>{$disp}</b></p><br>");
|
||||
echo("<p>".t("Foreman",false).": <b>{$foreman}</b></p><br>");
|
||||
echo("<p>".t("Chief",false).": <b>{$chief}</b></p><br>");
|
||||
echo("<p>".t("Driver",false).": <b>{$autista}</b></p><br>");
|
||||
echo("<p>".t("Phone number",false)." <i class='fa fa-phone' style='color:green' width='22px'></i>: <b><a href='tel:{$row['telefono']}'>{$row['telefono']}</a></b></p><br>");
|
||||
echo("<p>".t("Availability Minutes",false)." <br>(".t("This month",false).") <i class='demo-icon icon-hourglass'></i>: <b>{$row['availability_minutes']} minutes</b></p><br>");
|
||||
|
|
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 705 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
@ -223,7 +223,7 @@ textarea {
|
|||
<input type="time" name="rientro" required value="{{ values.rientro }}">
|
||||
<br>
|
||||
<br>
|
||||
<label><b>{{ 'Foreman'|t }}</b></label>
|
||||
<label><b>{{ 'Chief'|t }}</b></label>
|
||||
<br>
|
||||
{% for user in service.personale %}
|
||||
<div {{ user.name == "test" ? "style='display: none'" : "" }} class="checkbox">
|
||||
|
|
|
@ -223,7 +223,7 @@ textarea {
|
|||
<input type="time" name="end_time" required value="{{ values.fine }}">
|
||||
<br>
|
||||
<br>
|
||||
<label><b>{{ 'Foreman'|t }}</b></label>
|
||||
<label><b>{{ 'Chief'|t }}</b></label>
|
||||
<br>
|
||||
{% for user in training.personale %}
|
||||
<div {{ user.name == "test" ? "style='display: none'" : "" }} class="checkbox">
|
||||
|
|
|
@ -229,7 +229,7 @@ textarea {
|
|||
<input autocomplete="off" class="datepicker" name="birthday" placeholder="DD/MM/YYY" type="text">
|
||||
<br>
|
||||
<br>
|
||||
<label><b>{{ 'Foreman'|t }}</b></label><br>
|
||||
<label><b>{{ 'Chief'|t }}</b></label><br>
|
||||
<input type="checkbox" name="capo" data-toggle="toggle">
|
||||
<br>
|
||||
<br>
|
||||
|
|
|
@ -18,7 +18,7 @@ return [
|
|||
"Logout" => "Logout",
|
||||
"Name" => "Name",
|
||||
"Available" => "Available",
|
||||
"Foreman" => "Foreman",
|
||||
"Chief" => "Chief",
|
||||
"Driver" => "Driver",
|
||||
"Drivers" => "Drivers",
|
||||
"People" => "People",
|
||||
|
|
|
@ -18,7 +18,7 @@ return [
|
|||
"Logout" => "Logout",
|
||||
"Name" => "Nome",
|
||||
"Available" => "Disponibile",
|
||||
"Foreman" => "Caposquadra",
|
||||
"Chief" => "Caposquadra",
|
||||
"Driver" => "Autista",
|
||||
"Drivers" => "Autisti",
|
||||
"People" => "Persone",
|
||||
|
|