Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ajax/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/*
* Shared bootstrap for directly requested AJAX endpoint scripts.
*/

$rootDirectory = dirname(__DIR__);

if (!defined('LEGACY_ROOT'))
{
define('LEGACY_ROOT', $rootDirectory);
}

include_once($rootDirectory . '/config.php');
include_once(LEGACY_ROOT . '/constants.php');
include_once(LEGACY_ROOT . '/lib/DatabaseConnection.php');
include_once(LEGACY_ROOT . '/lib/Session.php');
include_once(LEGACY_ROOT . '/lib/AJAXInterface.php');

?>
2 changes: 2 additions & 0 deletions ajax/deleteActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: deleteActivity.php 1479 2007-01-17 00:22:21Z will $
*/

include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/ActivityEntries.php');


Expand Down
2 changes: 2 additions & 0 deletions ajax/editActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: editActivity.php 2883 2007-08-14 15:25:26Z brian $
*/

include_once(__DIR__ . '/bootstrap.php');


include_once(LEGACY_ROOT . '/lib/ActivityEntries.php');

Expand Down
2 changes: 2 additions & 0 deletions ajax/getCandidateIdByEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: getCandidateIdByEmail.php 3078 2007-09-21 20:25:28Z will $
*/

include_once(__DIR__ . '/bootstrap.php');

$interface = new SecureAJAXInterface();

include (LEGACY_ROOT . '/lib/Candidates.php');
Expand Down
2 changes: 2 additions & 0 deletions ajax/getCandidateIdByPhone.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: getCandidateIdByPhone.php 3078 2007-09-21 20:25:28Z will $
*/

include_once(__DIR__ . '/bootstrap.php');

$interface = new SecureAJAXInterface();

include (LEGACY_ROOT . '/lib/Candidates.php');
Expand Down
2 changes: 2 additions & 0 deletions ajax/getCompanyContacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: getCompanyContacts.php 1892 2007-02-20 06:44:04Z will $
*/

include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/Companies.php');


Expand Down
2 changes: 2 additions & 0 deletions ajax/getCompanyLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: getCompanyLocation.php 2359 2007-04-21 22:49:17Z will $
*/

include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/Companies.php');


Expand Down
2 changes: 2 additions & 0 deletions ajax/getCompanyLocationAndDepartments.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: getCompanyLocationAndDepartments.php 2359 2007-04-21 22:49:17Z will $
*/

include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/Companies.php');


Expand Down
2 changes: 2 additions & 0 deletions ajax/getCompanyNames.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: getCompanyNames.php 2367 2007-04-23 23:24:05Z will $
*/

include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/Companies.php');
include_once(LEGACY_ROOT . '/lib/Search.php');

Expand Down
2 changes: 2 additions & 0 deletions ajax/getDataGridPager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: getDataGridPager.php 3078 2007-09-21 20:25:28Z will $
*/

include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/CATSUtility.php');
include_once(LEGACY_ROOT . '/lib/TemplateUtility.php');
include_once(LEGACY_ROOT . '/lib/DataGrid.php');
Expand Down
2 changes: 2 additions & 0 deletions ajax/getDataItemJobOrders.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: getDataItemJobOrders.php 1892 2007-02-20 06:44:04Z will $
*/

include_once(__DIR__ . '/bootstrap.php');

$interface = new SecureAJAXInterface();

if (!$interface->isRequiredIDValid('dataItemID'))
Expand Down
2 changes: 2 additions & 0 deletions ajax/getParsedAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: getParsedAddress.php 2492 2007-05-25 21:12:47Z will $
*/

include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/StringUtility.php');
include_once(LEGACY_ROOT . '/lib/AddressParser.php');
include_once(LEGACY_ROOT . '/lib/ResultSetUtility.php');
Expand Down
2 changes: 2 additions & 0 deletions ajax/getPipelineDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: getPipelineDetails.php 2976 2007-08-30 18:18:48Z andrew $
*/

include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/Pipelines.php');


Expand Down
2 changes: 2 additions & 0 deletions ajax/getPipelineJobOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: getPipelineJobOrder.php 3814 2007-12-06 17:54:28Z brian $
*/

include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/Pipelines.php');
include_once(LEGACY_ROOT . '/lib/TemplateUtility.php');
include_once(LEGACY_ROOT . '/lib/StringUtility.php');
Expand Down
10 changes: 6 additions & 4 deletions ajax/replaceTemplateTags.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
include_once('./lib/EmailTemplates.php');
include_once('./lib/DateUtility.php');
include_once('./lib/Candidates.php');
include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/EmailTemplates.php');
include_once(LEGACY_ROOT . '/lib/DateUtility.php');
include_once(LEGACY_ROOT . '/lib/Candidates.php');

$interface = new SecureAJAXInterface();

Expand Down Expand Up @@ -53,4 +55,4 @@
"</data>\n"
);

?>
?>
2 changes: 2 additions & 0 deletions ajax/setCandidateJobOrderRating.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: setCandidateJobOrderRating.php 1479 2007-01-17 00:22:21Z will $
*/

include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/Pipelines.php');


Expand Down
2 changes: 2 additions & 0 deletions ajax/setColumnWidth.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: setColumnWidth.php 2373 2007-04-24 21:57:28Z will $
*/

include_once(__DIR__ . '/bootstrap.php');

$interface = new SecureAJAXInterface();

if ($_SERVER['REQUEST_METHOD'] !== 'POST')
Expand Down
8 changes: 5 additions & 3 deletions ajax/showTemplate.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
include_once('./lib/EmailTemplates.php');
include_once('./lib/DateUtility.php');
include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/EmailTemplates.php');
include_once(LEGACY_ROOT . '/lib/DateUtility.php');

$interface = new SecureAJAXInterface();

Expand Down Expand Up @@ -33,4 +35,4 @@
"</data>\n"
);

?>
?>
2 changes: 2 additions & 0 deletions ajax/testEmailSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: testEmailSettings.php 2101 2007-03-06 00:20:17Z brian $
*/

include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/Mailer.php');


Expand Down
2 changes: 2 additions & 0 deletions ajax/zipLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* OpenCATS
* AJAX Street/City/State lookup via Zip Interface
*/
include_once(__DIR__ . '/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/ZipLookup.php');
include_once(LEGACY_ROOT . '/lib/StringUtility.php');

Expand Down
2 changes: 1 addition & 1 deletion lib/ACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @copyright (C) OpenCats
*/

include_once("./config.php");
include_once(LEGACY_ROOT . '/config.php');

class ACL
{
Expand Down
2 changes: 1 addition & 1 deletion lib/CATSUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/

// FIXME: Why is this being reincluded here?
include_once('./config.php');
include_once(LEGACY_ROOT . '/config.php');
include_once(LEGACY_ROOT . '/lib/FileUtility.php');

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Companies.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
include_once('./vendor/autoload.php');
include_once(LEGACY_ROOT . '/vendor/autoload.php');
use OpenCATS\Entity\Company;
use OpenCATS\Entity\CompanyRepository;

Expand Down
2 changes: 1 addition & 1 deletion lib/JobOrders.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
include_once('./vendor/autoload.php');
include_once(LEGACY_ROOT . '/vendor/autoload.php');

use OpenCATS\Entity\JobOrder;
use OpenCATS\Entity\JobOrderRepository;
Expand Down
2 changes: 1 addition & 1 deletion lib/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
use PHPMailer\PHPMailer\Exception;

// Load Composer's autoloader
require './vendor/autoload.php';
require LEGACY_ROOT . '/vendor/autoload.php';

// FIXME: Remove this dependency! Bad bad bad!
include_once(LEGACY_ROOT . '/lib/Pipelines.php');
Expand Down
2 changes: 1 addition & 1 deletion lib/TemplateUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @version $Id: TemplateUtility.php 3835 2007-12-12 19:08:38Z brian $
*/

include_once('./vendor/autoload.php');
include_once(LEGACY_ROOT . '/vendor/autoload.php');
include_once(LEGACY_ROOT . '/lib/Candidates.php');
include_once(LEGACY_ROOT . '/lib/DateUtility.php');
include_once(LEGACY_ROOT . '/lib/SystemInfo.php');
Expand Down
2 changes: 1 addition & 1 deletion modules/candidates/Show.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php /* $Id: Show.tpl 3814 2007-12-06 17:54:28Z brian $ */
include_once('./vendor/autoload.php');
include_once(LEGACY_ROOT . '/vendor/autoload.php');
use OpenCATS\UI\CandidateQuickActionMenu;
use OpenCATS\UI\CandidateDuplicateQuickActionMenu;
?>
Expand Down
2 changes: 1 addition & 1 deletion modules/companies/Show.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php /* $Id: Show.tpl 3582 2007-11-12 22:58:48Z brian $ */
include_once('./vendor/autoload.php');
include_once(LEGACY_ROOT . '/vendor/autoload.php');
use OpenCATS\UI\QuickActionMenu;
?>
<?php TemplateUtility::printHeader('Company - ' . $this->data['name'], array( 'js/activity.js', 'js/sorttable.js', 'js/attachment.js')); ?>
Expand Down
2 changes: 1 addition & 1 deletion modules/contacts/Show.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php /* $Id: Show.tpl 3444 2007-11-06 23:16:27Z will $
*/
include_once('./vendor/autoload.php');
include_once(LEGACY_ROOT . '/vendor/autoload.php');
use OpenCATS\UI\QuickActionMenu;
?>
<?php TemplateUtility::printHeader('Contact - ' . $this->data['firstName'] . ' ' . $this->data['lastName'], array( 'js/activity.js', 'js/attachment.js')); ?>
Expand Down
2 changes: 2 additions & 0 deletions modules/import/ajax/processMassImportItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: processMassImportItem.php 2359 2007-04-21 22:49:17Z will $
*/

include_once(dirname(__DIR__, 3) . '/ajax/bootstrap.php');


include_once(LEGACY_ROOT . '/lib/Attachments.php');

Expand Down
4 changes: 3 additions & 1 deletion modules/install/ajax/attachmentsReindex.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*
*/

include_once(dirname(__DIR__, 3) . '/ajax/bootstrap.php');

if ($_SERVER['REQUEST_METHOD'] !== 'POST')
{
header('Content-Type: text/html; charset=UTF-8');
Expand All @@ -43,7 +45,7 @@
die();
}

include_once('./config.php');
include_once(LEGACY_ROOT . '/config.php');
include_once(LEGACY_ROOT . '/lib/DatabaseConnection.php');
include_once(LEGACY_ROOT . '/lib/ModuleUtility.php');

Expand Down
4 changes: 3 additions & 1 deletion modules/install/ajax/attachmentsToThreeDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: attachmentsToThreeDirectory.php 2336 2007-04-14 22:01:51Z will $
*/

include_once(dirname(__DIR__, 3) . '/ajax/bootstrap.php');

if ($_SERVER['REQUEST_METHOD'] !== 'POST')
{
header('Content-Type: text/html; charset=UTF-8');
Expand All @@ -45,7 +47,7 @@
die();
}

include_once('./config.php');
include_once(LEGACY_ROOT . '/config.php');
include_once(LEGACY_ROOT . '/lib/DatabaseConnection.php');

$interface = new SecureAJAXInterface();
Expand Down
4 changes: 3 additions & 1 deletion modules/install/ajax/ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
* $Id: ui.php 3807 2007-12-05 01:47:41Z will $
*/

include_once('./config.php');
include_once(dirname(__DIR__, 3) . '/ajax/bootstrap.php');

include_once(LEGACY_ROOT . '/config.php');
include_once(LEGACY_ROOT . '/lib/InstallationTests.php');
include_once(LEGACY_ROOT . '/lib/CATSUtility.php');

Expand Down
2 changes: 1 addition & 1 deletion modules/joborders/Show.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php /* $Id: Show.tpl 3814 2007-12-06 17:54:28Z brian $ */
include_once('./vendor/autoload.php');
include_once(LEGACY_ROOT . '/vendor/autoload.php');
use OpenCATS\UI\QuickActionMenu;
?>
<?php if ($this->isPopup): ?>
Expand Down
2 changes: 2 additions & 0 deletions modules/lists/ajax/addToLists.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: addToLists.php 3198 2007-10-14 23:36:43Z will $
*/

include_once(dirname(__DIR__, 3) . '/ajax/bootstrap.php');

include_once(LEGACY_ROOT . '/lib/StringUtility.php');
include_once(LEGACY_ROOT . '/lib/ActivityEntries.php');
include_once(LEGACY_ROOT . '/lib/SavedLists.php');
Expand Down
2 changes: 2 additions & 0 deletions modules/lists/ajax/deleteList.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: deleteList.php 3198 2007-10-14 23:36:43Z will $
*/

include_once(dirname(__DIR__, 3) . '/ajax/bootstrap.php');


include_once(LEGACY_ROOT . '/lib/StringUtility.php');
include_once(LEGACY_ROOT . '/lib/ActivityEntries.php');
Expand Down
2 changes: 2 additions & 0 deletions modules/lists/ajax/editListName.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: editListName.php 3198 2007-10-14 23:36:43Z will $
*/

include_once(dirname(__DIR__, 3) . '/ajax/bootstrap.php');


include_once(LEGACY_ROOT . '/lib/StringUtility.php');
include_once(LEGACY_ROOT . '/lib/ActivityEntries.php');
Expand Down
2 changes: 2 additions & 0 deletions modules/lists/ajax/newList.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: newList.php 3198 2007-10-14 23:36:43Z will $
*/

include_once(dirname(__DIR__, 3) . '/ajax/bootstrap.php');


include_once(LEGACY_ROOT . '/lib/StringUtility.php');
include_once(LEGACY_ROOT . '/lib/ActivityEntries.php');
Expand Down
2 changes: 2 additions & 0 deletions modules/settings/ajax/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* $Id: backup.php 3402 2007-11-02 22:03:43Z brian $
*/

include_once(dirname(__DIR__, 3) . '/ajax/bootstrap.php');

@ini_set('memory_limit', '512M');

include_once(LEGACY_ROOT . '/lib/Attachments.php');
Expand Down
Loading