mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-04 16:12:39 +01:00
Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -1119,34 +1119,39 @@ if ($action == 'edit') {
|
||||
}
|
||||
|
||||
// Test DNS entry for emails
|
||||
foreach (array('SPF', 'DMARC') as $dnstype) {
|
||||
foreach ($domainstotest as $domaintotest => $listofemails) {
|
||||
$dnsinfo = false;
|
||||
$foundforemail = 0;
|
||||
if (!empty($domaintotest) && function_exists('dns_get_record') && !getDolGlobalString('MAIN_DISABLE_DNS_GET_RECORD')) {
|
||||
$domain = $domaintotest;
|
||||
if ($dnstype == 'DMARC') {
|
||||
$domain = '_dmarc.'.$domain;
|
||||
if ($action == 'testsetup') {
|
||||
foreach (array('SPF', 'DMARC') as $dnstype) {
|
||||
foreach ($domainstotest as $domaintotest => $listofemails) {
|
||||
$dnsinfo = false;
|
||||
$foundforemail = 0;
|
||||
if (!empty($domaintotest) && function_exists('dns_get_record') && !getDolGlobalString('MAIN_DISABLE_DNS_GET_RECORD')) {
|
||||
$domain = $domaintotest;
|
||||
if ($dnstype == 'DMARC') {
|
||||
$domain = '_dmarc.'.$domain;
|
||||
}
|
||||
$dnsinfo = dns_get_record($domain, DNS_TXT);
|
||||
}
|
||||
$dnsinfo = dns_get_record($domain, DNS_TXT);
|
||||
}
|
||||
if (!empty($dnsinfo) && is_array($dnsinfo)) {
|
||||
foreach ($dnsinfo as $info) {
|
||||
if (($dnstype == 'SPF' && stripos($info['txt'], 'v=spf') !== false)
|
||||
|| ($dnstype == 'DMARC' && stripos($info['txt'], 'v=dmarc') !== false)) {
|
||||
$foundforemail++;
|
||||
$text .= ($text ? '<br>' : '').'- '.$langs->trans("ActualMailDNSRecordFound", '<b>'.$dnstype.'</b>', '<b>'.implode(', ', $listofemails).'</b>', '<span class="opacitylow">'.$info['txt'].'</span>');
|
||||
if (!empty($dnsinfo) && is_array($dnsinfo)) {
|
||||
foreach ($dnsinfo as $info) {
|
||||
if (($dnstype == 'SPF' && stripos($info['txt'], 'v=spf') !== false)
|
||||
|| ($dnstype == 'DMARC' && stripos($info['txt'], 'v=dmarc') !== false)) {
|
||||
$foundforemail++;
|
||||
$text .= ($text ? '<br>' : '').'- '.$langs->trans("ActualMailDNSRecordFound", '<b>'.$dnstype.'</b>', '<b>'.implode(', ', $listofemails).'</b>', '<span class="opacitylow">'.$info['txt'].'</span>');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$foundforemail) {
|
||||
$text .= ($text ? '<br>' : '').'- '.$langs->trans("ActualMailDNSRecordFound", '<b>'.$dnstype.'</b>', '<b>'.implode(', ', $listofemails).'</b>', '<span class="opacitymedium">'.$langs->transnoentitiesnoconv("None").'</span>');
|
||||
if (!$foundforemail) {
|
||||
$text .= ($text ? '<br>' : '').'- '.$langs->trans("ActualMailDNSRecordFound", '<b>'.$dnstype.'</b>', '<b>'.implode(', ', $listofemails).'</b>', '<span class="opacitymedium">'.$langs->transnoentitiesnoconv("None").'</span>');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($text) {
|
||||
print info_admin($langs->trans("SPFAndDMARCInformation").' :<br>'.$text, 0, 0, '1', '');
|
||||
if ($text) {
|
||||
print info_admin($langs->trans("SPFAndDMARCInformation").' :<br>'.$text, 0, 0, '1', '');
|
||||
}
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=testsetup">'.$langs->trans("ClickHereToCheckSPFDMARCForSetup").'</a>';
|
||||
print '<br><br>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2312,24 +2312,20 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
$arrayforbutaction = array();
|
||||
if ($object->nbofservicesclosed > 0 || $object->nbofserviceswait > 0) {
|
||||
$arrayforbutaction[] = array(
|
||||
'url' => '/contrat/card.php?id='.$object->id.'&action=activate&token='.newToken(),
|
||||
'label' => $langs->trans('ActivateAllContracts'),
|
||||
'lang' => 'bills',
|
||||
'perm' => $permissiontoactivate,
|
||||
'enabled' => true,
|
||||
);
|
||||
}
|
||||
if ($object->nbofservicesclosed < $nbofservices) {
|
||||
$arrayforbutaction[] = array(
|
||||
'url' => '/contrat/card.php?id='.$object->id.'&action=close&token='.newToken(),
|
||||
'label' => $langs->trans('CloseAllContracts'),
|
||||
'lang' => 'bills',
|
||||
'perm' => $permissiontodisable,
|
||||
'enabled' => true,
|
||||
);
|
||||
}
|
||||
$arrayforbutaction[] = array(
|
||||
'url' => '/contrat/card.php?id='.$object->id.'&action=activate&token='.newToken(),
|
||||
'label' => $langs->trans('ActivateAllContracts'),
|
||||
'lang' => 'bills',
|
||||
'perm' => ($object->nbofservicesclosed > 0 || $object->nbofserviceswait > 0) ? $permissiontoactivate : -1,
|
||||
'enabled' => true,
|
||||
);
|
||||
$arrayforbutaction[] = array(
|
||||
'url' => '/contrat/card.php?id='.$object->id.'&action=close&token='.newToken(),
|
||||
'label' => $langs->trans('CloseAllContracts'),
|
||||
'lang' => 'bills',
|
||||
'perm' => ($object->nbofservicesclosed < $nbofservices) ? $permissiontodisable : -1,
|
||||
'enabled' => true,
|
||||
);
|
||||
|
||||
if (count($arrayforbutaction)) {
|
||||
unset($params['attr']['title']);
|
||||
|
||||
@@ -72,6 +72,8 @@ class box_services_expired extends ModeleBoxes
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxLastExpiredServices", $max));
|
||||
|
||||
if ($user->hasRight('contrat', 'lire')) {
|
||||
$langs->load("contracts");
|
||||
|
||||
// Select contracts with at least one expired service
|
||||
$sql = "SELECT ";
|
||||
$sql .= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.ref_customer, c.ref_supplier,";
|
||||
@@ -123,6 +125,7 @@ class box_services_expired extends ModeleBoxes
|
||||
$contract->id = $objp->rowid;
|
||||
$contract->ref = $objp->ref;
|
||||
$contract->statut = $objp->fk_statut;
|
||||
$contract->status = $objp->fk_statut;
|
||||
$contract->ref_customer = $objp->ref_customer;
|
||||
$contract->ref_supplier = $objp->ref_supplier;
|
||||
|
||||
|
||||
@@ -2042,13 +2042,13 @@ class ExtraFields
|
||||
/**
|
||||
* Return HTML string to put an output field into a page
|
||||
*
|
||||
* @param string $key Key of attribute
|
||||
* @param string $value Value to show
|
||||
* @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering)
|
||||
* @param string $extrafieldsobjectkey Required (for example $object->table_element).
|
||||
* @param Translate|null $outputlangs Output
|
||||
* @param CommonObject $object The parent object of field to show
|
||||
* @return string Formatted value
|
||||
* @param string $key Key of attribute
|
||||
* @param string $value Value to show
|
||||
* @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering)
|
||||
* @param string $extrafieldsobjectkey Required (for example $object->table_element).
|
||||
* @param Translate|null $outputlangs Output
|
||||
* @param CommonObject|null $object The parent object of field to show
|
||||
* @return string Formatted value
|
||||
*/
|
||||
public function showOutputField($key, $value, $moreparam = '', $extrafieldsobjectkey = '', $outputlangs = null, $object = null)
|
||||
{
|
||||
|
||||
@@ -2898,9 +2898,10 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0
|
||||
* @param int $limittoshow Limit number of tabs to show. Use 0 to use automatic default value.
|
||||
* @param string $moretabssuffix A suffix to use when you have several dol_get_fiche_head() in same page
|
||||
* @param int $dragdropfile 0 (default) or 1. 1 enable a drop zone for file to be upload, 0 disable it
|
||||
* @param string $morecssdiv More CSS on the div
|
||||
* @return string
|
||||
*/
|
||||
function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab = 0, $picto = '', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limittoshow = 0, $moretabssuffix = '', $dragdropfile = 0)
|
||||
function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab = 0, $picto = '', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limittoshow = 0, $moretabssuffix = '', $dragdropfile = 0, $morecssdiv = '')
|
||||
{
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
@@ -3060,8 +3061,9 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
|
||||
}
|
||||
|
||||
if (!$notab || $notab == -1 || $notab == -2 || $notab == -3 || $notab == -4) {
|
||||
$out .= "\n" . '<div id="dragDropAreaTabBar" class="tabBar' . ($notab == -1 ? '' : ($notab == -2 ? ' tabBarNoTop' : ((($notab == -3 || $notab == -4) ? ' noborderbottom' : '') . ($notab == -4 ? '' : ' tabBarWithBottom'))));
|
||||
$out .= '">' . "\n";
|
||||
$out .= "\n".'<div id="dragDropAreaTabBar" class="tabBar'.($notab == -1 ? '' : ($notab == -2 ? ' tabBarNoTop' : ((($notab == -3 || $notab == -4) ? ' noborderbottom' : '').($notab == -4 ? '' : ' tabBarWithBottom'))));
|
||||
$out .= ($morecssdiv ? ' '.$morecssdiv : '');
|
||||
$out .= '">'."\n";
|
||||
}
|
||||
if (!empty($dragdropfile)) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
@@ -13959,17 +13961,15 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
||||
* @param string $label Label or tooltip of button if $text is provided. Also used as tooltip in title attribute. Can be escaped HTML content or full simple text.
|
||||
* @param string $text Optional : short label on button. Can be escaped HTML content or full simple text.
|
||||
* @param string $actionType 'default', 'danger', 'email', 'clone', 'cancel', 'delete', ...
|
||||
*
|
||||
* @param string|array<int,array{lang:string,enabled:bool,perm:bool,label:string,url:string,urlroot?:string,isDropDown?:int<0,1>}> $url Url for link or array of subbutton description
|
||||
*
|
||||
* Example when an array is used:
|
||||
* $arrayforbutaction = array(
|
||||
* 10 => array('attr' => array('class'=>''), 'lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
* 20 => array('attr' => array('class'=>''), 'lang'=>'mymodule', 'enabled'=>isModEnabled("mymodule"), 'perm'=>$user->hasRight('mymodule', 'write'), 'label' => 'MyModuleAction', 'urlroot'=>dol_build_patch('/mymodule/mypage.php?action=create')),
|
||||
* 30 => array('attr' => array('class'=>''), 'lang'=>'mymodule', 'enabled'=>isModEnabled("mymodule"), 'perm'=>$user->hasRight('mymodule', 'write'), 'label' => 'MyModuleOtherAction', 'urlraw' => '# || external Url || javascript: || tel: || mailto:' ),
|
||||
* ); );
|
||||
* @param string|array<int,array{lang:string,enabled:bool,perm:bool|int,label:string,url:string,urlroot?:string,isDropDown?:int<0,1>}> $url Url for link or array of subbutton description
|
||||
* Example when an array is used:
|
||||
* $arrayforbutaction = array(
|
||||
* 10 => array('attr' => array('class'=>''), 'lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
* 20 => array('attr' => array('class'=>''), 'lang'=>'mymodule', 'enabled'=>isModEnabled("mymodule"), 'perm'=>$user->hasRight('mymodule', 'write'), 'label' => 'MyModuleAction', 'urlroot'=>dol_build_patch('/mymodule/mypage.php?action=create')),
|
||||
* 30 => array('attr' => array('class'=>''), 'lang'=>'mymodule', 'enabled'=>isModEnabled("mymodule"), 'perm'=>$user->hasRight('mymodule', 'write'), 'label' => 'MyModuleOtherAction', 'urlraw' => '# || external Url || javascript: || tel: || mailto:' ),
|
||||
* ); );
|
||||
* @param string $id Attribute id of action button. Example 'action-delete'. This can be used for full ajax confirm if this code is reused into the ->formconfirm() method.
|
||||
* @param int|boolean $userRight User action right. Use 0 if user has no permission. It will add the message "No permission" on tooltip. Use -1 to have button not allowed without adding the message (because an explicit label is already set).
|
||||
* @param bool|int $userRight User action right. Use 0 if user has no permission. It will add the message "No permission" on tooltip. Use -1 to have button not allowed without adding the message (because an explicit label is already set).
|
||||
* // phpcs:disable
|
||||
* @param array{confirm?:array{url?:string,title?:string,content?:string,use_unsecured_unescapedattr?:bool|string[],action-btn-label?:string,cancel-btn-label?:string,modal?:bool},attr?:array<string,mixed>,areDropdownButtons?:bool,backtopage?:string,lang?:string,enabled?:bool,perm?:int<0,1>,label?:string,url?:string,isDropdown?:int<0,1>,isDropDown?:int<0,1>} $params = [ // Various params for future : recommended rather than adding more function arguments
|
||||
* 'attr' => [ // to add or override button attributes
|
||||
@@ -13988,7 +13988,6 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
||||
* ],
|
||||
* ]
|
||||
* // phpcs:enable
|
||||
* Example: array('attr' => array('class' => 'reposition'))
|
||||
* @return string html button
|
||||
*/
|
||||
function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = '', $id = '', $userRight = 1, $params = array())
|
||||
@@ -15104,7 +15103,7 @@ function finishSimpleTable($addLineBreak = false)
|
||||
* @param integer $nbofloop (optional) The maximum count of rows thaht the table show (when it is zero (0) no summary line will show, expect "$noneWord" when $num === 0)
|
||||
* @param integer $total (optional) The total value thaht is shown after when the table has minimum of one entire
|
||||
* @param string $noneWord (optional) The word that is shown when the table has no entries ($num === 0)
|
||||
* @param boolean $extraRightColumn (optional) Add a additional column after the summary word and total number
|
||||
* @param bool $extraRightColumn (optional) Add a additional column after the summary word and total number
|
||||
* @return void
|
||||
*/
|
||||
function addSummaryTableLine($tableColumnCount, $num, $nbofloop = 0, $total = 0, $noneWord = "None", $extraRightColumn = false)
|
||||
|
||||
@@ -2399,8 +2399,8 @@ function colorStringToArray($stringcolor, $colorifnotfound = array(88, 88, 88))
|
||||
|
||||
/**
|
||||
* @param string $color the color you need to valid
|
||||
* @param boolean $allow_white in case of white isn't valid
|
||||
* @return boolean
|
||||
* @param bool $allow_white in case of white isn't valid
|
||||
* @return bool
|
||||
*/
|
||||
function colorValidateHex($color, $allow_white = true)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->code_null = 0;
|
||||
$this->code_null = 0; // 1=can be empty
|
||||
$this->code_modifiable = 1;
|
||||
$this->code_modifiable_invalide = 1;
|
||||
$this->code_modifiable_null = 1;
|
||||
@@ -239,10 +239,9 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
||||
* @param int<0,1> $thirdparty_type 0 = customer/prospect , 1 = supplier
|
||||
* @param string $type type of barcode (EAN, ISBN, ...)
|
||||
* @return int<-7,0> 0 if OK
|
||||
* -1 ErrorBadCustomerCodeSyntax
|
||||
* -2 ErrorCustomerCodeRequired
|
||||
* -3 ErrorCustomerCodeAlreadyUsed
|
||||
* -4 ErrorPrefixRequired
|
||||
* -1 ErrorBadProductCodeSyntax
|
||||
* -2 ErrorProductCodeRequired
|
||||
* -3 ErrorProductCodeAlreadyUsed
|
||||
* -7 ErrorBadClass
|
||||
*/
|
||||
public function verif($db, &$code, $product, $thirdparty_type, $type)
|
||||
@@ -258,10 +257,9 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
||||
|
||||
$result = 0;
|
||||
$code = strtoupper(trim($code));
|
||||
|
||||
if (empty($code) && $this->code_null && !getDolGlobalString('BARCODE_STANDARD_PRODUCT_MASK')) {
|
||||
if (empty($code) && $this->code_null) {
|
||||
$result = 0;
|
||||
} elseif (empty($code) && (!$this->code_null || getDolGlobalString('BARCODE_STANDARD_PRODUCT_MASK'))) {
|
||||
} elseif (empty($code) && !$this->code_null && getDolGlobalString('BARCODE_STANDARD_PRODUCT_MASK')) {
|
||||
$result = -2;
|
||||
} else {
|
||||
if ($this->verif_syntax($code, $type) >= 0) {
|
||||
@@ -345,6 +343,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
||||
|
||||
// Special case, if mask is on 12 digits instead of 13, we remove last char into code to test
|
||||
if (in_array($typefortest, array('EAN13', 'ISBN'))) { // We remove the CRC char not included into mask
|
||||
$reg = array();
|
||||
if (preg_match('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i', $mask, $reg)) {
|
||||
if (strlen($reg[1]) == 12) {
|
||||
$newcodefortest = substr($newcodefortest, 0, 12);
|
||||
|
||||
@@ -266,7 +266,6 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode
|
||||
* -1 ErrorBadCustomerCodeSyntax
|
||||
* -2 ErrorCustomerCodeRequired
|
||||
* -3 ErrorCustomerCodeAlreadyUsed
|
||||
* -4 ErrorPrefixRequired
|
||||
* -7 ErrorBadClass
|
||||
*/
|
||||
public function verif($db, &$code, $thirdparty, $thirdparty_type, $type)
|
||||
@@ -280,9 +279,9 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode
|
||||
$result = 0;
|
||||
$code = strtoupper(trim($code));
|
||||
|
||||
if (empty($code) && $this->code_null && !getDolGlobalString('BARCODE_STANDARD_THIRDPARTY_MASK')) {
|
||||
if (empty($code) && $this->code_null) {
|
||||
$result = 0;
|
||||
} elseif (empty($code) && (!$this->code_null || getDolGlobalString('BARCODE_STANDARD_THIRDPARTY_MASK'))) {
|
||||
} elseif (empty($code) && !$this->code_null && getDolGlobalString('BARCODE_STANDARD_THIRDPARTY_MASK')) {
|
||||
$result = -2;
|
||||
} else {
|
||||
if ($this->verif_syntax($code, $type) >= 0) {
|
||||
@@ -365,6 +364,7 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode
|
||||
|
||||
// Special case, if mask is on 12 digits instead of 13, we remove last char into code to test
|
||||
if (in_array($typefortest, array('EAN13', 'ISBN'))) { // We remove the CRC char not included into mask
|
||||
$reg = array();
|
||||
if (preg_match('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i', $mask, $reg)) {
|
||||
if (strlen($reg[1]) == 12) {
|
||||
$newcodefortest = substr($newcodefortest, 0, 12);
|
||||
|
||||
@@ -86,7 +86,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
|
||||
* @param TCPDF $pdf PDF reference
|
||||
* @param string $code code to print
|
||||
* @param string $encoding type of barcode
|
||||
* @param boolean $is2d true if 2d barcode
|
||||
* @param bool $is2d true if 2d barcode
|
||||
* @param float $x x position in user units
|
||||
* @param float $y y position in user units
|
||||
* @param float $w width in user units
|
||||
|
||||
@@ -899,36 +899,27 @@ if ($order_id > 0 || !empty($ref)) {
|
||||
print '<input type="hidden" name="origin" value="commande">';
|
||||
print '<input type="hidden" name="origin_id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="projectid" value="'.$object->fk_project.'">';
|
||||
//print '<table class="border centpercent">';
|
||||
|
||||
$langs->load("stocks");
|
||||
|
||||
//print '<tr>';
|
||||
print '<div class="center formconsumeproduce">';
|
||||
|
||||
if (isModEnabled('stock')) {
|
||||
//print '<td>';
|
||||
print $langs->trans("WarehouseSource");
|
||||
//print '</td>';
|
||||
//print '<td>';
|
||||
print $formproduct->selectWarehouses(!empty($object->warehouse_id) ? $object->warehouse_id : 'ifone', 'entrepot_id', '', 1, 0, 0, '', 0, 0, array(), 'minwidth200');
|
||||
print $formproduct->selectWarehouses(empty($object->warehouse_id) ? 'ifone' : $object->warehouse_id, 'entrepot_id', '', 1, 0, 0, $langs->trans("Any"), 0, 0, array(), 'minwidth200');
|
||||
if (count($formproduct->cache_warehouses) <= 0) {
|
||||
print ' '.$langs->trans("WarehouseSourceNotDefined").' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create">'.$langs->trans("AddOne").'</a>';
|
||||
}
|
||||
//print '</td>';
|
||||
}
|
||||
//print '<td class="center">';
|
||||
print '<input type="submit" class="butAction" named="save" value="'.$langs->trans("CreateShipment").'">';
|
||||
print '<input type="submit" class="butAction marginbottomonly margintoponly" name="save" value="'.$langs->trans("CreateShipment").'">';
|
||||
if ($toBeShippedTotal <= 0) {
|
||||
print ' '.img_warning($langs->trans("WarningNoQtyLeftToSend"));
|
||||
}
|
||||
//print '</td></tr>';
|
||||
|
||||
//print "</table>";
|
||||
print '<br><br>';
|
||||
print '</div>';
|
||||
print "</form>\n";
|
||||
|
||||
print '</div>';
|
||||
|
||||
$somethingshown = 1;
|
||||
} else {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans("CreateShipment").'</a>';
|
||||
|
||||
@@ -63,6 +63,7 @@ require_once $conffile;
|
||||
* @var string $dolibarr_main_db_encryption
|
||||
* @var string $dolibarr_main_db_encrypted_pass
|
||||
* @var string $dolibarr_main_db_cryptkey
|
||||
* @var string $dolibarr_main_document_root
|
||||
*/
|
||||
require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
|
||||
|
||||
@@ -88,16 +89,6 @@ $ignoredbversion = (GETPOST('ignoredbversion', 'alpha', 3) == 'ignoredbversion')
|
||||
|
||||
$langs->loadLangs(array("admin", "install", "other", "errors"));
|
||||
|
||||
if ($dolibarr_main_db_type == "mysqli") {
|
||||
$choix = 1;
|
||||
}
|
||||
if ($dolibarr_main_db_type == "pgsql") {
|
||||
$choix = 2;
|
||||
}
|
||||
if ($dolibarr_main_db_type == "mssql") {
|
||||
$choix = 3;
|
||||
}
|
||||
|
||||
|
||||
dolibarr_install_syslog("--- upgrade: entering upgrade.php page ".$versionfrom." ".$versionto);
|
||||
if (!is_object($conf)) {
|
||||
@@ -135,12 +126,11 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
|
||||
print '<span class="inline-block valignmiddle">'.$langs->trans("DatabaseMigration").'</span></h3>';
|
||||
|
||||
print '<table cellspacing="0" cellpadding="1" class="centpercent">';
|
||||
$error = 0;
|
||||
|
||||
// If password is encoded, we decode it
|
||||
if ((!empty($dolibarr_main_db_pass) && preg_match('/(crypted|dolcrypt):/i', (string) $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) {
|
||||
require_once $dolibarr_main_document_root.'/core/lib/security.lib.php';
|
||||
if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) {
|
||||
if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', (string) $dolibarr_main_db_pass)) {
|
||||
$dolibarr_main_db_pass = preg_replace('/crypted:/i', '', (string) $dolibarr_main_db_pass);
|
||||
$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially encrypted
|
||||
$dolibarr_main_db_pass = dol_decode((string) $dolibarr_main_db_pass);
|
||||
|
||||
@@ -2686,4 +2686,5 @@ MAIN_ENABLE_AJAX_TOOLTIP=Use Ajax lazy load of tooltip content with Ajax
|
||||
MAIN_CACHE_COUNT=Keep the count of elements visible into badges in a cache (value may need several minutes to be up to date)
|
||||
MAIN_DO_FETCH_IN_ONE_SQL_REQUEST=Load content of object and lines into one request
|
||||
GoOnThisPageToInitBarCode=You can go on this page to initialize empty barcodes
|
||||
ClickHereToCheckSPFDMARCForSetup=Get a summary of the SPF and DMARC setup of all domains
|
||||
PDF_INVOICE_SHOW_BALANCE_SUMMARY= Show customer's previous and new balance
|
||||
|
||||
@@ -1369,6 +1369,7 @@ ClickOnPlusToCreateOne=Click the "Plus" button to add one.
|
||||
Free=Free
|
||||
ShowAsConversation=Show as conversation list
|
||||
MessageListViewType=Show as table list
|
||||
Any=Any
|
||||
PreviousBalance=Previous Balance
|
||||
NewBalance=New Balance
|
||||
Input=Input
|
||||
|
||||
@@ -144,7 +144,9 @@ SEPAFRST=SEPA FRST
|
||||
ExecutionDate=Execution date
|
||||
CreateForSepa=Create direct debit file
|
||||
ICS=Creditor Identifier - ICS
|
||||
ICSShort=ICS
|
||||
IDS=Debitor Identifier
|
||||
IDSShort=IDS
|
||||
END_TO_END="EndToEndId" SEPA XML tag - Unique id assigned per transaction
|
||||
USTRD="Unstructured" SEPA XML tag
|
||||
ADDDAYS=Add days to Execution Date
|
||||
|
||||
@@ -56,7 +56,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php'
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -65,7 +64,6 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
if (isModEnabled('propal')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
}
|
||||
@@ -100,6 +98,8 @@ if (isModEnabled('productbatch')) {
|
||||
$langs->load("productbatch");
|
||||
}
|
||||
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel');
|
||||
|
||||
$mesg = '';
|
||||
$error = 0;
|
||||
$errors = array();
|
||||
@@ -1600,6 +1600,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
|
||||
}
|
||||
|
||||
if ($showbarcode && is_object($modBarCodeProduct)) {
|
||||
//var_dump($modBarCodeProduct); exit;
|
||||
|
||||
print '<tr><td>'.$langs->trans('BarcodeType').'</td><td>';
|
||||
if (GETPOSTISSET('fk_barcode_type')) {
|
||||
$fk_barcode_type = GETPOST('fk_barcode_type') ? GETPOST('fk_barcode_type') : 0;
|
||||
@@ -1614,14 +1616,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
|
||||
$formbarcode = new FormBarCode($db);
|
||||
print $formbarcode->selectBarcodeType($fk_barcode_type, 'fk_barcode_type', 1);
|
||||
print '</td>';
|
||||
print '</tr><tr>';
|
||||
print '<td>'.$langs->trans("BarcodeValue").'</td><td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td'.($modBarCodeProduct->code_null ? '' : ' class="fieldrequired"').'>'.$langs->trans("BarcodeValue").'</td><td>';
|
||||
$tmpcode = GETPOSTISSET('barcode') ? GETPOST('barcode') : $object->barcode;
|
||||
if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) {
|
||||
$tmpcode = $modBarCodeProduct->getNextValue($object, $fk_barcode_type);
|
||||
}
|
||||
print img_picto('', 'barcode', 'class="pictofixedwidth"');
|
||||
print '<input class="maxwidth100" type="text" name="barcode" value="'.dol_escape_htmltag($tmpcode).'">';
|
||||
print '<input class="maxwidth150" type="text" name="barcode" value="'.dol_escape_htmltag($tmpcode).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@@ -283,10 +283,10 @@ class FormProduct
|
||||
* 'warehouseopen' = select products from open warehouses,
|
||||
* 'warehouseclosed' = select products from closed warehouses,
|
||||
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only
|
||||
* @param int<0,1> $empty 1=Can be empty, 0 if not
|
||||
* @param int<0,1>|string $empty Use 1 or 'label'=Can be empty, 0 if not
|
||||
* @param int<0,1> $disabled 1=Select is disabled
|
||||
* @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0.
|
||||
* @param string $empty_label Empty label if needed (only if $empty=1)
|
||||
* @param string $empty_label Empty label if needed (deprecated, set the label into the field $empty)
|
||||
* @param int<0,1> $showstock 1=Show stock count
|
||||
* @param int<0,1> $forcecombo 1=Force combo iso ajax select2
|
||||
* @param array<array{method:string,url:string,htmlname:string,params:array<string,string>}> $events Events to add to select2
|
||||
@@ -341,7 +341,7 @@ class FormProduct
|
||||
//$out .= ' placeholder="todo"'; // placeholder for select2 must be added by setting the id+placeholder js param when calling select2
|
||||
$out .= '>';
|
||||
if ($empty) {
|
||||
$out .= '<option value="-1">'.($empty_label ? $empty_label : ' ').'</option>';
|
||||
$out .= '<option value="-1">'.(is_numeric($empty) ? ($empty_label ? $empty_label : ' ') : $empty).'</option>';
|
||||
}
|
||||
foreach ($this->cache_warehouses as $id => $arraytypes) {
|
||||
$label = '';
|
||||
|
||||
@@ -46,7 +46,7 @@ if (empty($conf) || !is_object($conf)) {
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE STOCKCORRECTION.TPL.PHP -->
|
||||
<!-- BEGIN PHP TEMPLATE PRODUCT/STOCK/TPL/STOCKCORRECTION.TPL.PHP -->
|
||||
<?php
|
||||
|
||||
$productref = '';
|
||||
@@ -148,7 +148,7 @@ print load_fiche_titre($langs->trans("StockCorrection"), '', 'generic');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n";
|
||||
|
||||
print dol_get_fiche_head();
|
||||
print dol_get_fiche_head(array(), '', '', 0, '', 0, '', '', 0, '', 0, 'marginbottomonly');
|
||||
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="correct_stock">';
|
||||
@@ -277,6 +277,8 @@ print ' ';
|
||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '</form>';
|
||||
?>
|
||||
<!-- END PHP STOCKCORRECTION.TPL.PHP -->
|
||||
|
||||
@@ -45,7 +45,7 @@ if (empty($conf) || !is_object($conf)) {
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE STOCKTRANSFER.TPL.PHP -->
|
||||
<!-- BEGIN PHP TEMPLATE PRODUCT/STOCK/TPL/STOCKTRANSFER.TPL.PHP -->
|
||||
<?php
|
||||
$productref = '';
|
||||
if ($object->element == 'product') {
|
||||
@@ -76,7 +76,7 @@ print load_fiche_titre($langs->trans("StockTransfer"), '', 'generic');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n";
|
||||
|
||||
print dol_get_fiche_head();
|
||||
print dol_get_fiche_head(array(), '', '', 0, '', 0, '', '', 0, '', 0, 'marginbottomonly');
|
||||
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="transfert_stock">';
|
||||
@@ -168,6 +168,8 @@ print ' ';
|
||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '</form>';
|
||||
?>
|
||||
<!-- END PHP STOCKCORRECTION.TPL.PHP -->
|
||||
|
||||
@@ -231,7 +231,7 @@ trait CommonSubtotal
|
||||
*
|
||||
* @param Translate $langs Translation.
|
||||
* @param int $id ID of the line to delete
|
||||
* @param boolean $correspondingstline If true, also deletes the corresponding subtotal line
|
||||
* @param bool $correspondingstline If true, also deletes the corresponding subtotal line
|
||||
* @param User $user performing the deletion (used for permissions in some modules)
|
||||
* @return int ID of deleted line if successful, -1 on error
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user