forked from Wavyzz/dolibarr
add new rule
This commit is contained in:
@@ -83,8 +83,7 @@ if ($action == 'add') {
|
||||
$distinctfkuser[$obj->fk_user] = $obj->fk_user;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@@ -108,8 +107,7 @@ if ($action == 'add') {
|
||||
if (preg_match('/A/', $boxorder)) $nbboxonleft++;
|
||||
if (preg_match('/B/', $boxorder)) $nbboxonright++;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
} else dol_print_error($db);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
|
||||
$sql .= "box_id, position, box_order, fk_user, entity";
|
||||
@@ -133,8 +131,7 @@ if ($action == 'add') {
|
||||
{
|
||||
$db->commit();
|
||||
$action = '';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@@ -202,8 +199,7 @@ if ($action == 'switch')
|
||||
if ($resultupdatefrom && $resultupdateto)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@@ -285,23 +281,20 @@ if ($resql)
|
||||
$box_order = "A0".$record['box_order'];
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
||||
$resql = $db->query($sql);
|
||||
}
|
||||
elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1)))
|
||||
} elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1)))
|
||||
{
|
||||
$box_order = "B0".$record['box_order'];
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
||||
$resql = $db->query($sql);
|
||||
}
|
||||
}
|
||||
elseif (dol_strlen($record['box_order']) == 2)
|
||||
} elseif (dol_strlen($record['box_order']) == 2)
|
||||
{
|
||||
if (preg_match("/[13579]{1}/", substr($record['box_order'], -1)))
|
||||
{
|
||||
$box_order = "A".$record['box_order'];
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
||||
$resql = $db->query($sql);
|
||||
}
|
||||
elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1)))
|
||||
} elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1)))
|
||||
{
|
||||
$box_order = "B".$record['box_order'];
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
||||
@@ -342,8 +335,7 @@ foreach ($boxtoadd as $box)
|
||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg))
|
||||
{
|
||||
$logo = $box->boximg;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$logo = preg_replace("/^object_/i", "", $box->boximg);
|
||||
}
|
||||
|
||||
@@ -357,8 +349,7 @@ foreach ($boxtoadd as $box)
|
||||
{
|
||||
$langs->load("errors");
|
||||
print $langs->trans("WarningUsingThisBoxSlowDown");
|
||||
}
|
||||
else print ($box->note ? $box->note : ' ');
|
||||
} else print ($box->note ? $box->note : ' ');
|
||||
print '</td>'."\n";
|
||||
print '<td>'.$box->sourcefile.'</td>'."\n";
|
||||
|
||||
@@ -406,8 +397,7 @@ foreach ($boxactivated as $key => $box)
|
||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg))
|
||||
{
|
||||
$logo = $box->boximg;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$logo = preg_replace("/^object_/i", "", $box->boximg);
|
||||
}
|
||||
|
||||
@@ -421,8 +411,7 @@ foreach ($boxactivated as $key => $box)
|
||||
{
|
||||
$langs->load("errors");
|
||||
print img_warning('', 0).' '.$langs->trans("WarningUsingThisBoxSlowDown");
|
||||
}
|
||||
else print ($box->note ? $box->note : ' ');
|
||||
} else print ($box->note ? $box->note : ' ');
|
||||
print '</td>';
|
||||
print '<td class="center">'.(empty($pos_name[$box->position]) ? '' : $langs->trans($pos_name[$box->position])).'</td>';
|
||||
$hasnext = ($key < (count($boxactivated) - 1));
|
||||
|
||||
Reference in New Issue
Block a user