';
if (!empty($formquestion['text'])) {
$formconfirm .= '
'.$formquestion['text'].'
'."\n";
diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php
index 19fa3f6fb26..7aa7d5585d8 100644
--- a/htdocs/core/class/html.formaccounting.class.php
+++ b/htdocs/core/class/html.formaccounting.class.php
@@ -444,11 +444,11 @@ class FormAccounting extends Form
/**
* Return HTML combo list of years existing into book keepping
*
- * @param string $selected Preselected value
- * @param string $htmlname Name of HTML select object
- * @param int $useempty Affiche valeur vide dans liste
- * @param string $output_format (html/opton (for option html only)/array (to return options arrays
- * @return string/array
+ * @param string $selected Preselected value
+ * @param string $htmlname Name of HTML select object
+ * @param int $useempty Affiche valeur vide dans liste
+ * @param string $output_format (html/opton (for option html only)/array (to return options arrays
+ * @return string|array HTML select component or array of select options
*/
public function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html')
{
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 26abcf2e721..32deb0667e8 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1277,7 +1277,8 @@ class FormFile
}
else
{
- print dol_trunc($file['name'], 200);
+ $filenametoshow = preg_replace('/\.noexe$/', '', $file['name']);
+ print dol_trunc($filenametoshow, 200);
print '';
}
// Preview link
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index d961cd20536..929157a50e5 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -307,8 +307,8 @@ class FormMail extends Form
/**
* Get the form to input an email
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
- * this->withfile
* this->param: Contains more parameters like email templates info
+ * this->withfckeditor: 1=We use an advanced editor, so we switch content into HTML
*
* @param string $addfileaction Name of action when posting file attachments
* @param string $removefileaction Name of action when removing file attachments
@@ -940,7 +940,7 @@ class FormMail extends Form
$this->substit['__ONLINE_PAYMENT_URL__'] = '';
}
- //Add lines substitution key from each line
+ // Add lines substitution key from each line
$lines = '';
$defaultlines = $arraydefaultmessage->content_lines;
if (isset($defaultlines))
@@ -954,14 +954,30 @@ class FormMail extends Form
$defaultmessage = str_replace('\n', "\n", $defaultmessage);
- // Deal with format differences between message and signature (text / HTML)
- if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
- $this->substit['__USER_SIGNATURE__'] = dol_nl2br($this->substit['__USER_SIGNATURE__']);
- } elseif (!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
- $defaultmessage = dol_nl2br($defaultmessage);
+ // Deal with format differences between message and some substitution variables (text / HTML)
+ $atleastonecomponentishtml = 0;
+ if (strpos($defaultmessage, '__USER_SIGNATURE__') !== false && dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
+ $atleastonecomponentishtml++;
+ }
+ if (strpos($defaultmessage, '__ONLINE_PAYMENT_TEXT_AND_URL__') !== false && dol_textishtml($this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'])) {
+ $atleastonecomponentishtml++;
+ }
+ if (dol_textishtml($defaultmessage)) {
+ $atleastonecomponentishtml++;
+ }
+ if ($atleastonecomponentishtml) {
+ if (! dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
+ $this->substit['__USER_SIGNATURE__'] = dol_nl2br($this->substit['__USER_SIGNATURE__']);
+ }
+ if (! dol_textishtml($this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'])) {
+ $this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'] = dol_nl2br($this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']);
+ }
+ if (! dol_textishtml($defaultmessage)) {
+ $defaultmessage = dol_nl2br($defaultmessage);
+ }
}
- if (isset($_POST["message"]) && !$_POST['modelselected']) $defaultmessage = $_POST["message"];
+ if (GETPOSTISSET("message") && !$_POST['modelselected']) $defaultmessage = $_POST["message"];
else
{
$defaultmessage = make_substitutions($defaultmessage, $this->substit);
@@ -969,6 +985,7 @@ class FormMail extends Form
$defaultmessage = preg_replace("/^(
)+/", "", $defaultmessage);
$defaultmessage = preg_replace("/^\n+/", "", $defaultmessage);
}
+
$out .= '
';
$out .= '';
$out .= $form->textwithpicto($langs->trans('MailText'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfrombody');
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index dbea182fb9b..494540b14d7 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -882,7 +882,7 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te
{
$rel_filetorenamebefore = preg_replace('/^[\\/]/', '', $rel_filetorenamebefore);
$rel_filetorenameafter = preg_replace('/^[\\/]/', '', $rel_filetorenameafter);
- //var_dump($rel_filetorenamebefore.' - '.$rel_filetorenameafter);
+ //var_dump($rel_filetorenamebefore.' - '.$rel_filetorenameafter);exit;
dol_syslog("Try to rename also entries in database for full relative path before = ".$rel_filetorenamebefore." after = ".$rel_filetorenameafter, LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
@@ -905,6 +905,7 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te
$ecmfile->filepath = $rel_dir;
$ecmfile->filename = $filename;
+
$resultecm = $ecmfile->update($user);
}
elseif ($resultecm == 0) // If no entry were found for src files, create/update target file
@@ -1007,7 +1008,7 @@ function dolCheckVirus($src_file)
* @param integer $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error'])
* @param int $nohook Disable all hooks
* @param string $varfiles _FILES var name
- * @return int|string >0 if OK, <0 or string if KO
+ * @return int|string 1 if OK, 2 if OK and .noexe appended, <0 or string if KO
* @see dol_move()
*/
function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan = 0, $uploaderrorcode = 0, $nohook = 0, $varfiles = 'addedfile')
@@ -1017,6 +1018,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
$reshook = 0;
$file_name = $dest_file;
+ $successcode = 1;
if (empty($nohook))
{
@@ -1067,6 +1069,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
if (isAFileWithExecutableContent($dest_file) && empty($conf->global->MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED))
{
$file_name .= '.noexe';
+ $successcode = 2;
}
// Security:
@@ -1121,7 +1124,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
{
if (!empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK));
dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG);
- return 1; // Success
+ return $successcode; // Success
}
else
{
@@ -1130,7 +1133,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
}
}
- return 1; // Success
+ return $successcode; // Success
}
/**
@@ -1185,8 +1188,6 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
}
else
{
- $error = 0;
-
//print "x".$file." ".$disableglob;exit;
$file_osencoded = dol_osencode($file); // New filename encoded in OS filesystem encoding charset
if (empty($disableglob) && !empty($file_osencoded))
@@ -1209,10 +1210,11 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
$rel_filetodelete = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filename);
if (!preg_match('/(\/temp\/|\/thumbs\/|\.meta$)/', $rel_filetodelete)) // If not a tmp file
{
- $rel_filetodelete = preg_replace('/^[\\/]/', '', $rel_filetodelete);
-
if (is_object($db) && $indexdatabase) // $db may not be defined when lib is in a context with define('NOREQUIREDB',1)
{
+ $rel_filetodelete = preg_replace('/^[\\/]/', '', $rel_filetodelete);
+ $rel_filetodelete = preg_replace('/\.noexe$/', '', $rel_filetodelete);
+
dol_syslog("Try to remove also entries in database for full relative path = ".$rel_filetodelete, LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile = new EcmFiles($db);
@@ -1577,6 +1579,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
$destfile = dol_string_nohtmltag($destfile);
$destfull = dol_string_nohtmltag($destfull);
+ // Move file from temp directory to final directory. A .noexe may also be appended on file name.
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles);
if (is_numeric($resupload) && $resupload > 0) // $resupload can be 'ErrorFileAlreadyExists'
@@ -1613,14 +1616,14 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
// Update index table of files (llx_ecm_files)
if ($donotupdatesession == 1)
{
- $result = addFileIntoDatabaseIndex($upload_dir, basename($destfile), $TFile['name'][$i], 'uploaded', 0);
+ $result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', 0);
if ($result < 0)
{
if ($allowoverwrite) {
// Do not show error message. We can have an error due to DB_ERROR_RECORD_ALREADY_EXISTS
}
else {
- setEventMessages('FailedToAddFileIntoDatabaseIndex', '', 'warnings');
+ setEventMessages('WarningFailedToAddFileIntoDatabaseIndex', '', 'warnings');
}
}
}
@@ -1732,7 +1735,7 @@ function dol_remove_file_process($filenb, $donotupdatesession = 0, $donotdeletef
* See also commonGenerateDocument that also add/update database index when a file is generated.
*
* @param string $dir Directory name (full real path without ending /)
- * @param string $file File name
+ * @param string $file File name (May end with '.noexe')
* @param string $fullpathorig Full path of origin for file (can be '')
* @param string $mode How file was created ('uploaded', 'generated', ...)
* @param int $setsharekey Set also the share key
@@ -1748,7 +1751,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
if (!preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) // If not a tmp dir
{
- $filename = basename($file);
+ $filename = basename(preg_replace('/\.noexe$/', '', $file));
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 2d8996523fe..b30bc99f38a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1205,7 +1205,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$out = "\n".'';
if ((!empty($title) && $showtitle) || $morehtmlright || !empty($links)) {
- $out .= ''."\n";
+ $out .= ' '."\n";
}
// Show right part
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index 43acb16ba2a..a8567cd420c 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -37,11 +37,14 @@ function product_prepare_head($object)
global $db, $langs, $conf, $user;
$langs->load("products");
+ $label = $langs->trans('Product');
+ if ($object->isService()) $label = $langs->trans('Service');
+
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT."/product/card.php?id=".$object->id;
- $head[$h][1] = $langs->trans("ProductOrService");
+ $head[$h][1] = $label;
$head[$h][2] = 'card';
$h++;
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index be455d5431a..661eded1b33 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -1433,7 +1433,10 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire);
$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire);
$newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire);
-
+ //Achats
+ $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report", $langs->trans("ReportPurchaseTurnover"), 1, $user->rights->compta->resultat->lire);
+ $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire);
+ $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire);
// Journaux
$newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50);
$newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51);
@@ -1496,8 +1499,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->rights->prelevement->bons->lire);
$newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->prelevement->bons->lire);
$newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->prelevement->bons->lire);
-
- //$newmenu->add("/compta/prelevement/config.php",$langs->trans("Setup"),1,$user->rights->prelevement->bons->configurer);
}
}
@@ -1507,12 +1508,12 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->rights->paymentbybanktransfer->read, '', $mainmenu, 'banktransfer');
if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") {
- $newmenu->add("/compta/paymentbybanktransfer/create.php?mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->rights->paymentbybanktransfer->create);
+ $newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->rights->paymentbybanktransfer->create);
- $newmenu->add("/compta/paymentbybanktransfer/bons.php?mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->rights->paymentbybanktransfer->read);
- $newmenu->add("/compta/paymentbybanktransfer/list.php?mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->rights->paymentbybanktransfer->read);
- $newmenu->add("/compta/paymentbybanktransfer/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->paymentbybanktransfer->read);
- $newmenu->add("/compta/paymentbybanktransfer/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->paymentbybanktransfer->read);
+ $newmenu->add("/compta/prelevement/bons.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->rights->paymentbybanktransfer->read);
+ $newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->rights->paymentbybanktransfer->read);
+ $newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->paymentbybanktransfer->read);
+ $newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->paymentbybanktransfer->read);
}
}
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 384c4fc3a7e..d9f2c97724e 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -2321,24 +2321,24 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
print '
- '.$this->getName().'
+ '.$this->getName().'
'.nl2br($this->getDesc()).'';
/*print ' getVersion(1).'">';
print $this->getVersion(1);
print ''; */
- print ' ';
+ print ' ';
print ' ';
- print ' ';
- print $codeenabledisable;
- print ' ';
- print ' ';
+ print ' ';
print $codetoconfig;
print ' ';
+ print ' ';
+ print $codeenabledisable;
+ print ' ';
print ' ';
print '
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index cf91ec4806c..a98dd42e5d7 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -1310,7 +1310,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
- $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
+ $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval, 'MT'), 0, $outputlangs), 0, 'R', 1);
}
}
diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php
index d7a57f25818..ee6e39c591c 100644
--- a/htdocs/core/modules/modExpenseReport.class.php
+++ b/htdocs/core/modules/modExpenseReport.class.php
@@ -34,7 +34,7 @@ class modExpenseReport extends DolibarrModules
/**
* Constructor. Define names, constants, directories, boxes, permissions
*
- * @param Database $db Database handler
+ * @param DoliDb $db Database handler
*/
public function __construct($db)
{
diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php
index 7e2dc1f420e..50f64304e50 100644
--- a/htdocs/core/tpl/card_presend.tpl.php
+++ b/htdocs/core/tpl/card_presend.tpl.php
@@ -258,7 +258,6 @@ if ($action == 'presend')
}
}
- $custcontact = '';
$contactarr = array();
$contactarr = $tmpobject->liste_contact(-1, 'external');
diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php
index b7d083e8626..db72ea7d74a 100644
--- a/htdocs/core/tpl/filemanager.tpl.php
+++ b/htdocs/core/tpl/filemanager.tpl.php
@@ -178,7 +178,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg
print ' |
';
}
- else // Show filtree when ajax is disabled (rare)
+ else // Show file tree when ajax is disabled (rare)
{
print '
';
@@ -212,7 +212,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg
entity = trim($this->entity);
}
if (isset($this->filename)) {
- $this->filename = trim($this->filename);
+ $this->filename = preg_replace('/\.noexe$/', '', trim($this->filename));
}
if (isset($this->filepath)) {
$this->filepath = trim($this->filepath);
@@ -346,12 +346,13 @@ class EcmFiles extends CommonObject
$sql .= " t.src_object_id";
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
$sql .= ' WHERE 1 = 1';
- /* Fetching this table depends on filepath+filename, it must not depends on entity
+ /* Fetching this table depends on filepath+filename, it must not depends on entity because filesystem on disk does not know what is Dolibarr entities
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND entity IN (" . getEntity('ecmfiles') . ")";
}*/
if ($relativepath) {
- $sql .= " AND t.filepath = '".$this->db->escape(dirname($relativepath))."' AND t.filename = '".$this->db->escape(basename($relativepath))."'";
+ $relativepathwithnoexe = preg_replace('/\.noexe$/', '', $relativepath); // We must never have the .noexe into the database
+ $sql .= " AND t.filepath = '".$this->db->escape(dirname($relativepath))."' AND t.filename = '".$this->db->escape(basename($relativepathwithnoexe))."'";
$sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index
}
elseif (!empty($ref)) { // hash of file path
@@ -552,46 +553,47 @@ class EcmFiles extends CommonObject
// Clean parameters
if (isset($this->ref)) {
- $this->ref = trim($this->ref);
+ $this->ref = trim($this->ref);
}
if (isset($this->label)) {
- $this->label = trim($this->label);
+ $this->label = trim($this->label);
}
if (isset($this->share)) {
- $this->share = trim($this->share);
+ $this->share = trim($this->share);
}
if (isset($this->entity)) {
- $this->entity = trim($this->entity);
+ $this->entity = trim($this->entity);
}
if (isset($this->filename)) {
- $this->filename = trim($this->filename);
+ $this->filename = preg_replace('/\.noexe$/', '', trim($this->filename));
}
if (isset($this->filepath)) {
- $this->filepath = trim($this->filepath);
+ $this->filepath = trim($this->filepath);
+ $this->filepath = preg_replace('/[\\/]+$/', '', $this->filepath); // Remove last /
}
if (isset($this->fullpath_orig)) {
- $this->fullpath_orig = trim($this->fullpath_orig);
+ $this->fullpath_orig = trim($this->fullpath_orig);
}
if (isset($this->description)) {
- $this->description = trim($this->description);
+ $this->description = trim($this->description);
}
if (isset($this->keywords)) {
- $this->keywords = trim($this->keywords);
+ $this->keywords = trim($this->keywords);
}
if (isset($this->cover)) {
- $this->cover = trim($this->cover);
+ $this->cover = trim($this->cover);
}
if (isset($this->gen_or_uploaded)) {
- $this->gen_or_uploaded = trim($this->gen_or_uploaded);
+ $this->gen_or_uploaded = trim($this->gen_or_uploaded);
}
if (isset($this->extraparams)) {
- $this->extraparams = trim($this->extraparams);
+ $this->extraparams = trim($this->extraparams);
}
if (isset($this->fk_user_m)) {
- $this->fk_user_m = trim($this->fk_user_m);
+ $this->fk_user_m = trim($this->fk_user_m);
}
if (isset($this->acl)) {
- $this->acl = trim($this->acl);
+ $this->acl = trim($this->acl);
}
if (isset($this->src_object_type)) {
$this->src_object_type = trim($this->src_object_type);
diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php
index 1c94fd1700b..63fdedbab6d 100644
--- a/htdocs/ecm/file_card.php
+++ b/htdocs/ecm/file_card.php
@@ -140,6 +140,12 @@ if ($action == 'update')
$oldfile = $olddir.$oldlabel;
$newfile = $newdir.$newlabel;
+ $newfileformove = $newfile;
+ // If old file end with .noexe, new file must also end with .noexe
+ if (preg_match('/\.noexe$/', $oldfile) && ! preg_match('/\.noexe$/', $newfileformove)) {
+ $newfileformove .= '.noexe';
+ }
+ //var_dump($oldfile);var_dump($newfile);exit;
// Now we update index of file
$db->begin();
@@ -147,7 +153,7 @@ if ($action == 'update')
//print $oldfile.' - '.$newfile;
if ($newlabel != $oldlabel)
{
- $result = dol_move($oldfile, $newfile); // This include update of database
+ $result = dol_move($oldfile, $newfileformove); // This include update of database
if (!$result)
{
$langs->load('errors');
@@ -191,7 +197,7 @@ if ($action == 'update')
$object->entity = $conf->entity;
$object->filepath = preg_replace('/[\\/]+$/', '', $newdirrelativetodocument);
$object->filename = $newlabel;
- $object->label = md5_file(dol_osencode($newfile)); // hash of file content
+ $object->label = md5_file(dol_osencode($newfileformove)); // hash of file content
$object->fullpath_orig = '';
$object->gen_or_uploaded = 'unknown';
$object->description = ''; // indexed content
@@ -209,6 +215,11 @@ if ($action == 'update')
$db->commit();
$urlfile = $newlabel;
+ // If old file end with .noexe, new file must also end with .noexe
+ if (preg_match('/\.noexe$/', $newfileformove)) {
+ $urlfile .= '.noexe';
+ }
+
header('Location: '.$_SERVER["PHP_SELF"].'?urlfile='.urlencode($urlfile).'§ion='.urlencode($section));
exit;
}
@@ -265,9 +276,13 @@ while ($tmpecmdir && $result > 0)
$i++;
}
+$urlfiletoshow = preg_replace('/\.noexe$/', '', $urlfile);
+
$s = img_picto('', 'object_dir').' '.$langs->trans("ECMRoot").' -> '.$s.' -> ';
-if ($action == 'edit') $s .= ' ';
-else $s .= $urlfile;
+if ($action == 'edit') $s .= ' ';
+else $s .= $urlfiletoshow;
+
+$morehtml = '';
$object->ref = ''; // Force to hide ref
dol_banner_tab($object, '', $morehtml, 0, '', '', $s);
@@ -290,10 +305,9 @@ print dol_print_size($totalsize);
print ' |
';
*/
+// Hash of file content
print '
| '.$langs->trans("HashOfFileContent").' | ';
$object = new EcmFiles($db);
-//$filenametosearch=basename($filepath);
-//$filedirtosearch=basedir($filepath);
$object->fetch(0, '', $filepathtodocument);
if (!empty($object->label))
{
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index 43b9ca6dcce..2c533e483c6 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -125,7 +125,6 @@ if ($action == 'confirm_deletefile')
if (GETPOST('confirm') == 'yes')
{
// GETPOST('urlfile','alpha') is full relative URL from ecm root dir. Contains path of all sections.
- //var_dump(GETPOST('urlfile'));exit;
$upload_dir = $conf->ecm->dir_output.($relativepath ? '/'.$relativepath : '');
$file = $upload_dir."/".GETPOST('urlfile', 'alpha');
@@ -133,7 +132,9 @@ if ($action == 'confirm_deletefile')
$ret = dol_delete_file($file); // This include also the delete from file index in database.
if ($ret)
{
- setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile', 'alpha')), null, 'mesgs');
+ $urlfiletoshow = GETPOST('urlfile', 'alpha');
+ $urlfiletoshow = preg_replace('/\.noexe$/', '', $urlfiletoshow);
+ setEventMessages($langs->trans("FileWasRemoved", $urlfiletoshow), null, 'mesgs');
$result = $ecmdir->changeNbOfFiles('-');
}
else
diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php
index 0780154118e..eda59d8e0bb 100644
--- a/htdocs/filefunc.inc.php
+++ b/htdocs/filefunc.inc.php
@@ -31,7 +31,7 @@
*/
if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr');
-if (!defined('DOL_VERSION')) define('DOL_VERSION', '12.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
+if (!defined('DOL_VERSION')) define('DOL_VERSION', '12.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
if (!defined('EURO')) define('EURO', chr(128));
diff --git a/htdocs/index.php b/htdocs/index.php
index 8d6e02594ee..1ad2d1b4f64 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -158,7 +158,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
'prospects' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
'suppliers' => !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
'contacts' => !empty($conf->societe->enabled) && $user->rights->societe->contact->lire,
- 'services' => !empty($conf->product->enabled) && $user->rights->produit->lire,
+ 'products' => !empty($conf->product->enabled) && $user->rights->produit->lire,
'services' => !empty($conf->service->enabled) && $user->rights->service->lire,
'proposals' => !empty($conf->propal->enabled) && $user->rights->propale->lire,
'orders' => !empty($conf->commande->enabled) && $user->rights->commande->lire,
diff --git a/htdocs/install/default.css b/htdocs/install/default.css
index e469a3bbb80..b7fd69d9ecb 100644
--- a/htdocs/install/default.css
+++ b/htdocs/install/default.css
@@ -87,6 +87,9 @@ div.soustitre {
tr.trlineforchoice {
height: 4em;
}
+a.button.runupgrade {
+ padding: 10px;
+}
/* Force values for small screen 570 */
@media only screen and (max-width: 570px)
diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
index 5e673d97611..89b8a8ace76 100644
--- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
+++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
@@ -67,11 +67,13 @@ ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafie
ALTER TABLE llx_facture_rec MODIFY COLUMN titre varchar(200) NOT NULL;
-- This var is per entity now, so we remove const if global if exists
-delete from llx_const where name = 'PROJECT_HIDE_TASKS' and entity = 0;
-
+delete from llx_const where name in ('PROJECT_HIDE_TASKS', 'MAIN_BUGTRACK_ENABLELINK', 'MAIN_HELP_DISABLELINK') and entity = 0;
-- For v12
+ALTER TABLE llx_prelevement_bons ADD COLUMN type varchar(16) DEFAULT 'debit-order';
+
+
-- Delete an old index that is duplicated
-- VMYSQL4.1 DROP INDEX ix_fk_product_stock on llx_product_batch;
-- VPGSQL8.2 DROP INDEX ix_fk_product_stock
@@ -295,3 +297,8 @@ ALTER TABLE llx_menu MODIFY COLUMN module varchar(255);
UPDATE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG';
ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN hostcharset varchar(16) DEFAULT 'UTF-8';
+
+ALTER TABLE llx_adherent_type MODIFY subscription varchar(3) NOT NULL DEFAULT '1';
+ALTER TABLE llx_adherent_type MODIFY vote varchar(3) NOT NULL DEFAULT '1';
+
+
diff --git a/htdocs/install/mysql/tables/llx_adherent_type.sql b/htdocs/install/mysql/tables/llx_adherent_type.sql
index 1b675c5e3fd..7e9270b89dc 100644
--- a/htdocs/install/mysql/tables/llx_adherent_type.sql
+++ b/htdocs/install/mysql/tables/llx_adherent_type.sql
@@ -31,8 +31,8 @@ create table llx_adherent_type
libelle varchar(50) NOT NULL,
morphy varchar(3) NOT NULL,
duration varchar(6) DEFAULT NULL,
- subscription varchar(3) NOT NULL DEFAULT 'yes',
- vote varchar(3) NOT NULL DEFAULT 'yes',
+ subscription varchar(3) NOT NULL DEFAULT '1',
+ vote varchar(3) NOT NULL DEFAULT '1',
note text,
mail_valid text
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_prelevement_bons.sql b/htdocs/install/mysql/tables/llx_prelevement_bons.sql
index e7e0b9a89f1..fc7f3f2f538 100644
--- a/htdocs/install/mysql/tables/llx_prelevement_bons.sql
+++ b/htdocs/install/mysql/tables/llx_prelevement_bons.sql
@@ -26,6 +26,7 @@
create table llx_prelevement_bons
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
+ type varchar(16) DEFAULT 'debit-order', -- 'debit-order' or 'bank-transfer'
ref varchar(12), -- reference
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime, -- date de creation
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index fef27b5b7de..bee43c2569f 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -541,8 +541,8 @@ Module54Name=Contracts/Subscriptions
Module54Desc=Management of contracts (services or recurring subscriptions)
Module55Name=Barcodes
Module55Desc=Barcode management
-Module56Name=Payment by bank transfer
-Module56Desc=Management of payment by bank transfer orders. It includes generation of SEPA file for European countries.
+Module56Name=Payment by credit transfer
+Module56Desc=Management of payment by credit transfer orders. It includes generation of SEPA file for European countries.
Module57Name=Bank Direct Debit payments
Module57Desc=Management of Direct Debit payment orders. It includes generation of SEPA file for European countries.
Module58Name=ClickToDial
diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang
index 48bd2b81c2e..17ebc2ff7ed 100644
--- a/htdocs/langs/en_US/banks.lang
+++ b/htdocs/langs/en_US/banks.lang
@@ -35,10 +35,10 @@ SwiftValid=BIC/SWIFT valid
SwiftVNotalid=BIC/SWIFT not valid
IbanValid=BAN valid
IbanNotValid=BAN not valid
-StandingOrders=Direct Debit orders
+StandingOrders=Direct debit orders
StandingOrder=Direct debit order
-PaymentByBankTransfers=Payments by bank transfer
-PaymentByBankTransfer=Payment by bank transfer
+PaymentByBankTransfers=Payments by credit transfer
+PaymentByBankTransfer=Payment by credit transfer
AccountStatement=Account statement
AccountStatementShort=Statement
AccountStatements=Account statements
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index 2857b461e7b..1e562909360 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -241,10 +241,6 @@ EscompteOffered=Discount offered (payment before term)
EscompteOfferedShort=Discount
SendBillRef=Submission of invoice %s
SendReminderBillRef=Submission of invoice %s (reminder)
-StandingOrders=Direct debit orders
-StandingOrder=Direct debit order
-PaymentByBankTransfers=Payments by bank transfer
-PaymentByBankTransfer=Payment by bank transfer
NoDraftBills=No draft invoices
NoOtherDraftBills=No other draft invoices
NoDraftInvoices=No draft invoices
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index 1a9208bcf85..92674363ced 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -425,7 +425,7 @@ ListSuppliersShort=List of Vendors
ListProspectsShort=List of Prospects
ListCustomersShort=List of Customers
ThirdPartiesArea=Third Parties/Contacts
-LastModifiedThirdParties=Last %s modified Third Parties
+LastModifiedThirdParties=Latest %s modified Third Parties
UniqueThirdParties=Total of Third Parties
InActivity=Open
ActivityCeased=Closed
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 739ecb88591..6dbb616f2fc 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -263,3 +263,4 @@ WarningNumberOfRecipientIsRestrictedInMassAction=Warning, number of different re
WarningDateOfLineMustBeInExpenseReportRange=Warning, the date of line is not in the range of the expense report
WarningProjectClosed=Project is closed. You must re-open it first.
WarningSomeBankTransactionByChequeWereRemovedAfter=Some bank transaction were removed after that the receipt including them were generated. So nb of cheques and total of receipt may differ from number and total in list.
+WarningFailedToAddFileIntoDatabaseIndex=Warnin, failed to add file entry into ECM database index table
\ No newline at end of file
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index ba85f51e739..5dc70fa068f 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -85,8 +85,8 @@ MaxSize=Maximum size
AttachANewFile=Attach a new file/document
LinkedObject=Linked object
NbOfActiveNotifications=Number of notifications (no. of recipient emails)
-PredefinedMailTest=__(Hello)__\nThis is a test mail sent to __EMAIL__.\nThe two lines are separated by a carriage return.\n\n__USER_SIGNATURE__
-PredefinedMailTestHtml=__(Hello)__\nThis is a test mail (the word test must be in bold). The two lines are separated by a carriage return.
__USER_SIGNATURE__
+PredefinedMailTest=__(Hello)__\nThis is a test mail sent to __EMAIL__.\nThe lines are separated by a carriage return.\n\n__USER_SIGNATURE__
+PredefinedMailTestHtml=__(Hello)__ This is a test mail sent to __EMAIL__ (the word test must be in bold). The lines are separated by a carriage return.
__USER_SIGNATURE__
PredefinedMailContentContract=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendInvoice=__(Hello)__\n\nPlease find invoice __REF__ attached \n\n__ONLINE_PAYMENT_TEXT_AND_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
PredefinedMailContentSendInvoiceReminder=__(Hello)__\n\nWe would like to remind you that the invoice __REF__ seems to have not been paid. A copy of the invoice is attached as a reminder.\n\n__ONLINE_PAYMENT_TEXT_AND_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index a31243a07b6..fb4379f5e1a 100644
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -43,7 +43,7 @@ ServicesOnSaleOnly=Services for sale only
ServicesOnPurchaseOnly=Services for purchase only
ServicesNotOnSell=Services not for sale and not for purchase
ServicesOnSellAndOnBuy=Services for sale and for purchase
-LastModifiedProductsAndServices=Last %s modified products/services
+LastModifiedProductsAndServices=Latest %s modified products/services
LastRecordedProducts=Latest %s recorded products
LastRecordedServices=Latest %s recorded services
CardProduct0=Product
diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang
index ad51b045a37..fb6c56687ee 100644
--- a/htdocs/langs/en_US/withdrawals.lang
+++ b/htdocs/langs/en_US/withdrawals.lang
@@ -4,21 +4,22 @@ SuppliersStandingOrdersArea=Direct credit payment orders area
StandingOrdersPayment=Direct debit payment orders
StandingOrderPayment=Direct debit payment order
NewStandingOrder=New direct debit order
-NewPaymentByBankTransfer=New payment by bank transfer
+NewPaymentByBankTransfer=New payment by credit transfer
StandingOrderToProcess=To process
-PaymentByBankTransferReceipts=Bank transfer orders
-PaymentByBankTransferLines=Bank transfer order lines
+PaymentByBankTransferReceipts=Credit transfer orders
+PaymentByBankTransferLines=Credit transfer order lines
WithdrawalsReceipts=Direct debit orders
WithdrawalReceipt=Direct debit order
-LatestBankTransferReceipts=Latest %s bank transfer orders
+LatestBankTransferReceipts=Latest %s credit transfer orders
LastWithdrawalReceipts=Latest %s direct debit files
WithdrawalsLines=Direct debit order lines
RequestStandingOrderToTreat=Request for direct debit payment order to process
RequestStandingOrderTreated=Request for direct debit payment order processed
NotPossibleForThisStatusOfWithdrawReceiptORLine=Not yet possible. Withdraw status must be set to 'credited' before declaring reject on specific lines.
-NbOfInvoiceToWithdraw=No. of qualified invoice with waiting direct debit order
+NbOfInvoiceToWithdraw=No. of qualified customer invoices with waiting direct debit order
NbOfInvoiceToWithdrawWithInfo=No. of customer invoice with direct debit payment orders having defined bank account information
-SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by bank transfer
+NbOfInvoiceToPayByBankTransfer=No. of qualified supplier invoices waiting for a payment by credit transfer
+SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by credit transfer
InvoiceWaitingWithdraw=Invoice waiting for direct debit
AmountToWithdraw=Amount to withdraw
WithdrawsRefused=Direct debit refused
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 490641ca9fa..679e565cf0e 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1699,10 +1699,11 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$langs->load('admin');
$appli .= ' '.$langs->trans("Database").': '.$db->database_name;
}
- $text = ''.DOL_VERSION.'';
- $toprightmenu .= @Form::textwithtooltip('', $appli, 2, 1, $text, 'login_block_elem', 2);
}
+ $text = ''.DOL_VERSION.'';
+ $toprightmenu .= @Form::textwithtooltip('', $appli, 2, 1, $text, 'login_block_elem', 2);
+
// Logout link
$toprightmenu .= @Form::textwithtooltip('', $logouthtmltext, 2, 1, $logouttext, 'login_block_elem logout-btn', 2);
diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index d813c3b291b..5b53de530bd 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -2005,9 +2005,7 @@ elseif (!empty($module))
}
dol_fiche_end();
- }
- else
- {
+ } else { // Edit text file
$fullpathoffile = dol_buildpath($file, 0, 1); // Description - level 2
if ($fullpathoffile)
diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php
index 513c4537358..5426546e927 100644
--- a/htdocs/multicurrency/class/multicurrency.class.php
+++ b/htdocs/multicurrency/class/multicurrency.class.php
@@ -556,8 +556,6 @@ class MultiCurrency extends CommonObject
*/
public static function getAmountConversionFromInvoiceRate($fk_facture, $amount, $way = 'dolibarr', $table = 'facture')
{
- global $db;
-
$multicurrency_tx = self::getInvoiceRate($fk_facture, $table);
if ($multicurrency_tx)
@@ -592,10 +590,11 @@ class MultiCurrency extends CommonObject
}
/**
- * With free account we can't set source then recalcul all rates to force another source
+ * With free account we can't set source then recalcul all rates to force another source.
+ * This modify the array &$TRate.
*
* @param stdClass $TRate Object containing all currencies rates
- * @return -1 if KO, 0 if nothing, 1 if OK
+ * @return int -1 if KO, 0 if nothing, 1 if OK
*/
public static function recalculRates(&$TRate)
{
diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php
index d9af22ed78e..c971b69b208 100644
--- a/htdocs/opensurvey/class/opensurveysondage.class.php
+++ b/htdocs/opensurvey/class/opensurveysondage.class.php
@@ -83,14 +83,12 @@ class Opensurveysondage extends CommonObject
public $sujet;
/**
- * Allow comments on this poll
- * @var bool
+ * @var int Allow comments on this poll
*/
public $allow_comments;
/**
- * Allow users see others vote
- * @var bool
+ * @var int Allow users see others vote
*/
public $allow_spy;
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index 5ef50f798d0..55270e0cd10 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -73,9 +73,14 @@ class MouvementStock extends CommonObject
public $fk_origin;
public $origintype;
+
public $inventorycode;
public $batch;
+ /**
+ * @var Object Object set as origin before calling livraison() or reception()
+ */
+ public $origin;
public $fields = array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10, 'showoncombobox'=>1),
@@ -378,6 +383,7 @@ class MouvementStock extends CommonObject
if ($movestock && $entrepot_id > 0) // Change stock for current product, change for subproduct is done after
{
+ // Set $origintype, fk_origin, fk_project
$fk_project = 0;
if (!empty($this->origin)) { // This is set by caller for tracking reason
$origintype = empty($this->origin->origin_type) ? $this->origin->element : $this->origin->origin_type;
diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php
index c50a746c444..ab9d52a350d 100644
--- a/htdocs/societe/class/api_thirdparties.class.php
+++ b/htdocs/societe/class/api_thirdparties.class.php
@@ -133,7 +133,7 @@ class Thirdparties extends DolibarrApi
}
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
$sql .= ", ".MAIN_DB_PREFIX."c_stcomm as st";
- $sql .= " WHERE t.entity IN ('.getEntity('societe').')";
+ $sql .= " WHERE t.entity IN (".getEntity('societe').")";
$sql .= " AND t.fk_stcomm = st.id";
if ($mode == 1) $sql .= " AND t.client IN (1, 3)";
diff --git a/htdocs/takepos/css/phone.css b/htdocs/takepos/css/phone.css
index 0f3606071f0..bdfdf45e116 100644
--- a/htdocs/takepos/css/phone.css
+++ b/htdocs/takepos/css/phone.css
@@ -4,6 +4,7 @@ html,body {
margin:0;
height:100%;
width:100%;
+ background-color: #FFF !important;
}
.container{
@@ -17,14 +18,14 @@ html,body {
.phonerow1{
margin: 0 auto;
width: 100%;
- height: 40%;
+ height: auto;
min-height: 40%;
}
.phonerow2{
margin: 0 auto;
width: 100%;
- height: 40%;
+ height: auto;
}
.phonebuttonsrow{
@@ -90,7 +91,71 @@ button.publicphonebutton {
text-align: center;
overflow: visible; /* removes extra width in IE */
width:33%;
- height:90%;
+ height:50px;
+ font-weight: bold;
+ color: #fff;
+}
+
+.phoneblue{
+ color: #fff;
+ background-color: #428bca;
+ border-color: #357ebd;
+}
+
+.phonegreen{
+ color: #fff;
+ background-color: #5cb85c;
+ border-color: #4cae4c;
+ font-size:20px;
+ text-align:center;
+ width:20px;
+}
+
+.phonetable{
+ width:130px;
+}
+
+.phoneqty{
+ font-size:24px;
+ font-weight: bold;
+
+
+}
+
+.phonered{
+ color: #fff;
+ background-color: #dc3545;
+ border-color: #dc3545;
+ font-size:20px;
+ text-align:center;
+ width:20px;
+}
+
+.phoneorange{
+ color: #fff;
+ background-color: #f0ad4e;
+ border-color: #eea236;
+}
+
+.total{
+ width:100% !important;
+ font-size:24px;
+}
+
+.width24{
+ font-size:24px;
+}
+
+.leftcat{
+ margin-top:15px;
+ float:left;
+ width: 50%;
+ text-align:center;
+ height:150px;;
+ overflow:hidden;
+ margin-bottom:5px;
+ font-size:18px;
+ color:#5B5858;
font-weight: bold;
}
@@ -107,3 +172,28 @@ button.publicphonebutton2 {
font-weight: bold;
padding: 8px 16px;
}
+
+.div-table-responsive-no-min{
+ margin-top:20px;
+}
+
+.comment {
+ float: left;
+ width: 100%;
+ height: auto;
+}
+
+.comment-text-area {
+ float: left;
+ width: 80%;
+ height: auto;
+}
+
+.textinput {
+ float: left;
+ width: 100%;
+ min-height: 75px;
+ outline: none;
+ resize: none;
+ border: 1px solid grey;
+}
diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php
index a5686054193..ea863374f3c 100644
--- a/htdocs/takepos/genimg/index.php
+++ b/htdocs/takepos/genimg/index.php
@@ -25,7 +25,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
-require '../../main.inc.php'; // Load $user and permissions
+if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../../main.inc.php'; // Load $user and permissions
$id = GETPOST('id', 'int');
$w = GETPOST('w', 'int');
@@ -60,7 +60,7 @@ if ($query == "cat")
{
$filename = $obj['photo'];
}
- $file = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename);
+ $file = DOL_URL_ROOT.'/viewimage.php?cache=1&publictakepos=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename);
header('Location: '.$file);
exit;
}
@@ -72,15 +72,20 @@ elseif ($query == "pro")
$objProd = new Product($db);
$objProd->fetch($id);
- $image = $objProd->show_photos('product', $conf->product->multidir_output[$entity], 'small', 1);
+ $image = $objProd->show_photos('product', $conf->product->multidir_output[$objProd->entity], 'small', 1);
preg_match('@src="([^"]+)"@', $image, $match);
$file = array_pop($match);
- if ($file == "") header('Location: ../../public/theme/common/nophoto.png');
- else header('Location: '.$file.'&cache=1');
-}
-else
-{
+ if ($file == "") {
+ header('Location: ../../public/theme/common/nophoto.png');
+ } else {
+ if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
+ header('Location: '.$file.'&cache=1');
+ } else {
+ header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product');
+ }
+ }
+} else {
// TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resize when downloaded.
// The file
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 3d6cec96319..07006eb5cd1 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -70,10 +70,12 @@ if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout ==
';
+ $arrayofcss = array(
+ '/takepos/css/pos.css.php',
+ '/takepos/js/jquery.colorbox-min.js'
+ );
+ $arrayofjs = array('/takepos/js/jquery.colorbox-min.js');
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
- print '
-
- ';
}
/**
@@ -863,6 +865,9 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT)
print $langs->trans('Place')." ".$label." - ";
print $langs->trans('Floor')." ".$floor." - ";
}
+ elseif (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) print $mysoc->name;
+ elseif ($mobilepage == "cats") print $langs->trans('Category');
+ elseif ($mobilepage == "products") print $langs->trans('Label');
}
// In phone version only show when is invoice page
if ($mobilepage == "invoice" || $mobilepage == "") {
@@ -877,6 +882,7 @@ if ($_SESSION["basiclayout"] != 1)
print ' | '.$langs->trans('Qty').' | ';
print ''.$langs->trans('TotalTTCShort').' | ';
}
+elseif ($mobilepage == "invoice") print ''.$langs->trans('Qty').' | ';
print "
\n";
@@ -889,12 +895,14 @@ if ($_SESSION["basiclayout"] == 1)
$categories = $categorie->get_full_arbo('product');
$htmlforlines = '';
foreach ($categories as $row) {
- $htmlforlines .= '
';
- $htmlforlines .= '';
+ if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= ' ';
+ else $htmlforlines .= ' | ';
$htmlforlines .= $row['label'];
- $htmlforlines .= ' | ';
- $htmlforlines .= '
'."\n";
+ if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '
'."\n";
+ else $htmlforlines .= '