Qual: Mise en facteur du code de gestion des onglets commande

This commit is contained in:
Laurent Destailleur 2006-05-06 19:06:40 +00:00
parent 1aef3cbf9d
commit 41a5d50b5b
10 changed files with 200 additions and 330 deletions

View File

@ -30,6 +30,7 @@
*/
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
$user->getrights('commande');
$user->getrights('expedition');
@ -80,46 +81,9 @@ if ($_GET["id"] > 0) {
$soc = new Societe($db, $commande->socidp);
$soc->fetch($commande->socidp);
$h=0;
if ($conf->commande->enabled && $user->rights->commande->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans('OrderCard');
$h++;
}
if ($conf->expedition->enabled && $user->rights->expedition->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id;
$head[$h][1] = $langs->trans('SendingCard');
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans('ComptaCard');
$h++;
}
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Preview");
$hselected=$h;
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$commande->id;
$head[$h][1] = $langs->trans('Info');
$h++;
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$commande->id;
$head[$h][1] = $langs->trans('OrderContact');
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans('Order').': '.$commande->ref);
$head = commande_prepare_head($commande);
dolibarr_fiche_head($head, 'preview', $langs->trans("CustomerOrder"));
/*
@ -147,7 +111,7 @@ if ($_GET["id"] > 0) {
print '<table class="border" width="100%">';
// Reference
// Ref
print '<tr><td width="18%">'.$langs->trans("Ref")."</td>";
print '<td colspan="2">'.$commande->ref.'</td>';
print '<td width="50%">'.$langs->trans("Source").' : ' . $commande->sources[$commande->source] ;

View File

@ -30,7 +30,7 @@
require ("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
$langs->load("facture");
$langs->load("orders");
@ -216,71 +216,41 @@ if ( isset($mesg))
$id = $_GET["id"];
if ($id > 0)
{
$langs->trans("OrderCard");
$commande = New Commande($db);
if ( $commande->fetch($_GET['id'], $user->societe_id) > 0)
{
$soc = new Societe($db, $commande->socidp);
$soc->fetch($commande->socidp);
$langs->trans("OrderCard");
$commande = New Commande($db);
if ( $commande->fetch($_GET['id'], $user->societe_id) > 0)
{
$soc = new Societe($db, $commande->soc_id);
$soc->fetch($commande->soc_id);
$h=0;
if ($conf->commande->enabled && $user->rights->commande->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans("OrderCard");
$h++;
}
if ($conf->expedition->enabled && $user->rights->expedition->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id;
$head[$h][1] = $langs->trans("SendingCard");
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans("ComptaCard");
$h++;
}
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Info");
$h++;
//Ajout de longlet contacts
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$commande->id;
$head[$h][1] = $langs->trans('OrderContact');
$hselected = $h;
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Order").": $commande->ref");
$head = commande_prepare_head($commande);
dolibarr_fiche_head($head, 'contact', $langs->trans("CustomerOrder"));
/*
* Facture synthese pour rappel
*/
* Facture synthese pour rappel
*/
print '<table class="border" width="100%">';
// Reference de la commande
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $commande->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>';
print '</tr></table>';
print '</td><td colspan="3">';
print $commande->ref_client;
print '</td>';
print '</tr>';
// Customer
if ( is_null($commande->ref_client) )
$soc = new Societe($db);
$soc->fetch($commande->soc_id);
print "<tr><td>".$langs->trans("Customer")."</td>";
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">';
print '<b><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></b></td></tr>';
print "</table>";
@ -288,14 +258,14 @@ if ($id > 0)
print '</div>';
/*
* Lignes de contacts
*/
* Lignes de contacts
*/
echo '<br><table class="noborder" width="100%">';
/*
* Ajouter une ligne de contact
* Non affiché en mode modification de ligne
*/
* Ajouter une ligne de contact
* Non affiché en mode modification de ligne
*/
if ($_GET["action"] != 'editline' && $user->rights->facture->creer)
{
print '<tr class="liste_titre">';
@ -313,13 +283,13 @@ if ($id > 0)
print '<input type="hidden" name="source" value="internal">';
print '<input type="hidden" name="id" value="'.$id.'">';
// Ligne ajout pour contact interne
// Ligne ajout pour contact interne
print "<tr $bc[$var]>";
print '<td>';
print $langs->trans("Internal");
print '</td>';
print '</td>';
print '<td colspan="1">';
print $conf->global->MAIN_INFO_SOCIETE_NOM;
print '</td>';
@ -333,21 +303,21 @@ if ($id > 0)
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
print '</tr>';
print '</form>';
print '</form>';
print '<form action="contact.php?id='.$id.'" method="post">';
print '<input type="hidden" name="action" value="addcontact">';
print '<input type="hidden" name="source" value="external">';
print '<input type="hidden" name="id" value="'.$id.'">';
// Ligne ajout pour contact externe
// Ligne ajout pour contact externe
$var=!$var;
print "<tr $bc[$var]>";
print '<td>';
print $langs->trans("External");
print '</td>';
print '</td>';
print '<td colspan="1">';
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$commande->client->id;
$selectedCompany = select_societes_for_newconcat($commande, $selectedCompany, $htmlname = 'newcompany');
@ -361,12 +331,12 @@ if ($id > 0)
print '</td>';
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
print '</tr>';
print "</form>";
print '<tr><td colspan="6">&nbsp;</td></tr>';
print '<tr><td colspan="6">&nbsp;</td></tr>';
}
// Liste des contacts liés
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Source").'</td>';
@ -378,12 +348,12 @@ if ($id > 0)
print "</tr>\n";
$societe = new Societe($db);
$var = true;
$var = true;
foreach(array('internal','external') as $source)
{
$tab = $commande->liste_contact(-1,$source);
$num=sizeof($tab);
$tab = $commande->liste_contact(-1,$source);
$num=sizeof($tab);
$i = 0;
while ($i < $num)
@ -392,12 +362,12 @@ if ($id > 0)
print '<tr '.$bc[$var].' valign="top">';
// Source
// Source
print '<td align="left">';
if ($tab[$i]['source']=='internal') print $langs->trans("Internal");
if ($tab[$i]['source']=='external') print $langs->trans("External");
print '</td>';
print '</td>';
// Societe
print '<td align="left">';
if ($tab[$i]['socid'] > 0)
@ -405,15 +375,15 @@ if ($id > 0)
print '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$tab[$i]['socid'].'">';
print img_object($langs->trans("ShowCompany"),"company").' '.$societe->get_nom($tab[$i]['socid']);
print '</a>';
}
}
if ($tab[$i]['socid'] < 0)
{
print $conf->global->MAIN_INFO_SOCIETE_NOM;
}
print $conf->global->MAIN_INFO_SOCIETE_NOM;
}
if (! $tab[$i]['socid'])
{
print '&nbsp;';
}
{
print '&nbsp;';
}
print '</td>';
// Contact
@ -422,12 +392,12 @@ if ($id > 0)
{
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$tab[$i]['id'].'">';
print img_object($langs->trans("ShowUser"),"user").' '.$tab[$i]['nom'].'</a>';
}
}
if ($tab[$i]['source']=='external')
{
print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$tab[$i]['id'].'">';
print img_object($langs->trans("ShowContact"),"contact").' '.$tab[$i]['nom'].'</a>';
}
}
print '</td>';
// Type de contact
@ -437,11 +407,11 @@ if ($id > 0)
print '<td align="center">';
// Activation desativation du contact
if ($commande->statut >= 0)
print '<a href="contact.php?id='.$commande->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">';
print '<a href="contact.php?id='.$commande->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">';
print img_statut($tab[$i]['status']);
if ($commande->statut >= 0)
print '</a>';
print '</a>';
print '</td>';
// Icon update et delete (statut contrat 0=brouillon,1=validé,2=fermé)
@ -465,7 +435,7 @@ if ($id > 0)
}
else
{
// Contrat non trouvé
// Contrat non trouv
print "Contrat inexistant ou accés refusé";
}
}

View File

@ -37,6 +37,7 @@ require_once(DOL_DOCUMENT_ROOT.'/propal.class.php');
require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
require_once(DOL_DOCUMENT_ROOT.'/actioncomm.class.php');
require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php');
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
$langs->load('orders');
$langs->load('sendings');
@ -732,47 +733,8 @@ else
$author->id = $commande->user_author_id;
$author->fetch();
$h=0;
if ($conf->commande->enabled && $user->rights->commande->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans('OrderCard');
$hselected = $h;
$h++;
}
if ($conf->expedition->enabled && $user->rights->expedition->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id;
$head[$h][1] = $langs->trans('SendingCard');
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans('ComptaCard');
$h++;
}
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$commande->id;
$head[$h][1] = $langs->trans('Info');
$h++;
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$commande->id;
$head[$h][1] = $langs->trans('OrderContact');
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans('Order').': '.$commande->ref);
$head = commande_prepare_head($commande);
dolibarr_fiche_head($head, 'order', $langs->trans("CustomerOrder"));
/*
* Confirmation de la suppression de la commande

View File

@ -29,7 +29,8 @@
*/
require("./pre.inc.php");
require_once (DOL_DOCUMENT_ROOT."/commande/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
$langs->load("orders");
$langs->load("sendings");
@ -45,49 +46,11 @@ llxHeader();
$commande = new Commande($db);
$commande->fetch($_GET["id"]);
$commande->info($_GET["id"]);
$soc = new Societe($db, $commande->socidp);
$soc->fetch($commande->socidp);
$soc = new Societe($db, $commande->soc_id);
$soc->fetch($commande->soc_id);
$h = 0;
if ($conf->commande->enabled && $user->rights->commande->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans("OrderCard");
$h++;
}
if ($conf->expedition->enabled && $user->rights->expedition->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id;
$head[$h][1] = $langs->trans("SendingCard");
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans("ComptaCard");
$h++;
}
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Info");
$hselected = $h;
$h++;
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$commande->id;
$head[$h][1] = $langs->trans('OrderContact');
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Order").": $commande->ref");
$head = commande_prepare_head($commande);
dolibarr_fiche_head($head, 'info', $langs->trans("CustomerOrder"));
print '<table width="100%"><tr><td>';

View File

@ -29,31 +29,28 @@
*/
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/project.class.php");
$langs->load("orders");
$langs->load("sendings");
$langs->load("companies");
$langs->load("bills");
$langs->load("propal");
$user->getrights('facture');
$user->getrights('commande');
if (! $user->rights->commande->lire) accessforbidden();
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
/*
* Sécurité accés client
*/
// Sécurité accés client
if ($user->societe_id > 0)
{
$action = '';
$socidp = $user->societe_id;
}
/*
*
* Actions
*/
if ($_GET["action"] == 'facturee')
@ -87,46 +84,8 @@ if ($_GET["id"] > 0)
$author->id = $commande->user_author_id;
$author->fetch();
$h=0;
if ($conf->commande->enabled && $user->rights->commande->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans("OrderCard");
$h++;
}
if ($conf->expedition->enabled && $user->rights->expedition->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id;
$head[$h][1] = $langs->trans("SendingCard");
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans("ComptaCard");
$hselected = $h;
$h++;
}
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Info");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$commande->id;
$head[$h][1] = $langs->trans('OrderContact');
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Order").": $commande->ref");
$head = commande_prepare_head($commande);
dolibarr_fiche_head($head, 'accountancy', $langs->trans("CustomerOrder"));
/*
* Commande

View File

@ -34,6 +34,7 @@ require_once(DOL_DOCUMENT_ROOT."/product.class.php");
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
$langs->load("bills");
@ -87,46 +88,8 @@ if ($_GET["id"] > 0)
$author->id = $commande->user_author_id;
$author->fetch();
$h=0;
if ($conf->commande->enabled && $user->rights->commande->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans("OrderCard");
$h++;
}
if ($conf->expedition->enabled && $user->rights->expedition->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id;
$head[$h][1] = $langs->trans("SendingCard");
$hselected = $h;
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans("ComptaCard");
$h++;
}
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Info");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$commande->id;
$head[$h][1] = $langs->trans('OrderContact');
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Order").": $commande->ref");
$head = commande_prepare_head($commande);
dolibarr_fiche_head($head, 'shipping', $langs->trans("CustomerOrder"));
/*
* Confirmation de la validation

View File

@ -8,6 +8,8 @@ OrderDate=Date commande
NewOrder=New order
SupplierOrder=Supplier order
SuppliersOrders=Suppliers' orders
CustomerOrder=Customer order
CustomersOrders=Customers' orders
OrdersToValid=Orders to valid
OrdersToBill=Orders to bill
OrdersInProcess=Orders in process

View File

@ -8,6 +8,8 @@ OrderDate=Date commande
NewOrder=Nouvelle commande
SupplierOrder=Commande fournisseur
SuppliersOrders=Commandes fournisseurs
CustomerOrder=Commande client
CustomersOrders=Commandes client
OrdersToValid=Commandes à valider
OrdersToBill=Commandes à facturer
OrdersInProcess=Commandes en traitement

View File

@ -1,4 +1,4 @@
<?php
<?php
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
@ -23,43 +23,42 @@
/**
\file htdocs/lib/company.lib.php
\brief Ensemble de fonctions de base pour le module societe
\version $Revision$
\ingroup societe
\version $Revision$
Ensemble de fonctions de base de dolibarr sous forme d'include
*/
function societe_prepare_head($objsoc)
{
global $langs, $conf;
$h = 0;
$head = array();
$h = 0;
*/
function societe_prepare_head($objsoc)
{
global $langs, $conf;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Company");
$head[$h][2] = 'company';
$head[$h][1] = $langs->trans("Company");
$head[$h][2] = 'company';
$h++;
if ($objsoc->client==1)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Customer");;
$head[$h][2] = 'customer';
$head[$h][2] = 'customer';
$h++;
}
if ($objsoc->client==2)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$objsoc->id;
$head[$h][1] = $langs->trans("Prospect");
$head[$h][2] = 'prospect';
$head[$h][2] = 'prospect';
$h++;
}
if ($objsoc->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Supplier");
$head[$h][2] = 'supplier';
$head[$h][2] = 'supplier';
$h++;
}
@ -68,20 +67,20 @@ function societe_prepare_head($objsoc)
$langs->load("compta");
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Accountancy");
$head[$h][2] = 'compta';
$head[$h][2] = 'compta';
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Note");
$head[$h][2] = 'note';
$head[$h][2] = 'note';
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Documents");
$head[$h][2] = 'document';
$head[$h][2] = 'document';
$h++;
}
@ -89,13 +88,13 @@ function societe_prepare_head($objsoc)
{
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Notifications");
$head[$h][2] = 'notify';
$head[$h][2] = 'notify';
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$head[$h][2] = 'info';
$h++;
if ($user->societe_id == 0)
@ -104,9 +103,9 @@ function societe_prepare_head($objsoc)
$head[$h][1] = img_object($langs->trans("BookmarkThisPage"),'bookmark');
$head[$h][2] = 'image';
$h++;
}
return $head;
}
}
return $head;
}
?>

86
htdocs/lib/order.lib.php Normal file
View File

@ -0,0 +1,86 @@
<?php
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/
*
* $Id$
* $Source$
*/
/**
\file htdocs/lib/order.lib.php
\brief Ensemble de fonctions de base pour le module commande
\ingroup commande
\version $Revision$
Ensemble de fonctions de base de dolibarr sous forme d'include
*/
function commande_prepare_head($commande)
{
global $langs, $conf, $user;
if ($conf->expedition->enabled) $langs->load("sendings");
$h = 0;
$head = array();
if ($conf->commande->enabled && $user->rights->commande->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans("OrderCard");
$head[$h][2] = 'order';
$h++;
}
if ($conf->expedition->enabled && $user->rights->expedition->lire)
{
$head[$h][0] = DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id;
$head[$h][1] = $langs->trans("SendingCard");
$head[$h][2] = 'shipping';
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id;
$head[$h][1] = $langs->trans("ComptaCard");
$head[$h][2] = 'accountancy';
$hselected = $h;
$h++;
}
if ($conf->use_preview_tabs)
{
$head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Preview");
$head[$h][2] = 'preview';
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$commande->id;
$head[$h][1] = $langs->trans('OrderContact');
$head[$h][2] = 'contact';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$commande->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
return $head;
}
?>