diff --git a/ChangeLog b/ChangeLog index 33370d56006..f22a34a385a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,6 +38,8 @@ For users: - New: [ task #494 ] Send an email to foundation when a new member has auto-subscribed - New: [ task #326 ]: Add a numbering module to suggest automatically a product ref - New: Add conditional substitution IF/ELSEIF/ENDIF for ODT templates +- New: Add unit foot2, inch2, foot3 and inch3 for surface and volumes. +- New: Can select thirdparties into emailing targets, even if module category is not enabled. - Fix: [ bug #499 ]: Supplier order input method not translated - Fix: No images into product description lines as PDF generation does not work with this. diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 2371d07bbae..422058f2203 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -839,12 +839,11 @@ class FormOther var left_list = cleanSerialize(jQuery("#left").sortable("serialize")); var right_list = cleanSerialize(jQuery("#right").sortable("serialize")); var boxorder = \'A:\' + left_list + \'-B:\' + right_list; - jQuery.ajax({ url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&boxid=\'+boxid+\'&zone='.$areacode.'&userid='.$user->id.'\', - async: false + jQuery.ajax({ + url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&boxid=\'+boxid+\'&zone='.$areacode.'&userid='.$user->id.'\', + async: false }); - //jQuery.get(\''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&boxid=\'+boxid+\'&zone='.$areacode.'&userid='.$user->id.'\'); window.location.search=\'mainmenu='.GETPOST("mainmenu").'&leftmenu='.GETPOST('leftmenu').'&action=addbox&boxid=\'+boxid; - //window.location.href=\''.$_SERVER["PHP_SELF"].'\'; } });'; if (! count($arrayboxtoactivatelabel)) print 'jQuery("#boxcombo").hide();'; @@ -940,16 +939,32 @@ class FormOther containment: \'.fiche\', connectWith: \'.connectedSortable\', stop: function(event, ui) { - updateOrder(0); + updateBoxOrder(0); } }); }); '."\n"; - print 'function updateOrder() { - var left_list = cleanSerialize(jQuery("#left").sortable("serialize")); - var right_list = cleanSerialize(jQuery("#right").sortable("serialize")); - var boxorder = \'A:\' + left_list + \'-B:\' + right_list; - jQuery.get(\''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.'); + // To update list of activated boxes + print 'function updateBoxOrder(closing) { + var left_list = cleanSerialize(jQuery("#left").sortable("serialize")); + var right_list = cleanSerialize(jQuery("#right").sortable("serialize")); + var boxorder = \'A:\' + left_list + \'-B:\' + right_list; + if (boxorder==\'A:A-B:B\' && closing == 1) // There is no more boxes on screen, and we are after a delete of a box so we must hide title + { + jQuery.ajax({ + url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.', + async: false + }); + // We force reload to be sure to get all boxes into list + window.location.search=\'mainmenu='.GETPOST("mainmenu").'&leftmenu='.GETPOST('leftmenu').'&action=delbox\'; + } + else + { + jQuery.ajax({ + url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.', + async: true + }); + } }'."\n"; // For closing print 'jQuery(document).ready(function() { @@ -957,7 +972,7 @@ class FormOther var self = this; // because JQuery can modify this var boxid=self.id.substring(8); jQuery(\'#boxto_\'+boxid).remove(); - updateOrder(); + updateBoxOrder(1); }); });'."\n"; print ''."\n"; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 391e180e839..eb2de353ca9 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -329,8 +329,8 @@ function measuring_units_string($unit,$measuring_style='') $measuring_units[-1] = $langs->trans("SizeUnitdm"); $measuring_units[-2] = $langs->trans("SizeUnitcm"); $measuring_units[-3] = $langs->trans("SizeUnitmm"); - $measuring_units[99] = $langs->trans("SizeUnitinch"); $measuring_units[98] = $langs->trans("SizeUnitfoot"); + $measuring_units[99] = $langs->trans("SizeUnitinch"); } else if ($measuring_style == 'surface') { @@ -338,6 +338,8 @@ function measuring_units_string($unit,$measuring_style='') $measuring_units[-2] = $langs->trans("SurfaceUnitdm2"); $measuring_units[-4] = $langs->trans("SurfaceUnitcm2"); $measuring_units[-6] = $langs->trans("SurfaceUnitmm2"); + $measuring_units[98] = $langs->trans("SurfaceUnitfoot2"); + $measuring_units[99] = $langs->trans("SurfaceUnitinch2"); } else if ($measuring_style == 'volume') { @@ -345,7 +347,9 @@ function measuring_units_string($unit,$measuring_style='') $measuring_units[-3] = $langs->trans("VolumeUnitdm3"); $measuring_units[-6] = $langs->trans("VolumeUnitcm3"); $measuring_units[-9] = $langs->trans("VolumeUnitmm3"); - $measuring_units[97] = $langs->trans("VolumeUnitounce"); + $measuring_units[88] = $langs->trans("VolumeUnitfoot3"); + $measuring_units[89] = $langs->trans("VolumeUnitinch3"); + $measuring_units[97] = $langs->trans("VolumeUnitounce"); $measuring_units[98] = $langs->trans("VolumeUnitlitre"); $measuring_units[99] = $langs->trans("VolumeUnitgallon"); } diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 33c59091a3d..6c6bdcf61e0 100755 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -19,20 +19,15 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; /** - * \class mailing_thirdparties - * \brief Class to manage a list of personalised recipients for mailing feature + * Class to manage a list of personalised recipients for mailing feature */ class mailing_thirdparties extends MailingTargets { - // CHANGE THIS: Put here a name not already used var $name='ContactsCategories'; - // CHANGE THIS: Put here a description of your selector module. - // This label is used if no translation found for key MailingModuleDescXXX where XXX=name is found var $desc="Third parties (by categories)"; - // CHANGE THIS: Set to 1 if selector is available for admin users only var $require_admin=0; - var $require_module=array("categorie","societe"); + var $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated var $picto='company'; var $db; @@ -44,6 +39,8 @@ class mailing_thirdparties extends MailingTargets */ function __construct($db) { + global $conf; + $this->db=$db; } @@ -151,11 +148,12 @@ class mailing_thirdparties extends MailingTargets } - /* - * \brief Return here number of distinct emails returned by your selector. - * For example if this selector is used to extract 500 different - * emails from a text file, this function must return 500. - * \return int + /** + * Return here number of distinct emails returned by your selector. + * For example if this selector is used to extract 500 different + * emails from a text file, this function must return 500. + * + * @return int Nb of recipients */ function getNbOfRecipients() { @@ -200,6 +198,8 @@ class mailing_thirdparties extends MailingTargets { $num = $this->db->num_rows($resql); + if (empty($conf->categorie->enabled)) $num=0; // Force empty list if category module is not enabled + if ($num) $s.=''; else $s.=''; diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 46cc1d0a6b4..15b3ad6f0d4 100755 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -18,8 +18,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; /** - * \class mailing_thirdparties_services_expired - * \brief Class to offer a selector of emailing targets with Rule 'services expired'. + * Class to offer a selector of emailing targets with Rule 'services expired'. */ class mailing_thirdparties_services_expired extends MailingTargets { diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 99a91bab00a..81f652c190c 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -6,12 +6,12 @@ -- Requests to clean corrupted database -delete from llx_facturedet where fk_facture in (select rowid from llx_facture where facnumber = '(PROV)'); -delete from llx_facture where facnumber = '(PROV)'; -delete from llx_commandedet where fk_commande in (select rowid from llx_commande where ref = '(PROV)'); -delete from llx_commande where ref = '(PROV)'; -delete from llx_propaldet where fk_propal in (select rowid from llx_propal where ref = '(PROV)'); -delete from llx_propal where ref = '(PROV)'; +delete from llx_facturedet where fk_facture in (select rowid from llx_facture where facnumber in ('(PROV)','ErrorBadMask')); +delete from llx_facture where facnumber in ('(PROV)','ErrorBadMask'); +delete from llx_commandedet where fk_commande in (select rowid from llx_commande where ref in ('(PROV)','ErrorBadMask')); +delete from llx_commande where ref in ('(PROV)','ErrorBadMask'); +delete from llx_propaldet where fk_propal in (select rowid from llx_propal where ref in ('(PROV)','ErrorBadMask')); +delete from llx_propal where ref in ('(PROV)','ErrorBadMask'); delete from llx_facturedet where fk_facture in (select rowid from llx_facture where facnumber = ''); delete from llx_facture where facnumber = ''; delete from llx_commandedet where fk_commande in (select rowid from llx_commande where ref = ''); diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 650dde25d0e..324a0e24ee6 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -103,12 +103,16 @@ SurfaceUnitm2=m2 SurfaceUnitdm2=dm2 SurfaceUnitcm2=cm2 SurfaceUnitmm2=mm2 +SurfaceUnitfoot2=ft2 +SurfaceUnitinch2=in2 Volume=Volume TotalVolume=Total volume VolumeUnitm3=m3 VolumeUnitdm3=dm3 VolumeUnitcm3=cm3 VolumeUnitmm3=mm3 +VolumeUnitfoot3=ft3 +VolumeUnitinch3=in3 VolumeUnitounce=ounce VolumeUnitlitre=litre VolumeUnitgallon=gallon diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index 75cb28c67d0..670940a8a10 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -102,12 +102,16 @@ SurfaceUnitm2=m2 SurfaceUnitdm2=dm2 SurfaceUnitcm2=cm2 SurfaceUnitmm2=mm2 +SurfaceUnitfoot2=pied2 +SurfaceUnitinch2=pouce2 Volume=Volume TotalVolume=Volume total VolumeUnitm3=m3 VolumeUnitdm3=dm3 (l) VolumeUnitcm3=cm3 (ml) VolumeUnitmm3=mm3 (µl) +VolumeUnitfoot3=pied3 +VolumeUnitinch3=pouce3 VolumeUnitounce=once VolumeUnitlitre=litre VolumeUnitgallon=gallon diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index ff96ccf80f1..de861d5a3f7 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -172,9 +172,9 @@ class FormProduct $measuring_units=array(); if ($measuring_style == 'weight') $measuring_units=array(-6=>1,-3=>1,0=>1,3=>1,99=>1); - else if ($measuring_style == 'size') $measuring_units=array(-3=>1,-2=>1,-1=>1,0=>1,99=>1,98=>1); - else if ($measuring_style == 'surface') $measuring_units=array(-6=>1,-4=>1,-2=>1,0=>1); - else if ($measuring_style == 'volume') $measuring_units=array(-9=>1,-6=>1,-3=>1,0=>1,97=>1,99=>1,/* 98=>1 */); // Liter is not used as already available with dm3 + else if ($measuring_style == 'size') $measuring_units=array(-3=>1,-2=>1,-1=>1,0=>1,98=>1,99=>1); + else if ($measuring_style == 'surface') $measuring_units=array(-6=>1,-4=>1,-2=>1,0=>1,98=>1,99=>1); + else if ($measuring_style == 'volume') $measuring_units=array(-9=>1,-6=>1,-3=>1,0=>1,88=>1,89=>1,97=>1,99=>1,/* 98=>1 */); // Liter is not used as already available with dm3 $return.= '