if ($worker_id == ALL_WORKERS) {
        $_SESSION['selecter_worker'] = "";
    }
}
//Date Calculations
include_once "../_addon/addon_date_calculation.php";
//--- header ---
$breadcrumbs[] = $strings['reports'];
$breadcrumbs[] = buildLink('../reports/createreport.php?typeReports=create', $strings["create_report"], in) . ' | ' . buildLink('../reports/createreport.php?typeReports=custom', $strings['custom_reports'], LINK_INSIDE);
$breadcrumbs[] = $pageTitle;
$pageSection = 'reports';
require_once "../themes/" . THEME . "/header.php";
//*** Time Navigation ***
echo "<form action='?dateCalend=" . $dateCalend . "' method='post'>" . "<span width='70%' style='margin-left:20px'><strong>" . buildLink("?dateCalend={$datePast}", $strings["previous"], LINK_INSIDE) . " | " . buildLink($_SERVER['PHP_SELF'], $strings["today"], LINK_INSIDE) . " | " . buildLink("?dateCalend={$dateNext}", $strings["next"], LINK_INSIDE) . "</strong></span>";
//*** Add User Selection for Administrator ***
if (loggedUserIsAdmin()) {
    //*** Travailleur ***
    $tmpquery = " WHERE mem.profil != 3 AND mem.profil!= 0";
    $tmpquery .= " ORDER BY mem.name";
    $projmem = new request();
    $projmem->openMembers($tmpquery);
    $comptProjmem = count($projmem->mem_id);
    echo "&nbsp;&nbsp;<select name='worker_id' onChange=\"this.form.submit();\">";
    // get project team listing for owner select lists, default to logged user
    echo "<option value='" . ALL_WORKERS . "'>-- " . $strings["all_workers"] . " --</option>";
    for ($i = 0; $i < $comptProjmem; $i++) {
        $selected = "";
        //||(($worker_id==0)&&($_SESSION['idSession']==$projmem->mem_id[$i]))
        if ($worker_id == $projmem->mem_id[$i]) {
            $selected = " selected";
        }
예제 #2
0
    $selected = "";
    if ($task_id == $tasks->tas_id[$i]) {
        $selected = " selected";
    }
    echo "<option value='" . $tasks->tas_id[$i] . "'" . $selected . ">" . $tasks->tas_name[$i] . "</option>";
}
//*** Travailleur ***
$tmpquery = " WHERE mem.profil != 3 AND mem.profil!= 0";
$tmpquery .= " ORDER BY mem.name";
$projmem = new request();
$projmem->openMembers($tmpquery);
$comptProjmem = count($projmem->mem_id);
echo "\n\t<tr class='odd'>\n\t  <td valign='top' class='leftvalue'>" . $strings['assigned'] . " :</td>\n\t  <td>";
//Seulement pour Admin et Assistant
//	if(false) {
if (loggedUserIsAdmin() || loggedUserIsAssistant()) {
    echo "<select name='worker_id'>";
    //get project team listing for owner select lists, default to logged user
    for ($i = 0; $i < $comptProjmem; $i++) {
        $selected = "";
        if ($worker_id == $projmem->mem_id[$i] || $worker_id == 0 && $_SESSION['idSession'] == $projmem->mem_id[$i]) {
            $selected = " selected";
        }
        echo "<option value='" . $projmem->mem_id[$i] . "'" . $selected . ">" . $projmem->mem_name[$i] . "{$clientUser}</option>";
    }
    echo "</select>" . "</td></tr>";
} else {
    echo "<input type='hidden' name='worker_id' value='" . $_SESSION['idSession'] . "'>" . $_SESSION['nameSession'];
}
//*** Data Input ***
if ($ld == '') {
$crlf = which_crlf();
//URL Parameters
//$displayStyle
//$worker_id (if = * > All workers, if no value > session ID used)
//Find data
$query .= "WHERE (tim.date >= '{$firstDayDate}' AND tim.date <= '{$lastDayDate}')";
// a member selection was made
//$query .= " AND tim.owner = 4";
if ($worker_id != "" && $worker_id != ALL_WORKERS) {
    $team_id = $worker_id;
} else {
    $team_id = $_SESSION['idSession'];
}
//echo "$worker_id / $team_id / {$_SESSION['selecter_worker']} / {$_SESSION['idSession']}";
//Select according to user (when specified or user has no right ti see other timesheets)
if ($worker_id != ALL_WORKERS || !loggedUserIsAdmin()) {
    $query .= " AND tim.owner = {$team_id}";
    //	echo $_SESSION['idSession']."<br/>";
}
//Order by worker if necessary
$worker_order_addon = "";
if ($worker_id == ALL_WORKERS) {
    $worker_order_addon = "tim.owner ASC,";
}
$tmpquery = "{$query} ORDER BY {$worker_order_addon}tim.date ASC,org.name,pro.name";
//echo $tmpquery."<br/>";
$listHours = new request();
$listHours->openTaskTime($tmpquery);
$comptListHours = count($listHours->tim_id);
////File Name
$filename = "timesheets_{$displayStyle}_{$worker_id}_{$dateCalend}";