New: Ajout page admin pour purger les fichiers de documents
New: Quelques amliorations mineures sur expditions Trad: Un peu plus de traduction sur expditions
This commit is contained in:
parent
496e780434
commit
1d5b45e5e1
@ -570,6 +570,6 @@ if (window.parent.frames[1]) {
|
||||
|
||||
<?php
|
||||
|
||||
llxFooter();
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
|
||||
?>
|
||||
@ -23,8 +23,8 @@
|
||||
\file htdocs/admin/tools/dolibarr_import.php
|
||||
\brief Page import de la base
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".lib.php";
|
||||
|
||||
@ -36,16 +36,16 @@ if (! $user->admin)
|
||||
|
||||
llxHeader();
|
||||
|
||||
print_fiche_titre($langs->trans("Restore"),'','setup');
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b><br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print $langs->trans("FeatureNotYetAvailable");
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
print_fiche_titre($langs->trans("Restore"),'','setup');
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b><br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print $langs->trans("FeatureNotYetAvailable");
|
||||
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
|
||||
?>
|
||||
@ -196,5 +196,5 @@ print '<br>';
|
||||
|
||||
$time_end = time();
|
||||
|
||||
llxFooter();
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
@ -52,6 +52,7 @@ print "<br>";
|
||||
if ($message) print $message.'<br>';
|
||||
|
||||
|
||||
print $langs->trans("SystemToolsAreaDesc").'<br>';
|
||||
|
||||
|
||||
|
||||
|
||||
@ -41,6 +41,7 @@ function llxHeader($head = "", $urlp = "")
|
||||
$menu->add(DOL_URL_ROOT."/admin/tools/index.php", "SystemTools");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_export.php", $langs->trans("Backup"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_import.php", $langs->trans("Restore"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/admin/tools/purge.php", $langs->trans("Purge"));
|
||||
|
||||
left_menu($menu->liste);
|
||||
}
|
||||
|
||||
@ -50,20 +50,16 @@ class Expedition extends CommonObject
|
||||
*/
|
||||
function Expedition($DB)
|
||||
{
|
||||
$this->db = $DB;
|
||||
$this->lignes = array();
|
||||
global $langs;
|
||||
|
||||
$this->sources[0] = "Proposition commerciale";
|
||||
$this->sources[1] = "Internet";
|
||||
$this->sources[2] = "Courrier";
|
||||
$this->sources[3] = "Téléphone";
|
||||
$this->sources[4] = "Fax";
|
||||
|
||||
$this->statuts[-1] = "Annulée";
|
||||
$this->statuts[0] = "Brouillon";
|
||||
$this->statuts[1] = "Validée";
|
||||
|
||||
$this->products = array();
|
||||
$this->db = $DB;
|
||||
$this->lignes = array();
|
||||
|
||||
$this->statuts[-1] = $langs->trans("Canceled");
|
||||
$this->statuts[0] = $langs->trans("Draft");
|
||||
$this->statuts[1] = $langs->trans("Validated");
|
||||
|
||||
$this->products = array();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -729,6 +725,10 @@ class Expedition extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\class ExpeditionLigne
|
||||
\brief Classe de gestion des lignes de bons d'expedition
|
||||
*/
|
||||
class ExpeditionLigne
|
||||
{
|
||||
var $db;
|
||||
@ -743,7 +743,8 @@ class ExpeditionLigne
|
||||
var $libelle; // Label produit
|
||||
var $product_desc; // Description produit
|
||||
var $ref;
|
||||
|
||||
|
||||
|
||||
function ExpeditionLigne($DB)
|
||||
{
|
||||
$this->db=$DB;
|
||||
|
||||
@ -48,7 +48,7 @@ if (!$user->rights->expedition->lire)
|
||||
|
||||
|
||||
// Sécurité accés client
|
||||
if ($user->societe_id > 0)
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
@ -59,20 +59,20 @@ if ($user->societe_id > 0)
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_POST["action"] == 'add')
|
||||
if ($_POST["action"] == 'add')
|
||||
{
|
||||
// \todo Mettre id entrepot sur ligne detail expedition et non sur fiche expedition
|
||||
|
||||
|
||||
$db->begin();
|
||||
|
||||
|
||||
// Creation de l'objet expedition
|
||||
$expedition = new Expedition($db);
|
||||
|
||||
|
||||
$expedition->date_expedition = time();
|
||||
$expedition->note = $_POST["note"];
|
||||
$expedition->commande_id = $_POST["commande_id"];
|
||||
$expedition->entrepot_id = $_POST["entrepot_id"];
|
||||
|
||||
|
||||
// On boucle sur chaque ligne de commande pour compléter objet expedition
|
||||
// avec qté à livrer
|
||||
$commande = new Commande($db);
|
||||
@ -87,7 +87,7 @@ if ($_POST["action"] == 'add')
|
||||
$expedition->addline($_POST[$idl],$_POST[$qty]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$ret=$expedition->create($user);
|
||||
if ($ret > 0)
|
||||
{
|
||||
@ -125,7 +125,7 @@ if ($_POST["action"] == 'confirm_valid' && $_POST["confirm"] == 'yes' && $user->
|
||||
|
||||
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes')
|
||||
{
|
||||
if ($user->rights->expedition->supprimer )
|
||||
if ($user->rights->expedition->supprimer )
|
||||
{
|
||||
$expedition = new Expedition($db);
|
||||
$expedition->fetch($_GET["id"]);
|
||||
@ -158,7 +158,7 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
|
||||
{
|
||||
dolibarr_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -175,7 +175,7 @@ $html = new Form($db);
|
||||
* Mode creation
|
||||
*
|
||||
*********************************************************************/
|
||||
if ($_GET["action"] == 'create')
|
||||
if ($_GET["action"] == 'create')
|
||||
{
|
||||
|
||||
print_titre($langs->trans("CreateASending"));
|
||||
@ -382,11 +382,11 @@ if ($_GET["action"] == 'create')
|
||||
else
|
||||
{
|
||||
$this->error=$db->error();
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
print '<td align="left">';
|
||||
$html->select_array('warehouse'.$i,$array,'',1,0,0);
|
||||
$html->select_array('warehouse'.$i,$array,'',1,0,0);
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
@ -418,62 +418,62 @@ if ($_GET["action"] == 'create')
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
/* *************************************************************************** */
|
||||
/* */
|
||||
/* Mode vue et edition */
|
||||
/* */
|
||||
/* *************************************************************************** */
|
||||
{
|
||||
{
|
||||
if ($_GET["id"] > 0)
|
||||
{
|
||||
$expedition = New Expedition($db);
|
||||
$result = $expedition->fetch($_GET["id"]);
|
||||
|
||||
|
||||
if ($expedition->id > 0)
|
||||
{
|
||||
$author = new User($db);
|
||||
$author->id = $expedition->user_author_id;
|
||||
$author->fetch();
|
||||
|
||||
|
||||
$commande = New Commande($db);
|
||||
$commande->fetch($expedition->commande_id);
|
||||
|
||||
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($commande->socid);
|
||||
|
||||
|
||||
$h=0;
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/fiche.php?id=".$expedition->id;
|
||||
$head[$h][1] = $langs->trans("SendingCard");
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
|
||||
|
||||
if ($conf->livraison->enabled && $expedition->livraison_id)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/livraison/fiche.php?id=".$expedition->livraison_id;
|
||||
$head[$h][1] = $langs->trans("DeliveryCard");
|
||||
$h++;
|
||||
}
|
||||
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Sending"));
|
||||
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == 'delete')
|
||||
{
|
||||
$html->form_confirm("fiche.php?id=$expedition->id","Supprimer l'expedition","Etes-vous sûr de vouloir supprimer cette expedition ?","confirm_delete");
|
||||
$html->form_confirm("fiche.php?id=$expedition->id",$langs->trans("DeleteSending"),"Etes-vous sûr de vouloir supprimer cette expedition ?","confirm_delete");
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Confirmation de la validation
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == 'valid')
|
||||
{
|
||||
$html->form_confirm("fiche.php?id=$expedition->id","Valider l'expédition","Etes-vous sûr de vouloir valider cette expédition ?","confirm_valid");
|
||||
$html->form_confirm("fiche.php?id=$expedition->id",$langs->trans("ValidateSending"),"Etes-vous sûr de vouloir valider cette expédition ?","confirm_valid");
|
||||
print '<br>';
|
||||
}
|
||||
/*
|
||||
@ -482,10 +482,10 @@ else
|
||||
*/
|
||||
if ($_GET["action"] == 'annuler')
|
||||
{
|
||||
$html->form_confirm("fiche.php?id=$expedition->id",$langs->trans("Cancel"),"Etes-vous sûr de vouloir annuler cette commande ?","confirm_cancel");
|
||||
$html->form_confirm("fiche.php?id=$expedition->id",$langs->trans("CancelSending"),"Etes-vous sûr de vouloir annuler cette commande ?","confirm_cancel");
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Commande
|
||||
*/
|
||||
@ -494,67 +494,57 @@ else
|
||||
print '<form action="fiche.php?id='.$expedition->id.'" method="post">';
|
||||
print '<input type="hidden" name="action" value="setremise">';
|
||||
}
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3">'.$expedition->ref.'</td></tr>';
|
||||
|
||||
|
||||
// Client
|
||||
print '<tr><td width="20%">'.$langs->trans("Customer").'</td>';
|
||||
print '<td colspan="3">'.$soc->getNomUrl(1).'</td>';
|
||||
print "</tr>";
|
||||
|
||||
|
||||
// Commande liée
|
||||
print '<tr><td>'.$langs->trans("RefOrder").'</td>';
|
||||
print '<td colspan="3"><a href="'.DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id.'">'.img_object($langs->trans("ShowOrder"),'order').' '.$commande->ref."</a></td>\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Commande liée
|
||||
print '<tr><td>'.$langs->trans("RefCustomerOrderShort").'</td>';
|
||||
print '<td colspan="3"><a href="'.DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id.'">'.$commande->ref_client."</a></td>\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Date
|
||||
print '<tr><td>'.$langs->trans("Date").'</td>';
|
||||
print '<td colspan="3">'.dolibarr_print_date($expedition->date,"%A %d %B %Y")."</td>\n";
|
||||
print '</tr>';
|
||||
print '</tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="3">'.$expedition->getLibStatut(4)."</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
if (!$conf->expedition->enabled && $conf->stock->enabled)
|
||||
{
|
||||
// Entrepot
|
||||
$entrepot = new Entrepot($db);
|
||||
$entrepot->fetch($expedition->entrepot_id);
|
||||
print '<tr><td width="20%">'.$langs->trans("Warehouse").'</td>';
|
||||
print '<td colspan="3"><a href="'.DOL_URL_ROOT.'/product/stock/fiche.php?id='.$entrepot->id.'">'.$entrepot->libelle.'</a></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
/*
|
||||
* Lignes produits
|
||||
*/
|
||||
echo '<br><table class="noborder" width="100%">';
|
||||
|
||||
|
||||
$sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande,";
|
||||
$sql .= " e.fk_statut, ed.qty as qty_livre";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd , ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."expedition as e";
|
||||
$sql .= " WHERE e.rowid = ".$expedition->id." AND e.rowid = ed.fk_expedition AND cd.rowid = ed.fk_commande_ligne";
|
||||
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$num_prod = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Products").'</td>';
|
||||
print '<td align="center">'.$langs->trans("QtyOrdered").'</td>';
|
||||
@ -566,20 +556,24 @@ else
|
||||
{
|
||||
print '<td align="center">'.$langs->trans("QtyShipped").'</td>';
|
||||
}
|
||||
if ($conf->stock->enabled)
|
||||
{
|
||||
print '<td align="left">'.$langs->trans("WarehouseSource").'</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$var=true;
|
||||
while ($i < $num_prod)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
if ($objp->fk_product > 0)
|
||||
{
|
||||
$product = new Product($db);
|
||||
$product->fetch($objp->fk_product);
|
||||
|
||||
|
||||
print '<td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.'</a> - '.$product->libelle;
|
||||
if ($objp->description) print '<br>'.nl2br($objp->description);
|
||||
@ -587,13 +581,26 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td>".stripslashes(nl2br($objp->description))."</td>\n";
|
||||
print "<td>".nl2br($objp->description)."</td>\n";
|
||||
}
|
||||
|
||||
// Qte commandé
|
||||
print '<td align="center">'.$objp->qty_commande.'</td>';
|
||||
|
||||
// Qte a expedier ou expedier
|
||||
print '<td align="center">'.$objp->qty_livre.'</td>';
|
||||
|
||||
|
||||
// Entrepot source
|
||||
if ($conf->stock->enabled)
|
||||
{
|
||||
$entrepot = new Entrepot($db);
|
||||
$entrepot->fetch($expedition->entrepot_id);
|
||||
print '<td align="left">'.$entrepot->getNomUrl(1).'</td>';
|
||||
}
|
||||
|
||||
|
||||
print "</tr>";
|
||||
|
||||
|
||||
$i++;
|
||||
$var=!$var;
|
||||
}
|
||||
@ -603,63 +610,66 @@ else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
print "\n</div>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Boutons actions
|
||||
*/
|
||||
|
||||
|
||||
if ($user->societe_id == 0)
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($expedition->statut == 0 && $user->rights->expedition->valider && $num_prod > 0)
|
||||
|
||||
if (! eregi('^(valid|delete)',$_REQUEST["action"]))
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
|
||||
if ($conf->livraison->enabled && $expedition->statut == 1 && $user->rights->expedition->livraison->creer && !$expedition->livraison_id)
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=create_delivery">'.$langs->trans("DeliveryOrder").'</a>';
|
||||
}
|
||||
|
||||
if ($user->rights->expedition->lire && ($expedition->statut > 0))
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=builddoc">'.$langs->trans('BuildPDF').'</a>';
|
||||
}
|
||||
|
||||
if ($expedition->brouillon && $user->rights->expedition->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?id='.$expedition->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
|
||||
if ($expedition->statut == 0 && $user->rights->expedition->valider && $num_prod > 0)
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
|
||||
if ($conf->livraison->enabled && $expedition->statut == 1 && $user->rights->expedition->livraison->creer && !$expedition->livraison_id)
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=create_delivery">'.$langs->trans("DeliveryOrder").'</a>';
|
||||
}
|
||||
|
||||
if ($user->rights->expedition->lire && ($expedition->statut > 0))
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=builddoc">'.$langs->trans('BuildPDF').'</a>';
|
||||
}
|
||||
|
||||
if ($expedition->brouillon && $user->rights->expedition->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?id='.$expedition->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
print "\n";
|
||||
print "\n";
|
||||
|
||||
print "<table width=\"100%\" cellspacing=2><tr><td width=\"50%\" valign=\"top\">";
|
||||
|
||||
|
||||
/*
|
||||
* Documents générés
|
||||
*/
|
||||
|
||||
|
||||
$expeditionref = sanitize_string($expedition->ref);
|
||||
$filedir = $conf->expedition->dir_output . "/" .$expeditionref;
|
||||
|
||||
|
||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
|
||||
|
||||
|
||||
$genallowed=$user->rights->expedition->lire && ($expedition->statut > 0);
|
||||
$delallowed=$user->rights->expedition->supprimer;
|
||||
//$genallowed=1;
|
||||
//$delallowed=0;
|
||||
|
||||
|
||||
$somethingshown=$html->show_documents('expedition',$expeditionref,$filedir,$urlsource,$genallowed,$delallowed,$expedition->modelpdf);
|
||||
if ($genallowed && ! $somethingshown) $somethingshown=1;
|
||||
|
||||
|
||||
/*
|
||||
* Autres expeditions
|
||||
*/
|
||||
@ -673,17 +683,17 @@ else
|
||||
$sql .= " AND cd.rowid = ed.fk_commande_ligne";
|
||||
$sql .= " AND ed.fk_expedition = e.rowid";
|
||||
$sql .= " ORDER BY cd.fk_product";
|
||||
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
|
||||
if ($num)
|
||||
{
|
||||
if ($somethingshown) print '<br>';
|
||||
|
||||
|
||||
print_titre($langs->trans("OtherSendingsForSameOrder"));
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -692,7 +702,7 @@ else
|
||||
print '<td align="center">'.$langs->trans("Qty").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Date").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
@ -704,7 +714,7 @@ else
|
||||
{
|
||||
$product = new Product($db);
|
||||
$product->fetch($objp->fk_product);
|
||||
|
||||
|
||||
print '<td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.'</a> - '.dolibarr_trunc($product->libelle,20);
|
||||
if ($objp->description) print nl2br(dolibarr_trunc($objp->description,24));
|
||||
@ -719,7 +729,7 @@ else
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -727,14 +737,14 @@ else
|
||||
else {
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
|
||||
print '</td><td valign="top" width="50%">';
|
||||
|
||||
// Rien a droite
|
||||
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1563,11 +1563,14 @@ class Form
|
||||
|
||||
print '</table>';
|
||||
|
||||
foreach ($formquestion as $key => $input)
|
||||
{
|
||||
if ($input['type'] == 'hidden') print '<input type="hidden" name="'.$input['name'].'" value="'.$input['value'].'">';
|
||||
if (is_array($formquestion))
|
||||
{
|
||||
foreach ($formquestion as $key => $input)
|
||||
{
|
||||
if ($input['type'] == 'hidden') print '<input type="hidden" name="'.$input['name'].'" value="'.$input['value'].'">';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
|
||||
@ -147,6 +147,7 @@ class MenuLeft {
|
||||
$newmenu->add(DOL_URL_ROOT."/admin/tools/index.php?leftmenu=admintools", $langs->trans("SystemTools"));
|
||||
if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_export.php", $langs->trans("Backup"),1);
|
||||
if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_import.php", $langs->trans("Restore"),1);
|
||||
if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/purge.php", $langs->trans("Purge"),1);
|
||||
}
|
||||
|
||||
$langs->load("users");
|
||||
|
||||
@ -47,6 +47,13 @@ System=System
|
||||
SystemInfo=System informations
|
||||
SystemTools=System tools
|
||||
SystemToolsArea=System tools area
|
||||
SystemToolsAreaDesc=This area provides administration features. Use menu to choose feature you're looking for.
|
||||
PurgeAreaDesc=This page allow you to delete all files built or stored by Dolibarr (temporary files or all files in <b>%s</b> directory). Using this feature is not necessary. It is provided for users whose Dolibarr is hosted by a provider that does not offer permissions to delete files built by the web server.
|
||||
PurgeDeleteTemporaryFiles=Delete all temporary files (no risk to loose data)
|
||||
PurgeDeleteAllFilesInDocumentsDir=Delete all files in directory <b>%s</b>. Temporary files but also files attached to elements (third parties, invoices, ...) will be deleted.
|
||||
PurgeRunNow=Run purge now
|
||||
PurgeNothingToDelete=no directory to delete.
|
||||
PurgeNDirectoriesDeleted=<b>%s</b> files or directories deleted.
|
||||
NewBackup=New backup
|
||||
Backup=Backup
|
||||
Restore=Restore
|
||||
|
||||
@ -25,7 +25,7 @@ SendingsForSameOrder=Sendings for this order
|
||||
SendingsAndReceivingForSameOrder=Sendings and receivings for this order
|
||||
SendingsToValidate=Sending to validate
|
||||
StatusSendingDraft=Draft
|
||||
StatusSendingValidated=Validated (products to ship or already received)
|
||||
StatusSendingValidated=Validated (products to ship or already shipped)
|
||||
StatusSendingDraftShort=Draft
|
||||
StatusSendingValidatedShort=Validated
|
||||
SendingSheet=Sending sheet
|
||||
@ -5,6 +5,11 @@ NewWarehouse=New warehouse / Stock area
|
||||
MenuNewWarehouse=New warehouse
|
||||
WarehouseOpened=Warehouse opened
|
||||
WarehouseClosed=Warehouse closed
|
||||
WarehouseSource=Source warehouse
|
||||
WarehouseTarget=Target warehouse
|
||||
ValidateSending=Delete sending
|
||||
CancelSending=Cancel sending
|
||||
DeleteSending=Delete sending
|
||||
Stock=Stock
|
||||
Stocks=Stocks
|
||||
Movement=Movement
|
||||
|
||||
@ -25,7 +25,7 @@ SendingsForSameOrder=Exp
|
||||
SendingsAndReceivingForSameOrder=Expéditions et réceptions pour cette commande
|
||||
SendingsToValidate=Expéditions à valider
|
||||
StatusSendingDraft=Brouillon
|
||||
StatusSendingValidated=Validée (produits à envoyer ou reçus)
|
||||
StatusSendingValidated=Validée (produits à envoyer ou envoyés)
|
||||
StatusSendingDraftShort=Brouillon
|
||||
StatusSendingValidatedShort=Validée
|
||||
SendingSheet=Bordereau d'expédition
|
||||
|
||||
@ -47,6 +47,13 @@ System=Syst
|
||||
SystemInfo=Infos Système
|
||||
SystemTools=Outils Système
|
||||
SystemToolsArea=Espace outils systèmes
|
||||
SystemToolsAreaDesc=Cet espace offre des fonctions d'administration diverses. Utilisez le menu pour choisir la fonctionalité recherchée.
|
||||
PurgeAreaDesc=Cette page vous permet d'effacer tous les fichiers construits ou stockés par Dolibarr (fichiers temporaires ou tous les fichiers du répertoire <b>%s</b>). L'utilisation de cette fonction n'est pas nécessaire. Elle est fourni pour les utilisateurs qui héberge Dolibarr chez un hébergeur qui n'offre pas les permissions de supprimer les fichiers sauvegardés par le serveur Web.
|
||||
PurgeDeleteTemporaryFiles=Effacer tous les fichiers temporaires (pas de risque de perte de données)
|
||||
PurgeDeleteAllFilesInDocumentsDir=Effacer tous les fichiers du répertoire <b>%s</b>. Les fichiers temporaires mais aussi les fichiers joints aux éléments (tiers, factures, ...) seront effacées.
|
||||
PurgeRunNow=Lancer la purge maintenant
|
||||
PurgeNothingToDelete=Aucun répertoire à supprimer.
|
||||
PurgeNDirectoriesDeleted=<b>%s</b> fichiers ou répertoires supprimés.
|
||||
NewBackup=Nouvelle sauvegarde
|
||||
Backup=Sauvegarde
|
||||
Restore=Restauration
|
||||
|
||||
@ -25,7 +25,7 @@ SendingsForSameOrder=Exp
|
||||
SendingsAndReceivingForSameOrder=Expéditions et réceptions pour cette commande
|
||||
SendingsToValidate=Expéditions à valider
|
||||
StatusSendingDraft=Brouillon
|
||||
StatusSendingValidated=Validée (produits à envoyer ou reçus)
|
||||
StatusSendingValidated=Validée (produits à envoyer ou envoyés)
|
||||
StatusSendingDraftShort=Brouillon
|
||||
StatusSendingValidatedShort=Validée
|
||||
SendingSheet=Bordereau d'expédition
|
||||
@ -5,6 +5,11 @@ NewWarehouse=Nouvel entrep
|
||||
MenuNewWarehouse=Nouvel entrepôt
|
||||
WarehouseOpened=Entrepôt ouvert
|
||||
WarehouseClosed=Entrepôt fermé
|
||||
WarehouseSource=Entrepôt source
|
||||
WarehouseTarget=Entrepôt cible
|
||||
ValidateSending=Valider expédition
|
||||
CancelSending=Annuler expédition
|
||||
DeleteSending=Supprimer expédition
|
||||
Stock=Stock
|
||||
Stocks=Stocks
|
||||
Movement=Mouvement
|
||||
|
||||
@ -1613,12 +1613,49 @@ function dol_delete_file($file)
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Effacement d'un répertoire
|
||||
\param file Répertoire a effacer
|
||||
\brief Effacement d'un répertoire
|
||||
\param file Répertoire a effacer
|
||||
*/
|
||||
function dol_delete_dir($dir)
|
||||
{
|
||||
return rmdir($dir);
|
||||
return rmdir($dir);
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Effacement d'un répertoire et son arborescence
|
||||
\param file Répertoire a effacer
|
||||
\return int Nombre de fichier+repértoires supprimés
|
||||
*/
|
||||
function dol_delete_dir_recursive($dir)
|
||||
{
|
||||
$count=0;
|
||||
|
||||
if ($handle = opendir("$dir"))
|
||||
{
|
||||
while (false !== ($item = readdir($handle)))
|
||||
{
|
||||
if ($item != "." && $item != "..")
|
||||
{
|
||||
if (is_dir("$dir/$item"))
|
||||
{
|
||||
dol_delete_dir_recursive("$dir/$item");
|
||||
}
|
||||
else
|
||||
{
|
||||
unlink("$dir/$item");
|
||||
$count++;
|
||||
//echo " removing $dir/$item<br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
rmdir($dir);
|
||||
$count++;
|
||||
//echo "removing $dir<br>\n";
|
||||
}
|
||||
|
||||
//echo "return=".$count;
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
||||
@ -1984,22 +2021,29 @@ function dolibarr_dir_list($path, $types="all", $recursive=0, $filter="", $exclu
|
||||
|
||||
// Check if file is qualified
|
||||
if (eregi('^\.',$file)) $qualified=0;
|
||||
if ($filter && ! eregi($filter,$file)) $qualified=0;
|
||||
if ($excludefilter && eregi($excludefilter,$file)) $qualified=0;
|
||||
|
||||
// print "path=$path file=$file<br>\n";
|
||||
|
||||
if ($qualified)
|
||||
{
|
||||
// Check whether this is a file or directory and whether we're interested in that type
|
||||
if ((is_dir($path."/".$file)) && (($types=="directories") || ($types=="all")))
|
||||
{
|
||||
// Add file into file_list array
|
||||
// Add entry into file_list array
|
||||
if ($sortcriteria == 'date') $filedate=filemtime($path."/".$file);
|
||||
if ($sortcriteria == 'size') $filesize=filesize($path."/".$file);
|
||||
$file_list[] = array(
|
||||
"name" => $file,
|
||||
"date" => $filedate,
|
||||
"size" => $filesize
|
||||
);
|
||||
|
||||
if (! $filter || eregi($filter,$path.'/'.$file))
|
||||
{
|
||||
$file_list[] = array(
|
||||
"name" => $file,
|
||||
"fullname" => $path.'/'.$file,
|
||||
"date" => $filedate,
|
||||
"size" => $filesize
|
||||
);
|
||||
}
|
||||
|
||||
// if we're in a directory and we want recursive behavior, call this function again
|
||||
if ($recursive)
|
||||
{
|
||||
@ -2011,11 +2055,15 @@ function dolibarr_dir_list($path, $types="all", $recursive=0, $filter="", $exclu
|
||||
// Add file into file_list array
|
||||
if ($sortcriteria == 'date') $filedate=filemtime($path."/".$file);
|
||||
if ($sortcriteria == 'size') $filesize=filesize($path."/".$file);
|
||||
$file_list[] = array(
|
||||
"name" => $file,
|
||||
"date" => $filedate,
|
||||
"size" => $filesize
|
||||
);
|
||||
if (! $filter || eregi($filter,$path.'/'.$file))
|
||||
{
|
||||
$file_list[] = array(
|
||||
"name" => $file,
|
||||
"fullname" => $path.'/'.$file,
|
||||
"date" => $filedate,
|
||||
"size" => $filesize
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,8 +30,9 @@
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/livraison/mods/modules_livraison.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/expedition/expedition.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/livraison/livraison.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/livraison/mods/modules_livraison.php");
|
||||
if ($conf->stock->enabled) require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php");
|
||||
|
||||
$langs->load("sendings");
|
||||
@ -347,7 +348,7 @@ else
|
||||
{
|
||||
if ($_GET["id"] > 0)
|
||||
{
|
||||
$livraison = New Livraison($db);
|
||||
$livraison = new Livraison($db);
|
||||
$result = $livraison->fetch($_GET["id"]);
|
||||
|
||||
if ( $livraison->id > 0)
|
||||
@ -435,6 +436,11 @@ else
|
||||
print '<td colspan="3">'.dolibarr_print_date($livraison->date_creation,'%A %d %B %Y')."</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="3">'.$livraison->getLibStatut(4)."</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
if (!$conf->expedition->enabled && $conf->stock->enabled)
|
||||
{
|
||||
// Entrepot
|
||||
@ -519,25 +525,28 @@ else
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($livraison->statut == 0 && $user->rights->expedition->livraison->valider && $num_prod > 0)
|
||||
if (! eregi('^(valid|delete)',$_REQUEST["action"]))
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$livraison->id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
|
||||
print '<a class="butAction" href="fiche.php?id='.$livraison->id.'&action=builddoc">'.$langs->trans('BuildPDF').'</a>';
|
||||
|
||||
if ($livraison->brouillon && $user->rights->expedition->livraison->supprimer)
|
||||
{
|
||||
if ($conf->expedition->enabled)
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?id='.$livraison->id.'&expid='.$livraison->expedition_id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?id='.$livraison->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($livraison->statut == 0 && $user->rights->expedition->livraison->valider && $num_prod > 0)
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$livraison->id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
|
||||
print '<a class="butAction" href="fiche.php?id='.$livraison->id.'&action=builddoc">'.$langs->trans('BuildPDF').'</a>';
|
||||
|
||||
if ($livraison->brouillon && $user->rights->expedition->livraison->supprimer)
|
||||
{
|
||||
if ($conf->expedition->enabled)
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?id='.$livraison->id.'&expid='.$livraison->expedition_id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?id='.$livraison->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
print "\n";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user