Example #1
0
 public function graph($area)
 {
     $lines = array(array(), array());
     switch ($area) {
         case 'responses':
             // Selected range..
             $from = $this->datetime->mswDatePickerFormat($this->range[0]);
             $to = $this->datetime->mswDatePickerFormat($this->range[1]);
             $lines[0] = graphs::responses($from, $to);
             // Selected range - 1 Year earlier..
             $from = date('Y-m-d', strtotime('-1 year', strtotime($from)));
             $to = date('Y-m-d', strtotime('-1 year', strtotime($to)));
             $lines[1] = graphs::responses($from, $to);
             break;
     }
     return array($lines[0], $lines[1]);
 }
Example #2
0
<?php

if (!defined('PARENT')) {
    exit;
}
$g_config = array('default' => $MSTEAM->defDays, 'color1' => '#c8c8cb', 'color2' => '#5f6d88', 'bg' => '#fdfdfd', 'gline' => '#dddddd', 'border' => '#dddddd');
include PATH . 'control/classes/class.graphs.php';
$tz = $MSTEAM->timezone ? $MSTEAM->timezone : $SETTINGS->timezone;
$from = isset($_GET['f']) && $_GET['f'] && $MSDT->mswDatePickerFormat($_GET['f']) != '0000-00-00' ? $_GET['f'] : $MSDT->mswConvertMySQLDate(date('Y-m-d', strtotime('-' . $g_config['default'] . ' days', $MSDT->mswTimeStamp())));
$to = isset($_GET['t']) && $_GET['t'] && $MSDT->mswDatePickerFormat($_GET['t']) != '0000-00-00' ? $_GET['t'] : $MSDT->mswConvertMySQLDate(date('Y-m-d', $MSDT->mswTimeStamp()));
$graph = new graphs();
$graph->settings = $SETTINGS;
$graph->datetime = $MSDT;
$graph->team = $MSTEAM;
$data = $graph->home($from, $to, $ticketFilterAccess);
$g_tick = isset($data[0]) && $data[0] != 'none' ? implode(',', $data[0]) : '';
$g_disp = isset($data[1]) && $data[1] != 'none' ? implode(',', $data[1]) : '';
?>
<div class="content">
  <script type="text/javascript">
  //<![CDATA[
  <?php 
include PATH . 'templates/date-pickers.php';
?>
  function ms_changeDateRange() {
    var fm = jQuery('input[name="from"]').val();
	var to = jQuery('input[name="to"]').val();
	var dd = jQuery('input[name="def"]').val();
	if (dd=='') {
	  if (fm=='') {
	    jQuery('input[name="from"]').focus();
Example #3
0
<?php

if (!defined('PARENT')) {
    exit;
}
$_GET['id'] = (int) $_GET['id'];
$USER = mswGetTableData('users', 'id', $_GET['id']);
checkIsValid($USER);
// For graphs..
$dateRange = '-6 months';
$colors = array('#c8c8cb', '#65718a');
$from = isset($_GET['from']) && $MSDT->mswDatePickerFormat($_GET['from']) != '0000-00-00' ? $_GET['from'] : $MSDT->mswConvertMySQLDate(date('Y-m-d', strtotime($dateRange, $MSDT->mswTimeStamp())));
$to = isset($_GET['to']) && $MSDT->mswDatePickerFormat($_GET['to']) != '0000-00-00' ? $_GET['to'] : $MSDT->mswConvertMySQLDate(date('Y-m-d', $MSDT->mswTimeStamp()));
include PATH . 'control/classes/class.graphs.php';
$MSGRAPH = new graphs();
$MSGRAPH->settings = $SETTINGS;
$MSGRAPH->datetime = $MSDT;
$MSGRAPH->range = array($from, $to);
$buildGraph = $MSGRAPH->graph('responses');
?>
<div class="content">
  <script type="text/javascript">
  //<![CDATA[
  <?php 
include PATH . 'templates/date-pickers.php';
?>
  function searchToggle() {
    jQuery('#b1').toggle();
	if (jQuery('#b1').css('display')!='none') {
	  jQuery('input[name="q"]').focus();
      jQuery('#search-icon-button').attr('class','icon-remove');
Example #4
0
 private function show()
 {
     /* Is this a popup? */
     if (isset($_GET['display']) && $_GET['display'] == 'popup') {
         $isPopup = true;
     } else {
         $isPopup = false;
     }
     /* Bail out if we don't have a valid candidate ID. */
     if (!$this->isRequiredIDValid('jobOrderID', $_GET)) {
         /* FIXME: fatalPopup()? */
         CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid job order ID.');
     }
     $jobOrderID = $_GET['jobOrderID'];
     $jobOrders = new JobOrders($this->_siteID);
     $data = $jobOrders->get($jobOrderID);
     /* Bail out if we got an empty result set. */
     if (empty($data)) {
         CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'The specified job order ID could not be found.');
     }
     if ($data['isAdminHidden'] == 1 && $this->_accessLevel < ACCESS_LEVEL_MULTI_SA) {
         $this->listByView('This Job Order is hidden - only a CATS Administrator can unlock the Job Order.');
         return;
     }
     /* We want to handle formatting the city and state here instead of in
      * the template.
      */
     $data['cityAndState'] = StringUtility::makeCityStateString($data['city'], $data['state']);
     $data['description'] = trim($data['description']);
     $data['notes'] = trim($data['notes']);
     /* Determine the Job Type Description */
     $data['typeDescription'] = $jobOrders->typeCodeToString($data['type']);
     /* Convert '00-00-00' dates to empty strings. */
     $data['startDate'] = DateUtility::fixZeroDate($data['startDate']);
     /* Hot jobs [can] have different title styles than normal jobs. */
     if ($data['isHot'] == 1) {
         $data['titleClass'] = 'jobTitleHot';
     } else {
         $data['titleClass'] = 'jobTitleCold';
     }
     if ($data['public'] == 1) {
         $data['public'] = '<img src="images/public.gif" height="16" ' . 'width="16" title="This Job Order is marked as Public." />';
     } else {
         $data['public'] = '';
     }
     $attachments = new Attachments($this->_siteID);
     $attachmentsRS = $attachments->getAll(DATA_ITEM_JOBORDER, $jobOrderID);
     foreach ($attachmentsRS as $rowNumber => $attachmentsData) {
         /* Show an attachment icon based on the document's file type. */
         $attachmentIcon = strtolower(FileUtility::getAttachmentIcon($attachmentsRS[$rowNumber]['originalFilename']));
         $attachmentsRS[$rowNumber]['attachmentIcon'] = $attachmentIcon;
     }
     $careerPortalSettings = new CareerPortalSettings($this->_siteID);
     $careerPortalSettingsRS = $careerPortalSettings->getAll();
     if ($careerPortalSettingsRS['enabled'] == 1) {
         $careerPortalEnabled = true;
     } else {
         $careerPortalEnabled = false;
     }
     /* Add an MRU entry. */
     $_SESSION['CATS']->getMRU()->addEntry(DATA_ITEM_JOBORDER, $jobOrderID, $data['title']);
     if ($this->_accessLevel < ACCESS_LEVEL_DEMO) {
         $privledgedUser = false;
     } else {
         $privledgedUser = true;
     }
     /* Get extra fields. */
     $extraFieldRS = $jobOrders->extraFields->getValuesForShow($jobOrderID);
     $pipelineEntriesPerPage = $_SESSION['CATS']->getPipelineEntriesPerPage();
     $sessionCookie = $_SESSION['CATS']->getCookie();
     /* Get pipeline graph. */
     $graphs = new graphs();
     $pipelineGraph = $graphs->miniJobOrderPipeline(450, 250, array($jobOrderID));
     /* Get questionnaire information (if exists) */
     $questionnaireID = false;
     $questionnaireData = false;
     $careerPortalURL = false;
     $isPublic = false;
     if ($careerPortalEnabled && $data['public']) {
         $isPublic = true;
         if ($data['questionnaireID']) {
             $questionnaire = new Questionnaire($this->_siteID);
             $q = $questionnaire->get($data['questionnaireID']);
             if (is_array($q) && !empty($q)) {
                 $questionnaireID = $q['questionnaireID'];
                 $questionnaireData = $q;
             }
         }
     }
     $careerPortalSettings = new CareerPortalSettings($this->_siteID);
     $cpSettings = $careerPortalSettings->getAll();
     if (intval($cpSettings['enabled'])) {
         $careerPortalURL = CATSUtility::getAbsoluteURI() . 'careers/';
     }
     $this->_template->assign('active', $this);
     $this->_template->assign('isPublic', $isPublic);
     $this->_template->assign('questionnaireID', $questionnaireID);
     $this->_template->assign('questionnaireData', $questionnaireData);
     $this->_template->assign('careerPortalURL', $careerPortalURL);
     $this->_template->assign('data', $data);
     $this->_template->assign('extraFieldRS', $extraFieldRS);
     $this->_template->assign('attachmentsRS', $attachmentsRS);
     $this->_template->assign('pipelineEntriesPerPage', $pipelineEntriesPerPage);
     $this->_template->assign('pipelineGraph', $pipelineGraph);
     $this->_template->assign('jobOrderID', $jobOrderID);
     $this->_template->assign('isPopup', $isPopup);
     $this->_template->assign('careerPortalEnabled', $careerPortalEnabled);
     $this->_template->assign('privledgedUser', $privledgedUser);
     $this->_template->assign('sessionCookie', $_SESSION['CATS']->getCookie());
     if (!eval(Hooks::get('JO_SHOW'))) {
         return;
     }
     $this->_template->display('./modules/joborders/Show.tpl');
 }
Example #5
0
        $res = $db_object->get_single_column($sql);
        if (count($res) > 0) {
            $fam = @implode(",", $res);
            $family_ids = "(" . $fam . ")";
            $sql = "select {$model_factors_1}.model_id,model_name,family from {$model_name_table},{$model_factors_1} where \n\t\t\t\n\t\t\t{$model_name_table}.model_id={$model_factors_1}.model_id and family in {$family_ids}";
            $sql_res = $db_object->get_rsltset($sql);
            preg_match("/<{model_loopstart}>(.*?)<{model_loopend}>/s", $file, $match);
            $match = $match[0];
            for ($j = 0; $j < count($sql_res); $j++) {
                $model_id = $sql_res[$j][model_id];
                $model_name = $sql_res[$j][model_name];
                $str .= preg_replace("/<{(.*?)}>/e", "\$\$1", $match);
            }
            $file = preg_replace("/<{model_loopstart}>(.*?)<{model_loopend}>/s", $str, $file);
        }
        $file = $common->direct_replace($db_object, $file, $xArray);
        echo $file;
    }
}
$obj = new graphs();
switch ($fAs) {
    case "3":
        $obj->admin($db_object, $common, $user_id);
        break;
    case "2":
        $obj->boss($db_object, $common, $user_id);
        break;
    case "1":
        $obj->employee($db_object, $common, $user_id);
        break;
}
Example #6
0
    public function show()
    {
        /* Bail out if we don't have a valid candidate ID. */
        if (!$this->isRequiredIDValid('jobOrderID', $_GET))
        {
            /* FIXME: fatalPopup()? */
            CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid job order ID.');
        }

        $jobOrderID = $_GET['jobOrderID'];


        $jobOrders = new JobOrders($this->_siteID);
        $data = $jobOrders->get($jobOrderID);

        /* Bail out if we got an empty result set. */
        if (empty($data))
        {
            CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'The specified job order ID could not be found.');
        }

        if ($data['is_admin_hidden'] == 1 && $this->_accessLevel < ACCESS_LEVEL_MULTI_SA)
        {
            $this->listByView('This Job Order is hidden - only a CATS Administrator can unlock the Job Order.');
            return;
        }

        /* We want to handle formatting the city and state here instead of in
         * the template.
         */
        $data['cityAndState'] = StringUtility::makeCityStateString(
            $data['city'], $data['state']
        );
        /**
         * if ownertype is group, override the user full name
         */
        if($data['ownertype']>0)
        {
            $sql="select * from auieo_groups where id={$data['owner']}";
            $objDB=DatabaseConnection::getInstance();
            $row=$objDB->getAssoc($sql);
            if($row)
            {
                $data["ownerFullName"]=$row["groupname"];
            }
        }

        $data['description'] = trim($data['description']);
        $data['notes'] = trim($data['notes']);

        /* Determine the Job Type Description */
        $data['typeDescription'] = $jobOrders->typeCodeToString($data['type']);

        /* Convert '00-00-00' dates to empty strings. */
        $data['startDate'] = DateUtility::fixZeroDate(
            $data['startDate']
        );

        /* Hot jobs [can] have different title styles than normal jobs. */
        if ($data['is_hot'] == 1)
        {
            $data['titleClass'] = 'jobTitleHot';
        }
        else
        {
            $data['titleClass'] = 'jobTitleCold';
        }

        if ($data['public'] == 1)
        {
            $data['public'] = '<img src="images/public.gif" height="16" '
                . 'width="16" title="This Job Order is marked as Public." />';
        }
        else
        {
            $data['public'] = '';
        }

        $attachments = new Attachments($this->_siteID);
        $attachmentsRS = $attachments->getAll(
            DATA_ITEM_JOBORDER, $jobOrderID
        );

        foreach ($attachmentsRS as $rowNumber => $attachmentsData)
        {
            /* Show an attachment icon based on the document's file type. */
            $attachmentIcon = strtolower(
                FileUtility::getAttachmentIcon(
                    $attachmentsRS[$rowNumber]['originalFilename']
                )
            );

            $attachmentsRS[$rowNumber]['attachmentIcon'] = $attachmentIcon;
        }

        $careerPortalSettings = new CareerPortalSettings($this->_siteID);
        $careerPortalSettingsRS = $careerPortalSettings->getAll();

        if ($careerPortalSettingsRS['enabled'] == 1)
        {
            $careerPortalEnabled = true;
        }
        else
        {
            $careerPortalEnabled = false;
        }

        /* Add an MRU entry. */
        $_SESSION['CATS']->getMRU()->addEntry(
            DATA_ITEM_JOBORDER, $jobOrderID, $data['title']
        );

        if ($this->_accessLevel < ACCESS_LEVEL_DEMO)
        {
            $privledgedUser = false;
        }
        else
        {
            $privledgedUser = true;
        }

        /* Get extra fields. */
        $extraFieldRS = $jobOrders->extraFields->getValuesForShow($jobOrderID);

        $pipelineEntriesPerPage = $_SESSION['CATS']->getPipelineEntriesPerPage();

        $sessionCookie = $_SESSION['CATS']->getCookie();

        /* Get pipeline graph. */
        $graphs = new graphs();
        $pipelineGraph = $graphs->miniJobOrderPipeline(450, 250, array($jobOrderID));

        /* Get questionnaire information (if exists) */
        $questionnaireID = false;
        $questionnaireData = false;
        $careerPortalURL = false;
        $isPublic = false;



        if ($careerPortalEnabled && $data['public'])
        {
            $isPublic = true;
            if ($data['questionnaire_id'])
            {
                $questionnaire = new Questionnaire($this->_siteID);
                $q = $questionnaire->get($data['questionnaire_id']);
                if (is_array($q) && !empty($q))
                {
                    $questionnaireID = $q['questionnaireID'];
                    $questionnaireData = $q;
                }
            }
        }

        $careerPortalSettings = new CareerPortalSettings($this->_siteID);
        $cpSettings = $careerPortalSettings->getAll();
        if (intval($cpSettings['enabled']))
        {
            $careerPortalURL = CATSUtility::getAbsoluteURI() . 'careers/';
        }

        //$sql="select * from auieo_fields where site_id={$this->_siteID} and tablename='joborder' and presence!=1";
        //$db=DatabaseConnection::getInstance();
        //$arrAssoc=$db->getAllAssoc($sql);
        
        $adminHidden="";
        if ($data['is_admin_hidden'] == 1)
        {
            $adminHidden = "<p class='warning'>This Job Order is hidden.  Only CATS Administrators can view it or search for it.  To make it visible by the site users, click <a href='index.php?m=joborders&amp;a=administrativeHideShow&amp;jobOrderID={$jobOrderID}&amp;state=0' style='font-weight:bold;'>Here.</a></p>";
        }
        
        $strFrozen="";
        if (isset($frozen))
        {
            $strFrozen = "<table style='font-weight:bold; border: 1px solid #000; background-color: #ffed1a; padding:5px; margin-bottom:7px;' width='100%' id='candidateAlreadyInSystemTable'>
                <tr>
                    <td class='tdVertical' style='width:100%;'>
                        This Job Order is {$this->data['status']} and can not be modified.
                       ";
            if ($this->accessLevel >= ACCESS_LEVEL_EDIT)
            {
                $strFrozen = $strFrozen . "
                           <a id='edit_link' href='index.php?m=joborders&amp;a=edit&amp;jobOrderID={$this->jobOrderID}'>
                               <img src='images/actions/edit.gif' width='16' height='16' class='absmiddle' alt='edit' border='0' />&nbsp;Edit
                           </a>
                           the Job Order to make it Active.&nbsp;&nbsp;
                       ";
            } 
            $strFrozen = $strFrozen . "
                    </td>
                </tr>
            </table>
        ";
        }
        $public="";
        if ($isPublic)
        {
            $public = "<div style='background-color: #E6EEFE; padding: 10px; margin: 5px 0 12px 0; border: 1px solid #728CC8;'>
            <b>This job order is public";
            if ($careerPortalURL === false)
            {
                $public = $public . ".</b>";
            }
            else
            {
                $public = $public . "
                and will be shown on your
                ";
                if ($_SESSION['CATS']->getAccessLevel() >= ACCESS_LEVEL_SA){ 
                    $public = $public . "
                    <a style='font-weight: bold;' href='{$careerPortalURL}'>Careers Website</a>.
                ";
                }
                else
                {
                    $public = $public . "
                    Careers Website.
                ";
                } 
                $public = $public . "</b>
            ";
            } 
            if ($questionnaireID !== false)
            {
                $public = $public . "<br />Applicants must complete the '<i>{$questionnaireData['title']}</i>' (<a href='index.php?m=settings&a=careerPortalQuestionnaire&questionnaireID={$questionnaireID}'>edit</a>) questionnaire when applying.";
            }
            else
            {
                $public = $public . "<br />You have not attached any ";
                if ($_SESSION['CATS']->getAccessLevel() >= ACCESS_LEVEL_SA)
                {
                    $public = $public . "<a href='index.php?m=settings&a=careerPortalSettings'>Questionnaires</a>.";
                }
                else
                {
                    $public = $public . "Questionnaires.";
                }
            }
            $public = $public . "</div>";
        }
        
        $ACCESS_LEVEL_EDIT_BUTTON="";
        if ($this->_accessLevel >= ACCESS_LEVEL_EDIT)
        { 
            $ACCESS_LEVEL_EDIT_BUTTON = "<a id='edit_link' href='index.php?m=joborders&amp;a=edit&amp;jobOrderID={$jobOrderID}'>
                <img src='images/actions/edit.gif' width='16' height='16' class='absmiddle' alt='edit' border='0' />&nbsp;Edit
            </a>";
        }
        $ACCESS_LEVEL_DELETE_BUTTON="";
        if ($this->_accessLevel >= ACCESS_LEVEL_DELETE)
        { 
            $ACCESS_LEVEL_DELETE_BUTTON = "<a id='delete_link' href='index.php?m=joborders&amp;a=delete&amp;jobOrderID={$jobOrderID}' onclick=\"javascript:return confirm('Delete this job order?');\">
                <img src='images/actions/delete.gif' width='16' height='16' class='absmiddle' alt='delete' border='0' />&nbsp;Delete
            </a>";
        }
        $ACCESS_LEVEL_MULTI_SA_BUTTON="";
        if ($this->_accessLevel >= ACCESS_LEVEL_MULTI_SA)
        {
            if ($data['is_admin_hidden'] == 1)
            {
                $ACCESS_LEVEL_MULTI_SA_BUTTON = "<a href='index.php?m=joborders&amp;a=administrativeHideShow&amp;jobOrderID={$jobOrderID}&amp;state=0'>
                    <img src='images/resume_preview_inline.gif' width='16' height='16' class='absmiddle' alt='delete' border='0' />&nbsp;Administrative Show
                </a>";
            }
            else
            {
                $ACCESS_LEVEL_MULTI_SA_BUTTON = "<a href='index.php?m=joborders&amp;a=administrativeHideShow&amp;jobOrderID={$jobOrderID}&amp;state=1'>
                <img src='images/resume_preview_inline.gif' width='16' height='16' class='absmiddle' alt='delete' border='0' />&nbsp;Administrative Hide
            </a>";
            }
        }
        $ACCESS_LEVEL_EDIT_CONSIDER="";
        if ($this->_accessLevel >= ACCESS_LEVEL_EDIT)
        { 
            $ACCESS_LEVEL_EDIT_CONSIDER = "<a href='#' onclick=\"showPopWin('index.php?m=joborders&amp;a=considerCandidateSearch&amp;jobOrderID={$jobOrderID}', 820, 550, null); return false;\">
                <img src='images/consider.gif' width='16' height='16' class='absmiddle' alt='add candidate' border='0' />&nbsp;Add Candidate to This Job Order Pipeline
            </a>";
        }
        
        $this->_template->assign('active', $this);
        $this->_template->assign('public', $public);
        $this->_template->assign('ACCESS_LEVEL_EDIT_BUTTON', $ACCESS_LEVEL_EDIT_BUTTON);
        $this->_template->assign('ACCESS_LEVEL_DELETE_BUTTON', $ACCESS_LEVEL_DELETE_BUTTON);
        $this->_template->assign('ACCESS_LEVEL_MULTI_SA_BUTTON', $ACCESS_LEVEL_MULTI_SA_BUTTON);
        $this->_template->assign('ACCESS_LEVEL_EDIT_CONSIDER', $ACCESS_LEVEL_EDIT_CONSIDER);
        $this->_template->assign('questionnaireID', $questionnaireID);
        $this->_template->assign('questionnaireData', $questionnaireData);
        $this->_template->assign('careerPortalURL', $careerPortalURL);
        $this->_template->assign('data', $data);
        $this->_template->assign('frozen', $strFrozen);
        $this->_template->assign('adminHidden',$adminHidden);
        $this->_template->assign('extraFieldRS', $extraFieldRS);
        $this->_template->assign('attachmentsRS', $attachmentsRS);
        $this->_template->assign('pipelineEntriesPerPage', $pipelineEntriesPerPage);
        $this->_template->assign('pipelineGraph', $pipelineGraph);
        $this->_template->assign('jobOrderID', $jobOrderID);
        $this->_template->assign('careerPortalEnabled', $careerPortalEnabled);
        $this->_template->assign('privledgedUser', $privledgedUser);
        $this->_template->assign('sessionCookie', $_SESSION['CATS']->getCookie());
        //$this->_template->assign('fields_detail',$arrAssoc);

        if (!eval(Hooks::get('JO_SHOW'))) return;
        /* Is this a popup? */
        if (isset($_GET['display']) && $_GET['display'] == 'popup')
        {
            $this->_template->display('./modules/joborders/show_popup.php');
            $isPopup = true;
        }
        else
        {
            $this->_template->display('./modules/joborders/Show.php');
            $isPopup = false;
        }
    }