From c1d9cefaa56d3fdd0ebc21a19a2abcb082108ed4 Mon Sep 17 00:00:00 2001 From: Thomas Mudrunka Date: Fri, 31 May 2013 09:23:41 +0200 Subject: [PATCH] =?utf8?q?Z=C3=A1mek=20skladu=20se=20nyn=C3=AD=20nevztahuj?= =?utf8?q?e=20na=20jeho=20autora...?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- assistants/lock.inc.php | 6 ++++-- index.php | 3 ++- locale/cs/messages.inc.php | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/assistants/lock.inc.php b/assistants/lock.inc.php index 7f101a2..6795181 100644 --- a/assistants/lock.inc.php +++ b/assistants/lock.inc.php @@ -3,11 +3,12 @@ switch($SUBPATH[0]) { default: case 1: $result = $this->db->safe_query_fetch("SELECT * FROM `lock`;"); if(empty($result)) { - echo 'Not locked...'; + echo T('Not locked...'); echo $this->html->form("$URL/2", 'POST', array( array('reason','','textarea',false,'autofocus','reason:'), array('lock','lock','submit') )); + echo(T('By locking you will disable all other users from manipulating records.')); } else { echo $this->html->render_item_table($result, 'lock'); echo $this->html->form("$URL/2", 'POST', array( @@ -21,7 +22,8 @@ switch($SUBPATH[0]) { $user=$this->db->auth->get_user_id(); $username=$this->db->auth->get_username_by_id($user); $lock = $this->db->quote($username.': '.$_POST['reason']); - $this->db->safe_query("INSERT INTO `lock` (lock_name) VALUES ($lock);"); + $author = $this->db->quote($user); + $this->db->safe_query("INSERT INTO `lock` (lock_name,lock_author) VALUES ($lock,$author);"); $this->post_redirect_get("$URL_INTERNAL/1", T('Lock set')); } if(isset($_POST['unlock'])) { diff --git a/index.php b/index.php index 36c59f1..f03be33 100755 --- a/index.php +++ b/index.php @@ -1052,7 +1052,8 @@ class Sklad_UI { } function check_locks() { - $result = $this->db->safe_query_fetch("SELECT * FROM `lock`;"); + $user = $this->db->quote($this->db->auth->get_user_id()); + $result = $this->db->safe_query_fetch("SELECT * FROM `lock` WHERE `lock_author` != $user;"); if(!empty($result)) { echo T('There are locks:').' '.$this->html->render_item_table($result, 'lock'); $this->post_redirect_get('', 'There are locks!', true); diff --git a/locale/cs/messages.inc.php b/locale/cs/messages.inc.php index de1d4b2..f8316e8 100644 --- a/locale/cs/messages.inc.php +++ b/locale/cs/messages.inc.php @@ -11,6 +11,7 @@ $LOCALE_MESSAGES = array( 'Record not found!' => 'Položka nenalezena!', 'holy primordial emptiness is all you can find here...' => 'věz, že zde nenajdeš více než nekonečnou laskavost prapůvodní prázdnoty...', 'There are locks' => 'Sklad je zamčen', + 'By locking you will disable all other users from manipulating records.' => 'Zamknutím skladu zabráníte ostatním uživatelům v úpravě záznamů!', 'item_id' => '#', 'item_serial' => 'Sériové č.', -- 2.30.2