示例#1
0
$formother = new FormOther($db);
if ($id > 0) {
    $title = $langs->trans("User");
    $linkback = '<a href="' . DOL_URL_ROOT . '/user/index.php">' . $langs->trans("BackToList") . '</a>';
    $head = user_prepare_head($fuser);
    dol_fiche_head($head, 'paidholidays', $title, 0, 'user');
    dol_banner_tab($fuser, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
    print '<div class="underbanner clearboth"></div>';
    print '<br>';
} else {
    //print $num;
    //print count($holiday->holiday);
    print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, "", $num, count($holiday->holiday), 'title_hrm.png', 0, '', '', $limit);
    dol_fiche_head('');
}
$alltypeleaves = $holiday->getTypes(1, -1);
// To have labels
$out = '';
$typeleaves = $holiday->getTypes(1, 1);
foreach ($typeleaves as $key => $val) {
    $nb_type = $holiday->getCPforUser($user_id, $val['rowid']);
    $nb_holiday += $nb_type;
    $out .= ' - ' . $val['label'] . ': <strong>' . ($nb_type ? price2num($nb_type) : 0) . '</strong><br>';
}
print $langs->trans('SoldeCPUser', round($nb_holiday, 5)) . '<br>';
print $out;
dol_fiche_end();
if ($id > 0) {
    print '</br>';
}
print '<form method="get" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
示例#2
0
	            }
	        }
	        else
	        {
	           alert("' . dol_escape_js($langs->transnoentities('NoDateDebut')) . '");
	           return false;
	        }
       	}
       </script>' . "\n";
        // Formulaire de demande
        print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '" onsubmit="return valider()" name="demandeCP">' . "\n";
        print '<input type="hidden" name="action" value="create" />' . "\n";
        print '<input type="hidden" name="userID" value="' . $userid . '" />' . "\n";
        dol_fiche_head();
        $out = '';
        $typeleaves = $cp->getTypes(1, 1);
        foreach ($typeleaves as $key => $val) {
            $nb_type = $cp->getCPforUser($user->id, $val['rowid']);
            $nb_holiday += $nb_type;
            $out .= ' - ' . $val['label'] . ': <strong>' . ($nb_type ? price2num($nb_type) : 0) . '</strong><br>';
        }
        print $langs->trans('SoldeCPUser', round($nb_holiday, 5)) . '<br>';
        print $out;
        dol_fiche_end();
        dol_fiche_head();
        //print '<span>'.$langs->trans('DelayToRequestCP',$cp->getConfCP('delayForRequest')).'</span><br /><br />';
        print '<table class="border" width="100%">';
        print '<tbody>';
        // User
        print '<tr>';
        print '<td class="fieldrequired">' . $langs->trans("User") . '</td>';
示例#3
0
$form = new Form($db);
$formother = new FormOther($db);
if ($id > 0) {
    $title = $langs->trans("User");
    $linkback = '<a href="' . DOL_URL_ROOT . '/user/index.php">' . $langs->trans("BackToList") . '</a>';
    $head = user_prepare_head($fuser);
    dol_fiche_head($head, 'paidholidays', $title, 0, 'user');
    dol_banner_tab($fuser, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
    print '<div class="underbanner clearboth"></div>';
    print '<br>';
} else {
    print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, "", $num, 0, 'title_hrm.png');
    dol_fiche_head('');
}
$out = '';
$typeleaves = $holiday->getTypes(1, 1);
foreach ($typeleaves as $key => $val) {
    $nb_type = $holiday->getCPforUser($user->id, $val['rowid']);
    $nb_holiday += $nb_type;
    $out .= ' - ' . $val['label'] . ': <strong>' . ($nb_type ? price2num($nb_type) : 0) . '</strong><br>';
}
print $langs->trans('SoldeCPUser', round($nb_holiday, 5)) . '<br>';
print $out;
dol_fiche_end();
if ($id > 0) {
    print '</br>';
}
print '<form method="get" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
if ($optioncss != '') {
    print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
}
    foreach ($_POST['nb_conges'] as $user_id => $compteur) {
        if (!empty($compteur)) {
            $userValue = str_replace(',', '.', $compteur);
            $userValue = number_format($userValue, 2, '.', '');
        } else {
            $userValue = '0.00';
        }
        $congespayes->updateSoldeCP($user_id, $userValue, $fk_type);
    }
    print '<div class="tabBar">';
    print $langs->trans('UpdateConfCPOK');
    print '</div>';
}
$var = true;
$i = 0;
foreach ($congespayes->getTypes() as $type) {
    if ($type['affect'] == 1) {
        print '<div class="tabBar" style="float:left;width:300px;margin-right:10px;">';
        print '<h3>' . $type['label'] . '</h3>';
        print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
        print '<input type="hidden" name="action" value="update" />';
        print '<input type="hidden" name="fk_type" value="' . $type['rowid'] . '" />';
        print '<table class="noborder" width="100%;">';
        print "<tr class=\"liste_titre\">";
        print '<td width="50%">' . $langs->trans('Employee') . '</td>';
        print '<td width="30%">' . $langs->trans('Counter') . '</td>';
        print '</tr>';
        foreach ($listUsers as $users) {
            $var = !$var;
            print '<tr ' . $bc[$var] . '>';
            print '<td>' . $users['name'] . ' ' . $users['firstname'] . '</td>';
示例#5
0
文件: hrm.php 项目: Albertopf/prueba
 $sql .= " AND x.entity = " . $conf->entity;
 if (empty($user->rights->holiday->read_all)) {
     $sql .= ' AND x.fk_user IN (' . join(',', $childids) . ')';
 }
 //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND x.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = "******" AND x.fk_soc = ".$socid;
 $sql .= $db->order("x.tms", "DESC");
 $sql .= $db->plimit($max, 0);
 $result = $db->query($sql);
 if ($result) {
     $var = false;
     $num = $db->num_rows($result);
     $holidaystatic = new Holiday($db);
     $userstatic = new User($db);
     $listhalfday = array('morning' => $langs->trans("Morning"), "afternoon" => $langs->trans("Afternoon"));
     $typeleaves = $holidaystatic->getTypes(1, -1);
     $i = 0;
     print '<table class="noborder" width="100%">';
     print '<tr class="liste_titre">';
     print '<td colspan="3">' . $langs->trans("BoxTitleLastLeaveRequests", min($max, $num)) . '</td>';
     print '<td>' . $langs->trans("from") . '</td>';
     print '<td>' . $langs->trans("to") . '</td>';
     print '<td align="right">' . $langs->trans("DateModificationShort") . '</td>';
     print '<td width="16">&nbsp;</td>';
     print '</tr>';
     if ($num) {
         while ($i < $num && $i < $max) {
             $obj = $db->fetch_object($result);
             $holidaystatic->id = $obj->rowid;
             $holidaystatic->ref = $obj->ref;
             $userstatic->id = $obj->uid;