Просмотр исходного кода

all data input is ready

master
patrick 6 лет назад
Родитель
Сommit
07d4f64222
4 измененных файлов: 60 добавлений и 6 удалений
  1. +11
    -1
      css/bts_timesheet.css
  2. +13
    -2
      html/job.html
  3. +6
    -1
      js/bts_timesheet.js
  4. +30
    -2
      ts.php

+ 11
- 1
css/bts_timesheet.css Просмотреть файл

@@ -658,9 +658,19 @@ div.bdelete {
}

div.btos {
width: 30%;
width: 20%;
}

div.bhours{
width: 20%;
max-width: 20px;
}
.divTable div > select{
width: 100%;
height: 100%;
}


div.bdelete,
div.bconfirmed {
text-align:center;

+ 13
- 2
html/job.html Просмотреть файл

@@ -1,10 +1,21 @@
<div class="divTable blueTable">
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell btos">[bts_tos_options]</div>
<div class="divTableCell btos">
<select>
<option value="personalcare">Personal Care (stanard)</option>
<option value="personalcare_h">Personal Care(Complex)</option>
<option value="lunch">Lunch (stanard)</option>
<option value="lunch_h">Lunch(Complex)</option>
<option value="community">Community(stanard)</option>
<option value="community_h">Community(Complex)</option>
<option value="turn">Turn(stanard)</option>
<option value="turn_h">Turn(Complex)</option>
</select>
</div>
<div class="divTableCell bstart"><input class="datepicker" placeholder="2019:03-02-11:30am"></input></div>
<div class="divTableCell bfinish"><input class="datepicker" placeholder="2019:03-02-11:30am"></input></div>
<div class="divTableCell bhours">hours</div>
<div class="divTableCell bhours">[bts_hours_options]</div>
<div class="divTableCell bstaff">[bts_select_staff]</div>
<div class="divTableCell bclient">[bts_select_client]</div>
<div class="divTableCell bconfirmed"><input type=checkbox checked></div>

+ 6
- 1
js/bts_timesheet.js Просмотреть файл

@@ -228,9 +228,14 @@
var html = jQuery("#job_item").html();
jQuery('div.workspace').append(html);
}
dtp_init();
reset_date_time_picker();
});
function reset_date_time_picker(){
//$('div.xdsoft_datetimepicker.xdsoft_noselect.xdsoft_default').remove();
dtp_init();
}
$(document).on('click', 'div.divTableCell.bdelete', function(){
$(this).closest('div.divTable').remove();
});

+ 30
- 2
ts.php Просмотреть файл

@@ -34,7 +34,9 @@ class AcareOffice{
add_shortcode( 'bts_staff_item', array($this, 'bts_staff_item'));
add_shortcode( 'bts_client_item', array($this, 'bts_client_item'));
add_shortcode( 'bts_job_item', array($this, 'bts_job_item'));
add_shortcode( 'bts_tos_options', array($this, 'bts_tos_options'));
add_shortcode( 'bts_hours_options', array($this, 'bts_hours_options'));
add_shortcode( 'bts_select_staff', array($this, 'bts_select_staff'));
add_shortcode( 'bts_select_client', array($this, 'bts_select_client'));
add_action('wp_ajax_list_staff', array($this,'list_staff' ));
add_action('wp_ajax_list_client', array($this,'list_client' ));
@@ -138,7 +140,7 @@ class AcareOffice{
return $html;
}
public function bts_tos_options($attr){
public function bts_hours_options($attr){
$result = "<select> \n";
$options = get_option('bts_payitem_earnings_rate');
foreach($options as $o){
@@ -149,6 +151,25 @@ class AcareOffice{
return $result;
}
public function bts_select_staff($attr){
$result = "<select> \n";
$staff = $this->get_people_by_role('staff');
foreach ($staff as $u){
$result .= sprintf("<option value=%s> %s</option>", $u->user_login, $u->first_name . " " . $u->last_name);
}
$result .="</select>";
return $result;
}

public function bts_select_client($attr){
$result = "<select> \n";
$staff = $this->get_people_by_role('client');
foreach ($staff as $u){
$result .= sprintf("<option value=%s> %s</option>", $u->user_login, $u->first_name . " " . $u->last_name);
}
$result .="</select>";
return $result;
}
//generate template based on html file
private function template($id, $file)
@@ -201,6 +222,13 @@ class AcareOffice{
wp_die();
}
private function get_people_by_role($role){
//search all users that are staff
$staffq = new \WP_User_Query(array('role'=>$role));
$staff = $staffq->get_results();
return $staff;
}
//ajax get earnings rates
function get_payitem_earnings_rate()
{

Загрузка…
Отмена
Сохранить