Merge remote-tracking branch 'origin/3.4' into develop

Conflicts:
	htdocs/contrat/liste.php
This commit is contained in:
Laurent Destailleur 2013-07-31 12:45:39 +02:00
commit e234d5342d
9 changed files with 46 additions and 47 deletions

View File

@ -144,37 +144,6 @@ For users:
- Fix: [ bug #972 ] Auto completion contact field do not take account the min caract number before search
- Fix : [ bug #971 ] html.form.class.php select_contact with autocomplete do not exclude id from exclude array
For translators:
- Update language files.
For developers:
- System of menu managers has been rewritten to reduce code to do same things.
- An external module can force its theme.
- Add function dol_set_focus('#xxx').
- A mymodule can bring its own core/modules/mymodule/modules_mymodule.php file.
- Removed some not used libraries.
- More web services.
- Renamed some database fields, code variables and parameters from french to english.
- First change to manage margins on contracts.
- Add hook getFormMail.
- Function plimit of databases drivers accept -1 as value (it means default value set
into conf->liste_limit).
- New: Add option dol_hide_topmenu, dol_hide_leftmenu, dol_optimize_smallscreen,
dol_no_mouse_hover and dol_use_jmobile onto login page (to support different terminal).
- New: dol_syslog method accept a suffix to use different log files for log.
- New: Type of fields are received by export format handlers.
- New: when adding an action, we can define a free code to tag it for a specific need.
- New: Enhance Dolibarr migration process to include migration script of external
modules.
- New: [ task #811 ] Uniformanize note field.
WARNING: If you used external modules, some of them may need to be upgraded due to:
- Fields of classes were renamed to be normalized (nom, prenom, cp, ville, adresse, tel
were renamed into lastname, firstname, zip, town, address, phone).
This may also be true for some fields into web services.
- If module use hook pdf_writelinedesc, module may have to add return 1 at end of
function to keep same behaviour.
***** ChangeLog for 3.3.4 compared to 3.3.3 *****

View File

@ -64,7 +64,7 @@ if ($action == 'updateMask')
if (isset($res))
{
if ($res < 0)
if ($res > 0)
setEventMessage($langs->trans("SetupSaved"));
else
setEventMessage($langs->trans("Error"), 'errors');
@ -536,4 +536,4 @@ print '</table>';
llxFooter();
$db->close();
?>
?>

View File

@ -80,7 +80,7 @@ $sql.= " AND c.entity = ".$conf->entity;
if ($socid) $sql.= " AND s.rowid = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape($search_nom)."%'";
if ($search_contract) $sql.= " AND (".(is_numeric($search_contract)?"c.rowid = '".$db->escape($search_contract)."' OR ":'')." c.ref = '".$db->escape($search_contract)."')";
if ($search_contract) $sql.= " AND (".(is_numeric($search_contract)?"c.rowid = ".$db->escape($search_contract)." OR ":'')." c.ref LIKE '%".$db->escape($search_contract)."%')";
if ($sall) $sql.= " AND (s.nom LIKE '%".$db->escape($sall)."%' OR cd.label LIKE '%".$db->escape($sall)."%' OR cd.description LIKE '%".$db->escape($sall)."%')";
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut,";
$sql.= " s.nom, s.rowid";

View File

@ -538,7 +538,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
*/
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
{
global $conf;
global $conf,$mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$pdf->SetFont('','', $default_font_size);

View File

@ -321,17 +321,37 @@ class modSociete extends DolibarrModules
unset($this->export_entities_array[$r]['s.code_fournisseur']);
}
// Add extra fields
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'contact'";
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople'";
$resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example)
{
while ($obj=$this->db->fetch_object($resql))
{
$fieldname='extra.'.$obj->name;
$fieldlabel=ucfirst($obj->label);
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
$this->export_entities_array[$r][$fieldname]='contact';
}
while ($obj=$this->db->fetch_object($resql))
{
$fieldname='extra.'.$obj->name;
$fieldlabel=ucfirst($obj->label);
$typeFilter="Text";
switch($obj->type)
{
case 'int':
case 'double':
case 'price':
$typeFilter="Numeric";
break;
case 'date':
case 'datetime':
$typeFilter="Date";
break;
case 'boolean':
$typeFilter="Boolean";
break;
case 'sellist':
$typeFilter="List:".$obj->param;
break;
}
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;
$this->export_entities_array[$r][$fieldname]='contact';
}
}
// End add axtra fields
$this->export_sql_start[$r]='SELECT DISTINCT ';
@ -355,7 +375,7 @@ class modSociete extends DolibarrModules
$this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'societe','extra'=>MAIN_DB_PREFIX.'societe_extrafields'); // List of tables to insert into (insert done in same order)
$this->import_fields_array[$r]=array('s.nom'=>"Name*",'s.status'=>"Status",'s.client'=>"Customer*",'s.fournisseur'=>"Supplier*",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"CustomerAccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_pays'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic",'s.fk_typent'=>"ThirdPartyType",'s.fk_effectif'=>"Staff","s.fk_forme_juridique"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','s.default_lang'=>'DefaultLanguage','s.barcode'=>'BarCode','s.datec'=>"DateCreation");
// Add extra fields
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company' AND entity = ".$conf->entity;
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity = ".$conf->entity;
$resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example)
{
@ -390,7 +410,7 @@ class modSociete extends DolibarrModules
$this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'socpeople','extra'=>MAIN_DB_PREFIX.'socpeople_extrafields'); // List of tables to insert into (insert done in same order)
$this->import_fields_array[$r]=array('s.fk_soc'=>'ThirdPartyName*','s.civilite'=>'UserTitle','s.lastname'=>"Name*",'s.firstname'=>"Firstname",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_pays'=>"CountryCode",'s.birthday'=>"BirthdayDate",'s.poste'=>"Role",'s.phone'=>"Phone",'s.phone_perso'=>"PhonePerso",'s.phone_mobile'=>"PhoneMobile",'s.fax'=>"Fax",'s.email'=>"Email",'s.note_private'=>"Note",'s.note_public'=>"Note",'s.datec'=>"DateCreation");
// Add extra fields
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'contact' AND entity = ".$conf->entity;
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople' AND entity = ".$conf->entity;
$resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example)
{

View File

@ -56,7 +56,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$texte.= '<input type="hidden" name="action" value="updateMaskInvoice">';
$texte.= '<input type="hidden" name="action" value="updateMask">';
$texte.= '<input type="hidden" name="maskconstinvoice" value="SUPPLIER_INVOICE_TULIP_MASK">';
$texte.= '<table class="nobordernopadding" width="100%">';

View File

@ -59,6 +59,7 @@ class Expedition extends CommonObject
var $billed;
var $note_public;
var $note_private;
var $model_pdf;
var $trueWeight;
var $weight_units;
@ -162,6 +163,8 @@ class Expedition extends CommonObject
global $conf, $langs;
$now=dol_now();
if (empty($this->model_pdf)) $this->model_pdf=$conf->global->EXPEDITION_ADDON_PDF;
require_once DOL_DOCUMENT_ROOT .'/product/stock/class/mouvementstock.class.php';
$error = 0;
@ -196,6 +199,7 @@ class Expedition extends CommonObject
$sql.= ", size_units";
$sql.= ", note_private";
$sql.= ", note_public";
$sql.= ", model_pdf";
$sql.= ") VALUES (";
$sql.= "'(PROV)'";
$sql.= ", ".$conf->entity;
@ -217,6 +221,7 @@ class Expedition extends CommonObject
$sql.= ", ".$this->size_units;
$sql.= ", ".(!empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null");
$sql.= ", ".(!empty($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= ", ".(!empty($this->model_pdf)?"'".$this->db->escape($this->model_pdf)."'":"null");
$sql.= ")";
$resql=$this->db->query($sql);

View File

@ -59,6 +59,7 @@ class Livraison extends CommonObject
var $date_delivery; // Date really received
var $date_creation;
var $date_valid;
var $model_pdf;
/**
@ -89,6 +90,8 @@ class Livraison extends CommonObject
global $conf;
dol_syslog("Livraison::create");
if (empty($this->model_pdf)) $this->model_pdf=$conf->global->LIVRAISON_ADDON_PDF;
$error = 0;
@ -112,6 +115,7 @@ class Livraison extends CommonObject
$sql.= ", fk_address";
$sql.= ", note_private";
$sql.= ", note_public";
$sql.= ", model_pdf";
$sql.= ") VALUES (";
$sql.= "'(PROV)'";
$sql.= ", ".$conf->entity;
@ -123,6 +127,7 @@ class Livraison extends CommonObject
$sql.= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : "null");
$sql.= ", ".(!empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null");
$sql.= ", ".(!empty($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= ", ".(!empty($this->model_pdf)?"'".$this->db->escape($this->model_pdf)."'":"null");
$sql.= ")";
dol_syslog("Livraison::create sql=".$sql, LOG_DEBUG);

View File

@ -85,7 +85,7 @@ if (! empty($tag) && ($unsuscrib=='1'))
$resql=$db->query($sql);
//Update status communication of contact prospect
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=-1 WHERE rowid IN (SELECT fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.tag = '".$db->escape($tag)."' AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET no_email=1 WHERE rowid IN (SELECT rowid FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.tag = '".$db->escape($tag)."' AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
dol_syslog("public/emailing/mailing-unsubscribe.php : Mail unsubcribe contact : ".$sql, LOG_DEBUG);
$resql=$db->query($sql);