Plugin Directory

Changeset 3151570


Ignore:
Timestamp:
09/13/2024 08:47:01 PM (17 months ago)
Author:
mrdenny
Message:
  • Changing numeric fields to numeric data type so the user can't enter text
  • Calling the archive function from the email_retainers_due function instead of manually archiving
  • Allows for updating of templates
  • Adjusting the order of operations when saving a timesheet / template
  • Updated the save message to account for saving a template vs timesheet
  • Updated FAQ
Location:
time-sheets
Files:
376 added
5 edited

Legend:

Unmodified
Added
Removed
  • time-sheets/trunk/cron.php

    r3122661 r3151570  
    328328        $daysinmonth = date('t');
    329329        $today = date('d');
    330        
    331         var_dump($today);
    332330
    333331        if ($today != $daysinmonth) {
     332            echo "This procedure has exited. It only runs on the last day of the month.";
    334333            return;
    335334        }
     
    346345            $db->query($sql);
    347346           
    348             $sql = "insert into {$wpdb->prefix}timesheet_client_projects_archive
    349             select -1, now(), 'UPDATED', ProjectId, ClientId, ProjectName, IsRetainer, MaxHours, HoursUsed, Active, notes, BillOnProjectCompletion, flat_rate, po_number, sales_person_id, technical_sales_person_id, close_on_completion
    350             FROM {$wpdb->prefix}timesheet_client_projects_archive
    351             WHERE IsRetainer = 1";
    352             $db->query($sql);
     347            $common->archive_records('timesheet_client_projects', 'timesheet_client_projects_archive', 'IsRetainer', '1');
    353348           
    354349
  • time-sheets/trunk/entry.php

    r3122661 r3151570  
    717717        }
    718718   
    719         $page = $page .  "<form name='timesheet' method='POST' autocomplete='off' onsubmit='submit.disabled=true;'>";
     719        $page = $page .  "<form name='timesheet' method='POST' autocomplete='off' onsubmit='submit.disabled=true;is_template.disabled=false'>";
    720720        //class='ws-validate'
    721721       
     
    744744        $page = $page .  "<table>";
    745745        if (isset($timesheet_user)) {
    746             $page = $page .  "<TR><TD>Timesheet Number:</TD><TD>{$timesheet_id}</TD></TR>";
    747             $page = $page .  "<TR><TD>Timesheet For:</TD><TD>{$timesheet_user}</TD></TR>";
     746            $page = $page .  "<TR><TD>" . (($is_template == true)?"Template":"Timesheet") . " Number:</TD><TD>{$timesheet_id}</TD></TR>";
     747            $page = $page .  "<TR><TD>" . (($is_template == true)?"Template":"Timesheet") . " For:</TD><TD>{$timesheet_user}</TD></TR>";
    748748            if (isset($options['allow_money_based_retainers']) && (isset($timesheet->week_complete) && ($timesheet->week_complete=='1'))){
    749749                $page = $page . "<TR><TD>Employee Title";
     
    846846        $total_nb = $monday_nb+$tuesday_nb+$wednesday_nb+$thursday_nb+$friday_nb+$saturday_nb+$sunday_nb;   
    847847       
    848         $page = $page .  "<tr align='center'><td></td><td><input type='text' name='monday_date' value='' size='5' disabled></td>
    849 <td><input type='text' name='tuesday_date' value='' size='5' disabled></td>
    850 <td><input type='text' name='wednesday_date' value='' size='5' disabled></td>
    851 <td><input type='text' name='thursday_date' value='' size='5' disabled></td>
    852 <td><input type='text' name='friday_date' value='' size='5' disabled></td>
    853 <td><input type='text' name='saturday_date' value='' size='5' disabled></td>
    854 <td><input type='text' name='sunday_date' value='' size='5' disabled></td></tr>";
    855         $page = $page .  "<tr><td>Hours</td><td><input type='text' name='monday_hours' size='5' maxlength='5' value='{$monday_hours}'></td>";
    856         $page = $page .  "<td><input type='text' name='tuesday_hours' size='5' maxlength='5' value='{$tuesday_hours}'></td>";
    857         $page = $page .  "<td><input type='text' name='wednesday_hours' size='5' maxlength='5' value='{$wednesday_hours}'></td>";
    858         $page = $page .  "<td><input type='text' name='thursday_hours' size='5' maxlength='5' value='{$thursday_hours}'></td>";
    859         $page = $page .  "<td><input type='text' name='friday_hours' size='5' maxlength='5' value='{$friday_hours}'></td>";
    860         $page = $page .  "<td><input type='text' name='saturday_hours' size='5' maxlength='5' value='{$saturday_hours}'></td>";
    861         $page = $page .  "<td><input type='text' name='sunday_hours' size='5' maxlength='5' value='{$sunday_hours}'></td></tr>";
     848        $page = $page .  "<tr align='center'><td></td><td><input type='text' name='monday_date' value='' size='5' style='width: 5em' disabled></td>
     849<td><input type='text' name='tuesday_date' value='' size='5' style='width: 5em' disabled></td>
     850<td><input type='text' name='wednesday_date' value='' size='5' style='width: 5em' disabled></td>
     851<td><input type='text' name='thursday_date' value='' size='5' style='width: 5em' disabled></td>
     852<td><input type='text' name='friday_date' value='' size='5' style='width: 5em' disabled></td>
     853<td><input type='text' name='saturday_date' value='' size='5' style='width: 5em' disabled></td>
     854<td><input type='text' name='sunday_date' value='' size='5' style='width: 5em' disabled></td></tr>";
     855        $page = $page .  "<tr><td>Hours</td><td><input type='number' name='monday_hours' min='0' max='24' step='0.25' style='width: 5em' value='{$monday_hours}'></td>";
     856        $page = $page .  "<td><input type='number' name='tuesday_hours' min='0' max='24' step='0.25' style='width: 5em' value='{$tuesday_hours}'></td>";
     857        $page = $page .  "<td><input type='number' name='wednesday_hours' min='0' max='24' step='0.25' style='width: 5em' value='{$wednesday_hours}'></td>";
     858        $page = $page .  "<td><input type='number' name='thursday_hours' min='0' max='24' step='0.25' style='width: 5em' value='{$thursday_hours}'></td>";
     859        $page = $page .  "<td><input type='number' name='friday_hours' min='0' max='24' step='0.25' style='width: 5em' value='{$friday_hours}'></td>";
     860        $page = $page .  "<td><input type='number' name='saturday_hours' min='0' max='24' step='0.25' style='width: 5em' value='{$saturday_hours}'></td>";
     861        $page = $page .  "<td><input type='number' name='sunday_hours' min='0' max='24' step='0.25' style='width: 5em' value='{$sunday_hours}'></td></tr>";
    862862        $hide_ot = 0;
    863863        $hide_nb = 0;
     
    890890 
    891891
    892             $page = $page .  "<tr><td>Overtime</td><td><input type='text' name='monday_ot' size='5' maxlength='5' $monday_ot_style value='{$monday_ot}'></td>";
    893             $page = $page .  "<td><input type='text' name='tuesday_ot' size='5' maxlength='5' $tuesday_ot_style value='{$tuesday_ot}'></td>";
    894             $page = $page .  "<td><input type='text' name='wednesday_ot' size='5' maxlength='5' $wednesday_ot_style value='{$wednesday_ot}'></td>";
    895             $page = $page .  "<td><input type='text' name='thursday_ot' size='5' maxlength='5' $thursday_ot_style value='{$thursday_ot}'></td>";
    896             $page = $page .  "<td><input type='text' name='friday_ot' size='5' maxlength='5' $friday_ot_style value='{$friday_ot}'></td>";
    897             $page = $page .  "<td><input type='text' name='saturday_ot' size='5' maxlength='5' $saturday_ot_style value='{$saturday_ot}'></td>";
    898             $page = $page .  "<td><input type='text' name='sunday_ot' size='5' maxlength='5' $sunday_ot_style value='{$sunday_ot}'></td></tr>";
     892            $page = $page .  "<tr><td>Overtime</td><td><input type='number' name='monday_ot' min='0' max='24' step='0.25' style='width: 5em' $monday_ot_style value='{$monday_ot}'></td>";
     893            $page = $page .  "<td><input type='number' name='tuesday_ot' min='0' max='24' step='0.25' style='width: 5em' $tuesday_ot_style value='{$tuesday_ot}'></td>";
     894            $page = $page .  "<td><input type='number' name='wednesday_ot' min='0' max='24' step='0.25' style='width: 5em' $wednesday_ot_style value='{$wednesday_ot}'></td>";
     895            $page = $page .  "<td><input type='number' name='thursday_ot' min='0' max='24' step='0.25' style='width: 5em' $thursday_ot_style value='{$thursday_ot}'></td>";
     896            $page = $page .  "<td><input type='number' name='friday_ot' min='0' max='24' step='0.25' style='width: 5em' $friday_ot_style value='{$friday_ot}'></td>";
     897            $page = $page .  "<td><input type='number' name='saturday_ot' min='0' max='24' step='0.25' style='width: 5em' $saturday_ot_style value='{$saturday_ot}'></td>";
     898            $page = $page .  "<td><input type='number' name='sunday_ot' min='0' max='24' step='0.25' style='width: 5em' $sunday_ot_style value='{$sunday_ot}'></td></tr>";
    899899        }
    900900       
    901901        if ($hide_nb == 0) {
    902             $page = $page .  "<tr><td>Non-Billable Time</td><td><input type='text' name='monday_nb' size='5' maxlength='5' value='{$monday_nb}'></td>";
    903             $page = $page .  "<td><input type='text' name='tuesday_nb' size='5' maxlength='5' value='{$tuesday_nb}'></td>";
    904             $page = $page .  "<td><input type='text' name='wednesday_nb' size='5' maxlength='5' value='{$wednesday_nb}'></td>";
    905             $page = $page .  "<td><input type='text' name='thursday_nb' size='5' maxlength='5' value='{$thursday_nb}'></td>";
    906             $page = $page .  "<td><input type='text' name='friday_nb' size='5' maxlength='5' value='{$friday_nb}'></td>";
    907             $page = $page .  "<td><input type='text' name='saturday_nb' size='5' maxlength='5' value='{$saturday_nb}'></td>";
    908             $page = $page .  "<td><input type='text' name='sunday_nb' size='5' maxlength='5' value='{$sunday_nb}'></td></tr>";
     902            $page = $page .  "<tr><td>Non-Billable Time</td><td><input type='number' name='monday_nb' min='0' max='24' step='0.25' style='width: 5em' value='{$monday_nb}'></td>";
     903            $page = $page .  "<td><input type='number' name='tuesday_nb' min='0' max='24' step='0.25' style='width: 5em' value='{$tuesday_nb}'></td>";
     904            $page = $page .  "<td><input type='number' name='wednesday_nb' min='0' max='24' step='0.25' style='width: 5em' value='{$wednesday_nb}'></td>";
     905            $page = $page .  "<td><input type='number' name='thursday_nb' min='0' max='24' step='0.25' style='width: 5em' value='{$thursday_nb}'></td>";
     906            $page = $page .  "<td><input type='number' name='friday_nb' min='0'  max='24' step='0.25' style='width: 5em' value='{$friday_nb}'></td>";
     907            $page = $page .  "<td><input type='number' name='saturday_nb' min='0'  max='24' step='0.25' style='width: 5em'' value='{$saturday_nb}'></td>";
     908            $page = $page .  "<td><input type='number' name='sunday_nb' min='0' max='24' step='0.25' style='width: 5em' value='{$sunday_nb}'></td></tr>";
    909909           
    910910        }
     
    953953            $other_expenses_notes = (isset($timesheet->other_expenses_notes) ? $timesheet->other_expenses_notes : '');
    954954           
    955             $page = $page .  "<tr><td align='center'><input type='text' name='per_diem_days' size='8' maxlength='9' value='{$per_diem_days}'></td>";
     955            $page = $page .  "<tr><td align='center'><input type='number' name='per_diem_days 'min='0' style='width: 5em' value='{$per_diem_days}'></td>";
    956956            $page = $page .  "<td align='center'><input type='text' name='perdiem_city' size='15' value='{$per_diem_city}'></td>";
    957             $page = $page .  "<td align='center'>{$currency_char}<input type='text' name='flight_cost' size='8' maxlength='9' value='{$flight_cost}'></td>";
    958             $page = $page .  "<td align='center'>{$currency_char}<input type='text' name='hotel_charges' size='8' maxlength='9' value='{$hotel_charges}'></td>";
    959             $page = $page .  "<td align='center'>{$currency_char}<input type='text' name='rental_car_charges' size='8' maxlength='9' value='{$rental_car_charges}'></td>";
    960             $page = $page . "<td align='center'>{$currency_char}<input type='text' name='taxi' size='8' maxlength='9' value='{$taxi}'></td>";
    961             $page = $page .  "<td align='center'>{$currency_char}<input type='text' name='tolls' size='8' maxlength='9'  value='{$tolls}'></td>";
    962             $page = $page .  "<td align='center'><input type='text' name='mileage' size='8' maxlength='9' value='{$mileage}'></td>";
    963             $page = $page .  "<td align='center'>{$currency_char}<input type='text' name='other_expenses' size='8' maxlength='9' value='{$other_expenses}'></td></tr>";
     957            $page = $page .  "<td align='center'>{$currency_char}<input type='number' name='flight_cost' min='0' style='width: 5em' value='{$flight_cost}'></td>";
     958            $page = $page .  "<td align='center'>{$currency_char}<input type='number' name='hotel_charges'  min='0' style='width: 5em' value='{$hotel_charges}'></td>";
     959            $page = $page .  "<td align='center'>{$currency_char}<input type='number' name='rental_car_charges'  min='0' style='width: 5em' value='{$rental_car_charges}'></td>";
     960            $page = $page . "<td align='center'>{$currency_char}<input type='number' name='taxi'  min='0' style='width: 5em' value='{$taxi}'></td>";
     961            $page = $page .  "<td align='center'>{$currency_char}<input type='number' name='tolls'  min='0' style='width: 5em'  value='{$tolls}'></td>";
     962            $page = $page .  "<td align='center'><input type='number' name='mileage'  min='0' style='width: 5em' value='{$mileage}'></td>";
     963            $page = $page .  "<td align='center'>{$currency_char}<input type='number' name='other_expenses'  min='0' style='width: 5em' value='{$other_expenses}'></td></tr>";
    964964            $page = $page .  "<tr><td valign='top'>Other Expense Notes:</td><td colspan='8'><textarea name='other_expenses_notes' cols='70' rows='8'>{$common->esc_textarea($other_expenses_notes)}</textarea></td></tr></table>";
    965965        }
     
    980980
    981981        //Recuring Timesheet
    982         if (isset($options['allow_recurring_timesheets']) && $timesheet_id_int==0) {
    983             $page = $page . "<tr><td>Make this a recurring timesheet?</td><td><input type='checkbox' name='is_template' value='1' onclick='switchRecuringFields()'></td></tr>";
     982        if (isset($options['allow_recurring_timesheets']) && ($is_template==true || $timesheet_id_int==0)) {
     983            $page = $page . "<tr><td>Make this a recurring timesheet?</td><td><input type='checkbox' name='is_template' value='1' onclick='switchRecuringFields()'" . (($is_template == true)?" disabled checked":"") . "></td></tr>";
    984984            $page = $page . "<tr><td colspan='2'>
    985985                    <table>
     
    990990                            <td>
    991991                            <select name='interval' disabled>
    992                             <option value='w'>Weekly</option>
    993                             <option value='m'>Monthly</option>
    994                             <option value='q'>Quarterly</option>
    995                             <option value='a'>Annualy</option>
     992                            <option value='w'{$common->is_match('w', (($timesheet_id_int==0)?'':$timesheet->frequency), ' selected')}>Weekly</option>
     993                            <option value='m'{$common->is_match('m', (($timesheet_id_int==0)?'':$timesheet->frequency), ' selected')}>Monthly</option>
     994                            <option value='q'{$common->is_match('q', (($timesheet_id_int==0)?'':$timesheet->frequency), ' selected')}>Quarterly</option>
     995                            <option value='a'{$common->is_match('a', (($timesheet_id_int==0)?'':$timesheet->frequency), ' selected')}>Annualy</option>
    996996                            </select>
    997997                            </td>
     
    10021002                            </td>
    10031003                            <td>
    1004                                 <input type='date' name='next_execution' disabled>
     1004                                <input type='date' name='next_execution' value='" . (($timesheet_id_int==0)?'':date("Y-m-d", strtotime($timesheet->next_execution))) . "' disabled>
    10051005                            </td>
    10061006                        </tr>
     
    10111011                            </td>
    10121012                            <td>
    1013                                 <input type='date' name='expires' disabled> (optional)
     1013                                <input type='date' name='expires' value='" . (($timesheet_id_int==0)?'':date("Y-m-d", strtotime($timesheet->expires_on))) . "' disabled> (optional)
    10141014                            </td>
    10151015                        </tr>
    10161016                        <tr>
    10171017                            <td colspan='2'>
    1018                                 <input type='checkbox' name='delete_after_expiration' value='1' disabled> Delete template after expiration?
     1018                                <input type='checkbox' name='delete_after_expiration' value='1' disabled ". ((($timesheet_id_int==0)?'':$timesheet->delete_after_expiration==1)?'checked':'')  . "> Delete template after expiration?
    10191019                                <input type='hidden' name='template' value=''>
    10201020                            </td>
     
    10251025        $page = $page .  "</table>";
    10261026
    1027         if (!$is_template) {
     1027        //if (!$is_template) {
    10281028            if ($timesheet_id_int==0 || $timesheet->week_complete=='0') {
    10291029                if (isset($timesheet->user_id)) {
     
    10351035                }
    10361036            }
    1037         }
     1037        //}
    10381038
    10391039        $page = $page .  "<input type='hidden' name='action' value='save'>";
    10401040        if ($timesheet_id != "") {
    10411041            $page = $page .  "<input type='hidden' name='timesheet_id' value='{$timesheet_id}'>";
     1042            if ($is_template == true) {
     1043                $page = $page .  "<input type='hidden' name='template_id' value='{$timesheet_id}'>";
     1044            }
    10421045        }
    10431046        $page = $page .  "<input type='hidden' name='may_embargo' value='0'>";
     
    12491252    }
    12501253$page = $page .  "
     1254switchRecuringFields()
    12511255</script>";
    12521256
     
    13321336        $ot_multiplier = isset($options['ot_multiplier']) ? floatval($options['ot_multiplier']) : 1;
    13331337       
    1334         if (!isset($_POST['is_template'])) {
     1338        if ((!isset($_POST['is_template']) && !isset($_POST['template_id']))) {
    13351339            $table_name = "timesheet";
    13361340            $archive_name = "timesheet_archive";
     
    16061610            }
    16071611           
    1608             #Archive the change
    1609             $common->archive_records ($table_name, $archive_name, 'timesheet_id', intval($_POST['timesheet_id']));
    16101612           
    16111613       
     
    16721674            #$this->check_overages($timesheet_id, 1);
    16731675
    1674             if (isset($_POST['is_template'])) {
    1675                 if (isset($_POST['interval'])) {
    1676                     if ($_POST['interval'] = 'w') {
    1677                         $interval = 'w';
    1678                     }
     1676       
     1677           
     1678            if ($week_complete==1 && !isset($_POST['is_template'])) {
     1679                $sql = "update {$wpdb->prefix}timesheet
     1680                set marked_complete_by=$user_id,
     1681                    marked_complete_date = CURDATE()
     1682                where timesheet_id=$timesheet_id";
     1683
     1684                if (isset($options['allow_recurring_timesheets'])) {
     1685                    $this->update_retainer_usage($timesheet_id);
    16791686                }
    16801687               
    1681                 if (isset($_POST['delete_after_expiration'])) {
    1682                     $delete_after_expiration = 1;
    1683                 } else {
    1684                     $delete_after_expiration = 0;
    1685                 }
     1688                $db->query($sql);
     1689                if ($EmbargoPendingProjectClose==0) {
     1690                    $this->email_on_submission($timesheet_id);
     1691                }
     1692
     1693                $sql = "update {$wpdb->prefix}timesheet_client_projects
     1694                    set HoursUsed=HoursUsed+$total_hours
     1695                    where ProjectId=%d";
     1696                $params=array(intval($_POST['ProjectId']));
     1697
     1698                $db->query($sql, $params);
    16861699               
    1687                 $sql = "update {$wpdb->prefix}{$table_name}
     1700                $this->set_project_inactive_on_date(intval($_POST['ProjectId']));
     1701            }
     1702
     1703           
     1704           
     1705            echo "<div class='notice notice-success is-dismissible'><p>" .  ((isset($_POST['is_template']) || isset($_POST['template_id']) )?'Template':'Timesheet') . " saved.</p></div>";
     1706
     1707        }
     1708       
     1709        if (isset($_POST['is_template']) || isset($_POST['template_id']) ) { //If this is a template
     1710            if (isset($_POST['interval'])) {
     1711                if ($_POST['interval'] == 'w') {
     1712                    $interval = 'w';
     1713                } elseif ($_POST['interval'] == 'm') {
     1714                    $interval = 'm';
     1715                } elseif ($_POST['interval'] == 'q') {
     1716                    $interval = 'q';
     1717                } elseif ($_POST['interval'] == 'a') {
     1718                    $interval = 'a';
     1719                }
     1720            }
     1721
     1722            if (isset($_POST['delete_after_expiration'])) {
     1723                $delete_after_expiration = 1;
     1724            } else {
     1725                $delete_after_expiration = 0;
     1726            }
     1727
     1728            $sql = "update {$wpdb->prefix}{$table_name}
    16881729                            set frequency = %s,
    16891730                                next_execution = %s,
     
    16911732                                delete_after_expiration = %d
    16921733                        where timesheet_id = %d";
    1693                
    1694                 $params = array($interval, $_POST['next_execution'], $_POST['expires'], $delete_after_expiration, $timesheet_id);
    1695                
    1696                 $db->query($sql, $params);
    1697             }
    1698            
    1699             if ($week_complete==1 && !isset($_POST['is_template'])) {
    1700                 $sql = "update {$wpdb->prefix}timesheet
    1701                 set marked_complete_by=$user_id,
    1702                     marked_complete_date = CURDATE()
    1703                 where timesheet_id=$timesheet_id";
    1704 
    1705                 if (isset($options['allow_recurring_timesheets'])) {
    1706                     $this->update_retainer_usage($timesheet_id);
    1707                 }
    1708                
    1709                 $db->query($sql);
    1710                 if ($EmbargoPendingProjectClose==0) {
    1711                     $this->email_on_submission($timesheet_id);
    1712                 }
    1713 
    1714                 $sql = "update {$wpdb->prefix}timesheet_client_projects
    1715                     set HoursUsed=HoursUsed+$total_hours
    1716                     where ProjectId=%d";
    1717                 $params=array(intval($_POST['ProjectId']));
    1718 
    1719                 $db->query($sql, $params);
    1720                
    1721                 $this->set_project_inactive_on_date(intval($_POST['ProjectId']));
    1722             }
    1723 
    1724             //Archive the change
     1734
     1735            $params = array($interval, $_POST['next_execution'], $_POST['expires'], $delete_after_expiration, $timesheet_id);
     1736
     1737            $db->query($sql, $params);
     1738        }
     1739       
     1740        #Archive the change
     1741        if (isset($_POST['timesheet_id'])) { //UPDATE
     1742            $common->archive_records ($table_name, $archive_name, 'timesheet_id', intval($_POST['timesheet_id']));
     1743        } else { //INSERT
    17251744            $common->archive_records ($table_name, $archive_name, 'timesheet_id', intval($timesheet_id), '=', 'INSERT');
    1726                
    1727            
    1728             echo '<div class="notice notice-success is-dismissible"><p>Timesheet saved.</p></div>';
    1729 
    17301745        }
    17311746
  • time-sheets/trunk/manage-projects.php

    r3105849 r3151570  
    536536                <tr>
    537537                    <td>Retainer Hours</td>
    538                     <td><input type='text'  id='hours_included'  name='hours_included' size='5' value='{$hours_included}'></td>";
     538                    <td><input type='number'  id='hours_included'  name='hours_included'  'min='0' style='width: 5em' value='{$hours_included}'></td>";
    539539            if (isset($options['allow_money_based_retainers'])) {
    540                 echo "<td>Max Project Frequency Budget</td><td>{$options['currency_char']}<input type='text' name='max_monthly_budget' size='5' value='{$max_monthly_budget}'> <div id='project_override'>test</div></td>";
     540                echo "<td>Max Project Frequency Budget</td><td>{$options['currency_char']}<input type='number' name='max_monthly_budget'  'min='0' style='width: 5em' value='{$max_monthly_budget}'> <div id='project_override'>test</div></td>";
    541541               
    542542                $sql = "select e.* from {$wpdb->prefix}timesheet_employee_titles e
     
    548548            }
    549549            echo "</tr>
    550             <tr><td rowspan='{$valign}' valign='top'>Retainer Rate</td><td rowspan='{$valign}' valign='top'><input type='text' id='hourly_rate' name='hourly_rate' size='5'  value='{$hourly_rate}'></td>";
     550            <tr><td rowspan='{$valign}' valign='top'>Retainer Rate</td><td rowspan='{$valign}' valign='top'><input type='number' id='hourly_rate' name='hourly_rate'  'min='0' style='width: 5em'  value='{$hourly_rate}'></td>";
    551551            if (isset($options['allow_money_based_retainers'])) {
    552552                if ($titles) {
    553553                    foreach ($titles as $title) {
    554                         echo "<tr><td>Rate for {$title->name}:</td><td>{$options['currency_char']}<input type='text' size='5' name='title_{$title->title_id}' value=''></td></tr>";
     554                        echo "<tr><td>Rate for {$title->name}:</td><td>{$options['currency_char']}<input type='number'  'min='0' style='width: 5em' name='title_{$title->title_id}' value=''></td></tr>";
    555555                    }
    556556                }
    557557            }
    558             echo "</table><tr><td>Max Project Hours:</td><td><input type='text' name='MaxHours' size='5' value='{$MaxHours}'></td></tr>
     558            echo "</table><tr><td>Max Project Hours:</td><td><input type='number' name='MaxHours'  'min='0' style='width: 5em' value='{$MaxHours}'></td></tr>
    559559            <tr><td colspan='2'>Active / Visable <input type='checkbox' name='Active' value='1'{$Active}></td></tr>";
    560560            if (!isset($options['remove_embargo'])) {
     
    845845                <tr>
    846846                    <td>Retainer Hours</td>
    847                     <td><input type='text'  id='hours_included'  name='hours_included' size='5' value='{$hours_included}'></td>";
     847                    <td><input type='number'  id='hours_included'  name='hours_included''min='0' style='width: 5em' value='{$hours_included}'></td>";
    848848            if (isset($options['allow_money_based_retainers'])) {
    849                 echo "<td>Max Project Frequency Budget</td><td>{$options['currency_char']}<input type='text' name='max_monthly_budget' size='5' value='{$max_monthly_budget}'> <div id='project_override'></div></td>";
     849                echo "<td>Max Project Frequency Budget</td><td>{$options['currency_char']}<input type='number' name='max_monthly_budget' 'min='0' style='width: 5em' value='{$max_monthly_budget}'> <div id='project_override'></div></td>";
    850850               
    851851                $sql = "select e.*, p.hourly_rate from {$wpdb->prefix}timesheet_employee_titles e
     
    858858            }
    859859            echo "</tr>
    860             <tr><td rowspan='{$valign}' valign='top'>Retainer Rate</td><td rowspan='{$valign}' valign='top'><input type='text' id='hourly_rate' name='hourly_rate' size='5' value='{$hourly_rate}'></td>";
     860            <tr><td rowspan='{$valign}' valign='top'>Retainer Rate</td><td rowspan='{$valign}' valign='top'><input type='number' id='hourly_rate' name='hourly_rate' 'min='0' style='width: 5em' value='{$hourly_rate}'></td>";
    861861            if (isset($options['allow_money_based_retainers'])) {
    862862                if ($titles) {
    863863                    foreach ($titles as $title) {
    864                         echo "<tr><td>Rate for {$title->name}:</td><td>{$options['currency_char']}<input type='text' size='5' name='title_{$title->title_id}' value='{$title->hourly_rate}'></td></tr>";
     864                        echo "<tr><td>Rate for {$title->name}:</td><td>{$options['currency_char']}<input type='number' 'min='0' style='width: 5em' name='title_{$title->title_id}' value='{$title->hourly_rate}'></td></tr>";
    865865                    }
    866866                }
    867867            }
    868             echo "</table><tr><td>Max Project Hours:</td><td><input type='text'  id='MaxHours' name='MaxHours' size='5' value='{$project->MaxHours}'></td></tr>
     868            echo "</table><tr><td>Max Project Hours:</td><td><input type='number'  id='MaxHours' name='MaxHours' 'min='0' style='width: 5em' value='{$project->MaxHours}'></td></tr>
    869869            <tr><td>Hours Used:</td><td><a href='admin.php?page=timesheet_manage_clients&menu=view_timesheets_for_project&ProjectId={$common->intval($_GET['ProjectId'])}'>{$hoursused}</a></td></tr>
    870870            <tr><td>Hours Remaining:</td><td>{$hoursleft}</td></tr>
  • time-sheets/trunk/readme.txt

    r3130722 r3151570  
    1 === Time Sheets ===
     1=== Time Sheets ===
    22Contributors: mrdenny
    33Donate Link: https://www.dcac.com/go/time-sheets
    44Tags: ticketing system, time sheets, business management, consulting, workflow, invoicing, payroll, time tracking
    55Requires at least: 4.7.0
    6 Tested up to: 6.6.1
     6Tested up to: 6.6.2
    77Stable tag: trunk
    88License: GPLv2 or later
     
    5858
    5959= When do retainer reminders get sent out? =
    60 They are sent out on the last day of the month.
     60They are sent out on the last day of the month. (This is based on the time settings of your web server.)
    6161
    6262= When do reminders for late time sheets get sent out? =
    63 They are sent out on Monday mornings.
     63They are sent out on Monday mornings. (This is based on the time settings of your web server.)
    6464
    6565= What is a work week defined as? =
     
    8282
    8383= How many clients does the system support? =
    84 As many as you need.
     84As many as you need. Your limits are the numbers of rows supported in the database, and the amount of disk space which the database server has.
    8585
    8686= How many employees does the system support? =
    87 As many users as WordPress supports in the system.
     87As many users as WordPress supports in the system. Your limits are the numbers of rows supported in the database, and the amount of disk space which the database server has.
    8888
    8989= Where are the settings located? =
     
    9494
    9595= I have multiple web servers, but I only want to run the email jobs on one, can I? =
    96 Yes you can. Add the code "define( 'TIMESHEETS_SKIP_CRON', false );" to your wp-config.php. This will stop that web server from processing the email messages. Just make sure that you do not put this setting on every web server otherwise you won't get the messages on any server.
     96Yes you can. Add the code "define( 'TIMESHEETS_SKIP_CRON', false );" to your wp-config.php. This will stop that web server from processing the email messages and just about anything else that's scheduled through cron. Just make sure that you do not put this setting on every web server otherwise all the cron tasks won't run.
    9797
    9898== Screenshots ==
     
    115115
    116116== Changelog ==
     117= 2.1.2 =
     118* Changing numeric fields to numeric data type so the user can't enter text
     119* Calling the archive function from the email_retainers_due function instead of manually archiving
     120* Allows for updating of templates
     121* Adjusting the order of operations when saving a timesheet / template
     122* Updated the save message to account for saving a template vs timesheet
     123* Updated FAQ
     124
    117125= 2.1.1 =
    118126* Correct and made consistant the logic around the notes and expeses fields in settings
  • time-sheets/trunk/time-sheets.php

    r3130722 r3151570  
    22/*
    33Plugin Name: Time Sheets
    4 Version: 2.1.1
     4Version: 2.1.2
    55Plugin URI: https://www.dcac.com/go/time-sheets
    66Description: Time Sheets application
Note: See TracChangeset for help on using the changeset viewer.