* Portions created by the Initial Developer are Copyright (C) 2005 - 2007
 * (or from the year in which this file was created to the year 2007) by
 * Cognizo Technologies, Inc. All Rights Reserved.
 *
 *
 * $Id: setCandidateJobOrderRating.php 1479 2007-01-17 00:22:21Z will $
 */
include_once './lib/Pipelines.php';
$interface = new SecureAJAXInterface();
if ($_SESSION['CATS']->getAccessLevel() < ACCESS_LEVEL_EDIT) {
    $interface->outputXMLErrorPage(-1, ERROR_NO_PERMISSION);
    die;
}
if (!$interface->isRequiredIDValid('candidateJobOrderID')) {
    $interface->outputXMLErrorPage(-1, 'Invalid candidate-joborder ID.');
    die;
}
if (!$interface->isRequiredIDValid('rating', true, true) || $_REQUEST['rating'] < -6 || $_REQUEST['rating'] > 5) {
    $interface->outputXMLErrorPage(-1, 'Invalid rating.');
    die;
}
$siteID = $interface->getSiteID();
$candidateJobOrderID = $_REQUEST['candidateJobOrderID'];
$rating = $_REQUEST['rating'];
$pipelines = new Pipelines($siteID);
$pipelines->updateRatingValue($candidateJobOrderID, $rating);
$newRating = $pipelines->getRatingValue($candidateJobOrderID);
$output = "<data>\n" . "    <errorcode>0</errorcode>\n" . "    <errormessage></errormessage>\n" . "    <newrating>" . $newRating . "</newrating>\n" . "</data>\n";
/* Send back the XML data. */
$interface->outputXMLPage($output);
Example #2
0
        }
    }
}
foreach ($itemsToAdd as $index => $data) {
    if ($data == '') {
        unset($itemsToAdd[$index]);
    } else {
        if (isRequiredValueValid($data) == false) {
            $interface->outputXMLErrorPage(-1, 'Invalid items value.');
            die;
        }
    }
}
$savedLists = new SavedLists($siteID);
/* Write changes. */
foreach ($listsToAdd as $list) {
    $itemsToAddTemp = array();
    foreach ($itemsToAdd as $item) {
        $itemsToAddTemp[] = $item;
        /* Because its too slow adding 1 item at a time, we do it in spurts of 200 items. */
        if (count($itemsToAddTemp) > 200) {
            $savedLists->addEntryMany($list, $dataItemType, $itemsToAddTemp);
            $itemsToAddTemp = array();
        }
    }
    if (count($itemsToAddTemp) > 0) {
        $savedLists->addEntryMany($list, $dataItemType, $itemsToAddTemp);
    }
}
$interface->outputXMLPage("<data>\n" . "    <errorcode>0</errorcode>\n" . "    <errormessage></errormessage>\n" . "    <response>success</response>\n" . "</data>\n");
Example #3
0
$activityHour = trim(urldecode($_REQUEST['hour']));
$activityMinute = trim(urldecode($_REQUEST['minute']));
$activityAMPM = trim(urldecode($_REQUEST['ampm']));
if (!DateUtility::validate('-', $activityDate, DATE_FORMAT_MMDDYY)) {
    die('Invalid availability date.');
    return;
}
/* Convert formatted time to UNIX timestamp. */
$time = strtotime(sprintf('%s:%s %s', $activityHour, $activityMinute, $activityAMPM));
/* Create MySQL date string w/ 24hr time (YYYY-MM-DD HH:MM:SS). */
$date = sprintf('%s %s', DateUtility::convert('-', $activityDate, DATE_FORMAT_MMDDYY, DATE_FORMAT_YYYYMMDD), date('H:i:00', $time));
/* Highlight what needs highlighting. */
if (strpos($activityNote, 'Status change: ') === 0) {
    $pipelines = new Pipelines($siteID);
    $statusRS = $pipelines->getStatusesForPicking();
    foreach ($statusRS as $data) {
        $activityNote = StringUtility::replaceOnce($data['status'], '<span style="color: #ff6c00;">' . $data['status'] . '</span>', $activityNote);
    }
}
/* Save the new activity entry. */
$activityEntries = new ActivityEntries($siteID);
$activityEntries->update($activityID, $type, $activityNote, $jobOrderID, $date, $_SESSION['CATS']->getTimeZoneOffset());
/* Grab the current activity entry. */
$activityEntry = $activityEntries->get($activityID);
/* Send back "(No Notes)" to be displayed if we don't have any. */
if (empty($activityEntry['notes'])) {
    $activityEntry['notes'] = '(No Notes)';
}
/* Send back the XML data. */
$interface->outputXMLPage("<data>\n" . "    <errorcode>0</errorcode>\n" . "    <errormessage></errormessage>\n" . "    <type>" . $activityEntry['type'] . "</type>\n" . "    <typedescription>" . $activityEntry['typeDescription'] . "</typedescription>\n" . "    <notes>" . htmlspecialchars($activityEntry['notes']) . "</notes>\n" . "    <regarding>" . htmlspecialchars($activityEntry['regarding']) . "</regarding>\n" . "    <date>" . htmlspecialchars($activityEntry['dateCreated']) . "</date>\n" . "</data>\n");
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * The Original Code is "CATS Standard Edition".
 *
 * The Initial Developer of the Original Code is Cognizo Technologies, Inc.
 * Portions created by the Initial Developer are Copyright (C) 2005 - 2007
 * (or from the year in which this file was created to the year 2007) by
 * Cognizo Technologies, Inc. All Rights Reserved.
 *
 *
 * $Id: getCompanyLocation.php 2359 2007-04-21 22:49:17Z will $
 */
include_once './lib/Companies.php';
$interface = new SecureAJAXInterface();
if (!$interface->isRequiredIDValid('companyID', false)) {
    $interface->outputXMLErrorPage(-1, 'Invalid company ID.');
    die;
}
$siteID = $interface->getSiteID();
$companyID = $_REQUEST['companyID'];
/* Get an array of the company's location data. */
$companies = new Companies($siteID);
$locationArray = $companies->getLocationArray($companyID);
if (empty($locationArray)) {
    $interface->outputXMLErrorPage(-2, 'No location data.');
    die;
}
/* Send back the XML data. */
$interface->outputXMLPage("<data>\n" . "    <errorcode>0</errorcode>\n" . "    <errormessage></errormessage>\n" . "    <address>" . $locationArray['address'] . "</address>\n" . "    <city>" . $locationArray['city'] . "</city>\n" . "    <state>" . $locationArray['state'] . "</state>\n" . "    <zip>" . $locationArray['zip'] . "</zip>\n" . "</data>\n");
 * under the License.
 *
 * The Original Code is "CATS Standard Edition".
 *
 * The Initial Developer of the Original Code is Cognizo Technologies, Inc.
 * Portions created by the Initial Developer are Copyright (C) 2005 - 2007
 * (or from the year in which this file was created to the year 2007) by
 * Cognizo Technologies, Inc. All Rights Reserved.
 *
 *
 * $Id: getCandidateJobOrderID.php 1479 2007-01-17 00:22:21Z will $
 */
include_once './lib/Pipelines.php';
$interface = new SecureAJAXInterface();
if (!$interface->isRequiredIDValid('candidateID', false)) {
    $interface->outputXMLErrorPage(-1, 'Invalid candidate ID.');
    die;
}
if (!$interface->isRequiredIDValid('jobOrderID', false)) {
    $interface->outputXMLErrorPage(-1, 'Invalid job order ID.');
    die;
}
$siteID = $interface->getSiteID();
$candidateID = $_REQUEST['candidateID'];
$jobOrderID = $_REQUEST['jobOrderID'];
/* Get the candidate-joborder ID. */
$pipelines = new Pipelines($siteID);
$candidateJobOrderID = $pipelines->getCandidateJobOrderID($candidateID, $jobOrderID);
/* Send back the XML data. */
$interface->outputXMLPage("<data>\n" . "    <errorcode>0</errorcode>\n" . "    <errormessage></errormessage>\n" . "    <id>" . $candidateJobOrderID . "</id>\n" . "</data>\n");
Example #6
0
 *
 * $Id: editListName.php 3198 2007-10-14 23:36:43Z will $
 */
include_once './lib/StringUtility.php';
include_once './lib/ActivityEntries.php';
include_once './lib/SavedLists.php';
$interface = new SecureAJAXInterface();
if (!$interface->isRequiredIDValid('savedListID')) {
    $interface->outputXMLErrorPage(-1, 'Invalid saved list ID.');
    die;
}
if (!isset($_REQUEST['savedListName'])) {
    $interface->outputXMLErrorPage(-1, 'Invalid name.');
    die;
}
$siteID = $interface->getSiteID();
$savedListID = $_REQUEST['savedListID'];
$savedListName = $_REQUEST['savedListName'];
$savedLists = new SavedLists($siteID);
/* Validate the lists - if name is in use or name is blank, fail. */
if ($savedLists->getIDByDescription($savedListName) != -1 && $savedLists->getIDByDescription($savedListName) != $savedListID) {
    $interface->outputXMLPage("<data>\n" . "    <errorcode>0</errorcode>\n" . "    <errormessage></errormessage>\n" . "    <response>collision</response>\n" . "</data>\n");
    die;
}
if ($savedListName == '') {
    $interface->outputXMLPage("<data>\n" . "    <errorcode>0</errorcode>\n" . "    <errormessage></errormessage>\n" . "    <response>badName</response>\n" . "</data>\n");
    die;
}
/* Write changes. */
$savedLists->updateListName($savedListID, $savedListName);
$interface->outputXMLPage("<data>\n" . "    <errorcode>0</errorcode>\n" . "    <errormessage></errormessage>\n" . "    <response>success</response>\n" . "</data>\n");