Proposal #1322 » dynamic-time-sum.diff
app/views/work_time/_user_day_table.html.erb Tue Mar 04 12:41:29 2014 +0900 → app/views/work_time/_user_day_table.html.erb Wed Apr 23 17:03:18 2014 +0200 | ||
---|---|---|
</div>
|
||
</td>
|
||
<td>
|
||
<%= text_field_tag("new_time_entry["+issue_id.to_s+"][0][hours]", "", :size=>5) %>
|
||
<%= text_field_tag("new_time_entry["+issue_id.to_s+"][0][hours]", "", :size=>5, :onchange => "sumDayTimes()") %>
|
||
</td>
|
||
<% if @is_registerd_backlog then %>
|
||
<td>
|
||
... | ... | |
</div>
|
||
</td>
|
||
<td>
|
||
<%= text_field_tag("time_entry["+hour_id.to_s+"][hours]", hour.hours, :size=>5) %>
|
||
<%= text_field_tag("time_entry["+hour_id.to_s+"][hours]", hour.hours, :size=>5, :onchange => "sumDayTimes()") %>
|
||
</td>
|
||
<% if @is_registerd_backlog then %>
|
||
<td>
|
||
... | ... | |
<% end %>
|
||
<tr align="center" id="time_input_table_bottom" style="background:#ddd;">
|
||
<td> </td>
|
||
<td><%=sprintf("%1.1f", @day_pack[:total])%></td>
|
||
<td><span id='currentTotal'><%=sprintf("%1.1f", @day_pack[:total])%></span></td>
|
||
<% if @is_registerd_backlog then %>
|
||
<td> </td>
|
||
<% end %>
|
||
... | ... | |
<% end %>
|
||
</tr>
|
||
</table>
|
||
|
||
<SCRIPT LANGUAGE="JAVASCRIPT">
|
||
<!--
|
||
function sumDayTimes() {
|
||
var total=0;
|
||
var dayInputs;
|
||
|
||
// List all Input elemnets of the page
|
||
dayInputs = document.getElementsByTagName("input");
|
||
for (var i=0; i<dayInputs.length; i++) {
|
||
// Consider only those with an id containing the strings 'time_entry' and 'hours'
|
||
if ((dayInputs[i].id.indexOf("time_entry") >= 0) && (dayInputs[i].id.indexOf("hours") >= 0)) {
|
||
if (dayInputs[i].value && !isNaN(parseFloat(dayInputs[i].value))) {
|
||
// add the number to the total if it is a valid number
|
||
total = total + parseFloat(dayInputs[i].value);
|
||
}
|
||
}
|
||
}
|
||
// Set the total value to the new number, changing the style to indicate
|
||
// it is not saved, and adding the saved value as a flyover indication
|
||
var originalValue;
|
||
if (!document.getElementById("currentTotal").title) {
|
||
originalValue = document.getElementById("currentTotal").innerHTML;
|
||
document.getElementById("currentTotal").title = '<%=l(:wt_saved_value)%>' + originalValue;
|
||
}
|
||
document.getElementById("currentTotal").innerHTML = total;
|
||
document.getElementById("currentTotal").style = 'color:#FF0000;';
|
||
return true;
|
||
}
|
||
//-->
|
||
</SCRIPT>
|
||
|
config/locales/en.yml Tue Mar 04 12:41:29 2014 +0900 → config/locales/en.yml Wed Apr 23 17:03:18 2014 +0200 | ||
---|---|---|
wt_opt_disp_ticket_with_other_member: "[display other members ticket]"
|
||
wt_opt_disp_ticket_mine_only: "[display my ticket only]"
|
||
wt_bulkupdate_relations: "bulkupdate to parent"
|
||
permission_edit_work_time_total: "Edit work time totals"
|
||
permission_view_work_time_tab: "View Work time tab"
|
||
permission_view_work_time_other_member: "View other members' work time"
|
||
permission_edit_work_time_other_member: "Edit other members' work time "
|
||
wt_saved_value: "Saved timed: "
|
config/locales/fr.yml Tue Mar 04 12:41:29 2014 +0900 → config/locales/fr.yml Wed Apr 23 17:03:18 2014 +0200 | ||
---|---|---|
fr:
|
||
work_time: "Temps de travail"
|
||
wt_update: "Mise à jour"
|
||
wt_month_names: "Jan,Fev,Mar,Avr,Mai,Juin,Juil,Aout,Sep,Oct,Nov,Dec"
|
||
wt_update: "Mettre à jour"
|
||
wt_month_names: "Jan,Fév,Mar,Avr,Mai,Juin,Juil,Août,Sep,Oct,Nov,Déc"
|
||
wt_week_day_names: "Dim,Lun,Mar,Mer,Jeu,Ven,Sam"
|
||
wt_monthly_report: "Rapport mensuel"
|
||
wt_daily_report: "Rapport journalier"
|
||
wt_each_member_report: "Rapport utilisateur"
|
||
wt_raw_total: "Rapport mensuel(not relayed)"
|
||
wt_relay_total: "Rapport mensuel (relayed)"
|
||
wt_raw_total: "Rapport mensuel(non relayé)"
|
||
wt_relay_total: "Rapport mensuel (relayé)"
|
||
wt_edit_relay: "Ticket Relay Editor"
|
||
wt_ticket: "Demande"
|
||
wt_add_ticket: "Ajouter une demande"
|
||
wt_no_permission: "Vous n'avez pas les droits"
|
||
wt_loop_relay: "Ticket relation looped"
|
||
wt_set_holiday: "Placer cette date en vacances"
|
||
wt_del_holiday: "Retirer cette date de vacances"
|
||
wt_loop_relay: "Boucle infinie sur une demande"
|
||
wt_set_holiday: "Placer cette date en jour férié"
|
||
wt_del_holiday: "Retirer cette date des jours fériés"
|
||
wt_apply_checked: "Appliquer pour toutes les cases cochées"
|
||
wt_select_project: "Restreint un projet"
|
||
wt_select_project: "Restreindre à un projet"
|
||
wt_select_user: "Choisir un utilisateur"
|
||
wt_edit_memo: "Editer la note"
|
||
wt_edit_memo: "Éditer la note"
|
||
wt_pre_memo: "Note précédente"
|
||
wt_next_memo: "Note suivante"
|
||
wt_data_list: "Liste brute"
|
||
wt_input_ticket_numbers: "ou entrez le numéro de la demande"
|
||
wt_delete_closed_tickets: "Supprimer les demandes fermées"
|
||
wt_data_download: "les données téléchargent"
|
||
wt_opt_disp_ticket_with_closed: "[display closed ticket]"
|
||
wt_opt_disp_ticket_opened_only: "[display opened ticket only]"
|
||
wt_opt_disp_ticket_with_other_member: "[display other members ticket]"
|
||
wt_opt_disp_ticket_mine_only: "[display my ticket only]"
|
||
wt_bulkupdate_relations: "bulkupdate to parent"
|
||
wt_data_download: "Téléchargement des données"
|
||
wt_opt_disp_ticket_with_closed: "[afficher les demandes fermés]"
|
||
wt_opt_disp_ticket_opened_only: "[n'afficher que les demandes ouvertes]"
|
||
wt_opt_disp_ticket_with_other_member: "[afficher les demandes des autres membres]"
|
||
wt_opt_disp_ticket_mine_only: "[n'afficher que mes demandes]"
|
||
wt_bulkupdate_relations: "mise à jour en bloc du parent"
|
||
permission_edit_work_time_total: "Modifier les totaux de temps de travail"
|
||
permission_view_work_time_tab: "Afficher l'onglet Temps de travail"
|
||
permission_view_work_time_other_member: "Afficher les temps des autres membres"
|
||
permission_edit_work_time_other_member: "Modifier les temps des autres membres"
|
||
wt_saved_value: "Temps sauvegardé : "
|