-
-
diff --git a/application/views/scripts/user/get-user-data.phtml b/application/views/scripts/user/get-user-data.phtml
new file mode 100644
index 000000000..f9696f033
--- /dev/null
+++ b/application/views/scripts/user/get-user-data.phtml
@@ -0,0 +1,3 @@
+entries;
+?>
diff --git a/application/views/scripts/user/remove-user.phtml b/application/views/scripts/user/remove-user.phtml
new file mode 100644
index 000000000..845092689
--- /dev/null
+++ b/application/views/scripts/user/remove-user.phtml
@@ -0,0 +1,3 @@
+entries;
+?>
diff --git a/build/build.properties b/build/build.properties
index 75a77da70..d15498cad 100644
--- a/build/build.properties
+++ b/build/build.properties
@@ -1,6 +1,6 @@
#Note: project.home is automatically generated by the propel-install script.
#Any manual changes to this value will be overwritten.
-project.home = /home/naomiaro/dev-campcaster/campcaster
+project.home = /home/martin/workspace/airtime
project.build = ${project.home}/build
#Database driver
diff --git a/build/schema.xml b/build/schema.xml
index 5b0bbd1b4..43ae63a31 100644
--- a/build/schema.xml
+++ b/build/schema.xml
@@ -264,6 +264,9 @@
+
+
+
diff --git a/build/sql/schema.sql b/build/sql/schema.sql
index 26942a8be..7475c6620 100644
--- a/build/sql/schema.sql
+++ b/build/sql/schema.sql
@@ -402,6 +402,9 @@ CREATE TABLE "cc_subjs"
"last_name" VARCHAR(255) default '' NOT NULL,
"lastlogin" TIMESTAMP,
"lastfail" TIMESTAMP,
+ "skype_contact" VARCHAR(255),
+ "jabber_contact" VARCHAR(255),
+ "email" VARCHAR(255),
PRIMARY KEY ("id"),
CONSTRAINT "cc_subjs_id_idx" UNIQUE ("id"),
CONSTRAINT "cc_subjs_login_idx" UNIQUE ("login")
diff --git a/public/css/styles.css b/public/css/styles.css
index b5825d80e..3e70bbfb2 100644
--- a/public/css/styles.css
+++ b/public/css/styles.css
@@ -516,6 +516,25 @@ dl.inline-list dd {
padding: 0.2em 1em;
margin-right:3px;
}
+.dataTables_filter input {
+ background: url("images/search_auto_bg.png") no-repeat scroll 0 0 #DDDDDD;
+ text-indent: 25px;
+ width: 60%;
+ border: 1px solid #5B5B5B;
+ height: 23px;
+ margin: 0;
+ padding: 0;
+}
+.dataTables_length select {
+ background-color: #DDDDDD;
+ border: 1px solid #5B5B5B;
+ font-family: Arial,Helvetica,sans-serif;
+ font-size: 12px;
+ height: 25px;
+ margin: 0;
+ padding: 2px 2px 2px 0;
+ vertical-align: top;
+}
/*----END Data Table----*/
@@ -848,7 +867,6 @@ div.ui-datepicker {
margin-right:22px;
}
-
#schedule_playlist_chosen li > div > div > span {
float: right;
margin-right:46px;
@@ -1088,7 +1106,7 @@ button, input {
font-size: 1.7em;
padding-bottom: 16px;
}
-.user-management .dataTables_filter .auto-search {
+.user-management .dataTables_filter input {
width: 378px;
}
.user-data.simple-formblock dd {
@@ -1119,4 +1137,6 @@ button, input {
background-image:url(redmond/images/ui-icons_ff5d1a_256x240.png);
}
+
#ui-datepicker-div { z-index: 10 !important }
+
diff --git a/public/js/airtime/user/user.js b/public/js/airtime/user/user.js
index 7db393244..03edafc8a 100644
--- a/public/js/airtime/user/user.js
+++ b/public/js/airtime/user/user.js
@@ -1,3 +1,42 @@
+function populateForm(entries){
+ //$('#user_details').show();
+
+ $('.errors').remove();
+
+ $('#user_id').val(entries.id);
+ $('#login').val(entries.login);
+ $('#first_name').val(entries.first_name);
+ $('#last_name').val(entries.last_name);
+ $('#type').val(entries.type);
+
+ if (entries.id.length != 0){
+ $('#login').attr('readonly', 'readonly');
+ $('#password').val("xxxxxx");
+ } else {
+ $('#login').removeAttr('readonly');
+ $('#password').val("");
+ }
+}
+
+function rowClickCallback(row_id){
+ $.ajax({ url: '/User/get-user-data/id/'+ row_id +'/format/json', dataType:"json", success:function(data){
+ populateForm(data.entries);
+ }});
+}
+
+function removeUserCallback(row_id, nRow){
+ $.ajax({ url: '/User/remove-user/id/'+ row_id +'/format/json', dataType:"text", success:function(data){
+ var o = $('#users_datatable').dataTable().fnDeleteRow(nRow);
+ }});
+}
+
+function rowCallback( nRow, aData, iDisplayIndex ){
+ $(nRow).click(function(){rowClickCallback(aData[0])});
+ $('td:eq(2)', nRow).append( '
').children('span').click(function(e){e.stopPropagation(); removeUserCallback(aData[0], nRow)});
+
+ return nRow;
+}
+
$(document).ready(function() {
$('#users_datatable').dataTable( {
"bProcessing": true,
@@ -12,15 +51,22 @@ $(document).ready(function() {
"success": fnCallback
} );
},
+ "fnRowCallback": rowCallback,
"aoColumns": [
/* Id */ { "sName": "id", "bSearchable": false, "bVisible": false },
/* user name */ { "sName": "login" },
/* user type */ { "sName": "type", "bSearchable": false },
- /* del button */ { "sName": "first_name", "bSearchable": false, "bSortable": false}
+ /* del button */ { "sName": "null as delete", "bSearchable": false, "bSortable": false}
],
"bJQueryUI": true,
"bAutoWidth": false,
- "bLengthChange": false,
- //"bFilter": false
+ "bLengthChange": false
});
+
+ //$('#user_details').hide();
+
+ var newUser = {login:"", first_name:"", last_name:"", type:"G", id:""};
+
+ $('#add_user_button').click(function(){populateForm(newUser)});
+
});