Qual: Mise en facteur du code de gestion des onglets commande
This commit is contained in:
parent
1aef3cbf9d
commit
41a5d50b5b
@ -30,6 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
|
||||||
|
|
||||||
$user->getrights('commande');
|
$user->getrights('commande');
|
||||||
$user->getrights('expedition');
|
$user->getrights('expedition');
|
||||||
@ -80,46 +81,9 @@ if ($_GET["id"] > 0) {
|
|||||||
$soc = new Societe($db, $commande->socidp);
|
$soc = new Societe($db, $commande->socidp);
|
||||||
$soc->fetch($commande->socidp);
|
$soc->fetch($commande->socidp);
|
||||||
|
|
||||||
$h=0;
|
|
||||||
|
|
||||||
if ($conf->commande->enabled && $user->rights->commande->lire)
|
$head = commande_prepare_head($commande);
|
||||||
{
|
dolibarr_fiche_head($head, 'preview', $langs->trans("CustomerOrder"));
|
||||||
$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);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -147,7 +111,7 @@ if ($_GET["id"] > 0) {
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Reference
|
// Ref
|
||||||
print '<tr><td width="18%">'.$langs->trans("Ref")."</td>";
|
print '<tr><td width="18%">'.$langs->trans("Ref")."</td>";
|
||||||
print '<td colspan="2">'.$commande->ref.'</td>';
|
print '<td colspan="2">'.$commande->ref.'</td>';
|
||||||
print '<td width="50%">'.$langs->trans("Source").' : ' . $commande->sources[$commande->source] ;
|
print '<td width="50%">'.$langs->trans("Source").' : ' . $commande->sources[$commande->source] ;
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
require ("./pre.inc.php");
|
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."/contact.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("facture");
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
@ -216,71 +216,41 @@ if ( isset($mesg))
|
|||||||
$id = $_GET["id"];
|
$id = $_GET["id"];
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
$langs->trans("OrderCard");
|
$langs->trans("OrderCard");
|
||||||
$commande = New Commande($db);
|
$commande = New Commande($db);
|
||||||
if ( $commande->fetch($_GET['id'], $user->societe_id) > 0)
|
if ( $commande->fetch($_GET['id'], $user->societe_id) > 0)
|
||||||
{
|
{
|
||||||
$soc = new Societe($db, $commande->socidp);
|
$soc = new Societe($db, $commande->soc_id);
|
||||||
$soc->fetch($commande->socidp);
|
$soc->fetch($commande->soc_id);
|
||||||
|
|
||||||
$h=0;
|
|
||||||
|
|
||||||
if ($conf->commande->enabled && $user->rights->commande->lire)
|
$head = commande_prepare_head($commande);
|
||||||
{
|
dolibarr_fiche_head($head, 'contact', $langs->trans("CustomerOrder"));
|
||||||
$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");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Facture synthese pour rappel
|
* Facture synthese pour rappel
|
||||||
*/
|
*/
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Reference de la commande
|
// Ref
|
||||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
print $commande->ref;
|
print $commande->ref;
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Customer
|
// Ref commande client
|
||||||
if ( is_null($commande->ref_client) )
|
print '<tr><td>';
|
||||||
$soc = new Societe($db);
|
print '<table class="nobordernopadding" width="100%"><tr><td nowrap>';
|
||||||
$soc->fetch($commande->soc_id);
|
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>';
|
||||||
|
|
||||||
print "<tr><td>".$langs->trans("Customer")."</td>";
|
// Customer
|
||||||
|
print "<tr><td>".$langs->trans("Company")."</td>";
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print '<b><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></b></td></tr>';
|
print '<b><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></b></td></tr>';
|
||||||
print "</table>";
|
print "</table>";
|
||||||
@ -288,14 +258,14 @@ if ($id > 0)
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lignes de contacts
|
* Lignes de contacts
|
||||||
*/
|
*/
|
||||||
echo '<br><table class="noborder" width="100%">';
|
echo '<br><table class="noborder" width="100%">';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ajouter une ligne de contact
|
* Ajouter une ligne de contact
|
||||||
* Non affiché en mode modification de ligne
|
* Non affiché en mode modification de ligne
|
||||||
*/
|
*/
|
||||||
if ($_GET["action"] != 'editline' && $user->rights->facture->creer)
|
if ($_GET["action"] != 'editline' && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -313,12 +283,12 @@ if ($id > 0)
|
|||||||
print '<input type="hidden" name="source" value="internal">';
|
print '<input type="hidden" name="source" value="internal">';
|
||||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
|
|
||||||
// Ligne ajout pour contact interne
|
// Ligne ajout pour contact interne
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $langs->trans("Internal");
|
print $langs->trans("Internal");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
print $conf->global->MAIN_INFO_SOCIETE_NOM;
|
print $conf->global->MAIN_INFO_SOCIETE_NOM;
|
||||||
@ -333,20 +303,20 @@ if ($id > 0)
|
|||||||
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
print '<form action="contact.php?id='.$id.'" method="post">';
|
print '<form action="contact.php?id='.$id.'" method="post">';
|
||||||
print '<input type="hidden" name="action" value="addcontact">';
|
print '<input type="hidden" name="action" value="addcontact">';
|
||||||
print '<input type="hidden" name="source" value="external">';
|
print '<input type="hidden" name="source" value="external">';
|
||||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
|
|
||||||
// Ligne ajout pour contact externe
|
// Ligne ajout pour contact externe
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $langs->trans("External");
|
print $langs->trans("External");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$commande->client->id;
|
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$commande->client->id;
|
||||||
@ -364,7 +334,7 @@ if ($id > 0)
|
|||||||
|
|
||||||
print "</form>";
|
print "</form>";
|
||||||
|
|
||||||
print '<tr><td colspan="6"> </td></tr>';
|
print '<tr><td colspan="6"> </td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Liste des contacts liés
|
// Liste des contacts liés
|
||||||
@ -378,12 +348,12 @@ if ($id > 0)
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$societe = new Societe($db);
|
$societe = new Societe($db);
|
||||||
$var = true;
|
$var = true;
|
||||||
|
|
||||||
foreach(array('internal','external') as $source)
|
foreach(array('internal','external') as $source)
|
||||||
{
|
{
|
||||||
$tab = $commande->liste_contact(-1,$source);
|
$tab = $commande->liste_contact(-1,$source);
|
||||||
$num=sizeof($tab);
|
$num=sizeof($tab);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
@ -392,11 +362,11 @@ if ($id > 0)
|
|||||||
|
|
||||||
print '<tr '.$bc[$var].' valign="top">';
|
print '<tr '.$bc[$var].' valign="top">';
|
||||||
|
|
||||||
// Source
|
// Source
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
if ($tab[$i]['source']=='internal') print $langs->trans("Internal");
|
if ($tab[$i]['source']=='internal') print $langs->trans("Internal");
|
||||||
if ($tab[$i]['source']=='external') print $langs->trans("External");
|
if ($tab[$i]['source']=='external') print $langs->trans("External");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Societe
|
// Societe
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
@ -405,15 +375,15 @@ if ($id > 0)
|
|||||||
print '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$tab[$i]['socid'].'">';
|
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 img_object($langs->trans("ShowCompany"),"company").' '.$societe->get_nom($tab[$i]['socid']);
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
if ($tab[$i]['socid'] < 0)
|
if ($tab[$i]['socid'] < 0)
|
||||||
{
|
{
|
||||||
print $conf->global->MAIN_INFO_SOCIETE_NOM;
|
print $conf->global->MAIN_INFO_SOCIETE_NOM;
|
||||||
}
|
}
|
||||||
if (! $tab[$i]['socid'])
|
if (! $tab[$i]['socid'])
|
||||||
{
|
{
|
||||||
print ' ';
|
print ' ';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Contact
|
// Contact
|
||||||
@ -422,12 +392,12 @@ if ($id > 0)
|
|||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$tab[$i]['id'].'">';
|
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$tab[$i]['id'].'">';
|
||||||
print img_object($langs->trans("ShowUser"),"user").' '.$tab[$i]['nom'].'</a>';
|
print img_object($langs->trans("ShowUser"),"user").' '.$tab[$i]['nom'].'</a>';
|
||||||
}
|
}
|
||||||
if ($tab[$i]['source']=='external')
|
if ($tab[$i]['source']=='external')
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$tab[$i]['id'].'">';
|
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 img_object($langs->trans("ShowContact"),"contact").' '.$tab[$i]['nom'].'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Type de contact
|
// Type de contact
|
||||||
@ -437,11 +407,11 @@ if ($id > 0)
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
// Activation desativation du contact
|
// Activation desativation du contact
|
||||||
if ($commande->statut >= 0)
|
if ($commande->statut >= 0)
|
||||||
print '<a href="contact.php?id='.$commande->id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].'">';
|
print '<a href="contact.php?id='.$commande->id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].'">';
|
||||||
print img_statut($tab[$i]['status']);
|
print img_statut($tab[$i]['status']);
|
||||||
|
|
||||||
if ($commande->statut >= 0)
|
if ($commande->statut >= 0)
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Icon update et delete (statut contrat 0=brouillon,1=validé,2=fermé)
|
// Icon update et delete (statut contrat 0=brouillon,1=validé,2=fermé)
|
||||||
@ -465,7 +435,7 @@ if ($id > 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Contrat non trouvé
|
// Contrat non trouv
|
||||||
print "Contrat inexistant ou accés refusé";
|
print "Contrat inexistant ou accés refusé";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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.'/commande/commande.class.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/actioncomm.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/CMailFile.class.php');
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
|
||||||
|
|
||||||
$langs->load('orders');
|
$langs->load('orders');
|
||||||
$langs->load('sendings');
|
$langs->load('sendings');
|
||||||
@ -732,47 +733,8 @@ else
|
|||||||
$author->id = $commande->user_author_id;
|
$author->id = $commande->user_author_id;
|
||||||
$author->fetch();
|
$author->fetch();
|
||||||
|
|
||||||
$h=0;
|
$head = commande_prepare_head($commande);
|
||||||
|
dolibarr_fiche_head($head, 'order', $langs->trans("CustomerOrder"));
|
||||||
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);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la suppression de la commande
|
* Confirmation de la suppression de la commande
|
||||||
|
|||||||
@ -29,7 +29,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
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("orders");
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
@ -45,49 +46,11 @@ llxHeader();
|
|||||||
$commande = new Commande($db);
|
$commande = new Commande($db);
|
||||||
$commande->fetch($_GET["id"]);
|
$commande->fetch($_GET["id"]);
|
||||||
$commande->info($_GET["id"]);
|
$commande->info($_GET["id"]);
|
||||||
$soc = new Societe($db, $commande->socidp);
|
$soc = new Societe($db, $commande->soc_id);
|
||||||
$soc->fetch($commande->socidp);
|
$soc->fetch($commande->soc_id);
|
||||||
|
|
||||||
$h = 0;
|
$head = commande_prepare_head($commande);
|
||||||
|
dolibarr_fiche_head($head, 'info', $langs->trans("CustomerOrder"));
|
||||||
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");
|
|
||||||
|
|
||||||
|
|
||||||
print '<table width="100%"><tr><td>';
|
print '<table width="100%"><tr><td>';
|
||||||
|
|||||||
@ -29,31 +29,28 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
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("orders");
|
||||||
$langs->load("sendings");
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("propal");
|
|
||||||
|
|
||||||
$user->getrights('facture');
|
$user->getrights('commande');
|
||||||
|
|
||||||
if (! $user->rights->commande->lire) accessforbidden();
|
if (! $user->rights->commande->lire) accessforbidden();
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
// Sécurité accés client
|
||||||
require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Sécurité accés client
|
|
||||||
*/
|
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socidp = $user->societe_id;
|
$socidp = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_GET["action"] == 'facturee')
|
if ($_GET["action"] == 'facturee')
|
||||||
@ -87,46 +84,8 @@ if ($_GET["id"] > 0)
|
|||||||
$author->id = $commande->user_author_id;
|
$author->id = $commande->user_author_id;
|
||||||
$author->fetch();
|
$author->fetch();
|
||||||
|
|
||||||
$h=0;
|
$head = commande_prepare_head($commande);
|
||||||
|
dolibarr_fiche_head($head, 'accountancy', $langs->trans("CustomerOrder"));
|
||||||
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");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Commande
|
* Commande
|
||||||
|
|||||||
@ -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."/project.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/propal.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."/product/stock/entrepot.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
@ -87,46 +88,8 @@ if ($_GET["id"] > 0)
|
|||||||
$author->id = $commande->user_author_id;
|
$author->id = $commande->user_author_id;
|
||||||
$author->fetch();
|
$author->fetch();
|
||||||
|
|
||||||
$h=0;
|
$head = commande_prepare_head($commande);
|
||||||
|
dolibarr_fiche_head($head, 'shipping', $langs->trans("CustomerOrder"));
|
||||||
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");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la validation
|
* Confirmation de la validation
|
||||||
|
|||||||
@ -8,6 +8,8 @@ OrderDate=Date commande
|
|||||||
NewOrder=New order
|
NewOrder=New order
|
||||||
SupplierOrder=Supplier order
|
SupplierOrder=Supplier order
|
||||||
SuppliersOrders=Suppliers' orders
|
SuppliersOrders=Suppliers' orders
|
||||||
|
CustomerOrder=Customer order
|
||||||
|
CustomersOrders=Customers' orders
|
||||||
OrdersToValid=Orders to valid
|
OrdersToValid=Orders to valid
|
||||||
OrdersToBill=Orders to bill
|
OrdersToBill=Orders to bill
|
||||||
OrdersInProcess=Orders in process
|
OrdersInProcess=Orders in process
|
||||||
|
|||||||
@ -8,6 +8,8 @@ OrderDate=Date commande
|
|||||||
NewOrder=Nouvelle commande
|
NewOrder=Nouvelle commande
|
||||||
SupplierOrder=Commande fournisseur
|
SupplierOrder=Commande fournisseur
|
||||||
SuppliersOrders=Commandes fournisseurs
|
SuppliersOrders=Commandes fournisseurs
|
||||||
|
CustomerOrder=Commande client
|
||||||
|
CustomersOrders=Commandes client
|
||||||
OrdersToValid=Commandes à valider
|
OrdersToValid=Commandes à valider
|
||||||
OrdersToBill=Commandes à facturer
|
OrdersToBill=Commandes à facturer
|
||||||
OrdersInProcess=Commandes en traitement
|
OrdersInProcess=Commandes en traitement
|
||||||
|
|||||||
@ -23,7 +23,8 @@
|
|||||||
/**
|
/**
|
||||||
\file htdocs/lib/company.lib.php
|
\file htdocs/lib/company.lib.php
|
||||||
\brief Ensemble de fonctions de base pour le module societe
|
\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
|
Ensemble de fonctions de base de dolibarr sous forme d'include
|
||||||
*/
|
*/
|
||||||
@ -34,8 +35,6 @@ function societe_prepare_head($objsoc)
|
|||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$h = 0;
|
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$objsoc->id;
|
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$objsoc->id;
|
||||||
$head[$h][1] = $langs->trans("Company");
|
$head[$h][1] = $langs->trans("Company");
|
||||||
$head[$h][2] = 'company';
|
$head[$h][2] = 'company';
|
||||||
|
|||||||
86
htdocs/lib/order.lib.php
Normal file
86
htdocs/lib/order.lib.php
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
Loading…
Reference in New Issue
Block a user