';
- if (empty($object->bgcolor) || strtolower($object->bgcolor) == 'ffffff')
+ print '
';
+ if (empty($object->bgcolor) || strtolower($object->bgcolor) == 'ffffff') // CKEditor does not apply the color of the div into its content area
{
$readonly=1;
// Editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- $doleditor=new DolEditor('bodyemail',$object->body,'',600,'dolibarr_mailings','',false,true,empty($conf->global->FCKEDITOR_ENABLE_MAILING)?0:1,20,120,$readonly);
+ $doleditor=new DolEditor('bodyemail',$object->body,'',600,'dolibarr_mailings','',false,true,empty($conf->global->FCKEDITOR_ENABLE_MAILING)?0:1,20,'90%',$readonly);
$doleditor->Create();
}
else print dol_htmlentitiesbr($object->body);
@@ -1245,7 +1252,7 @@ else
// Background color
print '
'.$langs->trans("BackgroundColorByDefault").' ';
- print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0);
+ print $htmlother->selectColor($object->bgcolor,'bgcolor','',0);
print ' ';
print '';
diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php
index ea2569b863e..8e8941c23fb 100644
--- a/htdocs/comm/mailing/class/advtargetemailing.class.php
+++ b/htdocs/comm/mailing/class/advtargetemailing.class.php
@@ -658,7 +658,7 @@ class AdvanceTargetingMailing extends CommonObject
$sqlwhere[]= " (t.datec >= '".$this->db->idate($arrayquery['contact_create_st_dt'])."' AND t.datec <= '".$this->db->idate($arrayquery['contact_create_end_dt'])."')";
}
if (!empty($arrayquery['contact_categ']) && count($arrayquery['contact_categ'])>0) {
- $sqlwhere[]= " (contactcateg.fk_categorie IN (".$db->escape(implode(",",$arrayquery['contact_categ']))."))";
+ $sqlwhere[]= " (contactcateg.fk_categorie IN (".$this->db->escape(implode(",",$arrayquery['contact_categ']))."))";
}
//Standard Extrafield feature
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 49bab4faa71..7987555e569 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -602,7 +602,7 @@ if (empty($reshook))
}
// Close proposal
- else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel'))
+ else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel','alpha'))
{
if (! GETPOST('statut')) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors');
@@ -622,7 +622,7 @@ if (empty($reshook))
}
// Reopen proposal
- else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel'))
+ else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel','alpha'))
{
// prevent browser refresh from reopening proposal several times
if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED)
@@ -1106,7 +1106,7 @@ if (empty($reshook))
}
}
- else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel'))
+ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel','alpha'))
{
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 4939d7e83f7..909b0f3ebc8 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -169,8 +169,8 @@ $object = new Propal($db); // To be passed as parameter of executeHooks that nee
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
@@ -420,7 +420,7 @@ if ($resql)
{
$langs->load("mails");
- if (! GETPOST('cancel'))
+ if (! GETPOST('cancel','alpha'))
{
$objecttmp=new Propal($db);
$listofselectedid=array();
diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php
index bca371977a7..1ad4612d879 100644
--- a/htdocs/comm/remise.php
+++ b/htdocs/comm/remise.php
@@ -46,7 +46,7 @@ $backtopage = GETPOST('backtopage','alpha');
* Actions
*/
-if (GETPOST('cancel') && ! empty($backtopage))
+if (GETPOST('cancel','alpha') && ! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php
index 9964db9ecde..04eb2583fb5 100644
--- a/htdocs/comm/remx.php
+++ b/htdocs/comm/remx.php
@@ -49,7 +49,7 @@ if ($user->societe_id > 0)
* Actions
*/
-if (GETPOST('cancel') && ! empty($backtopage))
+if (GETPOST('cancel','alpha') && ! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 13139da7ea3..040b1e200d8 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1061,7 +1061,7 @@ if (empty($reshook))
}
}
- else if ($action == 'updateline' && $user->rights->commande->creer && GETPOST('cancel') == $langs->trans('Cancel')) {
+ else if ($action == 'updateline' && $user->rights->commande->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
}
@@ -1477,7 +1477,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '';
} else {
print '
';
- print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
+ print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 3)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
// reload page to retrieve customer informations
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
{
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 8810a1be986..13841b108d9 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -149,8 +149,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; }
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
@@ -666,7 +666,7 @@ if ($resql)
{
$langs->load("mails");
- if (! GETPOST('cancel'))
+ if (! GETPOST('cancel','alpha'))
{
$objecttmp=new Commande($db);
$listofselectedid=array();
diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php
index 67c16322a9d..cd4d659d743 100644
--- a/htdocs/compta/bank/bankentries.php
+++ b/htdocs/compta/bank/bankentries.php
@@ -161,8 +161,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php
index 177e576b5d7..80bf9d6f50c 100644
--- a/htdocs/compta/bank/index.php
+++ b/htdocs/compta/bank/index.php
@@ -111,8 +111,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php
index 525b7a72e12..c88220192ab 100644
--- a/htdocs/compta/bank/ligne.php
+++ b/htdocs/compta/bank/ligne.php
@@ -48,8 +48,8 @@ $action=GETPOST('action','alpha');
$confirm=GETPOST('confirm','alpha');
$rowid=GETPOST("rowid",'int');
$orig_account=GETPOST("orig_account");
-$backtopage=GETPOST('backtopage');
-$cancel=GETPOST('cancel');
+$backtopage=GETPOST('backtopage','alpha');
+$cancel=GETPOST('cancel','alpha');
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref :''));
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index d3e21f183a3..1e387bcd3fa 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -1762,7 +1762,7 @@ if (empty($reshook))
}
}
- elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel'))
+ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel','alpha'))
{
if (! $object->fetch($id) > 0) dol_print_error($db);
$object->fetch_thirdparty();
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index 80ffffdfb39..98fc2cd2f62 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -139,8 +139,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
@@ -148,7 +148,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook))
{
- if (GETPOST('cancel')) $action='';
+ if (GETPOST('cancel','alpha')) $action='';
// Selection of new fields
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
@@ -728,7 +728,7 @@ if (empty($reshook))
}
}
- elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel'))
+ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel','alpha'))
{
if (! $object->fetch($id) > 0) dol_print_error($db);
$object->fetch_thirdparty();
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 3ffd0af9cd3..15a79d7fdd9 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -181,8 +181,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
@@ -612,7 +612,7 @@ if ($resql)
{
$langs->load("mails");
- if (! GETPOST('cancel'))
+ if (! GETPOST('cancel','alpha'))
{
$objecttmp=new Facture($db);
$listofselectedid=array();
diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php
index cc7f36261cc..04c62107e83 100644
--- a/htdocs/contact/agenda.php
+++ b/htdocs/contact/agenda.php
@@ -115,7 +115,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook))
{
// Cancel
- if (GETPOST("cancel") && ! empty($backtopage))
+ if (GETPOST('cancel','alpha') && ! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index d5854297f43..7dffd99f8bf 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -91,7 +91,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook))
{
// Cancel
- if (GETPOST("cancel") && ! empty($backtopage))
+ if (GETPOST('cancel','alpha') && ! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 6d89cd07cd4..ebf7bc611f9 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -176,8 +176,8 @@ if (($id > 0 || ! empty($ref)) && $action != 'add')
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 26f9d0f6eae..5b109c7b0d7 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -636,7 +636,7 @@ if (empty($reshook))
}
}
- else if ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel'))
+ else if ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel','alpha'))
{
$objectline = new ContratLigne($db);
if ($objectline->fetch(GETPOST('elrowid')))
@@ -822,7 +822,7 @@ if (empty($reshook))
}
elseif ($action=='setref_supplier')
{
- $cancelbutton = GETPOST('cancel');
+ $cancelbutton = GETPOST('cancel','alpha');
if (!$cancelbutton) {
$result = $object->fetch($id);
@@ -846,7 +846,7 @@ if (empty($reshook))
}
elseif ($action=='setref_customer')
{
- $cancelbutton = GETPOST('cancel');
+ $cancelbutton = GETPOST('cancel','alpha');
if (!$cancelbutton)
{
@@ -871,7 +871,7 @@ if (empty($reshook))
}
elseif ($action=='setref')
{
- $cancelbutton = GETPOST('cancel');
+ $cancelbutton = GETPOST('cancel','alpha');
if (!$cancelbutton) {
$result = $object->fetch($id);
@@ -895,7 +895,7 @@ if (empty($reshook))
}
elseif ($action=='setdate_contrat')
{
- $cancelbutton = GETPOST('cancel');
+ $cancelbutton = GETPOST('cancel','alpha');
if (!$cancelbutton) {
$result = $object->fetch($id);
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index 17246751600..beba40103af 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -136,8 +136,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
* Action
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php
index aaf0d0cd796..cd445e682eb 100644
--- a/htdocs/contrat/services.php
+++ b/htdocs/contrat/services.php
@@ -140,8 +140,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; }
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php
index 3fa76891124..39f63683575 100644
--- a/htdocs/core/actions_setnotes.inc.php
+++ b/htdocs/core/actions_setnotes.inc.php
@@ -28,7 +28,7 @@
// $id must be defined (object is loaded in this file with fetch)
// Set public note
-if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel'))
+if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel','alpha'))
{
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('','Include of actions_setnotes.inc.php was done but required variable was not set before');
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
@@ -36,7 +36,7 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
}
// Set public note
-else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel'))
+else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel','alpha'))
{
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('','Include of actions_setnotes.inc.php was done but required variable was not set before');
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php
index 918956d7b32..723ae0d47b1 100644
--- a/htdocs/core/class/doleditor.class.php
+++ b/htdocs/core/class/doleditor.class.php
@@ -170,7 +170,8 @@ class DolEditor
if (in_array($this->tool,array('textarea','ckeditor')))
{
$found=1;
- //$out.= ' ';
- print '
'.$objp->batch.' ';
+
+ // Lot
+ print '
';
+ if ($product_lot_static->batch)
+ {
+ print $product_lot_static->getNomUrl(1);
+ }
+ print ' ';
+
print '
'.dol_print_date($db->jdate($objp->eatby), 'day').' ';
print '
'.dol_print_date($db->jdate($objp->sellby), 'day').' ';
print '
';
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index 0f843e97b61..c95e805c3f5 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -39,7 +39,7 @@ $langs->load("companies");
$langs->load("categories");
$action=GETPOST('action','aZ09');
-$cancel=GETPOST('cancel');
+$cancel=GETPOST('cancel','alpha');
$confirm=GETPOST('confirm');
$sortfield = GETPOST("sortfield",'alpha');
@@ -48,7 +48,7 @@ $id = GETPOST("id",'int');
if (! $sortfield) $sortfield="p.ref";
if (! $sortorder) $sortorder="DESC";
-$backtopage=GETPOST("backtopage");
+$backtopage=GETPOST('backtopage','alpha');
// Security check
$result=restrictedArea($user,'stock');
diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php
index 8659dfe8461..4b878c03260 100644
--- a/htdocs/product/stock/mouvement.php
+++ b/htdocs/product/stock/mouvement.php
@@ -51,7 +51,7 @@ $id=GETPOST('id','int');
$msid=GETPOST('msid','int');
$product_id=GETPOST("product_id");
$action=GETPOST('action','aZ09');
-$cancel=GETPOST('cancel');
+$cancel=GETPOST('cancel','alpha');
$idproduct = GETPOST('idproduct','int');
$year = GETPOST("year");
$month = GETPOST("month");
@@ -112,8 +112,8 @@ $object = new MouvementStock($db); // To be passed as parameter of executeHooks
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 87a218bb672..01df409361c 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -32,6 +32,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
+require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
@@ -50,15 +51,15 @@ $langs->load("stocks");
$langs->load("sendings");
if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
-$backtopage=GETPOST('backtopage');
+$backtopage=GETPOST('backtopage','alpha');
$action=GETPOST('action','aZ09');
-$cancel=GETPOST('cancel');
+$cancel=GETPOST('cancel','alpha');
$id=GETPOST('id', 'int');
$ref=GETPOST('ref', 'alpha');
$stocklimit = GETPOST('seuil_stock_alerte');
$desiredstock = GETPOST('desiredstock');
-$cancel = GETPOST('cancel');
+$cancel = GETPOST('cancel','alpha');
$fieldid = isset($_GET["ref"])?'ref':'rowid';
$d_eatby=dol_mktime(0, 0, 0, $_POST['eatbymonth'], $_POST['eatbyday'], $_POST['eatbyyear']);
$d_sellby=dol_mktime(0, 0, 0, $_POST['sellbymonth'], $_POST['sellbyday'], $_POST['sellbyyear']);
@@ -823,6 +824,8 @@ $sql.= " AND ps.fk_product = ".$object->id;
$sql.= " ORDER BY e.label";
$entrepotstatic=new Entrepot($db);
+$product_lot_static=new Productlot($db);
+
$total=0;
$totalvalue=$totalvaluesell=0;
@@ -867,6 +870,11 @@ if ($resql)
if ($details<0) dol_print_error($db);
foreach ($details as $pdluo)
{
+ $product_lot_static->id = $pdluo->lotid;
+ $product_lot_static->batch = $pdluo->batch;
+ $product_lot_static->eatby = $pdluo->eatby;
+ $product_lot_static->sellby = $pdluo->sellby;
+
if ($action == 'editline' && GETPOST('lineid','int') == $pdluo->id)
{ //Current line edit
print "\n".' ';
@@ -896,7 +904,9 @@ if ($resql)
// Do not use this, or data will be wrong (bad tracking of movement label, inventory code, ...
//print 'id.'#'.$pdluo->id.'">';
//print img_edit().' ';
- print ''.$pdluo->batch.' ';
+ print '';
+ print $product_lot_static->getNomUrl(1);
+ print ' ';
print ''. dol_print_date($pdluo->eatby,'day') .' ';
print ''. dol_print_date($pdluo->sellby,'day') .' ';
print ''.$pdluo->qty.($pdluo->qty<0?' '.img_warning():'').' ';
diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php
index 77466ead2c8..70d907ae5e9 100644
--- a/htdocs/product/stock/productlot_card.php
+++ b/htdocs/product/stock/productlot_card.php
@@ -45,7 +45,7 @@ $langs->load("productbatch");
// Get parameters
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
-$backtopage = GETPOST('backtopage');
+$backtopage = GETPOST('backtopage','alpha');
$batch = GETPOST('batch','alpha');
$productid = GETPOST('productid','int');
$ref = GETPOST('ref','alpha'); // ref is productid_batch
@@ -150,7 +150,7 @@ if (empty($reshook))
// Action to add record
if ($action == 'add')
{
- if (GETPOST('cancel'))
+ if (GETPOST('cancel','alpha'))
{
$urltogo=$backtopage?$backtopage:dol_buildpath('/stock/list.php',1);
header("Location: ".$urltogo);
@@ -198,10 +198,10 @@ if (empty($reshook))
}
// Cancel
- if ($action == 'update' && GETPOST('cancel')) $action='view';
+ if ($action == 'update' && GETPOST('cancel','alpha')) $action='view';
// Action to update record
- if ($action == 'update' && ! GETPOST('cancel'))
+ if ($action == 'update' && ! GETPOST('cancel','alpha'))
{
$error=0;
@@ -284,7 +284,6 @@ if ($action == 'create')
print ''."\n";
// print ''.$langs->trans("Label").' ';
//
- print ''.$langs->trans("Fieldentity").' ';
print ''.$langs->trans("Fieldfk_product").' ';
print ''.$langs->trans("Fieldbatch").' ';
print ''.$langs->trans("Fieldfk_user_creat").' ';
diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php
index 3cf1e022e7f..567d60911ae 100644
--- a/htdocs/product/stock/productlot_list.php
+++ b/htdocs/product/stock/productlot_list.php
@@ -45,7 +45,7 @@ $langs->load("users");
// Get parameters
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
-$backtopage = GETPOST('backtopage');
+$backtopage = GETPOST('backtopage','alpha');
$myparam = GETPOST('myparam','alpha');
@@ -132,8 +132,8 @@ if (($id > 0 || ! empty($ref)) && $action != 'add')
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'confirm_presend') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 5d0af329952..657e6d610d3 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -148,8 +148,8 @@ $object = new Project($db);
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; }
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index c00e93e239f..41413645906 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -39,7 +39,7 @@ $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$taskref = GETPOST('taskref', 'alpha');
$backtopage=GETPOST('backtopage','alpha');
-$cancel=GETPOST('cancel');
+$cancel=GETPOST('cancel','alpha');
$search_user_id = GETPOST('search_user_id', 'int');
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index 3d239921c60..c730fd074d5 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -138,8 +138,8 @@ $object = new Task($db);
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; }
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 03c44514b01..2869d2254e7 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -546,13 +546,13 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE))
print '';
}
// EMail
-print ''.$langs->trans("Email").' * '."\n";
+print ''.$langs->trans("Email").' * '."\n";
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
- print ''.$langs->trans("Login").' * '."\n";
- print ''.$langs->trans("Password").' * '."\n";
- print ''.$langs->trans("PasswordAgain").' * '."\n";
+ print ''.$langs->trans("Login").' * '."\n";
+ print ''.$langs->trans("Password").' * '."\n";
+ print ''.$langs->trans("PasswordAgain").' * '."\n";
}
// Birthday
print ''.$langs->trans("DateToBirth").' ';
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index a886dcf475b..9c89b516eff 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -108,7 +108,7 @@ if ($action == 'add_element_resource' && ! $cancel)
}
// Update ressource
-if ($action == 'update_linked_resource' && $user->rights->resource->write && !GETPOST('cancel') )
+if ($action == 'update_linked_resource' && $user->rights->resource->write && !GETPOST('cancel','alpha') )
{
$res = $object->fetch_element_resource($lineid);
if($res)
diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php
index 497b9593142..0dea66946ec 100644
--- a/htdocs/societe/agenda.php
+++ b/htdocs/societe/agenda.php
@@ -76,7 +76,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook))
{
// Cancel
- if (GETPOST("cancel") && ! empty($backtopage))
+ if (GETPOST('cancel','alpha') && ! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index bc51fb39375..45101a79d45 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -56,7 +56,7 @@ if (! empty($conf->notification->enabled)) $langs->load("mails");
$mesg=''; $error=0; $errors=array();
$action = (GETPOST('action','aZ09') ? GETPOST('action','aZ09') : 'view');
-$cancel = GETPOST('cancel');
+$cancel = GETPOST('cancel','alpha');
$backtopage = GETPOST('backtopage','alpha');
$confirm = GETPOST('confirm');
$socid = GETPOST('socid','int');
@@ -421,7 +421,7 @@ if (empty($reshook))
else if (! empty($_FILES['photo']['name'])) $object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
// Check parameters
- if (! GETPOST("cancel"))
+ if (! GETPOST('cancel','alpha'))
{
if (! empty($object->email) && ! isValidEMail($object->email))
{
@@ -580,7 +580,7 @@ if (empty($reshook))
if ($action == 'update')
{
- if (GETPOST("cancel"))
+ if (GETPOST('cancel','alpha'))
{
if (! empty($backtopage))
{
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 02b717feb9b..e23a457cea5 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -208,8 +208,8 @@ $object = new Societe($db);
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 04d0a09a804..fda4eea65ea 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -434,7 +434,7 @@ if (empty($reshook))
}
// Reopen proposal
- else if ($action == 'confirm_reopen' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel')) {
+ else if ($action == 'confirm_reopen' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) {
// prevent browser refresh from reopening proposal several times
if ($object->statut == SupplierProposal::STATUS_SIGNED || $object->statut == SupplierProposal::STATUS_NOTSIGNED || $object->statut == SupplierProposal::STATUS_CLOSE) {
$object->reopen($user, SupplierProposal::STATUS_VALIDATED);
@@ -442,7 +442,7 @@ if (empty($reshook))
}
// Close proposal
- else if ($action == 'close' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel')) {
+ else if ($action == 'close' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) {
// prevent browser refresh from reopening proposal several times
if ($object->statut == SupplierProposal::STATUS_SIGNED) {
$object->setStatut(SupplierProposal::STATUS_CLOSE);
@@ -450,7 +450,7 @@ if (empty($reshook))
}
// Set accepted/refused
- else if ($action == 'setstatut' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel')) {
+ else if ($action == 'setstatut' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) {
if (! GETPOST('statut')) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), null, 'errors');
$action = 'statut';
@@ -871,7 +871,7 @@ if (empty($reshook))
}
}
- else if ($action == 'updateligne' && $user->rights->supplier_proposal->creer && GETPOST('cancel') == $langs->trans('Cancel')) {
+ else if ($action == 'updateligne' && $user->rights->supplier_proposal->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
}
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index f92c0e6305d..96d1079b92a 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -168,8 +168,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
@@ -420,7 +420,7 @@ if ($resql)
{
$langs->load("mails");
- if (! GETPOST('cancel'))
+ if (! GETPOST('cancel','alpha'))
{
$objecttmp=new SupplierProposal($db);
$listofselectedid=array();
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 0eac875046b..a495290f47a 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -55,7 +55,7 @@ $mode = GETPOST('mode','alpha');
$confirm = GETPOST('confirm','alpha');
$subaction = GETPOST('subaction','alpha');
$group = GETPOST("group","int",3);
-$cancel = GETPOST('cancel');
+$cancel = GETPOST('cancel','alpha');
// Users/Groups management only in master entity if transverse mode
if (($action == 'create' || $action == 'adduserldap') && ! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)
diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php
index 2ba3c67d0b4..64919029536 100644
--- a/htdocs/user/clicktodial.php
+++ b/htdocs/user/clicktodial.php
@@ -53,7 +53,7 @@ $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook)) {
- if ($action == 'update' && !GETPOST('cancel')) {
+ if ($action == 'update' && !GETPOST('cancel','alpha')) {
$edituser = new User($db);
$edituser->fetch($id);
diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php
index 9624e462a71..f4b962fb86f 100644
--- a/htdocs/user/group/index.php
+++ b/htdocs/user/group/index.php
@@ -68,8 +68,8 @@ $fieldstosearchall = array(
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; }
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/user/index.php b/htdocs/user/index.php
index f9989827021..04bbbcf8b81 100644
--- a/htdocs/user/index.php
+++ b/htdocs/user/index.php
@@ -135,8 +135,8 @@ if ($mode == 'employee') $search_employee=1;
* Actions
*/
-if (GETPOST('cancel')) { $action='list'; $massaction=''; }
-if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; }
+if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; }
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php
index 9c2aabd3654..43cb5097bba 100644
--- a/htdocs/user/passwordforgotten.php
+++ b/htdocs/user/passwordforgotten.php
@@ -48,19 +48,19 @@ $action=GETPOST('action', 'alpha');
$mode=$dolibarr_main_authentication;
if (! $mode) $mode='http';
-$username = GETPOST('username');
-$passwordhash = GETPOST('passwordhash');
-$conf->entity = (GETPOST('entity') ? GETPOST('entity') : 1);
+$username = GETPOST('username','alpha');
+$passwordhash = GETPOST('passwordhash','alpha');
+$conf->entity = (GETPOST('entity','int') ? GETPOST('entity','int') : 1);
// Instantiate hooks of thirdparty module only if not already define
$hookmanager->initHooks(array('passwordforgottenpage'));
-if (GETPOST('dol_hide_leftmenu') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1;
-if (GETPOST('dol_hide_topmenu') || ! empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu=1;
-if (GETPOST('dol_optimize_smallscreen') || ! empty($_SESSION['dol_optimize_smallscreen'])) $conf->dol_optimize_smallscreen=1;
-if (GETPOST('dol_no_mouse_hover') || ! empty($_SESSION['dol_no_mouse_hover'])) $conf->dol_no_mouse_hover=1;
-if (GETPOST('dol_use_jmobile') || ! empty($_SESSION['dol_use_jmobile'])) $conf->dol_use_jmobile=1;
+if (GETPOST('dol_hide_leftmenu','alpha') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1;
+if (GETPOST('dol_hide_topmenu','alpha') || ! empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu=1;
+if (GETPOST('dol_optimize_smallscreen','alpha') || ! empty($_SESSION['dol_optimize_smallscreen'])) $conf->dol_optimize_smallscreen=1;
+if (GETPOST('dol_no_mouse_hover','alpha') || ! empty($_SESSION['dol_no_mouse_hover'])) $conf->dol_no_mouse_hover=1;
+if (GETPOST('dol_use_jmobile','alpha') || ! empty($_SESSION['dol_use_jmobile'])) $conf->dol_use_jmobile=1;
/**
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index 0ec1bf07b68..f5feba2e606 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -41,7 +41,7 @@ $massaction=GETPOST('massaction','alpha');
$show_files=GETPOST('show_files','int');
$confirm=GETPOST('confirm','alpha');
$toselect = GETPOST('toselect', 'array');
-$cancel = GETPOST('cancel');
+$cancel = GETPOST('cancel','alpha');
// Security check
$fieldvalue = (! empty($id) ? $id : $ref);