} else {
        $data[] = new pie_value(0, $text." (0)");
    }
}
*/
//BAR CHART DATA
$data = array();
$dataraw = array();
while ($row = tep_db_fetch_array($r)) {
    $dataraw[$row['status']] = $row['status_total'];
}
$statuslist = array('1', '2', '7', '3', '4', '5', '6');
$statuscolor = array('1' => '#bababa', '2' => '#ababab', '7' => '#838383', '3' => '#900000', '4' => '#ffd200', '5' => '#0066CC', '6' => '#066303');
$statustext = array();
foreach ($statuslist as $status) {
    $text = ($status == '1' ? 'New ' : 'Moved to ') . improvement::getImprovementStatus($status);
    $statustext[$status] = $text;
    $bar = new bar_value(intval($dataraw[$status]));
    $bar->set_colour($statuscolor[$status]);
    $data[$status] = $bar;
}
$title = new title('MIMS ' . $time_lookback_date . '-' . $time_lookuntil_date . ' (' . array_sum($dataraw) . ')');
$title->set_style("{font-size:13px;font-weight:bold;margin:5px 0 20px 0;}");
$chart = new open_flash_chart();
$chart->set_title($title);
/*
// PIE CHART
$pie = new pie();
$pie->set_alpha(0.6);
$pie->set_start_angle(-90);
$pie->add_animation( new pie_fade() );
Esempio n. 2
0
     }
     if ($team_id == 1) {
         $kpi_table = array();
         $row = array();
         $row['id'] = 'No';
         $row['s3 date'] = 'MIMS Status';
         $row['desc'] = 'MIMS Name';
         $row['s4 date'] = 'PIC';
         $kpi_table[] = $row;
         $m_internal_counter = 0;
         foreach ($mims_internal[$team_id] as $status => $mint) {
             foreach ($mint as $mid => $m) {
                 $m_internal_counter++;
                 $row = array();
                 $row['id'] = $m_internal_counter;
                 $row['s3 date'] = improvement::getImprovementStatus($status);
                 $row['desc'] = '<a href="?open=improvement&amp;id=' . $mid . '&amp;hidemenu=true" class="view_webpage">' . $m['name'] . '</a>';
                 $row['s4 date'] = $m['pic'];
                 $kpi_table[] = $row;
             }
         }
         //echo "<pre>";var_dump($mims_internal[1]);
         $result .= '<h3 style="margin-top:20px;">Internal MIMS</h3>';
         $result .= tep_draw_table('', $kpi_table);
     }
     $result .= '</div>';
     //#kpi-mims
 } elseif ($_GET['week-sum'] == 'MWALL') {
     $wall = new wall('0');
     $result .= '<div style="float:left;padding:20px 0;">';
     $result .= $wall->draw(5, 'width:650px;');
            $name_res = $db_object->get_a_line($name_qry);
            $alert_res[$i][addedby] = $name_res[username];
        }
        $values["alert_loop"] = $alert_res;
        $content = $common->simpleloopprocess($db_object, $content, $values);
        $content = $common->direct_replace($db_object, $content, $xArray);
        echo $content;
    }
    function date_format($date)
    {
        $date1 = @explode("/", $date);
        $date = $date1[2] . "-" . $date1[0] . "-" . $date1[1];
        return $date;
    }
}
$obj = new improvement();
if ($Submit) {
    $action = "submit";
}
switch ($action) {
    case NULL:
        $obj->performance_improvement($db_object, $common, $user_id, $uid);
        break;
    case "submit":
        $obj->submit_plan($db_object, $common, $fAssigned_by, $fAssigned_to, $fRequirement, $fConsequences, $fDate1, $default, $error_msg);
        break;
    case "alert":
        $obj->show_alert($db_object, $common, $user_id);
        break;
}
include_once "footer.php";
Esempio n. 4
0
$q = tep_db_query("SELECT improvements_id FROM improvements WHERE status=4 AND check_date<='{$today}'");
while ($row = tep_db_fetch_array($q)) {
    $i = new improvement($row['improvements_id']);
    $i->updateStatus('4', '5', $username);
}
$logger->write("- Auto move to Checkings Tab");
//$q = tep_db_query("SELECT improvements_id, DATEDIFF(deadline, '$today') AS deadline_diff FROM improvements WHERE status<4 HAVING deadline_diff<=1");
$q = tep_db_query("SELECT improvements_id, DATEDIFF(deadline, '{$today}') AS deadline_diff FROM improvements WHERE status<4 OR status=7 HAVING deadline_diff<=1");
while ($row = tep_db_fetch_array($q)) {
    $i = new improvement($row['improvements_id']);
    $targets = array();
    $targets[] = $i->owner_id;
    if ($i->pic > 0) {
        $targets[] = $i->pic;
    }
    $message = $obj_notifications->messageTemplateDeadlineReminder($username, 'Improvement', $i->id, $row['deadline_diff'], improvement::getTeamCategories($i->team, $i->category), $i->name);
    $obj_notifications->broadcast($targets, $message, $username, 'open=improvement&id=' . $i->id, false, $targets);
}
$logger->write("- Deadline Notifications Sent");
$logger->write("Task 3 - End");
$logger->write("Task 4a (CLEAR OLD NOTIFICATIONS) - Start");
////////////////////////////////////////////////
// CLEAR OLD NOTIFICATIONS OLDER THAN 1 MONTH //
////////////////////////////////////////////////
$max_days = 30;
$date_max = date('Y-m-d 00:00:00', strtotime("-{$max_days} days"));
$q = tep_db_query("DELETE FROM minierp_users_has_notifications WHERE posted_date<='{$date_max}' AND status=0 AND need_feedback=0");
$logger->write("Task 4b (RESET NEW STATUS FOR UNCONFIRMED FEEDBACK) - Start");
/////////////////////////////////////////
// SET BACK UNANSWERED FEEDBACK AS NEW //
/////////////////////////////////////////
Esempio n. 5
0
<?php

use_class('improvement');
use_class('minierp_users');
$class_mu = new minierp_users();
$create_new_button = 'Create New';
$id = isset($_GET['id']) ? tep_db_prepare_input($_GET['id']) : null;
$improvement = new improvement($id);
$is_createnew = is_null($improvement->id);
$newdata_created = isset($_GET['new']) && $_GET['new'] == 'true';
$reloadlist = false;
if ($newdata_created) {
    $messagebox->add('New MIMS successfully created with ID ' . $improvement->id, 'green');
    $reloadlist = true;
}
if (isset($_POST['me_action'])) {
    if (!is_null($improvement->id)) {
        $improvement->followers->addFollower($session_userinfo['id']);
    }
    if ($_POST['me_action'] == 'CREATENEWDATA' || $_POST['me_action'] == 'UPDATEDATA') {
        $owner_id = tep_db_prepare_input($_POST['owner_id']);
        $owner_name = tep_db_prepare_input($_POST['owner_name']);
        $owner_image = '';
        $date_added = tep_db_prepare_input($_POST['date_added']);
        $team = tep_db_prepare_input($_POST['team']);
        $teamcat = null;
        $eta = null;
        $target = null;
        $deadline = null;
        $kickoff_date = null;
        $pic = null;
             default:
                 $value = '$nbsp;';
         }
         $row .= '<td class="' . $class . '">' . $value . '</td>';
     }
     $row .= '</tr>';
     $result = array();
     $result['id'] = $id;
     $result['row'] = $row;
     ajaxReturn($result);
     exit;
 } elseif ($_POST['me_action'] == 'UPDATESTATUS') {
     $id = tep_db_prepare_input($_POST['datas_id']);
     $old_status = tep_db_prepare_input($_POST['old_status']);
     $new_status = tep_db_prepare_input($_POST['new_status']);
     $object = new improvement($id);
     $object->updateStatus($old_status, $new_status, $session_userinfo['username']);
     if ($old_status == '2' && $new_status == '3') {
         $object->updatePIC($session_userinfo['id'], $session_userinfo['username']);
     }
     if (isset($_POST['check_date']) && $_POST['check_date'] != '') {
         $object->updateCheckDate(tep_db_prepare_input($_POST['check_date']));
     }
     $result = array();
     $result['id'] = $id;
     $result['old_status'] = $old_status;
     $result['new_status'] = $new_status;
     $result['st_counter'] = datasCountByStatus();
     ajaxReturn($result);
     exit;
 } elseif ($_POST['me_action'] == 'UPDATESDATE') {
        $new_sort = tep_db_prepare_input($_POST['new_sort']);
        $object = new improvement($id);
        echo $object->updateSort($old_sort, $new_sort) ? 'SUCCESS' : 'FAIL';
        echo 'FAIL';
        exit;
    } elseif ($_POST['me_action'] == 'UPDATESORTS') {
        foreach ($_POST['newsorts'] as $priority => $id) {
            $id = intval(str_replace('data-', '', $id));
            improvement::updatePriority($id, $priority);
        }
        echo 'OK';
        exit;
    } elseif ($_POST['me_action'] == 'UPDATECHECKDATE') {
        $id = tep_db_prepare_input($_POST['datas_id']);
        $check_date = tep_db_prepare_input($_POST['check_date']);
        $object = new improvement($id);
        $scd = $object->updateCheckDate($check_date);
        $result = array();
        $result['id'] = $id;
        $result['check_date'] = $check_date;
        ajaxReturn($result);
        exit;
    }
    objectSocialLinePostAction('improvement');
}
if (isset($_GET['status']) && array_key_exists($_GET['status'], $tabs)) {
    $status = $_GET['status'];
    $status_sort_by_ownner = array('1');
    if ($filter_type == '0') {
        $filter = " AND i.department={$filter_team}";
        if ($filter_teamcat != 0) {