New : add of unique(entity,label)

This commit is contained in:
lmarcouiller 2022-04-14 11:06:54 +02:00
parent 914b037a9a
commit c90d758b0f
3 changed files with 19 additions and 1 deletions

View File

@ -324,3 +324,5 @@ ALTER TABLE llx_actioncomm MODIFY COLUMN note mediumtext;
DELETE FROM llx_boxes WHERE box_id IN (select rowid FROM llx_boxes_def WHERE file IN ('box_bom.php@bom', 'box_bom.php'));
DELETE FROM llx_boxes_def WHERE file IN ('box_bom.php@bom', 'box_bom.php');
ALTER TABLE llx_takepos_floor_tables ADD UNIQUE(entity,label);

View File

@ -0,0 +1,16 @@
-- Copyright (C) 2018 SuperAdmin
--
-- 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_takepos_floor_tables ADD UNIQUE(entity,label);

View File

@ -104,7 +104,7 @@ if ($action == "updatename") {
if (strlen($newname) > 3) {
$newname = substr($newname, 0, 3); // Only 3 chars
}
$db->query("UPDATE ".MAIN_DB_PREFIX."takepos_floor_tables set label='".$db->escape($newname)."' WHERE rowid = ".((int) $place));
$resql = $db->query("UPDATE ".MAIN_DB_PREFIX."takepos_floor_tables set label='".$db->escape($newname)."' WHERE rowid = ".((int) $place));
}
if ($action == "add") {