Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #473

Merged
merged 9 commits into from
Apr 15, 2020
4 changes: 2 additions & 2 deletions constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
);

/* CATS Version */
define('CATS_VERSION', '0.9.4 Countach');
define('CATS_VERSION', '0.9.5.2');

/* Copyright information at bottom of pages. */
define('COPYRIGHT_HTML', '© 2005 - 2007 Cognizo Technologies, Inc.');
define('COPYRIGHT_HTML', '© 2007-2020 OpenCATS.');

/* HTTP response codes. */
define('HTTP_OK', 200);
Expand Down
4 changes: 3 additions & 1 deletion db/upgrade-0.9.4-0.9.5.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ CREATE TABLE `candidate_duplicates` (
PRIMARY KEY (`old_candidate_id`, `new_candidate_id`),
KEY `IDX_old_candidate_id` (`old_candidate_id`),
KEY `IDX_new_candidate_id` (`new_candidate_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `candidate`
MODIFY COLUMN `web_site` varchar(352);
11 changes: 7 additions & 4 deletions lib/DatabaseConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,14 @@ public function getAllAssoc($query = null)

/* Make sure we always return an array. */
$recordSetArray = array();

/* Store all rows in $recordSetArray; */
while (($recordSet = mysqli_fetch_assoc($this->_queryResult)))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use mysqli procedural instead of OOP like ? such as $mysqli->fetch_assoc() ?
Not that it's done by default, but imo, should be done to continue the same "idea" of OOP of the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alexandre433 for your time in reviewing the commits. I may have jumped ahead of the wagon earlier with my comment blindly through the email. Since, many times, I've noticed lack of collaboration on code review and many self-approved merges. It should be mandatory in the project to code review by others. Likewise, lack of unit test updates with newly introduced methods for verification and validation.


if($this->_queryResult)
{
$recordSetArray[] = $recordSet;
/* Store all rows in $recordSetArray; */
while (($recordSet = mysqli_fetch_assoc($this->_queryResult)))
{
$recordSetArray[] = $recordSet;
}
}

/* Return the multi-dimensional record set array. */
Expand Down
6 changes: 3 additions & 3 deletions lib/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ public function send($from, $recipients, $subject, $body, $isHTML = false,

if ($signature)
{
$body .= "\n<br />\n<br /><span style=\"font-size: 10pt;\">Powered by <a href=\"http://www.catsone.com\" alt=\"CATS "
. "Applicant Tracking System\">CATS</a> (Free ATS)</span>";
$body .= "\n<br />\n<br /><span style=\"font-size: 10pt;\">Powered by <a href=\"http://www.opencats.org" alt=\"OpenCATS "
. "Applicant Tracking System\">OpenCATS</a> (Free ATS)</span>";
}

$this->_mailer->Body = '<div style="font: normal normal 12px Arial, Tahoma, sans-serif">'
Expand All @@ -221,7 +221,7 @@ public function send($from, $recipients, $subject, $body, $isHTML = false,
{
if ($signature)
{
$body .= "\n\nPowered by CATS (http://www.catsone.com) Free ATS";
$body .= "\n\nPowered by OpenCATS (http://www.opencats.org) Free ATS";
}

$this->_mailer->isHTML(false);
Expand Down
8 changes: 4 additions & 4 deletions lib/SystemInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function getSystemInfo()
"SELECT
*
FROM
system
`system`
WHERE
system_id = 0"
);
Expand All @@ -76,7 +76,7 @@ public function updateUID($uid)
{
$sql = sprintf(
"UPDATE
system
`system`
SET
uid = '%s'
WHERE
Expand All @@ -96,7 +96,7 @@ public function updateVersionCheckPrefs($enableNewVersionCheck)
{
$sql = sprintf(
"UPDATE
system
`system`
SET
disable_version_check = %s
WHERE
Expand All @@ -118,7 +118,7 @@ public function updateRemoteVersion($version, $newsRelease, $date)
{
$sql = sprintf(
"UPDATE
system
`system`
SET
available_version = '%s',
available_version_description = '%s',
Expand Down
18 changes: 9 additions & 9 deletions lib/TemplateUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -813,22 +813,22 @@ public static function printFooter()
$buildString = '';
}

/* THE MODIFICATION OF THE COPYRIGHT AND 'Powered by CATS' LINES IS NOT ALLOWED
BY THE TERMS OF THE CPL FOR CATS OPEN SOURCE EDITION.
/* THE MODIFICATION OF THE COPYRIGHT AND 'Powered by OpenCATS' LINES IS NOT ALLOWED
BY THE TERMS OF THE CPL FOR OpenCATS OPEN SOURCE EDITION.

II) The following copyright notice must be retained and clearly legible
at the bottom of every rendered HTML document: Copyright (C) 2005 - 2007
Cognizo Technologies, Inc. All rights reserved.
at the bottom of every rendered HTML document: Copyright (C) 2007-2020
OpenCATs All rights reserved.

III) The "Powered by CATS" text or logo must be retained and clearly
III) The "Powered by OpenCATS" text or logo must be retained and clearly
legible on every rendered HTML document. The logo, or the text
"CATS", must be a hyperlink to the CATS Project website, currently
http://www.catsone.com/.
"OpenCATS", must be a hyperlink to the CATS Project website, currently
http://www.opencats.org/.
*/

echo '<div class="footerBlock">', "\n";
echo '<p id="footerText">CATS Version ', CATS_VERSION, $buildString,
'. <span id="toolbarVersion"></span>Powered by <a href="http://www.catsone.com/"><strong>CATS</strong></a>.</p>', "\n";
echo '<p id="footerText">OpenCATS Version ', CATS_VERSION, $buildString,
'. <span id="toolbarVersion"></span>Powered by <a href="http://www.opencats.org/"><strong>OpenCATS</strong></a>.</p>', "\n";
echo '<span id="footerResponse">Server Response Time: ', $loadTime, ' seconds.</span><br />';
echo '<span id="footerCopyright">', COPYRIGHT_HTML, '</span>', "\n";
if (!eval(Hooks::get('TEMPLATEUTILITY_SHOWPRIVACYPOLICY'))) return;
Expand Down
17 changes: 6 additions & 11 deletions lib/artichow/inc/Axis.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,9 @@ public function getLabelNumber() {
*/
public function setLabelPrecision($precision) {
$this->auto(FALSE);
$function = 'axis'.time().'_'.(microtime(true) * 10000);
eval('function '.$function.'($value) {
return sprintf("%.'.(int)$precision.'f", $value);
}');
$this->label->setCallbackFunction($function);
$this->label->setCallbackFunction(function ($value) use ($precision) {
return sprintf('%.' . (int) $precision . 'f', $value);
});
}

/**
Expand All @@ -332,12 +330,9 @@ public function setLabelPrecision($precision) {
public function setLabelText($texts) {
if(is_array($texts)) {
$this->auto(FALSE);
$function = 'axis'.time().'_'.(microtime(true) * 10000);
eval('function '.$function.'($value) {
$texts = '.var_export($texts, TRUE).';
return $texts[$value];
}');
$this->label->setCallbackFunction($function);
$this->label->setCallbackFunction(function ($value) use ($texts) {
return isset($texts[$value]) ? $texts[$value] : '?';
});
}
}

Expand Down
10 changes: 4 additions & 6 deletions lib/artichow/inc/Label.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function count() {
* @param string $function
*/
public function setCallbackFunction($function) {
$this->function = is_null($function) ? $function : (string)$function;
$this->function = $function;
}

/**
Expand All @@ -235,11 +235,9 @@ public function getCallbackFunction() {
* @param string $format New format (printf style: %.2f for example)
*/
public function setFormat($format) {
$function = 'label'.time().'_'.(microtime(true) * 10000);
eval('function '.$function.'($value) {
return sprintf("'.addcslashes($format, '"').'", $value);
}');
$this->setCallbackFunction($function);
$this->setCallbackFunction(function ($value) use ($format) {
return sprintf($format, $value);
});
}

/**
Expand Down
4 changes: 2 additions & 2 deletions modules/careers/Blank.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
</div>
<div style="text-align:center;">

<?php /* WARNING: It is against the terms of the CPL to remove or alter the following line. The 'Powered by CATS' line must stay visible on every page. */ ?>
<?php /* WARNING: It is against the terms of the CPL to remove or alter the following line. The 'Powered by OpenCATS' line must stay visible on every page. */ ?>
<div id="poweredCATS">
<a href="http://www.catsone.com" target="_blank"><img src="../images/CATS-powered.gif" alt="Powered by: CATS - Applicant Tracking System" title="Powered by: CATS - Applicant Tracking System" /></a>
<a href="http://www.opencats.org" target="_blank"><img src="../images/CATS-powered.gif" alt="Powered by: OpenCATS - Applicant Tracking System" title="Powered by: OpenCATS - Applicant Tracking System" /></a>
</div>
</div>
<script type="text/javascript">st_init();</script>
Expand Down
4 changes: 2 additions & 2 deletions modules/careers/Blank2.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
</div>
<div style="text-align:center;">

<?php /* WARNING: It is against the terms of the CPL to remove or alter the following line. The 'Powered by CATS' line must stay visible on every page. */ ?>
<span style="font-size: 9px;">Powered by</span> <a style="color: #888; position: relative; font-size: 9px; font-weight: normal; text-align: center; left: 0px; top: 0px;" href="http://www.catsone.com/" target="_blank">CATS</a>.
<?php /* WARNING: It is against the terms of the CPL to remove or alter the following line. The 'Powered by OpenCATS' line must stay visible on every page. */ ?>
<span style="font-size: 9px;">Powered by</span> <a style="color: #888; position: relative; font-size: 9px; font-weight: normal; text-align: center; left: 0px; top: 0px;" href="http://www.opencats.com" target="_blank">OpenCATS</a>.

</div>
<script type="text/javascript">st_init();</script>
Expand Down
4 changes: 2 additions & 2 deletions modules/careers/BlankNoMargin.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
</div>
<div style="text-align:center;">

<?php /* WARNING: It is against the terms of the CPL to remove or alter the following line. The 'Powered by CATS' line must stay visible on every page. */ ?>
<span style="font-size: 9px;">Powered by</span> <a style="color: #888; position: relative; font-size: 9px; font-weight: normal; text-align: center; left: 0px; top: 0px;" href="http://www.catsone.com/" target="_blank">CATS</a>.
<?php /* WARNING: It is against the terms of the CPL to remove or alter the following line. The 'Powered by OpenCATS' line must stay visible on every page. */ ?>
<span style="font-size: 9px;">Powered by</span> <a style="color: #888; position: relative; font-size: 9px; font-weight: normal; text-align: center; left: 0px; top: 0px;" href="http://www.opencats.org" target="_blank">OpenCATS</a>.

</div>
<script type="text/javascript">st_init();</script>
Expand Down
2 changes: 1 addition & 1 deletion modules/login/Login.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
</div>
<div id="footerBlock">
<span class="footerCopyright"><?php echo(COPYRIGHT_HTML); ?></span>
Based upon original work and Powered by <a href="http://www.catsone.com ">CATS</a>.</div>
Based upon original work and Powered by <a href="http://www.opencats.org" target="_blank">OpenCATS</a>.</div>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions modules/reports/GraphView.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
}
</script>

<p id="footerText" align="center">CATS Version <?php echo(CATSUtility::getVersion()); ?> build <?php echo(CATSUtility::getBuild()); ?>. Powered by <a href="http://www.catsone.com/"><strong>CATS</strong></a>.<br />
<span id="footerCopyright">&copy;2005 - 2007 Cognizo Technologies, Inc. All rights reserved.</span></p>
<p id="footerText" align="center">CATS Version <?php echo(CATSUtility::getVersion()); ?> build <?php echo(CATSUtility::getBuild()); ?>. Powered by <a href="http://www.opencats.org" target="_blank"><strong>OpenCATS</strong></a>.<br />
<span id="footerCopyright">&copy;2007-2020 OpenCATS All rights reserved.</span></p>
</div>
</body>
</html>