';
if (! $i) $totalarray['nbfield']++;
}
diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php
index 0d9a9a94aea..1f3ca1cde8e 100644
--- a/htdocs/compta/bank/transfer.php
+++ b/htdocs/compta/bank/transfer.php
@@ -55,7 +55,7 @@ if ($action == 'add_confirm')
if (! $label)
{
-
+ $error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Description")), null, 'errors');
}
if (! $amount)
diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php
index 51061b4b6ad..aaf0d0cd796 100644
--- a/htdocs/contrat/services.php
+++ b/htdocs/contrat/services.php
@@ -154,6 +154,7 @@ if (empty($reshook))
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
+ $search_product_category=0;
$search_name="";
$search_contract="";
$search_service="";
@@ -176,6 +177,8 @@ if (empty($reshook))
$filter_opcloture="";
$mode='';
$filter='';
+ $toselect='';
+ $search_array_options=array();
}
}
diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php
index 1998808bf11..58bc00e3f0f 100644
--- a/htdocs/core/actions_sendmails.inc.php
+++ b/htdocs/core/actions_sendmails.inc.php
@@ -345,7 +345,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
}
// Send mail
- $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid);
+ if (empty($sendcontext)) $sendcontext = 'standard';
+ $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid,'',$sendcontext);
if ($mailfile->error)
{
setEventMessage($mailfile->error, 'errors');
diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php
index ae3e270101e..02b1d1880c8 100644
--- a/htdocs/core/boxes/box_activity.php
+++ b/htdocs/core/boxes/box_activity.php
@@ -97,181 +97,95 @@ class box_activity extends ModeleBoxes
$cumuldata = array();
- // list the summary of the bills
- if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
+
+ // list the summary of the propals
+ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
{
- include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
- $facturestatic=new Facture($db);
+ include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
+ $propalstatic=new Propal($db);
- // part 1
- $cachedir = DOL_DATA_ROOT.'/facture/temp';
- $filename = '/boxactivity-invoice'.$fileid;
+ $cachedir = DOL_DATA_ROOT.'/propale/temp';
+ $filename = '/boxactivity-propal'.$fileid;
+ $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
+ $data = array();
+ if ($refresh)
+ {
+ $sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb";
+ $sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
+ if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ $sql.= ")";
+ $sql.= " WHERE p.entity = ".$conf->entity;
+ $sql.= " AND p.fk_soc = s.rowid";
+ if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
+ if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
+ $sql.= " AND p.datep >= '".$db->idate($tmpdate)."'";
+ $sql.= " AND p.date_cloture IS NULL"; // just unclosed
+ $sql.= " GROUP BY p.fk_statut";
+ $sql.= " ORDER BY p.fk_statut DESC";
- $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
- $data = array();
- if ($refresh)
- {
- $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
- $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
- if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
- $sql.= ")";
- $sql.= " WHERE f.entity = ".$conf->entity;
- if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
- if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
- $sql.= " AND f.fk_soc = s.rowid";
- $sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1";
- $sql.= " GROUP BY f.fk_statut";
- $sql.= " ORDER BY f.fk_statut DESC";
+ $result = $db->query($sql);
+ if ($result)
+ {
+ $num = $db->num_rows($result);
- $result = $db->query($sql);
- if ($result) {
- $num = $db->num_rows($result);
- $j=0;
- while ($j < $num) {
- $data[$j]=$db->fetch_object($result);
- $j++;
- }
- if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
- dol_filecache($cachedir, $filename, $data);
- }
- $db->free($result);
- } else {
- dol_print_error($db);
- }
- } else {
- $data = dol_readcachefile($cachedir, $filename);
- }
+ $j=0;
+ while ($j < $num) {
+ $data[$j]=$db->fetch_object($result);
+ $j++;
+ }
+ if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
+ dol_filecache($cachedir, $filename, $data);
+ }
+ $db->free($result);
+ } else {
+ dol_print_error($db);
+ }
+ }
+ else
+ {
+ $data = dol_readcachefile($cachedir, $filename);
+ }
- $cumuldata=array_merge($cumuldata, $data);
- if (! empty($data)) {
- $j=0;
- while ($line < count($cumuldata)) {
- $billurl="viewstatut=2&paye=1&year=".$data[$j]->annee;
- $this->info_box_contents[$line][0] = array(
- 'td' => 'align="left" width="16"',
- 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
- 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
- 'logo' => 'bill',
- );
+ $cumuldata=array_merge($cumuldata, $data);
+ if (! empty($data))
+ {
+ $j=0;
+ while ($line < count($cumuldata))
+ {
+ $this->info_box_contents[$line][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut,
+ 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0),
+ 'logo' => 'object_propal'
+ );
- $this->info_box_contents[$line][1] = array(
- 'td' => '',
- 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee,
- );
+ $this->info_box_contents[$line][1] = array(
+ 'td' => '',
+ 'text' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0),
+ );
- $this->info_box_contents[$line][2] = array(
- 'td' => 'class="right"',
- 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
- 'text' => $data[$j]->nb,
- 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
- );
+ $this->info_box_contents[$line][2] = array(
+ 'td' => 'class="right"',
+ 'text' => $data[$j]->nb,
+ 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0),
+ 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut,
+ );
+ $totalnb += $data[$j]->nb;
- $this->info_box_contents[$line][3] = array(
- 'td' => 'class="right"',
- 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency)
- );
+ $this->info_box_contents[$line][3] = array(
+ 'td' => 'class="right"',
+ 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
+ );
+ $totalMnt += $data[$j]->Mnttot;
+ $this->info_box_contents[$line][4] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3),
+ );
- // We add only for the current year
- if ($data[$j]->annee == date("Y")) {
- $totalnb += $data[$j]->nb;
- $totalMnt += $data[$j]->Mnttot;
- }
- $this->info_box_contents[$line][4] = array(
- 'td' => 'align="right" width="18"',
- 'text' => $facturestatic->LibStatut(1,$data[$j]->fk_statut,3),
- );
- $line++;
- $j++;
- }
- if (count($data)==0)
- $this->info_box_contents[$line][0] = array(
- 'td' => 'align="center"',
- 'text'=>$langs->trans("NoRecordedInvoices"),
- );
- }
-
- // part 2
- $cachedir = DOL_DATA_ROOT.'/facture/temp';
- $filename = '/boxactivity-invoice2'.$fileid;
-
- $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
-
- if ($refresh) {
- $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
- $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
- $sql.= " WHERE f.entity = ".$conf->entity;
- $sql.= " AND f.fk_soc = s.rowid";
- $sql.= " AND paye=0";
- $sql.= " GROUP BY f.fk_statut";
- $sql.= " ORDER BY f.fk_statut DESC";
-
- $result = $db->query($sql);
- if ($result) {
- $num = $db->num_rows($result);
- $j=0;
- while ($j < $num) {
- $data[$j]=$db->fetch_object($result);
- $j++;
- }
- if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
- dol_filecache($cachedir, $filename, $data);
- }
- $db->free($result);
- } else {
- dol_print_error($db);
- }
- } else {
- $data = dol_readcachefile($cachedir, $filename);
- }
-
- $cumuldata=array_merge($cumuldata, $data);
- if (! empty($data)) {
- $j=0;
-
- while ($line < count($cumuldata)) {
- $billurl="viewstatut=".$data[$j]->fk_statut."&paye=0";
- $this->info_box_contents[$line][0] = array(
- 'td' => 'align="left" width="16"',
- 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
- 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
- 'logo' => 'bill',
- );
-
- $this->info_box_contents[$line][1] = array(
- 'td' => '',
- 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
- );
-
- $this->info_box_contents[$line][2] = array(
- 'td' => 'class="right"',
- 'text' => $data[$j]->nb,
- 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
- 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
- );
- $totalnb += $data[$j]->nb;
- $this->info_box_contents[$line][3] = array(
- 'td' => 'class="right"',
- 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
- );
- $totalMnt += $objp->Mnttot;
- $this->info_box_contents[$line][4] = array(
- 'td' => 'align="right" width="18"',
- 'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3),
- );
- $line++;
- $j++;
- }
- if ($num==0)
- $this->info_box_contents[$line][0] = array(
- 'td' => 'align="center"',
- 'text'=>$langs->trans("NoRecordedInvoices"),
- );
- } else {
- $this->info_box_contents[0][0] = array(
- 'td' => '',
- 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
- );
- }
+ $line++;
+ $j++;
+ }
+ }
}
// list the summary of the orders
@@ -295,12 +209,10 @@ class box_activity extends ModeleBoxes
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
$sql.= " AND c.date_commande >= '".$db->idate($tmpdate)."'";
- $sql.= " AND c.facture=0";
$sql.= " GROUP BY c.fk_statut";
$sql.= " ORDER BY c.fk_statut DESC";
$result = $db->query($sql);
-
if ($result) {
$num = $db->num_rows($result);
$j=0;
@@ -359,94 +271,182 @@ class box_activity extends ModeleBoxes
}
}
- // list the summary of the propals
- if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
+
+ // list the summary of the bills
+ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
- include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
- $propalstatic=new Propal($db);
+ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
+ $facturestatic=new Facture($db);
- $cachedir = DOL_DATA_ROOT.'/propale/temp';
- $filename = '/boxactivity-propal'.$fileid;
- $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
- $data = array();
- if ($refresh)
- {
- $sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb";
- $sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
- if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
- $sql.= ")";
- $sql.= " WHERE p.entity = ".$conf->entity;
- $sql.= " AND p.fk_soc = s.rowid";
- if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
- if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
- $sql.= " AND p.datep >= '".$db->idate($tmpdate)."'";
- $sql.= " AND p.date_cloture IS NULL"; // just unclosed
- $sql.= " GROUP BY p.fk_statut";
- $sql.= " ORDER BY p.fk_statut DESC";
+ // part 1
+ $cachedir = DOL_DATA_ROOT.'/facture/temp';
+ $filename = '/boxactivity-invoice'.$fileid;
- $result = $db->query($sql);
- if ($result)
- {
- $num = $db->num_rows($result);
+ $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
+ $data = array();
+ if ($refresh)
+ {
+ $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
+ $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
+ if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ $sql.= ")";
+ $sql.= " WHERE f.entity = ".$conf->entity;
+ if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
+ if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
+ $sql.= " AND f.fk_soc = s.rowid";
+ $sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1";
+ $sql.= " GROUP BY f.fk_statut";
+ $sql.= " ORDER BY f.fk_statut DESC";
- $j=0;
- while ($j < $num) {
- $data[$j]=$db->fetch_object($result);
- $j++;
- }
- if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
- dol_filecache($cachedir, $filename, $data);
- }
- $db->free($result);
- } else {
- dol_print_error($db);
- }
- }
- else
- {
- $data = dol_readcachefile($cachedir, $filename);
- }
+ $result = $db->query($sql);
+ if ($result) {
+ $num = $db->num_rows($result);
+ $j=0;
+ while ($j < $num) {
+ $data[$j]=$db->fetch_object($result);
+ $j++;
+ }
+ if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
+ dol_filecache($cachedir, $filename, $data);
+ }
+ $db->free($result);
+ } else {
+ dol_print_error($db);
+ }
+ } else {
+ $data = dol_readcachefile($cachedir, $filename);
+ }
- $cumuldata=array_merge($cumuldata, $data);
- if (! empty($data))
- {
- $j=0;
- while ($line < count($cumuldata))
- {
- $this->info_box_contents[$line][0] = array(
- 'td' => 'align="left" width="16"',
- 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut,
- 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0),
- 'logo' => 'object_propal'
- );
+ $cumuldata=array_merge($cumuldata, $data);
+ if (! empty($data)) {
+ $j=0;
+ while ($line < count($cumuldata)) {
+ $billurl="search_status=2&paye=1&year=".$data[$j]->annee;
+ $this->info_box_contents[$line][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
+ 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
+ 'logo' => 'bill',
+ );
- $this->info_box_contents[$line][1] = array(
- 'td' => '',
- 'text' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0),
- );
+ $this->info_box_contents[$line][1] = array(
+ 'td' => '',
+ 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee,
+ );
- $this->info_box_contents[$line][2] = array(
- 'td' => 'class="right"',
- 'text' => $data[$j]->nb,
- 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0),
- 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut,
- );
- $totalnb += $data[$j]->nb;
+ $this->info_box_contents[$line][2] = array(
+ 'td' => 'class="right"',
+ 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
+ 'text' => $data[$j]->nb,
+ 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
+ );
- $this->info_box_contents[$line][3] = array(
- 'td' => 'class="right"',
- 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
- );
- $totalMnt += $data[$j]->Mnttot;
- $this->info_box_contents[$line][4] = array(
- 'td' => 'align="right" width="18"',
- 'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3),
- );
+ $this->info_box_contents[$line][3] = array(
+ 'td' => 'class="right"',
+ 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency)
+ );
- $line++;
- $j++;
- }
- }
+ // We add only for the current year
+ if ($data[$j]->annee == date("Y")) {
+ $totalnb += $data[$j]->nb;
+ $totalMnt += $data[$j]->Mnttot;
+ }
+ $this->info_box_contents[$line][4] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $facturestatic->LibStatut(1,$data[$j]->fk_statut,3),
+ );
+ $line++;
+ $j++;
+ }
+ if (count($data)==0)
+ $this->info_box_contents[$line][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoRecordedInvoices"),
+ );
+ }
+
+ // part 2
+ $cachedir = DOL_DATA_ROOT.'/facture/temp';
+ $filename = '/boxactivity-invoice2'.$fileid;
+
+ $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
+
+ if ($refresh) {
+ $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
+ $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
+ $sql.= " WHERE f.entity = ".$conf->entity;
+ $sql.= " AND f.fk_soc = s.rowid";
+ $sql.= " AND paye=0";
+ $sql.= " GROUP BY f.fk_statut";
+ $sql.= " ORDER BY f.fk_statut DESC";
+
+ $result = $db->query($sql);
+ if ($result) {
+ $num = $db->num_rows($result);
+ $j=0;
+ while ($j < $num) {
+ $data[$j]=$db->fetch_object($result);
+ $j++;
+ }
+ if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
+ dol_filecache($cachedir, $filename, $data);
+ }
+ $db->free($result);
+ } else {
+ dol_print_error($db);
+ }
+ } else {
+ $data = dol_readcachefile($cachedir, $filename);
+ }
+
+ $cumuldata=array_merge($cumuldata, $data);
+ if (! empty($data)) {
+ $j=0;
+
+ while ($line < count($cumuldata)) {
+ $billurl="search_status=".$data[$j]->fk_statut."&paye=0";
+ $this->info_box_contents[$line][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
+ 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
+ 'logo' => 'bill',
+ );
+
+ $this->info_box_contents[$line][1] = array(
+ 'td' => '',
+ 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
+ );
+
+ $this->info_box_contents[$line][2] = array(
+ 'td' => 'class="right"',
+ 'text' => $data[$j]->nb,
+ 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
+ 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
+ );
+ $totalnb += $data[$j]->nb;
+ $this->info_box_contents[$line][3] = array(
+ 'td' => 'class="right"',
+ 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
+ );
+ $totalMnt += $objp->Mnttot;
+ $this->info_box_contents[$line][4] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3),
+ );
+ $line++;
+ $j++;
+ }
+ if ($num==0)
+ $this->info_box_contents[$line][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoRecordedInvoices"),
+ );
+ } else {
+ $this->info_box_contents[0][0] = array(
+ 'td' => '',
+ 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
+ );
+ }
}
// Add the sum in the bottom of the boxes
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 3b3efe96fb0..b05b8a162a1 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -38,8 +38,7 @@ class CMailFile
{
public $sendcontext;
public $sendmode;
- public $sendsetup;
-
+
var $subject; // Topic: Subject of email
var $addr_from; // From: Label and EMail of sender (must include '<>'). For example '' or 'John Doe ' or ''). Note that with gmail smtps, value here is forced by google to account (but not the reply-to).
// Sender: Who send the email ("Sender" has sent emails on behalf of "From").
@@ -115,14 +114,15 @@ class CMailFile
global $conf, $dolibarr_main_data_root;
$this->sendcontext = $sendcontext;
-
+
+ // Define this->sendmode
$this->sendmode = '';
- if ($this->sendcontext == 'emailing') $this->sendmode = $conf->global->EMAILING_MAIL_SENDMODE;
+ if ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default')
+ {
+ $this->sendmode = $conf->global->MAIN_MAIL_SENDMODE_EMAILING;
+ }
if (empty($this->sendmode)) $this->sendmode=$conf->global->MAIN_MAIL_SENDMODE;
if (empty($this->sendmode)) $this->sendmode='mail';
-
- $this->sendsetup = array();
-
// We define end of line (RFC 821).
$this->eol="\r\n";
@@ -145,7 +145,7 @@ class CMailFile
$this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); // Force md5 hash (does not contains special chars)
dol_syslog("CMailFile::CMailfile: sendmode=".$this->sendmode." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, trackid=$trackid sendcontext=$sendcontext", LOG_DEBUG);
- dol_syslog("CMailFile::CMailfile: subject=$subject, deliveryreceipt=$deliveryreceipt, msgishtml=$msgishtml", LOG_DEBUG);
+ dol_syslog("CMailFile::CMailfile: subject=".$subject.", deliveryreceipt=".$deliveryreceipt.", msgishtml=".$msgishtml, LOG_DEBUG);
if (empty($subject))
{
@@ -157,7 +157,7 @@ class CMailFile
{
dol_syslog("CMailFile::CMailfile: Try to send an email with empty body");
$msg='.'; // Avoid empty message (with empty message conten show a multipart structure)
- }
+ }
// Detect if message is HTML (use fast method)
if ($msgishtml == -1)
@@ -230,7 +230,7 @@ class CMailFile
$this->addr_bcc = $addr_bcc;
$this->deliveryreceipt = $deliveryreceipt;
$this->trackid = $trackid;
-
+
$smtp_headers = $this->write_smtpheaders();
if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n
@@ -339,7 +339,7 @@ class CMailFile
$this->phpmailer->SetReplyTo($this->getValidAddress($from,0,1)); // Set property with this->phpmailer->setReplyTo after constructor if you want to use another value than the From
// TODO Add trackid into smtp header
// TODO if (! empty($moreinheader)) ...
-
+
if (! empty($this->html))
{
if (!empty($css))
@@ -487,9 +487,7 @@ class CMailFile
{
require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
$hookmanager = new HookManager($db);
- $hookmanager->initHooks(array(
- 'maildao'
- ));
+ $hookmanager->initHooks(array('maildao'));
$reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if (! empty($reshook))
{
@@ -532,6 +530,22 @@ class CMailFile
return false;
}
+ $keyforsmtpserver='MAIN_MAIL_SMTP_SERVER';
+ $keyforsmtpport ='MAIN_MAIL_SMTP_PORT';
+ $keyforsmtpid ='MAIN_MAIL_SMTPS_ID';
+ $keyforsmtppw ='MAIN_MAIL_SMTPS_PW';
+ $keyfortls ='MAIN_MAIL_EMAIL_TLS';
+ $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS';
+ if ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default')
+ {
+ $keyforsmtpserver='MAIN_MAIL_SMTP_SERVER_EMAILING';
+ $keyforsmtpport ='MAIN_MAIL_SMTP_PORT_EMAILING';
+ $keyforsmtpid ='MAIN_MAIL_SMTPS_ID_EMAILING';
+ $keyforsmtppw ='MAIN_MAIL_SMTPS_PW_EMAILING';
+ $keyfortls ='MAIN_MAIL_EMAIL_TLS_EMAILING';
+ $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS_EMAILING';
+ }
+
// Action according to choosed sending method
if ($this->sendmode == 'mail')
{
@@ -548,9 +562,9 @@ class CMailFile
@ini_set('sendmail_from',$this->getValidAddress($this->addr_from,2));
}
- // Forcage parametres
- if (! empty($conf->global->MAIN_MAIL_SMTP_SERVER)) ini_set('SMTP',$conf->global->MAIN_MAIL_SMTP_SERVER);
- if (! empty($conf->global->MAIN_MAIL_SMTP_PORT)) ini_set('smtp_port',$conf->global->MAIN_MAIL_SMTP_PORT);
+ // Force parameters
+ if (! empty($conf->global->$keyforsmtpserver)) ini_set('SMTP',$conf->global->$keyforsmtpserver);
+ if (! empty($conf->global->$keyforsmtpport)) ini_set('smtp_port',$conf->global->$keyforsmtpport);
$dest=$this->getValidAddress($this->addr_to,2);
if (! $dest)
@@ -610,9 +624,9 @@ class CMailFile
@ini_restore('sendmail_from');
}
- // Forcage parametres
- if (! empty($conf->global->MAIN_MAIL_SMTP_SERVER)) ini_restore('SMTP');
- if (! empty($conf->global->MAIN_MAIL_SMTP_PORT)) ini_restore('smtp_port');
+ // Restore parameters
+ if (! empty($conf->global->$keyforsmtpserver)) ini_restore('SMTP');
+ if (! empty($conf->global->$keyforsmtpport)) ini_restore('smtp_port');
}
else if ($this->sendmode == 'smtps')
{
@@ -622,28 +636,30 @@ class CMailFile
$this->smtps->setTransportType(0); // Only this method is coded in SMTPs library
// Clean parameters
- if (empty($conf->global->MAIN_MAIL_SMTP_SERVER)) $conf->global->MAIN_MAIL_SMTP_SERVER=ini_get('SMTP');
- if (empty($conf->global->MAIN_MAIL_SMTP_PORT)) $conf->global->MAIN_MAIL_SMTP_PORT=ini_get('smtp_port');
-
- // TODO Manage alternative parameters
+ if (empty($conf->global->$keyforsmtpserver)) $conf->global->$keyforsmtpserver=ini_get('SMTP');
+ if (empty($conf->global->$keyforsmtpport)) $conf->global->$keyforsmtpport=ini_get('smtp_port');
// If we use SSL/TLS
- $server=$conf->global->MAIN_MAIL_SMTP_SERVER;
- if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $server='ssl://'.$server;
- $port=$conf->global->MAIN_MAIL_SMTP_PORT;
+ $server=$conf->global->$keyforsmtpserver;
+ $secure='';
+ if (! empty($conf->global->$keyfortls) && function_exists('openssl_open')) $secure='ssl';
+ if (! empty($conf->global->$keyforstarttls) && function_exists('openssl_open')) $secure='tls';
+ $server=($secure?$secure.'://':'').$server;
+
+ $port=$conf->global->$keyforsmtpport;
$this->smtps->setHost($server);
$this->smtps->setPort($port); // 25, 465...;
$loginid=''; $loginpass='';
- if (! empty($conf->global->MAIN_MAIL_SMTPS_ID))
+ if (! empty($conf->global->$keyforsmtpid))
{
- $loginid = $conf->global->MAIN_MAIL_SMTPS_ID;
+ $loginid = $conf->global->$keyforsmtpid;
$this->smtps->setID($loginid);
}
- if (! empty($conf->global->MAIN_MAIL_SMTPS_PW))
+ if (! empty($conf->global->$keyforsmtppw))
{
- $loginpass = $conf->global->MAIN_MAIL_SMTPS_PW;
+ $loginpass = $conf->global->$keyforsmtppw;
$this->smtps->setPW($loginpass);
}
@@ -651,14 +667,14 @@ class CMailFile
$from=$this->smtps->getFrom('org');
if (! $from)
{
- $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->MAIN_MAIL_SMTP_PORT." Sender address '$from' invalid";
+ $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport." Sender address '$from' invalid";
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
$res=false;
}
$dest=$this->smtps->getTo();
if (! $dest)
{
- $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->MAIN_MAIL_SMTP_PORT." Recipient address '$dest' invalid";
+ $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport." Recipient address '$dest' invalid";
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
$res=false;
}
@@ -666,7 +682,7 @@ class CMailFile
if ($res)
{
if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->smtps->setDebug(true);
-
+
$result=$this->smtps->sendMsg();
//print $result;
@@ -684,26 +700,24 @@ class CMailFile
}
else if ($this->sendmode == 'swiftmailer')
{
-
// Use Swift Mailer library
// ------------------------------------------
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php';
- // Forcage parametres
- if (empty($conf->global->MAIN_MAIL_SMTP_SERVER)) $conf->global->MAIN_MAIL_SMTP_SERVER=ini_get('SMTP');
- if (empty($conf->global->MAIN_MAIL_SMTP_PORT)) $conf->global->MAIN_MAIL_SMTP_PORT=ini_get('smtp_port');
+ // Clean parameters
+ if (empty($conf->global->$keyforsmtpserver)) $conf->global->$keyforsmtpserver=ini_get('SMTP');
+ if (empty($conf->global->$keyforsmtpport)) $conf->global->$keyforsmtpport=ini_get('smtp_port');
// If we use SSL/TLS
- $server=$conf->global->MAIN_MAIL_SMTP_SERVER;
+ $server=$conf->global->$keyforsmtpserver;
$secure='';
- //var_dump(stream_get_transports());
- if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $secure='ssl';
- if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $secure='tls';
+ if (! empty($conf->global->$keyfortls) && function_exists('openssl_open')) $secure='ssl';
+ if (! empty($conf->global->$keyforstarttls) && function_exists('openssl_open')) $secure='tls';
- $this->transport = Swift_SmtpTransport::newInstance($server, $conf->global->MAIN_MAIL_SMTP_PORT, $secure);
+ $this->transport = Swift_SmtpTransport::newInstance($server, $conf->global->$keyforsmtpport, $secure);
- if (! empty($conf->global->MAIN_MAIL_SMTPS_ID)) $this->transport->setUsername($conf->global->MAIN_MAIL_SMTPS_ID);
- if (! empty($conf->global->MAIN_MAIL_SMTPS_PW)) $this->transport->setPassword($conf->global->MAIN_MAIL_SMTPS_PW);
+ if (! empty($conf->global->$keyforsmtpid)) $this->transport->setUsername($conf->global->$keyforsmtpid);
+ if (! empty($conf->global->$keyforsmtppw)) $this->transport->setPassword($conf->global->$keyforsmtppw);
//$smtps->_msgReplyTo = 'reply@web.com';
// Create the Mailer using your created Transport
@@ -1026,7 +1040,7 @@ class CMailFile
$out.= $this->eol;
$out.= "--" . $this->related_boundary . $this->eol;
}
-
+
if (! $this->atleastoneimage && $strContentAltText && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part before html part
{
$out.= "Content-Type: multipart/alternative; boundary=\"".$this->alternative_boundary."\"".$this->eol;
@@ -1036,7 +1050,7 @@ class CMailFile
$out.= $this->eol.$strContentAltText.$this->eol;
$out.= "--" . $this->alternative_boundary . $this->eol;
}
-
+
$out.= "Content-Type: text/html; charset=".$conf->file->character_set_client.$this->eol;
$out.= $this->eol.$strContent.$this->eol;
@@ -1154,13 +1168,30 @@ class CMailFile
function check_server_port($host,$port)
{
global $conf;
+
$_retVal=0;
$timeout=5; // Timeout in seconds
if (function_exists('fsockopen'))
{
+ $keyforsmtpserver='MAIN_MAIL_SMTP_SERVER';
+ $keyforsmtpport ='MAIN_MAIL_SMTP_PORT';
+ $keyforsmtpid ='MAIN_MAIL_SMTPS_ID';
+ $keyforsmtppw ='MAIN_MAIL_SMTPS_PW';
+ $keyfortls ='MAIN_MAIL_EMAIL_TLS';
+ $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS';
+ if ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default')
+ {
+ $keyforsmtpserver='MAIN_MAIL_SMTP_SERVER_EMAILING';
+ $keyforsmtpport ='MAIN_MAIL_SMTP_PORT_EMAILING';
+ $keyforsmtpid ='MAIN_MAIL_SMTPS_ID_EMAILING';
+ $keyforsmtppw ='MAIN_MAIL_SMTPS_PW_EMAILING';
+ $keyfortls ='MAIN_MAIL_EMAIL_TLS_EMAILING';
+ $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS_EMAILING';
+ }
+
// If we use SSL/TLS
- if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $host='ssl://'.$host;
+ if (! empty($conf->global->$keyfortls) && function_exists('openssl_open')) $host='ssl://'.$host;
// tls smtp start with no encryption
//if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host;
@@ -1355,7 +1386,7 @@ class CMailFile
if ($email)
{
$i++;
-
+
$newemail='';
if ($format == 4)
{
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 1c516078dd4..50ccf362de6 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -4207,7 +4207,7 @@ abstract class CommonObject
if (! is_array($optionsArray))
{
- // $extrafields is not a known object, we initialize it. Best practice is to have $extrafields defined into card.php or list.php page.
+ // If $extrafields is not a known object, we initialize it. Best practice is to have $extrafields defined into card.php or list.php page.
// TODO Use of existing extrafield is not yet ready (must mutualize code that use extrafields in form first)
// global $extrafields;
//if (! is_object($extrafields))
@@ -4228,7 +4228,7 @@ abstract class CommonObject
if ($table_element == 'categorie') $table_element = 'categories'; // For compatibility
// Request to get complementary values
- if (count($optionsArray) > 0)
+ if (is_array($optionsArray) && count($optionsArray) > 0)
{
$sql = "SELECT rowid";
foreach ($optionsArray as $name => $label)
@@ -4352,6 +4352,12 @@ abstract class CommonObject
$this->array_options[$key] = null;
}
break;
+ /*case 'select': // Not required, we chosed value='0' for undefined values
+ if ($value=='-1')
+ {
+ $this->array_options[$key] = null;
+ }
+ break;*/
case 'price':
$this->array_options[$key] = price2num($this->array_options[$key]);
break;
@@ -4485,6 +4491,12 @@ abstract class CommonObject
$this->array_options["options_".$key] = null;
}
break;
+ /*case 'select': // Not required, we chosed value='0' for undefined values
+ if ($value=='-1')
+ {
+ $this->array_options[$key] = null;
+ }
+ break;*/
case 'price':
$this->array_options["options_".$key] = price2num($this->array_options["options_".$key]);
break;
diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php
index eaf72ffff71..e67fe9ee224 100644
--- a/htdocs/core/class/doleditor.class.php
+++ b/htdocs/core/class/doleditor.class.php
@@ -63,7 +63,7 @@ class DolEditor
* @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%')
* @param int $readonly 0=Read/Edit, 1=Read only
*/
- function __construct($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0,$readonly=0)
+ function __construct($htmlname, $content, $width='', $height=200, $toolbarname='Basic', $toolbarlocation='In', $toolbarstartexpanded=false, $uselocalbrowser=true, $okforextendededitor=true, $rows=0, $cols=0, $readonly=0)
{
global $conf,$langs;
@@ -282,11 +282,10 @@ class DolEditor
$out.= ($this->height?' height: '.$this->height.'px; ':'');
//$out.=" min-height: 100px;";
$out.= '">';
- /*$out.= preg_replace(array('/^<\?php/','/\?>$/'), array('<?php','?>'), $this->content); */
- $out.= htmlentities($this->content);
+ $out.= htmlspecialchars($this->content);
$out.= '';
$out.= '';
$out.= '';
- }
print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0,0,$alsoproductwithnosupplierprice);
}
}
@@ -5089,7 +5080,7 @@ class Form
* @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
* @param array $array Array (key => value)
* @param string|string[] $id Preselected key or preselected keys for multiselect
- * @param int $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (value is '' or ' ' if 1), <0 to add an empty value with key that is this value.
+ * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or ' ' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value.
* @param int $key_in_label 1 to show key into label with format "[key] value"
* @param int $value_as_key 1 to use value as key
* @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index f2e861ea932..4ec9c91aa80 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -473,7 +473,7 @@ class FormMail extends Form
$out.= ' <'.$this->tomail.'>';
if ($this->withtofree)
{
- $out.= ' '.$langs->trans("or").' withto) :"").'" />';
+ $out.= ' '.$langs->trans("and").' withto) :"").'" />';
}
}
else
@@ -489,7 +489,7 @@ class FormMail extends Form
}
if (! empty($this->withto) && is_array($this->withto))
{
- if (! empty($this->withtofree)) $out.= " ".$langs->trans("or")." ";
+ if (! empty($this->withtofree)) $out.= " ".$langs->trans("and")."/".$langs->trans("or")." ";
// multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time
$tmparray = $this->withto;
foreach($tmparray as $key => $val)
@@ -522,7 +522,7 @@ class FormMail extends Form
$out.= 'withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") ).'" />';
if (! empty($this->withtocc) && is_array($this->withtocc))
{
- $out.= " ".$langs->trans("or")." ";
+ $out.= " ".$langs->trans("and")."/".$langs->trans("or")." ";
// multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time
$tmparray = $this->withtocc;
foreach($tmparray as $key => $val)
@@ -551,7 +551,7 @@ class FormMail extends Form
$out.= 'withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") ).'" />';
if (! empty($this->withtoccc) && is_array($this->withtoccc))
{
- $out.= " ".$langs->trans("or")." ";
+ $out.= " ".$langs->trans("and")."/".$langs->trans("or")." ";
// multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time
$tmparray = $this->withtoccc;
foreach($tmparray as $key => $val)
diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php
index c92558bf1d3..cfaa88363a4 100644
--- a/htdocs/core/class/smtps.class.php
+++ b/htdocs/core/class/smtps.class.php
@@ -358,8 +358,11 @@ class SMTPs
// This is done here because '@fsockopen' will not give me this
// information if it failes to connect because it can't find the HOST
$host=$this->getHost();
+ $usetls = preg_match('@tls://@i',$host);
+
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
+ $host=preg_replace('@tls://@i','',$host); // Remove prefix
// @CHANGE LDR
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
@@ -373,7 +376,7 @@ class SMTPs
{
//See if we can connect to the SMTP server
if ($this->socket = @fsockopen(
- $this->getHost(), // Host to 'hit', IP or domain
+ preg_replace('@tls://@i','',$this->getHost()), // Host to 'hit', IP or domain
$this->getPort(), // which Port number to use
$this->errno, // actual system level error
$this->errstr, // and any text that goes with the error
@@ -416,16 +419,17 @@ class SMTPs
// This improvment as provided by 'SirSir' to
// accomodate both SMTP AND ESMTP capable servers
$host=$this->getHost();
+ $usetls = preg_match('@tls://@i',$host);
+
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
- if (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS))
- {
- $host=preg_replace('@tls://@i','',$host); // Remove prefix
- $host='tls://'.$host;
- }
+ $host=preg_replace('@tls://@i','',$host); // Remove prefix
+
+ if ($usetls) $host='tls://'.$host;
+
if ( $_retVal = $this->socket_send_str('EHLO ' . $host, '250') )
{
- if (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS))
+ if ($usetls)
{
/*
The following dialog illustrates how a client and server can start a TLS STARTTLS session
@@ -443,7 +447,7 @@ class SMTPs
// Second pass EHLO
C: EHLO client-domain.com
S: 250-server-domain.com
- S: 250 AUTH LOGIN
+ S: 250 AUTH LOGIN
C: socket_send_str('STARTTLS', 220))
@@ -456,7 +460,7 @@ class SMTPs
$this->_setErr(132, 'STARTTLS connection failed.');
return $_retVal;
}
- // Most server servers expect a 2nd pass of EHLO after TLS is established to get another time
+ // Most server servers expect a 2nd pass of EHLO after TLS is established to get another time
// the answer with list of supported AUTH methods. They may differs between non STARTTLS and with STARTTLS.
if (!$_retVal = $this->socket_send_str('EHLO '.$host, '250'))
{
@@ -514,8 +518,12 @@ class SMTPs
{
// Send the RFC821 specified HELO.
$host=$this->getHost();
+ $usetls = preg_match('@tls://@i',$host);
+
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
+ $host=preg_replace('@tls://@i','',$host); // Remove prefix
+
$_retVal = $this->socket_send_str('HELO ' . $host, '250');
}
@@ -1237,8 +1245,11 @@ class SMTPs
*/
$host=$this->getHost();
+ $usetls = preg_match('@tls://@i',$host);
+
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
+ $host=preg_replace('@tls://@i','',$host); // Remove prefix
$host=dol_getprefix('email');
diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php
index 76a1458b913..dc86a2ef9f3 100644
--- a/htdocs/core/lib/ajax.lib.php
+++ b/htdocs/core/lib/ajax.lib.php
@@ -40,6 +40,7 @@
* Ex: array('disabled'=> )
* Ex: array('show'=> )
* Ex: array('update_textarea'=> )
+ * Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax)
* @return string Script
*/
function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array())
@@ -146,6 +147,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
$("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value
// Disable an element
if (options.option_disabled) {
+ console.log("Make action option_disabled on #"+options.option_disabled+" with disabled="+ui.item.disabled)
if (ui.item.disabled) {
$("#" + options.option_disabled).prop("disabled", true);
if (options.error) {
@@ -154,28 +156,32 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
if (options.warning) {
$.jnotify(options.warning, "warning", false); // Output with jnotify the warning message
}
- } else {
+ } else {
$("#" + options.option_disabled).removeAttr("disabled");
}
}
if (options.disabled) {
+ console.log("Make action disabled on each "+options.option_disabled)
$.each(options.disabled, function(key, value) {
$("#" + value).prop("disabled", true);
});
}
if (options.show) {
+ console.log("Make action show on each "+options.show)
$.each(options.show, function(key, value) {
$("#" + value).show().trigger("show");
});
}
// Update an input
if (ui.item.update) {
+ console.log("Make action update on each ui.item.update")
// loop on each "update" fields
$.each(ui.item.update, function(key, value) {
$("#" + key).val(value).trigger("change");
});
}
if (ui.item.textarea) {
+ console.log("Make action textarea on each ui.item.textarea")
$.each(ui.item.textarea, function(key, value) {
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined") {
CKEDITOR.instances[key].setData(value);
@@ -192,7 +198,6 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
}
,delay: 500
}).data("'.$dataforrenderITem.'")._renderItem = function( ul, item ) {
-
return $("
")
.data( "'.$dataforitem.'", item ) // jQuery UI > 1.10.0
.append( \'\' + item.label + "" )
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 15af95ffb9c..7d654104257 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -190,8 +190,9 @@ function getBrowserInfo($user_agent)
}
// OS
- if (preg_match('/linux/i', $user_agent)) { $os='linux'; }
+ if (preg_match('/linux/i', $user_agent)) { $os='linux'; }
elseif (preg_match('/macintosh/i', $user_agent)) { $os='macintosh'; }
+ elseif (preg_match('/windows/i', $user_agent)) { $os='windows'; }
// Name
if (preg_match('/firefox(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='firefox'; $version=$reg[2]; }
@@ -201,7 +202,8 @@ function getBrowserInfo($user_agent)
elseif (preg_match('/epiphany/i', $user_agent)) { $name='epiphany'; }
elseif (preg_match('/safari(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not.
elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='opera'; $version=$reg[2]; }
- elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end
+ elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];.*rv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end
+ elseif (preg_match('/(Windows NT\s([0-9]+\.[0-9])).*(Trident\/[0-9]+.[0-9];.*rv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end
elseif (preg_match('/l(i|y)n(x|ks)(\(|\/|\s)*([\d\.]+)/i', $user_agent, $reg)) { $name='lynxlinks'; $version=$reg[4]; }
if ($tablet) {
@@ -1190,10 +1192,10 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$nophoto='';
$morehtmlleft.='';
}
- elseif ($conf->browser->layout != 'phone') { // Show no photo link
+ //elseif ($conf->browser->layout != 'phone') { // Show no photo link
$nophoto='/public/theme/common/nophoto.png';
$morehtmlleft.='
';
- }
+ //}
}
}
else
@@ -1270,7 +1272,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
}
}
- if (! $phototoshow && $conf->browser->layout != 'phone') // Show No photo link (picto of pbject)
+ if (! $phototoshow) // Show No photo link (picto of pbject)
{
$morehtmlleft.='
';
if ($object->element == 'action')
@@ -1288,6 +1290,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
}
$morehtmlleft.='';
$morehtmlleft.='
';
+
$morehtmlleft.='
';
}
}
@@ -6261,7 +6264,7 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
$newres .= $db->escape($tmpcrit2);
$newres .= $tmpafter;
$newres .= "'";
- if (empty($tmpcrit2))
+ if ($tmpcrit2 == '')
{
$newres .= ' OR ' . $field . " IS NULL";
}
@@ -6454,7 +6457,7 @@ function dol_mimetype($file,$default='application/octet-stream',$mode=0)
/**
* Return value from dictionary
- *
+ *
* @param string $tablename name of dictionary
* @param string $field the value to return
* @param int $id id of line
@@ -6464,13 +6467,13 @@ function dol_mimetype($file,$default='application/octet-stream',$mode=0)
function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield='rowid')
{
global $dictvalues,$db,$langs;
-
+
if (!isset($dictvalues[$tablename]))
{
$dictvalues[$tablename] = array();
$sql = 'SELECT * FROM '.$tablename.' WHERE 1';
if ($checkentity) $sql.= ' entity IN (0,'.getEntity('').')';
-
+
$resql = $db->query($sql);
if ($resql)
{
@@ -6484,7 +6487,7 @@ function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield='
dol_print_error($db);
}
}
-
+
if (!empty($dictvalues[$tablename][$id])) return $dictvalues[$tablename][$id]->{$field}; // Found
else // Not found
{
diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php
index 2de1bfb4ecd..4396b5a862c 100644
--- a/htdocs/core/lib/website.lib.php
+++ b/htdocs/core/lib/website.lib.php
@@ -164,10 +164,18 @@ function dolIncludeHtmlContent($contentfile)
print 'ERROR: RECURSIVE CONTENT LEVEL. Depth of recursive call is more than the limit of '.$MAXLEVEL.".\n";
return;
}
- // TODO Remove body and html if included
+ // file_get_contents is not possible. We must execute code with include
//$content = file_get_contents($fullpathfile);
//print preg_replace(array('/^.*]*>/ims','/<\/body>.*$/ims'), array('', ''), $content);*/
+
+ ob_start();
$res = include $fullpathfile; // Include because we want to execute code content
+ $tmpoutput = ob_get_contents();
+ ob_end_clean();
+
+ print "\n".''."\n";
+ print preg_replace(array('/^.*]*>/ims','/<\/body>.*$/ims'), array('', ''), $tmpoutput);
+
if (! $res)
{
print 'ERROR: FAILED TO INCLUDE PAGE '.$contentfile.".\n";
diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php
index 041892c35ee..ade0e2c7e75 100644
--- a/htdocs/core/modules/modAdherent.class.php
+++ b/htdocs/core/modules/modAdherent.class.php
@@ -53,7 +53,8 @@ class modAdherent extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Management of members of a foundation or association";
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='user';
@@ -75,119 +76,119 @@ class modAdherent extends DolibarrModules
//-----------
$this->const = array();
$r=0;
-
+
$this->const[$r][0] = "ADHERENT_ADDON_PDF";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "standard";
$this->const[$r][3] = 'Name of PDF model of member';
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_MAIL_RESIL";
$this->const[$r][1] = "texte";
$this->const[$r][2] = "Votre adhésion vient d'être résiliée.\r\nNous espérons vous revoir très bientôt";
$this->const[$r][3] = "Mail de résiliation";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_MAIL_VALID";
$this->const[$r][1] = "texte";
$this->const[$r][2] = "Votre adhésion vient d'être validée. \r\nVoici le rappel de vos coordonnées (toute information erronée entrainera la non validation de votre inscription) :\r\n\r\n%INFOS%\r\n\r\n";
$this->const[$r][3] = "Mail de validation";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_MAIL_VALID_SUBJECT";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "Votre adhésion a été validée";
$this->const[$r][3] = "Sujet du mail de validation";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_MAIL_RESIL_SUBJECT";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "Résiliation de votre adhésion";
$this->const[$r][3] = "Sujet du mail de résiliation";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_MAIL_FROM";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "";
$this->const[$r][3] = "From des mails";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_MAIL_COTIS";
$this->const[$r][1] = "texte";
$this->const[$r][2] = "Bonjour %FIRSTNAME%,\r\nCet email confirme que votre cotisation a été reçue\r\net enregistrée";
$this->const[$r][3] = "Mail de validation de cotisation";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_MAIL_COTIS_SUBJECT";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "Reçu de votre cotisation";
$this->const[$r][3] = "Sujet du mail de validation de cotisation";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_CARD_HEADER_TEXT";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "%YEAR%";
$this->const[$r][3] = "Texte imprimé sur le haut de la carte adhérent";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_CARD_FOOTER_TEXT";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "%COMPANY%";
$this->const[$r][3] = "Texte imprimé sur le bas de la carte adhérent";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_CARD_TEXT";
$this->const[$r][1] = "texte";
$this->const[$r][2] = "%FULLNAME%\r\nID: %ID%\r\n%EMAIL%\r\n%ADDRESS%\r\n%ZIP% %TOWN%\r\n%COUNTRY%";
$this->const[$r][3] = "Text to print on member cards";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_MAILMAN_ADMINPW";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "";
$this->const[$r][3] = "Mot de passe Admin des liste mailman";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_BANK_ACCOUNT";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "";
$this->const[$r][3] = "ID du Compte banquaire utilise";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_BANK_CATEGORIE";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "";
$this->const[$r][3] = "ID de la catégorie bancaire des cotisations";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_ETIQUETTE_TYPE";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "L7163";
$this->const[$r][3] = "Type of address sheets";
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "ADHERENT_ETIQUETTE_TEXT";
$this->const[$r][1] = "texte";
$this->const[$r][2] = "%FULLNAME%\n%ADDRESS%\n%ZIP% %TOWN%\n%COUNTRY%";
$this->const[$r][3] = "Text to print on member address sheets";
$this->const[$r][4] = 0;
$r++;
-
+
// Boxes
//-------
$this->boxes = array(0=>array('file'=>'box_members.php','enabledbydefaulton'=>'Home'));
@@ -260,8 +261,8 @@ class modAdherent extends DolibarrModules
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
// Exports
//--------
$r=0;
@@ -325,8 +326,8 @@ class modAdherent extends DolibarrModules
$this->import_regex_array[$r]=array('a.civility'=>'code@'.MAIN_DB_PREFIX.'c_civility','a.fk_adherent_type'=>'rowid@'.MAIN_DB_PREFIX.'adherent_type','a.morphy'=>'(phy|mor)','a.statut'=>'^[0|1]','a.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','a.datefin'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
$this->import_examplevalues_array[$r]=array('a.civility'=>"MR",'a.lastname'=>'Smith','a.firstname'=>'John','a.login'=>'jsmith','a.pass'=>'passofjsmith','a.fk_adherent_type'=>'1','a.morphy'=>'"mor" or "phy"','a.societe'=>'JS company','a.address'=>'21 jump street','a.zip'=>'55000','a.town'=>'New York','a.country'=>'1','a.email'=>'jsmith@example.com','a.birth'=>'1972-10-10','a.statut'=>"0 or 1",'a.note_public'=>"This is a public comment on member",'a.note_private'=>"This is private comment on member",'a.datec'=>dol_print_date($now,'%Y-%m-%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d'));
}
-
-
+
+
/**
* Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
@@ -338,16 +339,16 @@ class modAdherent extends DolibarrModules
function init($options='')
{
global $conf,$langs;
-
+
// Permissions
$this->remove($options);
-
+
//ODT template
/*
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/orders/template_order.odt';
$dirodt=DOL_DATA_ROOT.'/doctemplates/orders';
$dest=$dirodt.'/template_order.odt';
-
+
if (file_exists($src) && ! file_exists($dest))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -360,12 +361,12 @@ class modAdherent extends DolibarrModules
return 0;
}
}*/
-
+
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type='member' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','member',".$conf->entity.")"
);
-
+
return $this->_init($sql,$options);
- }
+ }
}
diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php
index da33e307b16..a42c3001b44 100644
--- a/htdocs/core/modules/modAgenda.class.php
+++ b/htdocs/core/modules/modAgenda.class.php
@@ -55,7 +55,8 @@ class modAgenda extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Follow events or rendez-vous. Record manual events into Agendas or let application record automatic events for log tracking.";
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
diff --git a/htdocs/core/modules/modBarcode.class.php b/htdocs/core/modules/modBarcode.class.php
index 0bb858fa07a..69df9843630 100644
--- a/htdocs/core/modules/modBarcode.class.php
+++ b/htdocs/core/modules/modBarcode.class.php
@@ -48,7 +48,8 @@ class modBarcode extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des codes barres";
- $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 2;
$this->picto='barcode';
diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php
index 3125627c007..f26c5fe525f 100644
--- a/htdocs/core/modules/modBlockedLog.class.php
+++ b/htdocs/core/modules/modBlockedLog.class.php
@@ -47,7 +47,8 @@ class modBlockedLog extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable a log on some business events into a non reversible log. This module may be mandatory for some countries.";
- $this->version = 'development'; // 'development', 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'development';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
diff --git a/htdocs/core/modules/modCollab.class.php b/htdocs/core/modules/modCollab.class.php
index 506eb99b540..01a80d0b702 100644
--- a/htdocs/core/modules/modCollab.class.php
+++ b/htdocs/core/modules/modCollab.class.php
@@ -42,7 +42,7 @@ class modCollab extends DolibarrModules
$this->db = $db;
$this->numero = 30000;
-
+
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "portal";
@@ -50,7 +50,8 @@ class modCollab extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable the public collaboration features, like shared pad, shared online sheets, etc...";
- $this->version = 'development'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'development';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php
index 90dae11dd72..55f0f96c546 100644
--- a/htdocs/core/modules/modCron.class.php
+++ b/htdocs/core/modules/modCron.class.php
@@ -50,7 +50,8 @@ class modCron extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable the Dolibarr cron service";
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php
index 881dd27e414..08564e241aa 100644
--- a/htdocs/core/modules/modDon.class.php
+++ b/htdocs/core/modules/modDon.class.php
@@ -49,7 +49,8 @@ class modDon extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des dons";
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
// Name of png file (without png) used for this module.
@@ -135,12 +136,12 @@ class modDon extends DolibarrModules
$this->rights[3][2] = 'd';
$this->rights[3][3] = 0;
$this->rights[3][4] = 'supprimer';
-
-
+
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
+
}
diff --git a/htdocs/core/modules/modDynamicPrices.class.php b/htdocs/core/modules/modDynamicPrices.class.php
index cb6544f4d29..21aa3644e3e 100644
--- a/htdocs/core/modules/modDynamicPrices.class.php
+++ b/htdocs/core/modules/modDynamicPrices.class.php
@@ -45,7 +45,8 @@ class modDynamicPrices extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable the usage of math expressions for prices";
- $this->version = 'experimental'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'experimental';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
@@ -83,6 +84,6 @@ class modDynamicPrices extends DolibarrModules
$this->rights = array();
$this->rights_class = 'dynamicprices';
$r=0;
-
+
}
}
diff --git a/htdocs/core/modules/modExport.class.php b/htdocs/core/modules/modExport.class.php
index cc0090c2fc8..70efc2c165f 100644
--- a/htdocs/core/modules/modExport.class.php
+++ b/htdocs/core/modules/modExport.class.php
@@ -48,8 +48,8 @@ class modExport extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Outils d'exports de donnees Dolibarr (via un assistant)";
- // Possible values for version are: 'experimental' or 'dolibarr' or version
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto = 'technic';
@@ -90,11 +90,11 @@ class modExport extends DolibarrModules
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'creer';
-
-
+
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
+
}
}
diff --git a/htdocs/core/modules/modExternalRss.class.php b/htdocs/core/modules/modExternalRss.class.php
index 7ae60e5e9eb..e3f4a538c4d 100644
--- a/htdocs/core/modules/modExternalRss.class.php
+++ b/htdocs/core/modules/modExternalRss.class.php
@@ -49,7 +49,8 @@ class modExternalRss extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Ajout de files d'informations RSS dans les ecrans Dolibarr";
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 1;
$this->picto='rss';
diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php
index 8752c553a77..54e1eadd735 100644
--- a/htdocs/core/modules/modFckeditor.class.php
+++ b/htdocs/core/modules/modFckeditor.class.php
@@ -49,7 +49,8 @@ class modFckeditor extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Editeur WYSIWYG";
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 2;
// Name of png file (without png) used for this module.
diff --git a/htdocs/core/modules/modImport.class.php b/htdocs/core/modules/modImport.class.php
index 2efebb58d80..18696ef4b11 100644
--- a/htdocs/core/modules/modImport.class.php
+++ b/htdocs/core/modules/modImport.class.php
@@ -48,8 +48,8 @@ class modImport extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Outils d'imports de donnees Dolibarr (via un assistant)";
- // Possible values for version are: 'experimental' or 'dolibarr' or version
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
+ $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto = 'technic';
@@ -85,11 +85,11 @@ class modImport extends DolibarrModules
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'run';
-
-
+
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
+
}
}
diff --git a/htdocs/core/modules/modLabel.class.php b/htdocs/core/modules/modLabel.class.php
index 05e98d36454..4f7cb8cacbb 100644
--- a/htdocs/core/modules/modLabel.class.php
+++ b/htdocs/core/modules/modLabel.class.php
@@ -48,7 +48,8 @@ class modLabel extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des etiquettes";
- $this->version = 'development'; // 'development' or 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'development';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 2;
$this->picto='label';
diff --git a/htdocs/core/modules/modLdap.class.php b/htdocs/core/modules/modLdap.class.php
index 31f51d5d956..27174a7dda0 100644
--- a/htdocs/core/modules/modLdap.class.php
+++ b/htdocs/core/modules/modLdap.class.php
@@ -46,7 +46,8 @@ class modLdap extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Synchronisation Ldap";
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
diff --git a/htdocs/core/modules/modMailing.class.php b/htdocs/core/modules/modMailing.class.php
index 45d2685abe4..64966e2105c 100644
--- a/htdocs/core/modules/modMailing.class.php
+++ b/htdocs/core/modules/modMailing.class.php
@@ -48,7 +48,8 @@ class modMailing extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des EMailings";
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='email';
@@ -130,7 +131,7 @@ class modMailing extends DolibarrModules
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
+
}
diff --git a/htdocs/core/modules/modMailmanSpip.class.php b/htdocs/core/modules/modMailmanSpip.class.php
index 3900c0549b9..209dcba3d2b 100644
--- a/htdocs/core/modules/modMailmanSpip.class.php
+++ b/htdocs/core/modules/modMailmanSpip.class.php
@@ -48,7 +48,8 @@ class modMailmanSpip extends DolibarrModules
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Mailman or Spip interface for member module";
- $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
+ $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 1;
@@ -76,10 +77,10 @@ class modMailmanSpip extends DolibarrModules
// Permissions
$this->rights = array();
$this->rights_class = 'clicktodial';
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
+
}
}
diff --git a/htdocs/core/modules/modModuleBuilder.class.php b/htdocs/core/modules/modModuleBuilder.class.php
index dabfda48518..944664f2339 100644
--- a/htdocs/core/modules/modModuleBuilder.class.php
+++ b/htdocs/core/modules/modModuleBuilder.class.php
@@ -47,7 +47,8 @@ class modModuleBuilder extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "A tool to help developers to build their own module.";
- $this->version = 'experimental'; // 'development', 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'experimental';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
diff --git a/htdocs/core/modules/modNotification.class.php b/htdocs/core/modules/modNotification.class.php
index 298d877d4aa..a4a56e1da0d 100644
--- a/htdocs/core/modules/modNotification.class.php
+++ b/htdocs/core/modules/modNotification.class.php
@@ -46,7 +46,8 @@ class modNotification extends DolibarrModules
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "EMail notifications (push) on business Dolibarr events";
$this->descriptionlong = 'Module600Long';
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 1;
$this->picto='email';
diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php
index 4be01e561fe..4d64c666c60 100644
--- a/htdocs/core/modules/modOauth.class.php
+++ b/htdocs/core/modules/modOauth.class.php
@@ -52,7 +52,8 @@ class modOauth extends DolibarrModules
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this->description = "Enable OAuth authentication";
- $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
+ $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php
index 2fc7d10fe5a..50c93f07220 100644
--- a/htdocs/core/modules/modReceiptPrinter.class.php
+++ b/htdocs/core/modules/modReceiptPrinter.class.php
@@ -52,7 +52,8 @@ class modReceiptPrinter extends DolibarrModules
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this->description = "ReceiptPrinterDesc";
- $this->version = 'development'; // 'development' or 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
+ $this->version = 'development';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
diff --git a/htdocs/core/modules/modSkype.class.php b/htdocs/core/modules/modSkype.class.php
index ca9179d5fa3..4c7d862cf66 100644
--- a/htdocs/core/modules/modSkype.class.php
+++ b/htdocs/core/modules/modSkype.class.php
@@ -48,7 +48,8 @@ class modSkype extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable Skype links into contacts";
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php
index fc8ad99abf8..6ef7648531a 100644
--- a/htdocs/core/modules/modSyslog.class.php
+++ b/htdocs/core/modules/modSyslog.class.php
@@ -52,7 +52,7 @@ class modSyslog extends DolibarrModules
// Can be enabled / disabled only in the main company
$this->core_enabled = true;
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
diff --git a/htdocs/core/modules/modWebServices.class.php b/htdocs/core/modules/modWebServices.class.php
index 59e934500b6..f4383bc6dc5 100644
--- a/htdocs/core/modules/modWebServices.class.php
+++ b/htdocs/core/modules/modWebServices.class.php
@@ -44,7 +44,8 @@ class modWebServices extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable the Dolibarr web services server";
- $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
diff --git a/htdocs/core/modules/modWebServicesClient.class.php b/htdocs/core/modules/modWebServicesClient.class.php
index c5365ba4459..2dd0ee871c5 100644
--- a/htdocs/core/modules/modWebServicesClient.class.php
+++ b/htdocs/core/modules/modWebServicesClient.class.php
@@ -44,7 +44,8 @@ class modWebServicesClient extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable the web service client to call external supplier web services";
- $this->version = 'experimental'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'experimental';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
diff --git a/htdocs/core/modules/modWebsites.class.php b/htdocs/core/modules/modWebsites.class.php
index 2c8e2e608a5..d6d984193d9 100644
--- a/htdocs/core/modules/modWebsites.class.php
+++ b/htdocs/core/modules/modWebsites.class.php
@@ -50,7 +50,8 @@ class modWebsites extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable to build and serve public websites with CMS features";
- $this->version = 'development'; // 'experimental' or 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ $this->version = 'experimental';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index edcf0504a99..29f1dd9df96 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -26,7 +26,7 @@
* $langs
* $dateSelector
* $forceall (0 by default, 1 for supplier invoices/orders)
- * $senderissupplier (0 by default, 1 for supplier invoices/orders)
+ * $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders)
* $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
*/
@@ -208,12 +208,13 @@ else {
}
else
{
+ // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum
if ($senderissupplier != 2)
{
$ajaxoptions=array(
'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key
- 'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done
- 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error'
+ 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done
+ 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for exemple shown we select a disabled option into combo)
);
$alsoproductwithnosupplierprice=0;
}
@@ -222,6 +223,7 @@ else {
$ajaxoptions = array();
$alsoproductwithnosupplierprice=1;
}
+
$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice);
}
echo '';
diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php
index 2ca1cba1083..69e48248d57 100644
--- a/htdocs/don/admin/donation.php
+++ b/htdocs/don/admin/donation.php
@@ -42,6 +42,8 @@ $typeconst=array('yesno','texte','chaine');
$action = GETPOST('action','alpha');
$value = GETPOST('value');
+$label = GETPOST('label','alpha');
+$scandir = GETPOST('scan_dir','alpha');
$type='donation';
@@ -287,14 +289,14 @@ if (is_resource($handle))
else
{
print "
';
}
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index f40273f7b3f..0c2c7044e5d 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -1157,7 +1157,7 @@ class CommandeFournisseur extends CommonOrder
// insert products details into database
for ($i=0;$i<$num;$i++)
{
- $result = $this->addline( // This include test on qty if option SUPPLIERORDER_WITH_NOPRICEDEFINED is not set
+ $result = $this->addline( // This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
$this->lines[$i]->desc,
$this->lines[$i]->subprice,
$this->lines[$i]->qty,
@@ -1393,7 +1393,7 @@ class CommandeFournisseur extends CommonOrder
if ($fk_product > 0)
{
- if (empty($conf->global->SUPPLIERORDER_WITH_NOPRICEDEFINED))
+ if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
{
// Check quantity is enough
dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." fourn_ref=".$fourn_ref);
@@ -2842,8 +2842,9 @@ class CommandeFournisseur extends CommonOrder
$supplierorderdispatch = new CommandeFournisseurDispatch($this->db);
$filter=array('t.fk_commande'=>$this->id);
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) {
- $filter['t.status']=1;
+ $filter['t.status']=1; // Restrict to lines with status validated
}
+
$ret=$supplierorderdispatch->fetchAll('','',0,0,$filter);
if ($ret<0)
{
@@ -2854,20 +2855,27 @@ class CommandeFournisseur extends CommonOrder
{
if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines)>0)
{
- //Build array with quantity deliverd by product
+ $date_liv = dol_now();
+
+ // Build array with quantity deliverd by product
foreach($supplierorderdispatch->lines as $line) {
$qtydelivered[$line->fk_product]+=$line->qty;
}
foreach($this->lines as $line) {
$qtywished[$line->fk_product]+=$line->qty;
}
-
- $date_liv = dol_now();
-
//Compare array
- $diff_array=array_diff_assoc($qtydelivered,$qtywished);
+ $diff_array=array_diff_assoc($qtydelivered,$qtywished); // Warning: $diff_array is done only on common keys.
+ $keysinwishednotindelivered=array_diff(array_keys($qtywished),array_keys($qtydelivered)); // To check we also have same number of keys
+ $keysindeliverednotinwished=array_diff(array_keys($qtydelivered),array_keys($qtywished)); // To check we also have same number of keys
+ /*var_dump(array_keys($qtydelivered));
+ var_dump(array_keys($qtywished));
+ var_dump($diff_array);
+ var_dump($keysinwishednotindelivered);
+ var_dump($keysindeliverednotinwished);
+ exit;*/
- if (count($diff_array)==0) //No diff => mean everythings is received
+ if (count($diff_array)==0 && count($keysinwishednotindelivered)==0 && count($keysindeliverednotinwished)==0) //No diff => mean everythings is received
{
if ($closeopenorder)
{
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 4e3362d36ac..56566438206 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -365,21 +365,29 @@ if (empty($reshook))
{
$productsupplier = new ProductFournisseur($db);
- if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
+ if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) // TODO this test seems useless
{
$idprod=0;
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
}
-
- if (GETPOST('idprodfournprice') > 0)
+ if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg))
+ {
+ $idprod=$reg[1];
+ $res=$productsupplier->fetch($idprod);
+ // Call to init properties of $productsupplier
+ // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price
+ $productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist
+ }
+ elseif (GETPOST('idprodfournprice') > 0)
{
- $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat.
+ $qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat.
+ //$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist
+ $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch);
+ $res=$productsupplier->fetch($idprod);
}
if ($idprod > 0)
{
- $res=$productsupplier->fetch($idprod);
-
$label = $productsupplier->label;
$desc = $productsupplier->description;
@@ -400,8 +408,8 @@ if (empty($reshook))
$tva_tx,
$localtax1_tx,
$localtax2_tx,
+ $idprod,
$productsupplier->id,
- GETPOST('idprodfournprice'),
$productsupplier->fourn_ref,
$remise_percent,
'HT',
@@ -2105,6 +2113,7 @@ elseif (! empty($object->id))
// Add free products/services form
global $forceall, $senderissupplier, $dateSelector;
$forceall=1; $senderissupplier=1; $dateSelector=0;
+ if (! empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum.
// Show object lines
$inputalsopricewithtax=0;
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index c0465a61658..f4f05f96b78 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -28,6 +28,7 @@
* \ingroup commande
* \brief Page to dispatch receiving
*/
+
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_order/modules_commandefournisseur.php';
require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
@@ -84,17 +85,33 @@ if ($id > 0 || ! empty($ref)) {
* Actions
*/
-if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) {
+if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))))
+{
+ $error=0;
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
+
+ $db->begin();
+
$result = $supplierorderdispatch->fetch($lineid);
if (! $result)
- dol_print_error($db);
- $result = $supplierorderdispatch->setStatut(1);
- if ($result < 0) {
+ {
+ $error++;
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
- $error ++;
$action = '';
- } else {
+ }
+
+ if (! $error)
+ {
+ $result = $supplierorderdispatch->setStatut(1);
+ if ($result < 0) {
+ setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
+ $error++;
+ $action = '';
+ }
+ }
+
+ if (! $error)
+ {
$result = $object->calcAndSetStatusDispatch($user);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
@@ -102,19 +119,42 @@ if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED
$action = '';
}
}
+ if (! $error)
+ {
+ $db->commit();
+ }
+ else
+ {
+ $db->rollback();
+ }
}
-if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) {
+if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))))
+{
+ $error=0;
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
+
+ $db->begin();
+
$result = $supplierorderdispatch->fetch($lineid);
if (! $result)
- dol_print_error($db);
- $result = $supplierorderdispatch->setStatut(0);
- if ($result < 0) {
+ {
+ $error++;
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
- $error ++;
$action = '';
- } else {
+ }
+
+ if (! $error)
+ {
+ $result = $supplierorderdispatch->setStatut(0);
+ if ($result < 0) {
+ setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
+ $error ++;
+ $action = '';
+ }
+ }
+ if (! $error)
+ {
$result = $object->calcAndSetStatusDispatch($user);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
@@ -122,19 +162,42 @@ if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANC
$action = '';
}
}
+ if (! $error)
+ {
+ $db->commit();
+ }
+ else
+ {
+ $db->rollback();
+ }
}
-if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) {
+if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))))
+{
+ $error=0;
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
+
+ $db->begin();
+
$result = $supplierorderdispatch->fetch($lineid);
if (! $result)
- dol_print_error($db);
- $result = $supplierorderdispatch->setStatut(2);
- if ($result < 0) {
+ {
+ $error++;
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
- $error ++;
$action = '';
- } else {
+ }
+
+ if (! $error)
+ {
+ $result = $supplierorderdispatch->setStatut(2);
+ if ($result < 0) {
+ setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
+ $error ++;
+ $action = '';
+ }
+ }
+ if (! $error)
+ {
$result = $object->calcAndSetStatusDispatch($user);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
@@ -142,6 +205,14 @@ if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_
$action = '';
}
}
+ if (! $error)
+ {
+ $db->commit();
+ }
+ else
+ {
+ $db->rollback();
+ }
}
if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) {
@@ -743,7 +814,8 @@ if ($id > 0 || ! empty($ref)) {
// Add button to check/uncheck disaptching
print '
';
- if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))) {
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))
+ {
if (empty($objp->status)) {
print '' . $langs->trans("Approve") . '';
print '' . $langs->trans("Deny") . '';
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index cdc6419d4a9..a3d396e75a1 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -976,21 +976,30 @@ if (empty($reshook))
if ($prod_entry_mode != 'free' && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or ''
{
- $idprod=0;
$productsupplier=new ProductFournisseur($db);
- if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-2; // Same behaviour than with combolist. When not select idprodfournprice is now -2 (to avoid conflict with next action that may return -1)
+ $idprod=0;
+ if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
- if (GETPOST('idprodfournprice') > 0)
+ if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg))
+ {
+ $idprod=$reg[1];
+ $res=$productsupplier->fetch($idprod);
+ // Call to init properties of $productsupplier
+ // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price
+ $productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist
+ }
+ elseif (GETPOST('idprodfournprice') > 0)
{
- $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat.
+ $qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat.
+ //$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist
+ $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch);
+ $res=$productsupplier->fetch($idprod);
}
//Replaces $fk_unit with the product's
if ($idprod > 0)
{
- $result=$productsupplier->fetch($idprod);
-
$label = $productsupplier->label;
$desc = $productsupplier->description;
@@ -1005,10 +1014,29 @@ if (empty($reshook))
$type = $productsupplier->type;
$price_base_type = 'HT';
- // TODO Save the product supplier ref into database into field ref_supplier (must rename field ref into ref_supplier first)
- $result=$object->addline($desc, $productsupplier->fourn_pu, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, $idprod, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $productsupplier->fk_unit);
+ // TODO Save the product supplier ref into database (like done for supplier propal and order) into field ref_supplier (must rename field ref into ref_supplier first)
+ $result=$object->addline(
+ $desc,
+ $productsupplier->fourn_pu,
+ $tva_tx,
+ $localtax1_tx,
+ $localtax2_tx,
+ $qty,
+ $idprod,
+ $remise_percent,
+ $date_start,
+ $date_end,
+ 0,
+ $tva_npr,
+ $price_base_type,
+ $type,
+ -1,
+ 0,
+ $array_options,
+ $productsupplier->fk_unit
+ );
}
- if ($idprod == -2 || $idprod == 0)
+ if ($idprod == -99 || $idprod == 0)
{
// Product not selected
$error++;
diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql
index d9b1390bb32..db1ba19aa6e 100644
--- a/htdocs/install/mysql/data/llx_c_currencies.sql
+++ b/htdocs/install/mysql/data/llx_c_currencies.sql
@@ -154,7 +154,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VEF'
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VND', '[8363]', 1, 'Viet Nam Dong');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XAF', NULL, 1, 'Communaute Financiere Africaine (BEAC) CFA Franc');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XOF', NULL, 1, 'Communaute Financiere Africaine (BCEAO) Franc');
-INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XPF', NULL, 1, 'Franc pacifique (XPF)');
+INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XPF', '[70]', 1, 'Franc CFP');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'YER', '[65020]', 1, 'Yemen Rial');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ZWD', '[90,36]', 1, 'Zimbabwe Dollar');
diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
index b027f560aa0..5759423abbb 100644
--- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
+++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
@@ -190,3 +190,9 @@ ALTER TABLE llx_extrafields ADD COLUMN fk_user_author integer;
ALTER TABLE llx_extrafields ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_extrafields ADD COLUMN datec datetime;
ALTER TABLE llx_extrafields ADD COLUMN tms timestamp;
+
+ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128);
+ALTER TABLE llx_holiday_config ADD UNIQUE INDEX idx_holiday_config (name);
+
+
+
diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql
index e275d982da4..cd55b7b38e2 100755
--- a/htdocs/install/mysql/migration/repair.sql
+++ b/htdocs/install/mysql/migration/repair.sql
@@ -152,7 +152,8 @@ delete from llx_categorie where fk_parent not in (select rowid from tmp_categori
drop table tmp_categorie;
-- Fix: delete orphelin category.
delete from llx_categorie_product where fk_categorie not in (select rowid from llx_categorie where type = 0);
-delete from llx_categorie_societe where fk_categorie not in (select rowid from llx_categorie where type in (1, 2));
+delete from llx_categorie_fournisseur where fk_categorie not in (select rowid from llx_categorie where type = 1);
+delete from llx_categorie_societe where fk_categorie not in (select rowid from llx_categorie where type = 2);
delete from llx_categorie_member where fk_categorie not in (select rowid from llx_categorie where type = 3);
delete from llx_categorie_contact where fk_categorie not in (select rowid from llx_categorie where type = 4);
delete from llx_categorie_project where fk_categorie not in (select rowid from llx_categorie where type = 5);
diff --git a/htdocs/install/mysql/tables/llx_holiday_config.key.sql b/htdocs/install/mysql/tables/llx_holiday_config.key.sql
new file mode 100644
index 00000000000..cda95c87f39
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_holiday_config.key.sql
@@ -0,0 +1,20 @@
+-- ===================================================================
+-- Copyright (C) 2012 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ===================================================================
+
+ALTER TABLE llx_holiday_config ADD UNIQUE INDEX idx_holiday_config (name);
+
diff --git a/htdocs/install/mysql/tables/llx_holiday_config.sql b/htdocs/install/mysql/tables/llx_holiday_config.sql
index 2f08bf5aa41..4ef6f15c7df 100644
--- a/htdocs/install/mysql/tables/llx_holiday_config.sql
+++ b/htdocs/install/mysql/tables/llx_holiday_config.sql
@@ -19,7 +19,7 @@
CREATE TABLE llx_holiday_config
(
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
-name VARCHAR( 255 ) NOT NULL UNIQUE,
+name VARCHAR(128) NOT NULL,
value TEXT NULL
)
ENGINE=innodb;
\ No newline at end of file
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index fd7301fa54b..0cfe86580fa 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -403,11 +403,11 @@ ExtrafieldCheckBoxFromList=Checkboxes from table
ExtrafieldLink=Link to an object
ComputedFormula=Computed field
ComputedFormulaDesc=You can enter here a formula using other properties of object or any PHP coding to get a dynamic computed value. You can use any PHP compatible formulas including the "?" condition operator, and following global object: $db, $conf, $langs, $mysoc, $user, $object. WARNING: Only some properties of $object may be available. If you need a properties not loaded, just fetch yourself the object into your formula like in the second example. Using a computed field means you can't enter yourself any value from interface. Also, if there is a syntax error, the formula may return nothing.
Example to reload object (($reloadedobj = new Societe($db)) && ($reloadedobj->fetch($obj->id ? $obj->id : ($obj->rowid ? $obj->rowid : $object->id)) > 0)) ? $reloadedobj->array_options['options_extrafieldkey'] * $reloadedobj->capital / 5 : '-1'
Other example of formula to force load of object and its parent object: (($reloadedobj = new Task($db)) && ($reloadedobj->fetch($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetch($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : 'Parent project not found'
-ExtrafieldParamHelpselect=Parameters list have to be like key,value
for example : 1,value1 2,value2 3,value3 ...
In order to have the list depending on another complementary attribute list : 1,value1|options_parent_list_code:parent_key 2,value2|options_parent_list_code:parent_key
In order to have the list depending on another list : 1,value1|parent_list_code:parent_key 2,value2|parent_list_code:parent_key
-ExtrafieldParamHelpcheckbox=Parameters list have to be like key,value
for example : 1,value1 2,value2 3,value3 ...
-ExtrafieldParamHelpradio=Parameters list have to be like key,value
for example : 1,value1 2,value2 3,value3 ...
-ExtrafieldParamHelpsellist=Parameters list comes from a table Syntax : table_name:label_field:id_field::filter Example : c_typent:libelle:id::filter
filter can be a simple test (eg active=1) to display only active value You can also use $ID$ in filter witch is the current id of current object To do a SELECT in filter use $SEL$ if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)
In order to have the list depending on another complementary attribute list: c_typent:libelle:id:options_parent_list_code|parent_column:filter
In order to have the list depending on another list: c_typent:libelle:id:parent_list_code|parent_column:filter
-ExtrafieldParamHelpchkbxlst=Parameters list comes from a table Syntax : table_name:label_field:id_field::filter Example : c_typent:libelle:id::filter
filter can be a simple test (eg active=1) to display only active value You can also use $ID$ in filter witch is the current id of current object To do a SELECT in filter use $SEL$ if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)
In order to have the list depending on another complementary attribute list : c_typent:libelle:id:options_parent_list_code|parent_column:filter
In order to have the list depending on another list: c_typent:libelle:id:parent_list_code|parent_column:filter
+ExtrafieldParamHelpselect=List of values must be lines with format key,value (where key can't be '0')
for example : 1,value1 2,value2 code3,value3 ...
In order to have the list depending on another complementary attribute list : 1,value1|options_parent_list_code:parent_key 2,value2|options_parent_list_code:parent_key
In order to have the list depending on another list : 1,value1|parent_list_code:parent_key 2,value2|parent_list_code:parent_key
+ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')
for example : 1,value1 2,value2 3,value3 ...
+ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')
for example : 1,value1 2,value2 3,value3 ...
+ExtrafieldParamHelpsellist=List of values comes from a table Syntax : table_name:label_field:id_field::filter Example : c_typent:libelle:id::filter
filter can be a simple test (eg active=1) to display only active value You can also use $ID$ in filter witch is the current id of current object To do a SELECT in filter use $SEL$ if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)
In order to have the list depending on another complementary attribute list: c_typent:libelle:id:options_parent_list_code|parent_column:filter
In order to have the list depending on another list: c_typent:libelle:id:parent_list_code|parent_column:filter
+ExtrafieldParamHelpchkbxlst=List of values comes from a table Syntax : table_name:label_field:id_field::filter Example : c_typent:libelle:id::filter
filter can be a simple test (eg active=1) to display only active value You can also use $ID$ in filter witch is the current id of current object To do a SELECT in filter use $SEL$ if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)
In order to have the list depending on another complementary attribute list : c_typent:libelle:id:options_parent_list_code|parent_column:filter
In order to have the list depending on another list: c_typent:libelle:id:parent_list_code|parent_column:filter
ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath Syntax : ObjectName:Classpath Example : Societe:societe/class/societe.class.php
LibraryToBuildPDF=Library used for PDF generation
WarningUsingFPDF=Warning: Your conf.php contains directive dolibarr_pdf_force_fpdf=1. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation. To solve this and have a full support of PDF generation, please download TCPDF library, then comment or remove the line $dolibarr_pdf_force_fpdf=1, and add instead $dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'
diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang
index 1e4f1446fa7..a78b7bbc6c8 100644
--- a/htdocs/langs/en_US/mails.lang
+++ b/htdocs/langs/en_US/mails.lang
@@ -156,4 +156,7 @@ NoContactWithCategoryFound=No contact/address with a category found
NoContactLinkedToThirdpartieWithCategoryFound=No contact/address with a category found
OutGoingEmailSetup=Outgoing email setup
InGoingEmailSetup=Incoming email setup
+OutGoingEmailSetupForEmailing=Outgoing email setup (for mass emailing)
+DefaultOutgoingEmailSetup=Default outgoing email setup
+
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index f2f0aba9579..ce7512f52c2 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1075,10 +1075,10 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print ''."\n"; // Do not index
print ''; // Scale for mobile device
print ''."\n";
- // Favicon. Note, even if we remove this meta, the browser and android webview try to find a favicon.ico
+ // Favicon
$favicon=dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico',1);
if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL;
- print ''."\n";
+ if (empty($conf->dol_use_jmobile)) print ''."\n"; // Not required into an Android webview
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser','int')) print ''."\n";
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser','int')) print ''."\n";
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser','int')) print ''."\n";
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index 81e0612cea5..d599c563912 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -228,7 +228,7 @@ foreach ($search_array_options as $key => $val)
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if ($crit != '' && (! in_array($typ, array('select')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php
index 172bdd9354c..78829e489a6 100644
--- a/htdocs/product/admin/product.php
+++ b/htdocs/product/admin/product.php
@@ -46,7 +46,7 @@ if (! $user->admin || (empty($conf->product->enabled) && empty($conf->service->e
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
-$scandir = GETPOST('scandir','alpha');
+$scandir = GETPOST('scan_dir','alpha');
$type='product';
// Pricing Rules
@@ -460,7 +460,7 @@ foreach ($dirmodels as $reldir)
else
{
print '
";
}
}
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 7f12893984e..53c5a1add14 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -168,12 +168,17 @@ if (empty($reshook))
}
// Merge extrafields
- foreach ($soc_origin->array_options as $key => $val)
+ if (is_array($soc_origin->array_options))
{
- if (empty($object->array_options[$key])) $object->array_options[$key] = $val;
+ foreach ($soc_origin->array_options as $key => $val)
+ {
+ if (empty($object->array_options[$key])) $object->array_options[$key] = $val;
+ }
}
// TODO Merge categories
+
+
$object->update($object->id, $user);
// Move links
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 94fc46f5734..f77630b371a 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -73,7 +73,8 @@ $search_idprof4=trim(GETPOST('search_idprof4'));
$search_idprof5=trim(GETPOST('search_idprof5'));
$search_idprof6=trim(GETPOST('search_idprof6'));
$search_sale=trim(GETPOST("search_sale",'int'));
-$search_categ=trim(GETPOST("search_categ",'int'));
+$search_categ_cus=trim(GETPOST("search_categ_cus",'int'));
+$search_categ_sup=trim(GETPOST("search_categ_sup",'int'));
$search_country=GETPOST("search_country",'intcomma');
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$search_status=GETPOST("search_status",'int');
@@ -220,7 +221,8 @@ if (empty($reshook))
$search_id='';
$search_nom='';
$search_alias='';
- $search_categ=0;
+ $search_categ_cus=0;
+ $search_categ_sup=0;
$search_sale='';
$search_barcode="";
$search_customer_code='';
@@ -389,7 +391,8 @@ $sql.= " state.code_departement as state_code, state.nom as state_name";
// We'll need these fields in order to filter by sale (including the case where the user can only see his prospects)
if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user";
// We'll need these fields in order to filter by categ
-if ($search_categ) $sql .= ", cs.fk_categorie, cs.fk_soc";
+if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
+if ($search_categ_sup) $sql .= ", cs.fk_categorie, cs.fk_soc";
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
// Add fields from hooks
@@ -402,7 +405,8 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
// We'll need this table joined to the select in order to filter by categ
-if (! empty($search_categ)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_".($type=='f'?"fournisseur":"societe")." as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ
+if (! empty($search_categ_cus)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
+if (! empty($search_categ_sup)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ
$sql.= " ,".MAIN_DB_PREFIX."c_stcomm as st";
// We'll need this table joined to the select in order to filter by sale
if ($search_sale || (!$user->rights->societe->client->voir && !$socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -413,8 +417,10 @@ if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
if (! $user->rights->fournisseur->lire) $sql.=" AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible
if ($search_sale) $sql.= " AND sc.fk_user = ".$db->escape($search_sale);
-if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$db->escape($search_categ);
-if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
+if ($search_categ_cus > 0) $sql.= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
+if ($search_categ_sup > 0) $sql.= " AND cs.fk_categorie = ".$db->escape($search_categ_sup);
+if ($search_categ_cus == -2) $sql.= " AND cc.fk_categorie IS NULL";
+if ($search_categ_sup == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all);
if (strlen($search_cti)) $sql.= natural_search('s.phone', $search_cti);
@@ -457,8 +463,8 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if ($crit != '' && (! in_array($typ, array('select')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
@@ -507,7 +513,8 @@ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&con
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_all != '') $param = "&sall=".urlencode($search_all);
if ($sall != '') $param .= "&sall=".urlencode($sall);
-if ($search_categ > 0) $param.='&search_categ='.urlencode($search_categ);
+if ($search_categ_cus > 0) $param.='&search_categ_cus='.urlencode($search_categ_cus);
+if ($search_categ_sup > 0) $param.='&search_categ_sup='.urlencode($search_categ_sup);
if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale);
if ($search_id > 0) $param.= "&search_id=".urlencode($search_id);
if ($search_nom != '') $param.= "&search_nom=".urlencode($search_nom);
@@ -594,25 +601,25 @@ if ($search_all)
// Filter on categories
$moreforfilter='';
-if ($type == 'c' || $type == 'p')
+if (empty($type) || $type == 'c' || $type == 'p')
{
if (! empty($conf->categorie->enabled))
{
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.='