try to fix sticker
This commit is contained in:
parent
e8aacc7acf
commit
229c581a25
@ -109,8 +109,7 @@ class mod_lot_advanced extends ModeleNumRefBatch
|
|||||||
$mysoc->code_client = $old_code_client;
|
$mysoc->code_client = $old_code_client;
|
||||||
$mysoc->typent_code = $old_code_type;
|
$mysoc->typent_code = $old_code_type;
|
||||||
|
|
||||||
if (!$numExample)
|
if (!$numExample) {
|
||||||
{
|
|
||||||
$numExample = $langs->trans('NotConfigured');
|
$numExample = $langs->trans('NotConfigured');
|
||||||
}
|
}
|
||||||
return $numExample;
|
return $numExample;
|
||||||
@ -132,8 +131,7 @@ class mod_lot_advanced extends ModeleNumRefBatch
|
|||||||
// We get cursor rule
|
// We get cursor rule
|
||||||
$mask = $conf->global->BATCH_ADVANCED_MASK;
|
$mask = $conf->global->BATCH_ADVANCED_MASK;
|
||||||
|
|
||||||
if (!$mask)
|
if (!$mask) {
|
||||||
{
|
|
||||||
$this->error = 'NotConfigured';
|
$this->error = 'NotConfigured';
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,7 +80,6 @@ class mod_lot_free extends ModeleNumRefBatch
|
|||||||
/**
|
/**
|
||||||
* Return description of module
|
* Return description of module
|
||||||
*
|
*
|
||||||
* @param Translate $langs Object langs
|
|
||||||
* @return string Description of module
|
* @return string Description of module
|
||||||
*/
|
*/
|
||||||
public function info()
|
public function info()
|
||||||
@ -103,5 +102,4 @@ class mod_lot_free extends ModeleNumRefBatch
|
|||||||
global $langs;
|
global $langs;
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,13 +91,11 @@ class mod_lot_standard extends ModeleNumRefBatch
|
|||||||
$sql .= " AND entity = ".$conf->entity;
|
$sql .= " AND entity = ".$conf->entity;
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
if ($row) { $coyymm = substr($row[0], 0, 6); $max = $row[0]; }
|
if ($row) { $coyymm = substr($row[0], 0, 6); $max = $row[0]; }
|
||||||
}
|
}
|
||||||
if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm))
|
if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) {
|
||||||
{
|
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$this->error = $langs->trans('ErrorNumRefModel', $max);
|
$this->error = $langs->trans('ErrorNumRefModel', $max);
|
||||||
return false;
|
return false;
|
||||||
@ -125,14 +123,11 @@ class mod_lot_standard extends ModeleNumRefBatch
|
|||||||
$sql .= " AND entity = ".$conf->entity;
|
$sql .= " AND entity = ".$conf->entity;
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj) $max = intval($obj->max);
|
if ($obj) $max = intval($obj->max);
|
||||||
else $max = 0;
|
else $max = 0;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_syslog("mod_lot_standard::getNextValue", LOG_DEBUG);
|
dol_syslog("mod_lot_standard::getNextValue", LOG_DEBUG);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,8 +109,7 @@ class mod_sn_advanced extends ModeleNumRefBatch
|
|||||||
$mysoc->code_client = $old_code_client;
|
$mysoc->code_client = $old_code_client;
|
||||||
$mysoc->typent_code = $old_code_type;
|
$mysoc->typent_code = $old_code_type;
|
||||||
|
|
||||||
if (!$numExample)
|
if (!$numExample) {
|
||||||
{
|
|
||||||
$numExample = $langs->trans('NotConfigured');
|
$numExample = $langs->trans('NotConfigured');
|
||||||
}
|
}
|
||||||
return $numExample;
|
return $numExample;
|
||||||
@ -132,8 +131,7 @@ class mod_sn_advanced extends ModeleNumRefBatch
|
|||||||
// We get cursor rule
|
// We get cursor rule
|
||||||
$mask = $conf->global->BATCH_ADVANCED_MASK;
|
$mask = $conf->global->BATCH_ADVANCED_MASK;
|
||||||
|
|
||||||
if (!$mask)
|
if (!$mask) {
|
||||||
{
|
|
||||||
$this->error = 'NotConfigured';
|
$this->error = 'NotConfigured';
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,7 +79,6 @@ class mod_sn_free extends ModeleNumRefBatch
|
|||||||
/**
|
/**
|
||||||
* Return description of module
|
* Return description of module
|
||||||
*
|
*
|
||||||
* @param Translate $langs Object langs
|
|
||||||
* @return string Description of module
|
* @return string Description of module
|
||||||
*/
|
*/
|
||||||
public function info()
|
public function info()
|
||||||
@ -102,5 +101,4 @@ class mod_sn_free extends ModeleNumRefBatch
|
|||||||
global $langs;
|
global $langs;
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,13 +91,11 @@ class mod_sn_standard extends ModeleNumRefBatch
|
|||||||
$sql .= " AND entity = ".$conf->entity;
|
$sql .= " AND entity = ".$conf->entity;
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
if ($row) { $coyymm = substr($row[0], 0, 6); $max = $row[0]; }
|
if ($row) { $coyymm = substr($row[0], 0, 6); $max = $row[0]; }
|
||||||
}
|
}
|
||||||
if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm))
|
if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) {
|
||||||
{
|
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$this->error = $langs->trans('ErrorNumRefModel', $max);
|
$this->error = $langs->trans('ErrorNumRefModel', $max);
|
||||||
return false;
|
return false;
|
||||||
@ -125,14 +123,11 @@ class mod_sn_standard extends ModeleNumRefBatch
|
|||||||
$sql .= " AND entity = ".$conf->entity;
|
$sql .= " AND entity = ".$conf->entity;
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj) $max = intval($obj->max);
|
if ($obj) $max = intval($obj->max);
|
||||||
else $max = 0;
|
else $max = 0;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_syslog("mod_sn_standard::getNextValue", LOG_DEBUG);
|
dol_syslog("mod_sn_standard::getNextValue", LOG_DEBUG);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,8 +42,7 @@ $value = GETPOST('value', 'alpha');
|
|||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||||
|
|
||||||
if ($action == 'updateMaskLot')
|
if ($action == 'updateMaskLot') {
|
||||||
{
|
|
||||||
$maskconstbatch = GETPOST('maskconstLot', 'alpha');
|
$maskconstbatch = GETPOST('maskconstLot', 'alpha');
|
||||||
$maskbatch = GETPOST('maskLot', 'alpha');
|
$maskbatch = GETPOST('maskLot', 'alpha');
|
||||||
|
|
||||||
@ -51,17 +50,13 @@ if ($action == 'updateMaskLot')
|
|||||||
|
|
||||||
if (!$res > 0) $error++;
|
if (!$res > 0) $error++;
|
||||||
|
|
||||||
if (!$error)
|
if (!$error) {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif ($action == 'updateMaskSN')
|
} elseif ($action == 'updateMaskSN') {
|
||||||
{
|
|
||||||
$maskconstbatch = GETPOST('maskconstSN', 'alpha');
|
$maskconstbatch = GETPOST('maskconstSN', 'alpha');
|
||||||
$maskbatch = GETPOST('maskSN', 'alpha');
|
$maskbatch = GETPOST('maskSN', 'alpha');
|
||||||
|
|
||||||
@ -69,21 +64,16 @@ if ($action == 'updateMaskLot')
|
|||||||
|
|
||||||
if (!$res > 0) $error++;
|
if (!$res > 0) $error++;
|
||||||
|
|
||||||
if (!$error)
|
if (!$error) {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif ($action == 'setmodlot')
|
} elseif ($action == 'setmodlot') {
|
||||||
{
|
|
||||||
dolibarr_set_const($db, "LOT_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "LOT_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
} elseif ($action == 'setmodsn')
|
} elseif ($action == 'setmodsn') {
|
||||||
{
|
|
||||||
dolibarr_set_const($db, "SN_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "SN_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,15 +115,12 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/product_batch/");
|
$dir = dol_buildpath($reldir."core/modules/product_batch/");
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir)) {
|
||||||
{
|
|
||||||
$handle = opendir($dir);
|
$handle = opendir($dir);
|
||||||
if (is_resource($handle))
|
if (is_resource($handle)) {
|
||||||
{
|
|
||||||
while (($file = readdir($handle)) !== false)
|
while (($file = readdir($handle)) !== false)
|
||||||
{
|
{
|
||||||
if (substr($file, 0, 8) == 'mod_lot_' && substr($file, dol_strlen($file) - 3, 3) == 'php')
|
if (substr($file, 0, 8) == 'mod_lot_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
|
||||||
{
|
|
||||||
$file = substr($file, 0, dol_strlen($file) - 4);
|
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||||
|
|
||||||
require_once $dir.$file.'.php';
|
require_once $dir.$file.'.php';
|
||||||
@ -144,8 +131,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||||
|
|
||||||
if ($module->isEnabled())
|
if ($module->isEnabled()) {
|
||||||
{
|
|
||||||
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
||||||
print $module->info();
|
print $module->info();
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -159,12 +145,9 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($conf->global->LOT_ADDON == $file)
|
if ($conf->global->LOT_ADDON == $file) {
|
||||||
{
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodlot&value='.$file.'">';
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodlot&value='.$file.'">';
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
@ -226,15 +209,12 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/product_batch/");
|
$dir = dol_buildpath($reldir."core/modules/product_batch/");
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir)) {
|
||||||
{
|
|
||||||
$handle = opendir($dir);
|
$handle = opendir($dir);
|
||||||
if (is_resource($handle))
|
if (is_resource($handle)) {
|
||||||
{
|
|
||||||
while (($file = readdir($handle)) !== false)
|
while (($file = readdir($handle)) !== false)
|
||||||
{
|
{
|
||||||
if (substr($file, 0, 7) == 'mod_sn_' && substr($file, dol_strlen($file) - 3, 3) == 'php')
|
if (substr($file, 0, 7) == 'mod_sn_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
|
||||||
{
|
|
||||||
$file = substr($file, 0, dol_strlen($file) - 4);
|
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||||
|
|
||||||
require_once $dir.$file.'.php';
|
require_once $dir.$file.'.php';
|
||||||
@ -245,8 +225,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||||
|
|
||||||
if ($module->isEnabled())
|
if ($module->isEnabled()) {
|
||||||
{
|
|
||||||
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
||||||
print $module->info();
|
print $module->info();
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -260,12 +239,9 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($conf->global->SN_ADDON == $file)
|
if ($conf->global->SN_ADDON == $file) {
|
||||||
{
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodsn&value='.$file.'">';
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodsn&value='.$file.'">';
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user