Compare commits
7 Commits
ec8efec61e
...
5.3.0dev
| Author | SHA1 | Date | |
|---|---|---|---|
| b70996b4d9 | |||
| 8647c9b4d8 | |||
| b201ac6d24 | |||
| 1480feecf0 | |||
| f84395f79a | |||
| f3db1c1523 | |||
| 962bd7b504 |
@@ -280,4 +280,5 @@
|
|||||||
is enabled.
|
is enabled.
|
||||||
- Validate all date and time fields to prevent user entered invalid date
|
- Validate all date and time fields to prevent user entered invalid date
|
||||||
formats from crashing php.
|
formats from crashing php.
|
||||||
|
- Fixed profile page to automatically refresh page to show the results
|
||||||
|
when a user changes their color preferences.
|
||||||
|
|||||||
32
INSTALL
32
INSTALL
@@ -4,32 +4,30 @@
|
|||||||
|
|
||||||
SPDX-License-Identifier: GPL-2.0
|
SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
|
|
||||||
Installation of OpenLog is straightforward.
|
Installation of OpenLog is straightforward.
|
||||||
|
|
||||||
1. Gather the required information.
|
1. Gather the required information.
|
||||||
You'll need to know how to configure your web server. This means where
|
You'll need to know how to configure your web server. This means where
|
||||||
you want to put the files to be served and any configuration required to
|
you want to put the files to be served and any configuration required to
|
||||||
allow clients to reach them. You'll also need to know the username and
|
allow clients to reach them. You'll also need to know the username and
|
||||||
password of the MySQL administrator.
|
password of the MySQL administrator.
|
||||||
|
|
||||||
2. Unpack
|
2. Unpack
|
||||||
Unpack the distribution in a convenient place (such as /tmp or My Documents).
|
Unpack the distribution in a convenient place (such as /tmp or My Documents).
|
||||||
A directory will be created called OpenLog-x.x.x.
|
A directory will be created called OpenLog-x.x.x.
|
||||||
|
|
||||||
3. Review License
|
3. Review License
|
||||||
Change to the openlog-x.x.x directory and review the LICENSE file.
|
Change to the openlog-x.x.x directory and review the LICENSE file.
|
||||||
|
|
||||||
4. Run the install script
|
4. Run the install script
|
||||||
If installing on a Linux or Unix based system, type ./install.sh at a
|
If installing on a Linux or Unix based system, type ./install.sh at a
|
||||||
command prompt. If installing on a Windows based system, double click
|
command prompt. If installing on a Windows based system, double click
|
||||||
install.bat. Follow the prompts.
|
install.bat. Follow the prompts.
|
||||||
|
|
||||||
5. Check and set Configuration
|
5. Check and set Configuration
|
||||||
Click on the Administration menu option on the main page to adjust the initial
|
Click on the Administration menu option on the main page to adjust the initial
|
||||||
settings. You will need to log in as OpenLogAdmin. The initial default password
|
settings. You will need to log in as OpenLogAdmin. The initial default password
|
||||||
is "OpenLog-1". From the Administration page, you can click on the links at the
|
is "OpenLog-1". From the Administration page, you can click on the links at the
|
||||||
top to add techs, subjects, shifts, etc.
|
top to add techs, subjects, shifts, etc.
|
||||||
|
|
||||||
7. Start using OpenLog.
|
|
||||||
|
|
||||||
|
6. Start using OpenLog.
|
||||||
|
|||||||
@@ -14,10 +14,10 @@
|
|||||||
** DO NOT EDIT **
|
** DO NOT EDIT **
|
||||||
************************************************************************
|
************************************************************************
|
||||||
*/
|
*/
|
||||||
$appname="APPNAME";
|
$appname = "APPNAME";
|
||||||
$dbname="DBNAME";
|
$dbname = "DBNAME";
|
||||||
$username="DBUSER";
|
$username = "DBUSER";
|
||||||
$dbpass="DBPASS";
|
$dbpass = "DBPASS";
|
||||||
|
|
||||||
function dberrmsg($dbname) {
|
function dberrmsg($dbname) {
|
||||||
echo "
|
echo "
|
||||||
@@ -34,7 +34,7 @@ function dberrmsg($dbname) {
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$db=@mysqli_connect("localhost",$username,$dbpass,$dbname);
|
$db = @mysqli_connect("localhost",$username,$dbpass,$dbname);
|
||||||
if (mysqli_errno($db)) {
|
if (mysqli_errno($db)) {
|
||||||
dberrmsg($dbname);
|
dberrmsg($dbname);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,4 +280,7 @@
|
|||||||
is enabled.
|
is enabled.
|
||||||
- Validate all date and time fields to prevent user entered invalid date
|
- Validate all date and time fields to prevent user entered invalid date
|
||||||
formats from crashing php.
|
formats from crashing php.
|
||||||
|
- Fixed profile page to automatically refresh page to show the results
|
||||||
|
when a user changes their color preferences.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -764,17 +764,25 @@ switch ($table) {
|
|||||||
";
|
";
|
||||||
// pull current values from database
|
// pull current values from database
|
||||||
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from techs where techid=$id"));
|
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from techs where techid=$id"));
|
||||||
$name = $currentvalues["techname"];
|
if (!empty($currentvalues)) {
|
||||||
$pass = $passconf = "password_is_unchanged";
|
$name = $currentvalues["techname"];
|
||||||
$shift = $currentvalues["shift"];
|
$pass = $passconf = "password_is_unchanged";
|
||||||
if ($currentvalues["admin"] == 1) {
|
$shift = $currentvalues["shift"];
|
||||||
$admintag = "<input type=\"checkbox\" name=\"admin\" checked>";
|
if ($currentvalues["admin"] == 1) {
|
||||||
|
$admintag = "<input type=\"checkbox\" name=\"admin\" checked>";
|
||||||
|
} else {
|
||||||
|
$admintag = "<input type=\"checkbox\" name=\"admin\">";
|
||||||
|
}
|
||||||
|
if ($currentvalues["status"] == 1) {
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\" checked>";
|
||||||
|
} else {
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$name = NULL;
|
||||||
|
$pass = NULL;
|
||||||
|
$shift = NULL;
|
||||||
$admintag = "<input type=\"checkbox\" name=\"admin\">";
|
$admintag = "<input type=\"checkbox\" name=\"admin\">";
|
||||||
}
|
|
||||||
if ($currentvalues["status"] == 1) {
|
|
||||||
$activetag = "<input type=\"checkbox\" name=\"active\" checked>";
|
|
||||||
} else {
|
|
||||||
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -878,10 +886,15 @@ switch ($table) {
|
|||||||
";
|
";
|
||||||
// pull current values from database
|
// pull current values from database
|
||||||
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from shifts where shiftid=$id"));
|
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from shifts where shiftid=$id"));
|
||||||
$name = $currentvalues["shiftname"];
|
if (!empty($currentvalues)) {
|
||||||
if ($currentvalues["status"] == 1) {
|
$name = $currentvalues["shiftname"];
|
||||||
$activetag = "<input type=\"checkbox\" name=\"active\" checked>";
|
if ($currentvalues["status"] == 1) {
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\" checked>";
|
||||||
|
} else {
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$name = NULL;
|
||||||
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -952,10 +965,15 @@ switch ($table) {
|
|||||||
";
|
";
|
||||||
// pull current values from database
|
// pull current values from database
|
||||||
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from subjects where subjectid=$id"));
|
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from subjects where subjectid=$id"));
|
||||||
$name = $currentvalues["subjectname"];
|
if (!empty($currentvalues)) {
|
||||||
if ($currentvalues["status"] == 1) {
|
$name = $currentvalues["subjectname"];
|
||||||
$activetag = "<input type=\"checkbox\" name=\"active\" checked>";
|
if ($currentvalues["status"] == 1) {
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\" checked>";
|
||||||
|
} else {
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$name = "";
|
||||||
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1026,12 +1044,19 @@ switch ($table) {
|
|||||||
";
|
";
|
||||||
// pull current values from database
|
// pull current values from database
|
||||||
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from links where linkid=$id"));
|
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from links where linkid=$id"));
|
||||||
$name = $currentvalues["displaytxt"];
|
if (!empty($currentvalues)) {
|
||||||
$priority = $currentvalues["linkpriority"];
|
$name = $currentvalues["displaytxt"];
|
||||||
$url = $currentvalues["urltxt"];
|
$priority = $currentvalues["linkpriority"];
|
||||||
if ($currentvalues["status"] == 1) {
|
$url = $currentvalues["urltxt"];
|
||||||
$activetag = "<input type=\"checkbox\" name=\"active\" checked>";
|
if ($currentvalues["status"] == 1) {
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\" checked>";
|
||||||
|
} else {
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$name = NULL;
|
||||||
|
$priority = NULL;
|
||||||
|
$url = NULL;
|
||||||
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
||||||
}
|
}
|
||||||
// determine where we are in the priority stack
|
// determine where we are in the priority stack
|
||||||
@@ -1145,10 +1170,22 @@ switch ($table) {
|
|||||||
";
|
";
|
||||||
// pull current values from database
|
// pull current values from database
|
||||||
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from flags where flagid=$id"));
|
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from flags where flagid=$id"));
|
||||||
$name = $currentvalues["flagname"];
|
if (!empty($currentvalues)) {
|
||||||
$flagsym = $currentvalues["flagsym"];
|
$name = $currentvalues["flagname"];
|
||||||
$flagcolor = $currentvalues["flagcolor"];
|
$flagsym = $currentvalues["flagsym"];
|
||||||
$flagcoloropts = "";
|
$flagcolor = $currentvalues["flagcolor"];
|
||||||
|
$flagcoloropts = "";
|
||||||
|
if ($currentvalues["status"] == 1) {
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\" checked>";
|
||||||
|
} else {
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$name = NULL;
|
||||||
|
$flagsym = NULL;
|
||||||
|
$flagcolor = NULL;
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
||||||
|
}
|
||||||
foreach ($basic_colors as $cname => $chex) {
|
foreach ($basic_colors as $cname => $chex) {
|
||||||
if ($chex == $flagcolor) {
|
if ($chex == $flagcolor) {
|
||||||
$flagcoloropts = $flagcoloropts . "<option value=\"$chex\" selected>$cname</option>";
|
$flagcoloropts = $flagcoloropts . "<option value=\"$chex\" selected>$cname</option>";
|
||||||
@@ -1156,11 +1193,6 @@ switch ($table) {
|
|||||||
$flagcoloropts = $flagcoloropts . "<option value=\"$chex\">$cname</option>";
|
$flagcoloropts = $flagcoloropts . "<option value=\"$chex\">$cname</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($currentvalues["status"] == 1) {
|
|
||||||
$activetag = "<input type=\"checkbox\" name=\"active\" checked>";
|
|
||||||
} else {
|
|
||||||
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// set form options for add
|
// set form options for add
|
||||||
$sectiontitle = "<b>Add New Flag</b><br><br>";
|
$sectiontitle = "<b>Add New Flag</b><br><br>";
|
||||||
@@ -1246,10 +1278,15 @@ switch ($table) {
|
|||||||
";
|
";
|
||||||
// pull current values from database
|
// pull current values from database
|
||||||
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from logpartactions where lpactionid=$id"));
|
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from logpartactions where lpactionid=$id"));
|
||||||
$name = $currentvalues["lpactionname"];
|
if (!empty($currentvalues)) {
|
||||||
if ($currentvalues["status"] == 1) {
|
$name = $currentvalues["lpactionname"];
|
||||||
$activetag = "<input type=\"checkbox\" name=\"active\" checked>";
|
if ($currentvalues["status"] == 1) {
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\" checked>";
|
||||||
|
} else {
|
||||||
|
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$name = NULL;
|
||||||
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
$activetag = "<input type=\"checkbox\" name=\"active\">";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1320,9 +1357,15 @@ switch ($table) {
|
|||||||
";
|
";
|
||||||
// pull current values from database
|
// pull current values from database
|
||||||
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from banners where bannerid=$id"));
|
$currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from banners where bannerid=$id"));
|
||||||
$name = $currentvalues["bannername"];
|
if (!empty($currentvalues)) {
|
||||||
$bnrcolor = $currentvalues["bannercolor"];
|
$name = $currentvalues["bannername"];
|
||||||
$bnrtextcolor = $currentvalues["textcolor"];
|
$bnrcolor = $currentvalues["bannercolor"];
|
||||||
|
$bnrtextcolor = $currentvalues["textcolor"];
|
||||||
|
} else {
|
||||||
|
$name = NULL;
|
||||||
|
$bnrcolor = NULL;
|
||||||
|
$bnrtextcolor = NULL;
|
||||||
|
}
|
||||||
$bnrcoloropts = "";
|
$bnrcoloropts = "";
|
||||||
foreach ($basic_colors as $cname => $chex) {
|
foreach ($basic_colors as $cname => $chex) {
|
||||||
if ($chex == $bnrcolor) {
|
if ($chex == $bnrcolor) {
|
||||||
|
|||||||
@@ -968,15 +968,15 @@ function templateselect($techid, $operation)
|
|||||||
<td>
|
<td>
|
||||||
<select name=\"usertemplateid\" title=\"Select the user template you'd like to load and click the Load Template button. User template selection takes precedence.\">
|
<select name=\"usertemplateid\" title=\"Select the user template you'd like to load and click the Load Template button. User template selection takes precedence.\">
|
||||||
";
|
";
|
||||||
if ($isadmin && $operation!=NULL) {
|
if ($isadmin && $operation != NULL) {
|
||||||
$templaterow = mysqli_query($db, "select * from notetemplates where tech!=\"0\" order by tech asc, templatename asc");
|
$templaterow = mysqli_query($db, "select * from notetemplates where tech!=\"0\" order by tech asc, templatename asc");
|
||||||
} else {
|
} else {
|
||||||
$templaterow = mysqli_query($db, "select * from notetemplates where tech=\"$techid\" order by templatename asc");
|
$templaterow = mysqli_query($db, "select * from notetemplates where tech=\"$techid\" order by templatename asc");
|
||||||
}
|
}
|
||||||
printf("<option value=\"%s\" selected>%s</option>", "0", "Select user template");
|
printf("<option value=\"%s\" selected>%s</option>", "0", "Select user template");
|
||||||
while ($templateitem = mysqli_fetch_assoc($templaterow)) {
|
while ($templateitem = mysqli_fetch_assoc($templaterow)) {
|
||||||
if ($isadmin && $operation!=NULL) {
|
if ($isadmin && $operation != NULL) {
|
||||||
$techname=dblookup($db, "techs", "techid", "techname", $templateitem["tech"]);
|
$techname = dblookup($db, "techs", "techid", "techname", $templateitem["tech"]);
|
||||||
printf("<option value=\"%s\">%s(%s)</option>", $templateitem["templateid"], $templateitem["templatename"], $techname);
|
printf("<option value=\"%s\">%s(%s)</option>", $templateitem["templateid"], $templateitem["templatename"], $techname);
|
||||||
} else {
|
} else {
|
||||||
printf("<option value=\"%s\">%s</option>", $templateitem["templateid"], $templateitem["templatename"]);
|
printf("<option value=\"%s\">%s</option>", $templateitem["templateid"], $templateitem["templatename"]);
|
||||||
@@ -1020,7 +1020,7 @@ function fix_date($datestring)
|
|||||||
|
|
||||||
if (!$datestring) $datestring = $today;
|
if (!$datestring) $datestring = $today;
|
||||||
$datepatt = '/^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$/';
|
$datepatt = '/^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$/';
|
||||||
if (!preg_match($datepatt,$datestring)) $datestring = $today;
|
if (!preg_match($datepatt, $datestring)) $datestring = $today;
|
||||||
$datestring = mysqli_real_escape_string($db, $datestring);
|
$datestring = mysqli_real_escape_string($db, $datestring);
|
||||||
return $datestring;
|
return $datestring;
|
||||||
}
|
}
|
||||||
@@ -1034,7 +1034,7 @@ function fix_time($timestring)
|
|||||||
|
|
||||||
if (!$timestring) $timestring = $now;
|
if (!$timestring) $timestring = $now;
|
||||||
$timepatt = '/^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/';
|
$timepatt = '/^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/';
|
||||||
if (!preg_match($timepatt,$timestring)) $timestring = $now;
|
if (!preg_match($timepatt, $timestring)) $timestring = $now;
|
||||||
$timestring = mysqli_real_escape_string($db, $timestring);
|
$timestring = mysqli_real_escape_string($db, $timestring);
|
||||||
return $timestring;
|
return $timestring;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
include("functions.php");
|
include("functions.php");
|
||||||
|
|
||||||
if (!array_key_exists("login",$_SESSION) && !array_key_exists("partview",$_REQUEST)) {
|
if (!array_key_exists("login", $_SESSION) && !array_key_exists("partview", $_REQUEST)) {
|
||||||
header("Location: login.php");
|
header("Location: login.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ if ($add) {
|
|||||||
// sanitize and fix blank date and time
|
// sanitize and fix blank date and time
|
||||||
$date = fix_date($date);
|
$date = fix_date($date);
|
||||||
$time = fix_time($time);
|
$time = fix_time($time);
|
||||||
|
|
||||||
// determine whether supplied date is future or past
|
// determine whether supplied date is future or past
|
||||||
$datediff = mysqli_fetch_row(mysqli_query($db, "select datediff(\"$date\",CURRENT_DATE)"));
|
$datediff = mysqli_fetch_row(mysqli_query($db, "select datediff(\"$date\",CURRENT_DATE)"));
|
||||||
// if future, set time to 00:00:01, if past, set to 23:59:59
|
// if future, set time to 00:00:01, if past, set to 23:59:59
|
||||||
@@ -265,7 +265,7 @@ if ($edit) {
|
|||||||
// sanitize and fix blank date and time
|
// sanitize and fix blank date and time
|
||||||
$date = fix_date($date);
|
$date = fix_date($date);
|
||||||
$time = fix_time($time);
|
$time = fix_time($time);
|
||||||
|
|
||||||
// remove cruft from note text
|
// remove cruft from note text
|
||||||
$note = strip_tags($note, "<a>");
|
$note = strip_tags($note, "<a>");
|
||||||
$note = mysqli_real_escape_string($db, $note);
|
$note = mysqli_real_escape_string($db, $note);
|
||||||
@@ -500,7 +500,7 @@ if ($delete) {
|
|||||||
format_message(0, "<strong>Note deleted.</strong> <a href=\"lognotes.php\">Return to main page.</a>");
|
format_message(0, "<strong>Note deleted.</strong> <a href=\"lognotes.php\">Return to main page.</a>");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists('login',$_SESSION)) {
|
if (array_key_exists('login', $_SESSION)) {
|
||||||
// show the template selection line
|
// show the template selection line
|
||||||
templateselect($techid, NULL);
|
templateselect($techid, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ if ($mfadd) {
|
|||||||
|
|
||||||
// add the record to maintforms
|
// add the record to maintforms
|
||||||
if (! $pdatamismatch) {
|
if (! $pdatamismatch) {
|
||||||
$lognoteid = ($lognoteid==NULL) ? 0 : $lognoteid;
|
$lognoteid = ($lognoteid == NULL) ? 0 : $lognoteid;
|
||||||
mysqli_query($db, "insert into maintforms(mfdate,mftime,mftech,mfpart,mfpartloc,mfmalfunction,nha,repord,lognoteid,pending)
|
mysqli_query($db, "insert into maintforms(mfdate,mftime,mftech,mfpart,mfpartloc,mfmalfunction,nha,repord,lognoteid,pending)
|
||||||
values (\"$mfdate\", \"$mftime\",\"$loggedinas\",\"$mfpart\",\"$mfpartloc\",\"$mfmalfunction\",\"$nha\",\"$repord\",\"$lognoteid\",\"$pending\")");
|
values (\"$mfdate\", \"$mftime\",\"$loggedinas\",\"$mfpart\",\"$mfpartloc\",\"$mfmalfunction\",\"$nha\",\"$repord\",\"$lognoteid\",\"$pending\")");
|
||||||
$newmaintformid = mysqli_insert_id($db);
|
$newmaintformid = mysqli_insert_id($db);
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ if (!$print) {
|
|||||||
// color settings
|
// color settings
|
||||||
$hexcolor = "#" . ltrim($hexcolor);
|
$hexcolor = "#" . ltrim($hexcolor);
|
||||||
putsetting($modcolor, $hexcolor, $techid);
|
putsetting($modcolor, $hexcolor, $techid);
|
||||||
|
$currentpage = $_SERVER['PHP_SELF'];
|
||||||
|
header("Refresh: .1; url=$currentpage");
|
||||||
}
|
}
|
||||||
if ($resetcustom) mysqli_query($db, "delete from customs where customtech=\"$techid\"");
|
if ($resetcustom) mysqli_query($db, "delete from customs where customtech=\"$techid\"");
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,6 @@ if ($add) {
|
|||||||
}
|
}
|
||||||
// run through the memberlist and modify the table
|
// run through the memberlist and modify the table
|
||||||
foreach ($memberlist as $memberdev) {
|
foreach ($memberlist as $memberdev) {
|
||||||
|
|
||||||
$addqry = ("insert into events(task,device,start_date,last_date,deferred_flag,deferred_date,active_flag)
|
$addqry = ("insert into events(task,device,start_date,last_date,deferred_flag,deferred_date,active_flag)
|
||||||
values(\"$task\",\"$memberdev\",\"$start_date\",\"$last_date\",\"$deferred_flag\",\"$deferred_date\",\"$active_flag\")");
|
values(\"$task\",\"$memberdev\",\"$start_date\",\"$last_date\",\"$deferred_flag\",\"$deferred_date\",\"$active_flag\")");
|
||||||
mysqli_query($db, $addqry);
|
mysqli_query($db, $addqry);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ $srchploc = $_REQUEST['srchploc'] ?? NULL;
|
|||||||
$srchnha = $_REQUEST['srchnha'] ?? NULL;
|
$srchnha = $_REQUEST['srchnha'] ?? NULL;
|
||||||
$srchrepord = $_REQUEST['srchrepord'] ?? NULL;
|
$srchrepord = $_REQUEST['srchrepord'] ?? NULL;
|
||||||
$srchflags = $_POST['srchflags'] ?? [];
|
$srchflags = $_POST['srchflags'] ?? [];
|
||||||
$target = $_REQUEST['target'] ?? NULL;
|
$target = $_REQUEST['target'] ?? ["log", "maintform", "part"];
|
||||||
|
|
||||||
$doparts = PARTS_FUNCTIONS;
|
$doparts = PARTS_FUNCTIONS;
|
||||||
$logname = LOG_NAME;
|
$logname = LOG_NAME;
|
||||||
@@ -56,7 +56,7 @@ framework("begin", "$logname Search", "Search", $print);
|
|||||||
|
|
||||||
// echo "REQUEST variables: <br>";
|
// echo "REQUEST variables: <br>";
|
||||||
// var_dump($_REQUEST);
|
// var_dump($_REQUEST);
|
||||||
|
// echo "<br>";
|
||||||
|
|
||||||
// ******** begin database manipulation ********
|
// ******** begin database manipulation ********
|
||||||
|
|
||||||
@@ -92,7 +92,6 @@ if ($search) {
|
|||||||
$srchpname = trim($srchpname);
|
$srchpname = trim($srchpname);
|
||||||
$srchploc = trim($srchploc);
|
$srchploc = trim($srchploc);
|
||||||
$srchnha = trim($srchnha);
|
$srchnha = trim($srchnha);
|
||||||
if ($target[0] == "") $target = [];
|
|
||||||
if (in_array("log", $target)) {
|
if (in_array("log", $target)) {
|
||||||
// define the query constraints
|
// define the query constraints
|
||||||
// log note id
|
// log note id
|
||||||
@@ -131,23 +130,6 @@ if ($search) {
|
|||||||
$logfromtables[] = "lognotes";
|
$logfromtables[] = "lognotes";
|
||||||
$logconstraints[] = "lognotes.lognote like \"%$srchtext%\"";
|
$logconstraints[] = "lognotes.lognote like \"%$srchtext%\"";
|
||||||
}
|
}
|
||||||
// flags
|
|
||||||
if (!empty($srchflags)) {
|
|
||||||
unset($flagconstraints);
|
|
||||||
$flagcount = count($srchflags);
|
|
||||||
$logfromtables[] = "lognotes";
|
|
||||||
$logfromtables[] = "flagmap";
|
|
||||||
$flagconstraints[] = "flagmap.lognoteid=lognotes.lognoteid and flagmap.flagid in (";
|
|
||||||
foreach ($srchflags as $flagid) {
|
|
||||||
$flagconstraints[] = "\"$flagid\"";
|
|
||||||
$flagconstraints[] = ",";
|
|
||||||
}
|
|
||||||
// remove final comma
|
|
||||||
array_splice($flagconstraints, -1, 1);
|
|
||||||
$flagconstraints[] = ") group by flagmap.lognoteid having count(distinct flagmap.flagid)=$flagcount";
|
|
||||||
// make flagconstraints a single string so that the final implode doesn't split it
|
|
||||||
$logconstraints[] = join('', $flagconstraints);
|
|
||||||
}
|
|
||||||
// uid
|
// uid
|
||||||
if ($srchuid != "any" && $srchuid != "") {
|
if ($srchuid != "any" && $srchuid != "") {
|
||||||
$logfromtables[] = "lognotes";
|
$logfromtables[] = "lognotes";
|
||||||
@@ -200,12 +182,28 @@ if ($search) {
|
|||||||
$logfromtables[] = "maintforms";
|
$logfromtables[] = "maintforms";
|
||||||
$logconstraints[] = "lognotes.lognoteid=logparts.lognoteid and logparts.partid=parts.partid and maintforms.mfpart=parts.partid and maintforms.repord=\"{$srchrepord}\"";
|
$logconstraints[] = "lognotes.lognoteid=logparts.lognoteid and logparts.partid=parts.partid and maintforms.mfpart=parts.partid and maintforms.repord=\"{$srchrepord}\"";
|
||||||
}
|
}
|
||||||
|
// flags
|
||||||
|
if (!empty($srchflags)) {
|
||||||
|
unset($flagconstraints);
|
||||||
|
$flagcount = count($srchflags);
|
||||||
|
$logfromtables[] = "lognotes";
|
||||||
|
$logfromtables[] = "flagmap";
|
||||||
|
$flagconstraints[] = "flagmap.lognoteid=lognotes.lognoteid and flagmap.flagid in (";
|
||||||
|
foreach ($srchflags as $flagid) {
|
||||||
|
$flagconstraints[] = "\"$flagid\"";
|
||||||
|
$flagconstraints[] = ",";
|
||||||
|
}
|
||||||
|
// remove final comma
|
||||||
|
array_splice($flagconstraints, -1, 1);
|
||||||
|
$flagconstraints[] = ") group by flagmap.lognoteid having count(distinct flagmap.flagid)=$flagcount";
|
||||||
|
// make flagconstraints a single string so that the final implode doesn't split it
|
||||||
|
$logconstraints[] = join('', $flagconstraints);
|
||||||
|
}
|
||||||
// build the clauses and run the query
|
// build the clauses and run the query
|
||||||
$logfromclause = implode(",", array_unique($logfromtables));
|
$logfromclause = implode(",", array_unique($logfromtables));
|
||||||
$logwhereclause = implode(" and ", $logconstraints);
|
$logwhereclause = implode(" and ", $logconstraints);
|
||||||
$logrowqry = mysqli_query($db, "select lognotes.* from $logfromclause where $logwhereclause order by lognotes.date asc, lognotes.time asc");
|
$logrowqry = mysqli_query($db, "select lognotes.* from $logfromclause where $logwhereclause order by lognotes.date asc, lognotes.time asc");
|
||||||
}
|
}
|
||||||
if ($target[0] == "") $target = [];
|
|
||||||
if (in_array("maintform", $target)) {
|
if (in_array("maintform", $target)) {
|
||||||
// maintforms search
|
// maintforms search
|
||||||
// define the query constraints
|
// define the query constraints
|
||||||
@@ -248,23 +246,6 @@ if ($search) {
|
|||||||
$mffromtables[] = "maintactions";
|
$mffromtables[] = "maintactions";
|
||||||
$mfconstraints[] = "maintforms.mfmalfunction like \"%$srchtext%\" or (maintactions.action like \"%$srchtext%\" and maintforms.maintformid=maintactions.maintformnum)";
|
$mfconstraints[] = "maintforms.mfmalfunction like \"%$srchtext%\" or (maintactions.action like \"%$srchtext%\" and maintforms.maintformid=maintactions.maintformnum)";
|
||||||
}
|
}
|
||||||
// flags
|
|
||||||
if (!empty($srchflags)) {
|
|
||||||
unset($flagconstraints);
|
|
||||||
$flagcount = count($srchflags);
|
|
||||||
$mffromtables[] = "maintforms";
|
|
||||||
$mffromtables[] = "flagmap";
|
|
||||||
$flagconstraints[] = "flagmap.maintformid=maintforms.maintformid and flagmap.flagid in (";
|
|
||||||
foreach ($srchflags as $thisflagid) {
|
|
||||||
$flagconstraints[] = "\"$thisflagid\"";
|
|
||||||
$flagconstraints[] = ",";
|
|
||||||
}
|
|
||||||
// remove final comma
|
|
||||||
array_splice($flagconstraints, -1, 1);
|
|
||||||
$flagconstraints[] = ") group by flagmap.maintformid having count(distinct flagmap.flagid)=$flagcount";
|
|
||||||
// make flagconstraints a single string so that the final implode doesn't split it
|
|
||||||
$mfconstraints[] = join('', $flagconstraints);
|
|
||||||
}
|
|
||||||
// uid
|
// uid
|
||||||
if ($srchuid != "any" && $srchuid != "") {
|
if ($srchuid != "any" && $srchuid != "") {
|
||||||
$mffromtables[] = "maintforms";
|
$mffromtables[] = "maintforms";
|
||||||
@@ -307,12 +288,28 @@ if ($search) {
|
|||||||
$mffromtables[] = "maintforms";
|
$mffromtables[] = "maintforms";
|
||||||
$mfconstraints[] = "maintforms.mfpart=parts.partid and maintforms.repord=\"{$srchrepord}\"";
|
$mfconstraints[] = "maintforms.mfpart=parts.partid and maintforms.repord=\"{$srchrepord}\"";
|
||||||
}
|
}
|
||||||
|
// flags
|
||||||
|
if (!empty($srchflags)) {
|
||||||
|
unset($flagconstraints);
|
||||||
|
$flagcount = count($srchflags);
|
||||||
|
$mffromtables[] = "maintforms";
|
||||||
|
$mffromtables[] = "flagmap";
|
||||||
|
$flagconstraints[] = "flagmap.maintformid=maintforms.maintformid and flagmap.flagid in (";
|
||||||
|
foreach ($srchflags as $thisflagid) {
|
||||||
|
$flagconstraints[] = "\"$thisflagid\"";
|
||||||
|
$flagconstraints[] = ",";
|
||||||
|
}
|
||||||
|
// remove final comma
|
||||||
|
array_splice($flagconstraints, -1, 1);
|
||||||
|
$flagconstraints[] = ") group by flagmap.maintformid having count(distinct flagmap.flagid)=$flagcount";
|
||||||
|
// make flagconstraints a single string so that the final implode doesn't split it
|
||||||
|
$mfconstraints[] = join('', $flagconstraints);
|
||||||
|
}
|
||||||
// build the clauses and run the query
|
// build the clauses and run the query
|
||||||
$mffromclause = implode(",", array_unique($mffromtables));
|
$mffromclause = implode(",", array_unique($mffromtables));
|
||||||
$mfwhereclause = implode(" and ", $mfconstraints);
|
$mfwhereclause = implode(" and ", $mfconstraints);
|
||||||
$mfrowqry = mysqli_query($db, "select maintforms.* from $mffromclause where $mfwhereclause order by maintforms.mfdate asc, maintforms.mftime asc");
|
$mfrowqry = mysqli_query($db, "select maintforms.* from $mffromclause where $mfwhereclause order by maintforms.mfdate asc, maintforms.mftime asc");
|
||||||
}
|
}
|
||||||
if ($target[0] == "") $target = [];
|
|
||||||
if (in_array("part", $target)) {
|
if (in_array("part", $target)) {
|
||||||
// parts search
|
// parts search
|
||||||
// define the query constraints
|
// define the query constraints
|
||||||
@@ -334,7 +331,6 @@ if ($search) {
|
|||||||
// tech doesn't apply to parts
|
// tech doesn't apply to parts
|
||||||
// subject doesn't apply to parts
|
// subject doesn't apply to parts
|
||||||
// search text doesn't apply to parts
|
// search text doesn't apply to parts
|
||||||
// flags doesn't apply to parts
|
|
||||||
// uid
|
// uid
|
||||||
if ($srchuid != "any" && $srchuid != "") {
|
if ($srchuid != "any" && $srchuid != "") {
|
||||||
$pfromtables[] = "parts";
|
$pfromtables[] = "parts";
|
||||||
@@ -373,6 +369,7 @@ if ($search) {
|
|||||||
$pfromtables[] = "maintforms";
|
$pfromtables[] = "maintforms";
|
||||||
$pconstraints[] = "maintforms.mfpart=parts.partid and maintforms.repord=\"{$srchrepord}\"";
|
$pconstraints[] = "maintforms.mfpart=parts.partid and maintforms.repord=\"{$srchrepord}\"";
|
||||||
}
|
}
|
||||||
|
// flags doesn't apply to parts
|
||||||
// build the clauses and run the query
|
// build the clauses and run the query
|
||||||
$pfromclause = implode(",", array_unique($pfromtables));
|
$pfromclause = implode(",", array_unique($pfromtables));
|
||||||
$pwhereclause = implode(" and ", $pconstraints);
|
$pwhereclause = implode(" and ", $pconstraints);
|
||||||
|
|||||||
@@ -163,9 +163,9 @@ if ($usertemplateid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// determine original owner of template
|
// determine original owner of template
|
||||||
$orig_owner=dblookup($db, "notetemplates","templateid","tech",$templateid);
|
$orig_owner = dblookup($db, "notetemplates", "templateid", "tech", $templateid);
|
||||||
if ($efftechid != NULL && $efftechid != $orig_owner) {
|
if ($efftechid != NULL && $efftechid != $orig_owner) {
|
||||||
$operation="add";
|
$operation = "add";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($operation == "add") {
|
if ($operation == "add") {
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ then
|
|||||||
else
|
else
|
||||||
# proceed with upgrade
|
# proceed with upgrade
|
||||||
# put app in maintenance mode
|
# put app in maintenance mode
|
||||||
echo "Putting the applocation in maintenance mode..."
|
echo "Putting the application in maintenance mode..."
|
||||||
# make sure mod_rewrite is enabled
|
# make sure mod_rewrite is enabled
|
||||||
if [[ ! -e "$APACHE_CONF_DIR/../mods-enabled/rewrite.load" ]]
|
if [[ ! -e "$APACHE_CONF_DIR/../mods-enabled/rewrite.load" ]]
|
||||||
then
|
then
|
||||||
|
|||||||
Reference in New Issue
Block a user