Merge remote-tracking branch 'origin/3.7' into 3.8

Conflicts:
	htdocs/core/modules/modContrat.class.php
	htdocs/fichinter/card.php
	htdocs/install/upgrade2.php
This commit is contained in:
Laurent Destailleur 2015-10-01 11:16:35 +02:00
commit b57c156b60
11 changed files with 32 additions and 10 deletions

View File

@ -203,7 +203,6 @@ else if ($action == 'set_FICHINTER_FREE_TEXT')
else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
{
$draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@ -544,7 +543,7 @@ print '<input size="50" class="flat" type="text" name="FICHINTER_DRAFT_WATERMARK
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
print '</form>';
// print products on fichinter
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';

View File

@ -622,7 +622,19 @@ class ActionComm extends CommonObject
$this->error=$this->db->lasterror();
$error++;
}
if (! $error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql.= " WHERE fk_actioncomm=".$this->id;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$res=$this->db->query($sql);
if ($res < 0) {
$this->error=$this->db->lasterror();
$error++;
}
}
// Removed extrafields
if (! $error) {
$result=$this->deleteExtraFields();

View File

@ -48,7 +48,7 @@ class PropaleStats extends Stats
* Constructor
*
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
* @param int $userid Id user for filter (creation user)
*/
function __construct($db, $socid=0, $userid=0)

View File

@ -48,7 +48,7 @@ class CommandeStats extends Stats
* Constructor
*
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
* @param string $mode Option ('customer', 'supplier')
* @param int $userid Id user for filter (creation user)
*/

View File

@ -45,7 +45,7 @@ class FactureStats extends Stats
* Constructor
*
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
* @param string $mode Option ('customer', 'supplier')
* @param int $userid Id user for filter (creation user)
*/
@ -168,7 +168,7 @@ class FactureStats extends Stats
$sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")";
$sql.= " FROM ".$this->from;
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
$sql.= " AND ".$this->where;
$sql.= " GROUP BY dm";
@ -188,7 +188,7 @@ class FactureStats extends Stats
$sql = "SELECT date_format(datef,'%Y') as year, COUNT(*) as nb, SUM(f.".$this->field.") as total, AVG(f.".$this->field.") as avg";
$sql.= " FROM ".$this->from;
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE ".$this->where;
$sql.= " GROUP BY year";
$sql.= $this->db->order('year','DESC');

View File

@ -75,6 +75,7 @@ class mailing_contacts1 extends MailingTargets
$statssql[0].= " WHERE c.entity IN (".getEntity('societe', 1).")";
$statssql[0].= " AND c.email != ''"; // Note that null != '' is false
$statssql[0].= " AND c.no_email = 0";
$statssql[0].= " AND c.statut = 1";
return $statssql;
}
@ -98,6 +99,7 @@ class mailing_contacts1 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
// La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients
@ -204,6 +206,7 @@ class mailing_contacts1 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email <> ''";
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
$sql.= " AND c.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
foreach($filtersarray as $key)
{

View File

@ -86,6 +86,7 @@ class mailing_contacts2 extends MailingTargets
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email <> ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
//$sql.= " AND sp.poste != ''";
$sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$this->db->escape($filtersarray[0])."'";
@ -168,6 +169,7 @@ class mailing_contacts2 extends MailingTargets
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
//$sql.= " AND sp.poste != ''";
// La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients
@ -191,6 +193,7 @@ class mailing_contacts2 extends MailingTargets
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')";
$sql.= " GROUP BY sp.poste";
$sql.= " ORDER BY sp.poste";

View File

@ -85,6 +85,7 @@ class mailing_contacts3 extends MailingTargets
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " WHERE sp.email <> ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_categorie = c.rowid";
@ -173,6 +174,7 @@ class mailing_contacts3 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
/*
$sql = "SELECT count(distinct(sp.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
@ -208,6 +210,7 @@ class mailing_contacts3 extends MailingTargets
$sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND cs.fk_categorie = c.rowid";
$sql.= " AND cs.fk_soc = sp.fk_soc";

View File

@ -85,6 +85,7 @@ class mailing_contacts4 extends MailingTargets
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'";
$sql.= " ORDER BY sp.lastname, sp.firstname";
@ -173,6 +174,7 @@ class mailing_contacts4 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
/*
$sql = "SELECT count(distinct(sp.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
@ -208,6 +210,7 @@ class mailing_contacts4 extends MailingTargets
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " GROUP BY c.label";
$sql.= " ORDER BY c.label";

View File

@ -3830,7 +3830,6 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Service module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
if ($res) {
$mod=new modService($db);
@ -3841,7 +3840,6 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Commande module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
if ($res) {
$mod=new modCommande($db);

View File

@ -1226,6 +1226,7 @@ ContractsNumberingModules=Contracts numbering modules
TemplatePDFContracts=Contracts documents models
FreeLegalTextOnContracts=Free text on contracts
WatermarkOnDraftContractCards=Watermark on draft contracts (none if empty)
ContractsAndServices=List of contracts and services
##### Members #####
MembersSetup=Members module setup
MemberMainOptions=Main options