diff --git a/ChangeLog b/ChangeLog index b8c81a65160..8f70155e56f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,7 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.2 compared to 3.1 ***** WARNING: PHP lower than 5.x are no more supported. -WARNING: Because of a major datastructure change onto supplier prices tabkes, be aware +WARNING: Because of a major datastructure change onto supplier prices tables, be aware to make a backup of your database before making upgrade. For users: diff --git a/build/debian/changelog b/build/debian/changelog index 3b1aeb0907f..3e7f7fa5e91 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,4 +1,4 @@ -dolibarr (3.2.0+nmu1) unstable; urgency=low +dolibarr (3.3.0+nmu1) unstable; urgency=low * Non-maintainer upload. * New upstream release. diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 2a6d12bbec0..a8b0325dc5d 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -40,6 +40,9 @@ if (!$user->admin) accessforbidden(); $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)) { @@ -50,6 +53,59 @@ if (empty($conf->global->EXPEDITION_ADDON_NUMBER)) /* * 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 = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + +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 = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + +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 = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + if ($action == 'specimen') { $modele=GETPOST('module','alpha'); @@ -84,8 +140,8 @@ if ($action == 'specimen') } else { - $mesg=''.$module->error.''; - dol_syslog($module->error, LOG_ERR); + $mesg=''.$obj->error.''; + dol_syslog($obj->error, LOG_ERR); } } else @@ -98,30 +154,13 @@ if ($action == 'specimen') // Activate a model if ($action == 'set') { - $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)) - { - - } + $ret = addDocumentModel($value, $type, $label, $scandir); } if ($action == 'del') { - $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)) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { if ($conf->global->EXPEDITION_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPEDITION_ADDON_PDF',$conf->entity); } @@ -130,37 +169,18 @@ if ($action == 'del') // 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 - $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) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { - $db->commit(); - } - else - { - $db->rollback(); + $ret = addDocumentModel($value, $type, $label, $scandir); } } @@ -240,28 +260,8 @@ if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - $module=GETPOST('module','alpha'); + dolibarr_set_const($db, "EXPEDITION_ADDON",$value,'chaine',0,'',$conf->entity); - 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 = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } } if ($action == 'setmodel') @@ -269,39 +269,6 @@ 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 = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } -} - -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 = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } -} - /* * View diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index bad34ac83b2..8808849b7ca 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -44,11 +44,14 @@ if ($action == 'setvalue' && $user->admin) $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) { @@ -101,6 +104,25 @@ print ''; +$var=!$var; +print ''; +print $langs->trans("ActivateCheckRead").''; +if ($conf->global->MAIN_SOCIETE_UNSUBSCRIBE==1) +{ + print ''; + print img_picto($langs->trans("Enabled"),'switch_on'); + print ''; +} +else +{ + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print ''; +} +print ''; + + + print ''; print ''; diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 5f02441159c..bf74bf0ad08 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -49,6 +49,7 @@ $substitutionarray=array( '__EMAIL__' => 'EMail', '__LASTNAME__' => 'Lastname', '__FIRSTNAME__' => 'Firstname', + '__MAILTOEMAIL__' => 'MailtoEmail', '__OTHER1__' => 'Other1', '__OTHER2__' => 'Other2', '__OTHER3__' => 'Other3', @@ -73,6 +74,7 @@ $substitutionarrayfortest=array( '__EMAIL__' => 'TESTEMail', '__LASTNAME__' => 'TESTLastname', '__FIRSTNAME__' => 'TESTFirstname', + '__MAILTOEMAIL__' => 'TESTMailtoEmail', '__OTHER1__' => 'TESTOther1', '__OTHER2__' => 'TESTOther2', '__OTHER3__' => 'TESTOther3', @@ -208,8 +210,9 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes') $substitutionarray=array( '__ID__' => $obj->source_id, '__EMAIL__' => $obj->email, - '__CHECK_READ__' => '', + '__CHECK_READ__' => '', '__UNSUSCRIBE__' => ''.$langs->trans("MailUnsubcribe").'', + '__MAILTOEMAIL__' => ''.$obj->email.'', '__LASTNAME__' => $obj->nom, '__FIRSTNAME__' => $obj->prenom, '__OTHER1__' => $other1, @@ -1048,6 +1051,7 @@ else print '__CHECK_READ__ = '.$langs->trans("CheckRead").'
'; print '__UNSUSCRIBE__ = '.$langs->trans("MailUnsubcribe").'
'; } + print '__MAILTOEMAIL__ = '.$langs->trans("MailtoEMail").'
'; print '__LASTNAME__ = '.$langs->trans("Lastname").'
'; print '__FIRSTNAME__ = '.$langs->trans("Firstname").'
'; print '__OTHER1__ = '.$langs->trans("Other").'1
'; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 8b220b58800..a2c19812434 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -94,7 +94,7 @@ class Conf $this->syslog = (object) array(); $this->browser = (object) array(); $this->multicompany = (object) array(); - + // First level object $this->expedition_bon = (object) array(); $this->livraison_bon = (object) array(); @@ -111,7 +111,7 @@ class Conf $this->bank = (object) array(); $this->notification = (object) array(); $this->mailing = (object) array(); - + //! Charset for HTML output and for storing data in memory $this->file->character_set_client='UTF-8'; // UTF-8, ISO-8859-1 } @@ -207,12 +207,12 @@ class Conf } $i++; } - + $db->free($resql); } //var_dump($this->modules); //var_dump($this->modules_parts); - + // Object $mc if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) { @@ -220,7 +220,7 @@ class Conf $ret = @dol_include_once('/multicompany/class/actions_multicompany.class.php'); if ($ret) $mc = new ActionsMulticompany($db); } - + // Second or others levels object $this->propal->cloture = (object) array(); $this->propal->facturation = (object) array(); @@ -289,7 +289,7 @@ class Conf // For backward compatibility $this->user->dir_output=$rootforuser."/users"; $this->user->dir_temp=$rootforuser."/users/temp"; - + // For propal storage $this->propal->dir_output=$rootforuser."/propale"; $this->propal->dir_temp=$rootforuser."/propale/temp"; @@ -307,7 +307,7 @@ class Conf $this->fournisseur->commande->dir_temp =$rootfordata."/fournisseur/commande/temp"; $this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture"; $this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp"; - + // Module product/service $this->product->multidir_output=array($this->entity => $rootfordata."/produit"); $this->product->multidir_temp =array($this->entity => $rootfordata."/produit/temp"); @@ -318,7 +318,7 @@ class Conf $this->product->dir_temp =$rootfordata."/produit/temp"; $this->service->dir_output=$rootfordata."/produit"; $this->service->dir_temp =$rootfordata."/produit/temp"; - + // Module contrat $this->contrat->dir_output=$rootfordata."/contracts"; $this->contrat->dir_temp =$rootfordata."/contracts/temp"; @@ -414,11 +414,11 @@ class Conf $this->bank->cheque->warning_delay=(isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT)?$this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT:0)*24*60*60; // For backward compatibility - $this->produit=$this->product; - $this->invoice=$this->facture; - $this->order=$this->commande; - $this->contract=$this->contrat; - $this->category=$this->categorie; + if (isset($this->product)) $this->produit=$this->product; + if (isset($this->facture)) $this->invoice=$this->facture; + if (isset($this->commande)) $this->order=$this->commande; + if (isset($this->contrat)) $this->contract=$this->contrat; + if (isset($this->categorie)) $this->category=$this->categorie; // Define menu manager in setup @@ -435,7 +435,7 @@ class Conf // For backward compatibility if ($this->top_menu == 'eldy.php') $this->top_menu='eldy_backoffice.php'; elseif ($this->top_menu == 'rodolphe.php') $this->top_menu='eldy_backoffice.php'; - + // Object $mc if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) { diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index eac6ff70dc8..80018d53d5b 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -221,7 +221,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Tel if ($sourcecompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->tel); // Fax - if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? ($sourcecompany->tel ? " - " : "\n") : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax); + if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax); // EMail if ($sourcecompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($sourcecompany->email); // Web diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index d94c5129335..a999e435111 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -98,8 +98,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->franchise=!$mysoc->tva_assuj; // Get source company - if (! is_object($object->thirdparty)) $object->fetch_thirdparty(); - $this->emetteur=$object->thirdparty; + $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined // Defini position des colonnes @@ -902,9 +901,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($this->marge_gauche,$posy); // Logo - /* - $logo=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; - if ($mysoc->logo) + $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; + if ($this->emetteur->logo) { if (is_readable($logo)) { @@ -920,10 +918,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } } else - {*/ + { $text=$this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); - //} + } $pdf->SetFont('', 'B', $default_font_size + 3); $pdf->SetXY($posx,$posy); @@ -991,7 +989,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // If BILLING contact defined on order, we use it $usecontact=false; - $arrayidcontact=$object->getIdContact('internal','BILLING'); + $arrayidcontact=$object->getIdContact('external','BILLING'); if (count($arrayidcontact) > 0) { $usecontact=true; @@ -1003,15 +1001,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { // On peut utiliser le nom de la societe du contact if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; - else $socname = $mysoc->nom; + else $socname = $object->client->name; $carac_client_name=$outputlangs->convToOutputCharset($socname); } else { - $carac_client_name=$outputlangs->convToOutputCharset($mysoc->nom); + $carac_client_name=$outputlangs->convToOutputCharset($object->client->name); } - - $carac_client=pdf_build_address($outputlangs,$this->emetteur,$mysoc,$object->contact,$usecontact,'target'); + + $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target'); // Show recipient $posy=42; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 96525557ced..e186337fcc0 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -54,6 +54,7 @@ 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 @@ -112,7 +113,7 @@ class CommandeFournisseur extends Commande $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.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.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.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,"; @@ -150,6 +151,7 @@ class CommandeFournisseur extends Commande $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; @@ -888,6 +890,7 @@ class CommandeFournisseur extends Commande $sql.= ", entity"; $sql.= ", fk_soc"; $sql.= ", date_creation"; + $sql.= ", date_livraison"; $sql.= ", fk_user_author"; $sql.= ", fk_statut"; $sql.= ", source"; @@ -899,6 +902,7 @@ class CommandeFournisseur extends Commande $sql.= ", ".$conf->entity; $sql.= ", ".$this->socid; $sql.= ", ".$this->db->idate($now); + $sql.= ", ".$this->db->idate($now); $sql.= ", ".$user->id; $sql.= ", 0"; $sql.= ", 0"; @@ -1367,6 +1371,41 @@ class CommandeFournisseur extends Commande 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 * @@ -1830,4 +1869,4 @@ class CommandeFournisseurLigne extends OrderLine } } -?> +?> \ No newline at end of file diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 21f93a08fcc..caf83271bbd 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -48,12 +48,12 @@ $langs->load('products'); $langs->load('stocks'); $id = GETPOST('id','int'); -$ref = GETPOST("ref"); -$action = GETPOST("action"); -$confirm = GETPOST("confirm"); -$comclientid = GETPOST("comid"); +$ref = GETPOST('ref','alpha'); +$action = GETPOST('action','alpha'); +$confirm = GETPOST('confirm','alpha'); +$comclientid = GETPOST('comid','int'); $socid = GETPOST('socid','int'); -$projectid = GETPOST("projectid"); +$projectid = GETPOST('projectid','int'); // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -87,6 +87,19 @@ else if ($action == 'setmode' && $user->rights->fournisseur->commande->creer) $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='
'.$object->error.'
'; + } +} + // Set project else if ($action == 'classin' && $user->rights->fournisseur->commande->creer) { @@ -100,18 +113,18 @@ else if ($action == 'setremisepercent' && $user->rights->fournisseur->commande-> $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) @@ -812,64 +825,64 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P } } -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) + 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 = '
'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'
'; - } - else - { - $mesg = '
'.$object->error.'
'; - } - } - } - - // 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); - } + $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 = '
'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'
'; + } + else + { + $mesg = '
'.$object->error.'
'; + } + } + } + + // 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); + } } } @@ -1102,6 +1115,30 @@ if ($id > 0 || ! empty($ref)) } print ''; + // Delivery date planed + print ''; + print ''; + + if ($action != 'editdate_livraison') print ''; + print '
'; + print $langs->trans('DateDeliveryPlanned'); + print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'
'; + print ''; + if ($action == 'editdate_livraison') + { + print '
'; + print ''; + print ''; + $form->select_date($object->date_livraison?$object->date_livraison:-1,'liv_','','','',"setdate_livraison"); + print ''; + print '
'; + } + else + { + print $object->date_livraison ? dol_print_date($object->date_livraison,'daytext') : ' '; + } + print ''; + // Project if ($conf->projet->enabled) { @@ -1155,22 +1192,22 @@ if ($id > 0 || ! empty($ref)) print "
"; - 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); @@ -1722,4 +1759,4 @@ if ($id > 0 || ! empty($ref)) // End of page llxFooter(); $db->close(); -?> +?> \ No newline at end of file diff --git a/htdocs/install/check.php b/htdocs/install/check.php index c48f4c7f599..dae2a0e4a8a 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -35,11 +35,11 @@ $langs->setDefaultLang($setuplang); $langs->load("install"); -// Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. -if (! isset($force_install_dolibarrlogin)) $force_install_dolibarrlogin=''; +// Now we load forced value from install.forced.php file. $useforcedwizard=false; -if (@file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (@file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +$forcedfile="./install.forced.php"; +if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; +if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once($forcedfile); } dolibarr_install_syslog("Dolibarr install/upgrade process started"); diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index b57b0e8a1c3..9859b7ed02e 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -43,10 +43,11 @@ $passroot=isset($_POST["db_pass_root"])?$_POST["db_pass_root"]:""; // Repertoire des pages dolibarr $main_dir=isset($_POST["main_dir"])?trim($_POST["main_dir"]):''; -// Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. +// Now we load forced value from install.forced.php file. $useforcedwizard=false; -if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +$forcedfile="./install.forced.php"; +if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; +if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once($forcedfile); } dolibarr_install_syslog("--- etape1: Entering etape1.php page"); diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php index 59ea5ec8bba..b8373847c25 100644 --- a/htdocs/install/etape2.php +++ b/htdocs/install/etape2.php @@ -52,10 +52,11 @@ if ($dolibarr_main_db_type == "pgsql") $choix=2; if ($dolibarr_main_db_type == "mssql") $choix=3; //if (empty($choix)) dol_print_error('','Database type '.$dolibarr_main_db_type.' not supported into etape2.php page'); -// Init "forced values" to nothing. "forced values" are used after a Doliwamp install wizard. +// Now we load forced value from install.forced.php file. $useforcedwizard=false; -if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +$forcedfile="./install.forced.php"; +if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; +if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once($forcedfile); } dolibarr_install_syslog("--- etape2: Entering etape2.php page"); diff --git a/htdocs/install/etape4.php b/htdocs/install/etape4.php index d9f27fe4e32..eb392ae2e86 100644 --- a/htdocs/install/etape4.php +++ b/htdocs/install/etape4.php @@ -36,11 +36,11 @@ $langs->setDefaultLang($setuplang); $langs->load("admin"); $langs->load("install"); -// Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. -if (! isset($force_install_dolibarrlogin)) $force_install_dolibarrlogin=''; +// Now we load forced value from install.forced.php file. $useforcedwizard=false; -if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +$forcedfile="./install.forced.php"; +if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; +if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once($forcedfile); } dolibarr_install_syslog("--- etape4: Entering etape4.php page"); @@ -74,7 +74,7 @@ $db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db- if ($db->ok == 1) { print ''.$langs->trans("DolibarrAdminLogin").' :'; - print ''; + print ''; print ''.$langs->trans("Password").' :'; print ''; print ''.$langs->trans("PasswordAgain").' :'; @@ -106,9 +106,9 @@ if ($db->ok == 1) } -$db->close(); - dolibarr_install_syslog("--- install/etape4.php end", LOG_INFO); pFooter($err,$setuplang); + +$db->close(); ?> diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php index 49d8259b0de..f63eafe1ef3 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -61,9 +61,11 @@ if (! isset($force_install_databasepass)) $force_install_databasepass=''; if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin=''; if (! isset($force_install_databaserootpass)) $force_install_databaserootpass=''; if (! isset($force_install_lockinstall)) $force_install_lockinstall=''; +// Now we load forced value from install.forced.php file. $useforcedwizard=false; -if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +$forcedfile="./install.forced.php"; +if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; +if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once($forcedfile); } dolibarr_install_syslog("--- etape5: Entering etape5.php page", LOG_INFO); diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 8fe90ac479f..44dc2011de1 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -53,14 +53,14 @@ if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin= if (! isset($force_install_databaserootpass)) $force_install_databaserootpass=''; // Now we load forced value from install.forced.php file. $useforcedwizard=false; -if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +$forcedfile="./install.forced.php"; +if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; +if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once($forcedfile); } dolibarr_install_syslog("Fileconf: Entering fileconf.php page"); - /* * View */ diff --git a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql index b5ccfefeb4a..b3ef221cf1a 100755 --- a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql +++ b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql @@ -451,3 +451,5 @@ 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; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur.sql index 1c1a00dbbe0..9cfca75f307 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseur.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur.sql @@ -53,11 +53,12 @@ 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; \ No newline at end of file diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 9ada97fc97b..d5deed6ec64 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -75,6 +75,8 @@ SentTo=Sent to %s MailingStatusRead=Read CheckRead=Read Receipt YourMailUnsubcribeOK=The email %s 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, ...) diff --git a/htdocs/langs/fr_FR/mails.lang b/htdocs/langs/fr_FR/mails.lang index c80a79615aa..9e1b08b84d1 100644 --- a/htdocs/langs/fr_FR/mails.lang +++ b/htdocs/langs/fr_FR/mails.lang @@ -75,6 +75,8 @@ SentTo=Envoyés à %s MailingStatusRead=Lu CheckRead=Accusé de lecture YourMailUnsubcribeOK=L'adresse e-mail %s 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...) diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 3ccca19e5e8..98b4439ad5c 100644 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -139,8 +139,9 @@ if ($resql) $substitutionarray=array( '__ID__' => $obj->source_id, '__EMAIL__' => $obj->email, - '__CHECK_READ__' => '', + '__CHECK_READ__' => '', '__UNSUSCRIBE__' => ''.$langs->trans("MailUnsubcribe").'', + '__MAILTOEMAIL__' => ''.$obj->email.'', '__LASTNAME__' => $obj->lastname, '__FIRSTNAME__' => $obj->firstname, '__OTHER1__' => $other1,