Merge remote-tracking branch 'Dolibarr/12.0' into 12

This commit is contained in:
Francis Appels 2020-06-17 09:52:11 +02:00
commit ee5ebdb6ef
39 changed files with 2021 additions and 1531 deletions

View File

@ -172,6 +172,11 @@ echo "mysql -P$port -u$admin -p***** $base < $mydir/$dumpfile"
mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
export res=$?
if [ $res -ne 0 ]; then
echo "Error to load database dump with mysql -P$port -u$admin -p***** $base < $mydir/$dumpfile"
exit
fi
$mydir/updatedemo.php confirm
export res=$?

File diff suppressed because one or more lines are too long

View File

@ -72,8 +72,8 @@ $tables=array(
'bank'=>array(0=>'datev', 1=>'dateo'),
'commande_fournisseur'=>array(0=>'date_commande', 1=>'date_valid', 3=>'date_creation', 4=>'date_approve', 5=>'date_approve2', 6=>'date_livraison'),
'supplier_proposal'=>array(0=>'datec', 1=>'date_valid', 2=>'date_cloture'),
'expense_report'=>array(0=>'date_debut', 1=>'date_fin', 2=>'date_create', 3=>'date_valid', 4=>'date_approve', 5=>'date_refuse', 6=>'date_cancel'),
'leave'=>array(0=>'date_debut', 1=>'date_fin', 2=>'date_create', 3=>'date_valid', 5=>'date_refuse', 6=>'date_cancel')
'expensereport'=>array(0=>'date_debut', 1=>'date_fin', 2=>'date_create', 3=>'date_valid', 4=>'date_approve', 5=>'date_refuse', 6=>'date_cancel'),
'holiday'=>array(0=>'date_debut', 1=>'date_fin', 2=>'date_create', 3=>'date_valid', 5=>'date_refuse', 6=>'date_cancel')
);
$year=2010;

View File

@ -34,8 +34,8 @@ $action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$codeventil = GETPOST('codeventil');
$id = GETPOST('id');
$codeventil = GETPOST('codeventil', 'int');
$id = GETPOST('id', 'int');
// Security check
if ($user->socid > 0)

View File

@ -38,8 +38,8 @@ $action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$codeventil = GETPOST('codeventil');
$id = GETPOST('id');
$codeventil = GETPOST('codeventil', 'int');
$id = GETPOST('id', 'int');
// Security check
if ($user->socid > 0)

View File

@ -38,8 +38,8 @@ $action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$codeventil = GETPOST('codeventil');
$id = GETPOST('id');
$codeventil = GETPOST('codeventil', 'int');
$id = GETPOST('id', 'int');
// Security check
if ($user->socid > 0)

View File

@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php';
$id = GETPOST('id');
$id = GETPOST('id', 'int');
// Load translation files required by the page
$langs->load("mails");

View File

@ -4080,16 +4080,19 @@ class Facture extends CommonInvoice
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Create a withdrawal request for a standing order.
* Create a withdrawal request for a direct debit order or a credit transfer order.
* Use the remain to pay excluding all existing open direct debit requests.
*
* @param User $fuser User asking the direct debit transfer
* @param float $amount Amount we request direct debit for
* @return int <0 if KO, >0 if OK
* @param User $fuser User asking the direct debit transfer
* @param float $amount Amount we request direct debit for
* @param string $type 'direct-debit' or 'bank-transfer'
* @param string $sourcetype Source ('facture' or 'supplier_invoice')
* @return int <0 if KO, >0 if OK
*/
public function demande_prelevement($fuser, $amount = 0)
public function demande_prelevement($fuser, $amount = 0, $type = 'direct-debit', $sourcetype = 'facture')
{
// phpcs:enable
global $conf;
$error = 0;
@ -4103,7 +4106,12 @@ class Facture extends CommonInvoice
$sql = 'SELECT count(*)';
$sql .= ' FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande';
$sql .= ' WHERE fk_facture = '.$this->id;
if ($type == 'bank-transfer') {
$sql .= ' WHERE fk_facture_fourn = '.$this->id;
} else {
$sql .= ' WHERE fk_facture = '.$this->id;
}
$sql .= ' AND ext_payment_id IS NULL'; // To exclude record done for some online payments
$sql .= ' AND traite = 0';
dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG);
@ -4128,16 +4136,24 @@ class Facture extends CommonInvoice
if (is_numeric($amount) && $amount != 0)
{
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande';
$sql .= ' (fk_facture, amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib)';
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande(';
if ($type == 'bank-transfer') {
$sql .= 'fk_facture_fourn, ';
} else {
$sql .= 'fk_facture, ';
}
$sql .= ' amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib, sourcetype, entity)';
$sql .= ' VALUES ('.$this->id;
$sql .= ",'".price2num($amount)."'";
$sql .= ",'".$this->db->idate($now)."'";
$sql .= ",".$fuser->id;
$sql .= ",'".$bac->code_banque."'";
$sql .= ",'".$bac->code_guichet."'";
$sql .= ",'".$bac->number."'";
$sql .= ",'".$bac->cle_rib."')";
$sql .= ",'".$this->db->escape($bac->code_banque)."'";
$sql .= ",'".$this->db->escape($bac->code_guichet)."'";
$sql .= ",'".$this->db->escape($bac->number)."'";
$sql .= ",'".$this->db->escape($bac->cle_rib)."'";
$sql .= ",'".$this->db->escape($sourcetype)."'";
$sql .= ",".$conf->entity;
$sql .= ")";
dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG);
$resql = $this->db->query($sql);

View File

@ -381,7 +381,7 @@ elseif ($massaction == 'withdrawrequest')
foreach ($listofbills as $aBill)
{
$db->begin();
$result = $aBill->demande_prelevement($user, $aBill->resteapayer);
$result = $aBill->demande_prelevement($user, $aBill->resteapayer, 'direct-debit', 'facture');
if ($result > 0)
{
$db->commit();

View File

@ -24,7 +24,7 @@
/**
* \file htdocs/compta/facture/prelevement.php
* \ingroup facture
* \brief Management of direct debit order of invoices
* \brief Management of direct debit order or credit tranfer of invoices
*/
require '../../main.inc.php';
@ -83,7 +83,13 @@ if (empty($reshook))
{
$db->begin();
$result = $object->demande_prelevement($user, GETPOST('withdraw_request_amount'));
$newtype = $type;
$sourcetype = 'facture';
if ($type == 'bank-transfer') {
$sourcetype = 'supplier_invoice';
}
$result = $object->demande_prelevement($user, price2num(GETPOST('withdraw_request_amount', 'alpha')), $newtype, $sourcetype);
if ($result > 0)
{
$db->commit();
@ -103,7 +109,7 @@ if (empty($reshook))
{
if ($object->id > 0)
{
$result = $object->demande_prelevement_delete($user, GETPOST('did'));
$result = $object->demande_prelevement_delete($user, GETPOST('did', 'int'));
if ($result == 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
@ -199,6 +205,7 @@ if ($object->id > 0)
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref .= '<input type="hidden" name="type" value="'.$type.'">';
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref .= '</form>';
@ -508,6 +515,7 @@ if ($object->id > 0)
$sql .= " WHERE fk_facture = ".$object->id;
}
$sql .= " AND pfd.traite = 0";
$sql .= " AND pfd.ext_payment_id IS NULL";
$sql .= " ORDER BY pfd.date_demande DESC";
$result_sql = $db->query($sql);
@ -531,6 +539,7 @@ if ($object->id > 0)
$sql .= " WHERE fk_facture = ".$object->id;
}
$sql .= " AND pfd.traite = 0";
$sql .= " AND pfd.ext_payment_id IS NULL";
$result_sql = $db->query($sql);
if ($result_sql)
@ -623,6 +632,7 @@ if ($object->id > 0)
$sql .= " WHERE fk_facture = ".$object->id;
}
$sql .= " AND pfd.traite = 0";
$sql .= " AND pfd.ext_payment_id IS NULL";
$sql .= " ORDER BY pfd.date_demande DESC";
$result_sql = $db->query($sql);
@ -677,6 +687,7 @@ if ($object->id > 0)
$sql .= " WHERE fk_facture = ".$object->id;
}
$sql .= " AND pfd.traite = 1";
$sql .= " AND pfd.ext_payment_id IS NULL";
$sql .= " ORDER BY pfd.date_demande DESC";
$result = $db->query($sql);

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('bills', 'companies'));
$id = GETPOST('id');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');

View File

@ -197,7 +197,13 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha'))
// Because if we put the documents directory into a directory inside web root (very bad), this allows to execute on demand arbitrary code.
if (isAFileWithExecutableContent($filenameto) && empty($conf->global->MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED))
{
$filenameto .= '.noexe';
// $upload_dir ends with a slash, so be must be sure the medias dir to compare to ends with slash too.
$publicmediasdirwithslash = $conf->medias->multidir_output[$conf->entity];
if (! preg_match('/\/$/', $publicmediasdirwithslash)) $publicmediasdirwithslash.='/';
if (strpos($upload_dir, $publicmediasdirwithslash) !== 0) { // We never add .noexe on files into media directory
$filenameto .= '.noexe';
}
}
if ($filenamefrom && $filenameto)

View File

@ -8340,7 +8340,9 @@ abstract class CommonObject
break;
}
} else {
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $table . ' WHERE ' . $this->fk_element . ' = ' . $this->id;
// Delete record in child table
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $table . ' WHERE ' . $this->fk_element . ' = ' . $this->id;
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
@ -8420,7 +8422,11 @@ abstract class CommonObject
$error++;
$this->errors[] = $this->error;
} else {
$result = $this->delete($user);
if (get_class($this) == 'Contact') { // TODO special code because delete() for contact has not been standardized like other delete.
$result = $this->delete();
} else {
$result = $this->delete($user);
}
if ($result < 0) {
$error++;
$this->errors[] = $this->error;

View File

@ -987,12 +987,12 @@ class FormTicket
print '</td></tr>';
}
// MESSAGE
$defaultmessage = "";
if (is_array($arraydefaultmessage) && count($arraydefaultmessage) > 0 && $arraydefaultmessage->content) {
// MESSAGE
$defaultmessage="";
if (is_object($arraydefaultmessage) && $arraydefaultmessage->content) {
$defaultmessage = $arraydefaultmessage->content;
}
$defaultmessage = str_replace('\n', "\n", $defaultmessage);
$defaultmessage = str_replace('\n', "\n", $defaultmessage);
// Deal with format differences between message and signature (text / HTML)
if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) {

View File

@ -1453,7 +1453,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$langs->load("mails");
$sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type";
$sql2 .= ", '' as fk_element, '' as elementtype, '' as contact_id";
$sql2 .= ", null as fk_element, '' as elementtype, null as contact_id";
$sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto";
$sql2 .= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action
if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql2 .= ", '' as lastname, '' as firstname";

View File

@ -1008,10 +1008,11 @@ 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
* @param string $upload_dir For information. Already included into $dest_file.
* @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')
function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan = 0, $uploaderrorcode = 0, $nohook = 0, $varfiles = 'addedfile', $upload_dir = '')
{
global $conf, $db, $user, $langs;
global $object, $hookmanager;
@ -1068,8 +1069,14 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
// Because if we put the documents directory into a directory inside web root (very bad), this allows to execute on demand arbitrary code.
if (isAFileWithExecutableContent($dest_file) && empty($conf->global->MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED))
{
$file_name .= '.noexe';
$successcode = 2;
// $upload_dir ends with a slash, so be must be sure the medias dir to compare to ends with slash too.
$publicmediasdirwithslash = $conf->medias->multidir_output[$conf->entity];
if (! preg_match('/\/$/', $publicmediasdirwithslash)) $publicmediasdirwithslash.='/';
if (strpos($upload_dir, $publicmediasdirwithslash) !== 0) { // We never add .noexe on files into media directory
$file_name .= '.noexe';
$successcode = 2;
}
}
// Security:
@ -1580,7 +1587,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
$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);
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles, $upload_dir);
if (is_numeric($resupload) && $resupload > 0) // $resupload can be 'ErrorFileAlreadyExists'
{

View File

@ -62,6 +62,7 @@ function facture_prepare_head($object)
$sql = "SELECT COUNT(pfd.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
$sql .= " WHERE pfd.fk_facture = ".$object->id;
$sql .= " AND pfd.ext_payment_id IS NULL";
$resql = $db->query($sql);
if ($resql)
{

View File

@ -427,7 +427,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
$langs->load("mails");
$sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type";
$sql2 .= ", '' as fk_element, '' as elementtype, '' as contact_id";
$sql2 .= ", null as fk_element, '' as elementtype, null as contact_id";
$sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto";
$sql2 .= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action
if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql2 .= ", '' as lastname, '' as firstname";

View File

@ -220,7 +220,7 @@ class modContrat extends DolibarrModules
*/
public function init($options = '')
{
global $conf;
global $conf, $langs;
// Nettoyage avant activation
$this->remove($options);

View File

@ -67,7 +67,7 @@ class EcmFiles extends CommonObject
*/
public $entity;
public $filename;
public $filename; // Note: Into ecm database record, the entry $filename never ends with .noexe
public $filepath;
public $fullpath_orig;

View File

@ -928,7 +928,7 @@ if ($id > 0 || !empty($ref)) {
</script>';
// List of lines already dispatched
$sql = "SELECT p.ref, p.label,";
$sql = "SELECT p.rowid as pid, p.ref, p.label,";
$sql .= " e.rowid as warehouse_id, e.ref as entrepot,";
$sql .= " cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec";
if ($conf->reception->enabled)$sql .= " ,cfd.fk_reception, r.date_delivery";
@ -1005,9 +1005,18 @@ if ($id > 0 || !empty($ref)) {
print '<td>'.dol_print_date($db->jdate($objp->date_delivery), 'day').'</td>';
if (!empty($conf->productbatch->enabled)) {
print '<td class="dispatch_batch_number">'.$objp->batch.'</td>';
print '<td class="dispatch_dluo">'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
print '<td class="dispatch_dlc">'.dol_print_date($db->jdate($objp->sellby), 'day').'</td>';
if ($objp->batch) {
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
$lot=new Productlot($db);
$lot->fetch(0, $objp->pid, $objp->batch);
print '<td class="dispatch_batch_number">'.$lot->getNomUrl(1).'</td>';
print '<td class="dispatch_dluo">'.dol_print_date($lot->eatby, 'day').'</td>';
print '<td class="dispatch_dlc">'.dol_print_date($lot->sellby, 'day').'</td>';
} else {
print '<td class="dispatch_batch_number"></td>';
print '<td class="dispatch_dluo"></td>';
print '<td class="dispatch_dlc"></td>';
}
}
// Qty

View File

@ -44,6 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
if (!empty($conf->product->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
}
if (!empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';

View File

@ -307,4 +307,8 @@ ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN hostcharset varchar(16)
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';
UPDATE llx_prelevement_facture_demande SET entity = 1 WHERE entity IS NULL;
ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture (fk_facture);
ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture_fourn (fk_facture_fourn);

View File

@ -0,0 +1,22 @@
-- ===================================================================
-- Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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 <https://www.gnu.org/licenses/>.
--
-- ===================================================================
ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture (fk_facture);
ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture_fourn (fk_facture_fourn);

View File

@ -1983,7 +1983,7 @@ SmallerThan=Smaller than
LargerThan=Larger than
IfTrackingIDFoundEventWillBeLinked=Note that If a tracking ID is found into incoming email, the event will be automatically linked to the related objects.
WithGMailYouCanCreateADedicatedPassword=With a GMail account, if you enabled the 2 steps validation, it is recommanded to create a dedicated second password for the application instead of using your own account passsword from https://myaccount.google.com/.
EmailCollectorTargetDir=It may be a desired behaviour to move the email into another tag/directory when it was processed successfully. Just set a value here to use this feature. Note that you must also use a read/write login account.
EmailCollectorTargetDir=It may be a desired behaviour to move the email into another tag/directory when it was processed successfully. Just set name of directory here to use this feature (Do NOT use special characters in name). Note that you must also use a read/write login account.
EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\s([^\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body.
EndPointFor=End point for %s : %s
DeleteEmailCollector=Delete email collector

View File

@ -43,3 +43,5 @@ ProductQtyInSuppliersReceptionAlreadyRecevied=Product quantity from open supplie
ValidateOrderFirstBeforeReception=You must first validate the order before being able to make receptions.
ReceptionsNumberingModules=Numbering module for receptions
ReceptionsReceiptModel=Document templates for receptions
NoMorePredefinedProductToDispatch=No more predefined products to dispatch

View File

@ -109,8 +109,8 @@ if (empty($reshook))
'memcached', 'numberwords', 'zipautofillfr');
$alwayshiddenuncheckedmodules = array('dav', 'debugbar', 'emailcollector', 'ftp', 'hrm', 'modulebuilder', 'printing', 'webservicesclient',
// Extended modules
'awstats', 'bittorrent', 'bootstrap', 'cabinetmed', 'cmcic', 'concatpdf', 'customfield', 'deplacement', 'dolicloud', 'filemanager', 'lightbox', 'mantis', 'monitoring', 'moretemplates', 'multicompany', 'nltechno', 'numberingpack', 'openstreetmap',
'ovh', 'phenix', 'phpsysinfo', 'pibarcode', 'postnuke', 'selectbank', 'skincoloreditor', 'submiteverywhere', 'survey', 'thomsonphonebook', 'topten', 'tvacerfa', 'voyage', 'webcalendar', 'webmail');
'awstats', 'bittorrent', 'bootstrap', 'cabinetmed', 'cmcic', 'concatpdf', 'customfield', 'datapolicy', 'deplacement', 'dolicloud', 'filemanager', 'lightbox', 'mantis', 'monitoring', 'moretemplates', 'multicompany', 'nltechno', 'numberingpack', 'openstreetmap',
'ovh', 'phenix', 'phpsysinfo', 'pibarcode', 'postnuke', 'dynamicprices', 'receiptprinter', 'selectbank', 'skincoloreditor', 'submiteverywhere', 'survey', 'thomsonphonebook', 'topten', 'tvacerfa', 'voyage', 'webcalendar', 'webmail');
}
// Search modules

View File

@ -19,6 +19,7 @@ This page is a sample of page using Dolibarr HTML widget methods. It is designed
- css (add parameter &amp;theme=newtheme to test another theme or edit css of current theme)<br>
- jmobile (add parameter <a class="wordbreak" href="<?php echo $_SERVER["PHP_SELF"].'?dol_use_jmobile=1&dol_optimize_smallscreen=1'; ?>">dol_use_jmobile=1&amp;dol_optimize_smallscreen=1</a> and switch to small screen < 570 to enable with emulated jmobile)<br>
- no javascript / usage for bind people (add parameter <a class="wordbreak" href="<?php echo $_SERVER["PHP_SELF"].'?nojs=1'; ?>">nojs=1</a> to force disable javascript)<br>
- use with a text browser (add parameter <a class="wordbreak" href="<?php echo $_SERVER["PHP_SELF"].'?textbrowser=1'; ?>">textbrowser=1</a> to force detection of a text browser)<br>
</h2>
<br>

View File

@ -55,7 +55,7 @@ class Societe extends CommonObject
public $table_element = 'societe';
/**
* @var int Field with ID of parent key if this field has a parent
* @var int Field with ID of parent key if this field has a parent or for child tables
*/
public $fk_element = 'fk_soc';

View File

@ -174,15 +174,15 @@ input {
padding-left: 5px;
}
select {
padding-top: 4px;
padding-top: 5px;
padding-right: 4px;
padding-bottom: 3px;
padding-bottom: 5px;
padding-left: 2px;
}
input, select {
margin-left:0px;
margin-bottom:1px;
margin-top:1px;
margin-left: 0px;
margin-bottom: 1px;
margin-top: 1px;
}
#mainbody input.button:not(.buttongen):not(.bordertransp) {
background: var(--butactionbg);

View File

@ -28,9 +28,9 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
}
.info-box-more {
float: right;
top: 6px;
top: 5px;
position: absolute;
right: 10px;
right: 8px;
}
.info-box small {
@ -385,6 +385,16 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
min-width: 350px;
max-width: 350px;
}
.info-box-title {
width: calc(100% - 20px);
}
@media only screen and (max-width: 767px) {
.info-box-module {
min-width: 260px;
}
}
.info-box-module .info-box-content {
height: 6.4em;
}

View File

@ -124,7 +124,7 @@ div.mainmenu.tools::before {
}
div.mainmenu.website::before {
content: "\f542";
content: "\f57d";
}
div.mainmenu.generic1::before {

View File

@ -2377,8 +2377,9 @@ class Ticket extends CommonObject
// If destination file already exists, we add a suffix to avoid to overwrite
if (is_file($destfile))
{
$pathinfo = pathinfo($filename[$i]);
$now = dol_now();
$destfile .= '.'.dol_print_date($now, 'dayhourlog');
$destfile = $destdir.'/'.$pathinfo['filename'].' - '.dol_print_date($now, 'dayhourlog').'.'.$pathinfo['extension'];
}
$res = dol_move($filepath[$i], $destfile, 0, 1);

View File

@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttributeValue.class.php'
header('Content-Type: application/json');
$id = GETPOST('id');
$id = GETPOST('id', 'int');
if (!$id) {
print json_encode(array(

View File

@ -263,7 +263,7 @@ if ($action == 'edit') {
<td><?php echo dol_htmlentities($attrval->ref) ?></td>
<td><?php echo dol_htmlentities($attrval->value) ?></td>
<td class="right">
<a href="card.php?id=<?php echo $object->id ?>&action=edit_value&valueid=<?php echo $attrval->id ?>"><?php echo img_edit() ?></a>
<a class="editfielda marginrightonly" href="card.php?id=<?php echo $object->id ?>&action=edit_value&valueid=<?php echo $attrval->id ?>"><?php echo img_edit() ?></a>
<a href="card.php?id=<?php echo $object->id ?>&action=delete_value&valueid=<?php echo $attrval->id ?>"><?php echo img_delete() ?></a>
</td>
<?php

View File

@ -126,8 +126,8 @@ foreach ($variants as $key => $attribute) {
print '<td class="right">'.$attribute->countChildValues().'</td>';
print '<td class="right">'.$attribute->countChildProducts().'</td>';
print '<td class="right">';
print '<a href="card.php?id='.$attribute->id.'&action=edit">'.img_edit().'</a>';
print '<a href="card.php?id='.$attribute->id.'&action=delete">'.img_delete().'</a>';
print '<a class="editfielda marginrightonly paddingleftonly" href="card.php?id='.$attribute->id.'&action=edit">'.img_edit().'</a>';
print '<a class="marginrightonly paddingleftonlyhref="card.php?id='.$attribute->id.'&action=delete">'.img_delete().'</a>';
print '</td>';
print '<td class="center linecolmove tdlineupdown">';
if ($key > 0) {

View File

@ -1013,7 +1013,7 @@ class Website extends CommonObject
fputs($fp, $line);
// Warning: We must keep llx_ here. It is a generic SQL.
$line = 'INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content)';
$line = 'INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias)';
$line .= " VALUES(";
$line .= $objectpageold->newid."__+MAX_llx_website_page__, ";
@ -1057,7 +1057,8 @@ class Website extends CommonObject
// When we have a link src="image/websiteref/file.png" into html content
$stringtoexport = str_replace('="image/'.$website->ref.'/', '="image/__WEBSITE_KEY__/', $stringtoexport);
$line .= "'".$this->db->escape($stringtoexport)."'"; // Replace \r \n to have record on 1 line
$line .= "'".$this->db->escape($stringtoexport)."', "; // Replace \r \n to have record on 1 line
$line .= "'".$this->db->escape($objectpageold->author_alias)."'";
$line .= ");";
$line .= "\n";
fputs($fp, $line);
@ -1080,7 +1081,7 @@ class Website extends CommonObject
// Build zip file
$filedir = $conf->website->dir_temp.'/'.$website->ref.'/.';
$fileglob = $conf->website->dir_temp.'/'.$website->ref.'/website_'.$website->ref.'-*.zip';
$filename = $conf->website->dir_temp.'/'.$website->ref.'/website_'.$website->ref.'-'.dol_print_date(dol_now(), 'dayhourlog').'.zip';
$filename = $conf->website->dir_temp.'/'.$website->ref.'/website_'.$website->ref.'-'.dol_print_date(dol_now(), 'dayhourlog').'-V'.((float) DOL_VERSION).'.zip';
dol_delete_file($fileglob, 0);
$result = dol_compress_file($filedir, $filename, 'zip');

View File

@ -173,9 +173,9 @@ class WebsitePage extends CommonObject
//public $table_element_line = 'mymodule_myobjectline';
/**
* @var int Field with ID of parent key if this object has a parent
* @var int Field with ID of parent key if this field has a parent or for child tables
*/
public $fk_element = 'fk_website';
public $fk_element = 'fk_website_page';
/**
* @var int Name of subtable class that manage subtable lines
@ -573,7 +573,7 @@ class WebsitePage extends CommonObject
if (!$error) {
$result = $this->deleteCommon($user, $trigger);
if ($result > 0)
if ($result <= 0)
{
$error++;
}
@ -594,10 +594,17 @@ class WebsitePage extends CommonObject
dol_delete_file($filealias);
dol_delete_file($filetpl);
} else {
$this->error = $websiteobj->error;
$this->errors = $websiteobj->errors;
}
}
return $result;
if (! $error) {
return 1;
} else {
return -1;
}
}
/**

View File

@ -85,7 +85,6 @@ if (GETPOST('createfromclone', 'alpha')) { $action = 'createfromclone'; }
if (GETPOST('createpagefromclone', 'alpha')) { $action = 'createpagefromclone'; }
if (empty($action) && $file_manager) $action = 'file_manager';
if (empty($action) && $replacesite) $action = 'replacesite';
if (GETPOST('refreshsite') || GETPOST('refreshsite_x') || GETPOST('refreshsite.x')) $pageid = 0;
// Load variable for pagination
@ -209,7 +208,7 @@ $permtouploadfile = $user->rights->website->write;
$diroutput = $conf->medias->multidir_output[$conf->entity];
$relativepath = $section_dir;
$upload_dir = $diroutput.'/'.$relativepath;
$upload_dir = preg_replace('/\/$/', '', $diroutput).'/'.preg_replace('/^\//', '', $relativepath);
$htmlheadercontentdefault = '';
$htmlheadercontentdefault .= '<link rel="stylesheet" id="google-fonts-css" href="//fonts.googleapis.com/css?family=Open+Sans:300,400,700" />'."\n";