Zámek skladu se nyní nevztahuje na jeho autora...
authorThomas Mudrunka <tomas@mudrunka.cz>
Fri, 31 May 2013 07:23:41 +0000 (09:23 +0200)
committerThomas Mudrunka <tomas@mudrunka.cz>
Fri, 31 May 2013 07:23:41 +0000 (09:23 +0200)
assistants/lock.inc.php
index.php
locale/cs/messages.inc.php

index 7f101a27d9da9f3745014500e25e56e5c0793680..67951816505d2a5cf381d7965d902338824d59c7 100644 (file)
@@ -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'])) {
index 36c59f153fab4ef6b3c69b13768817ba5109417b..f03be33f7158c8d33a1009488de0c27e99ae9e28 100755 (executable)
--- 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);
index de1d4b250b63c3325c86720ca5f5b7b9816dcb48..f8316e8ac194f62ebdc19355d0421fdcfb45f688 100644 (file)
@@ -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é č.',
This page took 0.188098 seconds and 4 git commands to generate.