Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Dolibarr/dolibarr
...
head fork: Dolibarr/dolibarr
Checking mergeability… Don't worry, you can still create the pull request.
  • 19 commits
  • 13 files changed
  • 0 commit comments
  • 2 contributors
Commits on Apr 08, 2012
@eldy eldy New logo 06b0330
@eldy eldy Fix: Back page to list of contacts(cherry picked from commit 2d9ed89) 4804530
Commits on Apr 09, 2012
@eldy eldy Fix: rounding d892f36
@eldy eldy Fix: Rounding 9a43149
Regis Houssin Fix: security 56daf57
Regis Houssin Fix: sql injection 64d60d1
Regis Houssin Fix: add special test ae8b16b
@eldy eldy Revert "Fix: security"
This reverts commit 56daf57.
b6b873c
@eldy eldy Revert code because it does not fix security hole completely. Also it
does work on origin but at a transition level.
Sanitizing for command line data must not appears inside a function used
for http data. I prefer fixing this at the source and also using a rule
that clean all attacks completely instead of a rule that clean "most
problem but not all".
141fa01
Commits on Apr 10, 2012
Regis Houssin Fix: best practice dc46b82
@eldy eldy Fix: translation 58b0751
@eldy eldy Fix: W3C 49bb9d7
@eldy eldy Fix: Bad link 1104387
@eldy eldy Fix: bad link d4cc4b4
Commits on Apr 11, 2012
@eldy eldy Merge branch '3.2' of ssh://git@github.com/Dolibarr/dolibarr.git into…
… 3.2
3870428
@eldy eldy Revert "Add __MAILTOEMAIL__ and configutation gobal varialbe of Check…
… Read and unsubscribe in Admin part"

This reverts commit 2a12b24.
bb917be
@eldy eldy Revert "to add delivery date"
This reverts commit b948ee1.
5aae71f
@eldy eldy Revert "to add delivery date"
This reverts commit 8a20b67.
b141f3c
@eldy eldy Revert "uniformise code"
This reverts commit 06761d9.
1e526a2
View
167 htdocs/admin/expedition.php
@@ -40,9 +40,6 @@
$action=GETPOST('action','alpha');
$value=GETPOST('value','alpha');
-$label = GETPOST('label','alpha');
-$scandir = GETPOST('scandir','alpha');
-$type='shipping';
if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
{
@@ -53,59 +50,6 @@
/*
* Actions
*/
- if ($action == 'updateMask')
-{
- $maskconst=GETPOST('maskconstexpedition','alpha');
- $maskvalue=GETPOST('maskexpedition','alpha');
- if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
-
- if (! $res > 0) $error++;
-
- if (! $error)
- {
- $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
- }
- else
- {
- $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
- }
-}
-
-if ($action == 'set_SHIPPING_FREE_TEXT')
-{
- $freetext=GETPOST('SHIPPING_FREE_TEXT','alpha');
- $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
-
- if (! $res > 0) $error++;
-
- if (! $error)
- {
- $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
- }
- else
- {
- $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
- }
-}
-
-if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
-{
- $draft=GETPOST('SHIPPING_DRAFT_WATERMARK','alpha');
-
- $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
-
- if (! $res > 0) $error++;
-
- if (! $error)
- {
- $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
- }
- else
- {
- $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
- }
-}
-
if ($action == 'specimen')
{
$modele=GETPOST('module','alpha');
@@ -140,8 +84,8 @@
}
else
{
- $mesg='<font class="error">'.$obj->error.'</font>';
- dol_syslog($obj->error, LOG_ERR);
+ $mesg='<font class="error">'.$module->error.'</font>';
+ dol_syslog($module->error, LOG_ERR);
}
}
else
@@ -154,13 +98,30 @@
// Activate a model
if ($action == 'set')
{
- $ret = addDocumentModel($value, $type, $label, $scandir);
+ $label = GETPOST('label','alpha');
+ $scandir = GETPOST('scandir','alpha');
+
+ $type='shipping';
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
+ $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
+ $sql.= ($label?"'".$db->escape($label)."'":'null').", ";
+ $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
+ $sql.= ")";
+ if ($db->query($sql))
+ {
+
+ }
}
if ($action == 'del')
{
- $ret = delDocumentModel($value, $type);
- if ($ret > 0)
+ $type='shipping';
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
+ $sql.= " WHERE nom = '".$db->escape($value)."'";
+ $sql.= " AND type = '".$type."'";
+ $sql.= " AND entity = ".$conf->entity;
+
+ if ($db->query($sql))
{
if ($conf->global->EXPEDITION_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPEDITION_ADDON_PDF',$conf->entity);
}
@@ -169,18 +130,37 @@
// Set default model
if ($action == 'setdoc')
{
+ $label = GETPOST('label','alpha');
+ $scandir = GETPOST('scandir','alpha');
+
+ $db->begin();
+
if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
- // La constante qui a ete lue en avant du nouveau set
- // on passe donc par une variable pour avoir un affichage coherent
$conf->global->EXPEDITION_ADDON_PDF = $value;
}
// On active le modele
- $ret = delDocumentModel($value, $type);
- if ($ret > 0)
+ $type='shipping';
+ $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
+ $sql_del.= " WHERE nom = '".$db->escape($value)."'";
+ $sql_del.= " AND type = '".$type."'";
+ $sql_del.= " AND entity = ".$conf->entity;
+ $result1=$db->query($sql_del);
+
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
+ $sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", ";
+ $sql.= ($label?"'".$db->escape($label)."'":'null').", ";
+ $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
+ $sql.= ")";
+ $result2=$db->query($sql);
+ if ($result1 && $result2)
+ {
+ $db->commit();
+ }
+ else
{
- $ret = addDocumentModel($value, $type, $label, $scandir);
+ $db->rollback();
}
}
@@ -260,15 +240,68 @@
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
- dolibarr_set_const($db, "EXPEDITION_ADDON",$value,'chaine',0,'',$conf->entity);
+ $module=GETPOST('module','alpha');
+
+ dolibarr_set_const($db, "EXPEDITION_ADDON",$module,'chaine',0,'',$conf->entity);
}
+if ($action == 'updateMask')
+{
+ $maskconst=GETPOST('maskconstexpedition','alpha');
+ $maskvalue=GETPOST('maskexpedition','alpha');
+ if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
+
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
+ }
+ else
+ {
+ $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
+ }
+}
+
if ($action == 'setmodel')
{
dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
}
+if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
+{
+ $draft=GETPOST('SHIPPING_DRAFT_WATERMARK','alpha');
+ $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
+
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
+ }
+ else
+ {
+ $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
+ }
+}
+
+if ($action == 'set_SHIPPING_FREE_TEXT')
+{
+ $free=GETPOST('SHIPPING_FREE_TEXT','alpha');
+ $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$free,'chaine',0,'',$conf->entity);
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
+ }
+ else
+ {
+ $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
+ }
+}
+
/*
* View
View
4 htdocs/admin/ihm.php
@@ -218,7 +218,7 @@
// Hide wiki link on login page
$var=!$var;
- print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/common/helpdoc.png','',1)).'</td><td>';
+ print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).'</td><td>';
print $form->selectyesno('MAIN_HELP_DISABLELINK',isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
@@ -366,7 +366,7 @@
// Link to wiki help
$var=!$var;
- print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/common/helpdoc.png','',1)).'</td><td colspan="2">';
+ print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).'</td><td colspan="2">';
print yn($conf->global->MAIN_HELP_DISABLELINK,1);
print '</td></tr>';
View
22 htdocs/admin/mailing.php
@@ -44,14 +44,11 @@
$mailfrom = GETPOST('MAILING_EMAIL_FROM','alpha');
$mailerror = GETPOST('MAILING_EMAIL_ERRORSTO','alpha');
- $checkread = GETPOST('value','alpha');
$res=dolibarr_set_const($db, "MAILING_EMAIL_FROM",$mailfrom,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
$res=dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO",$mailerror,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
- $res=dolibarr_set_const($db, "MAIN_SOCIETE_UNSUBSCRIBE",$checkread,'chaine',0,'',$conf->entity);
- if (! $res > 0) $error++;
if (! $error)
{
@@ -104,25 +101,6 @@
if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && ! isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) print ' '.img_warning($langs->trans("BadEMail"));
print '</td></tr>';
-$var=!$var;
-print '<tr '.$bc[$var].'><td>';
-print $langs->trans("ActivateCheckRead").'</td><td>';
-if ($conf->global->MAIN_SOCIETE_UNSUBSCRIBE==1)
-{
- print '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&value=0">';
- print img_picto($langs->trans("Enabled"),'switch_on');
- print '</a>';
-}
-else
-{
- print '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&value=1">';
- print img_picto($langs->trans("Disabled"),'switch_off');
- print '</a>';
-}
-print '</td></tr>';
-
-
-
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
print '</table></form>';
View
6 htdocs/comm/mailing/fiche.php
@@ -49,7 +49,6 @@
'__EMAIL__' => 'EMail',
'__LASTNAME__' => 'Lastname',
'__FIRSTNAME__' => 'Firstname',
- '__MAILTOEMAIL__' => 'MailtoEmail',
'__OTHER1__' => 'Other1',
'__OTHER2__' => 'Other2',
'__OTHER3__' => 'Other3',
@@ -74,7 +73,6 @@
'__EMAIL__' => 'TESTEMail',
'__LASTNAME__' => 'TESTLastname',
'__FIRSTNAME__' => 'TESTFirstname',
- '__MAILTOEMAIL__' => 'TESTMailtoEmail',
'__OTHER1__' => 'TESTOther1',
'__OTHER2__' => 'TESTOther2',
'__OTHER3__' => 'TESTOther3',
@@ -210,9 +208,8 @@
$substitutionarray=array(
'__ID__' => $obj->source_id,
'__EMAIL__' => $obj->email,
- '__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
+ '__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="0" height="0" style="width:0px;height:0px" border="0"/>',
'__UNSUSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
- '__MAILTOEMAIL__' => '<a href="mailto:'.$obj->email.'">'.$obj->email.'</a>',
'__LASTNAME__' => $obj->nom,
'__FIRSTNAME__' => $obj->prenom,
'__OTHER1__' => $other1,
@@ -1051,7 +1048,6 @@
print '__CHECK_READ__ = '.$langs->trans("CheckRead").'<br>';
print '__UNSUSCRIBE__ = '.$langs->trans("MailUnsubcribe").'<br>';
}
- print '__MAILTOEMAIL__ = '.$langs->trans("MailtoEMail").'<br>';
print '__LASTNAME__ = '.$langs->trans("Lastname").'<br>';
print '__FIRSTNAME__ = '.$langs->trans("Firstname").'<br>';
print '__OTHER1__ = '.$langs->trans("Other").'1<br>';
View
2  htdocs/core/boxes/box_produits.php
@@ -130,7 +130,7 @@ function loadBox($max=5)
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => $price);
- $this->info_box_contents[$i][3] = array('td' => 'align="center" width="20" nowrap="nowrap"',
+ $this->info_box_contents[$i][3] = array('td' => 'align="left" nowrap="nowrap"',
'text' => $price_base_type);
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
View
43 htdocs/fourn/class/fournisseur.commande.class.php
@@ -54,7 +54,6 @@ class CommandeFournisseur extends Commande
var $fourn_id;
var $date;
var $date_commande;
- var $date_livraison; // Date livraison souhaitee
var $total_ht;
var $total_tva;
var $total_localtax1; // Total Local tax 1
@@ -113,7 +112,7 @@ function fetch($id,$ref='')
$sql = "SELECT c.rowid, c.ref, c.date_creation, c.fk_soc, c.fk_user_author, c.fk_statut, c.amount_ht, c.total_ht, c.total_ttc, c.tva,";
$sql.= " c.localtax1, c.localtax2, ";
- $sql.= " c.date_commande as date_commande, c.date_livraison as date_livraison, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_projet as fk_project, c.remise_percent, c.source, c.fk_methode_commande,";
+ $sql.= " c.date_commande as date_commande, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_projet as fk_project, c.remise_percent, c.source, c.fk_methode_commande,";
$sql.= " c.note as note_private, c.note_public, c.model_pdf, c.extraparams,";
$sql.= " cm.libelle as methode_commande,";
$sql.= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle,";
@@ -151,7 +150,6 @@ function fetch($id,$ref='')
$this->total_ttc = $obj->total_ttc;
$this->date_commande = $this->db->jdate($obj->date_commande); // date a laquelle la commande a ete transmise
$this->date = $this->db->jdate($obj->date_creation);
- $this->date_livraison = $this->db->jdate($obj->date_livraison);
$this->remise_percent = $obj->remise_percent;
$this->methode_commande_id = $obj->fk_methode_commande;
$this->methode_commande = $obj->methode_commande;
@@ -890,7 +888,6 @@ function create($user)
$sql.= ", entity";
$sql.= ", fk_soc";
$sql.= ", date_creation";
- $sql.= ", date_livraison";
$sql.= ", fk_user_author";
$sql.= ", fk_statut";
$sql.= ", source";
@@ -902,7 +899,6 @@ function create($user)
$sql.= ", ".$conf->entity;
$sql.= ", ".$this->socid;
$sql.= ", ".$this->db->idate($now);
- $sql.= ", ".$this->db->idate($now);
$sql.= ", ".$user->id;
$sql.= ", 0";
$sql.= ", 0";
@@ -1371,41 +1367,6 @@ function Livraison($user, $date, $type, $comment)
return $result ;
}
- /**
- * Set the planned delivery date
- *
- * @param User $user Objet utilisateur qui modifie
- * @param timestamp $date_livraison Date de livraison
- * @return int <0 si ko, >0 si ok
- */
- function set_date_livraison($user, $date_livraison)
- {
- if ($user->rights->fournisseur->commande->creer)
- {
- $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
- $sql.= " SET date_livraison = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null');
- $sql.= " WHERE rowid = ".$this->id;
-
- dol_syslog("CommandeFournisseur::set_date_livraison sql=".$sql,LOG_DEBUG);
- $resql=$this->db->query($sql);
- if ($resql)
- {
- $this->date_livraison = $date_livraison;
- return 1;
- }
- else
- {
- $this->error=$this->db->error();
- dol_syslog("CommandeFournisseur::set_date_livraison ".$this->error,LOG_ERR);
- return -1;
- }
- }
- else
- {
- return -2;
- }
- }
-
/**
* Update a supplier order from a customer order
*
@@ -1869,4 +1830,4 @@ function update_total()
}
}
-?>
+?>
View
215 htdocs/fourn/commande/fiche.php
@@ -48,12 +48,12 @@
$langs->load('stocks');
$id = GETPOST('id','int');
-$ref = GETPOST('ref','alpha');
-$action = GETPOST('action','alpha');
-$confirm = GETPOST('confirm','alpha');
-$comclientid = GETPOST('comid','int');
+$ref = GETPOST("ref");
+$action = GETPOST("action");
+$confirm = GETPOST("confirm");
+$comclientid = GETPOST("comid");
$socid = GETPOST('socid','int');
-$projectid = GETPOST('projectid','int');
+$projectid = GETPOST("projectid");
// Security check
if ($user->societe_id) $socid=$user->societe_id;
@@ -87,19 +87,6 @@
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
}
-// date de livraison
-if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->creer)
-{
- $datelivraison=dol_mktime(0, 0, 0, GETPOST('liv_month','int'), GETPOST('liv_day','int'),GETPOST('liv_year','int'));
-
- $object->fetch($id);
- $result=$object->set_date_livraison($user,$datelivraison);
- if ($result < 0)
- {
- $mesg='<div class="error">'.$object->error.'</div>';
- }
-}
-
// Set project
else if ($action == 'classin' && $user->rights->fournisseur->commande->creer)
{
@@ -113,18 +100,18 @@
$result = $object->set_remise($user, $_POST['remise_percent']);
}
-else if ($action == 'setnote_public' && $user->rights->propale->creer)
-{
- $object->fetch($id);
- $result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
- if ($result < 0) dol_print_error($db,$object->error);
-}
-
-else if ($action == 'setnote' && $user->rights->propale->creer)
-{
- $object->fetch($id);
- $result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
- if ($result < 0) dol_print_error($db,$object->error);
+else if ($action == 'setnote_public' && $user->rights->propale->creer)
+{
+ $object->fetch($id);
+ $result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
+ if ($result < 0) dol_print_error($db,$object->error);
+}
+
+else if ($action == 'setnote' && $user->rights->propale->creer)
+{
+ $object->fetch($id);
+ $result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
+ if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
@@ -825,64 +812,64 @@
}
}
-if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
+if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
- if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer)
- {
- $result = $object->fetch($id);
-
- if ($result > 0 && $id > 0)
- {
- $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
- $result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
- }
-
- if ($result >= 0)
- {
- Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
- exit;
- }
- else
- {
- if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
- {
- $langs->load("errors");
- $mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
- }
- else
- {
- $mesg = '<div class="error">'.$object->error.'</div>';
- }
- }
- }
-
- // bascule du statut d'un contact
- else if ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer)
- {
- if ($object->fetch($id))
- {
- $result=$object->swapContactStatus(GETPOST('ligne'));
- }
- else
- {
- dol_print_error($db);
- }
- }
-
- // Efface un contact
- else if ($action == 'deletecontact' && $user->rights->fournisseur->commande->creer)
- {
- $object->fetch($id);
- $result = $object->delete_contact($_GET["lineid"]);
-
- if ($result >= 0)
+ if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer)
+ {
+ $result = $object->fetch($id);
+
+ if ($result > 0 && $id > 0)
{
- Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
- exit;
- }
- else {
- dol_print_error($db);
- }
+ $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
+ $result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
+ }
+
+ if ($result >= 0)
+ {
+ Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
+ exit;
+ }
+ else
+ {
+ if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
+ {
+ $langs->load("errors");
+ $mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
+ }
+ else
+ {
+ $mesg = '<div class="error">'.$object->error.'</div>';
+ }
+ }
+ }
+
+ // bascule du statut d'un contact
+ else if ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer)
+ {
+ if ($object->fetch($id))
+ {
+ $result=$object->swapContactStatus(GETPOST('ligne'));
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+ }
+
+ // Efface un contact
+ else if ($action == 'deletecontact' && $user->rights->fournisseur->commande->creer)
+ {
+ $object->fetch($id);
+ $result = $object->delete_contact($_GET["lineid"]);
+
+ if ($result >= 0)
+ {
+ Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
+ exit;
+ }
+ else {
+ dol_print_error($db);
+ }
}
}
@@ -1115,30 +1102,6 @@
}
print '</td></tr>';
- // Delivery date planed
- print '<tr><td height="10">';
- print '<table class="nobordernopadding" width="100%"><tr><td>';
- print $langs->trans('DateDeliveryPlanned');
- print '</td>';
-
- if ($action != 'editdate_livraison') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&amp;id='.$object->id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'</a></td>';
- print '</tr></table>';
- print '</td><td colspan="2">';
- if ($action == 'editdate_livraison')
- {
- print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
- print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
- print '<input type="hidden" name="action" value="setdate_livraison">';
- $form->select_date($object->date_livraison?$object->date_livraison:-1,'liv_','','','',"setdate_livraison");
- print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
- print '</form>';
- }
- else
- {
- print $object->date_livraison ? dol_print_date($object->date_livraison,'daytext') : '&nbsp;';
- }
- print '</td>';
-
// Project
if ($conf->projet->enabled)
{
@@ -1192,22 +1155,22 @@
print "</table><br>";
- if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
- {
+ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
+ {
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
- require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
- $formcompany= new FormCompany($db);
-
- $blocname = 'contacts';
- $title = $langs->trans('ContactsAddresses');
- include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
- }
-
- if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
- {
- $blocname = 'notes';
- $title = $langs->trans('Notes');
- include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
+ require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
+ $formcompany= new FormCompany($db);
+
+ $blocname = 'contacts';
+ $title = $langs->trans('ContactsAddresses');
+ include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
+ }
+
+ if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
+ {
+ $blocname = 'notes';
+ $title = $langs->trans('Notes');
+ include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
dol_htmloutput_mesg($mesg);
@@ -1759,4 +1722,4 @@
// End of page
llxFooter();
$db->close();
-?>
+?>
View
2  htdocs/install/mysql/migration/3.1.0-3.2.0.sql
@@ -451,5 +451,3 @@ ALTER TABLE llx_commande_fournisseur ADD COLUMN extraparams varchar(255) AFTER i
ALTER TABLE llx_facture_fourn ADD COLUMN extraparams varchar(255) AFTER import_key;
ALTER TABLE llx_boxes ADD COLUMN maxline integer NULL;
-
-ALTER TABLE llx_commande_fournisseur ADD COLUMN date_livraison date NULL;
View
5 htdocs/install/mysql/tables/llx_commande_fournisseur.sql
@@ -53,12 +53,11 @@ create table llx_commande_fournisseur
note text,
note_public text,
model_pdf varchar(255),
-
- date_livraison date default NULL,
+
fk_cond_reglement integer, -- condition de reglement
fk_mode_reglement integer, -- mode de reglement
fk_methode_commande integer default 0, -- should be named fk_input_method
import_key varchar(14),
extraparams varchar(255) -- for stock other parameters with json format
-)ENGINE=innodb;
+)ENGINE=innodb;
View
2  htdocs/langs/en_US/bills.lang
@@ -235,7 +235,7 @@ Discount=Discount
Discounts=Discounts
AddDiscount=Create discount
AddRelativeDiscount=Create relative discount
-EditRelativelDiscount=Edit relatvie discount
+EditRelativeDiscount=Edit relative discount
AddGlobalDiscount=Create absolute discount
EditGlobalDiscounts=Edit absolute discounts
AddCreditNote=Create credit note
View
2  htdocs/langs/en_US/mails.lang
@@ -75,8 +75,6 @@ SentTo=Sent to <b>%s</b>
MailingStatusRead=Read
CheckRead=Read Receipt
YourMailUnsubcribeOK=The email <b>%s</b> is correctly unsubcribe from mailing list
-MailtoEMail=Hyper link to email
-ActivateCheckRead=Activate Read receipt and unsubcribe tag
# Libelle des modules de liste de destinataires mailing
MailingModuleDescContactCompanies=Contacts of all third parties (customer, prospect, supplier, ...)
View
2  htdocs/langs/fr_FR/mails.lang
@@ -75,8 +75,6 @@ SentTo=Envoyés à <b>%s</b>
MailingStatusRead=Lu
CheckRead=Accusé de lecture
YourMailUnsubcribeOK=L'adresse e-mail <b>%s</b> est bien désincrite de la liste.
-MailtoEMail=Ecrire a e-mail (lien)
-ActivateCheckRead=Activer les tag d'accusé de lecture et de désincription
# Libelle des modules de liste de destinataires mailing
MailingModuleDescContactCompanies=Contacts de tiers (prospects, clients, fournisseurs...)
View
3  scripts/emailings/mailing-send.php
@@ -139,9 +139,8 @@
$substitutionarray=array(
'__ID__' => $obj->source_id,
'__EMAIL__' => $obj->email,
- '__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
+ '__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="0" height="0" style="width:0px;height:0px" border="0"/>',
'__UNSUSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
- '__MAILTOEMAIL__' => '<a href="mailto:'.$obj->email.'">'.$obj->email.'</a>',
'__LASTNAME__' => $obj->lastname,
'__FIRSTNAME__' => $obj->firstname,
'__OTHER1__' => $other1,

No commit comments for this range

Something went wrong with that request. Please try again.