本文整理汇总了PHP中Categorie::fetch_optionals方法的典型用法代码示例。如果您正苦于以下问题:PHP Categorie::fetch_optionals方法的具体用法?PHP Categorie::fetch_optionals怎么用?PHP Categorie::fetch_optionals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Categorie
的用法示例。
在下文中一共展示了Categorie::fetch_optionals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GETPOST
$id = GETPOST('id', 'int');
$ref = GETPOST('ref');
$type = GETPOST('type');
$action = GETPOST('action');
$confirm = GETPOST('confirm');
$removeelem = GETPOST('removeelem', 'int');
$elemid = GETPOST('elemid');
if ($id == "") {
dol_print_error('', 'Missing parameter id');
exit;
}
// Security check
$result = restrictedArea($user, 'categorie', $id, '&category');
$object = new Categorie($db);
$result = $object->fetch($id);
$object->fetch_optionals($id, $extralabels);
if ($result <= 0) {
dol_print_error($db, $object->error);
exit;
}
$type = $object->type;
$extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('categorycard'));
/*
* Actions
*/
// Remove element from category
if ($id > 0 && $removeelem > 0) {
if ($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer)) {
示例2: _fiche
function _fiche(&$PDOdb, $id)
{
global $conf, $db, $langs, $user, $form;
$object = new Categorie($db);
$result = $object->fetch($id);
$object->fetch_optionals($id, $extralabels);
if ($result <= 0) {
dol_print_error($db, $object->error);
exit;
}
llxHeader("", "", $langs->trans("Categories"));
$title = $langs->trans("CustomersCategoryShort");
$head = categories_prepare_head($object, Categorie::TYPE_CUSTOMER);
dol_fiche_head($head, 'commercial', $title, 0, 'category');
print '<table class="border" width="100%">';
print '<tr><td width="20%" class="notopnoleft">';
$ways = $object->print_all_ways();
print $langs->trans("Ref") . '</td><td>';
print '<a href="' . DOL_URL_ROOT . '/categories/index.php?leftmenu=cat&type=' . $type . '">' . $langs->trans("Root") . '</a> >> ';
foreach ($ways as $way) {
print $way . "<br>\n";
}
print '</td></tr>';
// Description
print '<tr><td width="20%" class="notopnoleft">';
print $langs->trans("Description") . '</td><td>';
print dol_htmlentitiesbr($object->description);
print '</td></tr>';
print '<tr><td>' . $langs->trans("SalesRepresentatives") . '</td>';
print '<td>';
$TUser = TCommercialCategory::getUser($PDOdb, $object->id);
if (!empty($TUser)) {
foreach ($TUser as &$u) {
echo $u->getNomUrl(1);
if ($user->rights->societe->creer) {
print '<a href="?id=' . $object->id . '&commid=' . $u->id . '&action=delete">';
print img_delete();
print '</a>';
}
print '<br />';
}
}
print '</td></tr>';
print '</table>';
dol_fiche_end();
if ($user->rights->societe->creer && $user->rights->societe->client->voir) {
/*
* Copier... Coller... Jobi... Joba...
*/
$langs->load("users");
$title = $langs->trans("ListOfUsers");
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.login";
$sql .= " FROM " . MAIN_DB_PREFIX . "user as u LEFT JOIN " . MAIN_DB_PREFIX . "commercial_category cc ON (cc.fk_user = u .rowid AND cc.fk_category=" . $object->id . ")";
$sql .= " WHERE u.entity IN (0," . $conf->entity . ")";
if (!empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) {
$sql .= " AND u.statut<>0 ";
}
$sql .= " AND cc.rowid IS NULL ";
$sql .= " ORDER BY u.lastname ASC ";
//var_dump($sql);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
print load_fiche_titre($title);
// Lignes des titres
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Login") . '</td>';
print '<td> </td>';
print "</tr>\n";
$var = True;
while ($i < $num) {
$obj = $db->fetch_object($resql);
$var = !$var;
print "<tr " . $bc[$var] . "><td>";
print '<a href="' . DOL_URL_ROOT . '/user/card.php?id=' . $obj->rowid . '">';
print img_object($langs->trans("ShowUser"), "user") . ' ';
print dolGetFirstLastname($obj->firstname, $obj->lastname) . "\n";
print '</a>';
print '</td><td>' . $obj->login . '</td>';
print '<td><a href="?id=' . $object->id . '&commid=' . $obj->rowid . '&action=add">' . $langs->trans("Add") . '</a></td>';
print '</tr>' . "\n";
$i++;
}
print "</table>";
$db->free($resql);
} else {
dol_print_error($db);
}
}
llxFooter();
}