Example #1
0
// Search project
if (!empty($conf->projet->enabled) && $user->rights->projet->lire) {
    $var = false;
    print '<form method="post" action="' . DOL_URL_ROOT . '/projet/list.php">';
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
    print '<table class="noborder nohover" width="100%">';
    print '<tr class="liste_titre"><td colspan="3">' . $langs->trans("SearchAProject") . '</td></tr>';
    print '<tr ' . $bc[$var] . '>';
    print '<td class="nowrap"><label for="sf_ref">' . $langs->trans("Ref") . '</label>:</td><td><input type="text" class="flat" name="search_ref" id="sf_ref" size="18"></td>';
    print '<td rowspan="2"><input type="submit" value="' . $langs->trans("Search") . '" class="button"></td></tr>';
    print '<tr ' . $bc[$var] . '><td class="nowrap"><label for="sall">' . $langs->trans("Other") . '</label>:</td><td><input type="text" class="flat" name="search_all" id="search_all" size="18"></td>';
    print '</tr>';
    print "</table></form>\n";
    print "<br>\n";
}
print_projecttasks_array($db, $socid, $projectsListId, 0, 0);
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("ThirdParties"), $_SERVER["PHP_SELF"], "s.nom", "", "", "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("NbOfProjects"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
print "</tr>\n";
$sql = "SELECT count(p.rowid) as nb";
$sql .= ", s.nom as name, s.rowid as socid";
$sql .= " FROM " . MAIN_DB_PREFIX . "projet as p";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s on p.fk_soc = s.rowid";
$sql .= " WHERE p.entity = " . $conf->entity;
if ($mine || empty($user->rights->projet->all->lire)) {
    $sql .= " AND p.rowid IN (" . $projectsListId . ")";
}
if ($socid) {
Example #2
0
$resql = $db->query($sql);
if ($resql) {
    $num = $db->num_rows($resql);
    $i = 0;
    while ($i < $num) {
        $obj = $db->fetch_object($resql);
        $var = !$var;
        print "<tr " . $bc[$var] . ">";
        print '<td class="nowrap">';
        if ($obj->socid) {
            $socstatic->id = $obj->socid;
            $socstatic->name = $obj->name;
            print $socstatic->getNomUrl(1);
        } else {
            print $langs->trans("OthersNotLinkedToThirdParty");
        }
        print '</td>';
        print '<td align="right"><a href="' . DOL_URL_ROOT . '/projet/list.php?socid=' . $obj->socid . '&search_status=1">' . $obj->nb . '</a></td>';
        print "</tr>\n";
        $i++;
    }
    $db->free($resql);
} else {
    dol_print_error($db);
}
print "</table>";
print '<br>';
print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 1, $listofoppstatus);
print '</div></div></div>';
llxFooter();
$db->close();