本文整理汇总了PHP中commande_prepare_head函数的典型用法代码示例。如果您正苦于以下问题:PHP commande_prepare_head函数的具体用法?PHP commande_prepare_head怎么用?PHP commande_prepare_head使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了commande_prepare_head函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _liste
function _liste(&$PDOdb)
{
global $langs, $db, $user, $conf;
llxHeader('', $langs->trans('ListOFAsset'), '', '');
//getStandartJS();
if (isset($_REQUEST['delete_ok'])) {
?>
<br><div class="error"><?php
echo $langs->trans('OFAssetDeleted');
?>
</div><br>
<?php
}
$fk_soc = __get('fk_soc', 0, 'integer');
$fk_product = __get('fk_product', 0, 'integer');
$fk_commande = __get('fk_commande', 0, 'integer');
if ($fk_product > 0) {
dol_include_once('/core/lib/product.lib.php');
$product = new Product($db);
$result = $product->fetch($fk_product);
$head = product_prepare_head($product, $user);
$titre = $langs->trans("CardProduct" . $product->type);
$picto = $product->type == 1 ? 'service' : 'product';
dol_fiche_head($head, 'tabOF2', $titre, 0, $picto);
} elseif ($fk_commande > 0) {
dol_include_once("/core/lib/order.lib.php");
$commande = new Commande($db);
$result = $commande->fetch($fk_commande);
$head = commande_prepare_head($commande, $user);
$titre = $langs->trans("CustomerOrder" . $product->type);
dol_fiche_head($head, 'tabOF3', $titre, 0, "order");
}
$form = new TFormCore();
$assetOf = new TAssetOF();
$r = new TSSRenderControler($assetOf);
$sql = "SELECT ofe.rowid, ofe.numero, ofe.fk_soc, s.nom as client, SUM(ofel.qty) as nb_product_to_make\n\t\t, GROUP_CONCAT(DISTINCT ofel.fk_product SEPARATOR ',') as fk_product, p.label as product, ofe.ordre, ofe.date_lancement , ofe.date_besoin, ofe.fk_commande,ofe.fk_project\n\t\t, ofe.status, ofe.fk_user,ofe.total_estimated_cost, ofe.total_cost, '' AS printTicket\n\t\t FROM " . MAIN_DB_PREFIX . "assetOf as ofe \n\t\t LEFT JOIN " . MAIN_DB_PREFIX . "assetOf_line ofel ON (ofel.fk_assetOf=ofe.rowid AND ofel.type = 'TO_MAKE')\n\t\t LEFT JOIN " . MAIN_DB_PREFIX . "product p ON (p.rowid = ofel.fk_product)\n\t\t LEFT JOIN " . MAIN_DB_PREFIX . "societe s ON (s.rowid = ofe.fk_soc)\n\t\t WHERE ofe.entity=" . $conf->entity;
if ($fk_soc > 0) {
$sql .= " AND ofe.fk_soc=" . $fk_soc;
}
if ($fk_product > 0) {
$sql .= " AND ofel.fk_product=" . $fk_product;
}
if ($fk_commande > 0) {
$sql .= " AND ofe.fk_commande=" . $fk_commande;
}
$sql .= " GROUP BY ofe.rowid ";
// TODO je me rappelle plus pourquoi j'ai fait cette merde mais ça fait planter le tri, donc à virer.
/*if($conf->global->ASSET_OF_LIST_BY_ROWID_DESC) $orderBy['ofe.rowid']='DESC';
else $orderBy['ofe.date_cre']='DESC';*/
$TMath = array();
$THide = array('rowid', 'fk_user', 'fk_product', 'fk_soc');
if ($fk_commande > 0) {
$THide[] = 'fk_commande';
}
if ($conf->global->OF_NB_TICKET_PER_PAGE == -1) {
$THide[] = 'printTicket';
}
if (empty($user->rights->of->of->price)) {
$THide[] = 'total_cost';
$THide[] = 'total_estimated_cost';
} else {
$TMath['total_estimated_cost'] = 'sum';
$TMath['total_cost'] = 'sum';
}
if (!empty($fk_product)) {
$TMath['nb_product_to_make'] = 'sum';
}
$form = new TFormCore($_SERVER['PHP_SELF'], 'form', 'GET');
echo $form->hidden('action', '');
if ($fk_commande > 0) {
echo $form->hidden('fk_commande', $fk_commande);
}
if ($fk_product > 0) {
echo $form->hidden('fk_product', $fk_product);
}
// permet de garder le filtre produit quand on est sur l'onglet OF d'une fiche produit
$r->liste($PDOdb, $sql, array('limit' => array('nbLine' => $conf->liste_limit), 'orderBy' => $orderBy, 'subQuery' => array(), 'link' => array('Utilisateur en charge' => '<a href="' . dol_buildpath('/user/card.php?id=@fk_user@', 2) . '">' . img_picto('', 'object_user.png', '', 0) . ' @val@</a>', 'numero' => '<a href="' . dol_buildpath('/of/fiche_of.php?id=@rowid@"', 2) . '>' . img_picto('', 'object_list.png', '', 0) . ' @val@</a>', 'printTicket' => '<input style=width:40px;"" type="number" value="' . (int) $conf->global->OF_NB_TICKET_PER_PAGE . '" name="printTicket[@rowid@]" min="0" />'), 'translate' => array(), 'hide' => $THide, 'type' => array('date_lancement' => 'date', 'date_besoin' => 'date', 'total_cost' => 'money', 'total_estimated_cost' => 'money', 'nb_product_to_make' => 'number'), 'math' => $TMath, 'liste' => array('titre' => $langs->trans('ListOFAsset'), 'image' => img_picto('', 'title.png', '', 0), 'picto_precedent' => img_picto('', 'back.png', '', 0), 'picto_suivant' => img_picto('', 'next.png', '', 0), 'noheader' => (int) isset($_REQUEST['fk_soc']) | (int) isset($_REQUEST['fk_product']), 'messageNothing' => "Il n'y a aucun " . $langs->trans('OFAsset') . " à afficher", 'picto_search' => img_picto('', 'search.png', '', 0)), 'title' => array('numero' => 'Numéro', 'fk_commande' => 'Commande client', 'ordre' => 'Priorité', 'date_lancement' => 'Date du lancement', 'date_besoin' => 'Date du besoin', 'status' => 'Status', 'login' => 'Utilisateur en charge', 'product' => 'Produit', 'client' => 'Client', 'nb_product_to_make' => 'Nb produits à fabriquer', 'total_cost' => 'Coût réel', 'total_estimated_cost' => 'Coût prévu', 'printTicket' => 'impression<br />étiquette', 'fk_project' => 'Projet'), 'orderBy' => array('rowid' => 'DESC'), 'eval' => array('ordre' => 'TAssetOF::ordre(@val@)', 'status' => 'TAssetOF::status(@val@)', 'product' => 'get_format_libelle_produit("@fk_product@")', 'client' => 'get_format_libelle_societe(@fk_soc@)', 'fk_commande' => 'get_format_libelle_commande(@fk_commande@)', 'fk_project' => 'get_format_libelle_projet(@fk_project@)'), 'search' => array('numero' => array('recherche' => true, 'table' => 'ofe'), 'date_lancement' => array('recherche' => 'calendars', 'table' => 'ofe'), 'date_besoin' => array('recherche' => 'calendars', 'table' => 'ofe'), 'status' => array('recherche' => TAssetOF::$TStatus, 'table' => 'ofe'))));
if ($conf->global->OF_NB_TICKET_PER_PAGE != -1) {
echo '<p align="right"><input class="button" type="button" onclick="$(this).closest(\'form\').find(\'input[name=action]\').val(\'printTicket\'); $(this).closest(\'form\').submit(); " name="print" value="' . $langs->trans('ofPrintTicket') . '" /></p>';
}
$form->end();
// On n'affiche pas le bouton de création d'OF si on est sur la liste OF depuis l'onglet "OF" de la fiche commande
if ($fk_commande) {
$commande = new Commande($db);
$commande->fetch($fk_commande);
$r2 = new TSSRenderControler($assetOf);
$sql = "SELECT c.rowid as fk_commandedet, p.rowid as rowid, p.ref as refProd, p.label as nomProd, c.qty as qteCommandee, c.description, c.product_type";
$sql .= " FROM " . MAIN_DB_PREFIX . "commandedet c LEFT JOIN " . MAIN_DB_PREFIX . "product p";
$sql .= " ON (c.fk_product = p.rowid)";
$sql .= " WHERE c.product_type IN (0,9) AND c.fk_commande = " . $fk_commande;
$resql = $db->query($sql);
//var_dump($db);
$num = $db->num_rows($resql);
print_barre_liste($langs->trans('ListOrderProducts'), $page, "liste.php", $param, $sortfield, $sortorder, '', $num);
$i = 0;
$form = new TFormCore($_SERVER['PHP_SELF'], 'formMakeOk', 'post');
echo $form->hidden('fk_commande', __get('fk_commande', 0, 'int'));
echo $form->hidden('action', 'createOFCommande');
echo $form->hidden('fk_soc', $commande->socid);
echo $form->hidden('token', $_SESSION['newtoken']);
//.........这里部分代码省略.........
示例2: dol_now
/* *************************************************************************** */
/* */
/* Mode vue et edition */
/* */
/* *************************************************************************** */
$now = dol_now();
if ($id > 0 || !empty($ref)) {
dol_htmloutput_mesg($mesg, $mesgs);
$product_static = new Product($db);
$result = $object->fetch($id, $ref);
if ($result > 0) {
$soc = new Societe($db);
$soc->fetch($object->socid);
$author = new User($db);
$author->fetch($object->user_author_id);
$head = commande_prepare_head($object);
dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), 0, 'order');
$formconfirm = '';
/*
* Confirmation de la suppression de la commande
*/
if ($action == 'delete') {
$formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
}
/*
* Confirmation de la validation
*/
if ($action == 'validate') {
// on verifie si l'objet est en numerotation provisoire
$ref = substr($object->ref, 1, 4);
if ($ref == 'PROV') {
示例3: llxHeader
/*
* View
*/
llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes');
$html = new Form($db);
if ($id > 0 || ! empty($ref))
{
$soc = new Societe($db, $commande->socid);
$soc->fetch($commande->socid);
$head = commande_prepare_head($commande);
dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), 0, 'order');
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="18%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $html->showrefnav($commande,'ref','',1,'ref','ref');
print "</td></tr>";
// Ref commande client
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td nowrap>';
print $langs->trans('RefCustomer').'</td><td align="left">';
print '</td>';
示例4: fiche_import
function fiche_import(&$object, $error)
{
global $langs, $user;
$origin = GETPOST('origin');
$head = null;
if ($origin == 'propal') {
$head = propal_prepare_head($object);
} else {
$head = commande_prepare_head($object);
}
if (empty($user->rights->importdevis->myactions)) {
accessforbidden();
} else {
llxHeader();
$title = $langs->trans('Import');
if ($origin == 'propal') {
dol_fiche_head($head, 'importdevis', $title, 0, 'propal');
} else {
dol_fiche_head($head, 'importdevis', $title, 0, 'commande');
}
?>
<table width="100%" class="border">
<tr>
<td width="25%"><?php
echo $langs->trans('Ref');
?>
</td>
<td colspan="3"><div style="vertical-align: middle"><div class="inline-block floatleft refid"><?php
echo $object->ref;
?>
</div></div></td>
</tr>
<tr>
<td><?php
echo $langs->trans('Company');
?>
</td>
<td colspan="3"><?php
echo $object->thirdparty->getNomUrl(1);
?>
</td>
</tr>
<?php
if (!$error) {
?>
<tr>
<td><?php
echo $langs->trans('FileToImport');
?>
</td>
<td>
<form action="<?php
echo $_SERVER['PHP_SELF'];
?>
" method="POST" enctype="multipart/form-data">
<input name="action" type="hidden" value="send_file" />
<input name="id" type="hidden" value="<?php
echo $object->id;
?>
" />
<input name="origin" type="hidden" value="<?php
echo $origin;
?>
"/>
<input name="token" type="hidden" value="<?php
echo $_SESSION['newtoken'];
?>
" />
<input name="fileDGPF" type="file" />
<?php
echo $langs->trans('NbLineToAvoid');
?>
<input name="nb_line_to_avoid" type="number" value="<?php
echo (int) $conf->global->IMPORTPROPAL_NB_LINE_TO_AVOID;
?>
" size="2" />
<input class="button" type="submit" value="<?php
echo $langs->trans('SendFile');
?>
" />
</form>
</td>
</tr>
<?php
}
?>
</table>
<?php
dol_fiche_end();
llxFooter();
}
}