Commit 27609774 by Teeradone Darunnat

Merge branch 'integration' into teeradone

parents 35b2d996 fbc32248
...@@ -289,7 +289,7 @@ class UserCardsController extends AppController ...@@ -289,7 +289,7 @@ class UserCardsController extends AppController
$UserEntities = $this->UserEntities->find('all', [ $UserEntities = $this->UserEntities->find('all', [
'conditions' => [ 'conditions' => [
'user_id' => $this->Auth->user('id'), 'user_id' => $this->Auth->user('id'),
'entity_code' => $TempUserCards['organize_id'] 'entity_code' => $this->request->data['UserCards']['organize_code']
] ]
])->first(); ])->first();
if(empty($UserEntities)){ if(empty($UserEntities)){
......
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
var employee = $("#employee"); var employee = $("#employee");
var date = $("#date"); var date = $("#date");
$(document).ready(function () { $(document).ready(function () {
$("#organize_code").on('change', function () { $("#organize_code").on('change', function () {
var organize_code = $("#organize_code").val(); var organize_code = $("#organize_code").val();
$('#employee').attr("disabled", true); $('#employee').attr("disabled", true);
......
...@@ -71,7 +71,7 @@ jQuery.validator.addMethod('filesize', function (value, element, param) { ...@@ -71,7 +71,7 @@ jQuery.validator.addMethod('filesize', function (value, element, param) {
jQuery.validator.addMethod("extension", function (value, element, param) { jQuery.validator.addMethod("extension", function (value, element, param) {
param = typeof (param === "string") ? param.replace(/,/g, '|') : "png|jpe?g|gif"; param = typeof (param === "string") ? param.replace(/,/g, '|') : "png|jpe?g|gif";
return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i")); return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i"));
}, jQuery.format("นามสกุลของไฟล์แนบต้องเป็น {0} เท่านั้น.")); }, jQuery.validator.format("นามสกุลของไฟล์แนบต้องเป็น {0} เท่านั้น."));
jQuery.validator.addMethod("accept", function (value, element, param) { jQuery.validator.addMethod("accept", function (value, element, param) {
var typeParam = typeof (param === "string") ? param.replace(/\s/g, '').replace(/,/g, '|') : "image/*", var typeParam = typeof (param === "string") ? param.replace(/\s/g, '').replace(/,/g, '|') : "image/*",
optionalValue = this.optional(element), optionalValue = this.optional(element),
...@@ -92,7 +92,7 @@ jQuery.validator.addMethod("accept", function (value, element, param) { ...@@ -92,7 +92,7 @@ jQuery.validator.addMethod("accept", function (value, element, param) {
} }
} }
return true; return true;
}, jQuery.format("ประเภทของไฟล์แนบต้องเป็น {0} เท่านั้น")); }, jQuery.validator.format("ประเภทของไฟล์แนบต้องเป็น {0} เท่านั้น"));
jQuery.validator.addMethod("alphanumeric", function (value, element) { jQuery.validator.addMethod("alphanumeric", function (value, element) {
return this.optional(element) || /^\w+$/i.test(value); return this.optional(element) || /^\w+$/i.test(value);
}, "ตัวอักษร หรือตัวเลขเท่านั้น"); }, "ตัวอักษร หรือตัวเลขเท่านั้น");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment