Synchro
This commit is contained in:
parent
3a7e9f3060
commit
6d0d0ab834
@ -39,18 +39,16 @@ if (!$user->admin)
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'set')
|
if ($_GET["action"] == 'set')
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$value."')";
|
$file = DOL_DOCUMENT_ROOT . '/includes/modules/expedition/methode_expedition_'.$_GET["value"].'.modules.php';
|
||||||
|
$classname = 'methode_expedition_'.$_GET["value"];
|
||||||
|
require_once($file);
|
||||||
|
|
||||||
if ($db->query($sql))
|
$obj = new $classname();
|
||||||
{
|
|
||||||
|
|
||||||
}
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."expedition_methode (rowid,code,libelle, description, statut)";
|
||||||
}
|
$sql .= " VALUES (".$obj->id.",'".$obj->code."','".$obj->name."','".addslashes($obj->description)."',".$_GET["statut"].")";
|
||||||
if ($action == 'del')
|
|
||||||
{
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_model_pdf WHERE nom='".$value."'";
|
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@ -62,7 +60,7 @@ if ($action == 'del')
|
|||||||
|
|
||||||
$expedition_addon_var_pdf = EXPEDITION_ADDON_PDF;
|
$expedition_addon_var_pdf = EXPEDITION_ADDON_PDF;
|
||||||
|
|
||||||
if ($action == 'setpdf')
|
if (action == 'setpdf')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'EXPEDITION_ADDON_PDF', value='".$value."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'EXPEDITION_ADDON_PDF', value='".$value."', visible=0";
|
||||||
|
|
||||||
@ -83,17 +81,17 @@ if ($action == 'setpdf')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$expedition_addon_var = EXPEDITION_ADDON;
|
$expedition_default = EXPEDITION_DEFAULT;
|
||||||
|
|
||||||
if ($action == 'setmod')
|
if ($_GET["action"] == 'setdef')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'EXPEDITION_ADDON', value='".$value."', visible=0";
|
|
||||||
|
|
||||||
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'EXPEDITION_ADDON', value='".$value."', visible=0";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
// la constante qui a été lue en avant du nouveau set
|
// la constante qui a été lue en avant du nouveau set
|
||||||
// on passe donc par une variable pour avoir un affichage cohérent
|
// on passe donc par une variable pour avoir un affichage cohérent
|
||||||
$expedition_addon_var = $value;
|
$expedition_default = $_GET["value"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,62 +101,6 @@ if ($action == 'setmod')
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print_titre("Module de numérotation");
|
|
||||||
|
|
||||||
print '<table class="border" cellpadding="3" cellspacing="0">';
|
|
||||||
print '<TR class="liste_titre">';
|
|
||||||
print '<td>Nom</td>';
|
|
||||||
print '<td>Info</td>';
|
|
||||||
print '<td align="center">Activé</td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print "</TR>\n";
|
|
||||||
|
|
||||||
clearstatcache();
|
|
||||||
|
|
||||||
$dir = "../includes/modules/expedition/";
|
|
||||||
$handle = opendir($dir);
|
|
||||||
if ($handle)
|
|
||||||
{
|
|
||||||
while (($file = readdir($handle))!==false)
|
|
||||||
{
|
|
||||||
if (substr($file, 0, 12) == 'mod_expedition_' && substr($file, strlen($file)-3, 3) == 'php')
|
|
||||||
{
|
|
||||||
$file = substr($file, 0, strlen($file)-4);
|
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/expedition/".$file.".php");
|
|
||||||
|
|
||||||
$modExpedition = new $file;
|
|
||||||
|
|
||||||
print '<tr class="pair"><td>'.$file."</td><td>\n";
|
|
||||||
print $modExpedition->info();
|
|
||||||
print '</td><td align="center">';
|
|
||||||
|
|
||||||
if ($expedition_addon_var == "$file")
|
|
||||||
{
|
|
||||||
print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0"></a>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print " ";
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</td><td>\n";
|
|
||||||
|
|
||||||
print '<a href="expedition.php?action=setmod&value='.$file.'">activer</a>';
|
|
||||||
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closedir($handle);
|
|
||||||
}
|
|
||||||
print '</table>';
|
|
||||||
/*
|
|
||||||
* PDF
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$def = array();
|
$def = array();
|
||||||
|
|
||||||
$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."propal_model_pdf";
|
$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."propal_model_pdf";
|
||||||
@ -177,7 +119,7 @@ else
|
|||||||
print $db->error();
|
print $db->error();
|
||||||
}
|
}
|
||||||
|
|
||||||
$dir = "../includes/modules/expedition/";
|
$dir = DOL_DOCUMENT_ROOT."/includes/modules/expedition/";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Méthode de livraison
|
* Méthode de livraison
|
||||||
@ -192,25 +134,23 @@ print '<td align="center" colspan="2">Actif</td>';
|
|||||||
print '<td align="center" colspan="2">Défaut</td>';
|
print '<td align="center" colspan="2">Défaut</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
clearstatcache();
|
|
||||||
|
|
||||||
$handle=opendir($dir);
|
$handle=opendir($dir);
|
||||||
|
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,19) == 'methode_expedition_')
|
if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,19) == 'methode_expedition_')
|
||||||
{
|
{
|
||||||
$name = substr($file, 19, strlen($file) - 27);
|
$name = substr($file, 19, strlen($file) - 31);
|
||||||
$classname = substr($file, 0, strlen($file) - 12);
|
$classname = substr($file, 0, strlen($file) - 12);
|
||||||
|
|
||||||
require_once($dir.$file);
|
require_once($dir.$file);
|
||||||
|
|
||||||
$obj = new $classname();
|
$obj = new $classname();
|
||||||
|
|
||||||
print '<tr class="pair"><td>';
|
print '<tr class="pair"><td>';
|
||||||
echo $obj->name;
|
echo $obj->name;
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
|
|
||||||
|
|
||||||
print $obj->description;
|
print $obj->description;
|
||||||
|
|
||||||
print '</td><td align="center">';
|
print '</td><td align="center">';
|
||||||
@ -219,18 +159,18 @@ while (($file = readdir($handle))!==false)
|
|||||||
{
|
{
|
||||||
print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0"></a>';
|
print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0"></a>';
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
print '<a href="expedition.php?action=del&value='.$name.'">désactiver</a>';
|
print '<a href="expedition.php?action=set&statut=0&value='.$name.'">désactiver</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print " ";
|
print " ";
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
print '<a href="expedition.php?action=set&value='.$name.'">activer</a>';
|
print '<a href="expedition.php?action=set&statut=1&value='.$name.'">activer</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td><td align="center">';
|
print '</td><td align="center">';
|
||||||
|
|
||||||
if ($expedition_addon_var_pdf == "$name")
|
if ($expedition_default == "$name")
|
||||||
{
|
{
|
||||||
print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0"></a>';
|
print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0"></a>';
|
||||||
}
|
}
|
||||||
@ -241,7 +181,7 @@ while (($file = readdir($handle))!==false)
|
|||||||
|
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
|
|
||||||
print '<a href="expedition.php?action=setpdf&value='.$name.'">activer</a>';
|
print '<a href="expedition.php?action=setdef&value='.$name.'">activer</a>';
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -147,7 +147,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$smonth = 1;
|
$smonth = 1;
|
||||||
$syear = date("Y", time());
|
$syear = date("Y", time());
|
||||||
print '<table border="1" cellpadding="3" cellspacing="0" width="100%">';
|
print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
|
||||||
|
|
||||||
print "<tr><td>Société</td><td><b>".$objsoc->nom."</td></tr>";
|
print "<tr><td>Société</td><td><b>".$objsoc->nom."</td></tr>";
|
||||||
|
|
||||||
@ -194,7 +194,6 @@ if ($action == 'create')
|
|||||||
print "<tr><td>Durée (en jours)</td><td><input name=\"duree\"></td></tr>\n";
|
print "<tr><td>Durée (en jours)</td><td><input name=\"duree\"></td></tr>\n";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
|
||||||
* Projet associé
|
* Projet associé
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -207,11 +206,12 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
$i = 0 ;
|
$i = 0 ;
|
||||||
$numprojet = $db->num_rows();
|
$numprojet = $db->num_rows();
|
||||||
while ($i < $numprojet) {
|
while ($i < $numprojet)
|
||||||
$projet = $db->fetch_object($i);
|
{
|
||||||
print "<option value=\"$projet->rowid\">$projet->title</option>";
|
$projet = $db->fetch_object($i);
|
||||||
$i++;
|
print "<option value=\"$projet->rowid\">$projet->title</option>";
|
||||||
}
|
$i++;
|
||||||
|
}
|
||||||
$db->free();
|
$db->free();
|
||||||
} else {
|
} else {
|
||||||
print $db->error();
|
print $db->error();
|
||||||
@ -219,7 +219,7 @@ if ($action == 'create')
|
|||||||
print '</select>';
|
print '</select>';
|
||||||
if ($numprojet==0) {
|
if ($numprojet==0) {
|
||||||
print 'Cette société n\'a pas de projet. ';
|
print 'Cette société n\'a pas de projet. ';
|
||||||
print '<a href='.DOL_URL_ROOT.'/comm/projet/fiche.php?socidp='.$socidp.'&action=create>Créer un projet</a>';
|
print '<a href='.DOL_URL_ROOT.'/projet/fiche.php?socidp='.$socidp.'&action=create>Créer un projet</a>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -262,7 +262,7 @@ if ($action == 'edit')
|
|||||||
|
|
||||||
print "<form action=\"$PHP_SELF?id=$id\" method=\"post\">";
|
print "<form action=\"$PHP_SELF?id=$id\" method=\"post\">";
|
||||||
|
|
||||||
print '<table border="1" cellpadding="3" cellspacing="0" width="100%">';
|
print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
|
||||||
print "<tr><td>Date</td><td>";
|
print "<tr><td>Date</td><td>";
|
||||||
/*
|
/*
|
||||||
* set $reday, $remonth, $reyear
|
* set $reday, $remonth, $reyear
|
||||||
@ -328,7 +328,7 @@ if ($id)
|
|||||||
{
|
{
|
||||||
$fichinter->fetch_client();
|
$fichinter->fetch_client();
|
||||||
|
|
||||||
print '<table border="1" cellpadding="3" cellspacing="0" width="100%">';
|
print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
|
||||||
print '<tr><td>Société</td><td><a href="../comm/fiche.php?socid='.$fichinter->client->id.'">'.$fichinter->client->nom.'</a></td></tr>';
|
print '<tr><td>Société</td><td><a href="../comm/fiche.php?socid='.$fichinter->client->id.'">'.$fichinter->client->nom.'</a></td></tr>';
|
||||||
print '<tr><td width="20%">Date</td><td>'.strftime("%A %d %B %Y",$fichinter->date).'</td></tr>';
|
print '<tr><td width="20%">Date</td><td>'.strftime("%A %d %B %Y",$fichinter->date).'</td></tr>';
|
||||||
print '<tr><td>Numéro</td><td>'.$fichinter->ref.'</td></tr>';
|
print '<tr><td>Numéro</td><td>'.$fichinter->ref.'</td></tr>';
|
||||||
@ -345,7 +345,7 @@ if ($id)
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
print '<br><table border="1" cellpadding="3" cellspacing="0" width="100%"><tr>';
|
print '<br><table class="border" cellpadding="3" cellspacing="0" width="100%"><tr>';
|
||||||
|
|
||||||
if ($user->societe_id == 0)
|
if ($user->societe_id == 0)
|
||||||
{
|
{
|
||||||
@ -395,9 +395,9 @@ if ($id)
|
|||||||
|
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
|
|
||||||
print "<table width=\"50%\" cellspacing=2><tr><td width=\"50%\" valign=\"top\">";
|
print '<table width="50%" cellspacing="2"><tr><td width="50%" valign="top">';
|
||||||
print_titre("Documents générés");
|
print_titre("Documents générés");
|
||||||
print "<table width=\"100%\" cellspacing=0 border=1 cellpadding=3>";
|
print '<table width="100%" cellspacing="0" class="border" cellpadding="3">';
|
||||||
|
|
||||||
$file = FICHEINTER_OUTPUTDIR . "/$fichinter->ref/$fichinter->ref.pdf";
|
$file = FICHEINTER_OUTPUTDIR . "/$fichinter->ref/$fichinter->ref.pdf";
|
||||||
if (file_exists($file))
|
if (file_exists($file))
|
||||||
|
|||||||
@ -42,10 +42,8 @@ class Entrepot
|
|||||||
*/
|
*/
|
||||||
Function create($user)
|
Function create($user)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($this->db->query("BEGIN") )
|
if ($this->db->query("BEGIN") )
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (datec, fk_user_author)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (datec, fk_user_author)";
|
||||||
$sql .= " VALUES (now(),".$user->id.")";
|
$sql .= " VALUES (now(),".$user->id.")";
|
||||||
|
|
||||||
@ -161,5 +159,27 @@ class Entrepot
|
|||||||
}
|
}
|
||||||
return $liste;
|
return $liste;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Renvoie la liste des entrepôts ouverts
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Function nb_products()
|
||||||
|
{
|
||||||
|
$sql = "SELECT sum(reel) FROM llx_product_stock WHERE fk_entrepot = ".$this->id;
|
||||||
|
|
||||||
|
$result = $this->db->query($sql) ;
|
||||||
|
|
||||||
|
if ( $result )
|
||||||
|
{
|
||||||
|
$row = $this->db->fetch_row(0);
|
||||||
|
return $row[0];
|
||||||
|
|
||||||
|
$this->db->free();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user