From: Thomas Mudrunka Date: Fri, 31 May 2013 07:23:41 +0000 (+0200) Subject: Zámek skladu se nyní nevztahuje na jeho autora... X-Git-Url: https://git.harvie.cz/?p=mirrors%2FSokoMan.git;a=commitdiff_plain;h=c1d9cefaa56d3fdd0ebc21a19a2abcb082108ed4 Zámek skladu se nyní nevztahuje na jeho autora... --- 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é č.',