Zámek skladu se nyní nevztahuje na jeho autora...
[mirrors/SokoMan.git] / assistants / lock.inc.php
index b94386453f6b45748c1ae005180bafd066a04c88..67951816505d2a5cf381d7965d902338824d59c7 100644 (file)
@@ -3,15 +3,14 @@ switch($SUBPATH[0]) {
        default: case 1:
                $result = $this->db->safe_query_fetch("SELECT * FROM `lock`;");
                if(empty($result)) {
-                       echo 'Not locked...';
-                       $user=$this->db->auth->get_user_id();
-                       $username=$this->db->auth->get_username_by_id($user);
+                       echo T('Not locked...');
                        echo $this->html->form("$URL/2", 'POST', array(
-                               array('reason',"$username: ",'textarea',false,'autofocus','reason:'),
+                               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);
+                       echo $this->html->render_item_table($result, 'lock');
                        echo $this->html->form("$URL/2", 'POST', array(
                                array('unlock','unlock','submit')
                        ));
@@ -20,8 +19,11 @@ switch($SUBPATH[0]) {
                break;
        case 2:
                if(isset($_POST['lock'])) {
-                       $lock = $this->db->quote($_POST['reason']);
-                       $this->db->safe_query("INSERT INTO `lock` (lock_name) VALUES ($lock);");
+                       $user=$this->db->auth->get_user_id();
+                       $username=$this->db->auth->get_username_by_id($user);
+                       $lock = $this->db->quote($username.': '.$_POST['reason']);
+                       $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'])) {
This page took 0.128515 seconds and 4 git commands to generate.